@silexpert/core 1.0.158 → 1.0.161
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/types/Enum/GeneralThirdParty.d.ts.map +1 -1
- package/es/types/Enum/GeneralThirdParty.js +611 -234
- package/es/types/Enum/GeneralThirdParty.js.map +1 -1
- package/es/types/Enum/Holidays.d.ts +2 -0
- package/es/types/Enum/Holidays.d.ts.map +1 -0
- package/es/types/Enum/Holidays.js +2 -0
- package/es/types/Enum/Holidays.js.map +1 -0
- package/es/types/Enum/PrestationType.js +1 -1
- package/es/types/Enum/PrestationType.js.map +1 -1
- package/es/types/Interface/models/IPrestation.d.ts +1 -1
- package/es/types/Interface/models/IPrestation.d.ts.map +1 -1
- package/es/types/Interface/models/IPrestation.js.map +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +1 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/prestation.js +9 -10
- package/es/utils/prestation.js.map +1 -1
- package/js/types/Enum/GeneralThirdParty.js +1567 -436
- package/js/types/Enum/GeneralThirdParty.js.map +1 -1
- package/js/types/Enum/Holidays.js +7 -0
- package/js/types/Enum/Holidays.js.map +1 -0
- package/js/types/Enum/PrestationType.js +1 -1
- package/js/types/Enum/PrestationType.js.map +1 -1
- package/js/types/Interface/models/IPrestation.js.map +1 -1
- package/js/types/index.js +10 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/prestation.js +8 -8
- package/js/utils/prestation.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/GeneralThirdParty.ts +611 -234
- package/ts/types/Enum/Holidays.ts +1 -0
- package/ts/types/Enum/PrestationType.ts +1 -1
- package/ts/types/Interface/models/IPrestation.ts +1 -1
- package/ts/types/index.ts +1 -0
- package/ts/utils/prestation.ts +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DateHolidays = ['2028-01-01', '2028-04-17', '2028-05-01', '2028-05-08', '2028-05-25', '2028-06-05', '2028-07-14', '2028-08-15', '2028-11-01', '2028-11-11', '2028-12-25', '2027-01-01', '2027-03-29', '2027-05-01', '2027-05-06', '2027-05-08', '2027-05-17', '2027-07-14', '2027-08-15', '2027-11-01', '2027-11-11', '2027-12-25', '2026-01-01', '2026-04-06', '2026-05-01', '2026-05-08', '2026-05-14', '2026-05-25', '2026-07-14', '2026-08-15', '2026-11-01', '2026-11-11', '2026-12-25', '2025-01-01', '2025-04-21', '2025-05-01', '2025-05-08', '2025-05-29', '2025-06-09', '2025-07-14', '2025-08-15', '2025-11-01', '2025-11-11', '2025-12-25', '2024-01-01', '2024-04-01', '2024-05-01', '2024-05-08', '2024-05-09', '2024-05-20', '2024-07-14', '2024-08-15', '2024-11-01', '2024-11-11', '2024-12-25', '2023-01-01', '2023-04-10', '2023-05-01', '2023-05-08', '2023-05-18', '2023-05-29', '2023-07-14', '2023-08-15', '2023-11-01', '2023-11-11', '2023-12-25'];
|
package/ts/types/index.ts
CHANGED
|
@@ -476,6 +476,7 @@ export * from './Enum/GeneralThirdParty';
|
|
|
476
476
|
export * from './Enum/MailDomainType';
|
|
477
477
|
export * from './Enum/TextMessageType';
|
|
478
478
|
export * from './Enum/JobTitle';
|
|
479
|
+
export * from './Enum/Holidays';
|
|
479
480
|
|
|
480
481
|
// Interfaces API
|
|
481
482
|
export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
|
package/ts/utils/prestation.ts
CHANGED
|
@@ -31,24 +31,24 @@ const isExpress = (idPrestationList: number):boolean => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {
|
|
34
|
+
const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);
|
|
35
|
+
|
|
34
36
|
// Get the list of prestations that are half price
|
|
35
37
|
const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);
|
|
36
38
|
const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);
|
|
37
39
|
|
|
38
|
-
// Get the number of points for the prestation
|
|
40
|
+
// Get the number of points for the new prestation
|
|
39
41
|
const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);
|
|
40
42
|
const numberPoint = prestaDetails?.point || 0;
|
|
41
43
|
|
|
42
|
-
//
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
// If there is no prestation with the same idPrestationList, return 100% of points
|
|
46
|
-
if (samePrestation.length === 0) return numberPoint;
|
|
44
|
+
// Get list of prestations that are already done and check if one of them is in the list of prestations that are half price
|
|
45
|
+
const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);
|
|
46
|
+
const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));
|
|
47
47
|
|
|
48
|
-
// If the
|
|
49
|
-
if (prestationHalfPriceIds.includes(idPrestationType)) return numberPoint * 0.5;
|
|
48
|
+
// If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points
|
|
49
|
+
if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType)) return Math.floor(numberPoint * 0.5);
|
|
50
50
|
|
|
51
|
-
return
|
|
51
|
+
return numberPoint;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export {
|