@silexpert/core 1.0.11 → 1.0.14
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/es/api/resources/{commercialDocument.d.ts → CommercialDocument.d.ts} +2 -1
- package/es/api/resources/{commercialDocument.d.ts.map → CommercialDocument.d.ts.map} +1 -1
- package/es/api/resources/{commercialDocument.js → CommercialDocument.js} +4 -1
- package/es/api/resources/CommercialDocument.js.map +1 -0
- package/es/api/resources/Exercice.d.ts +1 -0
- package/es/api/resources/Exercice.d.ts.map +1 -1
- package/es/api/resources/Exercice.js +3 -0
- package/es/api/resources/Exercice.js.map +1 -1
- package/es/api/resources/Invoice.d.ts +1 -0
- package/es/api/resources/Invoice.d.ts.map +1 -1
- package/es/api/resources/Invoice.js +3 -0
- package/es/api/resources/Invoice.js.map +1 -1
- package/es/api/resources/Recurrence.d.ts +9 -0
- package/es/api/resources/Recurrence.d.ts.map +1 -0
- package/es/api/resources/Recurrence.js +13 -0
- package/es/api/resources/Recurrence.js.map +1 -0
- package/es/api/resources/{reminder.d.ts → Reminder.d.ts} +1 -1
- package/es/api/resources/{reminder.d.ts.map → Reminder.d.ts.map} +1 -1
- package/es/api/resources/{reminder.js → Reminder.js} +2 -2
- package/es/api/resources/{reminder.js.map → Reminder.js.map} +1 -1
- package/es/api/resources.d.ts +4 -2
- package/es/api/resources.d.ts.map +1 -1
- package/es/api/resources.js +4 -2
- package/es/api/resources.js.map +1 -1
- package/es/types/Enum/RecurrenceType.d.ts +11 -0
- package/es/types/Enum/RecurrenceType.d.ts.map +1 -0
- package/es/types/Enum/RecurrenceType.js +26 -0
- package/es/types/Enum/RecurrenceType.js.map +1 -0
- package/es/types/Enum/TaskResponseType.d.ts +10 -0
- package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/es/types/Enum/TaskResponseType.js +11 -0
- package/es/types/Enum/TaskResponseType.js.map +1 -1
- package/es/types/Interface/api/commercialManagement/Create.d.ts +25 -18
- package/es/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/es/types/Interface/api/commercialManagement/Create.js +65 -81
- package/es/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/es/types/Interface/api/commercialManagement/Update.d.ts +6 -0
- package/es/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
- package/es/types/Interface/api/commercialManagement/Update.js +29 -1
- package/es/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/es/types/Interface/api/revision/QueryRevision.d.ts +2 -0
- package/es/types/Interface/api/revision/QueryRevision.d.ts.map +1 -1
- package/es/types/Interface/api/revision/QueryRevision.js +16 -2
- package/es/types/Interface/api/revision/QueryRevision.js.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts +1 -1
- package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionAccount.js +11 -5
- package/es/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionPaginate.d.ts +2 -0
- package/es/types/Interface/api/revision/QueryRevisionPaginate.d.ts.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionPaginate.js +16 -2
- package/es/types/Interface/api/revision/QueryRevisionPaginate.js.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts +1 -1
- package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts.map +1 -1
- package/es/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
- package/es/types/Interface/api/task/QueryCountTask.d.ts +1 -1
- package/es/types/Interface/api/task/QueryCountTask.d.ts.map +1 -1
- package/es/types/Interface/api/task/QueryCountTask.js +1 -1
- package/es/types/Interface/api/task/QueryCountTask.js.map +1 -1
- package/es/types/Interface/api/task/QueryPaginatedTask.d.ts +2 -0
- package/es/types/Interface/api/task/QueryPaginatedTask.d.ts.map +1 -1
- package/es/types/Interface/api/task/QueryPaginatedTask.js +11 -0
- package/es/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
- package/es/types/Interface/models/IApiError.d.ts +2 -1
- package/es/types/Interface/models/IApiError.d.ts.map +1 -1
- package/es/types/Interface/models/IApiError.js +1 -0
- package/es/types/Interface/models/IApiError.js.map +1 -1
- package/es/types/Interface/models/IEstimateInvoice.d.ts +2 -0
- package/es/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/es/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/es/types/Interface/models/IInvoiceRecurrence.d.ts +15 -0
- package/es/types/Interface/models/IInvoiceRecurrence.d.ts.map +1 -0
- package/es/types/Interface/models/IInvoiceRecurrence.js +2 -0
- package/es/types/Interface/models/IInvoiceRecurrence.js.map +1 -0
- package/es/types/Interface/models/IInvoiceReminder.d.ts +1 -1
- package/es/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
- package/es/types/Interface/models/IInvoiceReminder.js.map +1 -1
- package/es/types/Interface/models/ITask.d.ts +2 -2
- package/es/types/Interface/models/ITask.d.ts.map +1 -1
- package/es/types/Interface/models/ITask.js.map +1 -1
- package/es/types/index.d.ts +2 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +2 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/commercialManagement/document.js +3 -3
- package/es/utils/commercialManagement/document.js.map +1 -1
- package/es/utils/commercialManagement/recurrence.d.ts +7 -0
- package/es/utils/commercialManagement/recurrence.d.ts.map +1 -0
- package/es/utils/commercialManagement/recurrence.js +31 -0
- package/es/utils/commercialManagement/recurrence.js.map +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/es/utils/task.d.ts +3 -1
- package/es/utils/task.d.ts.map +1 -1
- package/es/utils/task.js +8 -1
- package/es/utils/task.js.map +1 -1
- package/js/api/resources/{commercialDocument.js → CommercialDocument.js} +5 -1
- package/js/api/resources/CommercialDocument.js.map +1 -0
- package/js/api/resources/Exercice.js +4 -0
- package/js/api/resources/Exercice.js.map +1 -1
- package/js/api/resources/Invoice.js +4 -0
- package/js/api/resources/Invoice.js.map +1 -1
- package/js/api/resources/Recurrence.js +26 -0
- package/js/api/resources/Recurrence.js.map +1 -0
- package/js/api/resources/{reminder.js → Reminder.js} +2 -2
- package/js/api/resources/{reminder.js.map → Reminder.js.map} +1 -1
- package/js/api/resources.js +7 -4
- package/js/api/resources.js.map +1 -1
- package/js/types/Enum/RecurrenceType.js +28 -0
- package/js/types/Enum/RecurrenceType.js.map +1 -0
- package/js/types/Enum/TaskResponseType.js +14 -1
- package/js/types/Enum/TaskResponseType.js.map +1 -1
- package/js/types/Interface/api/commercialManagement/Create.js +47 -33
- package/js/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/js/types/Interface/api/commercialManagement/Update.js +15 -1
- package/js/types/Interface/api/commercialManagement/Update.js.map +1 -1
- package/js/types/Interface/api/revision/QueryRevision.js +6 -0
- package/js/types/Interface/api/revision/QueryRevision.js.map +1 -1
- package/js/types/Interface/api/revision/QueryRevisionAccount.js +7 -5
- package/js/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -1
- package/js/types/Interface/api/revision/QueryRevisionPaginate.js +6 -0
- package/js/types/Interface/api/revision/QueryRevisionPaginate.js.map +1 -1
- package/js/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
- package/js/types/Interface/api/task/QueryCountTask.js +1 -1
- package/js/types/Interface/api/task/QueryCountTask.js.map +1 -1
- package/js/types/Interface/api/task/QueryPaginatedTask.js +6 -0
- package/js/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
- package/js/types/Interface/models/IApiError.js +1 -0
- package/js/types/Interface/models/IApiError.js.map +1 -1
- package/js/types/Interface/models/IInvoiceRecurrence.js +6 -0
- package/js/types/Interface/models/IInvoiceRecurrence.js.map +1 -0
- package/js/types/index.js +24 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/commercialManagement/document.js +3 -3
- package/js/utils/commercialManagement/document.js.map +1 -1
- package/js/utils/commercialManagement/recurrence.js +47 -0
- package/js/utils/commercialManagement/recurrence.js.map +1 -0
- package/js/utils/index.js +12 -0
- package/js/utils/index.js.map +1 -1
- package/js/utils/task.js +14 -1
- package/js/utils/task.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/{commercialDocument.ts → CommercialDocument.ts} +4 -0
- package/ts/api/resources/Exercice.ts +4 -0
- package/ts/api/resources/Invoice.ts +4 -0
- package/ts/api/resources/Recurrence.ts +17 -0
- package/ts/api/resources/{reminder.ts → Reminder.ts} +1 -1
- package/ts/api/resources.ts +4 -2
- package/ts/types/Enum/RecurrenceType.ts +25 -0
- package/ts/types/Enum/TaskResponseType.ts +11 -0
- package/ts/types/Interface/api/commercialManagement/Create.ts +62 -81
- package/ts/types/Interface/api/commercialManagement/Update.ts +25 -1
- package/ts/types/Interface/api/revision/QueryRevision.ts +15 -2
- package/ts/types/Interface/api/revision/QueryRevisionAccount.ts +11 -4
- package/ts/types/Interface/api/revision/QueryRevisionPaginate.ts +15 -2
- package/ts/types/Interface/api/revision/QueryRevisionSearchEntries.ts +1 -1
- package/ts/types/Interface/api/task/QueryCountTask.ts +1 -1
- package/ts/types/Interface/api/task/QueryPaginatedTask.ts +9 -0
- package/ts/types/Interface/models/IApiError.ts +1 -0
- package/ts/types/Interface/models/IEstimateInvoice.ts +2 -0
- package/ts/types/Interface/models/IInvoiceRecurrence.ts +16 -0
- package/ts/types/Interface/models/IInvoiceReminder.ts +1 -1
- package/ts/types/Interface/models/ITask.ts +2 -2
- package/ts/types/index.ts +2 -0
- package/ts/utils/commercialManagement/document.ts +3 -3
- package/ts/utils/commercialManagement/recurrence.ts +39 -0
- package/ts/utils/index.ts +1 -0
- package/ts/utils/task.ts +9 -1
- package/es/api/resources/commercialDocument.js.map +0 -1
- package/js/api/resources/commercialDocument.js.map +0 -1
|
@@ -5,6 +5,10 @@ import { ApiPropertyOptional } from '../../../../utils';
|
|
|
5
5
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
6
6
|
|
|
7
7
|
export class QueryPaginatedTask {
|
|
8
|
+
@ApiPropertyOptional()
|
|
9
|
+
@IsOptional()
|
|
10
|
+
isIntern?: boolean;
|
|
11
|
+
|
|
8
12
|
@ApiPropertyOptional()
|
|
9
13
|
@IsOptional()
|
|
10
14
|
@IsInt()
|
|
@@ -36,6 +40,11 @@ export class QueryPaginatedTask {
|
|
|
36
40
|
@IsInt()
|
|
37
41
|
idUser?: number;
|
|
38
42
|
|
|
43
|
+
@ApiPropertyOptional({ description: 'roles for filter tasks' })
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsInt()
|
|
46
|
+
idService?: number;
|
|
47
|
+
|
|
39
48
|
@ApiPropertyOptional({ description: 'user who terminate the task' })
|
|
40
49
|
@IsOptional()
|
|
41
50
|
@IsInt()
|
|
@@ -7,6 +7,7 @@ import { IEstimateInvoiceType } from './IEstimateInvoiceType';
|
|
|
7
7
|
import { ISociety } from './ISociety';
|
|
8
8
|
import { IInvoiceReminder } from './IInvoiceReminder';
|
|
9
9
|
import { IFile } from './IFile';
|
|
10
|
+
import { IInvoiceRecurrence } from './IInvoiceRecurrence';
|
|
10
11
|
|
|
11
12
|
// estimatesInvoices
|
|
12
13
|
export interface IEstimateInvoice {
|
|
@@ -62,5 +63,6 @@ export interface IEstimateInvoice {
|
|
|
62
63
|
estimateInvoiceForThisRepeat?: IEstimateInvoice;
|
|
63
64
|
invoiceReminder?: IInvoiceReminder;
|
|
64
65
|
relatedInvoice?: IEstimateInvoice;
|
|
66
|
+
recurrence?: IInvoiceRecurrence;
|
|
65
67
|
file?: IFile;
|
|
66
68
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IEstimateInvoice } from '../..';
|
|
2
|
+
import { RecurrenceType } from '../../Enum/RecurrenceType';
|
|
3
|
+
|
|
4
|
+
export interface IInvoiceRecurrence {
|
|
5
|
+
id?: number;
|
|
6
|
+
type: RecurrenceType;
|
|
7
|
+
startDate: Date;
|
|
8
|
+
endDate: Date;
|
|
9
|
+
lastSend: Date | null;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
idEstimateInvoice: number;
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
|
|
15
|
+
estimateInvoice?: IEstimateInvoice;
|
|
16
|
+
}
|
|
@@ -16,7 +16,7 @@ export interface ITask {
|
|
|
16
16
|
idSociety: number,
|
|
17
17
|
description?: string | null,
|
|
18
18
|
idRole?: number,
|
|
19
|
-
|
|
19
|
+
idService?: number,
|
|
20
20
|
idMail?: number,
|
|
21
21
|
deadlineAt: Date,
|
|
22
22
|
idUserWhoProcessed?: number,
|
|
@@ -29,7 +29,7 @@ export interface ITask {
|
|
|
29
29
|
userWhoCreated?: IUser;
|
|
30
30
|
society?: ISociety;
|
|
31
31
|
role?: IRole;
|
|
32
|
-
|
|
32
|
+
service?: IRole;
|
|
33
33
|
userWhoProcessed?: IUser;
|
|
34
34
|
userWhoRefused?: IUser;
|
|
35
35
|
calendarEvent?: ICalendarEvent;
|
package/ts/types/index.ts
CHANGED
|
@@ -311,6 +311,7 @@ export * from './Interface/models/ITask';
|
|
|
311
311
|
export * from './Interface/models/IMobileNotificationLog';
|
|
312
312
|
export * from './Interface/models/IMobileNotificationSetting';
|
|
313
313
|
export * from './Interface/models/ITimeRecorder';
|
|
314
|
+
export * from './Interface/models/IInvoiceRecurrence';
|
|
314
315
|
export * from './Interface/models/ILoanFile';
|
|
315
316
|
export * from './Interface/models/ICommercialMail';
|
|
316
317
|
|
|
@@ -434,6 +435,7 @@ export * from './Enum/InternalService';
|
|
|
434
435
|
export * from './Enum/SocietyTypeEvent';
|
|
435
436
|
export * from './Enum/Call';
|
|
436
437
|
export * from './Enum/ConnectionError';
|
|
438
|
+
export * from './Enum/RecurrenceType';
|
|
437
439
|
|
|
438
440
|
// Interfaces API
|
|
439
441
|
export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
|
|
@@ -104,9 +104,9 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCom
|
|
|
104
104
|
const commonTemplate = new CommercialDocumentCommonHTML();
|
|
105
105
|
|
|
106
106
|
return {
|
|
107
|
-
header: ejs
|
|
108
|
-
body: ejs
|
|
109
|
-
footer: ejs
|
|
107
|
+
header: ejs?.render(commonTemplate.header, data),
|
|
108
|
+
body: ejs?.render(bodyTemplate, data),
|
|
109
|
+
footer: ejs?.render(commonTemplate.footer, { ...data, freeText: payload?.settings?.freeInvoiceText ?? null }),
|
|
110
110
|
data,
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as dayjs from 'dayjs';
|
|
2
|
+
import { OpUnitType } from 'dayjs';
|
|
3
|
+
import { RecurrenceType } from '../../types/Enum/RecurrenceType';
|
|
4
|
+
|
|
5
|
+
const isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
|
|
6
|
+
const quarterOfYear = require('dayjs/plugin/quarterOfYear');
|
|
7
|
+
|
|
8
|
+
dayjs.extend(quarterOfYear);
|
|
9
|
+
dayjs.extend(isSameOrBefore);
|
|
10
|
+
|
|
11
|
+
export function getAllRecurrences(params: {
|
|
12
|
+
startDate: string;
|
|
13
|
+
endDate: string | null;
|
|
14
|
+
type: RecurrenceType;
|
|
15
|
+
}): string[] {
|
|
16
|
+
const { startDate, type } = params;
|
|
17
|
+
const endDate = params.endDate ?? '2100-01-01';
|
|
18
|
+
|
|
19
|
+
let loop = 0;
|
|
20
|
+
|
|
21
|
+
let recurrency: OpUnitType = 'month';
|
|
22
|
+
|
|
23
|
+
if (type === RecurrenceType.MONHLY) recurrency = 'month';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
else if (type === RecurrenceType.QUATERLY) recurrency = 'quarter';
|
|
26
|
+
else if (type === RecurrenceType.WEEKLY) recurrency = 'week';
|
|
27
|
+
else if (type === RecurrenceType.YEARLY) recurrency = 'year';
|
|
28
|
+
|
|
29
|
+
const nextInvoices: string[] = [];
|
|
30
|
+
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
while (dayjs(startDate).add(loop, recurrency).isSameOrBefore(endDate)) {
|
|
33
|
+
const currentDate = dayjs(startDate).add(loop, recurrency);
|
|
34
|
+
nextInvoices.push(currentDate.format('YYYY-MM-DD'));
|
|
35
|
+
loop += 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return nextInvoices;
|
|
39
|
+
}
|
package/ts/utils/index.ts
CHANGED
package/ts/utils/task.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Role } from '../types/Enum/Role';
|
|
2
|
+
import { TaskResponseType, RoleAvailableForTask } from '../types/Enum/TaskResponseType';
|
|
2
3
|
|
|
3
4
|
const getIdRoleUsedForTask = (listRoles: number[]): number => {
|
|
4
5
|
let idRole = 0;
|
|
@@ -32,6 +33,13 @@ const getIdRoleUsedForManagerTask = (listRoles: number[]): number => {
|
|
|
32
33
|
return idRole;
|
|
33
34
|
};
|
|
34
35
|
|
|
36
|
+
const getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): number | undefined => {
|
|
37
|
+
const taskTypeList = isIntern ? TaskResponseType.INTERN.types : TaskResponseType.EXTERN.types;
|
|
38
|
+
return taskTypeList.find((taskType) => taskType.id === idTaskType)?.role;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const getIdRoleUsedForGetTaskOfUser = (idRole: number): boolean => !!Object.values(RoleAvailableForTask).find((role) => role === idRole);
|
|
42
|
+
|
|
35
43
|
export {
|
|
36
|
-
getIdRoleUsedForTask, getIdRoleUsedForManagerTask,
|
|
44
|
+
getIdRoleUsedForTask, getIdRoleUsedForManagerTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser,
|
|
37
45
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commercialDocument.js","sourceRoot":"","sources":["../../../ts/api/resources/commercialDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAIL,mBAAmB,GAQpB,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9C,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAAiC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,oCAAoC,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,gBAAgB,CAAC,MAA0B;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,YAAY,CAAC,MAA8C;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,cAAc,CAAC,OAA6D;QAC1E,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,kCAAO,OAAO,KAAE,qBAAqB,EAAE,mBAAmB,CAAC,KAAK,IAAG,CAAC;IAChI,CAAC;IAED,WAAW,CAAC,OAA6D;QACvE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,+BAA+B,kCAAO,OAAO,KAAE,qBAAqB,EAAE,mBAAmB,CAAC,GAAG,IAAG,CAAC;IAC3H,CAAC;IAED,cAAc,CAAC,EAAU,EAAE,OAA8B;QACvD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED,WAAW,CAAC,EAAU,EAAE,OAA8B;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,iCAAiC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,CAAC,qBAA0C,EAAE,OAAsD;QACxG,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,iCAAiC,kCAAO,OAAO,KAAE,qBAAqB,IAAG,CAAC;IACpG,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n BasePaginate,\n CreateInvoiceDocument,\n CreatePreSaleDocument,\n EstimateInvoiceType,\n IEstimateInvoice,\n IFile,\n QueryDocumentPaginated,\n QueryNextReference,\n QueryPaginate,\n ReadEstimateInvoice,\n UpdateCommercialDocument,\n} from '../../types';\n\nexport class CommercialDocument extends Resource {\n get(id: number): Promise<ReadEstimateInvoice> {\n return this.axios.$get(`/commercial-management/documents/${id}`);\n }\n\n update(id: number, payload: UpdateCommercialDocument): Promise<IEstimateInvoice> {\n return this.axios.patch(`/commercial-management/documents/${id}`, payload);\n }\n\n delete(id: number): Promise<true> {\n return this.axios.$delete(`/commercial-management/documents/${id}`);\n }\n\n getNextReference(params: QueryNextReference): Promise<string> {\n return this.axios.$get('/commercial-management/documents/references', { params });\n }\n\n getPaginated(params: QueryDocumentPaginated & QueryPaginate): Promise<BasePaginate<ReadEstimateInvoice>> {\n return this.axios.$get('/commercial-management/documents', { params });\n }\n\n createEstimate(payload: Omit<CreatePreSaleDocument, 'idEstimateInvoiceType'>): Promise<IEstimateInvoice> {\n return this.axios.$post('/commercial-management/estimates', { ...payload, idEstimateInvoiceType: EstimateInvoiceType.DEVIS });\n }\n\n createOrder(payload: Omit<CreatePreSaleDocument, 'idEstimateInvoiceType'>): Promise<IEstimateInvoice> {\n return this.axios.$post('/commercial-management/orders', { ...payload, idEstimateInvoiceType: EstimateInvoiceType.BON });\n }\n\n updateEstimate(id: number, payload: CreatePreSaleDocument): Promise<IEstimateInvoice> {\n return this.axios.$post(`/commercial-management/estimates/${id}`, payload);\n }\n\n updateOrder(id: number, payload: CreatePreSaleDocument): Promise<IEstimateInvoice> {\n return this.axios.$post(`/commercial-management/orders/${id}`, payload);\n }\n\n preview(idEstimateInvoiceType: EstimateInvoiceType, payload: CreatePreSaleDocument | CreateInvoiceDocument): Promise<IFile> {\n return this.axios.$post('/commercial-management/preview/', { ...payload, idEstimateInvoiceType });\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commercialDocument.js","mappings":";;;;;;;AAAA;;AACA;;AAcM,MAAOA,kBAAP,SAAkCC,kBAAlC,CAA0C;EAC9CC,GAAG,CAACC,EAAD,EAAW;IACZ,OAAO,KAAKC,KAAL,CAAWC,IAAX,CAAgB,oCAAoCF,EAAE,EAAtD,CAAP;EACD;;EAEDG,MAAM,CAACH,EAAD,EAAaI,OAAb,EAA8C;IAClD,OAAO,KAAKH,KAAL,CAAWI,KAAX,CAAiB,oCAAoCL,EAAE,EAAvD,EAA2DI,OAA3D,CAAP;EACD;;EAEDE,MAAM,CAACN,EAAD,EAAW;IACf,OAAO,KAAKC,KAAL,CAAWM,OAAX,CAAmB,oCAAoCP,EAAE,EAAzD,CAAP;EACD;;EAEDQ,gBAAgB,CAACC,MAAD,EAA2B;IACzC,OAAO,KAAKR,KAAL,CAAWC,IAAX,CAAgB,6CAAhB,EAA+D;MAAEO;IAAF,CAA/D,CAAP;EACD;;EAEDC,YAAY,CAACD,MAAD,EAA+C;IACzD,OAAO,KAAKR,KAAL,CAAWC,IAAX,CAAgB,kCAAhB,EAAoD;MAAEO;IAAF,CAApD,CAAP;EACD;;EAEDE,cAAc,CAACP,OAAD,EAA8D;IAC1E,OAAO,KAAKH,KAAL,CAAWW,KAAX,CAAiB,kCAAjB,EAAmDC,gCAAOT,OAAP,GAAc;MAAEU,qBAAqB,EAAEC,2BAAoBC;IAA7C,CAAd,CAAnD,CAAP;EACD;;EAEDC,WAAW,CAACb,OAAD,EAA8D;IACvE,OAAO,KAAKH,KAAL,CAAWW,KAAX,CAAiB,+BAAjB,EAAgDC,gCAAOT,OAAP,GAAc;MAAEU,qBAAqB,EAAEC,2BAAoBG;IAA7C,CAAd,CAAhD,CAAP;EACD;;EAEDC,cAAc,CAACnB,EAAD,EAAaI,OAAb,EAA2C;IACvD,OAAO,KAAKH,KAAL,CAAWW,KAAX,CAAiB,oCAAoCZ,EAAE,EAAvD,EAA2DI,OAA3D,CAAP;EACD;;EAEDgB,WAAW,CAACpB,EAAD,EAAaI,OAAb,EAA2C;IACpD,OAAO,KAAKH,KAAL,CAAWW,KAAX,CAAiB,iCAAiCZ,EAAE,EAApD,EAAwDI,OAAxD,CAAP;EACD;;EAEDiB,OAAO,CAACP,qBAAD,EAA6CV,OAA7C,EAAmG;IACxG,OAAO,KAAKH,KAAL,CAAWW,KAAX,CAAiB,iCAAjB,EAAkDC,gCAAOT,OAAP,GAAc;MAAEU;IAAF,CAAd,CAAlD,CAAP;EACD;;AAvC6C;;QAAnCjB,kB,GAAAA,kB","names":["CommercialDocument","Resource","get","id","axios","$get","update","payload","patch","delete","$delete","getNextReference","params","getPaginated","createEstimate","$post","Object","idEstimateInvoiceType","EstimateInvoiceType","DEVIS","createOrder","BON","updateEstimate","updateOrder","preview"],"sourceRoot":"","sources":["../../../ts/api/resources/commercialDocument.ts"],"sourcesContent":["import { Resource } from '../Resource';\nimport {\n BasePaginate,\n CreateInvoiceDocument,\n CreatePreSaleDocument,\n EstimateInvoiceType,\n IEstimateInvoice,\n IFile,\n QueryDocumentPaginated,\n QueryNextReference,\n QueryPaginate,\n ReadEstimateInvoice,\n UpdateCommercialDocument,\n} from '../../types';\n\nexport class CommercialDocument extends Resource {\n get(id: number): Promise<ReadEstimateInvoice> {\n return this.axios.$get(`/commercial-management/documents/${id}`);\n }\n\n update(id: number, payload: UpdateCommercialDocument): Promise<IEstimateInvoice> {\n return this.axios.patch(`/commercial-management/documents/${id}`, payload);\n }\n\n delete(id: number): Promise<true> {\n return this.axios.$delete(`/commercial-management/documents/${id}`);\n }\n\n getNextReference(params: QueryNextReference): Promise<string> {\n return this.axios.$get('/commercial-management/documents/references', { params });\n }\n\n getPaginated(params: QueryDocumentPaginated & QueryPaginate): Promise<BasePaginate<ReadEstimateInvoice>> {\n return this.axios.$get('/commercial-management/documents', { params });\n }\n\n createEstimate(payload: Omit<CreatePreSaleDocument, 'idEstimateInvoiceType'>): Promise<IEstimateInvoice> {\n return this.axios.$post('/commercial-management/estimates', { ...payload, idEstimateInvoiceType: EstimateInvoiceType.DEVIS });\n }\n\n createOrder(payload: Omit<CreatePreSaleDocument, 'idEstimateInvoiceType'>): Promise<IEstimateInvoice> {\n return this.axios.$post('/commercial-management/orders', { ...payload, idEstimateInvoiceType: EstimateInvoiceType.BON });\n }\n\n updateEstimate(id: number, payload: CreatePreSaleDocument): Promise<IEstimateInvoice> {\n return this.axios.$post(`/commercial-management/estimates/${id}`, payload);\n }\n\n updateOrder(id: number, payload: CreatePreSaleDocument): Promise<IEstimateInvoice> {\n return this.axios.$post(`/commercial-management/orders/${id}`, payload);\n }\n\n preview(idEstimateInvoiceType: EstimateInvoiceType, payload: CreatePreSaleDocument | CreateInvoiceDocument): Promise<IFile> {\n return this.axios.$post('/commercial-management/preview/', { ...payload, idEstimateInvoiceType });\n }\n}"]}
|