@silexpert/core 1.2.80 → 1.2.82
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.
- package/dist/cjs/api/resources/Reminder.d.ts +17 -2
- package/dist/cjs/api/resources/Reminder.d.ts.map +1 -1
- package/dist/cjs/api/resources/Reminder.js +31 -2
- package/dist/cjs/api/resources/Reminder.js.map +1 -1
- package/dist/cjs/types/Enum/AppointmentState.d.ts +6 -1
- package/dist/cjs/types/Enum/AppointmentState.d.ts.map +1 -1
- package/dist/cjs/types/Enum/AppointmentState.js +5 -0
- package/dist/cjs/types/Enum/AppointmentState.js.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.js +5 -36
- package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/cjs/types/Enum/IncomeStatement.js +1 -1
- package/dist/cjs/types/Enum/IncomeStatement.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +17 -7
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js +66 -11
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts +7 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Update.js +36 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts +3 -0
- package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts +3 -0
- package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
- package/dist/cjs/types/Interface/models/IReminder.d.ts +18 -0
- package/dist/cjs/types/Interface/models/IReminder.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IReminder.js +3 -0
- package/dist/cjs/types/Interface/models/IReminder.js.map +1 -0
- package/dist/cjs/types/Interface/models/IReminderAttachment.d.ts +12 -0
- package/dist/cjs/types/Interface/models/IReminderAttachment.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IReminderAttachment.js +3 -0
- package/dist/cjs/types/Interface/models/IReminderAttachment.js.map +1 -0
- package/dist/cjs/types/Interface/models/IScheduledReminder.d.ts +8 -0
- package/dist/cjs/types/Interface/models/IScheduledReminder.d.ts.map +1 -0
- package/dist/cjs/types/Interface/models/IScheduledReminder.js +3 -0
- package/dist/cjs/types/Interface/models/IScheduledReminder.js.map +1 -0
- package/dist/cjs/types/Interface/models/ISocietyGescom.d.ts +3 -3
- package/dist/cjs/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/ISocietyGescom.js.map +1 -1
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +21 -16
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js +15 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
- package/dist/mjs/api/resources/Reminder.d.ts +17 -2
- package/dist/mjs/api/resources/Reminder.d.ts.map +1 -1
- package/dist/mjs/api/resources/Reminder.js +31 -2
- package/dist/mjs/api/resources/Reminder.js.map +1 -1
- package/dist/mjs/types/Enum/AppointmentState.d.ts +6 -1
- package/dist/mjs/types/Enum/AppointmentState.d.ts.map +1 -1
- package/dist/mjs/types/Enum/AppointmentState.js +5 -0
- package/dist/mjs/types/Enum/AppointmentState.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.js +5 -36
- package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/mjs/types/Enum/IncomeStatement.js +1 -1
- package/dist/mjs/types/Enum/IncomeStatement.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +17 -7
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js +73 -14
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts +7 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Update.js +40 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts +3 -0
- package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts +3 -0
- package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
- package/dist/mjs/types/Interface/models/IReminder.d.ts +18 -0
- package/dist/mjs/types/Interface/models/IReminder.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IReminder.js +2 -0
- package/dist/mjs/types/Interface/models/IReminder.js.map +1 -0
- package/dist/mjs/types/Interface/models/IReminderAttachment.d.ts +12 -0
- package/dist/mjs/types/Interface/models/IReminderAttachment.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IReminderAttachment.js +2 -0
- package/dist/mjs/types/Interface/models/IReminderAttachment.js.map +1 -0
- package/dist/mjs/types/Interface/models/IScheduledReminder.d.ts +8 -0
- package/dist/mjs/types/Interface/models/IScheduledReminder.d.ts.map +1 -0
- package/dist/mjs/types/Interface/models/IScheduledReminder.js +2 -0
- package/dist/mjs/types/Interface/models/IScheduledReminder.js.map +1 -0
- package/dist/mjs/types/Interface/models/ISocietyGescom.d.ts +3 -3
- package/dist/mjs/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/ISocietyGescom.js.map +1 -1
- package/dist/mjs/types/index.d.ts +3 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +3 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +10 -5
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js +15 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Reminder.ts +51 -5
- package/ts/types/Enum/AppointmentState.ts +5 -0
- package/ts/types/Enum/CommercialManagement.ts +10 -36
- package/ts/types/Enum/IncomeStatement.ts +1 -1
- package/ts/types/Interface/api/commercialManagement/Create.ts +55 -12
- package/ts/types/Interface/api/commercialManagement/Update.ts +30 -0
- package/ts/types/Interface/models/IEstimateInvoice.ts +3 -0
- package/ts/types/Interface/models/IInvoiceReminder.ts +3 -0
- package/ts/types/Interface/models/IReminder.ts +20 -0
- package/ts/types/Interface/models/IReminderAttachment.ts +14 -0
- package/ts/types/Interface/models/IScheduledReminder.ts +7 -0
- package/ts/types/Interface/models/ISocietyGescom.ts +3 -3
- package/ts/types/index.ts +3 -0
- package/ts/utils/commercialManagement/document.ts +11 -5
- package/ts/utils/commercialManagement/internationalization/choices.ts +17 -2
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
IsNumber,
|
|
9
9
|
IsOptional,
|
|
10
10
|
IsString,
|
|
11
|
+
Length,
|
|
11
12
|
} from 'class-validator';
|
|
12
13
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
13
14
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
@@ -144,3 +145,32 @@ export class UpdateRecurrence {
|
|
|
144
145
|
@IsOptional()
|
|
145
146
|
idSaleEmail?: number;
|
|
146
147
|
}
|
|
148
|
+
|
|
149
|
+
export class UpdateReminder2 {
|
|
150
|
+
@ApiPropertyOptional()
|
|
151
|
+
@IsString()
|
|
152
|
+
@Length(0, 255)
|
|
153
|
+
@IsOptional()
|
|
154
|
+
email: string | null;
|
|
155
|
+
|
|
156
|
+
@ApiPropertyOptional()
|
|
157
|
+
@IsString()
|
|
158
|
+
@IsOptional()
|
|
159
|
+
content: string | null;
|
|
160
|
+
|
|
161
|
+
@ApiPropertyOptional()
|
|
162
|
+
@IsString()
|
|
163
|
+
@Length(0, 255)
|
|
164
|
+
@IsOptional()
|
|
165
|
+
subject: string | null;
|
|
166
|
+
|
|
167
|
+
@ApiPropertyOptional()
|
|
168
|
+
@IsInt()
|
|
169
|
+
@IsOptional()
|
|
170
|
+
idEstimateInvoice: number | null;
|
|
171
|
+
|
|
172
|
+
@ApiPropertyOptional()
|
|
173
|
+
@IsInt()
|
|
174
|
+
@IsOptional()
|
|
175
|
+
idSaleEmail: number | null;
|
|
176
|
+
}
|
|
@@ -9,6 +9,7 @@ import { IFile } from './IFile';
|
|
|
9
9
|
import { IInvoiceRecurrence } from './IInvoiceRecurrence';
|
|
10
10
|
import { ReadEstimateInvoiceStatus } from '../api/commercialManagement/Read';
|
|
11
11
|
import { AccountingCategoryId, InvoiceLanguage } from '../../Enum/CommercialManagement';
|
|
12
|
+
import { IReminder } from './IReminder';
|
|
12
13
|
|
|
13
14
|
// estimatesInvoices
|
|
14
15
|
export interface IEstimateInvoice {
|
|
@@ -66,7 +67,9 @@ export interface IEstimateInvoice {
|
|
|
66
67
|
assetRelatedToThisEstimateInvoice?: IEstimateInvoice;
|
|
67
68
|
estimateInvoiceForThisAsset?: IEstimateInvoice;
|
|
68
69
|
estimateInvoiceForThisRepeat?: IEstimateInvoice;
|
|
70
|
+
/** @deprecated use reminder2 */
|
|
69
71
|
reminder?: IInvoiceReminder;
|
|
72
|
+
reminder2?: IReminder | null;
|
|
70
73
|
relatedInvoice?: IEstimateInvoice;
|
|
71
74
|
recurrence?: IInvoiceRecurrence;
|
|
72
75
|
file?: IFile;
|
|
@@ -3,6 +3,9 @@ import { IEstimateInvoice } from './IEstimateInvoice';
|
|
|
3
3
|
import { IInvoiceReminderAttachment } from './IInvoiceReminderAttachment';
|
|
4
4
|
|
|
5
5
|
// societyRelance
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated use IReminder
|
|
8
|
+
*/
|
|
6
9
|
export interface IInvoiceReminder {
|
|
7
10
|
id?: number;
|
|
8
11
|
beforeThree: boolean | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IReminderAttachment } from './IReminderAttachment';
|
|
2
|
+
import { IScheduledReminder } from './IScheduledReminder';
|
|
3
|
+
import { ISociety } from './ISociety';
|
|
4
|
+
|
|
5
|
+
export interface IReminder {
|
|
6
|
+
id?: number;
|
|
7
|
+
email: string | null;
|
|
8
|
+
subject: string | null;
|
|
9
|
+
content: string | null;
|
|
10
|
+
idSaleEmail: number | null;
|
|
11
|
+
idEstimateInvoice: number | null;
|
|
12
|
+
idSociety: number;
|
|
13
|
+
|
|
14
|
+
attachments?: IReminderAttachment[];
|
|
15
|
+
schedules?: IScheduledReminder[];
|
|
16
|
+
society?: ISociety;
|
|
17
|
+
|
|
18
|
+
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IFile } from './IFile';
|
|
2
|
+
import { IReminder } from './IReminder';
|
|
3
|
+
|
|
4
|
+
export interface IReminderAttachment {
|
|
5
|
+
id?: number;
|
|
6
|
+
idFile: number;
|
|
7
|
+
idReminder: number;
|
|
8
|
+
|
|
9
|
+
file?: IFile;
|
|
10
|
+
reminder?: IReminder;
|
|
11
|
+
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccountingCategoryId, FontIds, LogoAlignment } from '../../Enum/CommercialManagement';
|
|
2
2
|
import { IFile } from './IFile';
|
|
3
|
-
import {
|
|
3
|
+
import { IReminder } from './IReminder';
|
|
4
4
|
|
|
5
5
|
// societyGescom
|
|
6
6
|
export interface ISocietyGescom {
|
|
@@ -65,12 +65,12 @@ export interface ISocietyGescom {
|
|
|
65
65
|
externalBorderColor?: string | null;
|
|
66
66
|
reminderCustomizedDayDiff?: number | null;
|
|
67
67
|
idRibFile?: number | null;
|
|
68
|
+
idReminder?: number | null;
|
|
68
69
|
idSignatureFile?: number | null;
|
|
69
70
|
idGeneralConditionOfSale?: number | null;
|
|
70
|
-
idReminderSaleEmail?: number | null;
|
|
71
71
|
ribFile?: IFile;
|
|
72
72
|
signatureFile?: IFile;
|
|
73
|
-
|
|
73
|
+
reminder?: IReminder | null;
|
|
74
74
|
createdAt?: Date | null;
|
|
75
75
|
updatedAt?: Date | null;
|
|
76
76
|
}
|
package/ts/types/index.ts
CHANGED
|
@@ -343,6 +343,9 @@ export * from './Interface/models/ISaleEmail';
|
|
|
343
343
|
export * from './Interface/models/IGeneralConditionOfSale';
|
|
344
344
|
export * from './Interface/models/ISaleDocumentTemplate';
|
|
345
345
|
export * from './Interface/models/IInvoiceReminderAttachment';
|
|
346
|
+
export * from './Interface/models/IReminder';
|
|
347
|
+
export * from './Interface/models/IScheduledReminder';
|
|
348
|
+
export * from './Interface/models/IReminderAttachment';
|
|
346
349
|
|
|
347
350
|
// Schemas
|
|
348
351
|
export * from './Interface/schemas/IRegistrationDetail';
|
|
@@ -71,6 +71,8 @@ export function generateCommercialDocument(
|
|
|
71
71
|
const locale = payload.language ?? InvoiceLanguage.FR;
|
|
72
72
|
const languageOption = internationalizationChoices[locale];
|
|
73
73
|
|
|
74
|
+
const accountingCategory = AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null;
|
|
75
|
+
|
|
74
76
|
const data: ReadDocumentEditing & { brandColors: brandColorType; brandName: string; shouldHideBrandName: boolean } = {
|
|
75
77
|
...payload,
|
|
76
78
|
thirdParty,
|
|
@@ -78,15 +80,17 @@ export function generateCommercialDocument(
|
|
|
78
80
|
idEstimateInvoiceType,
|
|
79
81
|
title: payload.title ?? null,
|
|
80
82
|
penalties: payload.penalties
|
|
81
|
-
? (internationalizationConsistency(locale, payload.penalties, 'penalties') ??
|
|
83
|
+
? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? payload.penalties)
|
|
82
84
|
: null,
|
|
83
85
|
termsOfPayment: payload.termsOfPayment
|
|
84
|
-
? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ??
|
|
86
|
+
? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? payload.termsOfPayment)
|
|
85
87
|
: null,
|
|
86
88
|
compensation: payload.compensation
|
|
87
|
-
? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ??
|
|
89
|
+
? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? payload.compensation)
|
|
90
|
+
: null,
|
|
91
|
+
discount: payload.discount
|
|
92
|
+
? (internationalizationConsistency(locale, payload.discount, 'discount') ?? payload.discount)
|
|
88
93
|
: null,
|
|
89
|
-
discount: payload.discount ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? null) : null,
|
|
90
94
|
vatMention: payload.vatMention
|
|
91
95
|
? (internationalizationConsistency(locale, payload.vatMention, 'vatMention') ?? null)
|
|
92
96
|
: null,
|
|
@@ -123,7 +127,9 @@ export function generateCommercialDocument(
|
|
|
123
127
|
shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),
|
|
124
128
|
// @ts-ignore
|
|
125
129
|
marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),
|
|
126
|
-
accountingCategoryFormatted:
|
|
130
|
+
accountingCategoryFormatted: accountingCategory
|
|
131
|
+
? (internationalizationConsistency(locale, accountingCategory, 'accountingCategory') ?? null)
|
|
132
|
+
: null,
|
|
127
133
|
// @ts-ignore
|
|
128
134
|
brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,
|
|
129
135
|
brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,
|
|
@@ -7,7 +7,8 @@ type InternationalizationConsistencyKey =
|
|
|
7
7
|
| 'vatMention'
|
|
8
8
|
| 'recoveryCost'
|
|
9
9
|
| 'paymentType'
|
|
10
|
-
| 'termsOfPayment'
|
|
10
|
+
| 'termsOfPayment'
|
|
11
|
+
| 'accountingCategory';
|
|
11
12
|
|
|
12
13
|
export const internationalizationChoices: InternationalizationChoicesType = {
|
|
13
14
|
fr: {
|
|
@@ -249,7 +250,7 @@ export const internationalizationChoices: InternationalizationChoicesType = {
|
|
|
249
250
|
accountingCategory: {
|
|
250
251
|
title: 'Transaction type',
|
|
251
252
|
choices: [
|
|
252
|
-
{ id: AccountingCategoryId.DELIVERY_OF_GOOD, label: '
|
|
253
|
+
{ id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Supply of goods' },
|
|
253
254
|
{ id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services provision' },
|
|
254
255
|
{ id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services provision and supply of goods' },
|
|
255
256
|
],
|
|
@@ -493,6 +494,20 @@ const internationalizationMatching: { [key: string]: { fr: string; en: string }[
|
|
|
493
494
|
en: '60 days upon receipt of invoice',
|
|
494
495
|
},
|
|
495
496
|
],
|
|
497
|
+
accountingCategory: [
|
|
498
|
+
{
|
|
499
|
+
fr: 'Livraison de biens',
|
|
500
|
+
en: 'Supply of goods',
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
fr: 'Prestation de services',
|
|
504
|
+
en: 'Services provision',
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
fr: 'Prestation de services et livraison de biens',
|
|
508
|
+
en: 'Services provision and supply of goods',
|
|
509
|
+
},
|
|
510
|
+
],
|
|
496
511
|
};
|
|
497
512
|
|
|
498
513
|
export const internationalizationConsistency = (
|