@silexpert/core 1.2.45 → 1.2.46

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 (65) hide show
  1. package/dist/cjs/api/resources/Payment.d.ts +13 -0
  2. package/dist/cjs/api/resources/Payment.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Payment.js +26 -0
  4. package/dist/cjs/api/resources/Payment.js.map +1 -1
  5. package/dist/cjs/types/Enum/RoleDetail.d.ts +1 -0
  6. package/dist/cjs/types/Enum/RoleDetail.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/RoleDetail.js +1 -0
  8. package/dist/cjs/types/Enum/RoleDetail.js.map +1 -1
  9. package/dist/cjs/types/Enum/Sepa.d.ts +28 -0
  10. package/dist/cjs/types/Enum/Sepa.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/Sepa.js +55 -26
  12. package/dist/cjs/types/Enum/Sepa.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/payment/Params.d.ts +4 -0
  14. package/dist/cjs/types/Interface/api/payment/Params.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/payment/Params.js +17 -1
  16. package/dist/cjs/types/Interface/api/payment/Params.js.map +1 -1
  17. package/dist/cjs/types/Interface/models/IPayment.d.ts +2 -0
  18. package/dist/cjs/types/Interface/models/IPayment.d.ts.map +1 -1
  19. package/dist/cjs/types/Interface/models/IPayment.js.map +1 -1
  20. package/dist/cjs/types/Interface/models/IPaymentDirectDebitHistory.d.ts +10 -0
  21. package/dist/cjs/types/Interface/models/IPaymentDirectDebitHistory.d.ts.map +1 -0
  22. package/dist/cjs/types/Interface/models/IPaymentDirectDebitHistory.js +3 -0
  23. package/dist/cjs/types/Interface/models/IPaymentDirectDebitHistory.js.map +1 -0
  24. package/dist/cjs/types/Interface/models/ISociety.js.map +1 -1
  25. package/dist/cjs/types/index.d.ts +1 -0
  26. package/dist/cjs/types/index.d.ts.map +1 -1
  27. package/dist/cjs/types/index.js +1 -0
  28. package/dist/cjs/types/index.js.map +1 -1
  29. package/dist/mjs/api/resources/Payment.d.ts +13 -0
  30. package/dist/mjs/api/resources/Payment.d.ts.map +1 -1
  31. package/dist/mjs/api/resources/Payment.js +26 -0
  32. package/dist/mjs/api/resources/Payment.js.map +1 -1
  33. package/dist/mjs/types/Enum/RoleDetail.d.ts +1 -0
  34. package/dist/mjs/types/Enum/RoleDetail.d.ts.map +1 -1
  35. package/dist/mjs/types/Enum/RoleDetail.js +1 -0
  36. package/dist/mjs/types/Enum/RoleDetail.js.map +1 -1
  37. package/dist/mjs/types/Enum/Sepa.d.ts +28 -0
  38. package/dist/mjs/types/Enum/Sepa.d.ts.map +1 -1
  39. package/dist/mjs/types/Enum/Sepa.js +54 -25
  40. package/dist/mjs/types/Enum/Sepa.js.map +1 -1
  41. package/dist/mjs/types/Interface/api/payment/Params.d.ts +4 -0
  42. package/dist/mjs/types/Interface/api/payment/Params.d.ts.map +1 -1
  43. package/dist/mjs/types/Interface/api/payment/Params.js +19 -2
  44. package/dist/mjs/types/Interface/api/payment/Params.js.map +1 -1
  45. package/dist/mjs/types/Interface/models/IPayment.d.ts +2 -0
  46. package/dist/mjs/types/Interface/models/IPayment.d.ts.map +1 -1
  47. package/dist/mjs/types/Interface/models/IPayment.js.map +1 -1
  48. package/dist/mjs/types/Interface/models/IPaymentDirectDebitHistory.d.ts +10 -0
  49. package/dist/mjs/types/Interface/models/IPaymentDirectDebitHistory.d.ts.map +1 -0
  50. package/dist/mjs/types/Interface/models/IPaymentDirectDebitHistory.js +2 -0
  51. package/dist/mjs/types/Interface/models/IPaymentDirectDebitHistory.js.map +1 -0
  52. package/dist/mjs/types/Interface/models/ISociety.js.map +1 -1
  53. package/dist/mjs/types/index.d.ts +1 -0
  54. package/dist/mjs/types/index.d.ts.map +1 -1
  55. package/dist/mjs/types/index.js +1 -0
  56. package/dist/mjs/types/index.js.map +1 -1
  57. package/package.json +1 -1
  58. package/ts/api/resources/Payment.ts +28 -0
  59. package/ts/types/Enum/RoleDetail.ts +1 -0
  60. package/ts/types/Enum/Sepa.ts +58 -28
  61. package/ts/types/Interface/api/payment/Params.ts +15 -2
  62. package/ts/types/Interface/models/IPayment.ts +4 -1
  63. package/ts/types/Interface/models/IPaymentDirectDebitHistory.ts +12 -0
  64. package/ts/types/Interface/models/ISociety.ts +1 -1
  65. package/ts/types/index.ts +1 -0
