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:
Matthieu
2025-07-29 21:04:35 +02:00
parent e145b2c1ff
commit 1dbbf2b8ec
103 changed files with 10936 additions and 0 deletions

6
dist/app.controller.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
import { AppService } from './app.service';
export declare class AppController {
private readonly appService;
constructor(appService: AppService);
getHello(): string;
}

35
dist/app.controller.js vendored Normal file
View File

@@ -0,0 +1,35 @@
"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.AppController = void 0;
const common_1 = require("@nestjs/common");
const app_service_1 = require("./app.service");
let AppController = class AppController {
appService;
constructor(appService) {
this.appService = appService;
}
getHello() {
return this.appService.getHello();
}
};
exports.AppController = AppController;
__decorate([
(0, common_1.Get)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", String)
], AppController.prototype, "getHello", null);
exports.AppController = AppController = __decorate([
(0, common_1.Controller)(),
__metadata("design:paramtypes", [app_service_1.AppService])
], AppController);
//# sourceMappingURL=app.controller.js.map

1
dist/app.controller.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAGpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AAPY,sCAAa;AAIxB;IADC,IAAA,YAAG,GAAE;;;;6CAGL;wBANU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB"}

2
dist/app.module.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare class AppModule {
}

44
dist/app.module.js vendored Normal file
View File

@@ -0,0 +1,44 @@
"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.AppModule = void 0;
const common_1 = require("@nestjs/common");
const config_1 = require("@nestjs/config");
const prisma_module_1 = require("./prisma/prisma.module");
const app_controller_1 = require("./app.controller");
const app_service_1 = require("./app.service");
const sites_module_1 = require("./sites/sites.module");
const machines_module_1 = require("./machines/machines.module");
const composants_module_1 = require("./composants/composants.module");
const pieces_module_1 = require("./pieces/pieces.module");
const documents_module_1 = require("./documents/documents.module");
const types_module_1 = require("./types/types.module");
const custom_fields_module_1 = require("./custom-fields/custom-fields.module");
let AppModule = class AppModule {
};
exports.AppModule = AppModule;
exports.AppModule = AppModule = __decorate([
(0, common_1.Module)({
imports: [
config_1.ConfigModule.forRoot({
isGlobal: true,
}),
prisma_module_1.PrismaModule,
sites_module_1.SitesModule,
machines_module_1.MachinesModule,
composants_module_1.ComposantsModule,
pieces_module_1.PiecesModule,
documents_module_1.DocumentsModule,
types_module_1.TypesModule,
custom_fields_module_1.CustomFieldsModule,
],
controllers: [app_controller_1.AppController],
providers: [app_service_1.AppService],
})
], AppModule);
//# sourceMappingURL=app.module.js.map

1
dist/app.module.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA8C;AAC9C,0DAAsD;AACtD,qDAAiD;AACjD,+CAA2C;AAC3C,uDAAmD;AACnD,gEAA4D;AAC5D,sEAAkE;AAClE,0DAAsD;AACtD,mEAA+D;AAC/D,uDAAmD;AACnD,+EAA0E;AAmBnE,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAjBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,4BAAY;YACZ,0BAAW;YACX,gCAAc;YACd,oCAAgB;YAChB,4BAAY;YACZ,kCAAe;YACf,0BAAW;YACX,yCAAkB;SACnB;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG"}

3
dist/app.service.d.ts vendored Normal file
View File

@@ -0,0 +1,3 @@
export declare class AppService {
getHello(): string;
}

20
dist/app.service.js vendored Normal file
View File

@@ -0,0 +1,20 @@
"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.AppService = void 0;
const common_1 = require("@nestjs/common");
let AppService = class AppService {
getHello() {
return 'Hello World!';
}
};
exports.AppService = AppService;
exports.AppService = AppService = __decorate([
(0, common_1.Injectable)()
], AppService);
//# sourceMappingURL=app.service.js.map

1
dist/app.service.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"}

1141
dist/composants/composants.controller.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

100
dist/composants/composants.controller.js vendored Normal file
View File

