@silexpert/core 1.2.22 → 1.2.23

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 (67) hide show
  1. package/dist/cjs/api/resources/Regulation.d.ts +6 -2
  2. package/dist/cjs/api/resources/Regulation.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Regulation.js +15 -0
  4. package/dist/cjs/api/resources/Regulation.js.map +1 -1
  5. package/dist/cjs/types/Enum/MailAuto.d.ts.map +1 -1
  6. package/dist/cjs/types/Enum/MailAuto.js +12 -0
  7. package/dist/cjs/types/Enum/MailAuto.js.map +1 -1
  8. package/dist/cjs/types/Interface/api/rating/QueryRatingPaginated.d.ts +5 -4
  9. package/dist/cjs/types/Interface/api/rating/QueryRatingPaginated.d.ts.map +1 -1
  10. package/dist/cjs/types/Interface/api/rating/QueryRatingPaginated.js +12 -6
  11. package/dist/cjs/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -1
  12. package/dist/cjs/types/Interface/api/regulation/Create.d.ts +13 -0
  13. package/dist/cjs/types/Interface/api/regulation/Create.d.ts.map +1 -0
  14. package/dist/cjs/types/Interface/api/regulation/Create.js +73 -0
  15. package/dist/cjs/types/Interface/api/regulation/Create.js.map +1 -0
  16. package/dist/cjs/types/Interface/api/regulation/Query.d.ts +31 -5
  17. package/dist/cjs/types/Interface/api/regulation/Query.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/api/regulation/Query.js +139 -6
  19. package/dist/cjs/types/Interface/api/regulation/Query.js.map +1 -1
  20. package/dist/cjs/types/Interface/api/regulation/Read.d.ts +8 -0
  21. package/dist/cjs/types/Interface/api/regulation/Read.d.ts.map +1 -1
  22. package/dist/cjs/types/Interface/api/regulation/Read.js.map +1 -1
  23. package/dist/cjs/types/Interface/enum/Date.d.ts +5 -0
  24. package/dist/cjs/types/Interface/enum/Date.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/enum/Date.js.map +1 -1
  26. package/dist/cjs/types/index.d.ts +5 -2
  27. package/dist/cjs/types/index.d.ts.map +1 -1
  28. package/dist/cjs/types/index.js +5 -2
  29. package/dist/cjs/types/index.js.map +1 -1
  30. package/dist/mjs/api/resources/Regulation.d.ts +6 -2
  31. package/dist/mjs/api/resources/Regulation.d.ts.map +1 -1
  32. package/dist/mjs/api/resources/Regulation.js +21 -0
  33. package/dist/mjs/api/resources/Regulation.js.map +1 -1
  34. package/dist/mjs/types/Enum/MailAuto.d.ts.map +1 -1
  35. package/dist/mjs/types/Enum/MailAuto.js +12 -0
  36. package/dist/mjs/types/Enum/MailAuto.js.map +1 -1
  37. package/dist/mjs/types/Interface/api/rating/QueryRatingPaginated.d.ts +5 -4
  38. package/dist/mjs/types/Interface/api/rating/QueryRatingPaginated.d.ts.map +1 -1
  39. package/dist/mjs/types/Interface/api/rating/QueryRatingPaginated.js +14 -7
  40. package/dist/mjs/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -1
  41. package/dist/mjs/types/Interface/api/regulation/Create.d.ts +13 -0
  42. package/dist/mjs/types/Interface/api/regulation/Create.d.ts.map +1 -0
  43. package/dist/mjs/types/Interface/api/regulation/Create.js +78 -0
  44. package/dist/mjs/types/Interface/api/regulation/Create.js.map +1 -0
  45. package/dist/mjs/types/Interface/api/regulation/Query.d.ts +31 -5
  46. package/dist/mjs/types/Interface/api/regulation/Query.d.ts.map +1 -1
  47. package/dist/mjs/types/Interface/api/regulation/Query.js +158 -6
  48. package/dist/mjs/types/Interface/api/regulation/Query.js.map +1 -1
  49. package/dist/mjs/types/Interface/api/regulation/Read.d.ts +8 -0
  50. package/dist/mjs/types/Interface/api/regulation/Read.d.ts.map +1 -1
  51. package/dist/mjs/types/Interface/api/regulation/Read.js.map +1 -1
  52. package/dist/mjs/types/Interface/enum/Date.d.ts +5 -0
  53. package/dist/mjs/types/Interface/enum/Date.d.ts.map +1 -1
  54. package/dist/mjs/types/Interface/enum/Date.js.map +1 -1
  55. package/dist/mjs/types/index.d.ts +5 -2
  56. package/dist/mjs/types/index.d.ts.map +1 -1
  57. package/dist/mjs/types/index.js +5 -2
  58. package/dist/mjs/types/index.js.map +1 -1
  59. package/package.json +1 -1
  60. package/ts/api/resources/Regulation.ts +28 -3
  61. package/ts/types/Enum/MailAuto.ts +12 -0
  62. package/ts/types/Interface/api/rating/QueryRatingPaginated.ts +13 -8
  63. package/ts/types/Interface/api/regulation/Create.ts +50 -0
  64. package/ts/types/Interface/api/regulation/Query.ts +116 -6
  65. package/ts/types/Interface/api/regulation/Read.ts +10 -1
  66. package/ts/types/Interface/enum/Date.ts +7 -1
  67. package/ts/types/index.ts +7 -3
