feat: add profiles session API
This commit is contained in:
46
dist/constructeurs/constructeurs.controller.d.ts
vendored
Normal file
46
dist/constructeurs/constructeurs.controller.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
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
Normal file
81
dist/constructeurs/constructeurs.controller.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
"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
dist/constructeurs/constructeurs.controller.js.map
vendored
Normal file
1
dist/constructeurs/constructeurs.controller.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"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
Normal file
2
dist/constructeurs/constructeurs.module.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare class ConstructeursModule {
|
||||
}
|
||||
23
dist/constructeurs/constructeurs.module.js
vendored
Normal file
23
dist/constructeurs/constructeurs.module.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"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
dist/constructeurs/constructeurs.module.js.map
vendored
Normal file
1
dist/constructeurs/constructeurs.module.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"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
Normal file
47
dist/constructeurs/constructeurs.service.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
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
Normal file
77
dist/constructeurs/constructeurs.service.js
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"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
dist/constructeurs/constructeurs.service.js.map
vendored
Normal file
1
dist/constructeurs/constructeurs.service.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"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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