@@ -0,0 +1,100 @@
"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.ComposantsController = void 0;
const common_1 = require("@nestjs/common");
const composants_service_1 = require("./composants.service");
const composant_dto_1 = require("../shared/dto/composant.dto");
let ComposantsController = class ComposantsController {
composantsService;
constructor(composantsService) {
this.composantsService = composantsService;
}
create(createComposantDto) {
return this.composantsService.create(createComposantDto);
}
findAll() {
return this.composantsService.findAll();
}
findHierarchy(machineId) {
return this.composantsService.findHierarchy(machineId);
}
findByMachine(machineId) {
return this.composantsService.findByMachine(machineId);
}
findOne(id) {
return this.composantsService.findOne(id);
}
update(id, updateComposantDto) {
return this.composantsService.update(id, updateComposantDto);
}
remove(id) {
return this.composantsService.remove(id);
}
};
exports.ComposantsController = ComposantsController;
__decorate([
(0, common_1.Post)(),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [composant_dto_1.CreateComposantDto]),
__metadata("design:returntype", void 0)
], ComposantsController.prototype, "create", null);
__decorate([
(0, common_1.Get)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], ComposantsController.prototype, "findAll", null);
__decorate([
(0, common_1.Get)('hierarchy/:machineId'),
__param(0, (0, common_1.Param)('machineId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], ComposantsController.prototype, "findHierarchy", null);
__decorate([
(0, common_1.Get)('machine/:machineId'),
__param(0, (0, common_1.Param)('machineId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], ComposantsController.prototype, "findByMachine", 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)
], ComposantsController.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, composant_dto_1.UpdateComposantDto]),
__metadata("design:returntype", void 0)
], ComposantsController.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)
], ComposantsController.prototype, "remove", null);
exports.ComposantsController = ComposantsController = __decorate([
(0, common_1.Controller)('composants'),
__metadata("design:paramtypes", [composants_service_1.ComposantsService])
], ComposantsController);
//# sourceMappingURL=composants.controller.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"composants.controller.js","sourceRoot":"","sources":["../../src/composants/composants.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,6DAAyD;AACzD,+DAAqF;AAG9E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAGrE,MAAM,CAAS,kBAAsC;QACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC3D,CAAC;IAGD,OAAO;QACL,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IAGD,aAAa,CAAqB,SAAiB;QACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAGD,aAAa,CAAqB,SAAiB;QACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAGD,OAAO,CAAc,EAAU;QAC7B,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAGD,MAAM,CAAc,EAAU,EAAU,kBAAsC;QAC5E,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC/D,CAAC;IAGD,MAAM,CAAc,EAAU;QAC5B,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AArCY,oDAAoB;AAI/B;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAqB,kCAAkB;;kDAEpD;AAGD;IADC,IAAA,YAAG,GAAE;;;;mDAGL;AAGD;IADC,IAAA,YAAG,EAAC,sBAAsB,CAAC;IACb,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;;;;yDAEhC;AAGD;IADC,IAAA,YAAG,EAAC,oBAAoB,CAAC;IACX,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;;;;yDAEhC;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mDAEnB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAqB,kCAAkB;;kDAE7E;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;kDAElB;+BApCU,oBAAoB;IADhC,IAAA,mBAAU,EAAC,YAAY,CAAC;qCAEyB,sCAAiB;GADtD,oBAAoB,CAqChC"}

View File

@@ -0,0 +1,2 @@
export declare class ComposantsModule {
}

22
dist/composants/composants.module.js vendored Normal file
View 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.ComposantsModule = void 0;
const common_1 = require("@nestjs/common");
const composants_controller_1 = require("./composants.controller");
const composants_service_1 = require("./composants.service");
let ComposantsModule = class ComposantsModule {
};
exports.ComposantsModule = ComposantsModule;
exports.ComposantsModule = ComposantsModule = __decorate([
(0, common_1.Module)({
controllers: [composants_controller_1.ComposantsController],
providers: [composants_service_1.ComposantsService]
})
], ComposantsModule);
//# sourceMappingURL=composants.module.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"composants.module.js","sourceRoot":"","sources":["../../src/composants/composants.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mEAA+D;AAC/D,6DAAyD;AAMlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,4CAAgB;2BAAhB,gBAAgB;IAJ5B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,SAAS,EAAE,CAAC,sCAAiB,CAAC;KAC/B,CAAC;GACW,gBAAgB,CAAG"}

1141
dist/composants/composants.service.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

276
dist/composants/composants.service.js vendored Normal file
View File

@@ -0,0 +1,276 @@
"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.ComposantsService = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("../prisma/prisma.service");
let ComposantsService = class ComposantsService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async create(createComposantDto) {
return this.prisma.composant.create({
data: createComposantDto,
include: {
machine: true,
parentComposant: true,
typeComposant: true,
sousComposants: {
include: {
typeComposant: true,
pieces: true,
},
},
pieces: true,
documents: true,
},
});
}
async findAll() {
return this.prisma.composant.findMany({
include: {
machine: true,
parentComposant: true,
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
sousComposants: {
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
documents: true,
},
});
}
async findOne(id) {
return this.prisma.composant.findUnique({
where: { id },
include: {
machine: true,
parentComposant: true,
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
sousComposants: {
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
documents: true,
},
});
}
async findByMachine(machineId) {
return this.prisma.composant.findMany({
where: { machineId },
include: {
machine: true,
parentComposant: true,
typeComposant: true,
sousComposants: {
include: {
typeComposant: true,
pieces: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
customFieldValues: {
include: {
customField: true,
},
},
documents: true,
},
});
}
async findHierarchy(machineId) {
const rootComposants = await this.prisma.composant.findMany({
where: {
machineId,
parentComposantId: null
},
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
sousComposants: {
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
sousComposants: {
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
});
return rootComposants;
}
async update(id, updateComposantDto) {
return this.prisma.composant.update({
where: { id },
data: updateComposantDto,
include: {
machine: true,
parentComposant: true,
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
sousComposants: {
include: {
typeComposant: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
documents: true,
},
});
}
async remove(id) {
return this.prisma.composant.delete({
where: { id },
});
}
};
exports.ComposantsService = ComposantsService;
exports.ComposantsService = ComposantsService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], ComposantsService);
//# sourceMappingURL=composants.service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"composants.service.js","sourceRoot":"","sources":["../../src/composants/composants.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAIlD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACR;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,kBAAsC;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;YAClC,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,IAAI;gBACrB,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE;oBACd,OAAO,EAAE;wBACP,aAAa,EAAE,IAAI;wBACnB,MAAM,EAAE,IAAI;qBACb;iBACF;gBACD,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;YACpC,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,eAAe,EAAE,IAAI;gB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AAI;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;YAClC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArQY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,iBAAiB,CAqQ7B"}

View File

@@ -0,0 +1,141 @@
import { CustomFieldsService } from './custom-fields.service';
import { CreateCustomFieldValueDto, UpdateCustomFieldValueDto } from '../shared/dto/custom-field.dto';
export declare class CustomFieldsController {
private readonly customFieldsService;
constructor(customFieldsService: CustomFieldsService);
createCustomFieldValue(createCustomFieldValueDto: CreateCustomFieldValueDto): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
findCustomFieldValuesByEntity(entityType: string, entityId: string): Promise<({
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
})[]>;
findOneCustomFieldValue(id: string): Promise<({
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}) | null>;
updateCustomFieldValue(id: string, updateCustomFieldValueDto: UpdateCustomFieldValueDto): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
removeCustomFieldValue(id: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
upsertCustomFieldValue(body: {
customFieldId: string;
entityType: string;
entityId: string;
value: string;
}): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
}

View File

@@ -0,0 +1,92 @@
"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.CustomFieldsController = void 0;
const common_1 = require("@nestjs/common");
const custom_fields_service_1 = require("./custom-fields.service");
const custom_field_dto_1 = require("../shared/dto/custom-field.dto");
let CustomFieldsController = class CustomFieldsController {
customFieldsService;
constructor(customFieldsService) {
this.customFieldsService = customFieldsService;
}
createCustomFieldValue(createCustomFieldValueDto) {
return this.customFieldsService.createCustomFieldValue(createCustomFieldValueDto);
}
findCustomFieldValuesByEntity(entityType, entityId) {
return this.customFieldsService.findCustomFieldValuesByEntity(entityType, entityId);
}
findOneCustomFieldValue(id) {
return this.customFieldsService.findOneCustomFieldValue(id);
}
updateCustomFieldValue(id, updateCustomFieldValueDto) {
return this.customFieldsService.updateCustomFieldValue(id, updateCustomFieldValueDto);
}
removeCustomFieldValue(id) {
return this.customFieldsService.removeCustomFieldValue(id);
}
upsertCustomFieldValue(body) {
return this.customFieldsService.upsertCustomFieldValue(body.customFieldId, body.entityType, body.entityId, body.value);
}
};
exports.CustomFieldsController = CustomFieldsController;
__decorate([
(0, common_1.Post)('values'),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [custom_field_dto_1.CreateCustomFieldValueDto]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "createCustomFieldValue", null);
__decorate([
(0, common_1.Get)('values/:entityType/:entityId'),
__param(0, (0, common_1.Param)('entityType')),
__param(1, (0, common_1.Param)('entityId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "findCustomFieldValuesByEntity", null);
__decorate([
(0, common_1.Get)('values/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "findOneCustomFieldValue", null);
__decorate([
(0, common_1.Patch)('values/:id'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, custom_field_dto_1.UpdateCustomFieldValueDto]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "updateCustomFieldValue", null);
__decorate([
(0, common_1.Delete)('values/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "removeCustomFieldValue", null);
__decorate([
(0, common_1.Post)('values/upsert'),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
], CustomFieldsController.prototype, "upsertCustomFieldValue", null);
exports.CustomFieldsController = CustomFieldsController = __decorate([
(0, common_1.Controller)('custom-fields'),
__metadata("design:paramtypes", [custom_fields_service_1.CustomFieldsService])
], CustomFieldsController);
//# sourceMappingURL=custom-fields.controller.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"custom-fields.controller.js","sourceRoot":"","sources":["../../src/custom-fields/custom-fields.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,mEAA8D;AAC9D,qEAAsG;AAG/F,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACJ;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAGzE,sBAAsB,CAAS,yBAAoD;QACjF,OAAO,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,CAAC;IACpF,CAAC;IAGD,6BAA6B,CACN,UAAkB,EACpB,QAAgB;QAEnC,OAAO,IAAI,CAAC,mBAAmB,CAAC,6BAA6B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtF,CAAC;IAGD,uBAAuB,CAAc,EAAU;QAC7C,OAAO,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC;IAGD,sBAAsB,CACP,EAAU,EACf,yBAAoD;QAE5D,OAAO,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,EAAE,yBAAyB,CAAC,CAAC;IACxF,CAAC;IAGD,sBAAsB,CAAc,EAAU;QAC5C,OAAO,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IAGD,sBAAsB,CAAS,IAK9B;QACC,OAAO,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CACpD,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,CACX,CAAC;IACJ,CAAC;CACF,CAAA;AAhDY,wDAAsB;AAIjC;IADC,IAAA,aAAI,EAAC,QAAQ,CAAC;IACS,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAA4B,4CAAyB;;oEAElF;AAGD;IADC,IAAA,YAAG,EAAC,8BAA8B,CAAC;IAEjC,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IACnB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;2EAGnB;AAGD;IADC,IAAA,YAAG,EAAC,YAAY,CAAC;IACO,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;qEAEnC;AAGD;IADC,IAAA,cAAK,EAAC,YAAY,CAAC;IAEjB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAA4B,4CAAyB;;oEAG7D;AAGD;IADC,IAAA,eAAM,EAAC,YAAY,CAAC;IACG,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;oEAElC;AAGD;IADC,IAAA,aAAI,EAAC,eAAe,CAAC;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;oEAY7B;iCA/CU,sBAAsB;IADlC,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAEwB,2CAAmB;GAD1D,sBAAsB,CAgDlC"}

View File

@@ -0,0 +1,2 @@
export declare class CustomFieldsModule {
}

View File

@@ -0,0 +1,25 @@
"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.CustomFieldsModule = void 0;
const common_1 = require("@nestjs/common");
const custom_fields_service_1 = require("./custom-fields.service");
const custom_fields_controller_1 = require("./custom-fields.controller");
const prisma_module_1 = require("../prisma/prisma.module");
let CustomFieldsModule = class CustomFieldsModule {
};
exports.CustomFieldsModule = CustomFieldsModule;
exports.CustomFieldsModule = CustomFieldsModule = __decorate([
(0, common_1.Module)({
imports: [prisma_module_1.PrismaModule],
controllers: [custom_fields_controller_1.CustomFieldsController],
providers: [custom_fields_service_1.CustomFieldsService],
exports: [custom_fields_service_1.CustomFieldsService],
})
], CustomFieldsModule);
//# sourceMappingURL=custom-fields.module.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"custom-fields.module.js","sourceRoot":"","sources":["../../src/custom-fields/custom-fields.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mEAA8D;AAC9D,yEAAoE;AACpE,2DAAuD;AAQhD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAN9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,WAAW,EAAE,CAAC,iDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,2CAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,2CAAmB,CAAC;KAC/B,CAAC;GACW,kBAAkB,CAAG"}

View File

@@ -0,0 +1,136 @@
import { PrismaService } from '../prisma/prisma.service';
import { CreateCustomFieldValueDto, UpdateCustomFieldValueDto } from '../shared/dto/custom-field.dto';
export declare class CustomFieldsService {
private prisma;
constructor(prisma: PrismaService);
createCustomFieldValue(createCustomFieldValueDto: CreateCustomFieldValueDto): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
findCustomFieldValuesByEntity(entityType: string, entityId: string): Promise<({
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
})[]>;
findOneCustomFieldValue(id: string): Promise<({
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}) | null>;
updateCustomFieldValue(id: string, updateCustomFieldValueDto: UpdateCustomFieldValueDto): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
removeCustomFieldValue(id: string): Promise<{
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
upsertCustomFieldValue(customFieldId: string, entityType: string, entityId: string, value: string): Promise<{
customField: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
};
} & {
id: string;
createdAt: Date;
updatedAt: Date;
value: string;
customFieldId: string;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
}>;
}

View File

@@ -0,0 +1,96 @@
"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.CustomFieldsService = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("../prisma/prisma.service");
let CustomFieldsService = class CustomFieldsService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async createCustomFieldValue(createCustomFieldValueDto) {
return this.prisma.customFieldValue.create({
data: createCustomFieldValueDto,
include: {
customField: true,
},
});
}
async findCustomFieldValuesByEntity(entityType, entityId) {
const whereClause = {
[entityType + 'Id']: entityId,
};
return this.prisma.customFieldValue.findMany({
where: whereClause,
include: {
customField: true,
},
});
}
async findOneCustomFieldValue(id) {
return this.prisma.customFieldValue.findUnique({
where: { id },
include: {
customField: true,
},
});
}
async updateCustomFieldValue(id, updateCustomFieldValueDto) {
return this.prisma.customFieldValue.update({
where: { id },
data: updateCustomFieldValueDto,
include: {
customField: true,
},
});
}
async removeCustomFieldValue(id) {
return this.prisma.customFieldValue.delete({
where: { id },
});
}
async upsertCustomFieldValue(customFieldId, entityType, entityId, value) {
const existingValue = await this.prisma.customFieldValue.findFirst({
where: {
customFieldId,
[entityType + 'Id']: entityId,
},
});
if (existingValue) {
return this.prisma.customFieldValue.update({
where: { id: existingValue.id },
data: { value },
include: {
customField: true,
},
});
}
else {
return this.prisma.customFieldValue.create({
data: {
customFieldId,
value,
[entityType + 'Id']: entityId,
},
include: {
customField: true,
},
});
}
}
};
exports.CustomFieldsService = CustomFieldsService;
exports.CustomFieldsService = CustomFieldsService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], CustomFieldsService);
//# sourceMappingURL=custom-fields.service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"custom-fields.service.js","sourceRoot":"","sources":["../../src/custom-fields/custom-fields.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAIlD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACV;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAG7C,KAAK,CAAC,sBAAsB,CAAC,yBAAoD;QAC/E,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;YACzC,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE;gBACP,WAAW,EAAE,IAAI;aAClB;SACF,CAAC,CAAC;IACL,CAAC;IAGD,KAAK,CAAC,6BAA6B,CAAC,UAAkB,EAAE,QAAgB;QACtE,MAAM,WAAW,GAAG;YAClB,CAAC,UAAU,GAAG,IAAI,CAAC,EAAE,QAAQ;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;YAC3C,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE;gBACP,WAAW,EAAE,IAAI;aAClB;SACF,CAAC,CAAC;IACL,CAAC;IAGD,KAAK,CAAC,uBAAuB,CAAC,EAAU;QACtC,OAAO,IAAI,CAAC,MAAM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U,GAAG,IAAI,CAAC,EAAE,QAAQ;iBAC9B;gBACD,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI;iBAClB;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAA;AAxFY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,mBAAmB,CAwF/B"}

383
dist/documents/documents.controller.d.ts vendored Normal file
View File

@@ -0,0 +1,383 @@
import { DocumentsService } from './documents.service';
import { CreateDocumentDto, UpdateDocumentDto } from '../shared/dto/document.dto';
export declare class DocumentsController {
private readonly documentsService;
constructor(documentsService: DocumentsService);
create(createDocumentDto: CreateDocumentDto): Promise<{
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
findAll(): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findByMachine(machineId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findByComposant(composantId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findByPiece(pieceId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findOne(id: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}) | null>;
update(id: string, updateDocumentDto: UpdateDocumentDto): Promise<{
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
remove(id: string): Promise<{
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
}

110
dist/documents/documents.controller.js vendored Normal file
View File

@@ -0,0 +1,110 @@
"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.DocumentsController = void 0;
const common_1 = require("@nestjs/common");
const documents_service_1 = require("./documents.service");
const document_dto_1 = require("../shared/dto/document.dto");
let DocumentsController = class DocumentsController {
documentsService;
constructor(documentsService) {
this.documentsService = documentsService;
}
create(createDocumentDto) {
return this.documentsService.create(createDocumentDto);
}
findAll() {
return this.documentsService.findAll();
}
findByMachine(machineId) {
return this.documentsService.findByMachine(machineId);
}
findByComposant(composantId) {
return this.documentsService.findByComposant(composantId);
}
findByPiece(pieceId) {
return this.documentsService.findByPiece(pieceId);
}
findOne(id) {
return this.documentsService.findOne(id);
}
update(id, updateDocumentDto) {
return this.documentsService.update(id, updateDocumentDto);
}
remove(id) {
return this.documentsService.remove(id);
}
};
exports.DocumentsController = DocumentsController;
__decorate([
(0, common_1.Post)(),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [document_dto_1.CreateDocumentDto]),
__metadata("design:returntype", void 0)
], DocumentsController.prototype, "create", null);
__decorate([
(0, common_1.Get)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], DocumentsController.prototype, "findAll", null);
__decorate([
(0, common_1.Get)('machine/:machineId'),
__param(0, (0, common_1.Param)('machineId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], DocumentsController.prototype, "findByMachine", null);
__decorate([
(0, common_1.Get)('composant/:composantId'),
__param(0, (0, common_1.Param)('composantId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], DocumentsController.prototype, "findByComposant", null);
__decorate([
(0, common_1.Get)('piece/:pieceId'),
__param(0, (0, common_1.Param)('pieceId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], DocumentsController.prototype, "findByPiece", 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)
], DocumentsController.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, document_dto_1.UpdateDocumentDto]),
__metadata("design:returntype", void 0)
], DocumentsController.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)
], DocumentsController.prototype, "remove", null);
exports.DocumentsController = DocumentsController = __decorate([
(0, common_1.Controller)('documents'),
__metadata("design:paramtypes", [documents_service_1.DocumentsService])
], DocumentsController);
//# sourceMappingURL=documents.controller.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"documents.controller.js","sourceRoot":"","sources":["../../src/documents/documents.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,2DAAuD;AACvD,6DAAkF;AAG3E,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAGnE,MAAM,CAAS,iBAAoC;QACjD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACzD,CAAC;IAGD,OAAO;QACL,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;IAGD,aAAa,CAAqB,SAAiB;QACjD,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAGD,eAAe,CAAuB,WAAmB;QACvD,OAAO,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC;IA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K,EAAC,IAAI,CAAC,CAAA;;;;iDAElB;8BAzCU,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,WAAW,CAAC;qCAEyB,oCAAgB;GADpD,mBAAmB,CA0C/B"}

2
dist/documents/documents.module.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare class DocumentsModule {
}

22
dist/documents/documents.module.js vendored Normal file
View 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.DocumentsModule = void 0;
const common_1 = require("@nestjs/common");
const documents_controller_1 = require("./documents.controller");
const documents_service_1 = require("./documents.service");
let DocumentsModule = class DocumentsModule {
};
exports.DocumentsModule = DocumentsModule;
exports.DocumentsModule = DocumentsModule = __decorate([
(0, common_1.Module)({
controllers: [documents_controller_1.DocumentsController],
providers: [documents_service_1.DocumentsService]
})
], DocumentsModule);
//# sourceMappingURL=documents.module.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"documents.module.js","sourceRoot":"","sources":["../../src/documents/documents.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,iEAA6D;AAC7D,2DAAuD;AAMhD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,0CAAe;0BAAf,eAAe;IAJ3B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,0CAAmB,CAAC;QAClC,SAAS,EAAE,CAAC,oCAAgB,CAAC;KAC9B,CAAC;GACW,eAAe,CAAG"}

383
dist/documents/documents.service.d.ts vendored Normal file
View File

@@ -0,0 +1,383 @@
import { PrismaService } from '../prisma/prisma.service';
import { CreateDocumentDto, UpdateDocumentDto } from '../shared/dto/document.dto';
export declare class DocumentsService {
private prisma;
constructor(prisma: PrismaService);
create(createDocumentDto: CreateDocumentDto): Promise<{
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
findAll(): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findOne(id: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}) | null>;
findByMachine(machineId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findByComposant(composantId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
findByPiece(pieceId: string): Promise<({
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
})[]>;
update(id: string, updateDocumentDto: UpdateDocumentDto): Promise<{
machine: {
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;
} | null;
composant: {
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;
} | null;
piece: {
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;
} | null;
} & {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
remove(id: string): Promise<{
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}>;
}

101
dist/documents/documents.service.js vendored Normal file
View File

@@ -0,0 +1,101 @@
"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.DocumentsService = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("../prisma/prisma.service");
let DocumentsService = class DocumentsService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async create(createDocumentDto) {
return this.prisma.document.create({
data: createDocumentDto,
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async findAll() {
return this.prisma.document.findMany({
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async findOne(id) {
return this.prisma.document.findUnique({
where: { id },
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async findByMachine(machineId) {
return this.prisma.document.findMany({
where: { machineId },
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async findByComposant(composantId) {
return this.prisma.document.findMany({
where: { composantId },
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async findByPiece(pieceId) {
return this.prisma.document.findMany({
where: { pieceId },
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async update(id, updateDocumentDto) {
return this.prisma.document.update({
where: { id },
data: updateDocumentDto,
include: {
machine: true,
composant: true,
piece: true,
},
});
}
async remove(id) {
return this.prisma.document.delete({
where: { id },
});
}
};
exports.DocumentsService = DocumentsService;
exports.DocumentsService = DocumentsService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], DocumentsService);
//# sourceMappingURL=documents.service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"documents.service.js","sourceRoot":"","sources":["../../src/documents/documents.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAIlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACP;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,iBAAoC;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YACjC,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACnC,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;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AAE;YACb,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YACjC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AArFY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,gBAAgB,CAqF5B"}

1010
dist/machines/machines.controller.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

90
dist/machines/machines.controller.js vendored Normal file
View 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);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MachinesController = void 0;
const common_1 = require("@nestjs/common");
const machines_service_1 = require("./machines.service");
const machine_dto_1 = require("../shared/dto/machine.dto");
let MachinesController = class MachinesController {
machinesService;
constructor(machinesService) {
this.machinesService = machinesService;
}
create(createMachineDto) {
return this.machinesService.create(createMachineDto);
}
findAll() {
return this.machinesService.findAll();
}
findOne(id) {
return this.machinesService.findOne(id);
}
update(id, updateMachineDto) {
return this.machinesService.update(id, updateMachineDto);
}
remove(id) {
return this.machinesService.remove(id);
}
addMissingCustomFields(id) {
return this.machinesService.addMissingCustomFields(id);
}
};
exports.MachinesController = MachinesController;
__decorate([
(0, common_1.Post)(),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [machine_dto_1.CreateMachineDto]),
__metadata("design:returntype", void 0)
], MachinesController.prototype, "create", null);
__decorate([
(0, common_1.Get)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], MachinesController.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)
], MachinesController.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, machine_dto_1.UpdateMachineDto]),
__metadata("design:returntype", void 0)
], MachinesController.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)
], MachinesController.prototype, "remove", null);
__decorate([
(0, common_1.Post)(':id/add-custom-fields'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], MachinesController.prototype, "addMissingCustomFields", null);
exports.MachinesController = MachinesController = __decorate([
(0, common_1.Controller)('machines'),
__metadata("design:paramtypes", [machines_service_1.MachinesService])
], MachinesController);
//# sourceMappingURL=machines.controller.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"machines.controller.js","sourceRoot":"","sources":["../../src/machines/machines.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,yDAAqD;AACrD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K,EAAC,IAAI,CAAC,CAAA;;;;gDAElB;AAGD;IADC,IAAA,aAAI,EAAC,uBAAuB,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;gEAElC;6BA/BU,kBAAkB;IAD9B,IAAA,mBAAU,EAAC,UAAU,CAAC;qCAEyB,kCAAe;GADlD,kBAAkB,CAgC9B"}

2
dist/machines/machines.module.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare class MachinesModule {
}

22
dist/machines/machines.module.js vendored Normal file
View 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.MachinesModule = void 0;
const common_1 = require("@nestjs/common");
const machines_controller_1 = require("./machines.controller");
const machines_service_1 = require("./machines.service");
let MachinesModule = class MachinesModule {
};
exports.MachinesModule = MachinesModule;
exports.MachinesModule = MachinesModule = __decorate([
(0, common_1.Module)({
controllers: [machines_controller_1.MachinesController],
providers: [machines_service_1.MachinesService]
})
], MachinesModule);
//# sourceMappingURL=machines.module.js.map

1
dist/machines/machines.module.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"machines.module.js","sourceRoot":"","sources":["../../src/machines/machines.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA2D;AAC3D,yDAAqD;AAM9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAJ1B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;KAC7B,CAAC;GACW,cAAc,CAAG"}

1013
dist/machines/machines.service.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

675
dist/machines/machines.service.js vendored Normal file
View File

@@ -0,0 +1,675 @@
"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.MachinesService = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("../prisma/prisma.service");
let MachinesService = class MachinesService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async create(createMachineDto) {
const typeMachine = await this.prisma.typeMachine.findUnique({
where: { id: createMachineDto.typeMachineId },
include: {
customFields: true,
},
});
if (!typeMachine) {
throw new Error('Type de machine non trouvé');
}
return await this.prisma.$transaction(async (prisma) => {
const machine = await prisma.machine.create({
data: createMachineDto,
include: {
site: true,
typeMachine: true,
},
});
const components = typeMachine.components;
if (components) {
await this.createComponentsFromType(prisma, machine.id, components);
}
const machinePieces = typeMachine.machinePieces;
if (machinePieces) {
await this.createMachinePiecesFromType(prisma, machine.id, machinePieces);
}
if (typeMachine.customFields && typeMachine.customFields.length > 0) {
await this.createMachineCustomFieldsFromType(prisma, machine.id, typeMachine.customFields);
}
return await prisma.machine.findUnique({
where: { id: machine.id },
include: {
site: true,
typeMachine: {
include: {
customFields: true,
},
},
composants: {
include: {
typeComposant: true,
sousComposants: true,
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
customFieldValues: {
include: {
customField: true,
},
},
documents: true,
},
});
});
}
async createComponentsFromType(prisma, machineId, components, parentComposantId) {
for (const component of components) {
if (!component.name)
continue;
let typeComposant = null;
if (component.customFields && component.customFields.length > 0) {
typeComposant = await prisma.typeComposant.findFirst({
where: { name: component.name }
});
if (!typeComposant) {
typeComposant = await prisma.typeComposant.create({
data: {
name: component.name,
description: component.description || '',
},
});
for (const customField of component.customFields) {
await prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typeComposantId: typeComposant.id,
},
});
}
}
}
const createdComposant = await prisma.composant.create({
data: {
name: component.name,
reference: component.reference || '',
prestataire: component.prestataire || '',
emplacement: component.emplacement || '',
prix: component.prix || null,
machineId,
parentComposantId,
typeComposantId: typeComposant?.id || null,
},
});
if (typeComposant && typeComposant.id) {
const customFields = await prisma.customField.findMany({
where: { typeComposantId: typeComposant.id },
});
for (const customField of customFields) {
const defaultValue = component.customFields?.find(cf => cf.name === customField.name)?.defaultValue || '';
await prisma.customFieldValue.create({
data: {
value: defaultValue,
customFieldId: customField.id,
composantId: createdComposant.id,
},
});
}
}
if (component.pieces) {
for (const piece of component.pieces) {
if (!piece || !piece.name)
continue;
let typePiece = null;
if (piece.customFields && piece.customFields.length > 0) {
typePiece = await prisma.typePiece.findFirst({
where: { name: piece.name }
});
if (!typePiece) {
typePiece = await prisma.typePiece.create({
data: {
name: piece.name,
description: piece.description || '',
},
});
for (const customField of piece.customFields) {
await prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typePieceId: typePiece.id,
},
});
}
}
}
const createdPiece = await prisma.piece.create({
data: {
name: piece.name,
reference: piece.reference || '',
prestataire: piece.prestataire || '',
emplacement: piece.emplacement || '',
prix: piece.prix || null,
composantId: createdComposant.id,
typePieceId: typePiece?.id || null,
},
});
if (typePiece && typePiece.id) {
const customFields = await prisma.customField.findMany({
where: { typePieceId: typePiece.id },
});
for (const customField of customFields) {
const defaultValue = piece.customFields?.find(cf => cf.name === customField.name)?.defaultValue || '';
await prisma.customFieldValue.create({
data: {
value: defaultValue,
customFieldId: customField.id,
pieceId: createdPiece.id,
},
});
}
}
}
}
if (component.subComponents) {
await this.createComponentsFromType(prisma, machineId, component.subComponents, createdComposant.id);
}
}
}
async createMachinePiecesFromType(prisma, machineId, machinePieces) {
for (const piece of machinePieces) {
if (!piece || !piece.name)
continue;
const createdPiece = await prisma.piece.create({
data: {
name: piece.name,
machineId,
},
});
if (piece.customFields && piece.customFields.length > 0) {
for (const customField of piece.customFields) {
const createdCustomField = await prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typePieceId: null,
},
});
await prisma.customFieldValue.create({
data: {
value: customField.defaultValue || '',
customFieldId: createdCustomField.id,
pieceId: createdPiece.id,
},
});
}
}
}
}
async createMachineCustomFieldsFromType(prisma, machineId, machineCustomFields) {
for (const customField of machineCustomFields) {
if (!customField || !customField.name)
continue;
const createdCustomField = await prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typeMachineId: null,
},
});
await prisma.customFieldValue.create({
data: {
value: customField.defaultValue || '',
customFieldId: createdCustomField.id,
machineId: machineId,
},
});
}
}
async findAll() {
return this.prisma.machine.findMany({
include: {
site: true,
typeMachine: {
include: {
customFields: true,
},
},
composants: {
include: {
typeComposant: true,
sousComposants: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
customFieldValues: {
include: {
customField: true,
},
},
documents: true,
},
});
}
async findOne(id) {
return this.prisma.machine.findUnique({
where: { id },
include: {
site: true,
typeMachine: {
include: {
customFields: true,
},
},
composants: {
include: {
typeComposant: true,
sousComposants: true,
customFieldValues: {
include: {
customField: true,
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
},
},
pieces: {
include: {
customFieldValues: {
include: {
customField: true,
},
},
},
},
customFieldValues: {
include: {
customField: true,
},
},
documents: true,
},
});
}
async update(id, updateMachineDto) {
return this.prisma.machine.update({
where: { id },
data: updateMachineDto,
include: {
site: true,
typeMachine: {
include: {
customFields: true,
},
},
composants: {
include: {
typeComposant: true,
sousComposants: true,
pieces: true,
},
},
pieces: true,
customFieldValues: {
include: {
customField: true,
},
},
documents: true,
},
});
}
async remove(id) {
const machine = await this.prisma.machine.findUnique({
where: { id },
include: {
composants: true,
pieces: true,
documents: true,
customFieldValues: true,
},
});
if (!machine) {
throw new Error('Machine non trouvée');
}
return await this.prisma.$transaction(async (prisma) => {
if (machine.customFieldValues.length > 0) {
await prisma.customFieldValue.deleteMany({
where: { machineId: id },
});
}
if (machine.documents.length > 0) {
await prisma.document.deleteMany({
where: { machineId: id },
});
}
if (machine.pieces.length > 0) {
await prisma.piece.deleteMany({
where: { machineId: id },
});
}
if (machine.composants.length > 0) {
await prisma.composant.deleteMany({
where: { machineId: id },
});
}
return await prisma.machine.delete({
where: { id },
});
});
}
async addMissingCustomFields(machineId) {
const machine = await this.prisma.machine.findUnique({
where: { id: machineId },
include: {
typeMachine: true,
composants: {
include: {
pieces: true,
},
},
pieces: true,
},
});
if (!machine || !machine.typeMachine) {
throw new Error('Machine ou type de machine non trouvé');
}
const typeMachine = machine.typeMachine;
const components = typeMachine.components || [];
const machinePieces = typeMachine.machinePieces || [];
const machineCustomFields = typeMachine.customFields || [];
if (machineCustomFields && machineCustomFields.length > 0) {
for (const customField of machineCustomFields) {
const existingValue = await this.prisma.customFieldValue.findFirst({
where: {
machineId: machineId,
customField: {
name: customField.name,
},
},
include: {
customField: true,
},
});
if (!existingValue) {
const createdCustomField = await this.prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typeMachineId: null,
},
});
await this.prisma.customFieldValue.create({
data: {
value: customField.defaultValue || '',
customFieldId: createdCustomField.id,
machineId: machineId,
},
});
}
}
}
for (const component of machine.composants) {
const typeComponent = components.find((c) => c.name === component.name);
if (typeComponent && typeComponent.customFields && typeComponent.customFields.length > 0) {
let typeComposant = await this.prisma.typeComposant.findFirst({
where: { name: component.name },
});
if (!typeComposant) {
typeComposant = await this.prisma.typeComposant.create({
data: {
name: component.name,
description: typeComponent.description || '',
},
});
}
for (const customField of typeComponent.customFields) {
const existingField = await this.prisma.customField.findFirst({
where: {
name: customField.name,
typeComposantId: typeComposant.id,
},
});
if (!existingField) {
await this.prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typeComposantId: typeComposant.id,
},
});
}
}
await this.prisma.composant.update({
where: { id: component.id },
data: { typeComposantId: typeComposant.id },
});
const customFields = await this.prisma.customField.findMany({
where: { typeComposantId: typeComposant.id },
});
for (const customField of customFields) {
const existingValue = await this.prisma.customFieldValue.findFirst({
where: {
customFieldId: customField.id,
composantId: component.id,
},
});
if (!existingValue) {
const defaultValue = typeComponent.customFields.find((cf) => cf.name === customField.name)?.defaultValue || '';
await this.prisma.customFieldValue.create({
data: {
value: defaultValue,
customFieldId: customField.id,
composantId: component.id,
},
});
}
}
for (const piece of component.pieces) {
const typePiece = typeComponent.pieces?.find((p) => p.name === piece.name);
if (typePiece && typePiece.customFields && typePiece.customFields.length > 0) {
let typePieceEntity = await this.prisma.typePiece.findFirst({
where: { name: piece.name },
});
if (!typePieceEntity) {
typePieceEntity = await this.prisma.typePiece.create({
data: {
name: piece.name,
description: typePiece.description || '',
},
});
}
for (const customField of typePiece.customFields) {
const existingField = await this.prisma.customField.findFirst({
where: {
name: customField.name,
typePieceId: typePieceEntity.id,
},
});
if (!existingField) {
await this.prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typePieceId: typePieceEntity.id,
},
});
}
}
await this.prisma.piece.update({
where: { id: piece.id },
data: { typePieceId: typePieceEntity.id },
});
const customFields = await this.prisma.customField.findMany({
where: { typePieceId: typePieceEntity.id },
});
for (const customField of customFields) {
const existingValue = await this.prisma.customFieldValue.findFirst({
where: {
customFieldId: customField.id,
pieceId: piece.id,
},
});
if (!existingValue) {
const defaultValue = typePiece.customFields.find((cf) => cf.name === customField.name)?.defaultValue || '';
await this.prisma.customFieldValue.create({
data: {
value: defaultValue,
customFieldId: customField.id,
pieceId: piece.id,
},
});
}
}
}
}
}
}
for (const piece of machine.pieces) {
const typePiece = machinePieces.find((p) => p.name === piece.name);
if (typePiece && typePiece.customFields && typePiece.customFields.length > 0) {
let typePieceEntity = await this.prisma.typePiece.findFirst({
where: { name: piece.name },
});
if (!typePieceEntity) {
typePieceEntity = await this.prisma.typePiece.create({
data: {
name: piece.name,
description: typePiece.description || '',
},
});
}
for (const customField of typePiece.customFields) {
const existingField = await this.prisma.customField.findFirst({
where: {
name: customField.name,
typePieceId: typePieceEntity.id,
},
});
if (!existingField) {
await this.prisma.customField.create({
data: {
name: customField.name,
type: customField.type,
required: customField.required || false,
defaultValue: customField.defaultValue,
options: customField.options || [],
typePieceId: typePieceEntity.id,
},
});
}
}
await this.prisma.piece.update({
where: { id: piece.id },
data: { typePieceId: typePieceEntity.id },
});
const customFields = await this.prisma.customField.findMany({
where: { typePieceId: typePieceEntity.id },
});
for (const customField of customFields) {
const existingValue = await this.prisma.customFieldValue.findFirst({
where: {
customFieldId: customField.id,
pieceId: piece.id,
},
});
if (!existingValue) {
const defaultValue = typePiece.customFields.find((cf) => cf.name === customField.name)?.defaultValue || '';
await this.prisma.customFieldValue.create({
data: {
value: defaultValue,
customFieldId: customField.id,
pieceId: piece.id,
},
});
}
}
}
}
return this.findOne(machineId);
}
};
exports.MachinesService = MachinesService;
exports.MachinesService = MachinesService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], MachinesService);
//# sourceMappingURL=machines.service.js.map

1
dist/machines/machines.service.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/main.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export {};

25
dist/main.js vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@nestjs/core");
const common_1 = require("@nestjs/common");
const app_module_1 = require("./app.module");
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
app.enableCors({
origin: process.env.CORS_ORIGIN || 'http://localhost:3001',
credentials: true,
});
app.useGlobalPipes(new common_1.ValidationPipe({
whitelist: process.env.VALIDATION_WHITELIST === 'true',
forbidNonWhitelisted: process.env.VALIDATION_FORBID_NON_WHITELISTED === 'true',
transform: process.env.VALIDATION_TRANSFORM === 'true',
}));
const apiPrefix = process.env.API_PREFIX || 'api';
app.setGlobalPrefix(apiPrefix);
const port = process.env.PORT || 3000;
await app.listen(port);
console.log(`Application is running on: http://localhost:${port}`);
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
}
bootstrap();
//# sourceMappingURL=main.js.map

1
dist/main.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAgD;AAChD,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAGhD,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,uBAAuB;QAC1D,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAGH,GAAG,CAAC,cAAc,CAAC,IAAI,uBAAc,CAAC;QACpC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM;QACtD,oBAAoB,EAAE,OAAO,CAAC,GAAG,CAAC,iCAAiC,KAAK,MAAM;QAC9E,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM;KACvD,CAAC,CAAC,CAAC;IAGJ,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,KAAK,CAAC;IAClD,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;IACtC,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,+CAA+C,IAAI,EAAE,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,EAAE,CAAC,CAAC;AACvE,CAAC;AACD,SAAS,EAAE,CAAC"}

373
dist/pieces/pieces.controller.d.ts vendored Normal file
View File

@@ -0,0 +1,373 @@
import { PiecesService } from './pieces.service';
import { CreatePieceDto, UpdatePieceDto } from '../shared/dto/piece.dto';
export declare class PiecesController {
private readonly piecesService;
constructor(piecesService: PiecesService);
create(createPieceDto: CreatePieceDto): Promise<{
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}>;
findAll(): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
findByMachine(machineId: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
findByComposant(composantId: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
findOne(id: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}) | null>;
update(id: string, updatePieceDto: UpdatePieceDto): Promise<{
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}>;
remove(id: string): Promise<{
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;
}>;
}

100
dist/pieces/pieces.controller.js vendored Normal file
View File

@@ -0,0 +1,100 @@
"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.PiecesController = void 0;
const common_1 = require("@nestjs/common");
const pieces_service_1 = require("./pieces.service");
const piece_dto_1 = require("../shared/dto/piece.dto");
let PiecesController = class PiecesController {
piecesService;
constructor(piecesService) {
this.piecesService = piecesService;
}
create(createPieceDto) {
return this.piecesService.create(createPieceDto);
}
findAll() {
return this.piecesService.findAll();
}
findByMachine(machineId) {
return this.piecesService.findByMachine(machineId);
}
findByComposant(composantId) {
return this.piecesService.findByComposant(composantId);
}
findOne(id) {
return this.piecesService.findOne(id);
}
update(id, updatePieceDto) {
return this.piecesService.update(id, updatePieceDto);
}
remove(id) {
return this.piecesService.remove(id);
}
};
exports.PiecesController = PiecesController;
__decorate([
(0, common_1.Post)(),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [piece_dto_1.CreatePieceDto]),
__metadata("design:returntype", void 0)
], PiecesController.prototype, "create", null);
__decorate([
(0, common_1.Get)(),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], PiecesController.prototype, "findAll", null);
__decorate([
(0, common_1.Get)('machine/:machineId'),
__param(0, (0, common_1.Param)('machineId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], PiecesController.prototype, "findByMachine", null);
__decorate([
(0, common_1.Get)('composant/:composantId'),
__param(0, (0, common_1.Param)('composantId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], PiecesController.prototype, "findByComposant", 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)
], PiecesController.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, piece_dto_1.UpdatePieceDto]),
__metadata("design:returntype", void 0)
], PiecesController.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)
], PiecesController.prototype, "remove", null);
exports.PiecesController = PiecesController = __decorate([
(0, common_1.Controller)('pieces'),
__metadata("design:paramtypes", [pieces_service_1.PiecesService])
], PiecesController);
//# sourceMappingURL=pieces.controller.js.map

1
dist/pieces/pieces.controller.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"pieces.controller.js","sourceRoot":"","sources":["../../src/pieces/pieces.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,qDAAiD;AACjD,uDAAyE;AAGlE,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACE;IAA7B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAG7D,MAAM,CAAS,cAA8B;QAC3C,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAGD,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IAGD,aAAa,CAAqB,SAAiB;QACjD,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAGD,eAAe,CAAuB,WAAmB;QACvD,OAAO,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ored Normal file
View File

@@ -0,0 +1,2 @@
export declare class PiecesModule {
}

22
dist/pieces/pieces.module.js vendored Normal file
View 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.PiecesModule = void 0;
const common_1 = require("@nestjs/common");
const pieces_controller_1 = require("./pieces.controller");
const pieces_service_1 = require("./pieces.service");
let PiecesModule = class PiecesModule {
};
exports.PiecesModule = PiecesModule;
exports.PiecesModule = PiecesModule = __decorate([
(0, common_1.Module)({
controllers: [pieces_controller_1.PiecesController],
providers: [pieces_service_1.PiecesService]
})
], PiecesModule);
//# sourceMappingURL=pieces.module.js.map

1
dist/pieces/pieces.module.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"pieces.module.js","sourceRoot":"","sources":["../../src/pieces/pieces.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2DAAuD;AACvD,qDAAiD;AAM1C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,CAAC;KAC3B,CAAC;GACW,YAAY,CAAG"}

373
dist/pieces/pieces.service.d.ts vendored Normal file
View File

@@ -0,0 +1,373 @@
import { PrismaService } from '../prisma/prisma.service';
import { CreatePieceDto, UpdatePieceDto } from '../shared/dto/piece.dto';
export declare class PiecesService {
private prisma;
constructor(prisma: PrismaService);
create(createPieceDto: CreatePieceDto): Promise<{
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}>;
findAll(): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
findOne(id: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}) | null>;
findByMachine(machineId: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
findByComposant(composantId: string): Promise<({
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
})[]>;
update(id: string, updatePieceDto: UpdatePieceDto): Promise<{
typePiece: {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
} | null;
machine: {
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;
} | null;
composant: {
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;
} | null;
documents: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
machineId: string | null;
composantId: string | null;
pieceId: string | null;
filename: string;
path: string;
mimeType: string;
size: number;
}[];
} & {
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;
}>;
remove(id: string): Promise<{
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;
}>;
}

97
dist/pieces/pieces.service.js vendored Normal file
View File

@@ -0,0 +1,97 @@
"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.PiecesService = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("../prisma/prisma.service");
let PiecesService = class PiecesService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async create(createPieceDto) {
return this.prisma.piece.create({
data: createPieceDto,
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async findAll() {
return this.prisma.piece.findMany({
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async findOne(id) {
return this.prisma.piece.findUnique({
where: { id },
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async findByMachine(machineId) {
return this.prisma.piece.findMany({
where: { machineId },
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async findByComposant(composantId) {
return this.prisma.piece.findMany({
where: { composantId },
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async update(id, updatePieceDto) {
return this.prisma.piece.update({
where: { id },
data: updatePieceDto,
include: {
machine: true,
composant: true,
typePiece: true,
documents: true,
},
});
}
async remove(id) {
return this.prisma.piece.delete({
where: { id },
});
}
};
exports.PiecesService = PiecesService;
exports.PiecesService = PiecesService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], PiecesService);
//# sourceMappingURL=pieces.service.js.map

1
dist/pieces/pieces.service.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"pieces.service.js","sourceRoot":"","sources":["../../src/pieces/pieces.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAIlD,IAAM,aAAa,GAAnB,MAAM,aAAa;IACJ;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,cAA8B;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAC9B,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YAChC,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;YAClC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,SAAS,EAA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vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare class PrismaModule {
}

22
dist/prisma/prisma.module.js vendored Normal file
View 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.PrismaModule = void 0;
const common_1 = require("@nestjs/common");
const prisma_service_1 = require("./prisma.service");
let PrismaModule = class PrismaModule {
};
exports.PrismaModule = PrismaModule;
exports.PrismaModule = PrismaModule = __decorate([
(0, common_1.Global)(),
(0, common_1.Module)({
providers: [prisma_service_1.PrismaService],
exports: [prisma_service_1.PrismaService],
})
], PrismaModule);
//# sourceMappingURL=prisma.module.js.map

1
dist/prisma/prisma.module.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../../src/prisma/prisma.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAgD;AAChD,qDAAiD;AAO1C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IALxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}

7
dist/prisma/prisma.service.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
constructor();
onModuleInit(): Promise<void>;
onModuleDestroy(): Promise<void>;
}

33
dist/prisma/prisma.service.js vendored Normal file
View File

@@ -0,0 +1,33 @@
"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.PrismaService = void 0;
const common_1 = require("@nestjs/common");
const client_1 = require("@prisma/client");
let PrismaService = class PrismaService extends client_1.PrismaClient {
constructor() {
super({
log: ['query', 'info', 'warn', 'error'],
});
}
async onModuleInit() {
await this.$connect();
}
async onModuleDestroy() {
await this.$disconnect();
}
};
exports.PrismaService = PrismaService;
exports.PrismaService = PrismaService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [])
], PrismaService);
//# sourceMappingURL=prisma.service.js.map

1
dist/prisma/prisma.service.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"prisma.service.js","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qBAAY;IAC7C;QACE,KAAK,CAAC;YACJ,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF,CAAA;AAdY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;;GACA,aAAa,CAczB"}

18
dist/shared/dto/composant.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
export declare class CreateComposantDto {
name: string;
machineId?: string;
parentComposantId?: string;
reference?: string;
prestataire?: string;
prix?: number | null;
emplacement?: string;
typeComposantId?: string;
}
export declare class UpdateComposantDto {
name?: string;
reference?: string;
prestataire?: string;
prix?: number | null;
emplacement?: string;
typeComposantId?: string;
}

106
dist/shared/dto/composant.dto.js vendored Normal file
View File

@@ -0,0 +1,106 @@
"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.UpdateComposantDto = exports.CreateComposantDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class CreateComposantDto {
name;
machineId;
parentComposantId;
reference;
prestataire;
prix;
emplacement;
typeComposantId;
}
exports.CreateComposantDto = CreateComposantDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "machineId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "parentComposantId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Transform)(({ value }) => value === '' ? null : value),
(0, class_validator_1.IsNumber)({}, { message: 'prix must be a valid number' }),
__metadata("design:type", Object)
], CreateComposantDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateComposantDto.prototype, "typeComposantId", void 0);
class UpdateComposantDto {
name;
reference;
prestataire;
prix;
emplacement;
typeComposantId;
}
exports.UpdateComposantDto = UpdateComposantDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateComposantDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateComposantDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateComposantDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Transform)(({ value }) => value === '' ? null : value),
(0, class_validator_1.IsNumber)({}, { message: 'prix must be a valid number' }),
__metadata("design:type", Object)
], UpdateComposantDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateComposantDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateComposantDto.prototype, "typeComposantId", void 0);
//# sourceMappingURL=composant.dto.js.map

1
dist/shared/dto/composant.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"composant.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/composant.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AACjE,yDAA8C;AAE9C,MAAa,kBAAkB;IAE7B,IAAI,CAAS;IAIb,SAAS,CAAU;IAInB,iBAAiB,CAAU;IAI3B,SAAS,CAAU;IAInB,WAAW,CAAU;IAKrB,IAAI,CAAiB;IAIrB,WAAW,CAAU;IAIrB,eAAe,CAAU;CAC1B;AAhCD,gDAgCC;AA9BC;IADC,IAAA,0BAAQ,GAAE;;gDACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;6DACgB;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACU;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;;gDACpC;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACc;AAG3B,MAAa,kBAAkB;IAG7B,IAAI,CAAU;IAId,SAAS,CAAU;IAInB,WAAW,CAAU;IAKrB,IAAI,CAAiB;IAIrB,WAAW,CAAU;IAIrB,eAAe,CAAU;CAC1B;AAzBD,gDAyBC;AAtBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACU;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;;gDACpC;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACc"}

10
dist/shared/dto/custom-field.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
export declare class CreateCustomFieldValueDto {
customFieldId: string;
value: string;
machineId?: string;
composantId?: string;
pieceId?: string;
}
export declare class UpdateCustomFieldValueDto {
value?: string;
}

56
dist/shared/dto/custom-field.dto.js vendored Normal file
View File

@@ -0,0 +1,56 @@
"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.UpdateCustomFieldValueDto = exports.CreateCustomFieldValueDto = void 0;
const class_validator_1 = require("class-validator");
class CreateCustomFieldValueDto {
customFieldId;
value;
machineId;
composantId;
pieceId;
}
exports.CreateCustomFieldValueDto = CreateCustomFieldValueDto;
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", String)
], CreateCustomFieldValueDto.prototype, "customFieldId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", String)
], CreateCustomFieldValueDto.prototype, "value", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCustomFieldValueDto.prototype, "machineId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCustomFieldValueDto.prototype, "composantId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCustomFieldValueDto.prototype, "pieceId", void 0);
class UpdateCustomFieldValueDto {
value;
}
exports.UpdateCustomFieldValueDto = UpdateCustomFieldValueDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateCustomFieldValueDto.prototype, "value", void 0);
//# sourceMappingURL=custom-field.dto.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"custom-field.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/custom-field.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmE;AAEnE,MAAa,yBAAyB;IAGpC,aAAa,CAAS;IAItB,KAAK,CAAS;IAId,SAAS,CAAU;IAInB,WAAW,CAAU;IAIrB,OAAO,CAAU;CAClB;AApBD,8DAoBC;AAjBC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gEACS;AAItB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACC;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8DACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACM;AAGnB,MAAa,yBAAyB;IAGpC,KAAK,CAAU;CAChB;AAJD,8DAIC;AADC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACI"}

17
dist/shared/dto/document.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
export declare class CreateDocumentDto {
name: string;
filename: string;
path: string;
mimeType: string;
size: number;
machineId?: string;
composantId?: string;
pieceId?: string;
}
export declare class UpdateDocumentDto {
name?: string;
filename?: string;
path?: string;
mimeType?: string;
size?: number;
}

93
dist/shared/dto/document.dto.js vendored Normal file
View File

@@ -0,0 +1,93 @@
"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.UpdateDocumentDto = exports.CreateDocumentDto = void 0;
const class_validator_1 = require("class-validator");
class CreateDocumentDto {
name;
filename;
path;
mimeType;
size;
machineId;
composantId;
pieceId;
}
exports.CreateDocumentDto = CreateDocumentDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "filename", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "path", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "mimeType", void 0);
__decorate([
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], CreateDocumentDto.prototype, "size", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "machineId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "composantId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateDocumentDto.prototype, "pieceId", void 0);
class UpdateDocumentDto {
name;
filename;
path;
mimeType;
size;
}
exports.UpdateDocumentDto = UpdateDocumentDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateDocumentDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateDocumentDto.prototype, "filename", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateDocumentDto.prototype, "path", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateDocumentDto.prototype, "mimeType", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsNumber)(),
__metadata("design:type", Number)
], UpdateDocumentDto.prototype, "size", void 0);
//# sourceMappingURL=document.dto.js.map

1
dist/shared/dto/document.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"document.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/document.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAEjE,MAAa,iBAAiB;IAE5B,IAAI,CAAS;IAGb,QAAQ,CAAS;IAGjB,IAAI,CAAS;IAGb,QAAQ,CAAS;IAGjB,IAAI,CAAS;IAIb,SAAS,CAAU;IAInB,WAAW,CAAU;IAIrB,OAAO,CAAU;CAClB;AA3BD,8CA2BC;AAzBC;IADC,IAAA,0BAAQ,GAAE;;+CACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;mDACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;+CACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;mDACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;+CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACM;AAGnB,MAAa,iBAAiB;IAG5B,IAAI,CAAU;IAId,QAAQ,CAAU;IAIlB,IAAI,CAAU;IAId,QAAQ,CAAU;IAIlB,IAAI,CAAU;CACf;AApBD,8CAoBC;AAjBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACG"}

17
dist/shared/dto/machine.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
export declare class CreateMachineDto {
name: string;
siteId: string;
reference?: string;
prestataire?: string;
prix?: string;
emplacement?: string;
typeMachineId?: string;
}
export declare class UpdateMachineDto {
name?: string;
reference?: string;
prestataire?: string;
prix?: string;
emplacement?: string;
typeMachineId?: string;
}

96
dist/shared/dto/machine.dto.js vendored Normal file
View File

@@ -0,0 +1,96 @@
"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.UpdateMachineDto = exports.CreateMachineDto = void 0;
const class_validator_1 = require("class-validator");
class CreateMachineDto {
name;
siteId;
reference;
prestataire;
prix;
emplacement;
typeMachineId;
}
exports.CreateMachineDto = CreateMachineDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "siteId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsDecimal)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateMachineDto.prototype, "typeMachineId", void 0);
class UpdateMachineDto {
name;
reference;
prestataire;
prix;
emplacement;
typeMachineId;
}
exports.UpdateMachineDto = UpdateMachineDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsDecimal)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateMachineDto.prototype, "typeMachineId", void 0);
//# sourceMappingURL=machine.dto.js.map

1
dist/shared/dto/machine.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"machine.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/machine.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4E;AAE5E,MAAa,gBAAgB;IAE3B,IAAI,CAAS;IAGb,MAAM,CAAS;IAIf,SAAS,CAAU;IAInB,WAAW,CAAU;IAIrB,IAAI,CAAU;IAId,WAAW,CAAU;IAIrB,aAAa,CAAU;CACxB;AA1BD,4CA0BC;AAxBC;IADC,IAAA,0BAAQ,GAAE;;8CACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;gDACI;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;8CACE;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACY;AAGzB,MAAa,gBAAgB;IAG3B,IAAI,CAAU;IAId,SAAS,CAAU;IAInB,WAAW,CAAU;IAIrB,IAAI,CAAU;IAId,WAAW,CAAU;IAIrB,aAAa,CAAU;CACxB;AAxBD,4CAwBC;AArBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;8CACE;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACY"}

18
dist/shared/dto/piece.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
export declare class CreatePieceDto {
name: string;
machineId?: string;
composantId?: string;
reference?: string;
prestataire?: string;
prix?: number | null;
emplacement?: string;
typePieceId?: string;
}
export declare class UpdatePieceDto {
name?: string;
reference?: string;
prestataire?: string;
prix?: number | null;
emplacement?: string;
typePieceId?: string;
}

106
dist/shared/dto/piece.dto.js vendored Normal file
View File

@@ -0,0 +1,106 @@
"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.UpdatePieceDto = exports.CreatePieceDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class CreatePieceDto {
name;
machineId;
composantId;
reference;
prestataire;
prix;
emplacement;
typePieceId;
}
exports.CreatePieceDto = CreatePieceDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "machineId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "composantId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Transform)(({ value }) => value === '' ? null : value),
(0, class_validator_1.IsNumber)({}, { message: 'prix must be a valid number' }),
__metadata("design:type", Object)
], CreatePieceDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreatePieceDto.prototype, "typePieceId", void 0);
class UpdatePieceDto {
name;
reference;
prestataire;
prix;
emplacement;
typePieceId;
}
exports.UpdatePieceDto = UpdatePieceDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdatePieceDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdatePieceDto.prototype, "reference", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdatePieceDto.prototype, "prestataire", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Transform)(({ value }) => value === '' ? null : value),
(0, class_validator_1.IsNumber)({}, { message: 'prix must be a valid number' }),
__metadata("design:type", Object)
], UpdatePieceDto.prototype, "prix", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdatePieceDto.prototype, "emplacement", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdatePieceDto.prototype, "typePieceId", void 0);
//# sourceMappingURL=piece.dto.js.map

