@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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAllRecurrences = getAllRecurrences;
|
|
7
|
+
|
|
8
|
+
var _dayjs = require("dayjs");
|
|
9
|
+
|
|
10
|
+
var dayjs = _interopRequireWildcard(_dayjs);
|
|
11
|
+
|
|
12
|
+
var _RecurrenceType = require("../../types/Enum/RecurrenceType");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
const isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
|
|
19
|
+
|
|
20
|
+
const quarterOfYear = require('dayjs/plugin/quarterOfYear');
|
|
21
|
+
|
|
22
|
+
dayjs.extend(quarterOfYear);
|
|
23
|
+
dayjs.extend(isSameOrBefore);
|
|
24
|
+
|
|
25
|
+
function getAllRecurrences(params) {
|
|
26
|
+
var _a;
|
|
27
|
+
|
|
28
|
+
const {
|
|
29
|
+
startDate,
|
|
30
|
+
type
|
|
31
|
+
} = params;
|
|
32
|
+
const endDate = (_a = params.endDate) !== null && _a !== void 0 ? _a : '2100-01-01';
|
|
33
|
+
let loop = 0;
|
|
34
|
+
let recurrency = 'month';
|
|
35
|
+
if (type === _RecurrenceType.RecurrenceType.MONHLY) recurrency = 'month'; // @ts-ignore
|
|
36
|
+
else if (type === _RecurrenceType.RecurrenceType.QUATERLY) recurrency = 'quarter';else if (type === _RecurrenceType.RecurrenceType.WEEKLY) recurrency = 'week';else if (type === _RecurrenceType.RecurrenceType.YEARLY) recurrency = 'year';
|
|
37
|
+
const nextInvoices = []; // @ts-ignore
|
|
38
|
+
|
|
39
|
+
while (dayjs(startDate).add(loop, recurrency).isSameOrBefore(endDate)) {
|
|
40
|
+
const currentDate = dayjs(startDate).add(loop, recurrency);
|
|
41
|
+
nextInvoices.push(currentDate.format('YYYY-MM-DD'));
|
|
42
|
+
loop += 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return nextInvoices;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=recurrence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurrence.js","mappings":";;;;;QAUgBA,iB,GAAAA,iB;;AAVhB;;IAAYC,K;;AAEZ;;;;;;AAEA,MAAMC,cAAc,GAAGC,OAAO,CAAC,6BAAD,CAA9B;;AACA,MAAMC,aAAa,GAAGD,OAAO,CAAC,4BAAD,CAA7B;;AAEAF,KAAK,CAACI,MAAN,CAAaD,aAAb;AACAH,KAAK,CAACI,MAAN,CAAaH,cAAb;;AAEM,SAAUF,iBAAV,CAA4BM,MAA5B,EAIL;;;EACC,MAAM;IAAEC,SAAF;IAAaC;EAAb,IAAsBF,MAA5B;EACA,MAAMG,OAAO,GAAG,YAAM,CAACA,OAAP,MAAc,IAAd,IAAcC,aAAd,GAAcA,EAAd,GAAkB,YAAlC;EAEA,IAAIC,IAAI,GAAG,CAAX;EAEA,IAAIC,UAAU,GAAe,OAA7B;EAEA,IAAIJ,IAAI,KAAKK,+BAAeC,MAA5B,EAAoCF,UAAU,GAAG,OAAb,CAApC,CACA;EADA,KAEK,IAAIJ,IAAI,KAAKK,+BAAeE,QAA5B,EAAsCH,UAAU,GAAG,SAAb,CAAtC,KACA,IAAIJ,IAAI,KAAKK,+BAAeG,MAA5B,EAAoCJ,UAAU,GAAG,MAAb,CAApC,KACA,IAAIJ,IAAI,KAAKK,+BAAeI,MAA5B,EAAoCL,UAAU,GAAG,MAAb;EAEzC,MAAMM,YAAY,GAAa,EAA/B,CAdD,CAgBC;;EACA,OAAOjB,KAAK,CAACM,SAAD,CAAL,CAAiBY,GAAjB,CAAqBR,IAArB,EAA2BC,UAA3B,EAAuCV,cAAvC,CAAsDO,OAAtD,CAAP,EAAuE;IACrE,MAAMW,WAAW,GAAGnB,KAAK,CAACM,SAAD,CAAL,CAAiBY,GAAjB,CAAqBR,IAArB,EAA2BC,UAA3B,CAApB;IACAM,YAAY,CAACG,IAAb,CAAkBD,WAAW,CAACE,MAAZ,CAAmB,YAAnB,CAAlB;IACAX,IAAI,IAAI,CAAR;EACD;;EAED,OAAOO,YAAP;AACD","names":["getAllRecurrences","dayjs","isSameOrBefore","require","quarterOfYear","extend","params","startDate","type","endDate","_a","loop","recurrency","RecurrenceType","MONHLY","QUATERLY","WEEKLY","YEARLY","nextInvoices","add","currentDate","push","format"],"sourceRoot":"","sources":["../../../ts/utils/commercialManagement/recurrence.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { OpUnitType } from 'dayjs';\nimport { RecurrenceType } from '../../types/Enum/RecurrenceType';\n\nconst isSameOrBefore = require('dayjs/plugin/isSameOrBefore');\nconst quarterOfYear = require('dayjs/plugin/quarterOfYear');\n\ndayjs.extend(quarterOfYear);\ndayjs.extend(isSameOrBefore);\n\nexport function getAllRecurrences(params: {\n startDate: string;\n endDate: string | null;\n type: RecurrenceType;\n}): string[] {\n const { startDate, type } = params;\n const endDate = params.endDate ?? '2100-01-01';\n\n let loop = 0;\n\n let recurrency: OpUnitType = 'month';\n\n if (type === RecurrenceType.MONHLY) recurrency = 'month';\n // @ts-ignore\n else if (type === RecurrenceType.QUATERLY) recurrency = 'quarter';\n else if (type === RecurrenceType.WEEKLY) recurrency = 'week';\n else if (type === RecurrenceType.YEARLY) recurrency = 'year';\n\n const nextInvoices: string[] = [];\n\n // @ts-ignore\n while (dayjs(startDate).add(loop, recurrency).isSameOrBefore(endDate)) {\n const currentDate = dayjs(startDate).add(loop, recurrency);\n nextInvoices.push(currentDate.format('YYYY-MM-DD'));\n loop += 1;\n }\n\n return nextInvoices;\n}"]}
|
package/js/utils/index.js
CHANGED
|
@@ -124,6 +124,18 @@ Object.keys(_document).forEach(function (key) {
|
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
+
var _recurrence = require("./commercialManagement/recurrence");
|
|
128
|
+
|
|
129
|
+
Object.keys(_recurrence).forEach(function (key) {
|
|
130
|
+
if (key === "default" || key === "__esModule") return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _recurrence[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
127
139
|
var _amount = require("./amount");
|
|
128
140
|
|
|
129
141
|
Object.keys(_amount).forEach(function (key) {
|
package/js/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './amount';"]}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;;;AACA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA","names":[],"sourceRoot":"","sources":["../../ts/utils/index.ts"],"sourcesContent":["export * from './objectUtils';\nexport * from './stringUtils';\nexport * from './brands';\nexport * from './webmail';\nexport * from './decorators';\nexport * from './balanceSheetModule';\nexport * from './siretValidation';\nexport * from './task';\nexport * from './social';\nexport * from './commercialManagement/document';\nexport * from './commercialManagement/recurrence';\nexport * from './amount';"]}
|
package/js/utils/task.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getIdRoleUsedForManagerTask = exports.getIdRoleUsedForTask = undefined;
|
|
6
|
+
exports.getIdRoleUsedForGetTaskOfUser = exports.getIdRoleUsedForAttribution = exports.getIdRoleUsedForManagerTask = exports.getIdRoleUsedForTask = undefined;
|
|
7
7
|
|
|
8
8
|
var _Role = require("../types/Enum/Role");
|
|
9
9
|
|
|
10
|
+
var _TaskResponseType = require("../types/Enum/TaskResponseType");
|
|
11
|
+
|
|
10
12
|
const getIdRoleUsedForTask = listRoles => {
|
|
11
13
|
let idRole = 0;
|
|
12
14
|
|
|
@@ -43,6 +45,17 @@ const getIdRoleUsedForManagerTask = listRoles => {
|
|
|
43
45
|
return idRole;
|
|
44
46
|
};
|
|
45
47
|
|
|
48
|
+
const getIdRoleUsedForAttribution = (isIntern, idTaskType) => {
|
|
49
|
+
var _a;
|
|
50
|
+
|
|
51
|
+
const taskTypeList = isIntern ? _TaskResponseType.TaskResponseType.INTERN.types : _TaskResponseType.TaskResponseType.EXTERN.types;
|
|
52
|
+
return (_a = taskTypeList.find(taskType => taskType.id === idTaskType)) === null || _a === void 0 ? void 0 : _a.role;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const getIdRoleUsedForGetTaskOfUser = idRole => !!Object.values(_TaskResponseType.RoleAvailableForTask).find(role => role === idRole);
|
|
56
|
+
|
|
46
57
|
exports.getIdRoleUsedForTask = getIdRoleUsedForTask;
|
|
47
58
|
exports.getIdRoleUsedForManagerTask = getIdRoleUsedForManagerTask;
|
|
59
|
+
exports.getIdRoleUsedForAttribution = getIdRoleUsedForAttribution;
|
|
60
|
+
exports.getIdRoleUsedForGetTaskOfUser = getIdRoleUsedForGetTaskOfUser;
|
|
48
61
|
//# sourceMappingURL=task.js.map
|
package/js/utils/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","mappings":";;;;;;;AAAA;;AAEA,MAAMA,oBAAoB,GAAIC,SAAD,IAAgC;EAC3D,IAAIC,MAAM,GAAG,CAAb;;EACA,IAAID,SAAS,CAACE,QAAV,CAAmBC,WAAKC,UAAxB,KAAuCJ,SAAS,CAACE,QAAV,CAAmBC,WAAKE,kBAAxB,CAA3C,EAAwF;IACtFJ,MAAM,GAAGE,WAAKC,UAAd;EACD,CAFD,MAEO,IAAIJ,SAAS,CAACE,QAAV,CAAmBC,WAAKG,OAAxB,CAAJ,EAAsC;IAC3CL,MAAM,GAAGE,WAAKG,OAAd;EACD,CAFM,MAEA,IAAIN,SAAS,CAACE,QAAV,CAAmBC,WAAKI,MAAxB,CAAJ,EAAqC;IAC1CN,MAAM,GAAGE,WAAKI,MAAd;EACD,CAFM,MAEA,IAAIP,SAAS,CAACE,QAAV,CAAmBC,WAAKK,WAAxB,CAAJ,EAA0C;IAC/CP,MAAM,GAAGE,WAAKK,WAAd;EACD,CAFM,MAEA,IAAIR,SAAS,CAACE,QAAV,CAAmBC,WAAKM,gBAAxB,KAA6CT,SAAS,CAACE,QAAV,CAAmBC,WAAKO,wBAAxB,CAAjD,EAAoG;IACzGT,MAAM,GAAGE,WAAKM,gBAAd;EACD,CAFM,MAEA,IAAIT,SAAS,CAACE,QAAV,CAAmBC,WAAKQ,YAAxB,KAAyCX,SAAS,CAACE,QAAV,CAAmBC,WAAKS,aAAxB,CAA7C,EAAqF;IAC1FX,MAAM,GAAGE,WAAKQ,YAAd;EACD;;EACD,OAAOV,MAAP;AACD,CAhBD;;AAkBA,MAAMY,2BAA2B,GAAIb,SAAD,IAAgC;EAClE,IAAIC,MAAM,GAAG,CAAb;;EACA,IAAID,SAAS,CAACE,QAAV,CAAmBC,WAAKC,UAAxB,CAAJ,EAAyC;IACvCH,MAAM,GAAGE,WAAKE,kBAAd;EACD,CAFD,MAEO,IAAIL,SAAS,CAACE,QAAV,CAAmBC,WAAKG,OAAxB,KAAoCN,SAAS,CAACE,QAAV,CAAmBC,WAAKI,MAAxB,CAApC,IAAuEP,SAAS,CAACE,QAAV,CAAmBC,WAAKK,WAAxB,CAA3E,EAAiH;IACtHP,MAAM,GAAGE,WAAKW,OAAd;EACD,CAFM,MAEA,IAAId,SAAS,CAACE,QAAV,CAAmBC,WAAKM,gBAAxB,CAAJ,EAA+C;IACpDR,MAAM,GAAGE,WAAKO,wBAAd;EACD,CAFM,MAEA,IAAIV,SAAS,CAACE,QAAV,CAAmBC,WAAKQ,YAAxB,CAAJ,EAA2C;IAChDV,MAAM,GAAGE,WAAKS,aAAd;EACD;;EACD,OAAOX,MAAP;AACD,CAZD;;
|
|
1
|
+
{"version":3,"file":"task.js","mappings":";;;;;;;AAAA;;AACA;;AAEA,MAAMA,oBAAoB,GAAIC,SAAD,IAAgC;EAC3D,IAAIC,MAAM,GAAG,CAAb;;EACA,IAAID,SAAS,CAACE,QAAV,CAAmBC,WAAKC,UAAxB,KAAuCJ,SAAS,CAACE,QAAV,CAAmBC,WAAKE,kBAAxB,CAA3C,EAAwF;IACtFJ,MAAM,GAAGE,WAAKC,UAAd;EACD,CAFD,MAEO,IAAIJ,SAAS,CAACE,QAAV,CAAmBC,WAAKG,OAAxB,CAAJ,EAAsC;IAC3CL,MAAM,GAAGE,WAAKG,OAAd;EACD,CAFM,MAEA,IAAIN,SAAS,CAACE,QAAV,CAAmBC,WAAKI,MAAxB,CAAJ,EAAqC;IAC1CN,MAAM,GAAGE,WAAKI,MAAd;EACD,CAFM,MAEA,IAAIP,SAAS,CAACE,QAAV,CAAmBC,WAAKK,WAAxB,CAAJ,EAA0C;IAC/CP,MAAM,GAAGE,WAAKK,WAAd;EACD,CAFM,MAEA,IAAIR,SAAS,CAACE,QAAV,CAAmBC,WAAKM,gBAAxB,KAA6CT,SAAS,CAACE,QAAV,CAAmBC,WAAKO,wBAAxB,CAAjD,EAAoG;IACzGT,MAAM,GAAGE,WAAKM,gBAAd;EACD,CAFM,MAEA,IAAIT,SAAS,CAACE,QAAV,CAAmBC,WAAKQ,YAAxB,KAAyCX,SAAS,CAACE,QAAV,CAAmBC,WAAKS,aAAxB,CAA7C,EAAqF;IAC1FX,MAAM,GAAGE,WAAKQ,YAAd;EACD;;EACD,OAAOV,MAAP;AACD,CAhBD;;AAkBA,MAAMY,2BAA2B,GAAIb,SAAD,IAAgC;EAClE,IAAIC,MAAM,GAAG,CAAb;;EACA,IAAID,SAAS,CAACE,QAAV,CAAmBC,WAAKC,UAAxB,CAAJ,EAAyC;IACvCH,MAAM,GAAGE,WAAKE,kBAAd;EACD,CAFD,MAEO,IAAIL,SAAS,CAACE,QAAV,CAAmBC,WAAKG,OAAxB,KAAoCN,SAAS,CAACE,QAAV,CAAmBC,WAAKI,MAAxB,CAApC,IAAuEP,SAAS,CAACE,QAAV,CAAmBC,WAAKK,WAAxB,CAA3E,EAAiH;IACtHP,MAAM,GAAGE,WAAKW,OAAd;EACD,CAFM,MAEA,IAAId,SAAS,CAACE,QAAV,CAAmBC,WAAKM,gBAAxB,CAAJ,EAA+C;IACpDR,MAAM,GAAGE,WAAKO,wBAAd;EACD,CAFM,MAEA,IAAIV,SAAS,CAACE,QAAV,CAAmBC,WAAKQ,YAAxB,CAAJ,EAA2C;IAChDV,MAAM,GAAGE,WAAKS,aAAd;EACD;;EACD,OAAOX,MAAP;AACD,CAZD;;AAcA,MAAMc,2BAA2B,GAAG,CAACC,QAAD,EAAoBC,UAApB,KAA8D;;;EAChG,MAAMC,YAAY,GAAGF,QAAQ,GAAGG,mCAAiBC,MAAjB,CAAwBC,KAA3B,GAAmCF,mCAAiBG,MAAjB,CAAwBD,KAAxF;EACA,OAAO,kBAAY,CAACE,IAAb,CAAmBC,QAAD,IAAcA,QAAQ,CAACC,EAAT,KAAgBR,UAAhD,OAA2D,IAA3D,IAA2DS,aAA3D,GAA2D,MAA3D,GAA2DA,GAAEC,IAApE;AACD,CAHD;;AAKA,MAAMC,6BAA6B,GAAI3B,MAAD,IAA6B,CAAC,CAAC4B,MAAM,CAACC,MAAP,CAAcC,sCAAd,EAAoCR,IAApC,CAA0CI,IAAD,IAAUA,IAAI,KAAK1B,MAA5D,CAArE;;QAGEF,oB,GAAAA,oB;QAAsBc,2B,GAAAA,2B;QAA6BE,2B,GAAAA,2B;QAA6Ba,6B,GAAAA,6B","names":["getIdRoleUsedForTask","listRoles","idRole","includes","Role","COMMERCIAL","COMMERCIAL_MANAGER","JURIDIC","SOCIAL","FACTURATION","CUSTOMER_SUCCESS","CUSTOMER_SUCCESS_MANAGER","FRONT_OFFICE","FRONT_MANAGER","getIdRoleUsedForManagerTask","MANAGER","getIdRoleUsedForAttribution","isIntern","idTaskType","taskTypeList","TaskResponseType","INTERN","types","EXTERN","find","taskType","id","_a","role","getIdRoleUsedForGetTaskOfUser","Object","values","RoleAvailableForTask"],"sourceRoot":"","sources":["../../ts/utils/task.ts"],"sourcesContent":["import { Role } from '../types/Enum/Role';\nimport { TaskResponseType, RoleAvailableForTask } from '../types/Enum/TaskResponseType';\n\nconst getIdRoleUsedForTask = (listRoles: number[]): number => {\n let idRole = 0;\n if (listRoles.includes(Role.COMMERCIAL) || listRoles.includes(Role.COMMERCIAL_MANAGER)) {\n idRole = Role.COMMERCIAL;\n } else if (listRoles.includes(Role.JURIDIC)) {\n idRole = Role.JURIDIC;\n } else if (listRoles.includes(Role.SOCIAL)) {\n idRole = Role.SOCIAL;\n } else if (listRoles.includes(Role.FACTURATION)) {\n idRole = Role.FACTURATION;\n } else if (listRoles.includes(Role.CUSTOMER_SUCCESS) || listRoles.includes(Role.CUSTOMER_SUCCESS_MANAGER)) {\n idRole = Role.CUSTOMER_SUCCESS;\n } else if (listRoles.includes(Role.FRONT_OFFICE) || listRoles.includes(Role.FRONT_MANAGER)) {\n idRole = Role.FRONT_OFFICE;\n }\n return idRole;\n};\n\nconst getIdRoleUsedForManagerTask = (listRoles: number[]): number => {\n let idRole = 0;\n if (listRoles.includes(Role.COMMERCIAL)) {\n idRole = Role.COMMERCIAL_MANAGER;\n } else if (listRoles.includes(Role.JURIDIC) || listRoles.includes(Role.SOCIAL) || listRoles.includes(Role.FACTURATION)) {\n idRole = Role.MANAGER;\n } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {\n idRole = Role.CUSTOMER_SUCCESS_MANAGER;\n } else if (listRoles.includes(Role.FRONT_OFFICE)) {\n idRole = Role.FRONT_MANAGER;\n }\n return idRole;\n};\n\nconst getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): number | undefined => {\n const taskTypeList = isIntern ? TaskResponseType.INTERN.types : TaskResponseType.EXTERN.types;\n return taskTypeList.find((taskType) => taskType.id === idTaskType)?.role;\n};\n\nconst getIdRoleUsedForGetTaskOfUser = (idRole: number): boolean => !!Object.values(RoleAvailableForTask).find((role) => role === idRole);\n\nexport {\n getIdRoleUsedForTask, getIdRoleUsedForManagerTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser,\n};"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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": "js/index.js",
|
|
@@ -53,4 +53,8 @@ export class CommercialDocument extends Resource {
|
|
|
53
53
|
preview(idEstimateInvoiceType: EstimateInvoiceType, payload: CreatePreSaleDocument | CreateInvoiceDocument): Promise<IFile> {
|
|
54
54
|
return this.axios.$post('/commercial-management/preview/', { ...payload, idEstimateInvoiceType });
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
getFormValues(id: number): Promise<CreatePreSaleDocument> {
|
|
58
|
+
return this.axios.$get(`/commercial-management/documents/${id}/inputs`);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
@@ -5,4 +5,8 @@ export class Exercice extends Resource {
|
|
|
5
5
|
create(params: CreateExercice): Promise<IExercice> {
|
|
6
6
|
return this.axios.$post('/exercices', params);
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
getAllBySocietyId(id: number): Promise<IExercice[]> {
|
|
10
|
+
return this.axios.$get(`/societies/${id}/exercices`);
|
|
11
|
+
}
|
|
8
12
|
}
|
|
@@ -46,4 +46,8 @@ export class Invoice extends Resource {
|
|
|
46
46
|
sendMail(idFile: number, payload: CreateCommercialMail): Promise<ICommercialMail> {
|
|
47
47
|
return this.axios.$post(`/commercial-management/files/${idFile}/mails`, payload);
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
getFormValues(id: number): Promise<CreateInvoiceDocument> {
|
|
51
|
+
return this.axios.$get(`/commercial-management/documents/${id}/inputs`);
|
|
52
|
+
}
|
|
49
53
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Resource } from '../Resource';
|
|
2
|
+
import { IInvoiceRecurrence } from '../../types/Interface/models/IInvoiceRecurrence';
|
|
3
|
+
import { CreateRecurrence, UpdateRecurrence } from '../../types';
|
|
4
|
+
|
|
5
|
+
export class Recurrence extends Resource {
|
|
6
|
+
create(idEstimateInvoice: number, payload: CreateRecurrence): Promise<IInvoiceRecurrence> {
|
|
7
|
+
return this.axios.$post(`/commercial-management/documents/${idEstimateInvoice}/recurrences`, payload);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
update(id: number, idEstimateInvoice: number, payload: UpdateRecurrence): Promise<IInvoiceRecurrence> {
|
|
11
|
+
return this.axios.$put(`/commercial-management/documents/${idEstimateInvoice}/recurrences/${id}`, payload);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
delete(id: number, idEstimateInvoice: number): Promise<true> {
|
|
15
|
+
return this.axios.$delete(`/commercial-management/documents/${idEstimateInvoice}/recurrences/${id}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
export class Reminder extends Resource {
|
|
9
9
|
create(idEstimateInvoice: number, payload: CreateReminder): Promise<IInvoiceReminder> {
|
|
10
|
-
return this.axios.$post(`/commercial-management/documents/${idEstimateInvoice}`, payload);
|
|
10
|
+
return this.axios.$post(`/commercial-management/documents/${idEstimateInvoice}/reminders`, payload);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
update(id: number, idEstimateInvoice: number, payload: UpdateReminder): Promise<IInvoiceReminder> {
|
package/ts/api/resources.ts
CHANGED
|
@@ -90,9 +90,10 @@ import { TimeRecorder } from './resources/TimeRecorder';
|
|
|
90
90
|
import { CustomerActivity } from './resources/CustomerActivity';
|
|
91
91
|
import { CommercialSetting } from './resources/CommercialSetting';
|
|
92
92
|
import { Invoice } from './resources/Invoice';
|
|
93
|
-
import { CommercialDocument } from './resources/
|
|
93
|
+
import { CommercialDocument } from './resources/CommercialDocument';
|
|
94
94
|
import { Connection } from './resources/Connection';
|
|
95
|
-
import { Reminder } from './resources/
|
|
95
|
+
import { Reminder } from './resources/Reminder';
|
|
96
|
+
import { Recurrence } from './resources/Recurrence';
|
|
96
97
|
|
|
97
98
|
export const resources = {
|
|
98
99
|
simulation: Simulation,
|
|
@@ -190,4 +191,5 @@ export const resources = {
|
|
|
190
191
|
connection: Connection,
|
|
191
192
|
invoice: Invoice,
|
|
192
193
|
reminder: Reminder,
|
|
194
|
+
recurrence: Recurrence,
|
|
193
195
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export enum RecurrenceType {
|
|
2
|
+
WEEKLY = 1,
|
|
3
|
+
MONHLY = 2,
|
|
4
|
+
QUATERLY = 3,
|
|
5
|
+
YEARLY = 4,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const RecurrenceList: Array<{ id: RecurrenceType, label: string; }> = [
|
|
9
|
+
{
|
|
10
|
+
id: RecurrenceType.WEEKLY,
|
|
11
|
+
label: 'Hebdomadaire',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: RecurrenceType.MONHLY,
|
|
15
|
+
label: 'Mensuelle',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: RecurrenceType.QUATERLY,
|
|
19
|
+
label: 'Trimestrielle',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: RecurrenceType.YEARLY,
|
|
23
|
+
label: 'Annuelle',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
@@ -24,6 +24,17 @@ export enum StateTask {
|
|
|
24
24
|
REFUSED = 4,
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export enum RoleAvailableForTask {
|
|
28
|
+
SOCIAL = Role.SOCIAL,
|
|
29
|
+
FACTURATION = Role.FACTURATION,
|
|
30
|
+
JURIDIC = Role.JURIDIC,
|
|
31
|
+
CUSTOMER_SUCCESS = Role.CUSTOMER_SUCCESS,
|
|
32
|
+
FRONT_OFFICE = Role.FRONT_OFFICE,
|
|
33
|
+
COMMERCIAL = Role.COMMERCIAL,
|
|
34
|
+
BACK_MANAGER = Role.BACK_MANAGER,
|
|
35
|
+
EXPERT_ACCOUNTANT = Role.EXPERT_ACCOUNTANT,
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
export const TaskResponseType = {
|
|
28
39
|
INTERN: {
|
|
29
40
|
id: 1,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IsArray, IsBoolean, IsDateString, IsNumber, IsOptional, IsString, Min,
|
|
2
|
+
IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,
|
|
3
3
|
} from 'class-validator';
|
|
4
4
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
5
5
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
6
6
|
import { FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
7
7
|
import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';
|
|
8
|
+
import { RecurrenceType } from '../../../Enum/RecurrenceType';
|
|
8
9
|
import { IProductInvoice } from '../../models/IProductInvoice';
|
|
9
10
|
import { ISocietyGescom } from '../../models/ISocietyGescom';
|
|
10
11
|
import { IThirdParty } from '../../models/IThirdParty';
|
|
@@ -222,35 +223,24 @@ export class CreateCommercialMail {
|
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
export class CommercialDocumentInputs {
|
|
225
|
-
@
|
|
226
|
-
|
|
227
|
-
@IsOptional()
|
|
228
|
-
legalForm?: string;
|
|
226
|
+
@ApiProperty()
|
|
227
|
+
legalForm: string | null;
|
|
229
228
|
|
|
230
|
-
@
|
|
229
|
+
@ApiProperty()
|
|
231
230
|
@IsNumber()
|
|
232
|
-
@IsOptional()
|
|
233
231
|
capital?: number;
|
|
234
232
|
|
|
235
|
-
@
|
|
236
|
-
|
|
237
|
-
@IsOptional()
|
|
238
|
-
siren?: string;
|
|
233
|
+
@ApiProperty()
|
|
234
|
+
siren: string | null;
|
|
239
235
|
|
|
240
|
-
@
|
|
241
|
-
|
|
242
|
-
@IsOptional()
|
|
243
|
-
rcs?: string;
|
|
236
|
+
@ApiProperty()
|
|
237
|
+
rcs: string | null;
|
|
244
238
|
|
|
245
|
-
@
|
|
246
|
-
|
|
247
|
-
@IsOptional()
|
|
248
|
-
vatCode?: string;
|
|
239
|
+
@ApiProperty()
|
|
240
|
+
vatCode: string | null;
|
|
249
241
|
|
|
250
|
-
@
|
|
251
|
-
|
|
252
|
-
@IsOptional()
|
|
253
|
-
nafCode?: string;
|
|
242
|
+
@ApiProperty()
|
|
243
|
+
nafCode: string | null;
|
|
254
244
|
|
|
255
245
|
@ApiProperty()
|
|
256
246
|
@IsString()
|
|
@@ -267,14 +257,11 @@ export class CommercialDocumentInputs {
|
|
|
267
257
|
@IsDateString()
|
|
268
258
|
dueDate: string; //
|
|
269
259
|
|
|
270
|
-
@
|
|
271
|
-
|
|
272
|
-
@IsOptional()
|
|
273
|
-
expirationDate: string;
|
|
260
|
+
@ApiProperty({ description: 'Date d\'expiration pour la facture d\'acompte' })
|
|
261
|
+
expirationDate: string | null;
|
|
274
262
|
|
|
275
263
|
@ApiProperty({ description: 'Conditions de réglement' })
|
|
276
|
-
|
|
277
|
-
termsOfPayment: string;
|
|
264
|
+
termsOfPayment: string | null;
|
|
278
265
|
|
|
279
266
|
@ApiProperty()
|
|
280
267
|
@IsArray()
|
|
@@ -284,88 +271,62 @@ export class CommercialDocumentInputs {
|
|
|
284
271
|
@IsString()
|
|
285
272
|
discount: string; //
|
|
286
273
|
|
|
287
|
-
@
|
|
288
|
-
|
|
289
|
-
@IsString()
|
|
290
|
-
comment?: string; //
|
|
274
|
+
@ApiProperty()
|
|
275
|
+
comment: string | null; //
|
|
291
276
|
|
|
292
|
-
@
|
|
293
|
-
|
|
294
|
-
@IsString()
|
|
295
|
-
penalties?: string; //
|
|
277
|
+
@ApiProperty({ description: 'Pénalité de retard' })
|
|
278
|
+
penalties: string | null; //
|
|
296
279
|
|
|
297
280
|
@ApiProperty({ description: 'Remise globale' })
|
|
298
|
-
@IsOptional()
|
|
299
281
|
@IsNumber()
|
|
300
282
|
generalDiscount2: number; //
|
|
301
283
|
|
|
302
|
-
@
|
|
303
|
-
|
|
304
|
-
@IsString()
|
|
305
|
-
compensation?: string; //
|
|
284
|
+
@ApiProperty({ description: 'Indemnité forfaitaire' })
|
|
285
|
+
compensation: string | null; //
|
|
306
286
|
|
|
307
|
-
@
|
|
308
|
-
|
|
309
|
-
@IsString()
|
|
310
|
-
vatMention?: string; //
|
|
287
|
+
@ApiProperty()
|
|
288
|
+
vatMention: string | null; //
|
|
311
289
|
|
|
312
290
|
@ApiProperty()
|
|
313
291
|
@IsBoolean()
|
|
314
292
|
@ToBoolean()
|
|
315
293
|
disableVat: boolean;
|
|
316
294
|
|
|
317
|
-
@
|
|
318
|
-
|
|
319
|
-
@IsOptional()
|
|
320
|
-
title?: string; //
|
|
295
|
+
@ApiProperty()
|
|
296
|
+
title: string | null; //
|
|
321
297
|
|
|
322
|
-
@
|
|
298
|
+
@ApiProperty({ description: 'Commercial name of seller' })
|
|
323
299
|
@IsString()
|
|
324
|
-
@IsOptional()
|
|
325
300
|
name: string;
|
|
326
301
|
|
|
327
|
-
@
|
|
302
|
+
@ApiProperty({ description: 'Commercial number address of seller' })
|
|
328
303
|
@IsString()
|
|
329
|
-
|
|
330
|
-
number?: string;
|
|
304
|
+
number?: string | null;
|
|
331
305
|
|
|
332
|
-
@
|
|
333
|
-
|
|
334
|
-
@IsOptional()
|
|
335
|
-
street?: string;
|
|
306
|
+
@ApiProperty({ description: 'Commercial street address of seller' })
|
|
307
|
+
street: string | null;
|
|
336
308
|
|
|
337
|
-
@
|
|
338
|
-
|
|
339
|
-
@IsOptional()
|
|
340
|
-
zipCode?: string;
|
|
309
|
+
@ApiProperty({ description: 'Commercial zip code address of seller' })
|
|
310
|
+
zipCode: string | null;
|
|
341
311
|
|
|
342
|
-
@
|
|
343
|
-
|
|
344
|
-
@IsOptional()
|
|
345
|
-
city?: string;
|
|
312
|
+
@ApiProperty({ description: 'Commercial city address of seller' })
|
|
313
|
+
city: string | null;
|
|
346
314
|
|
|
347
|
-
@
|
|
348
|
-
@IsOptional()
|
|
315
|
+
@ApiProperty()
|
|
349
316
|
settings?: ISocietyGescom;
|
|
350
317
|
|
|
351
|
-
@
|
|
352
|
-
|
|
353
|
-
@IsString()
|
|
354
|
-
cgv?: string;
|
|
318
|
+
@ApiProperty()
|
|
319
|
+
cgv: string | null;
|
|
355
320
|
|
|
356
|
-
@
|
|
357
|
-
|
|
358
|
-
@IsString()
|
|
359
|
-
logoUrl?: string;
|
|
321
|
+
@ApiProperty()
|
|
322
|
+
logoUrl: string | null;
|
|
360
323
|
|
|
361
|
-
@
|
|
362
|
-
@IsOptional()
|
|
324
|
+
@ApiProperty()
|
|
363
325
|
@IsBoolean()
|
|
364
326
|
@ToBoolean()
|
|
365
327
|
isStripeAllowed?: boolean;
|
|
366
328
|
|
|
367
|
-
@
|
|
368
|
-
@IsOptional()
|
|
329
|
+
@ApiProperty()
|
|
369
330
|
@IsBoolean()
|
|
370
331
|
@ToBoolean()
|
|
371
332
|
isDraft?: boolean;
|
|
@@ -383,6 +344,7 @@ export class CreatePreSaleDocument extends CommercialDocumentInputs {
|
|
|
383
344
|
export class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
384
345
|
paymentLink?: string;
|
|
385
346
|
deposit?: number;
|
|
347
|
+
fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture
|
|
386
348
|
fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture
|
|
387
349
|
assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes
|
|
388
350
|
}
|
|
@@ -422,4 +384,23 @@ export class CreateReminder {
|
|
|
422
384
|
@IsString()
|
|
423
385
|
@IsOptional()
|
|
424
386
|
message?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export class CreateRecurrence {
|
|
390
|
+
@ApiProperty()
|
|
391
|
+
@IsEnum(RecurrenceType)
|
|
392
|
+
type: number;
|
|
393
|
+
|
|
394
|
+
@ApiProperty()
|
|
395
|
+
@IsDateString()
|
|
396
|
+
startDate: string;
|
|
397
|
+
|
|
398
|
+
@ApiProperty()
|
|
399
|
+
@IsDateString()
|
|
400
|
+
endDate: string;
|
|
401
|
+
|
|
402
|
+
@ApiProperty()
|
|
403
|
+
@ToBoolean()
|
|
404
|
+
@IsBoolean()
|
|
405
|
+
isActive: boolean;
|
|
425
406
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
IsBoolean, IsDate, IsOptional, IsString,
|
|
2
|
+
IsBoolean, IsDate, IsDateString, IsEnum, IsOptional, IsString,
|
|
3
3
|
} from 'class-validator';
|
|
4
4
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
5
5
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
6
|
+
import { RecurrenceType } from '../../../Enum/RecurrenceType';
|
|
6
7
|
|
|
7
8
|
export class UpdateCommercialDocument {
|
|
8
9
|
@ApiPropertyOptional()
|
|
@@ -69,4 +70,27 @@ export class UpdateReminder {
|
|
|
69
70
|
@IsString()
|
|
70
71
|
@IsOptional()
|
|
71
72
|
message?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class UpdateRecurrence {
|
|
76
|
+
@ApiPropertyOptional()
|
|
77
|
+
@IsEnum(RecurrenceType)
|
|
78
|
+
@IsOptional()
|
|
79
|
+
type?: number;
|
|
80
|
+
|
|
81
|
+
@ApiPropertyOptional()
|
|
82
|
+
@IsDateString()
|
|
83
|
+
@IsOptional()
|
|
84
|
+
startDate?: string;
|
|
85
|
+
|
|
86
|
+
@ApiPropertyOptional()
|
|
87
|
+
@IsDateString()
|
|
88
|
+
@IsOptional()
|
|
89
|
+
endDate?: string;
|
|
90
|
+
|
|
91
|
+
@ApiPropertyOptional()
|
|
92
|
+
@ToBoolean()
|
|
93
|
+
@IsBoolean()
|
|
94
|
+
@IsOptional()
|
|
95
|
+
isActive?: boolean;
|
|
72
96
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
IsBoolean,
|
|
3
|
+
IsDate, IsInt, IsNumber, IsOptional, IsString,
|
|
3
4
|
} from 'class-validator';
|
|
4
|
-
import { ApiProperty } from '../../../..';
|
|
5
|
+
import { ApiProperty, ApiPropertyOptional } from '../../../..';
|
|
6
|
+
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
5
7
|
|
|
6
8
|
export class QueryRevision {
|
|
7
9
|
@ApiProperty()
|
|
@@ -16,6 +18,17 @@ export class QueryRevision {
|
|
|
16
18
|
@IsInt()
|
|
17
19
|
idSociety: number;
|
|
18
20
|
|
|
21
|
+
@ApiPropertyOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
orderBy?: 'designation' | 'amount' | 'number';
|
|
25
|
+
|
|
26
|
+
@ApiPropertyOptional()
|
|
27
|
+
@IsBoolean()
|
|
28
|
+
@ToBoolean()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
descending?: boolean;
|
|
31
|
+
|
|
19
32
|
// Interface paginate
|
|
20
33
|
@ApiProperty({ default: 25 })
|
|
21
34
|
@IsNumber()
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
IsBoolean,
|
|
3
|
+
IsDate, IsInt, IsNumber, IsOptional, IsString,
|
|
3
4
|
} from 'class-validator';
|
|
4
5
|
import { ApiProperty, QueryPaginate } from '../../../..';
|
|
5
6
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
7
|
+
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
6
8
|
|
|
7
9
|
export class QueryRevisionAccount implements QueryPaginate {
|
|
8
10
|
@ApiProperty({ default: 1 })
|
|
9
11
|
@IsNumber()
|
|
10
12
|
page: number;
|
|
11
13
|
|
|
12
|
-
@ApiPropertyOptional({ default: 'idAccount' })
|
|
13
|
-
orderBy?: string;
|
|
14
|
-
|
|
15
14
|
@ApiProperty()
|
|
16
15
|
@IsDate()
|
|
17
16
|
startDate: Date;
|
|
@@ -24,7 +23,15 @@ export class QueryRevisionAccount implements QueryPaginate {
|
|
|
24
23
|
@IsNumber()
|
|
25
24
|
limit: number;
|
|
26
25
|
|
|
26
|
+
@ApiPropertyOptional({ default: 'idAccount' })
|
|
27
|
+
@IsString()
|
|
28
|
+
@IsOptional()
|
|
29
|
+
orderBy?: 'date' | 'designation' | 'idAccount' | 'debit' | 'credit';
|
|
30
|
+
|
|
27
31
|
@ApiPropertyOptional({ default: true })
|
|
32
|
+
@IsBoolean()
|
|
33
|
+
@ToBoolean()
|
|
34
|
+
@IsOptional()
|
|
28
35
|
descending?: boolean;
|
|
29
36
|
|
|
30
37
|
@ApiPropertyOptional()
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
IsBoolean,
|
|
3
|
+
IsDate, IsInt, IsNumber, IsOptional, IsString,
|
|
3
4
|
} from 'class-validator';
|
|
4
|
-
import { ApiProperty } from '../../../..';
|
|
5
|
+
import { ApiProperty, ApiPropertyOptional } from '../../../..';
|
|
6
|
+
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
5
7
|
|
|
6
8
|
export class QueryRevisionPaginate {
|
|
7
9
|
@ApiProperty()
|
|
@@ -16,6 +18,17 @@ export class QueryRevisionPaginate {
|
|
|
16
18
|
@IsInt()
|
|
17
19
|
idSociety: number;
|
|
18
20
|
|
|
21
|
+
@ApiPropertyOptional()
|
|
22
|
+
@IsString()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
orderBy?: 'designation' | 'amount' | 'number';
|
|
25
|
+
|
|
26
|
+
@ApiPropertyOptional()
|
|
27
|
+
@IsBoolean()
|
|
28
|
+
@ToBoolean()
|
|
29
|
+
@IsOptional()
|
|
30
|
+
descending?: boolean;
|
|
31
|
+
|
|
19
32
|
// Interface paginate
|
|
20
33
|
@ApiProperty({ default: 25 })
|
|
21
34
|
@IsNumber()
|
|
@@ -82,7 +82,7 @@ export class QueryRevisionSearchEntries {
|
|
|
82
82
|
@ApiPropertyOptional({ default: 'date' })
|
|
83
83
|
@IsString()
|
|
84
84
|
@IsOptional()
|
|
85
|
-
orderBy?: 'date' | 'accountNumber' | 'amount' | 'designation' | 'vatRate';
|
|
85
|
+
orderBy?: 'date' | 'accountNumber' | 'amount' | 'designation' | 'vatRate' | 'debit' | 'credit';
|
|
86
86
|
|
|
87
87
|
@ApiPropertyOptional()
|
|
88
88
|
@IsBoolean()
|