erp-construccion-backend/dist/modules/progress/services/avance-obra.service.d.ts

91 lines
2.9 KiB
TypeScript

/**
* AvanceObraService - Gestión de Avances de Obra
*
* Gestiona el registro y aprobación de avances físicos de obra.
* Incluye workflow de captura -> revisión -> aprobación.
*
* @module Progress
*/
import { Repository } from 'typeorm';
import { BaseService, ServiceContext, PaginatedResult } from '../../../shared/services/base.service';
import { AvanceObra, AdvanceStatus } from '../entities/avance-obra.entity';
import { FotoAvance } from '../entities/foto-avance.entity';
export interface CreateAvanceDto {
loteId?: string;
departamentoId?: string;
conceptoId: string;
captureDate: Date;
quantityExecuted: number;
percentageExecuted?: number;
notes?: string;
}
export interface AddFotoDto {
fileUrl: string;
fileName?: string;
fileSize?: number;
mimeType?: string;
description?: string;
location?: {
lat: number;
lng: number;
};
}
export interface AvanceFilters {
loteId?: string;
departamentoId?: string;
conceptoId?: string;
status?: AdvanceStatus;
dateFrom?: Date;
dateTo?: Date;
}
export declare class AvanceObraService extends BaseService<AvanceObra> {
private readonly fotoRepository;
constructor(repository: Repository<AvanceObra>, fotoRepository: Repository<FotoAvance>);
/**
* Crear nuevo avance (captura)
*/
createAvance(ctx: ServiceContext, data: CreateAvanceDto): Promise<AvanceObra>;
/**
* Obtener avances por lote
*/
findByLote(ctx: ServiceContext, loteId: string, page?: number, limit?: number): Promise<PaginatedResult<AvanceObra>>;
/**
* Obtener avances por departamento
*/
findByDepartamento(ctx: ServiceContext, departamentoId: string, page?: number, limit?: number): Promise<PaginatedResult<AvanceObra>>;
/**
* Obtener avances con filtros
*/
findWithFilters(ctx: ServiceContext, filters: AvanceFilters, page?: number, limit?: number): Promise<PaginatedResult<AvanceObra>>;
/**
* Obtener avance con fotos
*/
findWithFotos(ctx: ServiceContext, id: string): Promise<AvanceObra | null>;
/**
* Agregar foto al avance
*/
addFoto(ctx: ServiceContext, avanceId: string, data: AddFotoDto): Promise<FotoAvance>;
/**
* Revisar avance
*/
review(ctx: ServiceContext, avanceId: string): Promise<AvanceObra | null>;
/**
* Aprobar avance
*/
approve(ctx: ServiceContext, avanceId: string): Promise<AvanceObra | null>;
/**
* Rechazar avance
*/
reject(ctx: ServiceContext, avanceId: string, reason: string): Promise<AvanceObra | null>;
/**
* Calcular avance acumulado por concepto
*/
getAccumulatedProgress(ctx: ServiceContext, loteId?: string, departamentoId?: string): Promise<ConceptProgress[]>;
}
interface ConceptProgress {
conceptoId: string;
totalQuantity: number;
avgPercentage: number;
}
export {};
//# sourceMappingURL=avance-obra.service.d.ts.map