1
dist/shared/dto/piece.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"piece.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/piece.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AACjE,yDAA8C;AAE9C,MAAa,cAAc;IAEzB,IAAI,CAAS;IAIb,SAAS,CAAU;IAInB,WAAW,CAAU;IAIrB,SAAS,CAAU;IAInB,WAAW,CAAU;IAKrB,IAAI,CAAiB;IA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AAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,IAAA,0BAAQ,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;;4CACpC;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACU"}

8
dist/shared/dto/site.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
export declare class CreateSiteDto {
name: string;
description?: string;
}
export declare class UpdateSiteDto {
name?: string;
description?: string;
}

43
dist/shared/dto/site.dto.js vendored Normal file
View File

@@ -0,0 +1,43 @@
"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.UpdateSiteDto = exports.CreateSiteDto = void 0;
const class_validator_1 = require("class-validator");
class CreateSiteDto {
name;
description;
}
exports.CreateSiteDto = CreateSiteDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateSiteDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateSiteDto.prototype, "description", void 0);
class UpdateSiteDto {
name;
description;
}
exports.UpdateSiteDto = UpdateSiteDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateSiteDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateSiteDto.prototype, "description", void 0);
//# sourceMappingURL=site.dto.js.map

1
dist/shared/dto/site.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"site.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/site.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,aAAa;IAExB,IAAI,CAAS;IAIb,WAAW,CAAU;CACtB;AAPD,sCAOC;AALC;IADC,IAAA,0BAAQ,GAAE;;2CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACU;AAGvB,MAAa,aAAa;IAGxB,IAAI,CAAU;IAId,WAAW,CAAU;CACtB;AARD,sCAQC;AALC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACU"}

