build: Fichiers de build générés - Ajout des fichiers TypeScript compilés et des déclarations de types
This commit is contained in:
215
dist/sites/sites.controller.d.ts
vendored
Normal file
215
dist/sites/sites.controller.d.ts
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
import { SitesService } from './sites.service';
|
||||
import { CreateSiteDto, UpdateSiteDto } from '../shared/dto/site.dto';
|
||||
export declare class SitesController {
|
||||
private readonly sitesService;
|
||||
constructor(sitesService: SitesService);
|
||||
create(createSiteDto: CreateSiteDto): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
machines: ({
|
||||
typeMachine: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
category: string | null;
|
||||
maintenanceFrequency: string | null;
|
||||
components: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
criticalParts: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
machinePieces: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
specifications: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
composants: ({
|
||||
typeComposant: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
sousComposants: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
machines: ({
|
||||
typeMachine: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
category: string | null;
|
||||
maintenanceFrequency: string | null;
|
||||
components: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
criticalParts: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
machinePieces: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
specifications: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
composants: ({
|
||||
typeComposant: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
sousComposants: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}) | null>;
|
||||
update(id: string, updateSiteDto: UpdateSiteDto): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
}
|
||||
80
dist/sites/sites.controller.js
vendored
Normal file
80
dist/sites/sites.controller.js
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SitesController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const sites_service_1 = require("./sites.service");
|
||||
const site_dto_1 = require("../shared/dto/site.dto");
|
||||
let SitesController = class SitesController {
|
||||
sitesService;
|
||||
constructor(sitesService) {
|
||||
this.sitesService = sitesService;
|
||||
}
|
||||
create(createSiteDto) {
|
||||
return this.sitesService.create(createSiteDto);
|
||||
}
|
||||
findAll() {
|
||||
return this.sitesService.findAll();
|
||||
}
|
||||
findOne(id) {
|
||||
return this.sitesService.findOne(id);
|
||||
}
|
||||
update(id, updateSiteDto) {
|
||||
return this.sitesService.update(id, updateSiteDto);
|
||||
}
|
||||
remove(id) {
|
||||
return this.sitesService.remove(id);
|
||||
}
|
||||
};
|
||||
exports.SitesController = SitesController;
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [site_dto_1.CreateSiteDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], SitesController.prototype, "create", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], SitesController.prototype, "findAll", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)(':id'),
|
||||
__param(0, (0, common_1.Param)('id')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], SitesController.prototype, "findOne", null);
|
||||
__decorate([
|
||||
(0, common_1.Patch)(':id'),
|
||||
__param(0, (0, common_1.Param)('id')),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, site_dto_1.UpdateSiteDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], SitesController.prototype, "update", null);
|
||||
__decorate([
|
||||
(0, common_1.Delete)(':id'),
|
||||
__param(0, (0, common_1.Param)('id')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], SitesController.prototype, "remove", null);
|
||||
exports.SitesController = SitesController = __decorate([
|
||||
(0, common_1.Controller)('sites'),
|
||||
__metadata("design:paramtypes", [sites_service_1.SitesService])
|
||||
], SitesController);
|
||||
//# sourceMappingURL=sites.controller.js.map
|
||||
1
dist/sites/sites.controller.js.map
vendored
Normal file
1
dist/sites/sites.controller.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sites.controller.js","sourceRoot":"","sources":["../../src/sites/sites.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,mDAA+C;AAC/C,qDAAsE;AAG/D,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAG3D,MAAM,CAAS,aAA4B;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAGD,OAAO;QACL,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC;IAGD,OAAO,CAAc,EAAU;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAGD,MAAM,CAAc,EAAU,EAAU,aAA4B;QAClE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IAGD,MAAM,CAAc,EAAU;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;CACF,CAAA;AA3BY,0CAAe;AAI1B;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAgB,wBAAa;;6CAE1C;AAGD;IADC,IAAA,YAAG,GAAE;;;;8CAGL;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;8CAEnB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAgB,wBAAa;;6CAEnE;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;6CAElB;0BA1BU,eAAe;IAD3B,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAEyB,4BAAY;GAD5C,eAAe,CA2B3B"}
|
||||
2
dist/sites/sites.module.d.ts
vendored
Normal file
2
dist/sites/sites.module.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare class SitesModule {
|
||||
}
|
||||
22
dist/sites/sites.module.js
vendored
Normal file
22
dist/sites/sites.module.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SitesModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const sites_controller_1 = require("./sites.controller");
|
||||
const sites_service_1 = require("./sites.service");
|
||||
let SitesModule = class SitesModule {
|
||||
};
|
||||
exports.SitesModule = SitesModule;
|
||||
exports.SitesModule = SitesModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
controllers: [sites_controller_1.SitesController],
|
||||
providers: [sites_service_1.SitesService]
|
||||
})
|
||||
], SitesModule);
|
||||
//# sourceMappingURL=sites.module.js.map
|
||||
1
dist/sites/sites.module.js.map
vendored
Normal file
1
dist/sites/sites.module.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sites.module.js","sourceRoot":"","sources":["../../src/sites/sites.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAAqD;AACrD,mDAA+C;AAMxC,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IAJvB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,SAAS,EAAE,CAAC,4BAAY,CAAC;KAC1B,CAAC;GACW,WAAW,CAAG"}
|
||||
215
dist/sites/sites.service.d.ts
vendored
Normal file
215
dist/sites/sites.service.d.ts
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { CreateSiteDto, UpdateSiteDto } from '../shared/dto/site.dto';
|
||||
export declare class SitesService {
|
||||
private prisma;
|
||||
constructor(prisma: PrismaService);
|
||||
create(createSiteDto: CreateSiteDto): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
machines: ({
|
||||
typeMachine: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
category: string | null;
|
||||
maintenanceFrequency: string | null;
|
||||
components: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
criticalParts: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
machinePieces: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
specifications: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
composants: ({
|
||||
typeComposant: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
sousComposants: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
machines: ({
|
||||
typeMachine: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
category: string | null;
|
||||
maintenanceFrequency: string | null;
|
||||
components: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
criticalParts: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
machinePieces: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
specifications: import("@prisma/client/runtime/library").JsonValue | null;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
composants: ({
|
||||
typeComposant: {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
pieces: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}[];
|
||||
sousComposants: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
machineId: string | null;
|
||||
typeComposantId: string | null;
|
||||
parentComposantId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prestataire: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
})[];
|
||||
} & {
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}) | null>;
|
||||
update(id: string, updateSiteDto: UpdateSiteDto): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
description: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}>;
|
||||
}
|
||||
90
dist/sites/sites.service.js
vendored
Normal file
90
dist/sites/sites.service.js
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SitesService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const prisma_service_1 = require("../prisma/prisma.service");
|
||||
let SitesService = class SitesService {
|
||||
prisma;
|
||||
constructor(prisma) {
|
||||
this.prisma = prisma;
|
||||
}
|
||||
async create(createSiteDto) {
|
||||
return this.prisma.site.create({
|
||||
data: createSiteDto,
|
||||
});
|
||||
}
|
||||
async findAll() {
|
||||
return this.prisma.site.findMany({
|
||||
include: {
|
||||
machines: {
|
||||
include: {
|
||||
typeMachine: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
pieces: true,
|
||||
},
|
||||
},
|
||||
pieces: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.site.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
machines: {
|
||||
include: {
|
||||
typeMachine: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
pieces: true,
|
||||
},
|
||||
},
|
||||
pieces: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
async update(id, updateSiteDto) {
|
||||
return this.prisma.site.update({
|
||||
where: { id },
|
||||
data: updateSiteDto,
|
||||
});
|
||||
}
|
||||
async remove(id) {
|
||||
const machinesInSite = await this.prisma.machine.findMany({
|
||||
where: { siteId: id },
|
||||
select: { id: true, name: true },
|
||||
});
|
||||
if (machinesInSite.length > 0) {
|
||||
const machineNames = machinesInSite.map(m => m.name).join(', ');
|
||||
throw new Error(`Impossible de supprimer ce site car il contient ${machinesInSite.length} machine(s): ${machineNames}. ` +
|
||||
`Veuillez d'abord supprimer ou déplacer ces machines vers un autre site.`);
|
||||
}
|
||||
return this.prisma.site.delete({
|
||||
where: { id },
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.SitesService = SitesService;
|
||||
exports.SitesService = SitesService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
|
||||
], SitesService);
|
||||
//# sourceMappingURL=sites.service.js.map
|
||||
1
dist/sites/sites.service.js.map
vendored
Normal file
1
dist/sites/sites.service.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":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