@silexpert/core 1.1.81 → 1.1.83
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/LeadsToPartners.d.ts +8 -0
- package/es/api/resources/LeadsToPartners.d.ts.map +1 -0
- package/es/api/resources/LeadsToPartners.js +13 -0
- package/es/api/resources/LeadsToPartners.js.map +1 -0
- package/es/api/resources.d.ts +2 -0
- package/es/api/resources.d.ts.map +1 -1
- package/es/api/resources.js +2 -0
- package/es/api/resources.js.map +1 -1
- package/es/types/Enum/BrandStatutsExpress.js +1 -1
- package/es/types/Enum/BrandStatutsExpress.js.map +1 -1
- package/es/types/Enum/MailAuto.d.ts +2 -1
- package/es/types/Enum/MailAuto.d.ts.map +1 -1
- package/es/types/Enum/MailAuto.js +1 -0
- package/es/types/Enum/MailAuto.js.map +1 -1
- package/es/types/Enum/Partners.d.ts +86 -0
- package/es/types/Enum/Partners.d.ts.map +1 -0
- package/es/types/Enum/Partners.js +86 -0
- package/es/types/Enum/Partners.js.map +1 -0
- package/es/types/Enum/PrestationType.d.ts +2 -1
- package/es/types/Enum/PrestationType.d.ts.map +1 -1
- package/es/types/Enum/PrestationType.js +18 -0
- package/es/types/Enum/PrestationType.js.map +1 -1
- package/es/types/Interface/api/notification/Delete.d.ts +4 -0
- package/es/types/Interface/api/notification/Delete.d.ts.map +1 -0
- package/es/types/Interface/api/notification/Delete.js +17 -0
- package/es/types/Interface/api/notification/Delete.js.map +1 -0
- package/es/types/Interface/api/partners/PartnerStatisticType.d.ts +19 -0
- package/es/types/Interface/api/partners/PartnerStatisticType.d.ts.map +1 -0
- package/es/types/Interface/api/partners/PartnerStatisticType.js +5 -0
- package/es/types/Interface/api/partners/PartnerStatisticType.js.map +1 -0
- package/es/types/Interface/api/partners/QueryPartnerAll.d.ts +6 -0
- package/es/types/Interface/api/partners/QueryPartnerAll.d.ts.map +1 -0
- package/es/types/Interface/api/partners/QueryPartnerAll.js +37 -0
- package/es/types/Interface/api/partners/QueryPartnerAll.js.map +1 -0
- package/es/types/Interface/api/partners/QueryPartnerStatistic.d.ts +6 -0
- package/es/types/Interface/api/partners/QueryPartnerStatistic.d.ts.map +1 -0
- package/es/types/Interface/api/partners/QueryPartnerStatistic.js +37 -0
- package/es/types/Interface/api/partners/QueryPartnerStatistic.js.map +1 -0
- package/es/types/Interface/models/ILeadsToPartners.d.ts +13 -0
- package/es/types/Interface/models/ILeadsToPartners.d.ts.map +1 -0
- package/es/types/Interface/models/ILeadsToPartners.js +2 -0
- package/es/types/Interface/models/ILeadsToPartners.js.map +1 -0
- package/es/types/index.d.ts +6 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +6 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/brands.d.ts +5 -2
- package/es/utils/brands.d.ts.map +1 -1
- package/es/utils/brands.js +7 -1
- package/es/utils/brands.js.map +1 -1
- package/js/api/resources/LeadsToPartners.js +24 -0
- package/js/api/resources/LeadsToPartners.js.map +1 -0
- package/js/api/resources.js +3 -1
- package/js/api/resources.js.map +1 -1
- package/js/types/Enum/BrandStatutsExpress.js +1 -1
- package/js/types/Enum/BrandStatutsExpress.js.map +1 -1
- package/js/types/Enum/MailAuto.js +1 -0
- package/js/types/Enum/MailAuto.js.map +1 -1
- package/js/types/Enum/Partners.js +91 -0
- package/js/types/Enum/Partners.js.map +1 -0
- package/js/types/Enum/PrestationType.js +18 -0
- package/js/types/Enum/PrestationType.js.map +1 -1
- package/js/types/Interface/api/notification/Delete.js +21 -0
- package/js/types/Interface/api/notification/Delete.js.map +1 -0
- package/js/types/Interface/api/partners/PartnerStatisticType.js +9 -0
- package/js/types/Interface/api/partners/PartnerStatisticType.js.map +1 -0
- package/js/types/Interface/api/partners/QueryPartnerAll.js +35 -0
- package/js/types/Interface/api/partners/QueryPartnerAll.js.map +1 -0
- package/js/types/Interface/api/partners/QueryPartnerStatistic.js +35 -0
- package/js/types/Interface/api/partners/QueryPartnerStatistic.js.map +1 -0
- package/js/types/Interface/models/ILeadsToPartners.js +6 -0
- package/js/types/Interface/models/ILeadsToPartners.js.map +1 -0
- package/js/types/index.js +63 -3
- package/js/types/index.js.map +1 -1
- package/js/utils/brands.js +8 -1
- package/js/utils/brands.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/LeadsToPartners.ts +16 -0
- package/ts/api/resources.ts +2 -0
- package/ts/types/Enum/BrandStatutsExpress.ts +1 -1
- package/ts/types/Enum/MailAuto.ts +1 -0
- package/ts/types/Enum/Partners.ts +86 -0
- package/ts/types/Enum/PrestationType.ts +18 -0
- package/ts/types/Interface/api/notification/Delete.ts +6 -0
- package/ts/types/Interface/api/partners/PartnerStatisticType.ts +19 -0
- package/ts/types/Interface/api/partners/QueryPartnerAll.ts +24 -0
- package/ts/types/Interface/api/partners/QueryPartnerStatistic.ts +24 -0
- package/ts/types/Interface/models/ILeadsToPartners.ts +15 -0
- package/ts/types/index.ts +7 -1
- package/ts/utils/brands.ts +10 -2
package/js/utils/brands.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getBrandByEmail = exports.getBrandNameByNodeEnv = exports.getAllBrandByNodeEnv = exports.getBrandConfig = undefined;
|
|
6
|
+
exports.getBrandByEmail = exports.getBrandNameByNodeEnv = exports.getAllBrandByNodeEnv = exports.isItThisBrand = exports.getBrandConfig = undefined;
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _BrandClementine = require("../types/Enum/BrandClementine");
|
|
9
9
|
var _BrandLegalstart = require("../types/Enum/BrandLegalstart");
|
|
@@ -11,6 +11,7 @@ var _BrandComptalib = require("../types/Enum/BrandComptalib");
|
|
|
11
11
|
var _BrandPourcentage = require("../types/Enum/BrandPourcentage");
|
|
12
12
|
var _BrandClems = require("../types/Enum/BrandClems");
|
|
13
13
|
var _BrandStatutsExpress = require("../types/Enum/BrandStatutsExpress");
|
|
14
|
+
const allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'Clems', 'StatutsExpress'];
|
|
14
15
|
const getBrandNameByNodeEnv = nodeEnv => {
|
|
15
16
|
var _a;
|
|
16
17
|
const env = (_a = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV) !== null && _a !== void 0 ? _a : process.env.API_HOST;
|
|
@@ -33,6 +34,11 @@ const getBrandNameByNodeEnv = nodeEnv => {
|
|
|
33
34
|
}
|
|
34
35
|
return 'Clementine';
|
|
35
36
|
};
|
|
37
|
+
const isItThisBrand = (brandList, nodeEnv) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const env = (_a = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV) !== null && _a !== void 0 ? _a : process.env.API_HOST;
|
|
40
|
+
return getBrandNameByNodeEnv(env) === brandList;
|
|
41
|
+
};
|
|
36
42
|
const getAllBrandByNodeEnv = nodeEnv => {
|
|
37
43
|
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
38
44
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
@@ -100,6 +106,7 @@ const getBrandByEmail = email => {
|
|
|
100
106
|
return null;
|
|
101
107
|
};
|
|
102
108
|
exports.getBrandConfig = getBrandConfig;
|
|
109
|
+
exports.isItThisBrand = isItThisBrand;
|
|
103
110
|
exports.getAllBrandByNodeEnv = getAllBrandByNodeEnv;
|
|
104
111
|
exports.getBrandNameByNodeEnv = getBrandNameByNodeEnv;
|
|
105
112
|
exports.getBrandByEmail = getBrandByEmail;
|
package/js/utils/brands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","names":["_lodash","require","_BrandClementine","_BrandLegalstart","_BrandComptalib","_BrandPourcentage","_BrandClems","_BrandStatutsExpress","getBrandNameByNodeEnv","nodeEnv","env","_a","process","NODE_ENV","API_HOST","indexOf","getAllBrandByNodeEnv","nodeEnvUsed","currentEnvName","listEnvEnum","BrandClementine","BrandLegalstart","BrandComptalib","BrandPourcentage","BrandClems","BrandStatutsExpress","currentConfigFile","brand","getBrandConfig","params","idTypeBrand","objectWaited","find","b","sort","a","objectToReturn","getLodash","brandDefault","name","getBrandByEmail","email","exports"],"sources":["../../ts/utils/brands.ts"],"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';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\nimport { BrandClems } from '../types/Enum/BrandClems';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress';\n\ntype brand = {\n idTypeBrand: number,\n colors: {\n primary: string,\n },\n listMails: {\n bonjour: string,\n },\n listPhones: {\n contact: string,\n },\n name: string,\n urlApi1?: string,\n urlClient?: string,\n urlApp?: string,\n offices?: {\n LAXOU: {\n id : number,\n },\n HOME_OFFICE: {\n id : number,\n }\n },\n};\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string):
|
|
1
|
+
{"version":3,"file":"brands.js","names":["_lodash","require","_BrandClementine","_BrandLegalstart","_BrandComptalib","_BrandPourcentage","_BrandClems","_BrandStatutsExpress","allBrands","getBrandNameByNodeEnv","nodeEnv","env","_a","process","NODE_ENV","API_HOST","indexOf","isItThisBrand","brandList","getAllBrandByNodeEnv","nodeEnvUsed","currentEnvName","listEnvEnum","BrandClementine","BrandLegalstart","BrandComptalib","BrandPourcentage","BrandClems","BrandStatutsExpress","currentConfigFile","brand","getBrandConfig","params","idTypeBrand","objectWaited","find","b","sort","a","objectToReturn","getLodash","brandDefault","name","getBrandByEmail","email","exports"],"sources":["../../ts/utils/brands.ts"],"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';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\nimport { BrandClems } from '../types/Enum/BrandClems';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress';\n\ntype brand = {\n idTypeBrand: number,\n colors: {\n primary: string,\n },\n listMails: {\n bonjour: string,\n },\n listPhones: {\n contact: string,\n },\n name: string,\n urlApi1?: string,\n urlClient?: string,\n urlApp?: string,\n offices?: {\n LAXOU: {\n id : number,\n },\n HOME_OFFICE: {\n id : number,\n }\n },\n};\n\nconst allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'Clems', 'StatutsExpress'] as const;\ntype BrandList = typeof allBrands[number];\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env) {\n if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {\n return 'Legalstart';\n }\n if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {\n return 'Comptalib';\n }\n if (env.indexOf('pourcentage') > -1 || env.indexOf('Pourcentage') > -1) {\n return 'Pourcentage';\n }\n if (env.indexOf('clems') > -1 || env.indexOf('Clems') > -1) {\n return 'Clems';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisBrand = (brandList: BrandList, nodeEnv?: string): boolean => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n return getBrandNameByNodeEnv(env) === brandList;\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\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 = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems, BrandStatutsExpress,\n };\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\nconst getBrandByEmail = (email: string): 'Legalstart' | 'Comptalib' | 'Clementine' | 'Pourcentage' | 'Lecomptablefrancais' | null => {\n if (email.indexOf('legalstart.fr') > -1) return 'Legalstart';\n if (email.indexOf('comptalib.com') > -1) return 'Comptalib';\n if (email.indexOf('pourcentage.fr') > -1) return 'Pourcentage';\n if (email.indexOf('compta-clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('lecomptablefrancais.fr') > -1) return 'Lecomptablefrancais';\n return null;\n};\n\nexport {\n getBrandConfig, isItThisBrand, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail,\n};"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AA2BA,MAAMO,SAAS,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,CAAU;AAS9G,MAAMC,qBAAqB,GAAIC,OAAgB,IAAe;;EAC5D,MAAMC,GAAG,GAAG,CAAAC,EAAA,GAAAF,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAIG,OAAO,CAACF,GAAG,CAACG,QAAQ,cAAAF,EAAA,cAAAA,EAAA,GAAIC,OAAO,CAACF,GAAG,CAACI,QAAQ;EACnE,IAAIJ,GAAG,EAAE;IACP,IAAIA,GAAG,CAACK,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAIL,GAAG,CAACK,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE;MACpE,OAAO,YAAY;;IAErB,IAAIL,GAAG,CAACK,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAIL,GAAG,CAACK,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE;MAClE,OAAO,WAAW;;IAEpB,IAAIL,GAAG,CAACK,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAIL,GAAG,CAACK,OAAO,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EAGvB,OAAOT,KAAK;AACd,CAAC;AAED,MAAMa,eAAe,GAAIC,KAAa,IAA8F;EAClI,IAAIA,KAAK,CAAC5B,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,YAAY;EAC5D,IAAI4B,KAAK,CAAC5B,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,WAAW;EAC3D,IAAI4B,KAAK,CAAC5B,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,aAAa;EAC9D,IAAI4B,KAAK,CAAC5B,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,YAAY;EACnE,IAAI4B,KAAK,CAAC5B,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,YAAY;EAC5D,IAAI4B,KAAK,CAAC5B,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,qBAAqB;EAC9E,OAAO,IAAI;AACb,CAAC;AAAC6B,OAAA,CAGAd,cAAc,GAAdA,cAAc;AAAAc,OAAA,CAAE5B,aAAa,GAAbA,aAAa;AAAA4B,OAAA,CAAE1B,oBAAoB,GAApBA,oBAAoB;AAAA0B,OAAA,CAAEpC,qBAAqB,GAArBA,qBAAqB;AAAAoC,OAAA,CAAEF,eAAe,GAAfA,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.83",
|
|
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",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ILeadsToPartners, PartnerStatisticType, QueryPartnerAll, QueryPartnerStatistic,
|
|
3
|
+
} from '../../types';
|
|
4
|
+
import { Resource } from '../Resource';
|
|
5
|
+
|
|
6
|
+
export class LeadsToPartners extends Resource {
|
|
7
|
+
create(params: ILeadsToPartners): Promise<ILeadsToPartners> {
|
|
8
|
+
return this.axios.$post('partner', params);
|
|
9
|
+
}
|
|
10
|
+
getAll(params: QueryPartnerAll): Promise<ILeadsToPartners[]> {
|
|
11
|
+
return this.axios.$get('partner/all', { params });
|
|
12
|
+
}
|
|
13
|
+
getStatistic(params: QueryPartnerStatistic): Promise<PartnerStatisticType[]> {
|
|
14
|
+
return this.axios.$get('partner/statistic', { params });
|
|
15
|
+
}
|
|
16
|
+
}
|
package/ts/api/resources.ts
CHANGED
|
@@ -130,6 +130,7 @@ import { AccountsSector } from './resources/AccountsSectors';
|
|
|
130
130
|
import { BusinessSector } from './resources/BusinessSector';
|
|
131
131
|
import { VisualizedInformation } from './resources/VisualizedInformation';
|
|
132
132
|
import { Fusion } from './resources/Fusion';
|
|
133
|
+
import { LeadsToPartners } from './resources/LeadsToPartners';
|
|
133
134
|
|
|
134
135
|
export const resources = {
|
|
135
136
|
simulation: Simulation,
|
|
@@ -264,4 +265,5 @@ export const resources = {
|
|
|
264
265
|
businessSector: BusinessSector,
|
|
265
266
|
visualizedInformation: VisualizedInformation,
|
|
266
267
|
fusion: Fusion,
|
|
268
|
+
leadsToPartners: LeadsToPartners,
|
|
267
269
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const PartnerTypesDetail = {
|
|
2
|
+
WEBSITE: {
|
|
3
|
+
name: 'Site Internet',
|
|
4
|
+
color: 'green',
|
|
5
|
+
id: 1,
|
|
6
|
+
},
|
|
7
|
+
ACCOUNTANT_LOGICIEL: {
|
|
8
|
+
name: 'Logiciel comptable',
|
|
9
|
+
color: 'blue',
|
|
10
|
+
id: 2,
|
|
11
|
+
},
|
|
12
|
+
EXPERT_ACCOUNTANT: {
|
|
13
|
+
name: 'Expert-comptable en ligne',
|
|
14
|
+
color: 'orange',
|
|
15
|
+
id: 3,
|
|
16
|
+
},
|
|
17
|
+
INSURANCE: {
|
|
18
|
+
name: 'Assurance',
|
|
19
|
+
color: 'red',
|
|
20
|
+
id: 4,
|
|
21
|
+
},
|
|
22
|
+
DOMICILIATION: {
|
|
23
|
+
name: 'Domiciliation',
|
|
24
|
+
color: 'yellow',
|
|
25
|
+
id: 5,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Partners = {
|
|
30
|
+
NATIVE: {
|
|
31
|
+
id: 1,
|
|
32
|
+
idType: PartnerTypesDetail.INSURANCE.id,
|
|
33
|
+
name: 'Native',
|
|
34
|
+
excludeBrand: [],
|
|
35
|
+
disabled: false,
|
|
36
|
+
},
|
|
37
|
+
POURCENTAGE: {
|
|
38
|
+
id: 2,
|
|
39
|
+
idType: PartnerTypesDetail.EXPERT_ACCOUNTANT.id,
|
|
40
|
+
name: 'Pourcentage',
|
|
41
|
+
excludeBrand: ['Pourcentage'],
|
|
42
|
+
disabled: false,
|
|
43
|
+
},
|
|
44
|
+
CLEMENTINE: {
|
|
45
|
+
id: 3,
|
|
46
|
+
idType: PartnerTypesDetail.EXPERT_ACCOUNTANT.id,
|
|
47
|
+
name: 'Clementine',
|
|
48
|
+
excludeBrand: ['Clementine'],
|
|
49
|
+
disabled: false,
|
|
50
|
+
},
|
|
51
|
+
COMPTALIB: {
|
|
52
|
+
id: 4,
|
|
53
|
+
idType: PartnerTypesDetail.ACCOUNTANT_LOGICIEL.id,
|
|
54
|
+
name: 'Comptalib',
|
|
55
|
+
excludeBrand: ['Comptalib'],
|
|
56
|
+
disabled: false,
|
|
57
|
+
},
|
|
58
|
+
ALEO: {
|
|
59
|
+
id: 5,
|
|
60
|
+
idType: PartnerTypesDetail.WEBSITE.id,
|
|
61
|
+
name: 'Aleo',
|
|
62
|
+
excludeBrand: [],
|
|
63
|
+
disabled: false,
|
|
64
|
+
},
|
|
65
|
+
TRICOLORES: {
|
|
66
|
+
id: 6,
|
|
67
|
+
idType: PartnerTypesDetail.DOMICILIATION.id,
|
|
68
|
+
name: 'Tricolores',
|
|
69
|
+
excludeBrand: [],
|
|
70
|
+
disabled: false,
|
|
71
|
+
},
|
|
72
|
+
QONTO: {
|
|
73
|
+
id: 7,
|
|
74
|
+
idType: null,
|
|
75
|
+
name: 'Qonto',
|
|
76
|
+
excludeBrand: [],
|
|
77
|
+
disabled: true,
|
|
78
|
+
},
|
|
79
|
+
SHINE: {
|
|
80
|
+
id: 8,
|
|
81
|
+
idType: null,
|
|
82
|
+
name: 'Shine',
|
|
83
|
+
excludeBrand: [],
|
|
84
|
+
disabled: true,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -169,6 +169,7 @@ export enum PrestationType {
|
|
|
169
169
|
STATUTS_FREE = 212,
|
|
170
170
|
STATUTS_OPTION_1 = 213,
|
|
171
171
|
STATUTS_OPTION_2 = 214,
|
|
172
|
+
STATUTS_OPTION_AE = 215,
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
export interface PrestationDetailEnum {
|
|
@@ -3032,4 +3033,21 @@ export const PrestationDetail: PrestationDetailEnum = {
|
|
|
3032
3033
|
signaturePage: null,
|
|
3033
3034
|
point: 0,
|
|
3034
3035
|
},
|
|
3036
|
+
STATUTS_OPTION_AE: {
|
|
3037
|
+
id: PrestationType.STATUTS_OPTION_AE,
|
|
3038
|
+
name: 'Statuts - Auto\'Créa',
|
|
3039
|
+
isComptable: true,
|
|
3040
|
+
isJuridique: true,
|
|
3041
|
+
isSocial: false,
|
|
3042
|
+
isAttestation: false,
|
|
3043
|
+
inAverageCart: false,
|
|
3044
|
+
isBack: false,
|
|
3045
|
+
price: 118.8,
|
|
3046
|
+
isCatalog: true,
|
|
3047
|
+
hidden: false,
|
|
3048
|
+
isComplementary: false,
|
|
3049
|
+
signaturePosition: '',
|
|
3050
|
+
signaturePage: null,
|
|
3051
|
+
point: 0,
|
|
3052
|
+
},
|
|
3035
3053
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ISociety } from '../../models/ISociety';
|
|
2
|
+
|
|
3
|
+
export class PartnerStatisticType {
|
|
4
|
+
id: number;
|
|
5
|
+
fullname: string;
|
|
6
|
+
Native?: partnerCount;
|
|
7
|
+
Pourcentage?: partnerCount;
|
|
8
|
+
Clementine?: partnerCount;
|
|
9
|
+
Comptalib?:partnerCount;
|
|
10
|
+
Aleo?: partnerCount;
|
|
11
|
+
Tricolores?: partnerCount;
|
|
12
|
+
Qonto?: partnerCount;
|
|
13
|
+
Shine?: partnerCount;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class partnerCount {
|
|
17
|
+
number: number;
|
|
18
|
+
societies: Partial<ISociety>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApiPropertyOptional } from '../../../../utils';
|
|
2
|
+
|
|
3
|
+
export class QueryPartnerAll {
|
|
4
|
+
@ApiPropertyOptional({
|
|
5
|
+
description: 'society id',
|
|
6
|
+
required: false,
|
|
7
|
+
type: Number,
|
|
8
|
+
})
|
|
9
|
+
idSociety?: number;
|
|
10
|
+
|
|
11
|
+
@ApiPropertyOptional({
|
|
12
|
+
description: 'user id',
|
|
13
|
+
required: false,
|
|
14
|
+
type: Number,
|
|
15
|
+
})
|
|
16
|
+
idUser?: number;
|
|
17
|
+
|
|
18
|
+
@ApiPropertyOptional({
|
|
19
|
+
description: 'partner id',
|
|
20
|
+
required: false,
|
|
21
|
+
type: String,
|
|
22
|
+
})
|
|
23
|
+
idPartner?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApiPropertyOptional } from '../../../../utils';
|
|
2
|
+
|
|
3
|
+
export class QueryPartnerStatistic {
|
|
4
|
+
@ApiPropertyOptional({
|
|
5
|
+
description: 'Commercial',
|
|
6
|
+
required: false,
|
|
7
|
+
type: Number,
|
|
8
|
+
})
|
|
9
|
+
idCommercial?: number;
|
|
10
|
+
|
|
11
|
+
@ApiPropertyOptional({
|
|
12
|
+
description: 'Mois',
|
|
13
|
+
required: false,
|
|
14
|
+
type: Number,
|
|
15
|
+
})
|
|
16
|
+
month?: number;
|
|
17
|
+
|
|
18
|
+
@ApiPropertyOptional({
|
|
19
|
+
description: 'Année',
|
|
20
|
+
required: false,
|
|
21
|
+
type: Number,
|
|
22
|
+
})
|
|
23
|
+
year?: number;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUser } from './IUser';
|
|
2
|
+
import { ISociety } from './ISociety';
|
|
3
|
+
|
|
4
|
+
export interface ILeadsToPartners {
|
|
5
|
+
id?: number,
|
|
6
|
+
idPartner: number,
|
|
7
|
+
idSociety: number,
|
|
8
|
+
idUser: number,
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
updatedAt?: Date;
|
|
11
|
+
|
|
12
|
+
// Associations
|
|
13
|
+
society?: ISociety;
|
|
14
|
+
user?: IUser;
|
|
15
|
+
}
|
package/ts/types/index.ts
CHANGED
|
@@ -90,6 +90,7 @@ export * from './Interface/models/IProductInvoice';
|
|
|
90
90
|
export * from './Interface/models/IImmobilization';
|
|
91
91
|
export * from './Interface/models/IKilometricAllowanceScale';
|
|
92
92
|
export * from './Interface/models/ILabelPaymentWaiting';
|
|
93
|
+
export * from './Interface/models/ILeadsToPartners';
|
|
93
94
|
export * from './Interface/models/ILegalForm';
|
|
94
95
|
export * from './Interface/models/ILegalNotice';
|
|
95
96
|
export * from './Interface/models/ILettering';
|
|
@@ -364,6 +365,7 @@ export * from './Enum/PartnerType';
|
|
|
364
365
|
export * from './Enum/ThirdPartyType';
|
|
365
366
|
export * from './Enum/FecFileDelimiter';
|
|
366
367
|
export * from './Enum/IncomeStatement';
|
|
368
|
+
export * from './Enum/Partners';
|
|
367
369
|
export * from './Enum/PartnerTransactionType';
|
|
368
370
|
export * from './Enum/Vehicle';
|
|
369
371
|
export * from './Enum/VehicleType';
|
|
@@ -845,6 +847,7 @@ export * from './Interface/api/checklist/Read';
|
|
|
845
847
|
export * from './Interface/api/checklist/Query';
|
|
846
848
|
export * from './Interface/api/checklist/Update';
|
|
847
849
|
export * from './Interface/api/notification/CreateNotification';
|
|
850
|
+
export * from './Interface/api/notification/Delete';
|
|
848
851
|
export * from './Interface/api/mobile/UpdateMobile';
|
|
849
852
|
export * from './Interface/api/mobile/QueryMobileMigration';
|
|
850
853
|
export * from './Interface/api/societyEvent/QuerySocietyEvent';
|
|
@@ -948,4 +951,7 @@ export * from './Interface/api/affectedPatrimony/ResultCreateAffectedPatrimony';
|
|
|
948
951
|
export * from './Interface/api/affectedPatrimony/ReadAffectedPatrimony';
|
|
949
952
|
export * from './Interface/api/notificationSetting/CreateNotificationSetting';
|
|
950
953
|
export * from './Interface/api/notificationSetting/UpdateNotificationSetting';
|
|
951
|
-
export * from './Interface/api/appNotification/Update';
|
|
954
|
+
export * from './Interface/api/appNotification/Update';
|
|
955
|
+
export * from './Interface/api/partners/QueryPartnerAll';
|
|
956
|
+
export * from './Interface/api/partners/QueryPartnerStatistic';
|
|
957
|
+
export * from './Interface/api/partners/PartnerStatisticType';
|
package/ts/utils/brands.ts
CHANGED
|
@@ -31,13 +31,16 @@ type brand = {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
const allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'Clems', 'StatutsExpress'] as const;
|
|
35
|
+
type BrandList = typeof allBrands[number];
|
|
36
|
+
|
|
34
37
|
type getBrandConfigParams = {
|
|
35
38
|
idTypeBrand?: number,
|
|
36
39
|
objectWaited?: string,
|
|
37
40
|
nodeEnv?: string
|
|
38
41
|
};
|
|
39
42
|
|
|
40
|
-
const getBrandNameByNodeEnv = (nodeEnv?: string):
|
|
43
|
+
const getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {
|
|
41
44
|
const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;
|
|
42
45
|
if (env) {
|
|
43
46
|
if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {
|
|
@@ -59,6 +62,11 @@ const getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart' | 'Comptalib' | '
|
|
|
59
62
|
return 'Clementine';
|
|
60
63
|
};
|
|
61
64
|
|
|
65
|
+
const isItThisBrand = (brandList: BrandList, nodeEnv?: string): boolean => {
|
|
66
|
+
const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;
|
|
67
|
+
return getBrandNameByNodeEnv(env) === brandList;
|
|
68
|
+
};
|
|
69
|
+
|
|
62
70
|
const getAllBrandByNodeEnv = (nodeEnv?: string): Array<brand> => {
|
|
63
71
|
const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;
|
|
64
72
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
@@ -123,5 +131,5 @@ const getBrandByEmail = (email: string): 'Legalstart' | 'Comptalib' | 'Clementin
|
|
|
123
131
|
};
|
|
124
132
|
|
|
125
133
|
export {
|
|
126
|
-
getBrandConfig, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail,
|
|
134
|
+
getBrandConfig, isItThisBrand, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail,
|
|
127
135
|
};
|