@silexpert/core 1.1.232 → 1.1.233

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.
Files changed (38) hide show
  1. package/dist/cjs/api/resources/Subscription.d.ts +1 -1
  2. package/dist/cjs/api/resources/Subscription.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Subscription.js.map +1 -1
  4. package/dist/cjs/types/Enum/CommercialOfferType.d.ts +13 -0
  5. package/dist/cjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
  6. package/dist/cjs/types/Enum/CommercialOfferType.js +11 -1
  7. package/dist/cjs/types/Enum/CommercialOfferType.js.map +1 -1
  8. package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts +2 -0
  9. package/dist/cjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
  10. package/dist/cjs/types/Interface/models/ICommercialOffer.js.map +1 -1
  11. package/dist/cjs/utils/brands.js +1 -1
  12. package/dist/cjs/utils/brands.js.map +1 -1
  13. package/dist/cjs/utils/commercialOffer.d.ts +1 -1
  14. package/dist/cjs/utils/commercialOffer.d.ts.map +1 -1
  15. package/dist/cjs/utils/commercialOffer.js +3 -2
  16. package/dist/cjs/utils/commercialOffer.js.map +1 -1
  17. package/dist/mjs/api/resources/Subscription.d.ts +1 -1
  18. package/dist/mjs/api/resources/Subscription.d.ts.map +1 -1
  19. package/dist/mjs/api/resources/Subscription.js.map +1 -1
  20. package/dist/mjs/types/Enum/CommercialOfferType.d.ts +13 -0
  21. package/dist/mjs/types/Enum/CommercialOfferType.d.ts.map +1 -1
  22. package/dist/mjs/types/Enum/CommercialOfferType.js +11 -1
  23. package/dist/mjs/types/Enum/CommercialOfferType.js.map +1 -1
  24. package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts +2 -0
  25. package/dist/mjs/types/Interface/models/ICommercialOffer.d.ts.map +1 -1
  26. package/dist/mjs/types/Interface/models/ICommercialOffer.js.map +1 -1
  27. package/dist/mjs/utils/brands.js +1 -1
  28. package/dist/mjs/utils/brands.js.map +1 -1
  29. package/dist/mjs/utils/commercialOffer.d.ts +1 -1
  30. package/dist/mjs/utils/commercialOffer.d.ts.map +1 -1
  31. package/dist/mjs/utils/commercialOffer.js +3 -2
  32. package/dist/mjs/utils/commercialOffer.js.map +1 -1
  33. package/package.json +1 -1
  34. package/ts/api/resources/Subscription.ts +1 -1
  35. package/ts/types/Enum/CommercialOfferType.ts +11 -1
  36. package/ts/types/Interface/models/ICommercialOffer.ts +2 -0
  37. package/ts/utils/brands.ts +1 -1
  38. package/ts/utils/commercialOffer.ts +3 -2
