set gitignore for dist folder
This commit is contained in:
6
dist/app.controller.d.ts
vendored
6
dist/app.controller.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
import { AppService } from './app.service';
|
||||
export declare class AppController {
|
||||
private readonly appService;
|
||||
constructor(appService: AppService);
|
||||
getHello(): string;
|
||||
}
|
||||
35
dist/app.controller.js
vendored
35
dist/app.controller.js
vendored
@@ -1,35 +0,0 @@
|
||||
"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
1
dist/app.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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
2
dist/app.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class AppModule {
|
||||
}
|
||||
50
dist/app.module.js
vendored
50
dist/app.module.js
vendored
@@ -1,50 +0,0 @@
|
||||
"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");
|
||||
const constructeurs_module_1 = require("./constructeurs/constructeurs.module");
|
||||
const profiles_module_1 = require("./profiles/profiles.module");
|
||||
const session_module_1 = require("./session/session.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,
|
||||
constructeurs_module_1.ConstructeursModule,
|
||||
profiles_module_1.ProfilesModule,
|
||||
session_module_1.SessionModule,
|
||||
],
|
||||
controllers: [app_controller_1.AppController],
|
||||
providers: [app_service_1.AppService],
|
||||
})
|
||||
], AppModule);
|
||||
//# sourceMappingURL=app.module.js.map
|
||||
1
dist/app.module.js.map
vendored
1
dist/app.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;AAC1E,+EAA2E;AAC3E,gEAA4D;AAC5D,6DAAyD;AAsBlD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IApBrB,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;YAClB,0CAAmB;YACnB,gCAAc;YACd,8BAAa;SACd;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG"}
|
||||
3
dist/app.service.d.ts
vendored
3
dist/app.service.d.ts
vendored
@@ -1,3 +0,0 @@
|
||||
export declare class AppService {
|
||||
getHello(): string;
|
||||
}
|
||||
20
dist/app.service.js
vendored
20
dist/app.service.js
vendored
@@ -1,20 +0,0 @@
|
||||
"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
1
dist/app.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
1322
dist/composants/composants.controller.d.ts
vendored
1322
dist/composants/composants.controller.d.ts
vendored
File diff suppressed because it is too large
Load Diff
100
dist/composants/composants.controller.js
vendored
100
dist/composants/composants.controller.js
vendored
@@ -1,100 +0,0 @@
|
||||
"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
|
||||
1
dist/composants/composants.controller.js.map
vendored
1
dist/composants/composants.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;QACj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
|
||||
2
dist/composants/composants.module.d.ts
vendored
2
dist/composants/composants.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class ComposantsModule {
|
||||
}
|
||||
22
dist/composants/composants.module.js
vendored
22
dist/composants/composants.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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
|
||||
1
dist/composants/composants.module.js.map
vendored
1
dist/composants/composants.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
1322
dist/composants/composants.service.d.ts
vendored
1322
dist/composants/composants.service.d.ts
vendored
File diff suppressed because it is too large
Load Diff
298
dist/composants/composants.service.js
vendored
298
dist/composants/composants.service.js
vendored
@@ -1,298 +0,0 @@
|
||||
"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,
|
||||
constructeur: 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,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
documents: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.composant.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
machine: true,
|
||||
parentComposant: true,
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
documents: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByMachine(machineId) {
|
||||
return this.prisma.composant.findMany({
|
||||
where: { machineId },
|
||||
include: {
|
||||
machine: true,
|
||||
parentComposant: true,
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
pieces: true,
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
documents: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findHierarchy(machineId) {
|
||||
const rootComposants = await this.prisma.composant.findMany({
|
||||
where: {
|
||||
machineId,
|
||||
parentComposantId: null
|
||||
},
|
||||
include: {
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
return rootComposants;
|
||||
}
|
||||
async update(id, updateComposantDto) {
|
||||
return this.prisma.composant.update({
|
||||
where: { id },
|
||||
data: updateComposantDto,
|
||||
include: {
|
||||
machine: true,
|
||||
parentComposant: true,
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
sousComposants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: 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
|
||||
1
dist/composants/composants.service.js.map
vendored
1
dist/composants/composants.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;g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AEiB,8BAAa;GAD9B,iBAAiB,CA2R7B"}
|
||||
46
dist/constructeurs/constructeurs.controller.d.ts
vendored
46
dist/constructeurs/constructeurs.controller.d.ts
vendored
@@ -1,46 +0,0 @@
|
||||
import { ConstructeursService } from './constructeurs.service';
|
||||
import { CreateConstructeurDto, UpdateConstructeurDto } from '../shared/dto/constructeur.dto';
|
||||
export declare class ConstructeursController {
|
||||
private readonly constructeursService;
|
||||
constructor(constructeursService: ConstructeursService);
|
||||
create(payload: CreateConstructeurDto): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
findAll(search?: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}[]>;
|
||||
findOne(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null>;
|
||||
update(id: string, payload: UpdateConstructeurDto): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
}
|
||||
81
dist/constructeurs/constructeurs.controller.js
vendored
81
dist/constructeurs/constructeurs.controller.js
vendored
@@ -1,81 +0,0 @@
|
||||
"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.ConstructeursController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const constructeurs_service_1 = require("./constructeurs.service");
|
||||
const constructeur_dto_1 = require("../shared/dto/constructeur.dto");
|
||||
let ConstructeursController = class ConstructeursController {
|
||||
constructeursService;
|
||||
constructor(constructeursService) {
|
||||
this.constructeursService = constructeursService;
|
||||
}
|
||||
create(payload) {
|
||||
return this.constructeursService.create(payload);
|
||||
}
|
||||
findAll(search) {
|
||||
return this.constructeursService.findAll(search);
|
||||
}
|
||||
findOne(id) {
|
||||
return this.constructeursService.findOne(id);
|
||||
}
|
||||
update(id, payload) {
|
||||
return this.constructeursService.update(id, payload);
|
||||
}
|
||||
remove(id) {
|
||||
return this.constructeursService.remove(id);
|
||||
}
|
||||
};
|
||||
exports.ConstructeursController = ConstructeursController;
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [constructeur_dto_1.CreateConstructeurDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ConstructeursController.prototype, "create", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__param(0, (0, common_1.Query)('search')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ConstructeursController.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)
|
||||
], ConstructeursController.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, constructeur_dto_1.UpdateConstructeurDto]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], ConstructeursController.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)
|
||||
], ConstructeursController.prototype, "remove", null);
|
||||
exports.ConstructeursController = ConstructeursController = __decorate([
|
||||
(0, common_1.Controller)('constructeurs'),
|
||||
__metadata("design:paramtypes", [constructeurs_service_1.ConstructeursService])
|
||||
], ConstructeursController);
|
||||
//# sourceMappingURL=constructeurs.controller.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constructeurs.controller.js","sourceRoot":"","sources":["../../src/constructeurs/constructeurs.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,mEAA8D;AAC9D,qEAA6F;AAGtF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACL;IAA7B,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAG3E,MAAM,CAAS,OAA8B;QAC3C,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAGD,OAAO,CAAkB,MAAe;QACtC,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAClD,CAAC;IAGD,OAAO,CAAc,EAAU;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC9C,CAAC;IAGD,MAAM,CAAc,EAAU,EAAU,OAA8B;QACpE,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IAGD,MAAM,CAAc,EAAU;QAC5B,OAAO,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC7C,CAAC;CACF,CAAA;AA3BY,0DAAuB;AAIlC;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAU,wCAAqB;;qDAE5C;AAGD;IADC,IAAA,YAAG,GAAE;IACG,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;sDAEvB;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sDAEnB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAU,wCAAqB;;qDAErE;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;qDAElB;kCA1BU,uBAAuB;IADnC,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAEyB,4CAAoB;GAD5D,uBAAuB,CA2BnC"}
|
||||
2
dist/constructeurs/constructeurs.module.d.ts
vendored
2
dist/constructeurs/constructeurs.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class ConstructeursModule {
|
||||
}
|
||||
23
dist/constructeurs/constructeurs.module.js
vendored
23
dist/constructeurs/constructeurs.module.js
vendored
@@ -1,23 +0,0 @@
|
||||
"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.ConstructeursModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const constructeurs_service_1 = require("./constructeurs.service");
|
||||
const constructeurs_controller_1 = require("./constructeurs.controller");
|
||||
let ConstructeursModule = class ConstructeursModule {
|
||||
};
|
||||
exports.ConstructeursModule = ConstructeursModule;
|
||||
exports.ConstructeursModule = ConstructeursModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
controllers: [constructeurs_controller_1.ConstructeursController],
|
||||
providers: [constructeurs_service_1.ConstructeursService],
|
||||
exports: [constructeurs_service_1.ConstructeursService],
|
||||
})
|
||||
], ConstructeursModule);
|
||||
//# sourceMappingURL=constructeurs.module.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constructeurs.module.js","sourceRoot":"","sources":["../../src/constructeurs/constructeurs.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,mEAA8D;AAC9D,yEAAoE;AAO7D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAL/B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,kDAAuB,CAAC;QACtC,SAAS,EAAE,CAAC,4CAAoB,CAAC;QACjC,OAAO,EAAE,CAAC,4CAAoB,CAAC;KAChC,CAAC;GACW,mBAAmB,CAAG"}
|
||||
47
dist/constructeurs/constructeurs.service.d.ts
vendored
47
dist/constructeurs/constructeurs.service.d.ts
vendored
@@ -1,47 +0,0 @@
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { CreateConstructeurDto, UpdateConstructeurDto } from '../shared/dto/constructeur.dto';
|
||||
export declare class ConstructeursService {
|
||||
private prisma;
|
||||
constructor(prisma: PrismaService);
|
||||
private buildSearchWhere;
|
||||
create(data: CreateConstructeurDto): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
findAll(search?: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}[]>;
|
||||
findOne(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null>;
|
||||
update(id: string, data: UpdateConstructeurDto): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
}>;
|
||||
}
|
||||
77
dist/constructeurs/constructeurs.service.js
vendored
77
dist/constructeurs/constructeurs.service.js
vendored
@@ -1,77 +0,0 @@
|
||||
"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.ConstructeursService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const prisma_service_1 = require("../prisma/prisma.service");
|
||||
let ConstructeursService = class ConstructeursService {
|
||||
prisma;
|
||||
constructor(prisma) {
|
||||
this.prisma = prisma;
|
||||
}
|
||||
buildSearchWhere(search) {
|
||||
if (!search)
|
||||
return {};
|
||||
const term = search.trim();
|
||||
if (!term)
|
||||
return {};
|
||||
return {
|
||||
OR: [
|
||||
{ name: { contains: term, mode: 'insensitive' } },
|
||||
{ email: { contains: term, mode: 'insensitive' } },
|
||||
{ phone: { contains: term, mode: 'insensitive' } },
|
||||
],
|
||||
};
|
||||
}
|
||||
async create(data) {
|
||||
return this.prisma.constructeur.create({
|
||||
data: {
|
||||
...data,
|
||||
name: data.name.trim(),
|
||||
email: data.email?.trim(),
|
||||
phone: data.phone?.trim(),
|
||||
},
|
||||
});
|
||||
}
|
||||
async findAll(search) {
|
||||
return this.prisma.constructeur.findMany({
|
||||
where: this.buildSearchWhere(search),
|
||||
orderBy: { name: 'asc' },
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.constructeur.findUnique({
|
||||
where: { id },
|
||||
});
|
||||
}
|
||||
async update(id, data) {
|
||||
return this.prisma.constructeur.update({
|
||||
where: { id },
|
||||
data: {
|
||||
...data,
|
||||
name: data.name?.trim(),
|
||||
email: data.email?.trim(),
|
||||
phone: data.phone?.trim(),
|
||||
},
|
||||
});
|
||||
}
|
||||
async remove(id) {
|
||||
return this.prisma.constructeur.delete({
|
||||
where: { id },
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.ConstructeursService = ConstructeursService;
|
||||
exports.ConstructeursService = ConstructeursService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
|
||||
], ConstructeursService);
|
||||
//# sourceMappingURL=constructeurs.service.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constructeurs.service.js","sourceRoot":"","sources":["../../src/constructeurs/constructeurs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6DAAwD;AAKjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACX;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAErC,gBAAgB,CAAC,MAAe;QACtC,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAA;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;QAC1B,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAA;QACpB,OAAO;YACL,EAAE,EAAE;gBACF,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;gBACjD,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;gBAClD,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;aACnD;SACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAA2B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;YACrC,IAAI,EAAE;gBACJ,GAAG,IAAI;gBACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;gBACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;aAC1B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAe;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;YACvC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;YACpC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;YACzC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAA2B;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;YACrC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI,EAAE;gBACJ,GAAG,IAAI;gBACP,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;gBACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;gBACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE;aAC1B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;YACrC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAzDY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,oBAAoB,CAyDhC"}
|
||||
141
dist/custom-fields/custom-fields.controller.d.ts
vendored
141
dist/custom-fields/custom-fields.controller.d.ts
vendored
@@ -1,141 +0,0 @@
|
||||
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;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
findCustomFieldValuesByEntity(entityType: string, entityId: string): Promise<({
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
})[]>;
|
||||
findOneCustomFieldValue(id: string): Promise<({
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}) | null>;
|
||||
updateCustomFieldValue(id: string, updateCustomFieldValueDto: UpdateCustomFieldValueDto): Promise<{
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
removeCustomFieldValue(id: string): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
upsertCustomFieldValue(body: {
|
||||
customFieldId: string;
|
||||
entityType: string;
|
||||
entityId: string;
|
||||
value: string;
|
||||
}): Promise<{
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
}
|
||||
92
dist/custom-fields/custom-fields.controller.js
vendored
92
dist/custom-fields/custom-fields.controller.js
vendored
@@ -1,92 +0,0 @@
|
||||
"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
|
||||
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
2
dist/custom-fields/custom-fields.module.d.ts
vendored
2
dist/custom-fields/custom-fields.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class CustomFieldsModule {
|
||||
}
|
||||
25
dist/custom-fields/custom-fields.module.js
vendored
25
dist/custom-fields/custom-fields.module.js
vendored
@@ -1,25 +0,0 @@
|
||||
"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
|
||||
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
136
dist/custom-fields/custom-fields.service.d.ts
vendored
136
dist/custom-fields/custom-fields.service.d.ts
vendored
@@ -1,136 +0,0 @@
|
||||
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;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
findCustomFieldValuesByEntity(entityType: string, entityId: string): Promise<({
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
})[]>;
|
||||
findOneCustomFieldValue(id: string): Promise<({
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}) | null>;
|
||||
updateCustomFieldValue(id: string, updateCustomFieldValueDto: UpdateCustomFieldValueDto): Promise<{
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
removeCustomFieldValue(id: string): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
upsertCustomFieldValue(customFieldId: string, entityType: string, entityId: string, value: string): Promise<{
|
||||
customField: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
typeMachineId: string | null;
|
||||
typePieceId: string | null;
|
||||
typeComposantId: string | null;
|
||||
type: string;
|
||||
required: boolean;
|
||||
defaultValue: string | null;
|
||||
options: string[];
|
||||
};
|
||||
} & {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
pieceId: string | null;
|
||||
value: string;
|
||||
customFieldId: string;
|
||||
}>;
|
||||
}
|
||||
96
dist/custom-fields/custom-fields.service.js
vendored
96
dist/custom-fields/custom-fields.service.js
vendored
@@ -1,96 +0,0 @@
|
||||
"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
|
||||
@@ -1 +0,0 @@
|
||||
{"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,yB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,IAAI,CAAC,EAAE,QAAQ;aAC9B;SACF,CAAC,CAAC;QAEH,IAAI,aAAa,EAAE,CAAC;YAElB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;gBACzC,KAAK,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC,EAAE,EAAE;gBAC/B,IAAI,EAAE,EAAE,KAAK,EAAE;gBACf,OAAO,EAAE;oBACP,WAAW,EAAE,IAAI;iBAClB;aACF,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YAEN,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;gBACzC,IAAI,EAAE;oBACJ,aAAa;oBACb,KAAK;oBACL,CAAC,UAAU,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"}
|
||||
532
dist/documents/documents.controller.d.ts
vendored
532
dist/documents/documents.controller.d.ts
vendored
@@ -1,532 +0,0 @@
|
||||
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<{
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findByMachine(machineId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findByComposant(composantId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findByPiece(pieceId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findBySite(siteId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}) | null>;
|
||||
update(id: string, updateDocumentDto: UpdateDocumentDto): Promise<{
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
}
|
||||
120
dist/documents/documents.controller.js
vendored
120
dist/documents/documents.controller.js
vendored
@@ -1,120 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
findBySite(siteId) {
|
||||
return this.documentsService.findBySite(siteId);
|
||||
}
|
||||
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)('site/:siteId'),
|
||||
__param(0, (0, common_1.Param)('siteId')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], DocumentsController.prototype, "findBySite", 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
|
||||
1
dist/documents/documents.controller.js.map
vendored
1
dist/documents/documents.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;IAGD,WAAW,CAAmB,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EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAoB,gCAAiB;;iDAE3E;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;iDAElB;8BA9CU,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,WAAW,CAAC;qCAEyB,oCAAgB;GADpD,mBAAmB,CA+C/B"}
|
||||
2
dist/documents/documents.module.d.ts
vendored
2
dist/documents/documents.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class DocumentsModule {
|
||||
}
|
||||
22
dist/documents/documents.module.js
vendored
22
dist/documents/documents.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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
|
||||
1
dist/documents/documents.module.js.map
vendored
1
dist/documents/documents.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
532
dist/documents/documents.service.d.ts
vendored
532
dist/documents/documents.service.d.ts
vendored
@@ -1,532 +0,0 @@
|
||||
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<{
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}) | null>;
|
||||
findByMachine(machineId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findByComposant(composantId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findByPiece(pieceId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
findBySite(siteId: string): Promise<({
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
})[]>;
|
||||
update(id: string, updateDocumentDto: UpdateDocumentDto): Promise<{
|
||||
site: {
|
||||
name: string;
|
||||
contactName: string;
|
||||
contactPhone: string;
|
||||
contactAddress: string;
|
||||
contactPostalCode: string;
|
||||
contactCity: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
piece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
} | null;
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
remove(id: string): Promise<{
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}>;
|
||||
}
|
||||
119
dist/documents/documents.service.js
vendored
119
dist/documents/documents.service.js
vendored
@@ -1,119 +0,0 @@
|
||||
"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,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findAll() {
|
||||
return this.prisma.document.findMany({
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.document.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByMachine(machineId) {
|
||||
return this.prisma.document.findMany({
|
||||
where: { machineId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByComposant(composantId) {
|
||||
return this.prisma.document.findMany({
|
||||
where: { composantId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByPiece(pieceId) {
|
||||
return this.prisma.document.findMany({
|
||||
where: { pieceId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findBySite(siteId) {
|
||||
return this.prisma.document.findMany({
|
||||
where: { siteId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async update(id, updateDocumentDto) {
|
||||
return this.prisma.document.update({
|
||||
where: { id },
|
||||
data: updateDocumentDto,
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
piece: true,
|
||||
site: 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
|
||||
1
dist/documents/documents.service.js.map
vendored
1
dist/documents/documents.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;gBACX,IAAI,EAAE,IAAI;aACX;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;gBACf,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;aACX;SACF,CAAC,CAAC;IACL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C,KAAK,EAAE,EAAE,MAAM,EAAE;YACjB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;aACX;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,iBAAoC;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YACjC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;aACX;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;AAxGY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,gBAAgB,CAwG5B"}
|
||||
1245
dist/machines/machines.controller.d.ts
vendored
1245
dist/machines/machines.controller.d.ts
vendored
File diff suppressed because it is too large
Load Diff
90
dist/machines/machines.controller.js
vendored
90
dist/machines/machines.controller.js
vendored
@@ -1,90 +0,0 @@
|
||||
"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
|
||||
1
dist/machines/machines.controller.js.map
vendored
1
dist/machines/machines.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"machines.controller.js","sourceRoot":"","sources":["../../src/machines/machines.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,yDAAqD;AACrD,2DAA+E;AAGxE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAGjE,MAAM,CAAS,gBAAkC;QAC/C,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC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
|
||||
2
dist/machines/machines.module.d.ts
vendored
2
dist/machines/machines.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class MachinesModule {
|
||||
}
|
||||
22
dist/machines/machines.module.js
vendored
22
dist/machines/machines.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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
1
dist/machines/machines.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
1249
dist/machines/machines.service.d.ts
vendored
1249
dist/machines/machines.service.d.ts
vendored
File diff suppressed because it is too large
Load Diff
730
dist/machines/machines.service.js
vendored
730
dist/machines/machines.service.js
vendored
@@ -1,730 +0,0 @@
|
||||
"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,
|
||||
constructeur: 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,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: 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 || '',
|
||||
constructeurId: await this.resolveConstructeurId(prisma, component.constructeur),
|
||||
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 || '',
|
||||
constructeurId: await this.resolveConstructeurId(prisma, piece.constructeur),
|
||||
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,
|
||||
constructeurId: await this.resolveConstructeurId(prisma, piece.constructeur),
|
||||
},
|
||||
});
|
||||
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,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
documents: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.machine.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
site: true,
|
||||
typeMachine: {
|
||||
include: {
|
||||
customFields: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
constructeur: 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,
|
||||
},
|
||||
},
|
||||
constructeur: true,
|
||||
composants: {
|
||||
include: {
|
||||
typeComposant: true,
|
||||
sousComposants: true,
|
||||
constructeur: true,
|
||||
pieces: {
|
||||
include: {
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pieces: {
|
||||
include: {
|
||||
constructeur: true,
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
customFieldValues: {
|
||||
include: {
|
||||
customField: true,
|
||||
},
|
||||
},
|
||||
documents: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async resolveConstructeurId(prisma, rawName) {
|
||||
if (!rawName)
|
||||
return null;
|
||||
const name = String(rawName).trim();
|
||||
if (!name)
|
||||
return null;
|
||||
const existing = await prisma.constructeur.findFirst({
|
||||
where: {
|
||||
name: {
|
||||
equals: name,
|
||||
mode: 'insensitive',
|
||||
},
|
||||
},
|
||||
});
|
||||
if (existing)
|
||||
return existing.id;
|
||||
const created = await prisma.constructeur.create({
|
||||
data: { name },
|
||||
});
|
||||
return created.id;
|
||||
}
|
||||
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
1
dist/machines/machines.service.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/main.d.ts
vendored
1
dist/main.d.ts
vendored
@@ -1 +0,0 @@
|
||||
export {};
|
||||
55
dist/main.js
vendored
55
dist/main.js
vendored
@@ -1,55 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core_1 = require("@nestjs/core");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const session = require("express-session");
|
||||
const express_1 = require("express");
|
||||
const app_module_1 = require("./app.module");
|
||||
async function bootstrap() {
|
||||
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
||||
app.set('trust proxy', 1);
|
||||
const requestSizeLimit = process.env.REQUEST_SIZE_LIMIT || '10mb';
|
||||
app.use((0, express_1.json)({ limit: requestSizeLimit }));
|
||||
app.use((0, express_1.urlencoded)({ limit: requestSizeLimit, extended: true }));
|
||||
const sessionCookieSecure = process.env.SESSION_COOKIE_SECURE
|
||||
? process.env.SESSION_COOKIE_SECURE === 'true'
|
||||
: process.env.NODE_ENV === 'production';
|
||||
app.use(session({
|
||||
secret: process.env.SESSION_SECRET || 'change-me',
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
cookie: {
|
||||
httpOnly: true,
|
||||
sameSite: process.env.SESSION_SAME_SITE ?? 'lax',
|
||||
secure: sessionCookieSecure,
|
||||
maxAge: Number(process.env.SESSION_MAX_AGE ?? 1000 * 60 * 60 * 24 * 7),
|
||||
},
|
||||
}));
|
||||
const allowedOrigins = process.env.CORS_ORIGIN
|
||||
? process.env.CORS_ORIGIN.split(',').map(origin => origin.trim())
|
||||
: ['http://localhost:3001'];
|
||||
app.enableCors({
|
||||
origin: (origin, callback) => {
|
||||
if (!origin || allowedOrigins.includes(origin)) {
|
||||
callback(null, true);
|
||||
}
|
||||
else {
|
||||
callback(new Error(`Origin ${origin} not allowed by CORS`));
|
||||
}
|
||||
},
|
||||
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 = Number(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
1
dist/main.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAgD;AAEhD,2CAA2C;AAC3C,qCAA2C;AAC3C,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,sBAAS,CAAC,CAAC;IAExE,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAE1B,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,CAAC;IAClE,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAC3C,GAAG,CAAC,GAAG,CAAC,IAAA,oBAAU,EAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CA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;QACD,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,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;IAEJ,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,KAAK,CAAC;IAClD,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC9C,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;AAED,SAAS,EAAE,CAAC"}
|
||||
427
dist/pieces/pieces.controller.d.ts
vendored
427
dist/pieces/pieces.controller.d.ts
vendored
@@ -1,427 +0,0 @@
|
||||
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;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
findByMachine(machineId: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
findByComposant(composantId: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}) | null>;
|
||||
update(id: string, updatePieceDto: UpdatePieceDto): Promise<{
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: 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;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}>;
|
||||
}
|
||||
100
dist/pieces/pieces.controller.js
vendored
100
dist/pieces/pieces.controller.js
vendored
@@ -1,100 +0,0 @@
|
||||
"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
1
dist/pieces/pieces.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;IAG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CAAA;;;;8CAElB;2BApCU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAEyB,8BAAa;GAD9C,gBAAgB,CAqC5B"}
|
||||
2
dist/pieces/pieces.module.d.ts
vendored
2
dist/pieces/pieces.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class PiecesModule {
|
||||
}
|
||||
22
dist/pieces/pieces.module.js
vendored
22
dist/pieces/pieces.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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
1
dist/pieces/pieces.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
427
dist/pieces/pieces.service.d.ts
vendored
427
dist/pieces/pieces.service.d.ts
vendored
@@ -1,427 +0,0 @@
|
||||
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;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}>;
|
||||
findAll(): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
findOne(id: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}) | null>;
|
||||
findByMachine(machineId: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
findByComposant(composantId: string): Promise<({
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
})[]>;
|
||||
update(id: string, updatePieceDto: UpdatePieceDto): Promise<{
|
||||
typePiece: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
description: string | null;
|
||||
} | null;
|
||||
machine: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
siteId: string;
|
||||
typeMachineId: string | null;
|
||||
constructeurId: string | null;
|
||||
} | null;
|
||||
composant: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
parentComposantId: string | null;
|
||||
typeComposantId: string | null;
|
||||
} | null;
|
||||
constructeur: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
email: string | null;
|
||||
phone: string | null;
|
||||
} | null;
|
||||
documents: {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
siteId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
pieceId: string | null;
|
||||
}[];
|
||||
} & {
|
||||
name: string;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
reference: string | null;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: 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;
|
||||
prix: import("@prisma/client/runtime/library").Decimal | null;
|
||||
emplacement: string | null;
|
||||
constructeurId: string | null;
|
||||
machineId: string | null;
|
||||
composantId: string | null;
|
||||
typePieceId: string | null;
|
||||
}>;
|
||||
}
|
||||
103
dist/pieces/pieces.service.js
vendored
103
dist/pieces/pieces.service.js
vendored
@@ -1,103 +0,0 @@
|
||||
"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,
|
||||
constructeur: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findAll() {
|
||||
return this.prisma.piece.findMany({
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
typePiece: true,
|
||||
documents: true,
|
||||
constructeur: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findOne(id) {
|
||||
return this.prisma.piece.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
typePiece: true,
|
||||
documents: true,
|
||||
constructeur: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByMachine(machineId) {
|
||||
return this.prisma.piece.findMany({
|
||||
where: { machineId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
typePiece: true,
|
||||
documents: true,
|
||||
constructeur: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findByComposant(composantId) {
|
||||
return this.prisma.piece.findMany({
|
||||
where: { composantId },
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
typePiece: true,
|
||||
documents: true,
|
||||
constructeur: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async update(id, updatePieceDto) {
|
||||
return this.prisma.piece.update({
|
||||
where: { id },
|
||||
data: updatePieceDto,
|
||||
include: {
|
||||
machine: true,
|
||||
composant: true,
|
||||
typePiece: true,
|
||||
documents: true,
|
||||
constructeur: 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
1
dist/pieces/pieces.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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,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;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,cAA8B;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAC9B,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,IAAI;aACnB;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAC9B,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAtFY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,aAAa,CAsFzB"}
|
||||
2
dist/prisma/prisma.module.d.ts
vendored
2
dist/prisma/prisma.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class PrismaModule {
|
||||
}
|
||||
22
dist/prisma/prisma.module.js
vendored
22
dist/prisma/prisma.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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
1
dist/prisma/prisma.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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
7
dist/prisma/prisma.service.d.ts
vendored
@@ -1,7 +0,0 @@
|
||||
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
33
dist/prisma/prisma.service.js
vendored
@@ -1,33 +0,0 @@
|
||||
"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
1
dist/prisma/prisma.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
29
dist/profiles/profiles.controller.d.ts
vendored
29
dist/profiles/profiles.controller.d.ts
vendored
@@ -1,29 +0,0 @@
|
||||
import { ProfilesService } from './profiles.service';
|
||||
import { CreateProfileDto } from '../shared/dto/profile.dto';
|
||||
export declare class ProfilesController {
|
||||
private readonly profilesService;
|
||||
constructor(profilesService: ProfilesService);
|
||||
findAll(): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
}[]>;
|
||||
create(dto: CreateProfileDto): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
}>;
|
||||
delete(id: string): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
} | null>;
|
||||
}
|
||||
59
dist/profiles/profiles.controller.js
vendored
59
dist/profiles/profiles.controller.js
vendored
@@ -1,59 +0,0 @@
|
||||
"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.ProfilesController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const profiles_service_1 = require("./profiles.service");
|
||||
const profile_dto_1 = require("../shared/dto/profile.dto");
|
||||
let ProfilesController = class ProfilesController {
|
||||
profilesService;
|
||||
constructor(profilesService) {
|
||||
this.profilesService = profilesService;
|
||||
}
|
||||
async findAll() {
|
||||
return this.profilesService.findAllActive();
|
||||
}
|
||||
async create(dto) {
|
||||
return this.profilesService.create(dto);
|
||||
}
|
||||
async delete(id) {
|
||||
return this.profilesService.deactivate(id);
|
||||
}
|
||||
};
|
||||
exports.ProfilesController = ProfilesController;
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", Promise)
|
||||
], ProfilesController.prototype, "findAll", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [profile_dto_1.CreateProfileDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], ProfilesController.prototype, "create", 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", Promise)
|
||||
], ProfilesController.prototype, "delete", null);
|
||||
exports.ProfilesController = ProfilesController = __decorate([
|
||||
(0, common_1.Controller)('profiles'),
|
||||
__metadata("design:paramtypes", [profiles_service_1.ProfilesService])
|
||||
], ProfilesController);
|
||||
//# sourceMappingURL=profiles.controller.js.map
|
||||
1
dist/profiles/profiles.controller.js.map
vendored
1
dist/profiles/profiles.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"profiles.controller.js","sourceRoot":"","sources":["../../src/profiles/profiles.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2E;AAC3E,yDAAoD;AACpD,2DAA4D;AAGrD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAG3D,AAAN,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAA;IAC7C,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,GAAqB;QACxC,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACzC,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAc,EAAU;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAjBY,gDAAkB;AAIvB;IADL,IAAA,YAAG,GAAE;;;;iDAGL;AAGK;IADL,IAAA,aAAI,GAAE;IACO,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,8BAAgB;;gDAEzC;AAGK;IADL,IAAA,eAAM,EAAC,KAAK,CAAC;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;gDAExB;6BAhBU,kBAAkB;IAD9B,IAAA,mBAAU,EAAC,UAAU,CAAC;qCAEyB,kCAAe;GADlD,kBAAkB,CAiB9B"}
|
||||
2
dist/profiles/profiles.module.d.ts
vendored
2
dist/profiles/profiles.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class ProfilesModule {
|
||||
}
|
||||
23
dist/profiles/profiles.module.js
vendored
23
dist/profiles/profiles.module.js
vendored
@@ -1,23 +0,0 @@
|
||||
"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.ProfilesModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const profiles_controller_1 = require("./profiles.controller");
|
||||
const profiles_service_1 = require("./profiles.service");
|
||||
let ProfilesModule = class ProfilesModule {
|
||||
};
|
||||
exports.ProfilesModule = ProfilesModule;
|
||||
exports.ProfilesModule = ProfilesModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
controllers: [profiles_controller_1.ProfilesController],
|
||||
providers: [profiles_service_1.ProfilesService],
|
||||
exports: [profiles_service_1.ProfilesService],
|
||||
})
|
||||
], ProfilesModule);
|
||||
//# sourceMappingURL=profiles.module.js.map
|
||||
1
dist/profiles/profiles.module.js.map
vendored
1
dist/profiles/profiles.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"profiles.module.js","sourceRoot":"","sources":["../../src/profiles/profiles.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,+DAA0D;AAC1D,yDAAoD;AAO7C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
|
||||
40
dist/profiles/profiles.service.d.ts
vendored
40
dist/profiles/profiles.service.d.ts
vendored
@@ -1,40 +0,0 @@
|
||||
import { OnModuleInit } from '@nestjs/common';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { CreateProfileDto } from '../shared/dto/profile.dto';
|
||||
export declare class ProfilesService implements OnModuleInit {
|
||||
private readonly prisma;
|
||||
constructor(prisma: PrismaService);
|
||||
onModuleInit(): Promise<void>;
|
||||
findAllActive(): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
}[]>;
|
||||
findActiveById(profileId: string): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
} | null>;
|
||||
create(dto: CreateProfileDto): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
}>;
|
||||
deactivate(profileId: string): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
} | null>;
|
||||
private ensureDefaultProfile;
|
||||
}
|
||||
126
dist/profiles/profiles.service.js
vendored
126
dist/profiles/profiles.service.js
vendored
@@ -1,126 +0,0 @@
|
||||
"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.ProfilesService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const prisma_service_1 = require("../prisma/prisma.service");
|
||||
let ProfilesService = class ProfilesService {
|
||||
prisma;
|
||||
constructor(prisma) {
|
||||
this.prisma = prisma;
|
||||
}
|
||||
async onModuleInit() {
|
||||
await this.ensureDefaultProfile();
|
||||
}
|
||||
async findAllActive() {
|
||||
return this.prisma.profile.findMany({
|
||||
where: { isActive: true },
|
||||
orderBy: { createdAt: 'asc' },
|
||||
select: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async findActiveById(profileId) {
|
||||
if (!profileId)
|
||||
return null;
|
||||
return this.prisma.profile.findFirst({
|
||||
where: {
|
||||
id: profileId,
|
||||
isActive: true,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async create(dto) {
|
||||
const firstName = dto.firstName.trim();
|
||||
const lastName = dto.lastName.trim();
|
||||
if (!firstName || !lastName) {
|
||||
throw new common_1.BadRequestException('Le prénom et le nom sont obligatoires.');
|
||||
}
|
||||
return this.prisma.profile.create({
|
||||
data: {
|
||||
firstName,
|
||||
lastName,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async deactivate(profileId) {
|
||||
const existing = await this.prisma.profile.findUnique({ where: { id: profileId } });
|
||||
if (!existing) {
|
||||
throw new common_1.NotFoundException('Profil introuvable');
|
||||
}
|
||||
if (!existing.isActive) {
|
||||
return this.prisma.profile.findUnique({
|
||||
where: { id: profileId },
|
||||
select: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
return this.prisma.profile.update({
|
||||
where: { id: profileId },
|
||||
data: { isActive: false },
|
||||
select: {
|
||||
id: true,
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
isActive: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
async ensureDefaultProfile() {
|
||||
const count = await this.prisma.profile.count({ where: { isActive: true } });
|
||||
if (count > 0)
|
||||
return;
|
||||
const firstName = process.env.DEFAULT_PROFILE_FIRST_NAME?.trim() || 'Admin';
|
||||
const lastName = process.env.DEFAULT_PROFILE_LAST_NAME?.trim() || 'Général';
|
||||
await this.prisma.profile.create({
|
||||
data: {
|
||||
firstName,
|
||||
lastName,
|
||||
isActive: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.ProfilesService = ProfilesService;
|
||||
exports.ProfilesService = ProfilesService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
|
||||
], ProfilesService);
|
||||
//# sourceMappingURL=profiles.service.js.map
|
||||
1
dist/profiles/profiles.service.js.map
vendored
1
dist/profiles/profiles.service.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"profiles.service.js","sourceRoot":"","sources":["../../src/profiles/profiles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiG;AACjG,6DAAwD;AAIjD,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,O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,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAC5E,IAAI,KAAK,GAAG,CAAC;YAAE,OAAM;QAErB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,EAAE,IAAI,OAAO,CAAA;QAC3E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,EAAE,IAAI,SAAS,CAAA;QAE3E,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE;gBACJ,SAAS;gBACT,QAAQ;gBACR,QAAQ,EAAE,IAAI;aACf;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAjHY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAE0B,8BAAa;GADvC,eAAe,CAiH3B"}
|
||||
24
dist/session/session.controller.d.ts
vendored
24
dist/session/session.controller.d.ts
vendored
@@ -1,24 +0,0 @@
|
||||
import { Request } from 'express';
|
||||
import { ProfilesService } from '../profiles/profiles.service';
|
||||
import { ActivateProfileDto } from '../shared/dto/profile.dto';
|
||||
export declare class ProfileSessionController {
|
||||
private readonly profilesService;
|
||||
constructor(profilesService: ProfilesService);
|
||||
getActiveProfile(req: Request): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
}>;
|
||||
activateProfile(req: Request, dto: ActivateProfileDto): Promise<{
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
isActive: boolean;
|
||||
}>;
|
||||
logout(req: Request): Promise<unknown>;
|
||||
}
|
||||
87
dist/session/session.controller.js
vendored
87
dist/session/session.controller.js
vendored
@@ -1,87 +0,0 @@
|
||||
"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.ProfileSessionController = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const profiles_service_1 = require("../profiles/profiles.service");
|
||||
const profile_dto_1 = require("../shared/dto/profile.dto");
|
||||
let ProfileSessionController = class ProfileSessionController {
|
||||
profilesService;
|
||||
constructor(profilesService) {
|
||||
this.profilesService = profilesService;
|
||||
}
|
||||
async getActiveProfile(req) {
|
||||
if (!req.session?.profileId) {
|
||||
throw new common_1.UnauthorizedException('Aucun profil actif.');
|
||||
}
|
||||
const profile = await this.profilesService.findActiveById(req.session.profileId);
|
||||
if (!profile) {
|
||||
req.session.profileId = undefined;
|
||||
throw new common_1.UnauthorizedException('Profil introuvable ou inactif.');
|
||||
}
|
||||
return profile;
|
||||
}
|
||||
async activateProfile(req, dto) {
|
||||
if (!dto.profileId) {
|
||||
throw new common_1.BadRequestException('profileId est requis.');
|
||||
}
|
||||
const profile = await this.profilesService.findActiveById(dto.profileId);
|
||||
if (!profile) {
|
||||
throw new common_1.UnauthorizedException('Profil introuvable ou inactif.');
|
||||
}
|
||||
req.session.profileId = profile.id;
|
||||
return profile;
|
||||
}
|
||||
async logout(req) {
|
||||
if (!req.session) {
|
||||
return { success: true };
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
req.session.destroy((err) => {
|
||||
if (err) {
|
||||
return reject(new common_1.BadRequestException('Impossible de déconnecter la session.'));
|
||||
}
|
||||
resolve({ success: true });
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.ProfileSessionController = ProfileSessionController;
|
||||
__decorate([
|
||||
(0, common_1.Get)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], ProfileSessionController.prototype, "getActiveProfile", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, profile_dto_1.ActivateProfileDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], ProfileSessionController.prototype, "activateProfile", null);
|
||||
__decorate([
|
||||
(0, common_1.Delete)(),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], ProfileSessionController.prototype, "logout", null);
|
||||
exports.ProfileSessionController = ProfileSessionController = __decorate([
|
||||
(0, common_1.Controller)('session/profile'),
|
||||
__metadata("design:paramtypes", [profiles_service_1.ProfilesService])
|
||||
], ProfileSessionController);
|
||||
//# sourceMappingURL=session.controller.js.map
|
||||
1
dist/session/session.controller.js.map
vendored
1
dist/session/session.controller.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"session.controller.js","sourceRoot":"","sources":["../../src/session/session.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASuB;AAEvB,mEAA8D;AAC9D,2DAA8D;AAGvD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACN;IAA7B,YAA6B,eAAgC;QAAhC,oBAA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AC,GAAG,EAAE,EAAE;gBAC1B,IAAI,GAAG,EAAE,CAAC;oBACR,OAAO,MAAM,CAAC,IAAI,4BAAmB,CAAC,uCAAuC,CAAC,CAAC,CAAA;gBACjF,CAAC;gBACD,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;YAC5B,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhDY,4DAAwB;AAI7B;IADL,IAAA,YAAG,GAAE;IACkB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;gEAY5B;AAGK;IADL,IAAA,aAAI,GAAE;IACgB,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,gCAAkB;;+DAYzE;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,YAAG,GAAE,CAAA;;;;sDAalB;mCA/CU,wBAAwB;IADpC,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEkB,kCAAe;GADlD,wBAAwB,CAgDpC"}
|
||||
2
dist/session/session.module.d.ts
vendored
2
dist/session/session.module.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
export declare class SessionModule {
|
||||
}
|
||||
22
dist/session/session.module.js
vendored
22
dist/session/session.module.js
vendored
@@ -1,22 +0,0 @@
|
||||
"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.SessionModule = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const session_controller_1 = require("./session.controller");
|
||||
const profiles_module_1 = require("../profiles/profiles.module");
|
||||
let SessionModule = class SessionModule {
|
||||
};
|
||||
exports.SessionModule = SessionModule;
|
||||
exports.SessionModule = SessionModule = __decorate([
|
||||
(0, common_1.Module)({
|
||||
imports: [profiles_module_1.ProfilesModule],
|
||||
controllers: [session_controller_1.ProfileSessionController],
|
||||
})
|
||||
], SessionModule);
|
||||
//# sourceMappingURL=session.module.js.map
|
||||
1
dist/session/session.module.js.map
vendored
1
dist/session/session.module.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"session.module.js","sourceRoot":"","sources":["../../src/session/session.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,6DAA+D;AAC/D,iEAA4D;AAMrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAJzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,gCAAc,CAAC;QACzB,WAAW,EAAE,CAAC,6CAAwB,CAAC;KACxC,CAAC;GACW,aAAa,CAAG"}
|
||||
18
dist/shared/dto/composant.dto.d.ts
vendored
18
dist/shared/dto/composant.dto.d.ts
vendored
@@ -1,18 +0,0 @@
|
||||
export declare class CreateComposantDto {
|
||||
name: string;
|
||||
machineId?: string;
|
||||
parentComposantId?: string;
|
||||
reference?: string;
|
||||
constructeurId?: string;
|
||||
prix?: number | null;
|
||||
emplacement?: string;
|
||||
typeComposantId?: string;
|
||||
}
|
||||
export declare class UpdateComposantDto {
|
||||
name?: string;
|
||||
reference?: string;
|
||||
constructeurId?: string;
|
||||
prix?: number | null;
|
||||
emplacement?: string;
|
||||
typeComposantId?: string;
|
||||
}
|
||||
106
dist/shared/dto/composant.dto.js
vendored
106
dist/shared/dto/composant.dto.js
vendored
@@ -1,106 +0,0 @@
|
||||
"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;
|
||||
constructeurId;
|
||||
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, "constructeurId", 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;
|
||||
constructeurId;
|
||||
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, "constructeurId", 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
1
dist/shared/dto/composant.dto.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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,cAAc,CAAU;IAKxB,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;;0DACa;AAKxB;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,cAAc,CAAU;IAKxB,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;;0DACa;AAKxB;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/constructeur.dto.d.ts
vendored
10
dist/shared/dto/constructeur.dto.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
export declare class CreateConstructeurDto {
|
||||
name: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
}
|
||||
export declare class UpdateConstructeurDto {
|
||||
name?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
}
|
||||
55
dist/shared/dto/constructeur.dto.js
vendored
55
dist/shared/dto/constructeur.dto.js
vendored
@@ -1,55 +0,0 @@
|
||||
"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.UpdateConstructeurDto = exports.CreateConstructeurDto = void 0;
|
||||
const class_validator_1 = require("class-validator");
|
||||
class CreateConstructeurDto {
|
||||
name;
|
||||
email;
|
||||
phone;
|
||||
}
|
||||
exports.CreateConstructeurDto = CreateConstructeurDto;
|
||||
__decorate([
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateConstructeurDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsEmail)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateConstructeurDto.prototype, "email", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateConstructeurDto.prototype, "phone", void 0);
|
||||
class UpdateConstructeurDto {
|
||||
name;
|
||||
email;
|
||||
phone;
|
||||
}
|
||||
exports.UpdateConstructeurDto = UpdateConstructeurDto;
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], UpdateConstructeurDto.prototype, "name", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsEmail)(),
|
||||
__metadata("design:type", String)
|
||||
], UpdateConstructeurDto.prototype, "email", void 0);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], UpdateConstructeurDto.prototype, "phone", void 0);
|
||||
//# sourceMappingURL=constructeur.dto.js.map
|
||||
1
dist/shared/dto/constructeur.dto.js.map
vendored
1
dist/shared/dto/constructeur.dto.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"constructeur.dto.js","sourceRoot":"","sources":["../../../src/shared/dto/constructeur.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAE/D,MAAa,qBAAqB;IAEhC,IAAI,CAAQ;IAIZ,KAAK,CAAS;IAId,KAAK,CAAS;CACf;AAXD,sDAWC;AATC;IADC,IAAA,0BAAQ,GAAE;;mDACC;AAIZ;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;oDACI;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACG;AAGhB,MAAa,qBAAqB;IAGhC,IAAI,CAAS;IAIb,KAAK,CAAS;IAId,KAAK,CAAS;CACf;AAZD,sDAYC;AATC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;oDACI;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACG"}
|
||||
10
dist/shared/dto/custom-field.dto.d.ts
vendored
10
dist/shared/dto/custom-field.dto.d.ts
vendored
@@ -1,10 +0,0 @@
|
||||
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
56
dist/shared/dto/custom-field.dto.js
vendored
@@ -1,56 +0,0 @@
|
||||
"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
|
||||
1
dist/shared/dto/custom-field.dto.js.map
vendored
1
dist/shared/dto/custom-field.dto.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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"}
|
||||
19
dist/shared/dto/document.dto.d.ts
vendored
19
dist/shared/dto/document.dto.d.ts
vendored
@@ -1,19 +0,0 @@
|
||||
export declare class CreateDocumentDto {
|
||||
name: string;
|
||||
filename: string;
|
||||
path: string;
|
||||
mimeType: string;
|
||||
size: number;
|
||||
machineId?: string;
|
||||
composantId?: string;
|
||||
pieceId?: string;
|
||||
siteId?: string;
|
||||
}
|
||||
export declare class UpdateDocumentDto {
|
||||
name?: string;
|
||||
filename?: string;
|
||||
path?: string;
|
||||
mimeType?: string;
|
||||
size?: number;
|
||||
siteId?: string;
|
||||
}
|
||||
105
dist/shared/dto/document.dto.js
vendored
105
dist/shared/dto/document.dto.js
vendored
@@ -1,105 +0,0 @@
|
||||
"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;
|
||||
siteId;
|
||||
}
|
||||
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);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], CreateDocumentDto.prototype, "siteId", void 0);
|
||||
class UpdateDocumentDto {
|
||||
name;
|
||||
filename;
|
||||
path;
|
||||
mimeType;
|
||||
size;
|
||||
siteId;
|
||||
}
|
||||
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);
|
||||
__decorate([
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
(0, class_validator_1.IsString)(),
|
||||
__metadata("design:type", String)
|
||||
], UpdateDocumentDto.prototype, "siteId", void 0);
|
||||
//# sourceMappingURL=document.dto.js.map
|
||||
1
dist/shared/dto/document.dto.js.map
vendored
1
dist/shared/dto/document.dto.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"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;IAIjB,MAAM,CAAU;CACjB;AA/BD,8CA+BC;AA7BC;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;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACK;AAGlB,MAAa,iBAAiB;IAG5B,IAAI,CAAU;IAId,QAAQ,CAAU;IAIlB,IAAI,CAAU;IAId,QAAQ,CAAU;IAIlB,IAAI,CAAU;IAId,MAAM,CAAU;CACjB;AAxBD,8CAwBC;AArBC;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;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACK"}
|
||||
17
dist/shared/dto/machine.dto.d.ts
vendored
17
dist/shared/dto/machine.dto.d.ts
vendored
@@ -1,17 +0,0 @@
|
||||
export declare class CreateMachineDto {
|
||||
name: string;
|
||||
siteId: string;
|
||||
reference?: string;
|
||||
constructeurId?: string;
|
||||
prix?: string;
|
||||
emplacement?: string;
|
||||
typeMachineId?: string;
|
||||
}
|
||||
export declare class UpdateMachineDto {
|
||||
name?: string;
|
||||
reference?: string;
|
||||
constructeurId?: string;
|
||||
prix?: string;
|
||||
emplacement?: string;
|
||||
typeMachineId?: string;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user