59
dist/shared/dto/type.dto.d.ts vendored Normal file
View File

@@ -0,0 +1,59 @@
export declare enum CustomFieldType {
TEXT = "text",
NUMBER = "number",
SELECT = "select",
BOOLEAN = "boolean",
DATE = "date"
}
export declare class CreateCustomFieldDto {
name: string;
type: CustomFieldType;
required?: boolean;
defaultValue?: string;
options?: string[];
}
export declare class UpdateCustomFieldDto {
name?: string;
type?: CustomFieldType;
required?: boolean;
defaultValue?: string;
options?: string[];
}
export declare class CreateTypeMachineDto {
name: string;
description?: string;
category?: string;
maintenanceFrequency?: string;
components?: any[];
machinePieces?: string[];
customFields?: CreateCustomFieldDto[];
}
export declare class UpdateTypeMachineDto {
name?: string;
description?: string;
category?: string;
maintenanceFrequency?: string;
components?: any[];
machinePieces?: string[];
customFields?: CreateCustomFieldDto[];
}
export declare class CreateTypeComposantDto {
name: string;
description?: string;
customFields?: CreateCustomFieldDto[];
}
export declare class UpdateTypeComposantDto {
name?: string;
description?: string;
customFields?: CreateCustomFieldDto[];
}
export declare class CreateTypePieceDto {
name: string;
description?: string;
customFields?: CreateCustomFieldDto[];
}
export declare class UpdateTypePieceDto {
name?: string;
description?: string;
customFields?: CreateCustomFieldDto[];
}

