@silexpert/core 0.4.132 → 0.4.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/api/resources/Vehicle.d.ts +1 -0
- package/es/api/resources/Vehicle.d.ts.map +1 -1
- package/es/api/resources/Vehicle.js +3 -0
- package/es/api/resources/Vehicle.js.map +1 -1
- package/es/types/Interface/api/society/UpdateSociety.d.ts +0 -1
- package/es/types/Interface/api/society/UpdateSociety.d.ts.map +1 -1
- package/es/types/Interface/api/society/UpdateSociety.js +0 -9
- package/es/types/Interface/api/society/UpdateSociety.js.map +1 -1
- package/es/utils/brands.d.ts +2 -1
- package/es/utils/brands.d.ts.map +1 -1
- package/es/utils/brands.js +7 -6
- package/es/utils/brands.js.map +1 -1
- package/js/api/resources/Vehicle.js +4 -0
- package/js/api/resources/Vehicle.js.map +1 -1
- package/js/types/Interface/api/society/UpdateSociety.js +0 -6
- package/js/types/Interface/api/society/UpdateSociety.js.map +1 -1
- package/js/utils/brands.js +8 -6
- package/js/utils/brands.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Vehicle.ts +4 -0
- package/ts/types/Interface/api/society/UpdateSociety.ts +0 -9
- package/ts/utils/brands.ts +8 -6
|
@@ -5,6 +5,7 @@ import { Resource } from '../Resource';
|
|
|
5
5
|
export declare class Vehicle extends Resource {
|
|
6
6
|
getAllFromSocietyId(idSociety: number): Promise<ISocietyVehicle[]>;
|
|
7
7
|
get(idSociety: number, idSocietyVehicle: number): Promise<ISocietyVehicle>;
|
|
8
|
+
getAllIdsWhithMissingInformation(idSociety: number): Promise<number[]>;
|
|
8
9
|
create(idSociety: number, data: CreateSocietyVehicle, file: File): Promise<ISocietyVehicle>;
|
|
9
10
|
update(idSociety: number, idSocietyVehicle: number, data: UpdateSocietyVehicle): Promise<ISocietyVehicle>;
|
|
10
11
|
delete(idSociety: number, idSocietyVehicle: number): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vehicle.d.ts","sourceRoot":"","sources":["../../../ts/api/resources/Vehicle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIlE,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI1E,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,eAAe,CAAC;IAW3B,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,eAAe,CAAC;IAI3B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGtE"}
|
|
1
|
+
{"version":3,"file":"Vehicle.d.ts","sourceRoot":"","sources":["../../../ts/api/resources/Vehicle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIlE,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI1E,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAItE,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,eAAe,CAAC;IAW3B,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,eAAe,CAAC;IAI3B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGtE"}
|
|
@@ -7,6 +7,9 @@ export class Vehicle extends Resource {
|
|
|
7
7
|
get(idSociety, idSocietyVehicle) {
|
|
8
8
|
return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);
|
|
9
9
|
}
|
|
10
|
+
getAllIdsWhithMissingInformation(idSociety) {
|
|
11
|
+
return this.axios.$get(`society/${idSociety}/vehicles/missing-information`);
|
|
12
|
+
}
|
|
10
13
|
create(idSociety, data, file) {
|
|
11
14
|
const formData = new FormData();
|
|
12
15
|
forEach(data, (value, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vehicle.js","sourceRoot":"","sources":["../../../ts/api/resources/Vehicle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,mBAAmB,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,WAAW,CAAC,CAAC;IAC1D,CAAC;IAED,GAAG,CAAC,SAAiB,EAAE,gBAAwB;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,CACJ,SAAiB,EACjB,IAA0B,EAC1B,IAAU;QAEV,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC3B,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,WAAW,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,CACJ,SAAiB,EACjB,gBAAwB,EACxB,IAA0B;QAE1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,gBAAwB;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,CAAC,CAAC;IACjF,CAAC;CACF","sourcesContent":["import { forEach } from 'lodash';\nimport { CreateSocietyVehicle } from '../..';\nimport { UpdateSocietyVehicle } from '../../types/Interface/api/vehicle/UpdateSocietyVehicle';\nimport { ISocietyVehicle } from '../../types/Interface/models/ISocietyVehicle';\nimport { Resource } from '../Resource';\n\nexport class Vehicle extends Resource {\n getAllFromSocietyId(idSociety: number): Promise<ISocietyVehicle[]> {\n return this.axios.$get(`society/${idSociety}/vehicles`);\n }\n\n get(idSociety: number, idSocietyVehicle: number): Promise<ISocietyVehicle> {\n return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n\n create(\n idSociety: number,\n data: CreateSocietyVehicle,\n file: File,\n ): Promise<ISocietyVehicle> {\n const formData = new FormData();\n forEach(data, (value, key) => {\n if (value) {\n formData.append(key, `${value}`);\n }\n });\n formData.append('file', file);\n return this.axios.$post(`society/${idSociety}/vehicles`, formData, { headers: { 'Content-Type': 'multipart/form-data' } });\n }\n\n update(\n idSociety: number,\n idSocietyVehicle: number,\n data: UpdateSocietyVehicle,\n ): Promise<ISocietyVehicle> {\n return this.axios.$put(`society/${idSociety}/vehicles/${idSocietyVehicle}`, data);\n }\n\n delete(idSociety: number, idSocietyVehicle: number): Promise<boolean> {\n return this.axios.$delete(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Vehicle.js","sourceRoot":"","sources":["../../../ts/api/resources/Vehicle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,mBAAmB,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,WAAW,CAAC,CAAC;IAC1D,CAAC;IAED,GAAG,CAAC,SAAiB,EAAE,gBAAwB;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,gCAAgC,CAAC,SAAiB;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,+BAA+B,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,CACJ,SAAiB,EACjB,IAA0B,EAC1B,IAAU;QAEV,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC3B,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,WAAW,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,CACJ,SAAiB,EACjB,gBAAwB,EACxB,IAA0B;QAE1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,EAAE,IAAI,CAAC,CAAC;IACpF,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,gBAAwB;QAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,SAAS,aAAa,gBAAgB,EAAE,CAAC,CAAC;IACjF,CAAC;CACF","sourcesContent":["import { forEach } from 'lodash';\nimport { CreateSocietyVehicle } from '../..';\nimport { UpdateSocietyVehicle } from '../../types/Interface/api/vehicle/UpdateSocietyVehicle';\nimport { ISocietyVehicle } from '../../types/Interface/models/ISocietyVehicle';\nimport { Resource } from '../Resource';\n\nexport class Vehicle extends Resource {\n getAllFromSocietyId(idSociety: number): Promise<ISocietyVehicle[]> {\n return this.axios.$get(`society/${idSociety}/vehicles`);\n }\n\n get(idSociety: number, idSocietyVehicle: number): Promise<ISocietyVehicle> {\n return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n\n getAllIdsWhithMissingInformation(idSociety: number): Promise<number[]> {\n return this.axios.$get(`society/${idSociety}/vehicles/missing-information`);\n }\n\n create(\n idSociety: number,\n data: CreateSocietyVehicle,\n file: File,\n ): Promise<ISocietyVehicle> {\n const formData = new FormData();\n forEach(data, (value, key) => {\n if (value) {\n formData.append(key, `${value}`);\n }\n });\n formData.append('file', file);\n return this.axios.$post(`society/${idSociety}/vehicles`, formData, { headers: { 'Content-Type': 'multipart/form-data' } });\n }\n\n update(\n idSociety: number,\n idSocietyVehicle: number,\n data: UpdateSocietyVehicle,\n ): Promise<ISocietyVehicle> {\n return this.axios.$put(`society/${idSociety}/vehicles/${idSocietyVehicle}`, data);\n }\n\n delete(idSociety: number, idSocietyVehicle: number): Promise<boolean> {\n return this.axios.$delete(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSociety.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSociety.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,qBAAa,aAAa;IAExB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAGhD,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,qBAAa,oBAAoB;IAE/B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC5B"}
|
|
@@ -7,9 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsBoolean, IsOptional } from 'class-validator';
|
|
11
10
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
12
|
-
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
13
11
|
export class UpdateSociety {
|
|
14
12
|
}
|
|
15
13
|
__decorate([
|
|
@@ -72,13 +70,6 @@ __decorate([
|
|
|
72
70
|
ApiPropertyOptional(),
|
|
73
71
|
__metadata("design:type", String)
|
|
74
72
|
], UpdateSociety.prototype, "socialCapital", void 0);
|
|
75
|
-
__decorate([
|
|
76
|
-
ApiPropertyOptional(),
|
|
77
|
-
IsBoolean(),
|
|
78
|
-
ToBoolean(),
|
|
79
|
-
IsOptional(),
|
|
80
|
-
__metadata("design:type", Boolean)
|
|
81
|
-
], UpdateSociety.prototype, "showPopUpVehicleInformation", void 0);
|
|
82
73
|
export class UpdateSocietyPayload {
|
|
83
74
|
}
|
|
84
75
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSociety.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"UpdateSociety.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,MAAM,OAAO,aAAa;CA6CzB;AA3CC;IADC,mBAAmB,EAAE;;mDACA;AAGtB;IADC,mBAAmB,EAAE;;6CACN;AAGhB;IADC,mBAAmB,EAAE;;2CACR;AAGd;IADC,mBAAmB,EAAE;;8CACL;AAGjB;IADC,mBAAmB,EAAE;;2CACR;AAGd;IADC,mBAAmB,EAAE;;gDACH;AAGnB;IADC,mBAAmB,EAAE;;iDACF;AAGpB;IADC,mBAAmB,EAAE;;kDACD;AAGrB;IADC,mBAAmB,EAAE;;kDACD;AAGrB;IADC,mBAAmB,EAAE;;qDACE;AAGxB;IADC,mBAAmB,EAAE;;kDACD;AAGrB;IADC,mBAAmB,EAAE;;kDACD;AAGrB;IADC,mBAAmB,EAAE;;qDAC0B;AAGhD;IADC,mBAAmB,EAAE;;kDACD;AAGrB;IADC,mBAAmB,EAAE;;oDACC;AAEzB,MAAM,OAAO,oBAAoB;CAGhC;AADC;IADC,mBAAmB,EAAE;;qDACK","sourcesContent":["import { ApiPropertyOptional } from '../../../../utils';\nimport { ISociety } from '../../models/ISociety';\n\nexport class UpdateSociety {\n @ApiPropertyOptional()\n idTypeCompta?: number;\n\n @ApiPropertyOptional()\n idUser?: number;\n\n @ApiPropertyOptional()\n name?: string;\n\n @ApiPropertyOptional()\n address?: string;\n\n @ApiPropertyOptional()\n city?: string;\n\n @ApiPropertyOptional()\n idCountry?: number;\n\n @ApiPropertyOptional()\n idActivity?: number;\n\n @ApiPropertyOptional()\n idVatRegime?: number;\n\n @ApiPropertyOptional()\n idLegalForm?: number;\n\n @ApiPropertyOptional()\n idFiscalRegime?: number;\n\n @ApiPropertyOptional()\n profitsType?: number;\n\n @ApiPropertyOptional()\n idTaxSystem?: number;\n\n @ApiPropertyOptional()\n exercicePeriod?: { start: string, end: string };\n\n @ApiPropertyOptional()\n confirmedAt?: string;\n\n @ApiPropertyOptional()\n socialCapital?: string;\n}\nexport class UpdateSocietyPayload {\n @ApiPropertyOptional()\n society: Partial<ISociety>;\n}"]}
|
package/es/utils/brands.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ declare type brand = {
|
|
|
5
5
|
declare type getBrandConfigParams = {
|
|
6
6
|
idTypeBrand?: number;
|
|
7
7
|
objectWaited?: string;
|
|
8
|
+
nodeEnv?: string;
|
|
8
9
|
};
|
|
9
|
-
declare const getBrandNameByNodeEnv: () => 'Legalstart' | 'Comptalib' | 'Clementine';
|
|
10
|
+
declare const getBrandNameByNodeEnv: (nodeEnv?: string | undefined) => 'Legalstart' | 'Comptalib' | 'Clementine';
|
|
10
11
|
declare const getBrandConfig: (params: getBrandConfigParams) => brand;
|
|
11
12
|
export { getBrandConfig, getBrandNameByNodeEnv };
|
|
12
13
|
//# sourceMappingURL=brands.d.ts.map
|
package/es/utils/brands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAKA,aAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;AAEF,aAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAKA,aAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;AAEF,aAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC;AAEF,QAAA,MAAM,qBAAqB,oCAAuB,YAAY,GAAE,WAAW,GAAG,YAiB7E,CAAC;AAEF,QAAA,MAAM,cAAc,WAAY,oBAAoB,UAmCnD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAC"}
|
package/es/utils/brands.js
CHANGED
|
@@ -2,12 +2,12 @@ import { get as getLodash } from 'lodash';
|
|
|
2
2
|
import { BrandClementine } from '../types/Enum/BrandClementine';
|
|
3
3
|
import { BrandLegalstart } from '../types/Enum/BrandLegalstart';
|
|
4
4
|
import { BrandComptalib } from '../types/Enum/BrandComptalib';
|
|
5
|
-
const getBrandNameByNodeEnv = () => {
|
|
6
|
-
if (
|
|
7
|
-
if (['staging_legalstart', 'production_legalstart'].includes(
|
|
5
|
+
const getBrandNameByNodeEnv = (nodeEnv) => {
|
|
6
|
+
if (nodeEnv) {
|
|
7
|
+
if (['staging_legalstart', 'production_legalstart'].includes(nodeEnv)) {
|
|
8
8
|
return 'Legalstart';
|
|
9
9
|
}
|
|
10
|
-
if (['staging_comptalib', 'production_comptalib'].includes(
|
|
10
|
+
if (['staging_comptalib', 'production_comptalib'].includes(nodeEnv)) {
|
|
11
11
|
return 'Comptalib';
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -22,9 +22,10 @@ const getBrandNameByNodeEnv = () => {
|
|
|
22
22
|
return 'Clementine';
|
|
23
23
|
};
|
|
24
24
|
const getBrandConfig = (params) => {
|
|
25
|
-
const { idTypeBrand = null, objectWaited = null, } = params;
|
|
25
|
+
const { idTypeBrand = null, objectWaited = null, nodeEnv, } = params;
|
|
26
26
|
let brand;
|
|
27
|
-
const
|
|
27
|
+
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
28
|
+
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
28
29
|
const listEnvEnum = { BrandClementine, BrandLegalstart, BrandComptalib };
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
const currentConfigFile = listEnvEnum[`Brand${currentEnvName}`];
|
package/es/utils/brands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAa9D,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAA4C,EAAE;IAC3F,IAAI,OAAO,EAAE;QACX,IAAI,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACrE,OAAO,YAAY,CAAC;SACrB;QACD,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YACnE,OAAO,WAAW,CAAC;SACpB;KACF;SAAM,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE;YACnD,OAAO,YAAY,CAAC;SACrB;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE;YA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c,GAAG,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SACxD;QACD,OAAO,cAAc,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import { get as getLodash } from 'lodash';\nimport { BrandClementine } from '../types/Enum/BrandClementine';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib';\n\ntype brand = {\n idTypeBrand: number,\n name: string\n};\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart'| 'Comptalib' | 'Clementine' => {\n if (nodeEnv) {\n if (['staging_legalstart', 'production_legalstart'].includes(nodeEnv)) {\n return 'Legalstart';\n }\n if (['staging_comptalib', 'production_comptalib'].includes(nodeEnv)) {\n return 'Comptalib';\n }\n } else if (process.env.API_HOST) {\n if (process.env.API_HOST.indexOf('legalstart') > -1) {\n return 'Legalstart';\n }\n if (process.env.API_HOST.indexOf('comptalib') > -1) {\n return 'Comptalib';\n }\n }\n return 'Clementine';\n};\n\nconst getBrandConfig = (params: getBrandConfigParams): brand => {\n const {\n idTypeBrand = null, objectWaited = null, nodeEnv,\n } = params;\n let brand;\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = { BrandClementine, BrandLegalstart, BrandComptalib };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: brand, b: brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = getLodash(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: brand) => b.name === currentEnvName);\n objectToReturn = getLodash(brandDefault, objectWaited);\n }\n return objectToReturn;\n }\n\n return brand;\n};\n\nexport { getBrandConfig, getBrandNameByNodeEnv };"]}
|
|
@@ -18,6 +18,10 @@ class Vehicle extends _Resource.Resource {
|
|
|
18
18
|
return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
getAllIdsWhithMissingInformation(idSociety) {
|
|
22
|
+
return this.axios.$get(`society/${idSociety}/vehicles/missing-information`);
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
create(idSociety, data, file) {
|
|
22
26
|
const formData = new FormData();
|
|
23
27
|
(0, _lodash.forEach)(data, (value, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../ts/api/resources/Vehicle.ts"],"names":[],"mappings":";;;;;;;AAAA;;AAIA;;AAEM,MAAO,OAAP,SAAuB,kBAAvB,CAA+B;AACnC,EAAA,mBAAmB,CAAC,SAAD,EAAkB;AACnC,WAAO,KAAK,KAAL,CAAW,IAAX,CAAgB,WAAW,SAAS,WAApC,CAAP;AACD;;AAED,EAAA,GAAG,CAAC,SAAD,EAAoB,gBAApB,EAA4C;AAC7C,WAAO,KAAK,KAAL,CAAW,IAAX,CAAgB,WAAW,SAAS,aAAa,gBAAgB,EAAjE,CAAP;AACD;;AAED,EAAA,MAAM,CACJ,SADI,EAEJ,IAFI,EAGJ,IAHI,EAGM;AAEV,UAAM,QAAQ,GAAG,IAAI,QAAJ,EAAjB;AACA,yBAAQ,IAAR,EAA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AAQ,GAAG,IAAI,QAAJ,EAAjB;AACA,yBAAQ,IAAR,EAAc,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC3B,UAAI,KAAJ,EAAW;AACT,QAAA,QAAQ,CAAC,MAAT,CAAgB,GAAhB,EAAqB,GAAG,KAAK,EAA7B;AACD;AACF,KAJD;AAKA,IAAA,QAAQ,CAAC,MAAT,CAAgB,MAAhB,EAAwB,IAAxB;AACA,WAAO,KAAK,KAAL,CAAW,KAAX,CAAiB,WAAW,SAAS,WAArC,EAAkD,QAAlD,EAA4D;AAAE,MAAA,OAAO,EAAE;AAAE,wBAAgB;AAAlB;AAAX,KAA5D,CAAP;AACD;;AAED,EAAA,MAAM,CACJ,SADI,EAEJ,gBAFI,EAGJ,IAHI,EAGsB;AAE1B,WAAO,KAAK,KAAL,CAAW,IAAX,CAAgB,WAAW,SAAS,aAAa,gBAAgB,EAAjE,EAAqE,IAArE,CAAP;AACD;;AAED,EAAA,MAAM,CAAC,SAAD,EAAoB,gBAApB,EAA4C;AAChD,WAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,WAAW,SAAS,aAAa,gBAAgB,EAApE,CAAP;AACD;;AAtCkC;;QAAxB,O,GAAA,O","sourcesContent":["import { forEach } from 'lodash';\nimport { CreateSocietyVehicle } from '../..';\nimport { UpdateSocietyVehicle } from '../../types/Interface/api/vehicle/UpdateSocietyVehicle';\nimport { ISocietyVehicle } from '../../types/Interface/models/ISocietyVehicle';\nimport { Resource } from '../Resource';\n\nexport class Vehicle extends Resource {\n getAllFromSocietyId(idSociety: number): Promise<ISocietyVehicle[]> {\n return this.axios.$get(`society/${idSociety}/vehicles`);\n }\n\n get(idSociety: number, idSocietyVehicle: number): Promise<ISocietyVehicle> {\n return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n\n getAllIdsWhithMissingInformation(idSociety: number): Promise<number[]> {\n return this.axios.$get(`society/${idSociety}/vehicles/missing-information`);\n }\n\n create(\n idSociety: number,\n data: CreateSocietyVehicle,\n file: File,\n ): Promise<ISocietyVehicle> {\n const formData = new FormData();\n forEach(data, (value, key) => {\n if (value) {\n formData.append(key, `${value}`);\n }\n });\n formData.append('file', file);\n return this.axios.$post(`society/${idSociety}/vehicles`, formData, { headers: { 'Content-Type': 'multipart/form-data' } });\n }\n\n update(\n idSociety: number,\n idSocietyVehicle: number,\n data: UpdateSocietyVehicle,\n ): Promise<ISocietyVehicle> {\n return this.axios.$put(`society/${idSociety}/vehicles/${idSocietyVehicle}`, data);\n }\n\n delete(idSociety: number, idSocietyVehicle: number): Promise<boolean> {\n return this.axios.$delete(`society/${idSociety}/vehicles/${idSocietyVehicle}`);\n }\n}\n"],"sourceRoot":"","file":"Vehicle.js"}
|
|
@@ -5,12 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.UpdateSocietyPayload = exports.UpdateSociety = undefined;
|
|
7
7
|
|
|
8
|
-
var _classValidator = require("class-validator");
|
|
9
|
-
|
|
10
8
|
var _utils = require("../../../../utils");
|
|
11
9
|
|
|
12
|
-
var _boolean = require("../../../../utils/transforms/boolean.transform");
|
|
13
|
-
|
|
14
10
|
var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
15
11
|
var c = arguments.length,
|
|
16
12
|
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
@@ -57,8 +53,6 @@ __decorate([(0, _utils.ApiPropertyOptional)(), __metadata("design:type", String)
|
|
|
57
53
|
|
|
58
54
|
__decorate([(0, _utils.ApiPropertyOptional)(), __metadata("design:type", String)], UpdateSociety.prototype, "socialCapital", void 0);
|
|
59
55
|
|
|
60
|
-
__decorate([(0, _utils.ApiPropertyOptional)(), (0, _classValidator.IsBoolean)(), (0, _boolean.ToBoolean)(), (0, _classValidator.IsOptional)(), __metadata("design:type", Boolean)], UpdateSociety.prototype, "showPopUpVehicleInformation", void 0);
|
|
61
|
-
|
|
62
56
|
class UpdateSocietyPayload {}
|
|
63
57
|
|
|
64
58
|
exports.UpdateSocietyPayload = UpdateSocietyPayload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":";;;;;;;AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../ts/types/Interface/api/society/UpdateSociety.ts"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;;AAGM,MAAO,aAAP,CAAoB;;QAAb,a,GAAA,a;;AAEX,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,cAAA,E,KAAsB,CAAtB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,QAAA,E,KAAgB,CAAhB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,MAAA,E,KAAc,CAAd,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,SAAA,E,KAAiB,CAAjB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,MAAA,E,KAAc,CAAd,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,WAAA,E,KAAmB,CAAnB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,YAAA,E,KAAoB,CAApB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,aAAA,E,KAAqB,CAArB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,aAAA,E,KAAqB,CAArB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,gBAAA,E,KAAwB,CAAxB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,aAAA,E,KAAqB,CAArB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,aAAA,E,KAAqB,CAArB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,gBAAA,E,KAAgD,CAAhD,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,aAAA,E,KAAqB,CAArB,CAAA;;AAGA,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,uBAAA,E,eAAA,E,KAAuB,CAAvB,CAAA;;AAEI,MAAO,oBAAP,CAA2B;;QAApB,oB,GAAA,oB;;AAEX,UAAA,CAAA,CADC,iCACD,E,iCAAA,CAAA,E,8BAAA,E,SAAA,E,KAA2B,CAA3B,CAAA","sourcesContent":["import { ApiPropertyOptional } from '../../../../utils';\nimport { ISociety } from '../../models/ISociety';\n\nexport class UpdateSociety {\n @ApiPropertyOptional()\n idTypeCompta?: number;\n\n @ApiPropertyOptional()\n idUser?: number;\n\n @ApiPropertyOptional()\n name?: string;\n\n @ApiPropertyOptional()\n address?: string;\n\n @ApiPropertyOptional()\n city?: string;\n\n @ApiPropertyOptional()\n idCountry?: number;\n\n @ApiPropertyOptional()\n idActivity?: number;\n\n @ApiPropertyOptional()\n idVatRegime?: number;\n\n @ApiPropertyOptional()\n idLegalForm?: number;\n\n @ApiPropertyOptional()\n idFiscalRegime?: number;\n\n @ApiPropertyOptional()\n profitsType?: number;\n\n @ApiPropertyOptional()\n idTaxSystem?: number;\n\n @ApiPropertyOptional()\n exercicePeriod?: { start: string, end: string };\n\n @ApiPropertyOptional()\n confirmedAt?: string;\n\n @ApiPropertyOptional()\n socialCapital?: string;\n}\nexport class UpdateSocietyPayload {\n @ApiPropertyOptional()\n society: Partial<ISociety>;\n}"],"sourceRoot":"","file":"UpdateSociety.js"}
|
package/js/utils/brands.js
CHANGED
|
@@ -13,13 +13,13 @@ var _BrandLegalstart = require("../types/Enum/BrandLegalstart");
|
|
|
13
13
|
|
|
14
14
|
var _BrandComptalib = require("../types/Enum/BrandComptalib");
|
|
15
15
|
|
|
16
|
-
const getBrandNameByNodeEnv =
|
|
17
|
-
if (
|
|
18
|
-
if (['staging_legalstart', 'production_legalstart'].includes(
|
|
16
|
+
const getBrandNameByNodeEnv = nodeEnv => {
|
|
17
|
+
if (nodeEnv) {
|
|
18
|
+
if (['staging_legalstart', 'production_legalstart'].includes(nodeEnv)) {
|
|
19
19
|
return 'Legalstart';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
if (['staging_comptalib', 'production_comptalib'].includes(
|
|
22
|
+
if (['staging_comptalib', 'production_comptalib'].includes(nodeEnv)) {
|
|
23
23
|
return 'Comptalib';
|
|
24
24
|
}
|
|
25
25
|
} else if (process.env.API_HOST) {
|
|
@@ -38,10 +38,12 @@ const getBrandNameByNodeEnv = () => {
|
|
|
38
38
|
const getBrandConfig = params => {
|
|
39
39
|
const {
|
|
40
40
|
idTypeBrand = null,
|
|
41
|
-
objectWaited = null
|
|
41
|
+
objectWaited = null,
|
|
42
|
+
nodeEnv
|
|
42
43
|
} = params;
|
|
43
44
|
let brand;
|
|
44
|
-
const
|
|
45
|
+
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
46
|
+
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
45
47
|
const listEnvEnum = {
|
|
46
48
|
BrandClementine: _BrandClementine.BrandClementine,
|
|
47
49
|
BrandLegalstart: _BrandLegalstart.BrandLegalstart,
|
package/js/utils/brands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../ts/utils/brands.ts"],"names":[],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../ts/utils/brands.ts"],"names":[],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAaA,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CAAwB,CAAD,IAAc,CAAC,CAAC,WAAF,KAAkB,WAAvD,CAAR;AACD,GAd4D,CAe7D;AACA;;;AAEA,MAAI,CAAC,KAAL,EAAY;AACV;AACA,KAAC,KAAD,IAAU,iBAAiB,CAAC,IAAlB,CAAuB,CAAC,CAAD,EAAW,CAAX,KAAwB,CAAC,CAAC,WAAF,GAAgB,CAAC,CAAC,WAAjE,CAAV;AACD;;AAED,MAAI,YAAJ,EAAkB;AAChB;AACA,QAAI,cAAc,GAAG,iBAAU,KAAV,EAAiB,YAAjB,CAArB,CAFgB,CAGhB;;AACA,QAAI,CAAC,cAAL,EAAqB;AACnB,YAAM,YAAY,GAAG,iBAAiB,CAAC,IAAlB,CAAwB,CAAD,IAAc,CAAC,CAAC,IAAF,KAAW,cAAhD,CAArB;AACA,MAAA,cAAc,GAAG,iBAAU,YAAV,EAAwB,YAAxB,CAAjB;AACD;;AACD,WAAO,cAAP;AACD;;AAED,SAAO,KAAP;AACD,CAnCD;;QAqCS,c,GAAA,c;QAAgB,qB,GAAA,qB","sourcesContent":["import { get as getLodash } from 'lodash';\nimport { BrandClementine } from '../types/Enum/BrandClementine';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib';\n\ntype brand = {\n idTypeBrand: number,\n name: string\n};\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart'| 'Comptalib' | 'Clementine' => {\n if (nodeEnv) {\n if (['staging_legalstart', 'production_legalstart'].includes(nodeEnv)) {\n return 'Legalstart';\n }\n if (['staging_comptalib', 'production_comptalib'].includes(nodeEnv)) {\n return 'Comptalib';\n }\n } else if (process.env.API_HOST) {\n if (process.env.API_HOST.indexOf('legalstart') > -1) {\n return 'Legalstart';\n }\n if (process.env.API_HOST.indexOf('comptalib') > -1) {\n return 'Comptalib';\n }\n }\n return 'Clementine';\n};\n\nconst getBrandConfig = (params: getBrandConfigParams): brand => {\n const {\n idTypeBrand = null, objectWaited = null, nodeEnv,\n } = params;\n let brand;\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = { BrandClementine, BrandLegalstart, BrandComptalib };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: brand, b: brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = getLodash(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: brand) => b.name === currentEnvName);\n objectToReturn = getLodash(brandDefault, objectWaited);\n }\n return objectToReturn;\n }\n\n return brand;\n};\n\nexport { getBrandConfig, getBrandNameByNodeEnv };"],"sourceRoot":"","file":"brands.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.133",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "js/index.js",
|
|
@@ -13,6 +13,10 @@ export class Vehicle extends Resource {
|
|
|
13
13
|
return this.axios.$get(`society/${idSociety}/vehicles/${idSocietyVehicle}`);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
getAllIdsWhithMissingInformation(idSociety: number): Promise<number[]> {
|
|
17
|
+
return this.axios.$get(`society/${idSociety}/vehicles/missing-information`);
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
create(
|
|
17
21
|
idSociety: number,
|
|
18
22
|
data: CreateSocietyVehicle,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { IsBoolean, IsOptional } from 'class-validator';
|
|
2
1
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
3
2
|
import { ISociety } from '../../models/ISociety';
|
|
4
|
-
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
5
3
|
|
|
6
4
|
export class UpdateSociety {
|
|
7
5
|
@ApiPropertyOptional()
|
|
@@ -48,14 +46,7 @@ export class UpdateSociety {
|
|
|
48
46
|
|
|
49
47
|
@ApiPropertyOptional()
|
|
50
48
|
socialCapital?: string;
|
|
51
|
-
|
|
52
|
-
@ApiPropertyOptional()
|
|
53
|
-
@IsBoolean()
|
|
54
|
-
@ToBoolean()
|
|
55
|
-
@IsOptional()
|
|
56
|
-
showPopUpVehicleInformation?: boolean;
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
export class UpdateSocietyPayload {
|
|
60
51
|
@ApiPropertyOptional()
|
|
61
52
|
society: Partial<ISociety>;
|
package/ts/utils/brands.ts
CHANGED
|
@@ -11,14 +11,15 @@ type brand = {
|
|
|
11
11
|
type getBrandConfigParams = {
|
|
12
12
|
idTypeBrand?: number,
|
|
13
13
|
objectWaited?: string,
|
|
14
|
+
nodeEnv?: string
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const getBrandNameByNodeEnv = (): 'Legalstart'| 'Comptalib' | 'Clementine' => {
|
|
17
|
-
if (
|
|
18
|
-
if (['staging_legalstart', 'production_legalstart'].includes(
|
|
17
|
+
const getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart'| 'Comptalib' | 'Clementine' => {
|
|
18
|
+
if (nodeEnv) {
|
|
19
|
+
if (['staging_legalstart', 'production_legalstart'].includes(nodeEnv)) {
|
|
19
20
|
return 'Legalstart';
|
|
20
21
|
}
|
|
21
|
-
if (['staging_comptalib', 'production_comptalib'].includes(
|
|
22
|
+
if (['staging_comptalib', 'production_comptalib'].includes(nodeEnv)) {
|
|
22
23
|
return 'Comptalib';
|
|
23
24
|
}
|
|
24
25
|
} else if (process.env.API_HOST) {
|
|
@@ -34,10 +35,11 @@ const getBrandNameByNodeEnv = (): 'Legalstart'| 'Comptalib' | 'Clementine' => {
|
|
|
34
35
|
|
|
35
36
|
const getBrandConfig = (params: getBrandConfigParams): brand => {
|
|
36
37
|
const {
|
|
37
|
-
idTypeBrand = null, objectWaited = null,
|
|
38
|
+
idTypeBrand = null, objectWaited = null, nodeEnv,
|
|
38
39
|
} = params;
|
|
39
40
|
let brand;
|
|
40
|
-
const
|
|
41
|
+
const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;
|
|
42
|
+
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
41
43
|
const listEnvEnum = { BrandClementine, BrandLegalstart, BrandComptalib };
|
|
42
44
|
// @ts-ignore
|
|
43
45
|
const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];
|