@@ -1,5 +1,4 @@
1
- import { QueryRegulation } from '../../types';
2
- import { ReadRejectedRegulation } from '../../types/Interface/api/regulation/Read';
1
+ import { QueryPaginateRegulation, QueryRegulation, BasePaginate, IRegulation, QueryTotalAmountRegulation, CreateRegulation, ReadCreateRegulation, ReadRejectedRegulation } from '../../types';
3
2
  import { Resource } from '../Resource';
4
3
 
5
4
  export class Regulation extends Resource {
@@ -8,4 +7,30 @@ export class Regulation extends Resource {
8
7
  params,
9
8
  });
10
9
  }
11
- }
10
+
11
+ public getPaginate(params: QueryPaginateRegulation, signal?: AbortSignal): Promise<BasePaginate<IRegulation>> {
12
+ return this.axios.$get('/regulations/paginate', {
13
+ ...(signal ? { signal } : {}),
14
+ params,
15
+ });
16
+ }
17
+
18
+ public getTotalAmount(params: QueryTotalAmountRegulation, signal?: AbortSignal): Promise<number> {
19
+ return this.axios.$get('/regulations/amounts', {
20
+ ...(signal ? { signal } : {}),
21
+ params,
22
+ });
23
+ }
24
+
25
+ public create(params: CreateRegulation): Promise<ReadCreateRegulation> {
26
+ return this.axios.$post('/regulations', params);
27
+ }
28
+
29
+ public update(id: number, params: Partial<IRegulation>): Promise<IRegulation> {
30
+ return this.axios.$patch(`/regulations/${id}`, params);
31
+ }
32
+
33
+ public delete(id: number): Promise<number> {
34
+ return this.axios.$delete(`/regulations/${id}`);
35
+ }
36
+ }
@@ -238,4 +238,16 @@ export const MailAutoList = [
238
238
  { name: 'contentHtml' },
239
239
  ],
240
240
  },
241
+ {
242
+ id: MailAuto.PAYMENT_REJECTED,
243
+ onlyforRoles: null,
244
+ alias: 'paymentRejected',
245
+ title: 'Rejet de prélèvement',
246
+ subject: 'Rejet de prélèvement',
247
+ fields: [
248
+ { name: 'to', lg: 'xs12 sm5' },
249
+ { name: 'subject', lg: 'xs12 sm7' },
250
+ { name: 'contentHtml' },
251
+ ],
252
+ },
241
253
  ];
