@silexpert/core 1.2.55 → 1.2.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.
Files changed (71) hide show
  1. package/dist/cjs/api/resources/Payment.d.ts +2 -1
  2. package/dist/cjs/api/resources/Payment.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Payment.js +3 -0
  4. package/dist/cjs/api/resources/Payment.js.map +1 -1
  5. package/dist/cjs/types/Enum/Role.d.ts +2 -1
  6. package/dist/cjs/types/Enum/Role.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/Role.js +1 -0
  8. package/dist/cjs/types/Enum/Role.js.map +1 -1
  9. package/dist/cjs/types/Enum/RoleDetail.d.ts +12 -0
  10. package/dist/cjs/types/Enum/RoleDetail.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/RoleDetail.js +12 -0
  12. package/dist/cjs/types/Enum/RoleDetail.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.d.ts +4 -3
  14. package/dist/cjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.js.map +1 -1
  16. package/dist/cjs/types/Interface/api/payment/Query.d.ts +8 -0
  17. package/dist/cjs/types/Interface/api/payment/Query.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/api/payment/Query.js +26 -1
  19. package/dist/cjs/types/Interface/api/payment/Query.js.map +1 -1
  20. package/dist/cjs/types/Interface/api/regulation/Create.d.ts +1 -1
  21. package/dist/cjs/types/Interface/api/regulation/Create.d.ts.map +1 -1
  22. package/dist/cjs/types/Interface/api/regulation/Create.js +6 -8
  23. package/dist/cjs/types/Interface/api/regulation/Create.js.map +1 -1
  24. package/dist/cjs/types/Interface/api/task/QueryCountTask.d.ts +1 -1
  25. package/dist/cjs/types/Interface/api/task/QueryCountTask.d.ts.map +1 -1
  26. package/dist/cjs/types/Interface/api/task/QueryCountTask.js +2 -2
  27. package/dist/cjs/types/Interface/api/task/QueryCountTask.js.map +1 -1
  28. package/dist/cjs/utils/task.d.ts +11 -3
  29. package/dist/cjs/utils/task.d.ts.map +1 -1
  30. package/dist/cjs/utils/task.js +25 -3
  31. package/dist/cjs/utils/task.js.map +1 -1
  32. package/dist/mjs/api/resources/Payment.d.ts +2 -1
  33. package/dist/mjs/api/resources/Payment.d.ts.map +1 -1
  34. package/dist/mjs/api/resources/Payment.js +3 -0
  35. package/dist/mjs/api/resources/Payment.js.map +1 -1
  36. package/dist/mjs/types/Enum/Role.d.ts +2 -1
  37. package/dist/mjs/types/Enum/Role.d.ts.map +1 -1
  38. package/dist/mjs/types/Enum/Role.js +1 -0
  39. package/dist/mjs/types/Enum/Role.js.map +1 -1
  40. package/dist/mjs/types/Enum/RoleDetail.d.ts +12 -0
  41. package/dist/mjs/types/Enum/RoleDetail.d.ts.map +1 -1
  42. package/dist/mjs/types/Enum/RoleDetail.js +12 -0
  43. package/dist/mjs/types/Enum/RoleDetail.js.map +1 -1
  44. package/dist/mjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.d.ts +4 -3
  45. package/dist/mjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.d.ts.map +1 -1
  46. package/dist/mjs/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.js.map +1 -1
  47. package/dist/mjs/types/Interface/api/payment/Query.d.ts +8 -0
  48. package/dist/mjs/types/Interface/api/payment/Query.d.ts.map +1 -1
  49. package/dist/mjs/types/Interface/api/payment/Query.js +31 -1
  50. package/dist/mjs/types/Interface/api/payment/Query.js.map +1 -1
  51. package/dist/mjs/types/Interface/api/regulation/Create.d.ts +1 -1
  52. package/dist/mjs/types/Interface/api/regulation/Create.d.ts.map +1 -1
  53. package/dist/mjs/types/Interface/api/regulation/Create.js +7 -9
  54. package/dist/mjs/types/Interface/api/regulation/Create.js.map +1 -1
  55. package/dist/mjs/types/Interface/api/task/QueryCountTask.d.ts +1 -1
  56. package/dist/mjs/types/Interface/api/task/QueryCountTask.d.ts.map +1 -1
  57. package/dist/mjs/types/Interface/api/task/QueryCountTask.js +2 -2
  58. package/dist/mjs/types/Interface/api/task/QueryCountTask.js.map +1 -1
  59. package/dist/mjs/utils/task.d.ts +11 -3
  60. package/dist/mjs/utils/task.d.ts.map +1 -1
  61. package/dist/mjs/utils/task.js +24 -2
  62. package/dist/mjs/utils/task.js.map +1 -1
  63. package/package.json +1 -1
  64. package/ts/api/resources/Payment.ts +9 -1
  65. package/ts/types/Enum/Role.ts +1 -0
  66. package/ts/types/Enum/RoleDetail.ts +12 -0
  67. package/ts/types/Interface/api/kilometricAllowance/ReadKilometricAllowance.ts +4 -3
  68. package/ts/types/Interface/api/payment/Query.ts +25 -1
  69. package/ts/types/Interface/api/regulation/Create.ts +5 -7
  70. package/ts/types/Interface/api/task/QueryCountTask.ts +2 -2
  71. package/ts/utils/task.ts +27 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.2.55",
