@silexpert/core 1.3.57-2 → 1.3.57
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/dist/cjs/api/resources/Subscription.d.ts +2 -1
- package/dist/cjs/api/resources/Subscription.d.ts.map +1 -1
- package/dist/cjs/api/resources/Subscription.js +4 -0
- package/dist/cjs/api/resources/Subscription.js.map +1 -1
- package/dist/cjs/types/Enum/BalanceSheetQuestionWording.d.ts +1 -1
- package/dist/cjs/types/Enum/BalanceSheetQuestionWording.d.ts.map +1 -1
- package/dist/cjs/types/Enum/BalanceSheetQuestionWording.js +1 -1
- package/dist/cjs/types/Enum/BalanceSheetQuestionWording.js.map +1 -1
- package/dist/cjs/types/Enum/MealExpenseThresholds.d.ts.map +1 -1
- package/dist/cjs/types/Enum/MealExpenseThresholds.js +4 -0
- package/dist/cjs/types/Enum/MealExpenseThresholds.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/subscription.d.ts +21 -0
- package/dist/cjs/utils/subscription.d.ts.map +1 -0
- package/dist/cjs/utils/subscription.js +97 -0
- package/dist/cjs/utils/subscription.js.map +1 -0
- package/dist/mjs/api/resources/Subscription.d.ts +2 -1
- package/dist/mjs/api/resources/Subscription.d.ts.map +1 -1
- package/dist/mjs/api/resources/Subscription.js +4 -0
- package/dist/mjs/api/resources/Subscription.js.map +1 -1
- package/dist/mjs/types/Enum/BalanceSheetQuestionWording.d.ts +1 -1
- package/dist/mjs/types/Enum/BalanceSheetQuestionWording.d.ts.map +1 -1
- package/dist/mjs/types/Enum/BalanceSheetQuestionWording.js +1 -1
- package/dist/mjs/types/Enum/BalanceSheetQuestionWording.js.map +1 -1
- package/dist/mjs/types/Enum/MealExpenseThresholds.d.ts.map +1 -1
- package/dist/mjs/types/Enum/MealExpenseThresholds.js +4 -0
- package/dist/mjs/types/Enum/MealExpenseThresholds.js.map +1 -1
- package/dist/mjs/utils/index.d.ts +1 -0
- package/dist/mjs/utils/index.d.ts.map +1 -1
- package/dist/mjs/utils/index.js +1 -0
- package/dist/mjs/utils/index.js.map +1 -1
- package/dist/mjs/utils/subscription.d.ts +21 -0
- package/dist/mjs/utils/subscription.d.ts.map +1 -0
- package/dist/mjs/utils/subscription.js +92 -0
- package/dist/mjs/utils/subscription.js.map +1 -0
- package/package.json +1 -1
- package/ts/api/resources/Subscription.ts +15 -1
- package/ts/types/Enum/BalanceSheetQuestionWording.ts +1 -1
- package/ts/types/Enum/MealExpenseThresholds.ts +4 -0
- package/ts/utils/index.ts +1 -0
- package/ts/utils/subscription.ts +124 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MealExpenseThresholds.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/MealExpenseThresholds.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"MealExpenseThresholds.d.ts","sourceRoot":"","sources":["../../../../ts/types/Enum/MealExpenseThresholds.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,sBAyBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MealExpenseThresholds.js","sourceRoot":"","sources":["../../../../ts/types/Enum/MealExpenseThresholds.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,IAAI,EAAE;QACJ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,EAAE;KACR;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,IAAI;KACV;CACF,CAAC","sourcesContent":["export interface IMealExpenseThresholds {\n [key: string]: {\n min: number;\n max: number;\n };\n}\n\nexport const MealExpenseThresholds: IMealExpenseThresholds = {\n 2020: {\n min: 4.9,\n max: 19,\n },\n 2021: {\n min: 4.95,\n max: 19.1,\n },\n 2022: {\n min: 5,\n max: 19.4,\n },\n 2023: {\n min: 5.2,\n max: 20.2,\n },\n 2024: {\n min: 5.35,\n max: 20.7,\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MealExpenseThresholds.js","sourceRoot":"","sources":["../../../../ts/types/Enum/MealExpenseThresholds.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,IAAI,EAAE;QACJ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,EAAE;KACR;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACJ,GAAG,EAAE,GAAG;QACR,GAAG,EAAE,IAAI;KACV;CACF,CAAC","sourcesContent":["export interface IMealExpenseThresholds {\n [key: string]: {\n min: number;\n max: number;\n };\n}\n\nexport const MealExpenseThresholds: IMealExpenseThresholds = {\n 2020: {\n min: 4.9,\n max: 19,\n },\n 2021: {\n min: 4.95,\n max: 19.1,\n },\n 2022: {\n min: 5,\n max: 19.4,\n },\n 2023: {\n min: 5.2,\n max: 20.2,\n },\n 2024: {\n min: 5.35,\n max: 20.7,\n },\n 2025: {\n min: 5.5,\n max: 21.1,\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
package/dist/mjs/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './documents';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './statutsGeneration';\nexport * from './email';\nexport * from './exercice';\nexport * from './prestation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './commercialManagement/recurrence';\nexport * from './amount';\nexport * from './quotation';\nexport * from './isHtml';\nexport * from './isUrl';\nexport * from './bankAccount';\nexport * from './commercialOffer';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './documents';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './statutsGeneration';\nexport * from './email';\nexport * from './exercice';\nexport * from './prestation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './commercialManagement/recurrence';\nexport * from './amount';\nexport * from './quotation';\nexport * from './isHtml';\nexport * from './isUrl';\nexport * from './bankAccount';\nexport * from './commercialOffer';\nexport * from './subscription';\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComptaType } from '../types/Enum/ComptaType';
|
|
2
|
+
import { LegalFormTypeEnum } from '../types/Enum/LegalForm';
|
|
3
|
+
import { TaxSystem } from '../types/Enum/TaxSystem';
|
|
4
|
+
interface OfferParams {
|
|
5
|
+
idLegalForm: LegalFormTypeEnum | null;
|
|
6
|
+
idComptaType: ComptaType | null;
|
|
7
|
+
idTaxSystem: TaxSystem | null;
|
|
8
|
+
isYearly?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface StripeOffer {
|
|
11
|
+
name: string;
|
|
12
|
+
isYearly: boolean;
|
|
13
|
+
isMicro: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
isCashBased: boolean;
|
|
16
|
+
isSocietyTax?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const stripeTaxRate: string;
|
|
19
|
+
export declare function getDefaultOffer(params: OfferParams): StripeOffer;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../ts/utils/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,UAAU,WAAW;IACnB,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA8BD,eAAO,MAAM,aAAa,QAA8E,CAAC;AAqDzG,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAsBhE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ComptaType } from '../types/Enum/ComptaType';
|
|
2
|
+
import { LegalFormTypeEnum } from '../types/Enum/LegalForm';
|
|
3
|
+
import { TaxSystem } from '../types/Enum/TaxSystem';
|
|
4
|
+
const isTestKey = ['dev', 'staging', 'development', 'test', 'gitlab'].includes(process.env.NODE_ENV ?? '');
|
|
5
|
+
// AE | Annuel | Forfait Bilan complet
|
|
6
|
+
const ID_SUBSCRIPTION_MICRO_ANNUAL = !isTestKey ? 'price_1PFyHHIHo1jEedppVjwrqPr1' : 'price_1MRyi1IHo1jEedppRKdY06Re';
|
|
7
|
+
// AE | Mensuel | Forfait Bilan complet
|
|
8
|
+
const ID_SUBSCRIPTION_MICRO_MENSUAL = !isTestKey ? 'price_1LBJ4xIHo1jEedppylxr3fFa' : 'price_1LBI57IHo1jEedpppnxskfgv';
|
|
9
|
+
// Entreprise | Annuel | Forfait entreprise à l'IR
|
|
10
|
+
const ID_SUBSCRIPTION_INCOME_TAX_ANNUAL = !isTestKey
|
|
11
|
+
? 'price_1PFyG8IHo1jEedpp73TUxiJd'
|
|
12
|
+
: 'price_1MRyiJIHo1jEedppUe7MnPtW';
|
|
13
|
+
// Entreprise | Mensuel | Forfaitentreprise à l'IR
|
|
14
|
+
const ID_SUBSCRIPTION_INCOME_TAX_MENSUAL = !isTestKey
|
|
15
|
+
? 'price_1LBJ5YIHo1jEedppzwTErh9M'
|
|
16
|
+
: 'price_1LBIA3IHo1jEedpp2taeQ7yW';
|
|
17
|
+
// Entreprise | Annuel | Forfait entreprise à l'IS
|
|
18
|
+
const ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL = !isTestKey
|
|
19
|
+
? 'price_1PFwE3IHo1jEedpphgWrgwkA'
|
|
20
|
+
: 'price_1MRyiWIHo1jEedppp5tnksZe';
|
|
21
|
+
// Entreprise | Mensuel | Forfait entreprise à l'IS
|
|
22
|
+
const ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL = !isTestKey
|
|
23
|
+
? 'price_1LBJ69IHo1jEedppAWLeOk3I'
|
|
24
|
+
: 'price_1LBIB7IHo1jEedppocxyc1ft';
|
|
25
|
+
export const stripeTaxRate = isTestKey ? 'txr_1I9X9MIHo1jEedppM0DqL4iE' : 'txr_1I9X5wIHo1jEedppYttGFc0N';
|
|
26
|
+
const list = [
|
|
27
|
+
{
|
|
28
|
+
name: 'Offre auto-entrepreneur',
|
|
29
|
+
isYearly: true,
|
|
30
|
+
isMicro: true,
|
|
31
|
+
key: ID_SUBSCRIPTION_MICRO_ANNUAL,
|
|
32
|
+
isCashBased: true,
|
|
33
|
+
isSocietyTax: false,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Offre auto-entrepreneur',
|
|
37
|
+
isYearly: false,
|
|
38
|
+
isMicro: true,
|
|
39
|
+
key: ID_SUBSCRIPTION_MICRO_MENSUAL,
|
|
40
|
+
isCashBased: true,
|
|
41
|
+
isSocietyTax: false,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Offre entreprise IS',
|
|
45
|
+
isYearly: true,
|
|
46
|
+
isMicro: false,
|
|
47
|
+
key: ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL,
|
|
48
|
+
isCashBased: false,
|
|
49
|
+
isSocietyTax: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Offre entreprise IS',
|
|
53
|
+
isMicro: false,
|
|
54
|
+
isYearly: false,
|
|
55
|
+
key: ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL,
|
|
56
|
+
isCashBased: false,
|
|
57
|
+
isSocietyTax: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Offre entreprise IR',
|
|
61
|
+
isMicro: false,
|
|
62
|
+
isYearly: true,
|
|
63
|
+
isCashBased: true,
|
|
64
|
+
isSocietyTax: false,
|
|
65
|
+
key: ID_SUBSCRIPTION_INCOME_TAX_ANNUAL,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Offre entreprise IR',
|
|
69
|
+
isMicro: false,
|
|
70
|
+
isYearly: false,
|
|
71
|
+
key: ID_SUBSCRIPTION_INCOME_TAX_MENSUAL,
|
|
72
|
+
isCashBased: true,
|
|
73
|
+
isSocietyTax: false,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
export function getDefaultOffer(params) {
|
|
77
|
+
const { idLegalForm, idComptaType, isYearly, idTaxSystem } = params;
|
|
78
|
+
const isMicro = LegalFormTypeEnum.AUTO_ENTREPRENEUR === idLegalForm;
|
|
79
|
+
const isCashBased = idComptaType
|
|
80
|
+
? [ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(idComptaType)
|
|
81
|
+
: false;
|
|
82
|
+
const isSocietyTax = idTaxSystem === TaxSystem.IS;
|
|
83
|
+
const newPlan = list.find((l) => l.isMicro === isMicro &&
|
|
84
|
+
l.isYearly === isYearly &&
|
|
85
|
+
l.isCashBased === isCashBased &&
|
|
86
|
+
l.isSocietyTax === isSocietyTax);
|
|
87
|
+
if (newPlan) {
|
|
88
|
+
return newPlan;
|
|
89
|
+
}
|
|
90
|
+
return isYearly ? list[2] : list[3];
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../../ts/utils/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAkBpD,MAAM,SAAS,GAAY,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,E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vB,CAAC,CAAC,WAAW,KAAK,WAAW;QAC7B,CAAC,CAAC,YAAY,KAAK,YAAY,CAClC,CAAC;IAEF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { ComptaType } from '../types/Enum/ComptaType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { TaxSystem } from '../types/Enum/TaxSystem';\n\ninterface OfferParams {\n idLegalForm: LegalFormTypeEnum | null;\n idComptaType: ComptaType | null;\n idTaxSystem: TaxSystem | null;\n isYearly?: boolean;\n}\n\ninterface StripeOffer {\n name: string;\n isYearly: boolean;\n isMicro: boolean;\n key: string;\n isCashBased: boolean;\n isSocietyTax?: boolean;\n}\n\nconst isTestKey: boolean = ['dev', 'staging', 'development', 'test', 'gitlab'].includes(process.env.NODE_ENV ?? '');\n\n// AE | Annuel | Forfait Bilan complet\nconst ID_SUBSCRIPTION_MICRO_ANNUAL = !isTestKey ? 'price_1PFyHHIHo1jEedppVjwrqPr1' : 'price_1MRyi1IHo1jEedppRKdY06Re';\n\n// AE | Mensuel | Forfait Bilan complet\nconst ID_SUBSCRIPTION_MICRO_MENSUAL = !isTestKey ? 'price_1LBJ4xIHo1jEedppylxr3fFa' : 'price_1LBI57IHo1jEedpppnxskfgv';\n\n// Entreprise | Annuel | Forfait entreprise à l'IR\nconst ID_SUBSCRIPTION_INCOME_TAX_ANNUAL = !isTestKey\n ? 'price_1PFyG8IHo1jEedpp73TUxiJd'\n : 'price_1MRyiJIHo1jEedppUe7MnPtW';\n\n// Entreprise | Mensuel | Forfaitentreprise à l'IR\nconst ID_SUBSCRIPTION_INCOME_TAX_MENSUAL = !isTestKey\n ? 'price_1LBJ5YIHo1jEedppzwTErh9M'\n : 'price_1LBIA3IHo1jEedpp2taeQ7yW';\n\n// Entreprise | Annuel | Forfait entreprise à l'IS\nconst ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL = !isTestKey\n ? 'price_1PFwE3IHo1jEedpphgWrgwkA'\n : 'price_1MRyiWIHo1jEedppp5tnksZe';\n\n// Entreprise | Mensuel | Forfait entreprise à l'IS\nconst ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL = !isTestKey\n ? 'price_1LBJ69IHo1jEedppAWLeOk3I'\n : 'price_1LBIB7IHo1jEedppocxyc1ft';\n\nexport const stripeTaxRate = isTestKey ? 'txr_1I9X9MIHo1jEedppM0DqL4iE' : 'txr_1I9X5wIHo1jEedppYttGFc0N';\n\nconst list: StripeOffer[] = [\n {\n name: 'Offre auto-entrepreneur',\n isYearly: true,\n isMicro: true,\n key: ID_SUBSCRIPTION_MICRO_ANNUAL,\n isCashBased: true,\n isSocietyTax: false,\n },\n {\n name: 'Offre auto-entrepreneur',\n isYearly: false,\n isMicro: true,\n key: ID_SUBSCRIPTION_MICRO_MENSUAL,\n isCashBased: true,\n isSocietyTax: false,\n },\n {\n name: 'Offre entreprise IS',\n isYearly: true,\n isMicro: false,\n key: ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL,\n isCashBased: false,\n isSocietyTax: true,\n },\n {\n name: 'Offre entreprise IS',\n isMicro: false,\n isYearly: false,\n key: ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL,\n isCashBased: false,\n isSocietyTax: true,\n },\n {\n name: 'Offre entreprise IR',\n isMicro: false,\n isYearly: true,\n isCashBased: true,\n isSocietyTax: false,\n key: ID_SUBSCRIPTION_INCOME_TAX_ANNUAL,\n },\n {\n name: 'Offre entreprise IR',\n isMicro: false,\n isYearly: false,\n key: ID_SUBSCRIPTION_INCOME_TAX_MENSUAL,\n isCashBased: true,\n isSocietyTax: false,\n },\n];\n\nexport function getDefaultOffer(params: OfferParams): StripeOffer {\n const { idLegalForm, idComptaType, isYearly, idTaxSystem } = params;\n\n const isMicro = LegalFormTypeEnum.AUTO_ENTREPRENEUR === idLegalForm;\n const isCashBased = idComptaType\n ? [ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(idComptaType)\n : false;\n const isSocietyTax = idTaxSystem === TaxSystem.IS;\n\n const newPlan = list.find(\n (l) =>\n l.isMicro === isMicro &&\n l.isYearly === isYearly &&\n l.isCashBased === isCashBased &&\n l.isSocietyTax === isSocietyTax,\n );\n\n if (newPlan) {\n return newPlan;\n }\n\n return isYearly ? list[2] : list[3];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.3.57
|
|
3
|
+
"version": "1.3.57",
|
|
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",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Resource } from '../Resource';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
QueryStripeSession,
|
|
4
|
+
CreateSubscriptionSession,
|
|
5
|
+
CreateStripePortals,
|
|
6
|
+
CreateCommercialSession,
|
|
7
|
+
} from '../../types';
|
|
3
8
|
import type Stripe from 'stripe';
|
|
4
9
|
|
|
5
10
|
export class Subscription extends Resource {
|
|
@@ -38,4 +43,13 @@ export class Subscription extends Resource {
|
|
|
38
43
|
get(): Promise<Stripe.Response<Stripe.Subscription> | null> {
|
|
39
44
|
return this.axios.$get('/stripe/subscriptions');
|
|
40
45
|
}
|
|
46
|
+
|
|
47
|
+
/* -------------- */
|
|
48
|
+
|
|
49
|
+
createComptalibSession(
|
|
50
|
+
idSociety: number,
|
|
51
|
+
body: QueryStripeSession,
|
|
52
|
+
): Promise<Stripe.Response<Stripe.Checkout.Session>> {
|
|
53
|
+
return this.axios.$post(`/societies/${idSociety}/subscriptions/sessions`, body);
|
|
54
|
+
}
|
|
41
55
|
}
|
|
@@ -210,7 +210,7 @@ export enum QuestionWording {
|
|
|
210
210
|
'2050_TONNAGE_TAX_RESULT_FOR_SEA_TRANSPORT_COMPANY' = 'Résultat fiscal afférent au régime optionnel de taxation au tonnage des entreprises de transport maritime',
|
|
211
211
|
|
|
212
212
|
ECONOMICAL_INTEREST_GROUP_LOSS_SHARE = 'Quote-part dans les pertes subies par une société de personne ou une GIE',
|
|
213
|
-
NON_DEDUCTIBLE_EXPENSES_AND_PROVISIONS_ASSIGN_BACK_IN_FISCAL_YEAR = "Provisions et charges à payer non déductibles, antérieurement taxées et réintégrées dans les résultats comptables de l'
|
|
213
|
+
NON_DEDUCTIBLE_EXPENSES_AND_PROVISIONS_ASSIGN_BACK_IN_FISCAL_YEAR = "Provisions et charges à payer non déductibles, antérieurement taxées et réintégrées dans les résultats comptables de l'exercice (2058 B SD, cadre III)",
|
|
214
214
|
|
|
215
215
|
LONG_RUN_TAXABLE_GAIN_AT_15_RATE = "Plus-value nettes à long termes imposées au taux de 15% (12.8 pour les entreprises à l'IR)",
|
|
216
216
|
LONG_RUN_TAXABLE_GAIN_AT_0_RATE = 'plus-values nette à long terme imposées au taux de 0%',
|
package/ts/utils/index.ts
CHANGED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ComptaType } from '../types/Enum/ComptaType';
|
|
2
|
+
import { LegalFormTypeEnum } from '../types/Enum/LegalForm';
|
|
3
|
+
import { TaxSystem } from '../types/Enum/TaxSystem';
|
|
4
|
+
|
|
5
|
+
interface OfferParams {
|
|
6
|
+
idLegalForm: LegalFormTypeEnum | null;
|
|
7
|
+
idComptaType: ComptaType | null;
|
|
8
|
+
idTaxSystem: TaxSystem | null;
|
|
9
|
+
isYearly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface StripeOffer {
|
|
13
|
+
name: string;
|
|
14
|
+
isYearly: boolean;
|
|
15
|
+
isMicro: boolean;
|
|
16
|
+
key: string;
|
|
17
|
+
isCashBased: boolean;
|
|
18
|
+
isSocietyTax?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const isTestKey: boolean = ['dev', 'staging', 'development', 'test', 'gitlab'].includes(process.env.NODE_ENV ?? '');
|
|
22
|
+
|
|
23
|
+
// AE | Annuel | Forfait Bilan complet
|
|
24
|
+
const ID_SUBSCRIPTION_MICRO_ANNUAL = !isTestKey ? 'price_1PFyHHIHo1jEedppVjwrqPr1' : 'price_1MRyi1IHo1jEedppRKdY06Re';
|
|
25
|
+
|
|
26
|
+
// AE | Mensuel | Forfait Bilan complet
|
|
27
|
+
const ID_SUBSCRIPTION_MICRO_MENSUAL = !isTestKey ? 'price_1LBJ4xIHo1jEedppylxr3fFa' : 'price_1LBI57IHo1jEedpppnxskfgv';
|
|
28
|
+
|
|
29
|
+
// Entreprise | Annuel | Forfait entreprise à l'IR
|
|
30
|
+
const ID_SUBSCRIPTION_INCOME_TAX_ANNUAL = !isTestKey
|
|
31
|
+
? 'price_1PFyG8IHo1jEedpp73TUxiJd'
|
|
32
|
+
: 'price_1MRyiJIHo1jEedppUe7MnPtW';
|
|
33
|
+
|
|
34
|
+
// Entreprise | Mensuel | Forfaitentreprise à l'IR
|
|
35
|
+
const ID_SUBSCRIPTION_INCOME_TAX_MENSUAL = !isTestKey
|
|
36
|
+
? 'price_1LBJ5YIHo1jEedppzwTErh9M'
|
|
37
|
+
: 'price_1LBIA3IHo1jEedpp2taeQ7yW';
|
|
38
|
+
|
|
39
|
+
// Entreprise | Annuel | Forfait entreprise à l'IS
|
|
40
|
+
const ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL = !isTestKey
|
|
41
|
+
? 'price_1PFwE3IHo1jEedpphgWrgwkA'
|
|
42
|
+
: 'price_1MRyiWIHo1jEedppp5tnksZe';
|
|
43
|
+
|
|
44
|
+
// Entreprise | Mensuel | Forfait entreprise à l'IS
|
|
45
|
+
const ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL = !isTestKey
|
|
46
|
+
? 'price_1LBJ69IHo1jEedppAWLeOk3I'
|
|
47
|
+
: 'price_1LBIB7IHo1jEedppocxyc1ft';
|
|
48
|
+
|
|
49
|
+
export const stripeTaxRate = isTestKey ? 'txr_1I9X9MIHo1jEedppM0DqL4iE' : 'txr_1I9X5wIHo1jEedppYttGFc0N';
|
|
50
|
+
|
|
51
|
+
const list: StripeOffer[] = [
|
|
52
|
+
{
|
|
53
|
+
name: 'Offre auto-entrepreneur',
|
|
54
|
+
isYearly: true,
|
|
55
|
+
isMicro: true,
|
|
56
|
+
key: ID_SUBSCRIPTION_MICRO_ANNUAL,
|
|
57
|
+
isCashBased: true,
|
|
58
|
+
isSocietyTax: false,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Offre auto-entrepreneur',
|
|
62
|
+
isYearly: false,
|
|
63
|
+
isMicro: true,
|
|
64
|
+
key: ID_SUBSCRIPTION_MICRO_MENSUAL,
|
|
65
|
+
isCashBased: true,
|
|
66
|
+
isSocietyTax: false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Offre entreprise IS',
|
|
70
|
+
isYearly: true,
|
|
71
|
+
isMicro: false,
|
|
72
|
+
key: ID_SUBSCRIPTION_SOCIETY_TAX_ANNUAL,
|
|
73
|
+
isCashBased: false,
|
|
74
|
+
isSocietyTax: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Offre entreprise IS',
|
|
78
|
+
isMicro: false,
|
|
79
|
+
isYearly: false,
|
|
80
|
+
key: ID_SUBSCRIPTION_SOCIETY_TAX_MENSUAL,
|
|
81
|
+
isCashBased: false,
|
|
82
|
+
isSocietyTax: true,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Offre entreprise IR',
|
|
86
|
+
isMicro: false,
|
|
87
|
+
isYearly: true,
|
|
88
|
+
isCashBased: true,
|
|
89
|
+
isSocietyTax: false,
|
|
90
|
+
key: ID_SUBSCRIPTION_INCOME_TAX_ANNUAL,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Offre entreprise IR',
|
|
94
|
+
isMicro: false,
|
|
95
|
+
isYearly: false,
|
|
96
|
+
key: ID_SUBSCRIPTION_INCOME_TAX_MENSUAL,
|
|
97
|
+
isCashBased: true,
|
|
98
|
+
isSocietyTax: false,
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
export function getDefaultOffer(params: OfferParams): StripeOffer {
|
|
103
|
+
const { idLegalForm, idComptaType, isYearly, idTaxSystem } = params;
|
|
104
|
+
|
|
105
|
+
const isMicro = LegalFormTypeEnum.AUTO_ENTREPRENEUR === idLegalForm;
|
|
106
|
+
const isCashBased = idComptaType
|
|
107
|
+
? [ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(idComptaType)
|
|
108
|
+
: false;
|
|
109
|
+
const isSocietyTax = idTaxSystem === TaxSystem.IS;
|
|
110
|
+
|
|
111
|
+
const newPlan = list.find(
|
|
112
|
+
(l) =>
|
|
113
|
+
l.isMicro === isMicro &&
|
|
114
|
+
l.isYearly === isYearly &&
|
|
115
|
+
l.isCashBased === isCashBased &&
|
|
116
|
+
l.isSocietyTax === isSocietyTax,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
if (newPlan) {
|
|
120
|
+
return newPlan;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return isYearly ? list[2] : list[3];
|
|
124
|
+
}
|