@@ -1,4 +1,4 @@
1
- import { IsDateString, IsInt, IsOptional, IsString } from 'class-validator';
1
+ import { IsArray, IsDateString, IsInt, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
 
4
4
  export class QueryRatingPaginated {
@@ -34,14 +34,14 @@ export class QueryRatingPaginated {
34
34
  search?: string;
35
35
 
36
36
  @ApiPropertyOptional()
37
- @IsInt()
37
+ @IsArray()
38
38
  @IsOptional()
39
- supportType?: number;
39
+ supportType?: number[];
40
40
 
41
41
  @ApiPropertyOptional()
42
- @IsInt()
42
+ @IsArray()
43
43
  @IsOptional()
44
- average?: number;
44
+ average?: number[];
45
45
 
46
46
  @ApiPropertyOptional()
47
47
  @IsInt()
@@ -51,12 +51,17 @@ export class QueryRatingPaginated {
51
51
  @ApiPropertyOptional()
52
52
  @IsInt()
53
53
  @IsOptional()
54
- status?: number;
54
+ idLastCaller?: number;
55
55
 
56
56
  @ApiPropertyOptional()
57
- @IsInt()
57
+ @IsArray()
58
+ @IsOptional()
59
+ status?: number[];
60
+
61
+ @ApiPropertyOptional()
62
+ @IsArray()
58
63
  @IsOptional()
59
- toRecall?: number;
64
+ toRecall?: number[];
60
65
 
61
66
  @ApiPropertyOptional()
62
67
  @IsOptional()
@@ -0,0 +1,50 @@
1
+ import { IsBoolean, IsDate, IsEnum, IsInt, IsNumber, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
+ import { UnpaidReason } from '../../../Enum/UnpaidReason';
5
+
6
+ export class CreateRegulation {
7
+ @ApiProperty()
8
+ @IsInt()
9
+ idSociety: number;
10
+
11
+ @ApiProperty()
12
+ @IsInt()
13
+ idPaymentMethod: number;
14
+
15
+ @ApiProperty()
16
+ @IsNumber()
17
+ amount: number;
18
+
19
+ @ApiProperty()
20
+ @IsDate()
21
+ date: Date;
22
+
23
+ @ApiPropertyOptional()
24
+ @IsOptional()
25
+ @IsInt({
26
+ each: true,
27
+ })
28
+ idPayments?: number[];
29
+
30
+ @ApiPropertyOptional()
31
+ @IsOptional()
32
+ @IsBoolean()
33
+ @ToBoolean()
34
+ sendSMS?: boolean;
35
+
36
+ @ApiPropertyOptional()
37
+ @IsOptional()
38
+ @IsBoolean()
39
+ @ToBoolean()
40
+ sendMail?: boolean;
41
+
42
+ @ApiProperty()
43
+ @IsString()
44
+ comment: string;
45
+
46
+ @ApiPropertyOptional()
47
+ @IsOptional()
48
+ @IsEnum(UnpaidReason)
49
+ reasonUnpaid?: UnpaidReason;
50
+ }
@@ -1,31 +1,141 @@
1
1
  import { IsBoolean, IsInt, IsOptional, IsString } from 'class-validator';
2
- import { ApiPropertyOptional } from '../../../../utils';
2
+ import { RequiredQueryPaginate } from '../BasePaginate';
3
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
4
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
5
 
6
+ export class QueryPaginateRegulation extends RequiredQueryPaginate {
7
+ @ApiPropertyOptional()
8
+ @IsOptional()
9
+ @IsInt()
10
+ idRegulation?: number;
11
+
12
+ @ApiPropertyOptional()
13
+ @IsOptional()
14
+ @IsString()
15
+ orderBy?: string;
16
+
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsBoolean()
20
+ @ToBoolean()
21
+ descending?: boolean;
22
+
23
+ @ApiPropertyOptional()
24
+ @IsOptional()
25
+ @IsInt()
26
+ year?: number;
27
+
28
+ @ApiPropertyOptional()
29
+ @IsOptional()
30
+ @IsInt()
31
+ month?: number;
32
+
33
+ @ApiPropertyOptional()
34
+ @IsOptional()
35
+ @IsInt()
36
+ idPaymentMethod?: number;
37
+
38
+ @ApiPropertyOptional()
39
+ @IsOptional()
40
+ @IsString()
41
+ search?: string;
42
+
43
+ @ApiPropertyOptional()
44
+ @IsOptional()
45
+ @IsInt()
46
+ day?: number;
47
+
48
+ @ApiPropertyOptional()
49
+ @IsOptional()
50
+ @IsInt()
51
+ idJuriste?: number;
52
+
53
+ @ApiPropertyOptional()
54
+ @IsOptional()
55
+ @IsInt()
56
+ idCommercial?: number;
57
+
58
+ @ApiPropertyOptional()
59
+ @IsOptional()
60
+ @IsString()
61
+ linkPayment?: string;
62
+ }
63
+
5
64
  export class QueryRegulation {
6
65
  @ApiPropertyOptional()
7
66
  @IsOptional()
8
67
  @IsString()
9
- orderBy?: string | null;
68
+ orderBy?: string;
10
69
 
11
70
  @ApiPropertyOptional()
12
71
  @IsOptional()
13
72
  @IsBoolean()
14
73
  @ToBoolean()
15
- descending?: boolean | null;
74
+ descending?: boolean;
75
+
76
+ @ApiPropertyOptional()
77
+ @IsOptional()
78
+ @IsInt()
79
+ year?: number;
80
+
81
+ @ApiPropertyOptional()
82
+ @IsOptional()
83
+ @IsInt()
84
+ month?: number;
16
85
 
17
86
  @ApiPropertyOptional()
18
87
  @IsOptional()
19
88
  @IsInt()
20
- year?: number | null;
89
+ idPaymentMethod?: number;
90
+
91
+ @ApiPropertyOptional()
92
+ @IsOptional()
93
+ @IsString()
94
+ search?: string;
95
+
96
+ @ApiPropertyOptional()
97
+ @IsOptional()
98
+ @IsInt()
99
+ day?: number;
100
+
101
+ @ApiPropertyOptional()
102
+ @IsOptional()
103
+ @IsInt()
104
+ idJuriste?: number;
105
+
106
+ @ApiPropertyOptional()
107
+ @IsOptional()
108
+ @IsInt()
109
+ idCommercial?: number;
110
+
111
+ @ApiPropertyOptional()
112
+ @IsOptional()
113
+ @IsString()
114
+ linkPayment?: string;
115
+ }
116
+
117
+ export class QueryTotalAmountRegulation {
118
+ @ApiProperty()
119
+ @IsInt()
120
+ year: number;
121
+
122
+ @ApiPropertyOptional()
123
+ @IsOptional()
124
+ @IsInt()
125
+ month?: number;
126
+
127
+ @ApiPropertyOptional()
128
+ @IsOptional()
129
+ @IsString()
130
+ search?: string;
21
131
 
22
132
  @ApiPropertyOptional()
23
133
  @IsOptional()
24
134
  @IsInt()
25
- month?: number | null;
135
+ day?: number;
26
136
 
27
137
  @ApiPropertyOptional()
28
138
  @IsOptional()
29
139
  @IsInt()
30
- idPaymentMethod?: number | null;
140
+ idPaymentMethod?: number;
31
141
  }
@@ -1,7 +1,16 @@
1
1
  import { IRegulation } from '../../..';
2
+ import { IMail } from '../../models/IMail';
3
+ import { ISms } from '../../models/ISms';
2
4
 
3
5
  export interface ReadRejectedRegulation {
4
6
  regulations: IRegulation[];
5
7
  nbOfReject: number;
6
8
  totalAmount: number;
7
- }
9
+ }
10
+
11
+ export interface ReadCreateRegulation {
12
+ id: number,
13
+ message: string | null,
14
+ sms: ISms | null,
15
+ email: IMail | null,
16
+ }
@@ -3,4 +3,10 @@ export interface DateRange {
3
3
  end: Date;
4
4
  from?: number;
5
5
  to?: number;
6
- }
6
+ }
7
+
8
+ export type StartAndEndDateFormat = {
9
+ year: number;
10
+ month?: number;
11
+ day?: number;
12
+ };
package/ts/types/index.ts CHANGED
@@ -1118,6 +1118,8 @@ export * from './Interface/api/companyCreationForm/UpdateCompanyCreationForm';
1118
1118
  export * from './Interface/api/companyCreationForm/CompanyCreationFormPayload';
1119
1119
  export * from './Interface/api/sellsy/CreateInvoicesSellsy';
1120
1120
  export * from './Interface/api/PaymentRecovery/Create';
1121
+ export * from './Interface/api/yousign/index';
1122
+ export * from './Interface/api/aspone/AsponeApi';
1121
1123
  export * from './Interface/api/PaymentRecovery/Caarl';
1122
1124
  export * from './Interface/api/PaymentRecovery/Read';
1123
1125
  export * from './Interface/api/PaymentRecovery/Query';
@@ -1125,8 +1127,7 @@ export * from './Interface/api/previsionalForm/PrevisionalFormPayload';
1125
1127
  export * from './Interface/api/previsionalForm/CreatePrevisionalForm';
1126
1128
  export * from './Interface/api/toDoExpress/Query';
1127
1129
  export * from './Interface/api/toDoExpress/Read';
1128
- export * from './Interface/api/yousign/index';
1129
- export * from './Interface/api/aspone/AsponeApi';
1130
+
1130
1131
 
1131
1132
  // Enums types
1132
1133
  export * from './Interface/enum/Util';
@@ -1157,4 +1158,7 @@ export * from './Interface/api/dubiousCustomer/Create';
1157
1158
  export * from './Interface/api/dubiousCustomer/Update';
1158
1159
  export * from './Interface/api/timeTracking/Create';
1159
1160
  export * from './Interface/api/timeTracking/Query';
1160
- export * from './Interface/api/IntermediateManagementRebate';
1161
+ export * from './Interface/api/IntermediateManagementRebate';
1162
+ export * from './Interface/api/regulation/Query';
1163
+ export * from './Interface/api/regulation/Read';
1164
+ export * from './Interface/api/regulation/Create';