3
+ "version": "1.2.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",
@@ -9,6 +9,7 @@ import {
9
9
  QueryMonthlyPayment,
10
10
  QueryPayment,
11
11
  QueryPaymentCsv,
12
+ QueryPayments,
12
13
  QueryPaymentInvoice,
13
14
  QueryPaymentRecoveryPaginated,
14
15
  QueryPaymentRecoveryStatistic,
@@ -135,8 +136,15 @@ export class Payment extends Resource {
135
136
  ): Promise<ReadPaymentRecoveryStatistic> {
136
137
  return this.axios.$get('/payments-recovery/statistics', { params: query, signal });
137
138
  }
138
-
139
+
139
140
  askProcess(idPaymentRecovery: number, payload: AskProcessPaymentRecovery): Promise<IPaymentRecovery> {
140
141
  return this.axios.$post(`/payments-recovery/${idPaymentRecovery}/contact`, payload);
141
142
  }
143
+
144
+ getAll(
145
+ query: QueryPayments,
146
+ signal: AbortSignal,
147
+ ): Promise<IPayment[]> {
148
+ return this.axios.$get('/payments', { params: query, signal });
149
+ }
142
150
  }
@@ -50,6 +50,7 @@ export enum Role {
50
50
  SENIOR = 54,
51
51
  TECHNICAL_ADVISOR = 55,
52
52
  RATING = 56,
53
+ INTERNAL_ACCOUNTANT = 57,
53
54
  }
54
55
 
55
56
  export const RoleAllowedToLogInAsClient = [
@@ -503,4 +503,16 @@ export const RoleDetail = {
503
503
  cnVpn: 'COMPTABLE',
504
504
  isGrade: false,
505
505
  },
506
+ INTERNAL_ACCOUNTANT: {
507
+ id: Role.INTERNAL_ACCOUNTANT,
508
+ name: 'Comptable Interne',
509
+ colorPrimary: '#8765D0',
510
+ colorSecondary: '#DED7F6',
511
+ handledInUserSocietyPermissionTable: false,
512
+ isService: false,
513
+ subRole: false,
514
+ isInWebmail: false,
515
+ cnVpn: 'COMPTABLE',
516
+ isGrade: false,
517
+ },
506
518
  };
@@ -1,7 +1,8 @@
1
1
  import { ISocietyPartner } from '../../..';
2
2
  import { ISocietyVehicle } from '../../models/ISocietyVehicle';
3
3
 
