@silexpert/core 1.0.158 → 1.0.160
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/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/utils/prestation.d.ts.map +1 -1
- package/es/utils/prestation.js +5 -4
- 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/Interface/models/IPrestation.js.map +1 -1
- package/js/utils/prestation.js +4 -3
- package/js/utils/prestation.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/GeneralThirdParty.ts +611 -234
- package/ts/types/Interface/models/IPrestation.ts +1 -1
- package/ts/utils/prestation.ts +5 -4
package/ts/utils/prestation.ts
CHANGED
|
@@ -39,15 +39,16 @@ const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestati
|
|
|
39
39
|
const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);
|
|
40
40
|
const numberPoint = prestaDetails?.point || 0;
|
|
41
41
|
|
|
42
|
+
const prestationsExistIds = prestations.map((prestation) => prestation.idPrestationList);
|
|
43
|
+
// If one the prestation is in the list of prestations that are half price, return 50% of points
|
|
44
|
+
if (prestationsExistIds.some((id) => prestationHalfPriceIds.includes(id))) return Math.floor(numberPoint * 0.5);
|
|
45
|
+
|
|
42
46
|
// Find the prestation with the same idPrestationList and they need to be paid and signed
|
|
43
|
-
const samePrestation = prestations.filter((prestation) => (prestation.idPrestationList === idPrestationType) && (prestation.paid === true && prestation.signed === true && prestation.
|
|
47
|
+
const samePrestation = prestations.filter((prestation) => (prestation.idPrestationList === idPrestationType) && (prestation.paid === true && prestation.signed === true && prestation.terminationList === null));
|
|
44
48
|
|
|
45
49
|
// If there is no prestation with the same idPrestationList, return 100% of points
|
|
46
50
|
if (samePrestation.length === 0) return numberPoint;
|
|
47
51
|
|
|
48
|
-
// If the prestation is in the list of half price prestation, return 50% of points
|
|
49
|
-
if (prestationHalfPriceIds.includes(idPrestationType)) return numberPoint * 0.5;
|
|
50
|
-
|
|
51
52
|
return 0;
|
|
52
53
|
};
|
|
53
54
|
|