HEFESTO v1.0 - Sistema de Controle Orçamentário para Facilities
- Backend NestJS com 12 módulos - Frontend React com dashboard e gestão - Manuais técnico e de negócios (MD + PDF) - Workflow de aprovação com alçadas - RBAC com 6 perfis de acesso
This commit is contained in:
14
backend/src/modules/centros-custo/centros-custo.service.ts
Normal file
14
backend/src/modules/centros-custo/centros-custo.service.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { CentroCusto } from './entities/centro-custo.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CentrosCustoService {
|
||||
constructor(@InjectRepository(CentroCusto) private repo: Repository<CentroCusto>) {}
|
||||
findAll() { return this.repo.find({ where: { ativo: true } }); }
|
||||
findOne(id: string) { return this.repo.findOne({ where: { id } }); }
|
||||
create(data: Partial<CentroCusto>) { return this.repo.save(data); }
|
||||
async update(id: string, data: Partial<CentroCusto>) { await this.repo.update(id, data); return this.findOne(id); }
|
||||
async remove(id: string) { await this.repo.update(id, { ativo: false }); }
|
||||
}
|
||||
Reference in New Issue
Block a user