74 lines
2.4 KiB
TypeScript
74 lines
2.4 KiB
TypeScript
/**
|
|
* BitacoraObraService - Bitácora de Obra
|
|
*
|
|
* Gestiona el registro diario de bitácora de obra.
|
|
* Genera automáticamente el número de entrada secuencial.
|
|
*
|
|
* @module Progress
|
|
*/
|
|
import { Repository } from 'typeorm';
|
|
import { BaseService, ServiceContext, PaginatedResult } from '../../../shared/services/base.service';
|
|
import { BitacoraObra } from '../entities/bitacora-obra.entity';
|
|
export interface CreateBitacoraDto {
|
|
fraccionamientoId: string;
|
|
entryDate: Date;
|
|
weather?: string;
|
|
temperatureMax?: number;
|
|
temperatureMin?: number;
|
|
workersCount?: number;
|
|
description: string;
|
|
observations?: string;
|
|
incidents?: string;
|
|
}
|
|
export interface UpdateBitacoraDto {
|
|
weather?: string;
|
|
temperatureMax?: number;
|
|
temperatureMin?: number;
|
|
workersCount?: number;
|
|
description?: string;
|
|
observations?: string;
|
|
incidents?: string;
|
|
}
|
|
export interface BitacoraFilters {
|
|
dateFrom?: Date;
|
|
dateTo?: Date;
|
|
hasIncidents?: boolean;
|
|
}
|
|
export declare class BitacoraObraService extends BaseService<BitacoraObra> {
|
|
constructor(repository: Repository<BitacoraObra>);
|
|
/**
|
|
* Crear nueva entrada de bitácora
|
|
*/
|
|
createEntry(ctx: ServiceContext, data: CreateBitacoraDto): Promise<BitacoraObra>;
|
|
/**
|
|
* Obtener siguiente número de entrada
|
|
*/
|
|
private getNextEntryNumber;
|
|
/**
|
|
* Obtener bitácora por fraccionamiento
|
|
*/
|
|
findByFraccionamiento(ctx: ServiceContext, fraccionamientoId: string, page?: number, limit?: number): Promise<PaginatedResult<BitacoraObra>>;
|
|
/**
|
|
* Obtener bitácora con filtros
|
|
*/
|
|
findWithFilters(ctx: ServiceContext, fraccionamientoId: string, filters: BitacoraFilters, page?: number, limit?: number): Promise<PaginatedResult<BitacoraObra>>;
|
|
/**
|
|
* Obtener entrada por fecha
|
|
*/
|
|
findByDate(ctx: ServiceContext, fraccionamientoId: string, date: Date): Promise<BitacoraObra | null>;
|
|
/**
|
|
* Obtener última entrada
|
|
*/
|
|
findLatest(ctx: ServiceContext, fraccionamientoId: string): Promise<BitacoraObra | null>;
|
|
/**
|
|
* Obtener estadísticas de bitácora
|
|
*/
|
|
getStats(ctx: ServiceContext, fraccionamientoId: string): Promise<BitacoraStats>;
|
|
}
|
|
interface BitacoraStats {
|
|
totalEntries: number;
|
|
entriesWithIncidents: number;
|
|
avgWorkersCount: number;
|
|
}
|
|
export {};
|
|
//# sourceMappingURL=bitacora-obra.service.d.ts.map
|