@@ -3,7 +3,7 @@ import { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types'
3
3
  import Stripe from 'stripe';
4
4
  export declare class Subscription extends Resource {
5
5
  retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice>;
6
- getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription>>;
6
+ getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription> | null>;
7
7
  createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>>;
8
8
  createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>>;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,qBAAa,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAI9E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAInF,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;CAG9E"}
1
+ {"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,qBAAa,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAIrF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAInF,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;CAG9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAIvC,MAAa,YAAa,SAAQ,mBAAQ;IACxC,uBAAuB,CAAC,MAAqC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,SAAS,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,SAAS,yBAAyB,CAAC,CAAC;IAC5E,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACpD,CAAC;CACF;AAhBD,oCAgBC","sourcesContent":["import { Resource } from '../Resource';\nimport { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types';\nimport Stripe from 'stripe';\n\nexport class Subscription extends Resource {\n retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice> {\n return this.axios.$get('/subscription/next-invoice', { params });\n }\n\n getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription>> {\n return this.axios.$get(`/societies/${idSociety}/subscriptions`);\n }\n\n createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>> {\n return this.axios.$post(`/societies/${idSociety}/subscriptions/sessions`);\n }\n\n createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>> {\n return this.axios.$post('/subscriptions/portals');\n }\n}\n"]}
1
+ {"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAIvC,MAAa,YAAa,SAAQ,mBAAQ;IACxC,uBAAuB,CAAC,MAAqC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,SAAS,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,SAAS,yBAAyB,CAAC,CAAC;IAC5E,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACpD,CAAC;CACF;AAhBD,oCAgBC","sourcesContent":["import { Resource } from '../Resource';\nimport { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types';\nimport Stripe from 'stripe';\n\nexport class Subscription extends Resource {\n retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice> {\n return this.axios.$get('/subscription/next-invoice', { params });\n }\n\n getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription> | null> {\n return this.axios.$get(`/societies/${idSociety}/subscriptions`);\n }\n\n createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>> {\n return this.axios.$post(`/societies/${idSociety}/subscriptions/sessions`);\n }\n\n createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>> {\n return this.axios.$post('/subscriptions/portals');\n }\n}\n"]}
@@ -118,6 +118,19 @@ export declare const CommercialOfferTypeDetail: {
118
118
  isCatalog: null;
119
119
  isBack: boolean;
120
120
  };
121
+ BALANCE_SHEET_OFFERED_EXCEPTIONAL: {
122
+ id: number;
123
+ label: string;
124
+ text: string;
125
+ amountType: {
126
+ id: number;
127
+ label: string;
128
+ };
129
+ idPrestationList: never[];
130
+ isComptable: boolean;
131
+ isCatalog: null;
132
+ isBack: boolean;
133
+ };
121
134
  };
122
135
  export {};
123
136
  //# sourceMappingURL=CommercialOfferType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommercialOfferType.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFrC,CAAC"}
@@ -80,7 +80,17 @@ exports.CommercialOfferTypeDetail = {
80
80
  BALANCE_SHEET_OFFERED: {
81
81
  id: 7,
82
82
  label: 'Bilan à 0',
83
- text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire ',
83
+ text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire',
84
+ amountType: exports.CommercialOfferAmountType.MONEY,
85
+ idPrestationList: [],
86
+ isComptable: true,
87
+ isCatalog: null,
88
+ isBack: true,
89
+ },
90
+ BALANCE_SHEET_OFFERED_EXCEPTIONAL: {
91
+ id: 8,
92
+ label: 'Offre exceptionnel Express',
93
+ text: 'Offre exceptionnel, bilan à %value% € pour l\'exercice %exerciceYear%',
84
94
  amountType: exports.CommercialOfferAmountType.MONEY,
85
95
  idPrestationList: [],
86
96
  isComptable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"CommercialOfferType.js","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAiBrC,QAAA,yBAAyB,GAAG;IACvC,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;CACF,CAAC;AAEW,QAAA,yBAAyB,GAAG;IACvC,cAAc,EAAG;QACf,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,wEAAwE;QAC9E,UAAU,EAAE,iCAAyB,CAAC,UAAU;QAChD,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,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;IACD,qBAAqB,EAAG;QACtB,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,gHAAgH;QACtH,UAAU,EAAE,iCAAyB,CAAC,KAAK;QAC3C,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAC","sourcesContent":["import { PrestationType } from './PrestationType';\n\ntype commercialOfferTypeAmount = {\n id: number;\n label: string;\n};\n\nexport type CommercialOfferTypeType = {\n id: number;\n label: string;\n amountType: commercialOfferTypeAmount;\n idPrestationList: number[];\n isComptable: boolean | null;\n isCatalog: boolean | null;\n isBack: boolean | null;\n};\n\nexport const CommercialOfferAmountType = {\n PERCENTAGE: {\n id: 1,\n label: '%',\n },\n MONTH: {\n id: 2,\n label: 'Mois',\n },\n MONEY: {\n id: 3,\n label: '€',\n },\n};\n\nexport const CommercialOfferTypeDetail = {\n RECOVERY_MONTH : {\n id: 1,\n label: '% de reprise sur les mois',\n text: '%value% % offert sur les mois de reprise, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n MONTH_OFFERED : {\n id: 2,\n label: 'Nb de mois offert',\n text: '%value% mois offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONTH,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n AMOUNT_OFFERED : {\n id: 3,\n label: 'Montant offert',\n text: '%value% euros offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n SPONSORSHIP : {\n id: 4,\n label: 'Parrainage',\n text: '%value% euros de parrainage, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n COMPANY_SETUP: {\n id: 5,\n label: '% de la création d\\'entreprise',\n text: 'Création offerte, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [PrestationType.CREATION_SOCIETE],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n PERCENTAGE_OFFERED : {\n id: 6,\n label: '% offert',\n text: '%value% % offert sur l\\'année, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n BALANCE_SHEET_OFFERED : {\n id: 7,\n label: 'Bilan à 0',\n text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\\'il y ai moins de 50 lignes sur le relevé bancaire ',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n};"]}
1
+ {"version":3,"file":"CommercialOfferType.js","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAiBrC,QAAA,yBAAyB,GAAG;IACvC,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;CACF,CAAC;AAEW,QAAA,yBAAyB,GAAG;IACvC,cAAc,EAAG;QACf,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,wEAAwE;QAC9E,UAAU,EAAE,iCAAyB,CAAC,UAAU;QAChD,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,KAAK;KACd;IACD,aAAa,EAAG;QACd,EAAE,EAAE,CAAC;QACL,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EAAE,+GAA+G;QACrH,UAAU,EAAE,iCAAyB,CAAC,KAAK;QAC3C,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;IACD,iCAAiC,EAAG;QAClC,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,uEAAuE;QAC7E,UAAU,EAAE,iCAAyB,CAAC,KAAK;QAC3C,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAC","sourcesContent":["import { PrestationType } from './PrestationType';\n\ntype commercialOfferTypeAmount = {\n id: number;\n label: string;\n};\n\nexport type CommercialOfferTypeType = {\n id: number;\n label: string;\n amountType: commercialOfferTypeAmount;\n idPrestationList: number[];\n isComptable: boolean | null;\n isCatalog: boolean | null;\n isBack: boolean | null;\n};\n\nexport const CommercialOfferAmountType = {\n PERCENTAGE: {\n id: 1,\n label: '%',\n },\n MONTH: {\n id: 2,\n label: 'Mois',\n },\n MONEY: {\n id: 3,\n label: '€',\n },\n};\n\nexport const CommercialOfferTypeDetail = {\n RECOVERY_MONTH : {\n id: 1,\n label: '% de reprise sur les mois',\n text: '%value% % offert sur les mois de reprise, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n MONTH_OFFERED : {\n id: 2,\n label: 'Nb de mois offert',\n text: '%value% mois offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONTH,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n AMOUNT_OFFERED : {\n id: 3,\n label: 'Montant offert',\n text: '%value% euros offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n SPONSORSHIP : {\n id: 4,\n label: 'Parrainage',\n text: '%value% euros de parrainage, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n COMPANY_SETUP: {\n id: 5,\n label: '% de la création d\\'entreprise',\n text: 'Création offerte, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [PrestationType.CREATION_SOCIETE],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n PERCENTAGE_OFFERED : {\n id: 6,\n label: '% offert',\n text: '%value% % offert sur l\\'année, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n BALANCE_SHEET_OFFERED : {\n id: 7,\n label: 'Bilan à 0',\n text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\\'il y ai moins de 50 lignes sur le relevé bancaire',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n BALANCE_SHEET_OFFERED_EXCEPTIONAL : {\n id: 8,\n label: 'Offre exceptionnel Express',\n text: 'Offre exceptionnel, bilan à %value% € pour l\\'exercice %exerciceYear%',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n};"]}
@@ -6,6 +6,8 @@ export interface ICommercialOffer {
6
6
  title: string;
7
7
  label: string;
8
8
  amount?: number;
9
+ turnoverMax?: number;
10
+ idComptaType?: number;
9
11
  startDate: Date;
10
12
  endDate: Date;
11
13
  cumulative: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ICommercialOffer.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACvD"}
1
+ {"version":3,"file":"ICommercialOffer.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ICommercialOffer.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercicePrestationOffer } from './IExercicePrestationOffer';\n\nexport interface ICommercialOffer {\n id?: number,\n idCommercialOfferType: number,\n brand: any,\n title: string,\n label: string,\n amount?: number,\n startDate: Date,\n endDate: Date,\n cumulative: boolean,\n createdAt?: Date,\n updatedAt?: Date,\n deletedAt?: Date\n\n /* Associations */\n exercicePrestationOffers?: IExercicePrestationOffer[];\n}"]}
1
+ {"version":3,"file":"ICommercialOffer.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercicePrestationOffer } from './IExercicePrestationOffer';\n\nexport interface ICommercialOffer {\n id?: number,\n idCommercialOfferType: number,\n brand: any,\n title: string,\n label: string,\n amount?: number,\n turnoverMax?: number,\n idComptaType?: number,\n startDate: Date,\n endDate: Date,\n cumulative: boolean,\n createdAt?: Date,\n updatedAt?: Date,\n deletedAt?: Date\n\n /* Associations */\n exercicePrestationOffers?: IExercicePrestationOffer[];\n}"]}
@@ -12,7 +12,7 @@ const getBrandNameByNodeEnv = (nodeEnv) => {
12
12
  var _a;
13
13
  const env = (_a = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV) !== null && _a !== void 0 ? _a : process.env.API_HOST;
14
14
  if (env) {
15
- if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {
15
+ if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -1) {
16
16
  return 'Legalstart';
17
17
  }
18
18
  if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {
@@ -1 +1 @@
1
- {"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;A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OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,aAAa,CAAC;IAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IACpE,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,qBAAqB,CAAC;IAC/E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAe0E,0CAAe;AAb3F,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAiB,EAAE;IAC1D,MAAM,WAAW,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG;QAClB,eAAe,EAAf,iCAAe,EAAE,eAAe,EAAf,iCAAe,EAAE,cAAc,EAAd,+BAAc,EAAE,gBAAgB,EAAhB,mCAAgB,EAAE,mBAAmB,EAAnB,yCAAmB;KACxF,CAAC;IACF,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAG2F,0CAAe","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 { 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', '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('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (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, 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, 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 || email.indexOf('comptastartbyclementine.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\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
1
+ {"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAC1C,mEAAgE;AAChE,mEAAgE;AAChE,iEAA8D;AAC9D,qEAAkE;AAClE,2EAAwE;AA2BxE,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,CAAU,CAAC;AAStG,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAa,EAAE;;IAC5D,MAAM,GAAG,GAAG,MAAA,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpE,IAAI,GAAG,EAAE;QACP,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAK,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE;YACjN,OAAO,YAAY,CAAC;SACrB;QACD,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE;YAClE,OAAO,WAAW,CAAC;SACpB;QACD,IAAI,GAAG,CAAC,OAAO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AAE,mBAAmB,EAAnB,yCAAmB;KACxF,CAAC;IACF,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAG2F,0CAAe","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 { 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', '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 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -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('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (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, 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, 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 || email.indexOf('comptastartbyclementine.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\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
@@ -1,6 +1,6 @@
1
1
  import { ICommercialOffer } from '../types';
2
2
  declare const displayCommercialOffer: (idPrestationList: number, idCommercialOfferType: number) => boolean;
3
3
  declare const disableCommercialOffer: (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[]) => boolean;
4
- declare const getCommercialOfferList: (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[]) => ICommercialOffer[];
4
+ declare const getCommercialOfferList: (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number) => ICommercialOffer[];
5
5
  export { displayCommercialOffer, disableCommercialOffer, getCommercialOfferList, };
6
6
  //# sourceMappingURL=commercialOffer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commercialOffer.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQ5C,QAAA,MAAM,sBAAsB,qBAAsB,MAAM,yBAAyB,MAAM,KAAG,OAazF,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,MAAM,mBAAmB,MAAM,EAAE,uBAAuB,gBAAgB,EAAE,KAAI,OAI7H,CAAC;AAEF,QAAA,MAAM,sBAAsB,0BAA2B,MAAM,gBAAgB,MAAM,aAAa,gBAAgB,EAAE,KAAG,gBAAgB,EAGpI,CAAC;AAEF,OAAO,EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC"}
1
+ {"version":3,"file":"commercialOffer.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAS5C,QAAA,MAAM,sBAAsB,qBAAsB,MAAM,yBAAyB,MAAM,KAAG,OAazF,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,MAAM,mBAAmB,MAAM,EAAE,uBAAuB,gBAAgB,EAAE,KAAI,OAI7H,CAAC;AAEF,QAAA,MAAM,sBAAsB,0BAA2B,MAAM,gBAAgB,MAAM,aAAa,gBAAgB,EAAE,eAAe,MAAM,gBAAgB,MAAM,KAAG,gBAAgB,EAG/K,CAAC;AAEF,OAAO,EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCommercialOfferList = exports.disableCommercialOffer = exports.displayCommercialOffer = void 0;
4
4
  const CommercialOfferType_1 = require("../types/Enum/CommercialOfferType");
5
5
  const PrestationType_1 = require("../types/Enum/PrestationType");
6
+ const ComptaType_1 = require("../types/Enum/ComptaType");
6
7
  const dayjs = require("dayjs");
7
8
  const isBetween = require("dayjs/plugin/isBetween");
8
9
  dayjs.extend(isBetween);
@@ -31,8 +32,8 @@ const disableCommercialOffer = (idCurrentOffer, idOfferSelected, commercialOffer
31
32
  return false;
32
33
  };
33
34
  exports.disableCommercialOffer = disableCommercialOffer;
34
- const getCommercialOfferList = (idCommercialOfferType, societyBrand, offerList) => {
35
- const commercialOfferList = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand));
35
+ const getCommercialOfferList = (idCommercialOfferType, societyBrand, offerList, turnoverMax, idComptaType) => {
36
+ const commercialOfferList = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType_1.ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType_1.ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));
36
37
  return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));
37
38
  };
38
39
  exports.getCommercialOfferList = getCommercialOfferList;
@@ -1 +1 @@
1
- {"version":3,"file":"commercialOffer.js","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":";;;AACA,2EAAuG;AACvG,iEAAgE;AAChE,+BAA+B;AAC/B,oDAAoD;AAEpD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,sBAAsB,GAAG,CAAC,gBAAwB,EAAE,qBAA6B,EAAW,EAAE;IAClG,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,iCAAgB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,gBAAgB,CAAC,CAAC;IAC9G,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CAAC,+CAAyB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,E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AE,UAAU,MAAK,KAAK;QAAE,OAAO,IAAI,CAAC;SAC3H,IAAI,CAAA,MAAA,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,eAAe,CAAC,CAAC,CAAC,CAAC,0CAAE,UAAU,MAAK,KAAK;QAAE,OAAO,IAAI,CAAC;;QAC1G,OAAO,KAAK,CAAC;AACpB,CAAC,CAAC;AAQwB,wDAAsB;AANhD,MAAM,sBAAsB,GAAG,CAAC,qBAA6B,EAAE,YAAoB,EAAE,SAA6B,EAAsB,EAAE;IACxI,MAAM,mBAAmB,GAAuB,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,qBAAqB,KAAK,qBAAqB,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACzK,OAAO,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3H,CAAC,CAAC;AAGgD,wDAAsB","sourcesContent":["import { ICommercialOffer } from '../types';\nimport { CommercialOfferTypeType, CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';\nimport { PrestationDetail } from '../types/Enum/PrestationType';\nimport * as dayjs from 'dayjs';\nimport * as isBetween from 'dayjs/plugin/isBetween';\n\ndayjs.extend(isBetween);\n\nconst displayCommercialOffer = (idPrestationList: number, idCommercialOfferType: number): boolean => {\n const prestationList = Object.values(PrestationDetail).find(prestation => prestation.id === idPrestationList);\n const commercialOfferType: CommercialOfferTypeType | undefined = Object.values(CommercialOfferTypeDetail).find(offer => offer.id === idCommercialOfferType);\n if (commercialOfferType?.idPrestationList.length && commercialOfferType?.idPrestationList.includes(idPrestationList)) return true;\n else if (prestationList && \n !commercialOfferType?.idPrestationList.length &&\n (\n (!commercialOfferType?.isComptable || commercialOfferType?.isComptable === prestationList?.isComptable)\n && (!commercialOfferType?.isCatalog || commercialOfferType?.isCatalog === prestationList.isCatalog)\n && (!commercialOfferType?.isBack || commercialOfferType?.isBack === prestationList.isBack)\n )\n ) return true;\n else return false;\n};\n\nconst disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[] ): boolean=> {\n if (idOfferSelected.length && commercialOfferList.find(offer => offer.id === idCurrentOffer)?.cumulative === false) return true;\n else if (commercialOfferList.find(offer => offer.id === idOfferSelected[0])?.cumulative === false) return true;\n else return false;\n};\n\nconst getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[]): ICommercialOffer[] => {\n const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand));\n return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));\n};\n\nexport {\n displayCommercialOffer, disableCommercialOffer, getCommercialOfferList,\n};"]}
1
+ {"version":3,"file":"commercialOffer.js","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":";;;AACA,2EAAuG;AACvG,iEAAgE;AAChE,yDAAsD;AACtD,+BAA+B;AAC/B,oDAAoD;AAEpD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,sBAAsB,GAAG,CAAC,gBAAwB,EAAE,qBAA6B,EAAW,EAAE;IAClG,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,iCAAgB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,gBAAgB,CAAC,CAAC;IAC9G,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CAAC,+CAAyB,CAAC,CAAC,IAAI,CAAC,K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gD,wDAAsB","sourcesContent":["import { ICommercialOffer } from '../types';\nimport { CommercialOfferTypeType, CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';\nimport { PrestationDetail } from '../types/Enum/PrestationType';\nimport { ComptaType } from '../types/Enum/ComptaType';\nimport * as dayjs from 'dayjs';\nimport * as isBetween from 'dayjs/plugin/isBetween';\n\ndayjs.extend(isBetween);\n\nconst displayCommercialOffer = (idPrestationList: number, idCommercialOfferType: number): boolean => {\n const prestationList = Object.values(PrestationDetail).find(prestation => prestation.id === idPrestationList);\n const commercialOfferType: CommercialOfferTypeType | undefined = Object.values(CommercialOfferTypeDetail).find(offer => offer.id === idCommercialOfferType);\n if (commercialOfferType?.idPrestationList.length && commercialOfferType?.idPrestationList.includes(idPrestationList)) return true;\n else if (prestationList && \n !commercialOfferType?.idPrestationList.length &&\n (\n (!commercialOfferType?.isComptable || commercialOfferType?.isComptable === prestationList?.isComptable)\n && (!commercialOfferType?.isCatalog || commercialOfferType?.isCatalog === prestationList.isCatalog)\n && (!commercialOfferType?.isBack || commercialOfferType?.isBack === prestationList.isBack)\n )\n ) return true;\n else return false;\n};\n\nconst disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[] ): boolean=> {\n if (idOfferSelected.length && commercialOfferList.find(offer => offer.id === idCurrentOffer)?.cumulative === false) return true;\n else if (commercialOfferList.find(offer => offer.id === idOfferSelected[0])?.cumulative === false) return true;\n else return false;\n};\n\nconst getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number): ICommercialOffer[] => {\n const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));\n return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));\n};\n\nexport {\n displayCommercialOffer, disableCommercialOffer, getCommercialOfferList,\n};"]}
@@ -3,7 +3,7 @@ import { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types'
3
3
  import Stripe from 'stripe';
4
4
  export declare class Subscription extends Resource {
5
5
  retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice>;
6
- getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription>>;
6
+ getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription> | null>;
7
7
  createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>>;
8
8
  createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>>;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,qBAAa,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAI9E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAInF,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;CAG9E"}
1
+ {"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,qBAAa,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAIrF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAInF,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;CAG9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAqC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,SAAS,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,SAAS,yBAAyB,CAAC,CAAC;IAC5E,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types';\nimport Stripe from 'stripe';\n\nexport class Subscription extends Resource {\n retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice> {\n return this.axios.$get('/subscription/next-invoice', { params });\n }\n\n getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription>> {\n return this.axios.$get(`/societies/${idSociety}/subscriptions`);\n }\n\n createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>> {\n return this.axios.$post(`/societies/${idSociety}/subscriptions/sessions`);\n }\n\n createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>> {\n return this.axios.$post('/subscriptions/portals');\n }\n}\n"]}
1
+ {"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../ts/api/resources/Subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,MAAM,OAAO,YAAa,SAAQ,QAAQ;IACxC,uBAAuB,CAAC,MAAqC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,SAAS,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,SAAS,yBAAyB,CAAC,CAAC;IAC5E,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { RetrieveUpcomingInvoiceParams, ReadUpcomingInvoice } from '../../types';\nimport Stripe from 'stripe';\n\nexport class Subscription extends Resource {\n retrieveUpcomingInvoice(params: RetrieveUpcomingInvoiceParams): Promise<ReadUpcomingInvoice> {\n return this.axios.$get('/subscription/next-invoice', { params });\n }\n\n getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription> | null> {\n return this.axios.$get(`/societies/${idSociety}/subscriptions`);\n }\n\n createSession(idSociety: number): Promise<Stripe.Response<Stripe.Checkout.Session>> {\n return this.axios.$post(`/societies/${idSociety}/subscriptions/sessions`);\n }\n\n createPortalSession(): Promise<Stripe.Response<Stripe.BillingPortal.Session>> {\n return this.axios.$post('/subscriptions/portals');\n }\n}\n"]}
@@ -118,6 +118,19 @@ export declare const CommercialOfferTypeDetail: {
118
118
  isCatalog: null;
119
119
  isBack: boolean;
120
120
  };
121
+ BALANCE_SHEET_OFFERED_EXCEPTIONAL: {
122
+ id: number;
123
+ label: string;
124
+ text: string;
125
+ amountType: {
126
+ id: number;
127
+ label: string;
128
+ };
129
+ idPrestationList: never[];
130
+ isComptable: boolean;
131
+ isCatalog: null;
132
+ isBack: boolean;
133
+ };
121
134
  };
122
135
  export {};
123
136
  //# sourceMappingURL=CommercialOfferType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommercialOfferType.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,yBAAyB,CAAC;IACtC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;CAarC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuErC,CAAC"}
1
+ {"version":3,"file":"CommercialOfferType.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,yBAAyB,CAAC;IACtC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;CAarC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFrC,CAAC"}
@@ -77,7 +77,17 @@ export const CommercialOfferTypeDetail = {
77
77
  BALANCE_SHEET_OFFERED: {
78
78
  id: 7,
79
79
  label: 'Bilan à 0',
80
- text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire ',
80
+ text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire',
81
+ amountType: CommercialOfferAmountType.MONEY,
82
+ idPrestationList: [],
83
+ isComptable: true,
84
+ isCatalog: null,
85
+ isBack: true,
86
+ },
87
+ BALANCE_SHEET_OFFERED_EXCEPTIONAL: {
88
+ id: 8,
89
+ label: 'Offre exceptionnel Express',
90
+ text: 'Offre exceptionnel, bilan à %value% € pour l\'exercice %exerciceYear%',
81
91
  amountType: CommercialOfferAmountType.MONEY,
82
92
  idPrestationList: [],
83
93
  isComptable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"CommercialOfferType.js","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,cAAc,EAAG;QACf,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,wEAAwE;QAC9E,UAAU,EAAE,yBAAyB,CAAC,UAAU;QAChD,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,KAAK;KACd;IACD,aAAa,EAAG;QACd,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,mDAAmD;QACzD,U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3C,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAC","sourcesContent":["import { PrestationType } from './PrestationType';\n\ntype commercialOfferTypeAmount = {\n id: number;\n label: string;\n};\n\nexport type CommercialOfferTypeType = {\n id: number;\n label: string;\n amountType: commercialOfferTypeAmount;\n idPrestationList: number[];\n isComptable: boolean | null;\n isCatalog: boolean | null;\n isBack: boolean | null;\n};\n\nexport const CommercialOfferAmountType = {\n PERCENTAGE: {\n id: 1,\n label: '%',\n },\n MONTH: {\n id: 2,\n label: 'Mois',\n },\n MONEY: {\n id: 3,\n label: '€',\n },\n};\n\nexport const CommercialOfferTypeDetail = {\n RECOVERY_MONTH : {\n id: 1,\n label: '% de reprise sur les mois',\n text: '%value% % offert sur les mois de reprise, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n MONTH_OFFERED : {\n id: 2,\n label: 'Nb de mois offert',\n text: '%value% mois offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONTH,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n AMOUNT_OFFERED : {\n id: 3,\n label: 'Montant offert',\n text: '%value% euros offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n SPONSORSHIP : {\n id: 4,\n label: 'Parrainage',\n text: '%value% euros de parrainage, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n COMPANY_SETUP: {\n id: 5,\n label: '% de la création d\\'entreprise',\n text: 'Création offerte, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [PrestationType.CREATION_SOCIETE],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n PERCENTAGE_OFFERED : {\n id: 6,\n label: '% offert',\n text: '%value% % offert sur l\\'année, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n BALANCE_SHEET_OFFERED : {\n id: 7,\n label: 'Bilan à 0',\n text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\\'il y ai moins de 50 lignes sur le relevé bancaire ',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n};"]}
1
+ {"version":3,"file":"CommercialOfferType.js","sourceRoot":"","sources":["../../../../ts/types/Enum/CommercialOfferType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,UAAU,EAAE;QACV,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;QACL,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,GAAG;KACX;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,cAAc,EAAG;QACf,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,wEAAwE;QAC9E,UAAU,EAAE,yBAAyB,CAAC,UAAU;QAChD,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,KAAK;KACd;IACD,aAAa,EAAG;QACd,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,mDAAmD;QACzD,UAAU,EAAE,yBAAyB,CAA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;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;IACD,iCAAiC,EAAG;QAClC,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,uEAAuE;QAC7E,UAAU,EAAE,yBAAyB,CAAC,KAAK;QAC3C,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAC","sourcesContent":["import { PrestationType } from './PrestationType';\n\ntype commercialOfferTypeAmount = {\n id: number;\n label: string;\n};\n\nexport type CommercialOfferTypeType = {\n id: number;\n label: string;\n amountType: commercialOfferTypeAmount;\n idPrestationList: number[];\n isComptable: boolean | null;\n isCatalog: boolean | null;\n isBack: boolean | null;\n};\n\nexport const CommercialOfferAmountType = {\n PERCENTAGE: {\n id: 1,\n label: '%',\n },\n MONTH: {\n id: 2,\n label: 'Mois',\n },\n MONEY: {\n id: 3,\n label: '€',\n },\n};\n\nexport const CommercialOfferTypeDetail = {\n RECOVERY_MONTH : {\n id: 1,\n label: '% de reprise sur les mois',\n text: '%value% % offert sur les mois de reprise, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n MONTH_OFFERED : {\n id: 2,\n label: 'Nb de mois offert',\n text: '%value% mois offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONTH,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n AMOUNT_OFFERED : {\n id: 3,\n label: 'Montant offert',\n text: '%value% euros offert, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: false,\n },\n SPONSORSHIP : {\n id: 4,\n label: 'Parrainage',\n text: '%value% euros de parrainage, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: false,\n isBack: null,\n },\n COMPANY_SETUP: {\n id: 5,\n label: '% de la création d\\'entreprise',\n text: 'Création offerte, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [PrestationType.CREATION_SOCIETE],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n PERCENTAGE_OFFERED : {\n id: 6,\n label: '% offert',\n text: '%value% % offert sur l\\'année, valable jusqu\\'au %dateEnd%.',\n amountType: CommercialOfferAmountType.PERCENTAGE,\n idPrestationList: [],\n isComptable: null,\n isCatalog: null,\n isBack: null,\n },\n BALANCE_SHEET_OFFERED : {\n id: 7,\n label: 'Bilan à 0',\n text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\\'il y ai moins de 50 lignes sur le relevé bancaire',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n BALANCE_SHEET_OFFERED_EXCEPTIONAL : {\n id: 8,\n label: 'Offre exceptionnel Express',\n text: 'Offre exceptionnel, bilan à %value% € pour l\\'exercice %exerciceYear%',\n amountType: CommercialOfferAmountType.MONEY,\n idPrestationList: [],\n isComptable: true,\n isCatalog: null,\n isBack: true,\n },\n};"]}
@@ -6,6 +6,8 @@ export interface ICommercialOffer {
6
6
  title: string;
7
7
  label: string;
8
8
  amount?: number;
9
+ turnoverMax?: number;
10
+ idComptaType?: number;
9
11
  startDate: Date;
10
12
  endDate: Date;
11
13
  cumulative: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ICommercialOffer.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACvD"}
1
+ {"version":3,"file":"ICommercialOffer.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAA;IAGhB,wBAAwB,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ICommercialOffer.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercicePrestationOffer } from './IExercicePrestationOffer';\n\nexport interface ICommercialOffer {\n id?: number,\n idCommercialOfferType: number,\n brand: any,\n title: string,\n label: string,\n amount?: number,\n startDate: Date,\n endDate: Date,\n cumulative: boolean,\n createdAt?: Date,\n updatedAt?: Date,\n deletedAt?: Date\n\n /* Associations */\n exercicePrestationOffers?: IExercicePrestationOffer[];\n}"]}
1
+ {"version":3,"file":"ICommercialOffer.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/ICommercialOffer.ts"],"names":[],"mappings":"","sourcesContent":["import { IExercicePrestationOffer } from './IExercicePrestationOffer';\n\nexport interface ICommercialOffer {\n id?: number,\n idCommercialOfferType: number,\n brand: any,\n title: string,\n label: string,\n amount?: number,\n turnoverMax?: number,\n idComptaType?: number,\n startDate: Date,\n endDate: Date,\n cumulative: boolean,\n createdAt?: Date,\n updatedAt?: Date,\n deletedAt?: Date\n\n /* Associations */\n exercicePrestationOffers?: IExercicePrestationOffer[];\n}"]}
@@ -8,7 +8,7 @@ const allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'Stat
8
8
  const getBrandNameByNodeEnv = (nodeEnv) => {
9
9
  const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;
10
10
  if (env) {
11
- if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {
11
+ if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -1) {
12
12
  return 'Legalstart';
13
13
  }
14
14
  if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {
@@ -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,+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CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,qBAAqB,CAAC;IAC/E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAiB,EAAE;IAC1D,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG;QAClB,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB;KACxF,CAAC;IACF,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,OAAO,EACL,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,GAC3G,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';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\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', '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('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (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, 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, 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 || email.indexOf('comptastartbyclementine.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\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
1
+ {"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"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C,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IACjH,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,aAAa,CAAC;IAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IACpE,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,qBAAqB,CAAC;IAC/E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAiB,EAAE;IAC1D,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG;QAClB,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB;KACxF,CAAC;IACF,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,OAAO,EACL,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,GAC3G,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';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\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', '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 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -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('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (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, 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, 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 || email.indexOf('comptastartbyclementine.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\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
@@ -1,6 +1,6 @@
1
1
  import { ICommercialOffer } from '../types';
2
2
  declare const displayCommercialOffer: (idPrestationList: number, idCommercialOfferType: number) => boolean;
3
3
  declare const disableCommercialOffer: (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[]) => boolean;
4
- declare const getCommercialOfferList: (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[]) => ICommercialOffer[];
4
+ declare const getCommercialOfferList: (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number) => ICommercialOffer[];
5
5
  export { displayCommercialOffer, disableCommercialOffer, getCommercialOfferList, };
6
6
  //# sourceMappingURL=commercialOffer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commercialOffer.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQ5C,QAAA,MAAM,sBAAsB,qBAAsB,MAAM,yBAAyB,MAAM,KAAG,OAazF,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,MAAM,mBAAmB,MAAM,EAAE,uBAAuB,gBAAgB,EAAE,KAAI,OAI7H,CAAC;AAEF,QAAA,MAAM,sBAAsB,0BAA2B,MAAM,gBAAgB,MAAM,aAAa,gBAAgB,EAAE,KAAG,gBAAgB,EAGpI,CAAC;AAEF,OAAO,EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC"}
1
+ {"version":3,"file":"commercialOffer.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAS5C,QAAA,MAAM,sBAAsB,qBAAsB,MAAM,yBAAyB,MAAM,KAAG,OAazF,CAAC;AAEF,QAAA,MAAM,sBAAsB,mBAAoB,MAAM,mBAAmB,MAAM,EAAE,uBAAuB,gBAAgB,EAAE,KAAI,OAI7H,CAAC;AAEF,QAAA,MAAM,sBAAsB,0BAA2B,MAAM,gBAAgB,MAAM,aAAa,gBAAgB,EAAE,eAAe,MAAM,gBAAgB,MAAM,KAAG,gBAAgB,EAG/K,CAAC;AAEF,OAAO,EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';
2
2
  import { PrestationDetail } from '../types/Enum/PrestationType';
3
+ import { ComptaType } from '../types/Enum/ComptaType';
3
4
  import * as dayjs from 'dayjs';
4
5
  import * as isBetween from 'dayjs/plugin/isBetween';
5
6
  dayjs.extend(isBetween);
@@ -25,8 +26,8 @@ const disableCommercialOffer = (idCurrentOffer, idOfferSelected, commercialOffer
25
26
  else
26
27
  return false;
27
28
  };
28
- const getCommercialOfferList = (idCommercialOfferType, societyBrand, offerList) => {
29
- const commercialOfferList = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand));
29
+ const getCommercialOfferList = (idCommercialOfferType, societyBrand, offerList, turnoverMax, idComptaType) => {
30
+ const commercialOfferList = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));
30
31
  return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));
31
32
  };
32
33
  export { displayCommercialOffer, disableCommercialOffer, getCommercialOfferList, };
@@ -1 +1 @@
1
- {"version":3,"file":"commercialOffer.js","sourceRoot":"","sources":["../../../ts/utils/commercialOffer.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AAEpD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,sBAAsB,GAAG,CAAC,gBAAwB,EAAE,qBAA6B,EAAW,EAAE;IAClG,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,gBAAgB,CAAC,CAAC;IAC9G,MAAM,mBAAmB,GAAwC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,qBAAqB,CAAC,CAAC;IAC5J,IAAI,mBAAmB,EAAE,gBAAgB,CAAC,MAAM,IAAI,mBAAmB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;SAC7H,IAAI,cAAc;QACrB,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,MAAM;QAC7C,CACE,CAAC,CAAC,mBAAmB,EAAE,WAAW,IAAI,mBAAmB,EAAE,WAAW,KAAK,cAAc,EAAE,WAAW,CAAC;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EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC","sourcesContent":["import { ICommercialOffer } from '../types';\nimport { CommercialOfferTypeType, CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';\nimport { PrestationDetail } from '../types/Enum/PrestationType';\nimport * as dayjs from 'dayjs';\nimport * as isBetween from 'dayjs/plugin/isBetween';\n\ndayjs.extend(isBetween);\n\nconst displayCommercialOffer = (idPrestationList: number, idCommercialOfferType: number): boolean => {\n const prestationList = Object.values(PrestationDetail).find(prestation => prestation.id === idPrestationList);\n const commercialOfferType: CommercialOfferTypeType | undefined = Object.values(CommercialOfferTypeDetail).find(offer => offer.id === idCommercialOfferType);\n if (commercialOfferType?.idPrestationList.length && commercialOfferType?.idPrestationList.includes(idPrestationList)) return true;\n else if (prestationList && \n !commercialOfferType?.idPrestationList.length &&\n (\n (!commercialOfferType?.isComptable || commercialOfferType?.isComptable === prestationList?.isComptable)\n && (!commercialOfferType?.isCatalog || commercialOfferType?.isCatalog === prestationList.isCatalog)\n && (!commercialOfferType?.isBack || commercialOfferType?.isBack === prestationList.isBack)\n )\n ) return true;\n else return false;\n};\n\nconst disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[] ): boolean=> {\n if (idOfferSelected.length && commercialOfferList.find(offer => offer.id === idCurrentOffer)?.cumulative === false) return true;\n else if (commercialOfferList.find(offer => offer.id === idOfferSelected[0])?.cumulative === false) return true;\n else return false;\n};\n\nconst getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[]): ICommercialOffer[] => {\n const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand));\n return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));\n};\n\nexport {\n displayCommercialOffer, disableCommercialOffer, getCommercialOfferList,\n};"]}
1
+ {"version":3,"file":"commerc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AK,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3H,CAAC,CAAC;AAEF,OAAO,EACL,sBAAsB,EAAE,sBAAsB,EAAE,sBAAsB,GACvE,CAAC","sourcesContent":["import { ICommercialOffer } from '../types';\nimport { CommercialOfferTypeType, CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';\nimport { PrestationDetail } from '../types/Enum/PrestationType';\nimport { ComptaType } from '../types/Enum/ComptaType';\nimport * as dayjs from 'dayjs';\nimport * as isBetween from 'dayjs/plugin/isBetween';\n\ndayjs.extend(isBetween);\n\nconst displayCommercialOffer = (idPrestationList: number, idCommercialOfferType: number): boolean => {\n const prestationList = Object.values(PrestationDetail).find(prestation => prestation.id === idPrestationList);\n const commercialOfferType: CommercialOfferTypeType | undefined = Object.values(CommercialOfferTypeDetail).find(offer => offer.id === idCommercialOfferType);\n if (commercialOfferType?.idPrestationList.length && commercialOfferType?.idPrestationList.includes(idPrestationList)) return true;\n else if (prestationList && \n !commercialOfferType?.idPrestationList.length &&\n (\n (!commercialOfferType?.isComptable || commercialOfferType?.isComptable === prestationList?.isComptable)\n && (!commercialOfferType?.isCatalog || commercialOfferType?.isCatalog === prestationList.isCatalog)\n && (!commercialOfferType?.isBack || commercialOfferType?.isBack === prestationList.isBack)\n )\n ) return true;\n else return false;\n};\n\nconst disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[], commercialOfferList: ICommercialOffer[] ): boolean=> {\n if (idOfferSelected.length && commercialOfferList.find(offer => offer.id === idCurrentOffer)?.cumulative === false) return true;\n else if (commercialOfferList.find(offer => offer.id === idOfferSelected[0])?.cumulative === false) return true;\n else return false;\n};\n\nconst getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number): ICommercialOffer[] => {\n const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));\n return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));\n};\n\nexport {\n displayCommercialOffer, disableCommercialOffer, getCommercialOfferList,\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.232",
3
+ "version": "1.1.233",
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": "dist/cjs/index.js",
@@ -7,7 +7,7 @@ export class Subscription extends Resource {
7
7
  return this.axios.$get('/subscription/next-invoice', { params });
8
8
  }
9
9
 
10
- getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription>> {
10
+ getBySociety(idSociety: number): Promise<Stripe.Response<Stripe.Subscription> | null> {
11
11
  return this.axios.$get(`/societies/${idSociety}/subscriptions`);
12
12
  }
13
13
 
@@ -94,7 +94,17 @@ export const CommercialOfferTypeDetail = {
94
94
  BALANCE_SHEET_OFFERED : {
95
95
  id: 7,
96
96
  label: 'Bilan à 0',
97
- text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire ',
97
+ text: 'Bilan à %value% € par exercice à rattraper sous réserve qu\'il y ai moins de 50 lignes sur le relevé bancaire',
98
+ amountType: CommercialOfferAmountType.MONEY,
99
+ idPrestationList: [],
100
+ isComptable: true,
101
+ isCatalog: null,
102
+ isBack: true,
103
+ },
104
+ BALANCE_SHEET_OFFERED_EXCEPTIONAL : {
105
+ id: 8,
106
+ label: 'Offre exceptionnel Express',
107
+ text: 'Offre exceptionnel, bilan à %value% € pour l\'exercice %exerciceYear%',
98
108
  amountType: CommercialOfferAmountType.MONEY,
99
109
  idPrestationList: [],
100
110
  isComptable: true,
@@ -7,6 +7,8 @@ export interface ICommercialOffer {
7
7
  title: string,
8
8
  label: string,
9
9
  amount?: number,
10
+ turnoverMax?: number,
11
+ idComptaType?: number,
10
12
  startDate: Date,
11
13
  endDate: Date,
12
14
  cumulative: boolean,
@@ -42,7 +42,7 @@ type getBrandConfigParams = {
42
42
  const getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {
43
43
  const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;
44
44
  if (env) {
45
- if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {
45
+ if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -1) {
46
46
  return 'Legalstart';
47
47
  }
48
48
  if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {
@@ -1,6 +1,7 @@
1
1
  import { ICommercialOffer } from '../types';
2
2
  import { CommercialOfferTypeType, CommercialOfferTypeDetail } from '../types/Enum/CommercialOfferType';
3
3
  import { PrestationDetail } from '../types/Enum/PrestationType';
4
+ import { ComptaType } from '../types/Enum/ComptaType';
4
5
  import * as dayjs from 'dayjs';
5
6
  import * as isBetween from 'dayjs/plugin/isBetween';
6
7
 
@@ -27,8 +28,8 @@ const disableCommercialOffer = (idCurrentOffer: number, idOfferSelected: number[
27
28
  else return false;
28
29
  };
29
30
 
30
- const getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[]): ICommercialOffer[] => {
31
- const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand));
31
+ const getCommercialOfferList = (idCommercialOfferType: number, societyBrand: number, offerList: ICommercialOffer[], turnoverMax: number, idComptaType: number): ICommercialOffer[] => {
32
+ const commercialOfferList: ICommercialOffer[] = offerList.filter((offer) => offer.idCommercialOfferType === idCommercialOfferType && offer.brand.includes(societyBrand) && ((offer.turnoverMax && offer.turnoverMax === turnoverMax) || true) && ((offer.idComptaType && ((offer.idComptaType === ComptaType.ACCRUALS && idComptaType % 2 === 0) || (offer.idComptaType === ComptaType.CASH_BASED && !(idComptaType % 2 === 0)))) || true));
32
33
  return commercialOfferList.filter(offer => dayjs().isBetween(dayjs(offer.startDate), dayjs(offer.endDate), 'day', '[]'));
33
34
  };
34
35