@silexpert/core 1.2.31 → 1.2.32

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 (112) hide show
  1. package/dist/cjs/api/resources/CalendarEvent.d.ts +1 -1
  2. package/dist/cjs/api/resources/CalendarEvent.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/CalendarEvent.js +2 -2
  4. package/dist/cjs/api/resources/CalendarEvent.js.map +1 -1
  5. package/dist/cjs/api/resources/PaymentExpectation.d.ts +4 -1
  6. package/dist/cjs/api/resources/PaymentExpectation.d.ts.map +1 -1
  7. package/dist/cjs/api/resources/PaymentExpectation.js +9 -0
  8. package/dist/cjs/api/resources/PaymentExpectation.js.map +1 -1
  9. package/dist/cjs/types/Enum/ReasonCancelSignatureRequest.d.ts +6 -0
  10. package/dist/cjs/types/Enum/ReasonCancelSignatureRequest.d.ts.map +1 -0
  11. package/dist/cjs/types/Enum/ReasonCancelSignatureRequest.js +11 -0
  12. package/dist/cjs/types/Enum/ReasonCancelSignatureRequest.js.map +1 -0
  13. package/dist/cjs/types/Interface/api/brevo/BrevoElement.d.ts +0 -3
  14. package/dist/cjs/types/Interface/api/brevo/BrevoElement.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/brevo/BrevoElement.js +1 -9
  16. package/dist/cjs/types/Interface/api/brevo/BrevoElement.js.map +1 -1
  17. package/dist/cjs/types/Interface/api/brevo/Read.d.ts +10 -0
  18. package/dist/cjs/types/Interface/api/brevo/Read.d.ts.map +1 -0
  19. package/dist/cjs/types/Interface/api/brevo/Read.js +3 -0
  20. package/dist/cjs/types/Interface/api/brevo/Read.js.map +1 -0
  21. package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +14 -0
  22. package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  23. package/dist/cjs/types/Interface/api/commercialManagement/Create.js +64 -1
  24. package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
  25. package/dist/cjs/types/Interface/api/customerSignature/Query.d.ts +3 -0
  26. package/dist/cjs/types/Interface/api/customerSignature/Query.d.ts.map +1 -1
  27. package/dist/cjs/types/Interface/api/customerSignature/Query.js +4 -0
  28. package/dist/cjs/types/Interface/api/customerSignature/Query.js.map +1 -1
  29. package/dist/cjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.d.ts +7 -0
  30. package/dist/cjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.d.ts.map +1 -1
  31. package/dist/cjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.js +27 -1
  32. package/dist/cjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.js.map +1 -1
  33. package/dist/cjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts +1 -0
  34. package/dist/cjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts.map +1 -1
  35. package/dist/cjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.js +6 -0
  36. package/dist/cjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.js.map +1 -1
  37. package/dist/cjs/types/Interface/models/IPaymentExpectation.d.ts +2 -0
  38. package/dist/cjs/types/Interface/models/IPaymentExpectation.d.ts.map +1 -1
  39. package/dist/cjs/types/Interface/models/IPaymentExpectation.js.map +1 -1
  40. package/dist/cjs/types/Interface/models/ISaleDocumentTemplate.d.ts +16 -0
  41. package/dist/cjs/types/Interface/models/ISaleDocumentTemplate.d.ts.map +1 -0
  42. package/dist/cjs/types/Interface/models/ISaleDocumentTemplate.js +3 -0
  43. package/dist/cjs/types/Interface/models/ISaleDocumentTemplate.js.map +1 -0
  44. package/dist/cjs/types/index.d.ts +3 -0
  45. package/dist/cjs/types/index.d.ts.map +1 -1
  46. package/dist/cjs/types/index.js +3 -0
  47. package/dist/cjs/types/index.js.map +1 -1
  48. package/dist/cjs/utils/commercialManagement/saleEmail.js +1 -1
  49. package/dist/cjs/utils/commercialManagement/saleEmail.js.map +1 -1
  50. package/dist/mjs/api/resources/CalendarEvent.d.ts +1 -1
  51. package/dist/mjs/api/resources/CalendarEvent.d.ts.map +1 -1
  52. package/dist/mjs/api/resources/CalendarEvent.js +2 -2
  53. package/dist/mjs/api/resources/CalendarEvent.js.map +1 -1
  54. package/dist/mjs/api/resources/PaymentExpectation.d.ts +4 -1
  55. package/dist/mjs/api/resources/PaymentExpectation.d.ts.map +1 -1
  56. package/dist/mjs/api/resources/PaymentExpectation.js +9 -0
  57. package/dist/mjs/api/resources/PaymentExpectation.js.map +1 -1
  58. package/dist/mjs/types/Enum/ReasonCancelSignatureRequest.d.ts +6 -0
  59. package/dist/mjs/types/Enum/ReasonCancelSignatureRequest.d.ts.map +1 -0
  60. package/dist/mjs/types/Enum/ReasonCancelSignatureRequest.js +8 -0
  61. package/dist/mjs/types/Enum/ReasonCancelSignatureRequest.js.map +1 -0
  62. package/dist/mjs/types/Interface/api/brevo/BrevoElement.d.ts +0 -3
  63. package/dist/mjs/types/Interface/api/brevo/BrevoElement.d.ts.map +1 -1
  64. package/dist/mjs/types/Interface/api/brevo/BrevoElement.js +0 -8
  65. package/dist/mjs/types/Interface/api/brevo/BrevoElement.js.map +1 -1
  66. package/dist/mjs/types/Interface/api/brevo/Read.d.ts +10 -0
  67. package/dist/mjs/types/Interface/api/brevo/Read.d.ts.map +1 -0
  68. package/dist/mjs/types/Interface/api/brevo/Read.js +2 -0
  69. package/dist/mjs/types/Interface/api/brevo/Read.js.map +1 -0
  70. package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +14 -0
  71. package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  72. package/dist/mjs/types/Interface/api/commercialManagement/Create.js +73 -2
  73. package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
  74. package/dist/mjs/types/Interface/api/customerSignature/Query.d.ts +3 -0
  75. package/dist/mjs/types/Interface/api/customerSignature/Query.d.ts.map +1 -1
  76. package/dist/mjs/types/Interface/api/customerSignature/Query.js +5 -0
  77. package/dist/mjs/types/Interface/api/customerSignature/Query.js.map +1 -1
  78. package/dist/mjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.d.ts +7 -0
  79. package/dist/mjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.d.ts.map +1 -1
  80. package/dist/mjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.js +31 -2
  81. package/dist/mjs/types/Interface/api/paymentExpectation/QueryPaymentExpectation.js.map +1 -1
  82. package/dist/mjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts +1 -0
  83. package/dist/mjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.d.ts.map +1 -1
  84. package/dist/mjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.js +9 -1
  85. package/dist/mjs/types/Interface/api/vatDeclaration/QueryVatDeclaration.js.map +1 -1
  86. package/dist/mjs/types/Interface/models/IPaymentExpectation.d.ts +2 -0
  87. package/dist/mjs/types/Interface/models/IPaymentExpectation.d.ts.map +1 -1
  88. package/dist/mjs/types/Interface/models/IPaymentExpectation.js.map +1 -1
  89. package/dist/mjs/types/Interface/models/ISaleDocumentTemplate.d.ts +16 -0
  90. package/dist/mjs/types/Interface/models/ISaleDocumentTemplate.d.ts.map +1 -0
  91. package/dist/mjs/types/Interface/models/ISaleDocumentTemplate.js +2 -0
  92. package/dist/mjs/types/Interface/models/ISaleDocumentTemplate.js.map +1 -0
  93. package/dist/mjs/types/index.d.ts +3 -0
  94. package/dist/mjs/types/index.d.ts.map +1 -1
  95. package/dist/mjs/types/index.js +3 -0
  96. package/dist/mjs/types/index.js.map +1 -1
  97. package/dist/mjs/utils/commercialManagement/saleEmail.js +1 -1
  98. package/dist/mjs/utils/commercialManagement/saleEmail.js.map +1 -1
  99. package/package.json +1 -1
  100. package/ts/api/resources/CalendarEvent.ts +2 -2
  101. package/ts/api/resources/PaymentExpectation.ts +13 -1
  102. package/ts/types/Enum/ReasonCancelSignatureRequest.ts +5 -0
  103. package/ts/types/Interface/api/brevo/BrevoElement.ts +0 -6
  104. package/ts/types/Interface/api/brevo/Read.ts +10 -0
  105. package/ts/types/Interface/api/commercialManagement/Create.ts +52 -1
  106. package/ts/types/Interface/api/customerSignature/Query.ts +5 -0
  107. package/ts/types/Interface/api/paymentExpectation/QueryPaymentExpectation.ts +23 -2
  108. package/ts/types/Interface/api/vatDeclaration/QueryVatDeclaration.ts +7 -1
  109. package/ts/types/Interface/models/IPaymentExpectation.ts +2 -0
  110. package/ts/types/Interface/models/ISaleDocumentTemplate.ts +18 -0
  111. package/ts/types/index.ts +3 -0
  112. package/ts/utils/commercialManagement/saleEmail.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
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",
@@ -45,8 +45,8 @@ export class CalendarEvent extends Resource {
45
45
  });
