@silexpert/core 1.3.101 → 1.3.102

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 (114) hide show
  1. package/dist/cjs/api/resources/Exercice.d.ts +1 -1
  2. package/dist/cjs/api/resources/Exercice.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Exercice.js.map +1 -1
  4. package/dist/cjs/api/resources/Inpi.d.ts +3 -3
  5. package/dist/cjs/api/resources/Inpi.d.ts.map +1 -1
  6. package/dist/cjs/api/resources/Inpi.js +1 -1
  7. package/dist/cjs/api/resources/Inpi.js.map +1 -1
  8. package/dist/cjs/api/resources/StripePurchase.d.ts +13 -0
  9. package/dist/cjs/api/resources/StripePurchase.d.ts.map +1 -0
  10. package/dist/cjs/api/resources/StripePurchase.js +17 -0
  11. package/dist/cjs/api/resources/StripePurchase.js.map +1 -0
  12. package/dist/cjs/api/resources.d.ts +2 -0
  13. package/dist/cjs/api/resources.d.ts.map +1 -1
  14. package/dist/cjs/api/resources.js +2 -0
  15. package/dist/cjs/api/resources.js.map +1 -1
  16. package/dist/cjs/types/Enum/InpiType.d.ts +10 -2
  17. package/dist/cjs/types/Enum/InpiType.d.ts.map +1 -1
  18. package/dist/cjs/types/Enum/InpiType.js +12 -4
  19. package/dist/cjs/types/Enum/InpiType.js.map +1 -1
  20. package/dist/cjs/types/Enum/PrestationType.d.ts +2 -1
  21. package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
  22. package/dist/cjs/types/Enum/PrestationType.js +20 -0
  23. package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
  24. package/dist/cjs/types/Enum/Stripe.d.ts +4 -0
  25. package/dist/cjs/types/Enum/Stripe.d.ts.map +1 -0
  26. package/dist/cjs/types/Enum/Stripe.js +8 -0
  27. package/dist/cjs/types/Enum/Stripe.js.map +1 -0
  28. package/dist/cjs/types/Interface/api/exercice/Create.d.ts +1 -0
  29. package/dist/cjs/types/Interface/api/exercice/Create.d.ts.map +1 -1
  30. package/dist/cjs/types/Interface/api/exercice/Create.js +7 -0
  31. package/dist/cjs/types/Interface/api/exercice/Create.js.map +1 -1
  32. package/dist/cjs/types/Interface/api/inpiPayment/Query.d.ts +14 -0
  33. package/dist/cjs/types/Interface/api/inpiPayment/Query.d.ts.map +1 -0
  34. package/dist/cjs/types/Interface/api/inpiPayment/Query.js +128 -0
  35. package/dist/cjs/types/Interface/api/inpiPayment/Query.js.map +1 -0
  36. package/dist/cjs/types/Interface/api/stripe/Create.d.ts +10 -0
  37. package/dist/cjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  38. package/dist/cjs/types/Interface/api/stripe/Create.js +30 -1
  39. package/dist/cjs/types/Interface/api/stripe/Create.js.map +1 -1
  40. package/dist/cjs/types/Interface/api/stripe/QueryStripe.d.ts +6 -0
  41. package/dist/cjs/types/Interface/api/stripe/QueryStripe.d.ts.map +1 -1
  42. package/dist/cjs/types/Interface/api/stripe/QueryStripe.js +19 -1
  43. package/dist/cjs/types/Interface/api/stripe/QueryStripe.js.map +1 -1
  44. package/dist/cjs/types/index.d.ts +1 -0
  45. package/dist/cjs/types/index.d.ts.map +1 -1
  46. package/dist/cjs/types/index.js +1 -0
  47. package/dist/cjs/types/index.js.map +1 -1
  48. package/dist/cjs/utils/vat/3517/century23.d.ts.map +1 -1
  49. package/dist/cjs/utils/vat/3517/century23.js +55 -55
  50. package/dist/cjs/utils/vat/3517/century23.js.map +1 -1
  51. package/dist/mjs/api/resources/Exercice.d.ts +1 -1
  52. package/dist/mjs/api/resources/Exercice.d.ts.map +1 -1
  53. package/dist/mjs/api/resources/Exercice.js.map +1 -1
  54. package/dist/mjs/api/resources/Inpi.d.ts +3 -3
  55. package/dist/mjs/api/resources/Inpi.d.ts.map +1 -1
  56. package/dist/mjs/api/resources/Inpi.js +1 -1
  57. package/dist/mjs/api/resources/Inpi.js.map +1 -1
  58. package/dist/mjs/api/resources/StripePurchase.d.ts +13 -0
  59. package/dist/mjs/api/resources/StripePurchase.d.ts.map +1 -0
  60. package/dist/mjs/api/resources/StripePurchase.js +16 -0
  61. package/dist/mjs/api/resources/StripePurchase.js.map +1 -0
  62. package/dist/mjs/api/resources.d.ts +2 -0
  63. package/dist/mjs/api/resources.d.ts.map +1 -1
  64. package/dist/mjs/api/resources.js +2 -0
  65. package/dist/mjs/api/resources.js.map +1 -1
  66. package/dist/mjs/types/Enum/InpiType.d.ts +10 -2
  67. package/dist/mjs/types/Enum/InpiType.d.ts.map +1 -1
  68. package/dist/mjs/types/Enum/InpiType.js +12 -4
  69. package/dist/mjs/types/Enum/InpiType.js.map +1 -1
  70. package/dist/mjs/types/Enum/PrestationType.d.ts +2 -1
  71. package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
  72. package/dist/mjs/types/Enum/PrestationType.js +20 -0
  73. package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
  74. package/dist/mjs/types/Enum/Stripe.d.ts +4 -0
  75. package/dist/mjs/types/Enum/Stripe.d.ts.map +1 -0
  76. package/dist/mjs/types/Enum/Stripe.js +5 -0
  77. package/dist/mjs/types/Enum/Stripe.js.map +1 -0
  78. package/dist/mjs/types/Interface/api/exercice/Create.d.ts +1 -0
  79. package/dist/mjs/types/Interface/api/exercice/Create.d.ts.map +1 -1
  80. package/dist/mjs/types/Interface/api/exercice/Create.js +8 -0
  81. package/dist/mjs/types/Interface/api/exercice/Create.js.map +1 -1
  82. package/dist/mjs/types/Interface/api/inpiPayment/Query.d.ts +14 -0
  83. package/dist/mjs/types/Interface/api/inpiPayment/Query.d.ts.map +1 -0
  84. package/dist/mjs/types/Interface/api/inpiPayment/Query.js +135 -0
  85. package/dist/mjs/types/Interface/api/inpiPayment/Query.js.map +1 -0
  86. package/dist/mjs/types/Interface/api/stripe/Create.d.ts +10 -0
  87. package/dist/mjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  88. package/dist/mjs/types/Interface/api/stripe/Create.js +34 -1
  89. package/dist/mjs/types/Interface/api/stripe/Create.js.map +1 -1
  90. package/dist/mjs/types/Interface/api/stripe/QueryStripe.d.ts +6 -0
  91. package/dist/mjs/types/Interface/api/stripe/QueryStripe.d.ts.map +1 -1
  92. package/dist/mjs/types/Interface/api/stripe/QueryStripe.js +18 -0
  93. package/dist/mjs/types/Interface/api/stripe/QueryStripe.js.map +1 -1
  94. package/dist/mjs/types/index.d.ts +1 -0
  95. package/dist/mjs/types/index.d.ts.map +1 -1
  96. package/dist/mjs/types/index.js +1 -0
  97. package/dist/mjs/types/index.js.map +1 -1
  98. package/dist/mjs/utils/vat/3517/century23.d.ts.map +1 -1
  99. package/dist/mjs/utils/vat/3517/century23.js +54 -54
  100. package/dist/mjs/utils/vat/3517/century23.js.map +1 -1
  101. package/package.json +1 -1
  102. package/ts/api/resources/Exercice.ts +1 -1
  103. package/ts/api/resources/Inpi.ts +3 -2
  104. package/ts/api/resources/StripePurchase.ts +22 -0
  105. package/ts/api/resources.ts +2 -0
  106. package/ts/types/Enum/InpiType.ts +13 -4
  107. package/ts/types/Enum/PrestationType.ts +20 -0
  108. package/ts/types/Enum/Stripe.ts +3 -0
  109. package/ts/types/Interface/api/exercice/Create.ts +6 -0
  110. package/ts/types/Interface/api/inpiPayment/Query.ts +103 -0
  111. package/ts/types/Interface/api/stripe/Create.ts +24 -1
  112. package/ts/types/Interface/api/stripe/QueryStripe.ts +14 -0
  113. package/ts/types/index.ts +1 -0
  114. package/ts/utils/vat/3517/century23.ts +55 -54
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.3.101",
3
+ "version": "1.3.102",
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",
@@ -11,7 +11,7 @@ import {
11
11
  import { Resource } from '../Resource';
12
12
 
13
13
  export class Exercice extends Resource {
14
- create(params: CreateExercice): Promise<IExercice> {
14
+ create(params: CreateExercice): Promise<IExercice | null> {
15
15
  return this.axios.$post('/exercices', params);
16
16
  }
17
17
 
@@ -8,6 +8,7 @@ import {
8
8
  IInpiPayment,
9
9
  QueryInpiPaymentPaginated,
10
10
  QueryInpiPaymentStatistic,
11
+ QueryInpiPaymentCreate,
11
12
  } from '../../types';
12
13
 
13
14
  export class Inpi extends Resource {
@@ -50,10 +51,10 @@ export class Inpi extends Resource {
50
51
 
51
52
  /**
52
53
  * Créer un enregistrement dans la table InpiPayment
53
- * @param { IInpiPayment } payload
54
+ * @param { QueryInpiPaymentCreate } payload
54
55
  * @returns { IInpiPayment }
55
56
  */
56
- public createPayment(payload: IInpiPayment): Promise<IInpiPayment> {
57
+ public createPayment(payload: QueryInpiPaymentCreate): Promise<IInpiPayment> {
57
58
  return this.axios.$post('/inpi/payments', payload);
58
59
  }
59
60
 
@@ -0,0 +1,22 @@
1
+ import Stripe from 'stripe';
2
+ import { Resource } from '../Resource';
3
+ import { CreatePurchaseSession, QueryStripePrice } from '../../types';
4
+
5
+ export class StripePurchase extends Resource {
6
+
7
+ getAllPrices(params: QueryStripePrice): Promise<Stripe.Price[]> {
8
+ return this.axios.$get('/stripe/purchases/prices', { params });
9
+ }
10
+
11
+ createNewExerciceSession(metadata: { idSociety: number; startDate: string; endDate: string; }, payload: CreatePurchaseSession): Promise<Stripe.Response<Stripe.Checkout.Session>> {
12
+ return this.createSession({
13
+ ...payload,
14
+ metadata
15
+ });
16
+ }
17
+
18
+ createSession(payload: CreatePurchaseSession): Promise<Stripe.Response<Stripe.Checkout.Session>> {
19
+ return this.axios.$post('/stripe/purchases/sessions', payload);
20
+ }
21
+
22
+ }
@@ -179,6 +179,7 @@ import { StatisticLegal } from './resources/statistic/Legal';
179
179
  import { AnalyticsUtm } from './resources/AnalyticsUtm';
180
180
  import { Caarl } from './resources/Caarl';
181
181
  import { Gdpr } from './resources/Gdpr';
182
+ import { StripePurchase } from './resources/StripePurchase';
182
183
 
183
184
  export const resources = {
184
185
  budgetInsight: BudgetInsight,
@@ -362,4 +363,5 @@ export const resources = {
362
363
  analyticsUtm: AnalyticsUtm,
363
364
  caarl: Caarl,
364
365
  gdpr: Gdpr,
366
+ StripePurchase: StripePurchase
365
367
  };
@@ -1,3 +1,5 @@
1
+ import { PaymentMethodIds } from './PaymentMethod';
2
+
1
3
  export const InpiCostType = {
2
4
  GREFFE: {
3
5
  id: 1,
@@ -29,12 +31,19 @@ export const InpiState = {
29
31
  };
30
32
 
31
33
  export const InpiPaymentType = {
32
- PACKAGE: {
33
- id: 1,
34
- label: 'Forfait',
35
- },
36
34
  PAYMENT_LINK: {
37
35
  id: 2,
36
+ idPaymentMethod: PaymentMethodIds.BANK_CARD,
38
37
  label: 'Lien de paiement',
39
38
  },
39
+ DIRECT_DEBIT: {
40
+ id: 3,
41
+ idPaymentMethod: PaymentMethodIds.DIRECT_DEBIT,
42
+ label: 'Prélèvement',
43
+ },
44
+ STRIPE_ECB: {
45
+ id: 4,
46
+ idPaymentMethod: PaymentMethodIds.STRIPE_ECB,
47
+ label: 'Stripe (ECB)',
48
+ },
40
49
  };
@@ -190,6 +190,7 @@ export enum PrestationType {
190
190
  EI = 236,
191
191
  MICRO = 237,
192
192
  GESTION_IMMO = 238,
193
+ TERMINATION_FEES = 239,
193
194
  }
194
195
 
195
196
  // Liste des prestations avec une lettre de mission à signer
@@ -3869,4 +3870,23 @@ export const PrestationDetail: PrestationDetailEnum = {
3869
3870
  signaturePage: 7, //???
3870
3871
  point: 200, //???
3871
3872
  },
3873
+ TERMINATION_FEES: {
3874
+ id: PrestationType.TERMINATION_FEES,
3875
+ name: 'Frais de résiliation',
3876
+ isComptable: true,
3877
+ isJuridique: false,
3878
+ isSocial: false,
3879
+ isAttestation: false,
3880
+ inAverageCart: false,
3881
+ isBack: false,
3882
+ minimumPrice: null,
3883
+ price: null,
3884
+ isCatalog: true,
3885
+ isPlannable: false,
3886
+ hidden: false,
3887
+ isComplementary: false,
3888
+ signaturePosition: null,
3889
+ signaturePage: null,
3890
+ point: 0,
3891
+ },
3872
3892
  };
@@ -0,0 +1,3 @@
1
+ export enum PurchasePriceType {
2
+ NEW_EXERCICE = 'newExercice'
3
+ }
@@ -82,6 +82,12 @@ export class CreateExercice {
82
82
  @ToBoolean()
83
83
  @IsOptional()
84
84
  isDefault?: boolean;
85
+
86
+ @ApiPropertyOptional({ description: 'Simulate exercise creation, return null if it is ok' })
87
+ @IsBoolean()
88
+ @ToBoolean()
89
+ @IsOptional()
90
+ isBlankMode?: boolean;
85
91
  }
86
92
 
87
93
  export class CreateProjectExercice {
@@ -0,0 +1,103 @@
1
+ import { IsDate, IsInt, IsNumber, IsString } from 'class-validator';
2
+ import { ApiProperty } from '../../../../utils';
3
+
4
+ export class QueryInpiPaymentCreate {
5
+ @ApiProperty({
6
+ description: 'list of selected cost type',
7
+ required: true,
8
+ type: String,
9
+ example: '[1,2]',
10
+ })
11
+ @IsString()
12
+ costType: string;
13
+
14
+ @ApiProperty({
15
+ description: 'file number',
16
+ required: true,
17
+ type: String,
18
+ example: '010234',
19
+ })
20
+ @IsString()
21
+ fileNumber: string;
22
+
23
+ @ApiProperty({
24
+ description: 'amount',
25
+ required: true,
26
+ type: Number,
27
+ example: 100.0,
28
+ })
29
+ @IsNumber()
30
+ amount: number;
31
+
32
+ @ApiProperty({
33
+ description: 'commission',
34
+ required: true,
35
+ type: Number,
36
+ example: 100.0,
37
+ })
38
+ @IsNumber()
39
+ commission: number;
40
+
41
+ @ApiProperty({
42
+ description: 'type',
43
+ required: true,
44
+ type: Number,
45
+ example: 1,
46
+ })
47
+ @IsInt()
48
+ type: number;
49
+
50
+ @ApiProperty({
51
+ description: 'state',
52
+ required: true,
53
+ type: Number,
54
+ example: 1,
55
+ })
56
+ @IsInt()
57
+ state: number;
58
+
59
+ @ApiProperty({
60
+ description: 'idSociety',
61
+ required: true,
62
+ type: Number,
63
+ example: 1,
64
+ })
65
+ @IsInt()
66
+ idSociety: number;
67
+
68
+ @ApiProperty({
69
+ description: 'idUserWhoCreated',
70
+ required: true,
71
+ type: Number,
72
+ example: 1,
73
+ })
74
+ @IsInt()
75
+ idUserWhoCreated: number;
76
+
77
+ @ApiProperty({
78
+ description: 'idExercice',
79
+ required: true,
80
+ type: Number,
81
+ example: 1,
82
+ })
83
+ @IsInt()
84
+ idExercice: number;
85
+
86
+ @ApiProperty({
87
+ description: 'idPrestationListRelated',
88
+ required: true,
89
+ type: Number,
90
+ example: 1,
91
+ })
92
+ @IsInt()
93
+ idPrestationListRelated: number;
94
+
95
+ @ApiProperty({
96
+ description: 'datePayment',
97
+ required: true,
98
+ type: Date,
99
+ example: new Date(),
100
+ })
101
+ @IsDate()
102
+ datePayment: Date;
103
+ }
@@ -1,6 +1,7 @@
1
- import { IsDate, IsDateString, IsInt, IsNumber, IsOptional, IsString, Min } from 'class-validator';
1
+ import { IsArray, IsBoolean, IsDate, IsDateString, IsInt, IsNumber, IsOptional, IsString, Min } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
  import type Stripe from 'stripe';
4
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
5
  export class CreateStripeConnection {
5
6
  @ApiProperty()
6
7
  @IsString()
@@ -123,3 +124,25 @@ export class CreateTapToPayConnectionToken {
123
124
  @IsOptional()
124
125
  locationId?: string;
125
126
  }
127
+
128
+ export class CreatePurchaseSession {
129
+ @ApiProperty({ description: 'Is software or accountancy product' })
130
+ @IsBoolean()
131
+ @ToBoolean()
132
+ isSoftware: boolean;
133
+
134
+ @ApiProperty({ description: 'Redirection link on success' })
135
+ @IsString()
136
+ successRedirection: string;
137
+
138
+ @ApiProperty({ description: 'Redirection link on cancel / error' })
139
+ @IsString()
140
+ cancelRedirection: string;
141
+
142
+ @ApiPropertyOptional()
143
+ metadata?: Record<string, string | number>;
144
+
145
+ @ApiProperty()
146
+ @IsArray()
147
+ items: Array<{ priceId: string; quantity: number }>;
148
+ }
@@ -21,3 +21,17 @@ export class QueryStripeSubscriptionId {
21
21
  @IsString()
22
22
  customerId: string;
23
23
  }
24
+
25
+ export class QueryStripePrice {
26
+ @ApiProperty()
27
+ @IsBoolean()
28
+ @ToBoolean()
29
+ isSoftware: boolean;
30
+ }
31
+
32
+ export class QueryStripePurchaseHook {
33
+ @ApiProperty()
34
+ @IsBoolean()
35
+ @ToBoolean()
36
+ isSoftware: boolean;
37
+ }
package/ts/types/index.ts CHANGED
@@ -760,6 +760,7 @@ export * from './Interface/api/ratingHistory/CreateRatingHistory';
760
760
  export * from './Interface/api/inpiBalance/inpiBalanceStatistic';
761
761
  export * from './Interface/api/inpiPayment/QueryInpiPaymentStatistic';
762
762
  export * from './Interface/api/inpiPayment/QueryInpiPaymentPaginated';
763
+ export * from './Interface/api/inpiPayment/Query';
763
764
  export * from './Interface/api/vatRegimeHistory/QueryVatRegimeHistory';
764
765
  export * from './Interface/api/textMessage/Create';
765
766
  export * from './Interface/api/textMessage/Update';