4
- export type ReadKilometricAllowanceByVehicleInfoPerYear = {
4
+ export type ReadKilometricAllowanceByYearInfoPerYear = {
5
+ vehicle?: ISocietyVehicle;
5
6
  year: string;
6
7
  amount: number;
7
8
  kilometers: number;
@@ -11,12 +12,12 @@ export type ReadKilometricAllowanceByVehicle = {
11
12
  vehicle: ISocietyVehicle;
12
13
  amount: number;
13
14
  kilometers: number;
14
- informationsPerYear: ReadKilometricAllowanceByVehicleInfoPerYear[];
15
+ informationsPerYear: ReadKilometricAllowanceByYearInfoPerYear[];
15
16
  };
16
17
 
17
18
  export type ReadKilometricAllowanceByPartner = {
18
19
  partner: ISocietyPartner;
19
20
  amount: number;
20
21
  kilometers: number;
21
- informationsPerYear: ReadKilometricAllowanceByVehicleInfoPerYear[];
22
+ informationsPerYear: ReadKilometricAllowanceByYearInfoPerYear[];
22
23
  };
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsDate, IsOptional } from 'class-validator';
1
+ import { IsBoolean, IsDate, IsIn, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
4
 
@@ -12,6 +12,30 @@ export class QueryPayment {
12
12
  endDate: Date;
13
13
  }
14
14
 
15
+ export class QueryPayments {
16
+ /**
17
+ * Reference used in paymentDirectDebitHistory
18
+ */
19
+ @ApiProperty()
20
+ @IsString()
21
+ reference: string;
22
+
23
+ @ApiPropertyOptional()
24
+ @IsOptional()
25
+ @IsString({
26
+ each: true,
27
+ })
28
+ @IsIn(['directDebitHistory'], { each: true })
29
+ include?: string[];
30
+
31
+ @ApiPropertyOptional()
32
+ @IsOptional()
33
+ @IsString({
34
+ each: true,
35
+ })
36
+ attributes?: string[];
37
+ }
38
+
15
39
  export class QuerySocietyUnpaid {
16
40
  @ApiPropertyOptional()
17
41
  @IsOptional()
@@ -20,13 +20,6 @@ export class CreateRegulation {
20
20
  @IsDate()
21
21
  date: Date;
22
22
 
23
- @ApiPropertyOptional()
24
- @IsOptional()
25
- @IsInt({
26
- each: true,
27
- })
28
- idPayments?: number[];
29
-
30
23
  @ApiPropertyOptional()
31
24
  @IsOptional()
32
25
  @IsBoolean()
@@ -47,4 +40,9 @@ export class CreateRegulation {
47
40
  @IsOptional()
48
41
  @IsEnum(UnpaidReason)
49
42
  reasonUnpaid?: UnpaidReason;
43
+
44
+ @ApiPropertyOptional()
45
+ @IsOptional()
46
+ @IsString()
47
+ paymentReference?: string;
50
48
  }
@@ -10,8 +10,8 @@ export class QueryCountTask {
10
10
 
11
11
  @ApiPropertyOptional()
12
12
  @IsOptional()
13
- @IsInt()
14
- idService?: number;
13
+ @IsInt({each: true})
14
+ idService?: number[];
15
15
 
16
16
  @ApiPropertyOptional()
17
17
  @IsOptional()
package/ts/utils/task.ts CHANGED
@@ -1,7 +1,13 @@
1
1
  import { Role } from '../types/Enum/Role';
2
2
  import { TaskResponseType, RoleAvailableForTask } from '../types/Enum/TaskResponseType';
3
3
 
4
- const getIdRoleUsedForTask = (listRoles: number[]): number => {
4
+ /**
5
+ * Use getListIdRolesUsedForTask instead
6
+ * @param listRoles
7
+ * @returns
8
+ * @deprecated
9
+ */
10
+ const getIdRoleUsedForTask = (listRoles: Role[]): Role => {
5
11
  let idRole = 0;
6
12
  if (listRoles.includes(Role.COMMERCIAL)) {
7
13
  idRole = Role.COMMERCIAL;
@@ -43,12 +49,29 @@ const getIdRoleUsedForTask = (listRoles: number[]): number => {
43
49
  // return idRole;
44
50
  // };
45
51
 
46
- const getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): number | undefined => {
52
+ const getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): Role[] => {
47
53
  const taskTypeList = isIntern === true ? TaskResponseType.INTERN.types : TaskResponseType.EXTERN.types;
48
- return taskTypeList.find((taskType) => taskType.id === idTaskType)?.role;
54
+ return taskTypeList.filter((taskType) => taskType.id === idTaskType).map(r => r.role);
49
55
  };
50
56
 
51
57
  const getIdRoleUsedForGetTaskOfUser = (idRole: number): boolean =>
52
58
  !!Object.values(RoleAvailableForTask).find((role) => role === idRole);
53
59
 
54
- export { getIdRoleUsedForTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser };
60
+ const getListIdRolesUsedForTask = (listRoles: Role[]): Role[] => {
61
+ const listIdRoles:Role[] = listRoles.filter(r => [
62
+ Role.COMMERCIAL,
63
+ Role.JURIDIC,
64
+ Role.SOCIAL,
65
+ Role.FACTURATION,
66
+ Role.CUSTOMER_SUCCESS,
67
+ Role.TECHNICAL_ADVISOR,
68
+ Role.ON_BOARDER,
69
+ Role.TERMINATION,
70
+ Role.LITIGE,
71
+ Role.FRONT_OFFICE,
72
+ Role.DATA_OFFICER,
73
+ ].includes(r));
74
+ return listIdRoles;
75
+ };
76
+
77
+ export { getIdRoleUsedForTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser, getListIdRolesUsedForTask };