46
46
  }
47
47
 
48
- compareCalendarCall(params: QueryCalendarEventCall): Promise<ReadCalendarEventCall> {
49
- return this.axios.$get('/calendar-events/compare-calendar-call', { params });
48
+ compareCalendarCall(params: QueryCalendarEventCall, signal?: AbortSignal): Promise<ReadCalendarEventCall> {
49
+ return this.axios.$get('/calendar-events/compare-calendar-call', { params, ...(signal ? { signal } : {}) });
50
50
  }
51
51
 
52
52
  update(id: number, payload: UpdateCalendarEvent): Promise<ICalendarEvent> {
@@ -1,4 +1,4 @@
1
- import { CreatePaymentExpecation, IPaymentExpectation, QueryGetPaymentExpectation } from '../../types';
1
+ import { BasePaginate, CreatePaymentExpecation, IPaymentExpectation, QueryGetPaymentExpectation, QueryGetPaymentExpectationPaginated } from '../../types';
2
2
  import { Resource } from '../Resource';
3
3
 
4
4
  export class PaymentExpectation extends Resource {
@@ -6,10 +6,22 @@ export class PaymentExpectation extends Resource {
6
6
  return this.axios.$get('/payment-expectations', { params });
7
7
  }
8
8
 
9
+ getPaginate(params: QueryGetPaymentExpectationPaginated, signal?: AbortSignal): Promise<BasePaginate<IPaymentExpectation>> {
10
+ return this.axios.$get('/payment-expectations/paginate', { params, ...(signal ? { signal } : {}) });
11
+ }
12
+
9
13
  create(idSociety: number, payload: CreatePaymentExpecation): Promise<IPaymentExpectation> {
10
14
  return this.axios.$post(`/societies/${idSociety}/payment-expectations`, payload);
11
15
  }
12
16
 
17
+ update(id: number, payload: Partial<IPaymentExpectation>): Promise<IPaymentExpectation> {
18
+ return this.axios.$patch(`/payment-expectations/${id}`, payload);
19
+ }
20
+
21
+ delete(id: number): Promise<boolean> {
22
+ return this.axios.$delete(`/payment-expectations/${id}`);
23
+ }
24
+
13
25
  /**
14
26
  * Update only one paymentExpectation, linked to prestation
15
27
  * @param idPrestation
@@ -0,0 +1,5 @@
1
+ export enum ReasonCancelSignatureRequest {
2
+ CONTRACTUALIZATION_ABORTED = 'contractualization_aborted',
3
+ ERRORS_IN_DOCUMENT = 'errors_in_document',
4
+ OTHER = 'other'
5
+ };
@@ -35,12 +35,6 @@ export class CreateContact {
35
35
 
36
36
  }
37
37
 
38
- export class ReadContact {
39
- @ApiProperty()
40
- @IsNumber()
41
- id: number;
42
- }
43
-
44
38
  export class ChangeContact {
45
39
  @ApiProperty()
46
40
  @IsString({ each: true })
@@ -0,0 +1,10 @@
1
+ export type ReadContact = {
2
+ id: number,
3
+ }
4
+
5
+ export type ReadContactChange = {
6
+ contacts: {
7
+ success: string[],
8
+ failure: string[],
9
+ };
10
+ }
@@ -1,5 +1,5 @@
1
1
  import {
2
- IsArray, IsBoolean, IsDateString, IsEnum, IsInt, IsNumber, IsOptional, IsString, Min,
2
+ IsArray, IsBoolean, IsDateString, IsEnum, IsIn, IsInt, IsNumber, IsObject, IsOptional, IsString, Min,
3
3
  } from 'class-validator';
4
4
  import { IFile, ReadProductEditing } from '../../..';
5
5
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
@@ -641,4 +641,55 @@ export class UpdateGeneralConditionOfSale {
641
641
  @IsBoolean()
642
642
  @ToBoolean()
643
643
  isDefault?: boolean;
644
+ }
645
+
646
+ export class CreateSaleDocumentTemplate {
647
+ @ApiProperty()
648
+ @IsIn(Object.values(InvoiceLanguage))
649
+ language: InvoiceLanguage;
650
+
651
+ @ApiProperty()
652
+ @IsString()
653
+ name: string;
654
+
655
+ @ApiProperty()
656
+ @IsObject()
657
+ template: CreateInvoiceDocument | CreatePreSaleDocument;
658
+
659
+ @ApiProperty()
660
+ @IsEnum(EstimateInvoiceType)
661
+ idEstimateInvoiceType: EstimateInvoiceType;
662
+
663
+ @ApiProperty()
664
+ @IsBoolean()
665
+ @ToBoolean()
666
+ isDefault: boolean;
667
+ }
668
+
669
+ export class UpdateSaleDocumentTemplate {
670
+ @ApiPropertyOptional()
671
+ @IsOptional()
672
+ @IsIn(Object.values(InvoiceLanguage))
673
+ language?: InvoiceLanguage;
674
+
675
+ @ApiPropertyOptional()
676
+ @IsOptional()
677
+ @IsString()
678
+ name?: string;
679
+
680
+ @ApiPropertyOptional()
681
+ @IsOptional()
682
+ @IsObject()
683
+ template?: CreateInvoiceDocument | CreatePreSaleDocument;
684
+
685
+ @ApiPropertyOptional()
686
+ @IsOptional()
687
+ @IsEnum(EstimateInvoiceType)
688
+ idEstimateInvoiceType?: number;
689
+
690
+ @ApiPropertyOptional()
691
+ @IsOptional()
692
+ @IsBoolean()
693
+ @ToBoolean()
694
+ isDefault?: boolean;
644
695
  }
@@ -1,5 +1,7 @@
1
1
  import { IsDate, IsInt, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiPropertyOptional } from '../../../../utils';
3
+ import { WhereOptions } from 'sequelize';
4
+ import { ICustomerSignature } from '../../models/ICustomerSignature';
3
5
 
4
6
  export class QueryCustomerSignature {
5
7
  @ApiPropertyOptional()
@@ -86,4 +88,7 @@ export class QueryCustomerSignature {
86
88
  @IsOptional()
87
89
  @IsString({ each: true })
88
90
  includes?: string[];
91
+
92
+ @ApiPropertyOptional()
93
+ where?: WhereOptions<ICustomerSignature>;
89
94
  }
@@ -1,8 +1,29 @@
1
- import { IsInt } from 'class-validator';
2
- import { ApiProperty } from '../../../../utils';
1
+ import { IsDate, IsInt, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+ import { RequiredQueryPaginate } from '../BasePaginate';
3
4
 
4
5
  export class QueryGetPaymentExpectation {
5
6
  @ApiProperty()
6
7
  @IsInt()
7
8
  idPrestation: number;
9
+ }
10
+
11
+ export class QueryGetPaymentExpectationPaginated extends RequiredQueryPaginate {
12
+ @ApiPropertyOptional()
13
+ @IsString()
14
+ @IsOptional()
15
+ search?: string;
16
+
17
+ @ApiPropertyOptional()
18
+ @IsString()
19
+ @IsOptional()
20
+ searchAmount?: string;
21
+
22
+ @ApiProperty()
23
+ @IsDate()
24
+ startDate: Date;
25
+
26
+ @ApiProperty()
27
+ @IsDate()
28
+ endDate: Date;
8
29
  }
@@ -1,5 +1,5 @@
1
1
  import {
2
- IsDate, IsDateString, IsEnum, IsNumber, IsOptional, IsString,
2
+ IsDate, IsDateString, IsEnum, IsIn, IsNumber, IsOptional, IsString,
3
3
  } from 'class-validator';
4
4
  import { CerfaType } from '../../../Enum/CerfaType';
5
5
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils/decorators';
@@ -54,4 +54,10 @@ export class QueryVatEntry {
54
54
  @IsString()
55
55
  @IsOptional()
56
56
  type?: 'collected' | 'deductible';
57
+
58
+ // TODO: Passer le paramètre en requis une fois le front mis à jour
59
+ @ApiPropertyOptional()
60
+ @IsIn(Object.values(CerfaType))
61
+ @IsOptional()
62
+ idCerfaType?: CerfaType;
57
63
  }
@@ -15,6 +15,8 @@ export interface IPaymentExpectation {
15
15
  idSociety: number;
16
16
  idRegulation: number | null;
17
17
  idPrestation: number | null;
18
+ idUserNotifyPaiementProceed?: number | null;
19
+ idUserTaskPaiementProceed?: number | null;
18
20
  createdAt?: Date | null;
19
21
  updatedAt?: Date | null;
20
22
 
@@ -0,0 +1,18 @@
1
+ import { CreateInvoiceDocument, CreatePreSaleDocument, InvoiceLanguage } from '../..';
2
+ import { EstimateInvoiceType } from '../../Enum/EstimateInvoice';
3
+ import { ISociety } from './ISociety';
4
+
5
+ export interface ISaleDocumentTemplate {
6
+ id?: number;
7
+ name: string;
8
+ language: InvoiceLanguage;
9
+ template: CreateInvoiceDocument | CreatePreSaleDocument;
10
+ idEstimateInvoiceType: EstimateInvoiceType;
11
+ isDefault: boolean;
12
+ idSociety: number;
13
+ createdAt?: Date | null;
14
+ updatedAt?: Date | null;
15
+
16
+ // association
17
+ society?: ISociety
18
+ }
package/ts/types/index.ts CHANGED
@@ -340,6 +340,7 @@ export * from './Interface/models/IHumanResourceLibrary';
340
340
  export * from './Interface/models/IUserHumanResourceLibrary';
341
341
  export * from './Interface/models/ISaleEmail';
342
342
  export * from './Interface/models/IGeneralConditionOfSale';
343
+ export * from './Interface/models/ISaleDocumentTemplate';
343
344
 
344
345
 
345
346
  // Schemas
@@ -562,6 +563,7 @@ export * from './Enum/PaymentRecovery';
562
563
  export * from './Enum/JuridicalSociety';
563
564
  export * from './Enum/Pdf2PicLocalType';
564
565
  export * from './Enum/DocumentForHumanResourceType';
566
+ export * from './Enum/ReasonCancelSignatureRequest';
565
567
 
566
568
  // Interfaces API
567
569
  export * from './Interface/api/exercice/ReadExercice';
@@ -1098,6 +1100,7 @@ export * from './Interface/api/userRoomEquipment/CreateSignature';
1098
1100
  export * from './Interface/api/paymentExpectation/CreatePaymentExpecation';
1099
1101
  export * from './Interface/api/expertAnnuary/Query';
1100
1102
  export * from './Interface/api/brevo/BrevoElement';
1103
+ export * from './Interface/api/brevo/Read';
1101
1104
  export * from './Interface/api/bankAccount/Create';
1102
1105
  export * from './Interface/api/echo/Mission';
1103
1106
  export * from './Interface/api/echo/CreateOrder';
@@ -13,9 +13,9 @@ export function transformModelWithCharcodeToString(datas: InfoToUseType, templat
13
13
  // this regex match the carac with []
14
14
  const reg = /\[(.*?)\]/g;
15
15
 
16
- const charcodesFound = template.match(reg) ?? [];
16
+ const charcodesFound: RegExpMatchArray | [] = template.match(reg) ?? [];
17
17
  const charcodesFoundWithoutBrackets: string[] = [];
18
- charcodesFound?.forEach((f: string) => charcodesFoundWithoutBrackets.push(f.replace(/[\[\]']+/g, '')));
18
+ charcodesFound.forEach((f) => charcodesFoundWithoutBrackets.push(f.replace(/[\[\]']+/g, '')));
19
19
 
20
20
  // we get the list of matching key template with key data
21
21
  const charcodesDetected = emailTemplateVariableAffiliatedData.filter((data) => intersection(emailTemplateVariableAffiliatedData.map((d) => d.name), charcodesFoundWithoutBrackets).includes(data.name));