@@ -64,6 +64,34 @@ export class Payment extends Resource {
64
64
  });
65
65
  }
66
66
 
67
+ /**
68
+ * Return list of payments which could be collectables
69
+ * @param signal
70
+ * @returns
71
+ */
72
+ getAutoCollectables(signal: AbortSignal): Promise<IPayment[]> {
73
+ return this.axios.$get('payments/auto-collectables', {
74
+ signal,
75
+ });
76
+ }
77
+
78
+ /**
79
+ * Return list of payments which are collectables
80
+ * @param signal
81
+ * @returns
82
+ */
83
+ getCollectables(signal: AbortSignal): Promise<IPayment[]> {
84
+ return this.axios.$get('payments/collectables', {
85
+ signal,
86
+ });
87
+ }
88
+ setAsCollectable(listIdPayment: number[]): Promise<IPayment[]> {
89
+ return this.axios.$patch('payments', {
90
+ listIdPayment,
91
+ isCollectable: true,
92
+ });
93
+ }
94
+
67
95
  getStatsPaidByPrestation(
68
96
  payload: QueryPayment,
69
97
  ): Promise<{ invoicePaymentStats: ReadStatPrestation; assetPaymentStats: ReadStatPrestation }> {
@@ -430,6 +430,7 @@ export const RoleDetail = {
430
430
  handledInUserSocietyPermissionTable: false,
431
431
  isService: true,
432
432
  subRole: false,
433
+ isInWebmail: true,
433
434
  cnVpn: 'CUSTOMER_SUCCESS',
434
435
  isGrade: false,
435
436
  },
@@ -1,48 +1,78 @@
1
+ export enum ErrorCodeSepaId {
2
+ UNUSABLE_BANK_DETAILS = 1,
3
+ INCORRECT_BIC = 2,
4
+ MISSING_ID = 3,
5
+ MISSING_NAME_OR_ADDRESS = 4,
6
+ MISSING_OTHER = 5,
7
+ NOT_CORRESPONDING_DEBTOR_NAME = 6,
8
+ DUBBLE = 7,
9
+ INCORRECT_CREDITOR_ID = 8,
10
+ INCORRECT_TRANSACTION_CODE_OR_BAD_FILE_FORMAT = 9,
11
+ INCORRECT_BANK_DEBIT_TYPE = 10,
12
+ MISSING_BANK_ORDER_DATA = 11,
13
+ INCORRECT_ORMISSING_CREDITOR_NAME_OR_ADDRESS = 12,
14
+ INCORRECT_TRANSACTION_CODE_OR_SEQUENCE_ERROR = 13,
15
+ NO_VALID_BANK_ORDER_OR_UNAUTHORISED_TRANSACTION = 14,
16
+ PROHIBITED_WITHDRAWALS_FOR_LEGISLATIVE_REASONS = 15,
17
+ CLOSED_ACCOUNT = 16,
18
+ DECEASED_DEBTOR = 17,
19
+ ACCOUNT_BLOCKED_FOR_SEPA_DIRECT_DEBITS_BY_THE_DEBTOR = 18,
20
+ SPECIFIC_SERVICE = 19,
21
+ DEBIT_ACCOUNT_OF_NATURAL_PERSON = 20,
22
+ INSUFFICIENT_FUNDS = 21,
23
+ DIRECT_DEBIT_REFUSED_BY_DEBTOR = 22,
24
+ REASON_NOT_SPECIFIED = 23,
25
+ AUTHORISED_OPERATION_CONTESTED = 24,
26
+ NO_VALID_MANDATE_OR_UNAUTHORISED_TRANSACTION = 25,
27
+ }
28
+
1
29
  type ErrorCodeSepaType = {
2
- refXml: string;
3
- motifXml: string;
30
+ id:ErrorCodeSepaId,
31
+ refXml:string,
32
+ motifXml:string,
4
33
  };
5
34
 
6
- export const ErrorCodeSepa: ErrorCodeSepaType[] = [
7
- { refXml: 'AC01', motifXml: 'Coordonnées bancaires inexploitables' },
8
- { refXml: 'RC01', motifXml: 'Code BIC erroné' },
35
+ export const ErrorCodeSepa:ErrorCodeSepaType[] = [
36
+ { id: ErrorCodeSepaId.UNUSABLE_BANK_DETAILS, refXml: 'AC01', motifXml: 'Coordonnées bancaires inexploitables' },
37
+ { id: ErrorCodeSepaId.INCORRECT_BIC, refXml: 'RC01', motifXml: 'Code BIC erroné' },
9
38
  {
10
- refXml: 'RR01',
39
+ id: ErrorCodeSepaId.MISSING_ID, refXml: 'RR01',
11
40
  motifXml: 'Motif réglementaire - Le compte ou identifiant débiteur est insuffisant ou manquant.',
12
41
  },
13
42
  {
14
- refXml: 'RR02',
43
+ id: ErrorCodeSepaId.MISSING_NAME_OR_ADDRESS, refXml: 'RR02',
15
44
  motifXml:
16
45
  'Motif réglementaire - Les renseignements du nom ou de l’adresse du débiteur sont insuffisants ou manquants.',
17
46
  },
18
- { refXml: 'RR04', motifXml: 'Motif réglementaire - Autre' },
47
+ { id: ErrorCodeSepaId.MISSING_OTHER, refXml: 'RR04', motifXml: 'Motif réglementaire - Autre' },
19
48
  {
20
- refXml: 'BE01',
49
+ id: ErrorCodeSepaId.NOT_CORRESPONDING_DEBTOR_NAME, refXml: 'BE01',
21
50
  motifXml: 'Le nom du débiteur ne correspond pas au nom du titulaire du compte',
22
51
  },
23
- { refXml: 'AM05', motifXml: 'Prélèvement en double' },
24
- { refXml: 'BE05', motifXml: 'Identifiant créancier incorrect' },
25
- { refXml: 'FF01', motifXml: 'Code de transaction incorrect ou format fichier invalide' },
26
- { refXml: 'FF05', motifXml: 'Type de prélèvement incorrect' },
27
- { refXml: 'MD02', motifXml: 'Données du mandat manquantes ou inexactes' },
52
+ { id: ErrorCodeSepaId.DUBBLE, refXml: 'AM05', motifXml: 'Prélèvement en double' },
53
+ { id: ErrorCodeSepaId.INCORRECT_CREDITOR_ID, refXml: 'BE05', motifXml: 'Identifiant créancier incorrect' },
54
+ { id: ErrorCodeSepaId.INCORRECT_TRANSACTION_CODE_OR_BAD_FILE_FORMAT, refXml: 'FF01', motifXml: 'Code de transaction incorrect ou format fichier invalide' },
55
+ { id: ErrorCodeSepaId.INCORRECT_BANK_DEBIT_TYPE, refXml: 'FF05', motifXml: 'Type de prélèvement incorrect' },
56
+ { id: ErrorCodeSepaId.MISSING_BANK_ORDER_DATA, refXml: 'MD02', motifXml: 'Données du mandat manquantes ou inexactes' },
28
57
  {
58
+ id: ErrorCodeSepaId.INCORRECT_ORMISSING_CREDITOR_NAME_OR_ADDRESS,
29
59
  refXml: 'RR03',
30
- motifXml: "Motif réglementaire - Le nom ou l'adresse du créancier est incorrect ou manquant.",
60
+ motifXml: 'Motif réglementaire - Le nom ou l\'adresse du créancier est incorrect ou manquant.',
31
61
  },
32
- { refXml: 'AG02', motifXml: 'Code de transaction incorrect ou erreur de séquence' },
33
- { refXml: 'MD01', motifXml: 'Aucun mandat valide ou opération non autorisée' },
62
+ { id: ErrorCodeSepaId.INCORRECT_TRANSACTION_CODE_OR_SEQUENCE_ERROR, refXml: 'AG02', motifXml: 'Code de transaction incorrect ou erreur de séquence' },
63
+ { id: ErrorCodeSepaId.NO_VALID_BANK_ORDER_OR_UNAUTHORISED_TRANSACTION, refXml: 'MD01', motifXml: 'Aucun mandat valide ou opération non autorisée' },
34
64
  {
35
- refXml: 'AG01',
65
+ id: ErrorCodeSepaId.PROHIBITED_WITHDRAWALS_FOR_LEGISLATIVE_REASONS, refXml: 'AG01',
36
66
  motifXml: 'Prélèvements interdits sur ce compte pour des raisons législatives',
37
67
  },
38
- { refXml: 'AC04', motifXml: 'Compte fermé' },
39
- { refXml: 'MD07', motifXml: 'Débiteur décédé' },
40
- { refXml: 'AC06', motifXml: 'Compte bloqué pour les prélèvements SEPA par le débiteur' },
41
- { refXml: 'SL01', motifXml: 'Service spécifique' },
42
- { refXml: 'AC13', motifXml: "Le compte débiteur est le compte d'une personne physique" },
43
- { refXml: 'AM04', motifXml: 'Fonds insuffisants' },
44
- { refXml: 'MS02', motifXml: 'Prélèvement refusé par le débiteur' },
45
- { refXml: 'MS03', motifXml: 'Raison non précisée' },
46
- { refXml: 'MD06', motifXml: 'Opération autorisée contestée' },
47
- { refXml: 'MD01', motifXml: 'Aucun mandat valide ou opération non autorisée' },
68
+ { id: ErrorCodeSepaId.CLOSED_ACCOUNT, refXml: 'AC04', motifXml: 'Compte fermé' },
69
+ { id: ErrorCodeSepaId.DECEASED_DEBTOR, refXml: 'MD07', motifXml: 'Débiteur décédé' },
70
+ { id: ErrorCodeSepaId.ACCOUNT_BLOCKED_FOR_SEPA_DIRECT_DEBITS_BY_THE_DEBTOR, refXml: 'AC06', motifXml: 'Compte bloqué pour les prélèvements SEPA par le débiteur' },
71
+ { id: ErrorCodeSepaId.SPECIFIC_SERVICE, refXml: 'SL01', motifXml: 'Service spécifique' },
72
+ { id: ErrorCodeSepaId.DEBIT_ACCOUNT_OF_NATURAL_PERSON, refXml: 'AC13', motifXml: 'Le compte débiteur est le compte d\'une personne physique' },
73
+ { id: ErrorCodeSepaId.INSUFFICIENT_FUNDS, refXml: 'AM04', motifXml: 'Fonds insuffisants' },
74
+ { id: ErrorCodeSepaId.DIRECT_DEBIT_REFUSED_BY_DEBTOR, refXml: 'MS02', motifXml: 'Prélèvement refusé par le débiteur' },
75
+ { id: ErrorCodeSepaId.REASON_NOT_SPECIFIED, refXml: 'MS03', motifXml: 'Raison non précisée' },
76
+ { id: ErrorCodeSepaId.AUTHORISED_OPERATION_CONTESTED, refXml: 'MD06', motifXml: 'Opération autorisée contestée' },
77
+ { id: ErrorCodeSepaId.NO_VALID_MANDATE_OR_UNAUTHORISED_TRANSACTION, refXml: 'MD01', motifXml: 'Aucun mandat valide ou opération non autorisée' },
48
78
  ];
@@ -1,5 +1,6 @@
1
- import { IsInt, IsOptional } from 'class-validator';
2
- import { ApiPropertyOptional } from '../../../../utils';
1
+ import { IsBoolean, IsInt, IsOptional } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
3
4
 
4
5
  export class CreatePaymentsAutoBilling {
5
6
  @ApiPropertyOptional()
@@ -7,3 +8,15 @@ export class CreatePaymentsAutoBilling {
7
8
  @IsInt()
8
9
  idSociety?: number;
9
10
  }
11
+
12
+ export class UpdateCollectable {
13
+ @ApiProperty()
14
+ @IsInt({ each: true })
15
+ listIdPayment: number[];
16
+
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsBoolean()
20
+ @ToBoolean()
21
+ isCollectable: boolean;
22
+ }
@@ -13,7 +13,10 @@ export interface IPayment {
13
13
  isOverdue?: boolean;
14
14
  isOverpaid?: boolean;
15
15
  isFirst?: boolean;
16
- toCollect?: boolean;
16
+ // @deprecated Use isCollectable instead
17
+ toCollect?: boolean;
18
+ countRejects?: number;
19
+ isCollectable?: boolean;
17
20
  isAsset?: boolean;
18
21
  isFree?: boolean;
19
22
  isHiddenCustomer?: boolean;
@@ -0,0 +1,12 @@
1
+ import { IPayment } from './IPayment';
2
+
3
+ // paymentDirectDebitHistory
4
+ export interface IPaymentDirectDebitHistory {
5
+ id?: number;
6
+ reference: string;
7
+ idPayment: number;
8
+ createdAt?: Date | null;
9
+ updatedAt?: Date | null;
10
+
11
+ payment?: IPayment;
12
+ }
@@ -144,7 +144,7 @@ export interface ISociety {
144
144
  idUserAdvise?: number | null;
145
145
  idVatForInternalInvoicing?: number;
146
146
  dateFirstSendUnpaid?: Date | null;
147
- reasonUnpaid?: number | null;
147
+ reasonUnpaid?: number | null; //FIXME: une fois migrée, à remplacer par l'ENUM reasonUnpaid
148
148
  stripeSubscriptionId?: string | null;
149
149
  stateSynchroBankAccount?: number | null;
150
150
  noShowPopUpSynchroDate?: Date | null;
package/ts/types/index.ts CHANGED
@@ -61,6 +61,7 @@ export * from './Interface/models/ICycle';
61
61
  export * from './Interface/models/IDay';
62
62
  export * from './Interface/models/IDetailedLogBi';
63
63
  export * from './Interface/models/IDirectDebitHistory';
64
+ export * from './Interface/models/IPaymentDirectDebitHistory';
64
65
  export * from './Interface/models/IEmployee';
65
66
  export * from './Interface/models/IEngagementOcrExtraction';
66
67
  export * from './Interface/models/IEstimateInvoiceRepeat';