47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
/**
|
|
* CapacitacionService - Servicio para catálogo de capacitaciones HSE
|
|
*
|
|
* Gestión de capacitaciones con CRUD y filtros.
|
|
*
|
|
* @module HSE
|
|
*/
|
|
import { Repository } from 'typeorm';
|
|
import { Capacitacion, TipoCapacitacion } from '../entities/capacitacion.entity';
|
|
import { ServiceContext, PaginatedResult } from '../../../shared/services/base.service';
|
|
export interface CreateCapacitacionDto {
|
|
codigo: string;
|
|
nombre: string;
|
|
descripcion?: string;
|
|
tipo: TipoCapacitacion;
|
|
duracionHoras?: number;
|
|
vigenciaMeses?: number;
|
|
requiereEvaluacion?: boolean;
|
|
calificacionMinima?: number;
|
|
}
|
|
export interface UpdateCapacitacionDto {
|
|
nombre?: string;
|
|
descripcion?: string;
|
|
tipo?: TipoCapacitacion;
|
|
duracionHoras?: number;
|
|
vigenciaMeses?: number;
|
|
requiereEvaluacion?: boolean;
|
|
calificacionMinima?: number;
|
|
activo?: boolean;
|
|
}
|
|
export interface CapacitacionFilters {
|
|
tipo?: TipoCapacitacion;
|
|
activo?: boolean;
|
|
search?: string;
|
|
}
|
|
export declare class CapacitacionService {
|
|
private readonly repository;
|
|
constructor(repository: Repository<Capacitacion>);
|
|
findAll(ctx: ServiceContext, filters?: CapacitacionFilters, page?: number, limit?: number): Promise<PaginatedResult<Capacitacion>>;
|
|
findById(ctx: ServiceContext, id: string): Promise<Capacitacion | null>;
|
|
findByCodigo(ctx: ServiceContext, codigo: string): Promise<Capacitacion | null>;
|
|
create(ctx: ServiceContext, dto: CreateCapacitacionDto): Promise<Capacitacion>;
|
|
update(ctx: ServiceContext, id: string, dto: UpdateCapacitacionDto): Promise<Capacitacion | null>;
|
|
toggleActive(ctx: ServiceContext, id: string): Promise<Capacitacion | null>;
|
|
getByTipo(ctx: ServiceContext, tipo: TipoCapacitacion): Promise<Capacitacion[]>;
|
|
}
|
|
//# sourceMappingURL=capacitacion.service.d.ts.map
|