257
dist/shared/dto/type.dto.js vendored Normal file
View File

@@ -0,0 +1,257 @@
"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.UpdateTypePieceDto = exports.CreateTypePieceDto = exports.UpdateTypeComposantDto = exports.CreateTypeComposantDto = exports.UpdateTypeMachineDto = exports.CreateTypeMachineDto = exports.UpdateCustomFieldDto = exports.CreateCustomFieldDto = exports.CustomFieldType = void 0;
const class_validator_1 = require("class-validator");
var CustomFieldType;
(function (CustomFieldType) {
CustomFieldType["TEXT"] = "text";
CustomFieldType["NUMBER"] = "number";
CustomFieldType["SELECT"] = "select";
CustomFieldType["BOOLEAN"] = "boolean";
CustomFieldType["DATE"] = "date";
})(CustomFieldType || (exports.CustomFieldType = CustomFieldType = {}));
class CreateCustomFieldDto {
name;
type;
required;
defaultValue;
options;
}
exports.CreateCustomFieldDto = CreateCustomFieldDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCustomFieldDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsEnum)(CustomFieldType),
__metadata("design:type", String)
], CreateCustomFieldDto.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], CreateCustomFieldDto.prototype, "required", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCustomFieldDto.prototype, "defaultValue", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateCustomFieldDto.prototype, "options", void 0);
class UpdateCustomFieldDto {
name;
type;
required;
defaultValue;
options;
}
exports.UpdateCustomFieldDto = UpdateCustomFieldDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateCustomFieldDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(CustomFieldType),
__metadata("design:type", String)
], UpdateCustomFieldDto.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], UpdateCustomFieldDto.prototype, "required", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateCustomFieldDto.prototype, "defaultValue", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateCustomFieldDto.prototype, "options", void 0);
class CreateTypeMachineDto {
name;
description;
category;
maintenanceFrequency;
components;
machinePieces;
customFields;
}
exports.CreateTypeMachineDto = CreateTypeMachineDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeMachineDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeMachineDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeMachineDto.prototype, "category", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeMachineDto.prototype, "maintenanceFrequency", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateTypeMachineDto.prototype, "components", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateTypeMachineDto.prototype, "machinePieces", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateTypeMachineDto.prototype, "customFields", void 0);
class UpdateTypeMachineDto {
name;
description;
category;
maintenanceFrequency;
components;
machinePieces;
customFields;
}
exports.UpdateTypeMachineDto = UpdateTypeMachineDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeMachineDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeMachineDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeMachineDto.prototype, "category", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeMachineDto.prototype, "maintenanceFrequency", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateTypeMachineDto.prototype, "components", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateTypeMachineDto.prototype, "machinePieces", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateTypeMachineDto.prototype, "customFields", void 0);
class CreateTypeComposantDto {
name;
description;
customFields;
}
exports.CreateTypeComposantDto = CreateTypeComposantDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeComposantDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypeComposantDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateTypeComposantDto.prototype, "customFields", void 0);
class UpdateTypeComposantDto {
name;
description;
customFields;
}
exports.UpdateTypeComposantDto = UpdateTypeComposantDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeComposantDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypeComposantDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateTypeComposantDto.prototype, "customFields", void 0);
class CreateTypePieceDto {
name;
description;
customFields;
}
exports.CreateTypePieceDto = CreateTypePieceDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypePieceDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateTypePieceDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], CreateTypePieceDto.prototype, "customFields", void 0);
class UpdateTypePieceDto {
name;
description;
customFields;
}
exports.UpdateTypePieceDto = UpdateTypePieceDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypePieceDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateTypePieceDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
__metadata("design:type", Array)
], UpdateTypePieceDto.prototype, "customFields", void 0);
//# sourceMappingURL=type.dto.js.map

