erp-construccion-backend/dist/modules/construction/services/etapa.service.d.ts

67 lines
1.8 KiB
TypeScript

/**
* EtapaService - Gestión de etapas de fraccionamientos
*
* CRUD de etapas con soporte multi-tenant.
*
* @module Construction
*/
import { Repository } from 'typeorm';
import { Etapa } from '../entities/etapa.entity';
export interface CreateEtapaDto {
fraccionamientoId: string;
code: string;
name: string;
description?: string;
sequence?: number;
totalLots?: number;
status?: string;
startDate?: Date;
expectedEndDate?: Date;
}
export interface UpdateEtapaDto extends Partial<CreateEtapaDto> {
actualEndDate?: Date;
}
export interface EtapaListOptions {
tenantId: string;
fraccionamientoId?: string;
page?: number;
limit?: number;
search?: string;
status?: string;
}
export declare class EtapaService {
private readonly repository;
constructor(repository: Repository<Etapa>);
/**
* Listar etapas
*/
findAll(options: EtapaListOptions): Promise<{
items: Etapa[];
total: number;
}>;
/**
* Obtener etapa por ID
*/
findById(id: string, tenantId: string): Promise<Etapa | null>;
/**
* Obtener etapa por código dentro de un fraccionamiento
*/
findByCode(code: string, fraccionamientoId: string, tenantId: string): Promise<Etapa | null>;
/**
* Crear etapa
*/
create(tenantId: string, dto: CreateEtapaDto, createdBy?: string): Promise<Etapa>;
/**
* Actualizar etapa
*/
update(id: string, tenantId: string, dto: UpdateEtapaDto, updatedBy?: string): Promise<Etapa>;
/**
* Eliminar etapa (soft delete)
*/
delete(id: string, tenantId: string, _deletedBy?: string): Promise<void>;
/**
* Obtener etapas por fraccionamiento
*/
findByFraccionamiento(fraccionamientoId: string, tenantId: string): Promise<Etapa[]>;
}
//# sourceMappingURL=etapa.service.d.ts.map