60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
/**
|
|
* ManzanaService - Gestión de manzanas (bloques)
|
|
*
|
|
* CRUD de manzanas con soporte multi-tenant.
|
|
*
|
|
* @module Construction
|
|
*/
|
|
import { Repository } from 'typeorm';
|
|
import { Manzana } from '../entities/manzana.entity';
|
|
export interface CreateManzanaDto {
|
|
etapaId: string;
|
|
code: string;
|
|
name?: string;
|
|
totalLots?: number;
|
|
}
|
|
export interface UpdateManzanaDto extends Partial<CreateManzanaDto> {
|
|
}
|
|
export interface ManzanaListOptions {
|
|
tenantId: string;
|
|
etapaId?: string;
|
|
page?: number;
|
|
limit?: number;
|
|
search?: string;
|
|
}
|
|
export declare class ManzanaService {
|
|
private readonly repository;
|
|
constructor(repository: Repository<Manzana>);
|
|
/**
|
|
* Listar manzanas
|
|
*/
|
|
findAll(options: ManzanaListOptions): Promise<{
|
|
items: Manzana[];
|
|
total: number;
|
|
}>;
|
|
/**
|
|
* Obtener manzana por ID
|
|
*/
|
|
findById(id: string, tenantId: string): Promise<Manzana | null>;
|
|
/**
|
|
* Obtener manzana por código dentro de una etapa
|
|
*/
|
|
findByCode(code: string, etapaId: string, tenantId: string): Promise<Manzana | null>;
|
|
/**
|
|
* Crear manzana
|
|
*/
|
|
create(tenantId: string, dto: CreateManzanaDto, createdBy?: string): Promise<Manzana>;
|
|
/**
|
|
* Actualizar manzana
|
|
*/
|
|
update(id: string, tenantId: string, dto: UpdateManzanaDto, updatedBy?: string): Promise<Manzana>;
|
|
/**
|
|
* Eliminar manzana (soft delete)
|
|
*/
|
|
delete(id: string, tenantId: string, _deletedBy?: string): Promise<void>;
|
|
/**
|
|
* Obtener manzanas por etapa
|
|
*/
|
|
findByEtapa(etapaId: string, tenantId: string): Promise<Manzana[]>;
|
|
}
|
|
//# sourceMappingURL=manzana.service.d.ts.map
|