1
dist/shared/dto/type.dto.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"type.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/type.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6F;AAE7F,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;AACf,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,MAAa,oBAAoB;IAE/B,IAAI,CAAS;IAGb,IAAI,CAAkB;IAItB,QAAQ,CAAW;IAInB,YAAY,CAAU;IAItB,OAAO,CAAY;CACpB;AAlBD,oDAkBC;AAhBC;IADC,IAAA,0BAAQ,GAAE;;kDACE;AAGb;IADC,IAAA,wBAAM,EAAC,eAAe,CAAC;;kDACF;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;sDACO;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;qDACS;AAGrB,MAAa,oBAAoB;IAG/B,IAAI,CAAU;IAId,IAAI,CAAmB;IAIvB,QAAQ,CAAW;IAInB,YAAY,CAAU;IAItB,OAAO,CAAY;CACpB;AApBD,oDAoBC;AAjBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,eAAe,CAAC;;kDACD;AAIvB;IAFC,IAAA,4BA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,GAAE;;uDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;wDAC4B"}

215
dist/sites/sites.controller.d.ts vendored Normal file
View 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
View 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
View 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
View File

@@ -0,0 +1,2 @@
export declare class SitesModule {
}

22
dist/sites/sites.module.js vendored Normal file
View 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
View 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
View 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
View 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
View File

@@ -0,0 +1 @@
{"version":3,"file":"sites.service.js","sourceRoot":"","sources":["../../src/sites/sites.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAIlD,IAAM,YAAY,GAAlB,MAAM,YAAY;IACH;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,aAA4B;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC7B,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;IACL,CAAC;IAED,KA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AAG,CAAC,EAAE,CAAC;YAC9B,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChE,MAAM,IAAI,KAAK,CACb,mDAAmD,cAAc,CAAC,MAAM,gBAAgB,YAAY,IAAI;gBACxG,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC7B,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5EY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,YAAY,CA4ExB"}

1
dist/tsconfig.build.tsbuildinfo vendored Normal file

File diff suppressed because one or more lines are too long

385
dist/types/types.controller.d.ts vendored Normal file
View File

@@ -0,0 +1,385 @@
import { TypesService } from './types.service';
import { CreateTypeMachineDto, UpdateTypeMachineDto, CreateTypeComposantDto, UpdateTypeComposantDto, CreateTypePieceDto, UpdateTypePieceDto } from '../shared/dto/type.dto';
export declare class TypesController {
private readonly typesService;
constructor(typesService: TypesService);
createTypeMachine(createTypeMachineDto: CreateTypeMachineDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
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;
}>;
findAllTypeMachines(): Promise<({
machines: {
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
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;
})[]>;
findOneTypeMachine(id: string): Promise<({
machines: {
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
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>;
updateTypeMachine(id: string, updateTypeMachineDto: UpdateTypeMachineDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
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;
}>;
removeTypeMachine(id: string): Promise<{
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;
}>;
createTypeComposant(createTypeComposantDto: CreateTypeComposantDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
findAllTypeComposants(): Promise<({
composants: {
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
})[]>;
findOneTypeComposant(id: string): Promise<({
composants: {
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}) | null>;
updateTypeComposant(id: string, updateTypeComposantDto: UpdateTypeComposantDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
removeTypeComposant(id: string): Promise<{
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
createTypePiece(createTypePieceDto: CreateTypePieceDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
findAllTypePieces(): Promise<({
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
})[]>;
findOneTypePiece(id: string): Promise<({
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;
}[];
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}) | null>;
updateTypePiece(id: string, updateTypePieceDto: UpdateTypePieceDto): Promise<{
customFields: {
name: string;
id: string;
createdAt: Date;
updatedAt: Date;
typeMachineId: string | null;
type: string;
required: boolean;
defaultValue: string | null;
options: string[];
typeComposantId: string | null;
typePieceId: string | null;
}[];
} & {
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
removeTypePiece(id: string): Promise<{
name: string;
description: string | null;
id: string;
createdAt: Date;
updatedAt: Date;
}>;
}

180
dist/types/types.controller.js vendored Normal file
View File

@@ -0,0 +1,180 @@
"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.TypesController = void 0;
const common_1 = require("@nestjs/common");
const types_service_1 = require("./types.service");
const type_dto_1 = require("../shared/dto/type.dto");
let TypesController = class TypesController {
typesService;
constructor(typesService) {
this.typesService = typesService;
}
createTypeMachine(createTypeMachineDto) {
return this.typesService.createTypeMachine(createTypeMachineDto);
}
findAllTypeMachines() {
return this.typesService.findAllTypeMachines();
}
findOneTypeMachine(id) {
return this.typesService.findOneTypeMachine(id);
}
updateTypeMachine(id, updateTypeMachineDto) {
return this.typesService.updateTypeMachine(id, updateTypeMachineDto);
}
removeTypeMachine(id) {
return this.typesService.removeTypeMachine(id);
}
createTypeComposant(createTypeComposantDto) {
return this.typesService.createTypeComposant(createTypeComposantDto);
}
findAllTypeComposants() {
return this.typesService.findAllTypeComposants();
}
findOneTypeComposant(id) {
return this.typesService.findOneTypeComposant(id);
}
updateTypeComposant(id, updateTypeComposantDto) {
return this.typesService.updateTypeComposant(id, updateTypeComposantDto);
}
removeTypeComposant(id) {
return this.typesService.removeTypeComposant(id);
}
createTypePiece(createTypePieceDto) {
return this.typesService.createTypePiece(createTypePieceDto);
}
findAllTypePieces() {
return this.typesService.findAllTypePieces();
}
findOneTypePiece(id) {
return this.typesService.findOneTypePiece(id);
}
updateTypePiece(id, updateTypePieceDto) {
return this.typesService.updateTypePiece(id, updateTypePieceDto);
}
removeTypePiece(id) {
return this.typesService.removeTypePiece(id);
}
};
exports.TypesController = TypesController;
__decorate([
(0, common_1.Post)('machines'),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [type_dto_1.CreateTypeMachineDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "createTypeMachine", null);
__decorate([
(0, common_1.Get)('machines'),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findAllTypeMachines", null);
__decorate([
(0, common_1.Get)('machines/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findOneTypeMachine", null);
__decorate([
(0, common_1.Patch)('machines/:id'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, type_dto_1.UpdateTypeMachineDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "updateTypeMachine", null);
__decorate([
(0, common_1.Delete)('machines/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "removeTypeMachine", null);
__decorate([
(0, common_1.Post)('composants'),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [type_dto_1.CreateTypeComposantDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "createTypeComposant", null);
__decorate([
(0, common_1.Get)('composants'),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findAllTypeComposants", null);
__decorate([
(0, common_1.Get)('composants/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findOneTypeComposant", null);
__decorate([
(0, common_1.Patch)('composants/:id'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, type_dto_1.UpdateTypeComposantDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "updateTypeComposant", null);
__decorate([
(0, common_1.Delete)('composants/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "removeTypeComposant", null);
__decorate([
(0, common_1.Post)('pieces'),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [type_dto_1.CreateTypePieceDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "createTypePiece", null);
__decorate([
(0, common_1.Get)('pieces'),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findAllTypePieces", null);
__decorate([
(0, common_1.Get)('pieces/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "findOneTypePiece", null);
__decorate([
(0, common_1.Patch)('pieces/:id'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, type_dto_1.UpdateTypePieceDto]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "updateTypePiece", null);
__decorate([
(0, common_1.Delete)('pieces/:id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], TypesController.prototype, "removeTypePiece", null);
exports.TypesController = TypesController = __decorate([
(0, common_1.Controller)('types'),
__metadata("design:paramtypes", [types_service_1.TypesService])
], TypesController);
//# sourceMappingURL=types.controller.js.map

1
dist/types/types.controller.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.controller.js","sourceRoot":"","sources":["../../src/types/types.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,mDAA+C;AAC/C,qDAOgC;AAGzB,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAI3D,iBAAiB,CAAS,oBAA0C;QAClE,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACnE,CAAC;IAGD,mBAAmB;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;IACjD,CAAC;IAGD,kBAAkB,CAAc,EAAU;QACxC,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IAGD,iBAAiB,CAAc,EAAU,EAAU,oBAA0C;QAC3F,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAC;IACvE,CAAC;IAGD,iBAAiB,CAAc,EAAU;QACvC,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAID,mBAAmB,CAAS,sBAA8C;QACxE,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IACvE,CAAC;IAGD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,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sDAE3B;0BA/EU,eAAe;IAD3B,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAEyB,4BAAY;GAD5C,eAAe,CAgF3B"}

2
dist/types/types.module.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare class TypesModule {
}

22
dist/types/types.module.js vendored Normal file
View 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.TypesModule = void 0;
const common_1 = require("@nestjs/common");
const types_controller_1 = require("./types.controller");
const types_service_1 = require("./types.service");
let TypesModule = class TypesModule {
};
exports.TypesModule = TypesModule;
exports.TypesModule = TypesModule = __decorate([
(0, common_1.Module)({
controllers: [types_controller_1.TypesController],
providers: [types_service_1.TypesService]
})
], TypesModule);
//# sourceMappingURL=types.module.js.map

1
dist/types/types.module.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.module.js","sourceRoot":"","sources":["../../src/types/types.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"}

Some files were not shown because too many files have changed in this diff Show More