@silexpert/core 1.0.163 → 1.0.167

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.
Files changed (135) hide show
  1. package/es/api/resources/Prestations.d.ts +24 -0
  2. package/es/api/resources/Prestations.d.ts.map +1 -0
  3. package/es/api/resources/Prestations.js +29 -0
  4. package/es/api/resources/Prestations.js.map +1 -0
  5. package/es/api/resources/Quotation.d.ts +17 -0
  6. package/es/api/resources/Quotation.d.ts.map +1 -0
  7. package/es/api/resources/Quotation.js +20 -0
  8. package/es/api/resources/Quotation.js.map +1 -0
  9. package/es/api/resources/Rating.d.ts +18 -0
  10. package/es/api/resources/Rating.d.ts.map +1 -0
  11. package/es/api/resources/Rating.js +20 -0
  12. package/es/api/resources/Rating.js.map +1 -0
  13. package/es/api/resources.d.ts +6 -0
  14. package/es/api/resources.d.ts.map +1 -1
  15. package/es/api/resources.js +6 -0
  16. package/es/api/resources.js.map +1 -1
  17. package/es/types/Enum/AbsenceType.d.ts +4 -3
  18. package/es/types/Enum/AbsenceType.d.ts.map +1 -1
  19. package/es/types/Enum/AbsenceType.js +5 -0
  20. package/es/types/Enum/AbsenceType.js.map +1 -1
  21. package/es/types/Enum/AdminAcceptance.d.ts +11 -0
  22. package/es/types/Enum/AdminAcceptance.d.ts.map +1 -0
  23. package/es/types/Enum/AdminAcceptance.js +26 -0
  24. package/es/types/Enum/AdminAcceptance.js.map +1 -0
  25. package/es/types/Enum/BalanceSheet.d.ts.map +1 -1
  26. package/es/types/Enum/BalanceSheet.js +1 -0
  27. package/es/types/Enum/BalanceSheet.js.map +1 -1
  28. package/es/types/Enum/Channel.d.ts +3 -1
  29. package/es/types/Enum/Channel.d.ts.map +1 -1
  30. package/es/types/Enum/Channel.js +2 -0
  31. package/es/types/Enum/Channel.js.map +1 -1
  32. package/es/types/Enum/ConstitutionState.d.ts.map +1 -1
  33. package/es/types/Enum/ConstitutionState.js +8 -2
  34. package/es/types/Enum/ConstitutionState.js.map +1 -1
  35. package/es/types/Enum/PrestationListType.d.ts +11 -0
  36. package/es/types/Enum/PrestationListType.d.ts.map +1 -0
  37. package/es/types/Enum/PrestationListType.js +26 -0
  38. package/es/types/Enum/PrestationListType.js.map +1 -0
  39. package/es/types/Interface/api/prestations/QueryCreate.d.ts +20 -0
  40. package/es/types/Interface/api/prestations/QueryCreate.d.ts.map +1 -0
  41. package/es/types/Interface/api/prestations/QueryCreate.js +116 -0
  42. package/es/types/Interface/api/prestations/QueryCreate.js.map +1 -0
  43. package/es/types/Interface/api/prestations/QueryGetAllPrestations.d.ts +6 -0
  44. package/es/types/Interface/api/prestations/QueryGetAllPrestations.d.ts.map +1 -0
  45. package/es/types/Interface/api/prestations/QueryGetAllPrestations.js +36 -0
  46. package/es/types/Interface/api/prestations/QueryGetAllPrestations.js.map +1 -0
  47. package/es/types/Interface/api/prestations/QueryUpdate.d.ts +22 -0
  48. package/es/types/Interface/api/prestations/QueryUpdate.d.ts.map +1 -0
  49. package/es/types/Interface/api/prestations/QueryUpdate.js +131 -0
  50. package/es/types/Interface/api/prestations/QueryUpdate.js.map +1 -0
  51. package/es/types/Interface/api/quotation/ReadClientQuotation.d.ts +20 -0
  52. package/es/types/Interface/api/quotation/ReadClientQuotation.d.ts.map +1 -0
  53. package/es/types/Interface/api/quotation/ReadClientQuotation.js +2 -0
  54. package/es/types/Interface/api/quotation/ReadClientQuotation.js.map +1 -0
  55. package/es/types/Interface/api/rating/QueryRatingPaginated.d.ts +6 -0
  56. package/es/types/Interface/api/rating/QueryRatingPaginated.d.ts.map +1 -0
  57. package/es/types/Interface/api/rating/QueryRatingPaginated.js +42 -0
  58. package/es/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -0
  59. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts +1 -1
  60. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts.map +1 -1
  61. package/es/types/Interface/api/task/QueryPaginatedTask.js +3 -3
  62. package/es/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  63. package/es/types/Interface/models/IPrestationList.d.ts +3 -0
  64. package/es/types/Interface/models/IPrestationList.d.ts.map +1 -1
  65. package/es/types/Interface/models/IPrestationList.js.map +1 -1
  66. package/es/types/Interface/models/IRating.d.ts +9 -5
  67. package/es/types/Interface/models/IRating.d.ts.map +1 -1
  68. package/es/types/Interface/models/IRating.js.map +1 -1
  69. package/es/types/index.d.ts +7 -0
  70. package/es/types/index.d.ts.map +1 -1
  71. package/es/types/index.js +7 -0
  72. package/es/types/index.js.map +1 -1
  73. package/es/utils/quotation.d.ts +5 -0
  74. package/es/utils/quotation.d.ts.map +1 -1
  75. package/es/utils/quotation.js +160 -0
  76. package/es/utils/quotation.js.map +1 -1
  77. package/js/api/resources/Prestations.js +38 -0
  78. package/js/api/resources/Prestations.js.map +1 -0
  79. package/js/api/resources/Quotation.js +27 -0
  80. package/js/api/resources/Quotation.js.map +1 -0
  81. package/js/api/resources/Rating.js +29 -0
  82. package/js/api/resources/Rating.js.map +1 -0
  83. package/js/api/resources.js +7 -1
  84. package/js/api/resources.js.map +1 -1
  85. package/js/types/Enum/AbsenceType.js +4 -0
  86. package/js/types/Enum/AbsenceType.js.map +1 -1
  87. package/js/types/Enum/AdminAcceptance.js +26 -0
  88. package/js/types/Enum/AdminAcceptance.js.map +1 -0
  89. package/js/types/Enum/BalanceSheet.js +1 -0
  90. package/js/types/Enum/BalanceSheet.js.map +1 -1
  91. package/js/types/Enum/Channel.js +2 -0
  92. package/js/types/Enum/Channel.js.map +1 -1
  93. package/js/types/Enum/ConstitutionState.js +8 -2
  94. package/js/types/Enum/ConstitutionState.js.map +1 -1
  95. package/js/types/Enum/PrestationListType.js +26 -0
  96. package/js/types/Enum/PrestationListType.js.map +1 -0
  97. package/js/types/Interface/api/prestations/QueryCreate.js +39 -0
  98. package/js/types/Interface/api/prestations/QueryCreate.js.map +1 -0
  99. package/js/types/Interface/api/prestations/QueryGetAllPrestations.js +26 -0
  100. package/js/types/Interface/api/prestations/QueryGetAllPrestations.js.map +1 -0
  101. package/js/types/Interface/api/prestations/QueryUpdate.js +40 -0
  102. package/js/types/Interface/api/prestations/QueryUpdate.js.map +1 -0
  103. package/js/types/Interface/api/quotation/ReadClientQuotation.js +6 -0
  104. package/js/types/Interface/api/quotation/ReadClientQuotation.js.map +1 -0
  105. package/js/types/Interface/api/rating/QueryRatingPaginated.js +40 -0
  106. package/js/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -0
  107. package/js/types/Interface/api/task/QueryPaginatedTask.js +1 -1
  108. package/js/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  109. package/js/types/Interface/models/IPrestationList.js.map +1 -1
  110. package/js/types/Interface/models/IRating.js.map +1 -1
  111. package/js/types/index.js +70 -0
  112. package/js/types/index.js.map +1 -1
  113. package/js/utils/quotation.js +157 -0
  114. package/js/utils/quotation.js.map +1 -1
  115. package/package.json +1 -1
  116. package/ts/api/resources/Prestations.ts +34 -0
  117. package/ts/api/resources/Quotation.ts +22 -0
  118. package/ts/api/resources/Rating.ts +23 -0
  119. package/ts/api/resources.ts +6 -0
  120. package/ts/types/Enum/AbsenceType.ts +6 -1
  121. package/ts/types/Enum/AdminAcceptance.ts +26 -0
  122. package/ts/types/Enum/BalanceSheet.ts +1 -0
  123. package/ts/types/Enum/Channel.ts +2 -0
  124. package/ts/types/Enum/ConstitutionState.ts +8 -2
  125. package/ts/types/Enum/PrestationListType.ts +25 -0
  126. package/ts/types/Interface/api/prestations/QueryCreate.ts +91 -0
  127. package/ts/types/Interface/api/prestations/QueryGetAllPrestations.ts +25 -0
  128. package/ts/types/Interface/api/prestations/QueryUpdate.ts +106 -0
  129. package/ts/types/Interface/api/quotation/ReadClientQuotation.ts +19 -0
  130. package/ts/types/Interface/api/rating/QueryRatingPaginated.ts +29 -0
  131. package/ts/types/Interface/api/task/QueryPaginatedTask.ts +3 -3
  132. package/ts/types/Interface/models/IPrestationList.ts +5 -0
  133. package/ts/types/Interface/models/IRating.ts +9 -5
  134. package/ts/types/index.ts +7 -1
  135. package/ts/utils/quotation.ts +178 -0
@@ -4,8 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLeadQuotation = getLeadQuotation;
7
+ exports.getClientQuotation = getClientQuotation;
8
+ exports.compareTwoCotation = compareTwoCotation;
9
+ var _dayjs = require("dayjs");
10
+ var dayjs = _interopRequireWildcard(_dayjs);
7
11
  var _MailDomainType = require("../types/Enum/MailDomainType");
8
12
  var _Activity = require("../types/Enum/Activity");
13
+ var _ComptaType = require("../types/Enum/ComptaType");
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
+ 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; }
9
16
  function getLeadQuotation(params) {
10
17
  const {
11
18
  firstname,
@@ -104,4 +111,154 @@ function getLeadQuotation(params) {
104
111
  }
105
112
  return quotation;
106
113
  }
114
+ /* besoin en entré de la société concerné avec les différents imports (society), ainsi que la liste des autres sociétés ou l'owner est owner (otherSocieties) */
115
+ function getClientQuotation(society, otherSocieties, lastNotice, unpaidDetails, reports, societyProcedings, tabBankAccount, firstPaiement) {
116
+ var _a, _b, _c, _d, _e, _f;
117
+ let quotationPositive = 0;
118
+ let quotationNegative = 0;
119
+ let quotation = 0;
120
+ const detailQuotation = {
121
+ signature: 0,
122
+ seniority: 0,
123
+ additionalBenefits: 0,
124
+ additionalCompanies: 0,
125
+ unpayed: 0,
126
+ updatedAnnotations: 0,
127
+ bankSynchronization: 0,
128
+ rating: 0,
129
+ labRefused: 0,
130
+ ongoingProceedings: 0,
131
+ report: 0,
132
+ termination: 0,
133
+ created: 0
134
+ };
135
+ // calcul de l'ancienneté de la société
136
+ const anciennete = (firstPaiement === null || firstPaiement === void 0 ? void 0 : firstPaiement.length) > 0 ? dayjs().diff(dayjs(firstPaiement[0].datePayment, 'YYYY-MM-DD'), 'years') : 0;
137
+ const ponderation = anciennete * 0.1 + 1;
138
+ /* Type de comptabilité du client (Tresorerie (+10) / Engagement (+15)) */
139
+ if (society.idComptaType) {
140
+ if ([_ComptaType.ComptaType.CASH_BASED, _ComptaType.ComptaType.CASH_BASED_ASSISTANCE, _ComptaType.ComptaType.CASH_BASED_SEIZURE].includes(society.idComptaType)) {
141
+ quotationPositive += 10;
142
+ detailQuotation.signature += 10;
143
+ } else if ([_ComptaType.ComptaType.ACCRUALS, _ComptaType.ComptaType.ACCRUALS_ASSISTANCE, _ComptaType.ComptaType.ACCRUALS_SEIZURE].includes(society.idComptaType)) {
144
+ quotationPositive += 15;
145
+ detailQuotation.signature += 15;
146
+ }
147
+ }
148
+ /* Ancienneté (1 ans < firstPaiement < 2 ans (+10) / 2 ans < firstPaiement (+20 / année)) */
149
+ if ((firstPaiement === null || firstPaiement === void 0 ? void 0 : firstPaiement.length) > 0) {
150
+ const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(firstPaiement[0].datePayment).getFullYear());
151
+ if (yearAsClient === 1) {
152
+ quotationPositive += 10;
153
+ detailQuotation.seniority += 10;
154
+ } else if (yearAsClient > 1) {
155
+ quotationPositive += 20 * (yearAsClient - 1) + 10;
156
+ detailQuotation.seniority += 20 * (yearAsClient - 1) + 10;
157
+ }
158
+ }
159
+ /* Prestations Complémentaires (+5 / prestation) */
160
+ if ((_a = society.prestationsSocieties) === null || _a === void 0 ? void 0 : _a.length) {
161
+ const prestationsCompl = society.prestationsSocieties.filter(prestation => prestation.idPrestationComplementary);
162
+ prestationsCompl.forEach(() => {
163
+ quotationPositive += Math.ceil(5 * ponderation);
164
+ detailQuotation.additionalBenefits += Math.ceil(5 * ponderation);
165
+ });
166
+ }
167
+ /* Sociétés supplémentaires (+8 / société) */
168
+ if (otherSocieties.length) {
169
+ quotationPositive += Math.ceil(8 * otherSocieties.length * ponderation);
170
+ detailQuotation.additionalCompanies += Math.ceil(8 * otherSocieties.length * ponderation);
171
+ }
172
+ /* Impayés (-15 / mois) */
173
+ if (unpaidDetails.length) {
174
+ quotationNegative -= Math.ceil(15 * unpaidDetails.length * ponderation);
175
+ detailQuotation.unpayed -= Math.ceil(15 * unpaidDetails.length * ponderation);
176
+ }
177
+ /* annotations à jour */
178
+ if ((_b = tabBankAccount.societyAccountingTransactions) === null || _b === void 0 ? void 0 : _b.length) {
179
+ // on check s'il y a 80% des lignes annotées (dateLocked)
180
+ let countNotAnnoted = 0;
181
+ let percentageAnnotations = 100;
182
+ tabBankAccount.societyAccountingTransactions.map(na => {
183
+ if (na.dateLocked === null) {
184
+ countNotAnnoted += 1;
185
+ }
186
+ return countNotAnnoted;
187
+ });
188
+ if (countNotAnnoted !== 0) percentageAnnotations = countNotAnnoted / ((_c = tabBankAccount.societyAccountingTransactions) === null || _c === void 0 ? void 0 : _c.length) * 100;
189
+ if (percentageAnnotations >= 80) {
190
+ quotationPositive += Math.ceil(12 * ponderation);
191
+ detailQuotation.updatedAnnotations += Math.ceil(12 * ponderation);
192
+ } else {
193
+ quotationNegative -= Math.ceil(12 * ponderation);
194
+ detailQuotation.updatedAnnotations -= Math.ceil(12 * ponderation);
195
+ }
196
+ }
197
+ /* synchronisation bancaire */
198
+ if ((_d = tabBankAccount.societyActivatedBankAccounts) === null || _d === void 0 ? void 0 : _d.length) {
199
+ // comptes synchro
200
+ const synchro = tabBankAccount.societyActivatedBankAccounts.length - tabBankAccount.desactivatedBankAccount.length;
201
+ quotationPositive += Math.ceil(12 * synchro * ponderation);
202
+ detailQuotation.bankSynchronization += Math.ceil(12 * synchro * ponderation);
203
+ // comptes desynchro
204
+ quotationNegative -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);
205
+ detailQuotation.bankSynchronization -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);
206
+ }
207
+ /* avis */
208
+ if (lastNotice && lastNotice.data.length === 1) {
209
+ if (lastNotice.data[0].average === 5) {
210
+ quotationPositive += Math.ceil(10 * ponderation);
211
+ detailQuotation.rating += Math.ceil(10 * ponderation);
212
+ } else {
213
+ quotationNegative -= 10;
214
+ detailQuotation.rating -= 10;
215
+ }
216
+ }
217
+ /* LAB refusée */
218
+ if (!((_e = society.societyDetail) === null || _e === void 0 ? void 0 : _e.acceptation)) {
219
+ quotationNegative -= 10;
220
+ detailQuotation.labRefused -= 10;
221
+ }
222
+ /* Cessation de paiement - redressement judiciaire - procédure en cours / signalements / résiliation */
223
+ if (societyProcedings === null || societyProcedings === void 0 ? void 0 : societyProcedings.length) {
224
+ quotationNegative -= 5 * societyProcedings.length;
225
+ detailQuotation.ongoingProceedings -= 5 * societyProcedings.length;
226
+ }
227
+ if (reports === null || reports === void 0 ? void 0 : reports.length) {
228
+ quotationNegative -= 10;
229
+ detailQuotation.report -= 10;
230
+ }
231
+ if (society.isWaitingEnd) {
232
+ quotationNegative -= 50;
233
+ detailQuotation.termination -= 50;
234
+ }
235
+ /* Création chez nous */
236
+ if ((_f = society.prestationsSocieties) === null || _f === void 0 ? void 0 : _f.length) {
237
+ const prestationsCreation = society.prestationsSocieties.filter(prestation => prestation.idPrestationList === 15); // creation pas d'enum
238
+ prestationsCreation.forEach(() => {
239
+ quotationPositive += 10;
240
+ detailQuotation.created += 10;
241
+ });
242
+ }
243
+ if (quotationPositive > 100) quotationPositive = 100;
244
+ if (quotationNegative > 100) quotationNegative = 100;
245
+ quotation = quotationPositive + quotationNegative;
246
+ if (quotation < 0) quotation = 0;
247
+ return {
248
+ cotation: quotation,
249
+ data: detailQuotation,
250
+ idSociety: society.id
251
+ };
252
+ }
253
+ function compareTwoCotation(cotations) {
254
+ // on recupere les 2 dernieres cotations de la societe
255
+ const higher = false;
256
+ if (cotations[0].cotation === cotations[1].cotation) {
257
+ return null;
258
+ }
259
+ if (cotations[0].cotation > cotations[1].cotation) {
260
+ return true;
261
+ }
262
+ return higher;
263
+ }
107
264
  //# sourceMappingURL=quotation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quotation.js","names":["getLeadQuotation","_MailDomainType","require","_Activity","params","firstname","lastname","phone","mail","annualTurnover","source","alreadyExist","activitySector","includes","quotation","substr","BasicDomain","find","domain","ForbidenDomain","Date","getDay","dateTime","year","getFullYear","month","getMonth","day","getDate","startTime","endTime","getTime","fieldNumber","filter","data","length","Activity","INFORMATIQUE","CONSEIL","TRANSPORT","BTP","RESTAURATION","COMMERCANT","MEDICAL","PROF_LIB"],"sources":["../../ts/utils/quotation.ts"],"sourcesContent":["import { ForbidenDomain, BasicDomain } from '../types/Enum/MailDomainType';\nimport { Activity } from '../types/Enum/Activity';\n\ntype getLeadQuotationParams = {\n firstname: string,\n lastname: string,\n phone: string,\n mail: string,\n annualTurnover: number,\n source: number,\n alreadyExist: boolean,\n activitySector: number,\n};\n\nexport function getLeadQuotation(params: getLeadQuotationParams):number {\n const {\n firstname, lastname, phone, mail, annualTurnover, source, alreadyExist, activitySector,\n } = params;\n if (\n firstname === 'test'\n || lastname === 'test'\n || mail?.includes('test')\n || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)\n ) {\n return 0;\n }\n let quotation = 0;\n\n /* cotation du prénom */\n if (firstname) quotation += 5;\n\n /* cotation du nom */\n if (lastname) quotation += 5;\n\n /* cotation du numéro de téléphone */\n if (['6', '7'].includes(phone.substr(0, 1))) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n\n /* cotation de l'adresse email */\n if (BasicDomain.find((domain) => mail?.includes(domain))) {\n quotation += 5;\n } else\n if (!ForbidenDomain.find((domain) => mail?.includes(domain))) {\n quotation += 15;\n }\n\n /* cotation du CA annuel */\n if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {\n quotation += 10;\n } else if ([50000, 234000].includes(annualTurnover)) {\n quotation += 5;\n }\n\n /* cotation de la date d'ajout */\n if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {\n const dateTime = new Date();\n const year = dateTime.getFullYear();\n const month = dateTime.getMonth();\n const day = dateTime.getDate();\n const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);\n const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);\n if ((startTime.getTime() <= dateTime.getTime()) && (endTime.getTime() >= dateTime.getTime())) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n } else {\n quotation += 5;\n }\n\n /* cotation de la source */\n /* Parrainage */\n if (source === 49) {\n quotation += 10;\n\n /* calendly, appel entrant */\n } else if (source === 2) {\n quotation += 8;\n\n /* adWords, Bing, Formulaire */\n } else if (source === 4) {\n quotation += 6;\n\n /* Chat, Whatsapp */\n } else if ([29, 92].includes(source)) {\n quotation += 2;\n }\n\n /* cotation de la qualité (nombre de champs remplis) */\n const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter((data) => !!data).length;\n switch (fieldNumber) {\n case 6:\n quotation += 10;\n break;\n case 5:\n quotation += 8;\n break;\n case 4:\n quotation += 6;\n break;\n case 3:\n quotation += 4;\n break;\n case 2:\n quotation += 2;\n break;\n default:\n break;\n }\n\n /* cotation de l'existence du lead (déjà existant ou non) */\n if (alreadyExist) quotation += 8;\n\n /* cotation du secteur d'activité */\n if ([Activity.INFORMATIQUE, Activity.CONSEIL].includes(activitySector)) {\n quotation += 10;\n } else if ([Activity.TRANSPORT, Activity.BTP, Activity.RES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exports","getClientQuotation","compareTwoCotation","_dayjs","require","dayjs","_interopRequireWildcard","_MailDomainType","_Activity","_ComptaType","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","params","firstname","lastname","phone","mail","annualTurnover","source","alreadyExist","activitySector","includes","quotation","substr","BasicDomain","find","domain","ForbidenDomain","Date","getDay","dateTime","year","getFullYear","month","getMonth","day","getDate","startTime","endTime","getTime","fieldNumber","filter","data","length","Activity","INFORMATIQUE","CONSEIL","TRANSPORT","BTP","RESTAURATION","COMMERCANT","MEDICAL","PROF_LIB","society","otherSocieties","lastNotice","unpaidDetails","reports","societyProcedings","tabBankAccount","firstPaiement","quotationPositive","quotationNegative","detailQuotation","signature","seniority","additionalBenefits","additionalCompanies","unpayed","updatedAnnotations","bankSynchronization","rating","labRefused","ongoingProceedings","report","termination","created","anciennete","diff","datePayment","ponderation","idComptaType","ComptaType","CASH_BASED","CASH_BASED_ASSISTANCE","CASH_BASED_SEIZURE","ACCRUALS","ACCRUALS_ASSISTANCE","ACCRUALS_SEIZURE","yearAsClient","Number","_a","prestationsSocieties","prestationsCompl","prestation","idPrestationComplementary","forEach","Math","ceil","_b","societyAccountingTransactions","countNotAnnoted","percentageAnnotations","map","na","dateLocked","_c","_d","societyActivatedBankAccounts","synchro","desactivatedBankAccount","average","_e","societyDetail","acceptation","isWaitingEnd","_f","prestationsCreation","idPrestationList","cotation","idSociety","id","cotations","higher"],"sources":["../../ts/utils/quotation.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { ForbidenDomain, BasicDomain } from '../types/Enum/MailDomainType';\nimport { Activity } from '../types/Enum/Activity';\nimport { ComptaType } from '../types/Enum/ComptaType';\nimport { ISociety } from '../types/Interface/models/ISociety';\nimport { ICotation } from '../types/Interface/models/ICotation';\nimport {\n BasePaginate,\n IPayment,\n IRating, IReport, ISocietyProceding, ReadClientQuotation,\n} from '../types';\n\ntype getLeadQuotationParams = {\n firstname: string,\n lastname: string,\n phone: string,\n mail: string,\n annualTurnover: number,\n source: number,\n alreadyExist: boolean,\n activitySector: number,\n};\n\nexport function getLeadQuotation(params: getLeadQuotationParams):number {\n const {\n firstname, lastname, phone, mail, annualTurnover, source, alreadyExist, activitySector,\n } = params;\n if (\n firstname === 'test'\n || lastname === 'test'\n || mail?.includes('test')\n || ['606060606', '707070707', '612345678', '712345678', '687654321', '787654321'].includes(phone)\n ) {\n return 0;\n }\n let quotation = 0;\n\n /* cotation du prénom */\n if (firstname) quotation += 5;\n\n /* cotation du nom */\n if (lastname) quotation += 5;\n\n /* cotation du numéro de téléphone */\n if (['6', '7'].includes(phone.substr(0, 1))) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n\n /* cotation de l'adresse email */\n if (BasicDomain.find((domain) => mail?.includes(domain))) {\n quotation += 5;\n } else\n if (!ForbidenDomain.find((domain) => mail?.includes(domain))) {\n quotation += 15;\n }\n\n /* cotation du CA annuel */\n if ([0, 150000, 400000, 783000, 783001].includes(annualTurnover)) {\n quotation += 10;\n } else if ([50000, 234000].includes(annualTurnover)) {\n quotation += 5;\n }\n\n /* cotation de la date d'ajout */\n if ([1, 2, 3, 4, 5].includes(new Date().getDay())) {\n const dateTime = new Date();\n const year = dateTime.getFullYear();\n const month = dateTime.getMonth();\n const day = dateTime.getDate();\n const startTime = new Date(`${year}-${month + 1}-${day} 08:45:00`);\n const endTime = new Date(`${year}-${month + 1}-${day} 18:45:00`);\n if ((startTime.getTime() <= dateTime.getTime()) && (endTime.getTime() >= dateTime.getTime())) {\n quotation += 15;\n } else {\n quotation += 5;\n }\n } else {\n quotation += 5;\n }\n\n /* cotation de la source */\n /* Parrainage */\n if (source === 49) {\n quotation += 10;\n\n /* calendly, appel entrant */\n } else if (source === 2) {\n quotation += 8;\n\n /* adWords, Bing, Formulaire */\n } else if (source === 4) {\n quotation += 6;\n\n /* Chat, Whatsapp */\n } else if ([29, 92].includes(source)) {\n quotation += 2;\n }\n\n /* cotation de la qualité (nombre de champs remplis) */\n const fieldNumber = [firstname, lastname, phone, mail, annualTurnover, activitySector].filter((data) => !!data).length;\n switch (fieldNumber) {\n case 6:\n quotation += 10;\n break;\n case 5:\n quotation += 8;\n break;\n case 4:\n quotation += 6;\n break;\n case 3:\n quotation += 4;\n break;\n case 2:\n quotation += 2;\n break;\n default:\n break;\n }\n\n /* cotation de l'existence du lead (déjà existant ou non) */\n if (alreadyExist) quotation += 8;\n\n /* cotation du secteur d'activité */\n if ([Activity.INFORMATIQUE, Activity.CONSEIL].includes(activitySector)) {\n quotation += 10;\n } else if ([Activity.TRANSPORT, Activity.BTP, Activity.RESTAURATION, Activity.COMMERCANT, Activity.MEDICAL, Activity.PROF_LIB].includes(activitySector)) {\n quotation += 5;\n }\n\n return quotation;\n}\n\n/* besoin en entré de la société concerné avec les différents imports (society), ainsi que la liste des autres sociétés ou l'owner est owner (otherSocieties) */\nexport function getClientQuotation(society: ISociety, otherSocieties: ISociety[], lastNotice: BasePaginate<IRating>, unpaidDetails: [], reports: IReport[], societyProcedings: ISocietyProceding[], tabBankAccount: any, firstPaiement: IPayment[]): ReadClientQuotation {\n let quotationPositive = 0;\n let quotationNegative = 0;\n let quotation = 0;\n const detailQuotation = {\n signature: 0,\n seniority: 0,\n additionalBenefits: 0,\n additionalCompanies: 0,\n unpayed: 0,\n updatedAnnotations: 0,\n bankSynchronization: 0,\n rating: 0,\n labRefused: 0,\n ongoingProceedings: 0,\n report: 0,\n termination: 0,\n created: 0,\n };\n\n // calcul de l'ancienneté de la société\n const anciennete = firstPaiement?.length > 0 ? dayjs().diff(dayjs(firstPaiement[0].datePayment, 'YYYY-MM-DD'), 'years') : 0;\n const ponderation = (anciennete * 0.1) + 1;\n\n /* Type de comptabilité du client (Tresorerie (+10) / Engagement (+15)) */\n if (society.idComptaType) {\n if ([ComptaType.CASH_BASED, ComptaType.CASH_BASED_ASSISTANCE, ComptaType.CASH_BASED_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 10;\n detailQuotation.signature += 10;\n } else if ([ComptaType.ACCRUALS, ComptaType.ACCRUALS_ASSISTANCE, ComptaType.ACCRUALS_SEIZURE].includes(society.idComptaType)) {\n quotationPositive += 15;\n detailQuotation.signature += 15;\n }\n }\n\n /* Ancienneté (1 ans < firstPaiement < 2 ans (+10) / 2 ans < firstPaiement (+20 / année)) */\n if (firstPaiement?.length > 0) {\n const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(firstPaiement[0].datePayment).getFullYear());\n if (yearAsClient === 1) {\n quotationPositive += 10;\n detailQuotation.seniority += 10;\n } else if (yearAsClient > 1) {\n quotationPositive += (20 * (yearAsClient - 1) + 10);\n detailQuotation.seniority += (20 * (yearAsClient - 1) + 10);\n }\n }\n\n /* Prestations Complémentaires (+5 / prestation) */\n if (society.prestationsSocieties?.length) {\n const prestationsCompl = society.prestationsSocieties.filter((prestation) => prestation.idPrestationComplementary);\n prestationsCompl.forEach(() => {\n quotationPositive += Math.ceil(5 * ponderation);\n detailQuotation.additionalBenefits += Math.ceil(5 * ponderation);\n });\n }\n\n /* Sociétés supplémentaires (+8 / société) */\n if (otherSocieties.length) {\n quotationPositive += Math.ceil(8 * otherSocieties.length * ponderation);\n detailQuotation.additionalCompanies += Math.ceil(8 * otherSocieties.length * ponderation);\n }\n\n /* Impayés (-15 / mois) */\n if (unpaidDetails.length) {\n quotationNegative -= Math.ceil(15 * unpaidDetails.length * ponderation);\n detailQuotation.unpayed -= Math.ceil(15 * unpaidDetails.length * ponderation);\n }\n\n /* annotations à jour */\n if (tabBankAccount.societyAccountingTransactions?.length) {\n // on check s'il y a 80% des lignes annotées (dateLocked)\n let countNotAnnoted = 0;\n let percentageAnnotations = 100;\n tabBankAccount.societyAccountingTransactions.map((na:any) => {\n if (na.dateLocked === null) {\n countNotAnnoted += 1;\n }\n return countNotAnnoted;\n });\n if (countNotAnnoted !== 0) percentageAnnotations = (countNotAnnoted / tabBankAccount.societyAccountingTransactions?.length) * 100;\n if (percentageAnnotations >= 80) {\n quotationPositive += Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations += Math.ceil(12 * ponderation);\n } else {\n quotationNegative -= Math.ceil(12 * ponderation);\n detailQuotation.updatedAnnotations -= Math.ceil(12 * ponderation);\n }\n }\n\n /* synchronisation bancaire */\n if (tabBankAccount.societyActivatedBankAccounts?.length) {\n // comptes synchro\n const synchro = tabBankAccount.societyActivatedBankAccounts.length - tabBankAccount.desactivatedBankAccount.length;\n quotationPositive += Math.ceil(12 * synchro * ponderation);\n detailQuotation.bankSynchronization += Math.ceil(12 * synchro * ponderation);\n\n // comptes desynchro\n quotationNegative -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n detailQuotation.bankSynchronization -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);\n }\n\n /* avis */\n if (lastNotice && lastNotice.data.length === 1) {\n if (lastNotice.data[0].average === 5) {\n quotationPositive += Math.ceil(10 * ponderation);\n detailQuotation.rating += Math.ceil(10 * ponderation);\n } else {\n quotationNegative -= 10;\n detailQuotation.rating -= 10;\n }\n }\n\n /* LAB refusée */\n if (!society.societyDetail?.acceptation) {\n quotationNegative -= 10;\n detailQuotation.labRefused -= 10;\n }\n\n /* Cessation de paiement - redressement judiciaire - procédure en cours / signalements / résiliation */\n if (societyProcedings?.length) {\n quotationNegative -= 5 * societyProcedings.length;\n detailQuotation.ongoingProceedings -= 5 * societyProcedings.length;\n }\n\n if (reports?.length) {\n quotationNegative -= 10;\n detailQuotation.report -= 10;\n }\n\n if (society.isWaitingEnd) {\n quotationNegative -= 50;\n detailQuotation.termination -= 50;\n }\n\n /* Création chez nous */\n if (society.prestationsSocieties?.length) {\n const prestationsCreation = society.prestationsSocieties.filter((prestation) => prestation.idPrestationList === 15); // creation pas d'enum\n prestationsCreation.forEach(() => {\n quotationPositive += 10;\n detailQuotation.created += 10;\n });\n }\n\n if (quotationPositive > 100) quotationPositive = 100;\n if (quotationNegative > 100) quotationNegative = 100;\n\n quotation = quotationPositive + quotationNegative;\n\n if (quotation < 0) quotation = 0;\n\n return {\n cotation: quotation,\n data: detailQuotation,\n idSociety: society.id as number,\n };\n}\n\nexport function compareTwoCotation(cotations: ICotation[]):boolean | null {\n // on recupere les 2 dernieres cotations de la societe\n const higher = false;\n if (cotations[0].cotation === cotations[1].cotation) {\n return null;\n } if (cotations[0].cotation > cotations[1].cotation) {\n return true;\n }\n return higher;\n}"],"mappings":";;;;;QAuBgBA,gBAAgB,GAAhBA,gBAAgB;AAAAC,OAAA,CAiHhBC,kBAAkB,GAAlBA,kBAAkB;AAAAD,OAAA,CA6JlBE,kBAAkB,GAAlBA,kBAAkB;AArSlC,IAAAC,MAAA,GAAAC,OAAA;AAA+B,IAAnBC,KAAK,GAAAC,uBAAA,CAAAH,MAAA;AACjB,IAAAI,eAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAsD,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA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iBAAiB,IAAI,EAAE;MACvBE,eAAe,CAACa,OAAO,IAAI,EAAE;IAC/B,CAAC,CAAC;;EAGJ,IAAIf,iBAAiB,GAAG,GAAG,EAAEA,iBAAiB,GAAG,GAAG;EACpD,IAAIC,iBAAiB,GAAG,GAAG,EAAEA,iBAAiB,GAAG,GAAG;EAEpDxC,SAAS,GAAGuC,iBAAiB,GAAGC,iBAAiB;EAEjD,IAAIxC,SAAS,GAAG,CAAC,EAAEA,SAAS,GAAG,CAAC;EAEhC,OAAO;IACLiG,QAAQ,EAAEjG,SAAS;IACnBoB,IAAI,EAAEqB,eAAe;IACrByD,SAAS,EAAEnE,OAAO,CAACoE;GACpB;AACH;AAEM,SAAU3I,kBAAkBA,CAAC4I,SAAsB;EACvD;EACA,MAAMC,MAAM,GAAG,KAAK;EACpB,IAAID,SAAS,CAAC,CAAC,CAAC,CAACH,QAAQ,KAAKG,SAAS,CAAC,CAAC,CAAC,CAACH,QAAQ,EAAE;IACnD,OAAO,IAAI;;EACX,IAAIG,SAAS,CAAC,CAAC,CAAC,CAACH,QAAQ,GAAGG,SAAS,CAAC,CAAC,CAAC,CAACH,QAAQ,EAAE;IACnD,OAAO,IAAI;;EAEb,OAAOI,MAAM;AACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.0.163",
3
+ "version": "1.0.167",
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",
@@ -0,0 +1,34 @@
1
+ import {
2
+ IPrestationList, QueryCreatePrestations, QueryUpdatePrestations, QueryGetAllPrestations,
3
+ } from '../../types';
4
+ import { Resource } from '../Resource';
5
+
6
+ export class Prestations extends Resource {
7
+ /**
8
+ * Crée un enregistrement dans la table prestationList
9
+ * @param { QueryUpdatePrestations } data
10
+ * @returns { IPrestationList }
11
+ */
12
+ create(data: QueryCreatePrestations): Promise<IPrestationList> {
13
+ return this.axios.$post('prestations', data);
14
+ }
15
+
16
+ /**
17
+ * update un enregistrement dans la table prestationList
18
+ * @param { number } id
19
+ * @param { QueryCreatePrestations } data
20
+ * @returns { boolean }
21
+ */
22
+ update(id: number, data: QueryUpdatePrestations): Promise<boolean> {
23
+ return this.axios.$put(`prestations/${id}`, data);
24
+ }
25
+
26
+ /**
27
+ * update un enregistrement dans la table prestationList
28
+ * @param { QueryGetAllPrestations } data
29
+ * @returns { boolean }
30
+ */
31
+ getAll(params: QueryGetAllPrestations): Promise<IPrestationList[]> {
32
+ return this.axios.$get('prestations/all', { params });
33
+ }
34
+ }
@@ -0,0 +1,22 @@
1
+ import { ICotation } from '../../types/Interface/models/ICotation';
2
+ import { Resource } from '../Resource';
3
+
4
+ export class Quotation extends Resource {
5
+ /**
6
+ * Compare l'évolution entre les 2 derniere cotation
7
+ * @param { number } idSociety
8
+ * @returns { boolean }
9
+ */
10
+ public compareQuotation(idSociety: number): Promise<boolean | null> {
11
+ return this.axios.$get(`/quotation/compare/${idSociety}`);
12
+ }
13
+
14
+ /**
15
+ * Retourne la derniere cotation enregistrée
16
+ * @param { number } idSociety
17
+ * @returns { Cotation }
18
+ */
19
+ getLast(idSociety: number): Promise<ICotation> {
20
+ return this.axios.$get(`/quotation/${idSociety}`);
21
+ }
22
+ }
@@ -0,0 +1,23 @@
1
+ import { CancelToken } from 'axios';
2
+ import { Resource } from '../Resource';
3
+ import { BasePaginate, IRating, QueryRatingPaginated } from '../../types';
4
+
5
+ export class Rating extends Resource {
6
+ /**
7
+ * Creation d'un avis sur le clementinier qu'un client a deposé
8
+ * @param { IRating } payload
9
+ * @returns { IRating }
10
+ */
11
+ createRating(payload: IRating, cancelToken?: CancelToken): Promise<IRating> {
12
+ return this.axios.$post('/ratings', payload);
13
+ }
14
+
15
+ /**
16
+ * Retourne les enregistrement de la table rating sous format paginé
17
+ * @param { QueryRatingPaginated } params
18
+ * @returns { BasePaginate<IRating> }
19
+ */
20
+ public getPaginate(params: QueryRatingPaginated): Promise<BasePaginate<IRating>> {
21
+ return this.axios.$get('/ratings/paginate', { params });
22
+ }
23
+ }
@@ -117,6 +117,9 @@ import { SignFile } from './resources/SignFile';
117
117
  import { Rule } from './resources/Rule';
118
118
  import { VatRegimeHistory } from './resources/VatRegimeHistory';
119
119
  import { Acceptance } from './resources/Acceptance';
120
+ import { Rating } from './resources/Rating';
121
+ import { Quotation } from './resources/Quotation';
122
+ import { Prestations } from './resources/Prestations';
120
123
 
121
124
  export const resources = {
122
125
  simulation: Simulation,
@@ -237,5 +240,8 @@ export const resources = {
237
240
  societyConfigBalanceSheet: SocietyConfigBalanceSheet,
238
241
  signFile: SignFile,
239
242
  rule: Rule,
243
+ rating: Rating,
240
244
  acceptance: Acceptance,
245
+ quotation: Quotation,
246
+ prestations: Prestations,
241
247
  };
@@ -7,9 +7,10 @@ export enum AbsenceType {
7
7
  REMOTE = 6,
8
8
  SCHOOL = 7,
9
9
  UNJUSTIFIED = 8,
10
+ UNPAID_LEAVE = 9,
10
11
  }
11
12
 
12
- export const AbsenceTypeList = [
13
+ export const AbsenceTypeList: Array<{ id: AbsenceType, label: string }> = [
13
14
  {
14
15
  id: AbsenceType.DAY_OFF,
15
16
  label: 'Jours de congé',
@@ -42,4 +43,8 @@ export const AbsenceTypeList = [
42
43
  id: AbsenceType.UNJUSTIFIED,
43
44
  label: 'Absence non justifiée',
44
45
  },
46
+ {
47
+ id: AbsenceType.UNPAID_LEAVE,
48
+ label: 'Congés sans solde',
49
+ },
45
50
  ];
@@ -0,0 +1,26 @@
1
+ export enum AdminAcceptance {
2
+ BEING_ACCEPTED = 0,
3
+ ACCEPTED = 1,
4
+ TO_PROCESSED = 2,
5
+ REFUSED = 3,
6
+ }
7
+
8
+ export const AdminAcceptanceList: Array<{ id: AdminAcceptance; text: String }> =
9
+ [
10
+ {
11
+ id: AdminAcceptance.BEING_ACCEPTED,
12
+ text: "En cours d'acceptation",
13
+ },
14
+ {
15
+ id: AdminAcceptance.ACCEPTED,
16
+ text: 'Accepté',
17
+ },
18
+ {
19
+ id: AdminAcceptance.TO_PROCESSED,
20
+ text: 'À traiter',
21
+ },
22
+ {
23
+ id: AdminAcceptance.REFUSED,
24
+ text: 'Refusé',
25
+ },
26
+ ];
@@ -707,6 +707,7 @@ export const BALANCE_SHEET_LIST_PASSIVE: BalanceSheetList = [
707
707
  },
708
708
  {
709
709
  name: 'TOTAL GENERAL (I+II+III+IV)',
710
+ key: 'total5',
710
711
  total: 0,
711
712
  calculation: true,
712
713
  calculationAdd: ['subscribedCapital', 'issuePremiums', 'equivalenceGap', 'revaluationGap', 'reservations', 'postponement', 'resultExercice', 'subsidies', 'subsidiesRegulated', 'provisions', 'debts', 'total4'],
@@ -1,4 +1,6 @@
1
1
  export enum Channel {
2
2
  COMMENT = 1,
3
3
  PHONE = 2,
4
+ TASK = 4,
5
+ SMS = 5,
4
6
  }
@@ -5,9 +5,12 @@ export enum ConstitutionState {
5
5
  WAITING_INFORMATION_SHEET = 4,
6
6
  WAITING_DEPOSIT_CERTIFICATE = 5,
7
7
  WAITING_SIGNED_DOCS_OR_AL_PAYMENT_OR_COURT_FEES = 6,
8
+ // TODO : A delete une fois plus utilisé
9
+ // ========================
8
10
  WAITING_KBIS = 7,
9
11
  WAITING_RIB_OR_SEPA = 8,
10
12
  INVOICING_TO_D0 = 9,
13
+ // ========================
11
14
  ABANDONED_CASE = 10,
12
15
  }
13
16
 
@@ -22,7 +25,7 @@ export type ConstitutionStateType = {
22
25
  export const ConstitutionStateDetail: ConstitutionStateType = {
23
26
  TO_CONTACT: {
24
27
  value: ConstitutionState.TO_CONTACT,
25
- text: 'À contacter',
28
+ text: 'À contacter et à facturer',
26
29
  color: 'grey lighten-4',
27
30
  },
28
31
  WAITING_INFORMATION_SHEET: {
@@ -40,6 +43,8 @@ export const ConstitutionStateDetail: ConstitutionStateType = {
40
43
  text: 'Attente doc signés / paiement AL / frais de Greffe',
41
44
  color: 'blue lighten-4',
42
45
  },
46
+ // TODO : A delete une fois plus utilisé
47
+ // ========================================
43
48
  WAITING_KBIS: {
44
49
  value: ConstitutionState.WAITING_KBIS,
45
50
  text: 'Attente KBIS',
@@ -55,6 +60,7 @@ export const ConstitutionStateDetail: ConstitutionStateType = {
55
60
  text: 'Facturation à faire',
56
61
  color: 'primary lighten-2',
57
62
  },
63
+ // ========================================
58
64
  ABANDONED_CASE: {
59
65
  value: ConstitutionState.ABANDONED_CASE,
60
66
  text: 'Dossier en abandon',
@@ -67,7 +73,7 @@ export const ConstitutionStateDetail: ConstitutionStateType = {
67
73
  },
68
74
  FINISHED: {
69
75
  value: ConstitutionState.FINISHED,
70
- text: 'Dossier terminé',
76
+ text: 'Dossier Conforme (Envoi KBIS, information & documents et RIB pro)',
71
77
  color: 'success',
72
78
  },
73
79
  };
@@ -0,0 +1,25 @@
1
+ export enum PrestationListType {
2
+ ACCOUNTANT = 1,
3
+ JURIDIC = 2,
4
+ SOCIAL = 3,
5
+ ATTESTATION = 4,
6
+ }
7
+
8
+ export const PrestationListTypeDetail = [
9
+ {
10
+ id: PrestationListType.ACCOUNTANT,
11
+ label: 'Comptable',
12
+ },
13
+ {
14
+ id: PrestationListType.JURIDIC,
15
+ label: 'Juridique',
16
+ },
17
+ {
18
+ id: PrestationListType.SOCIAL,
19
+ label: 'Sociale',
20
+ },
21
+ {
22
+ id: PrestationListType.ATTESTATION,
23
+ label: 'Attestation',
24
+ },
25
+ ];
@@ -0,0 +1,91 @@
1
+ import {
2
+ IsOptional, IsNumber, IsString, IsBoolean,
3
+ } from 'class-validator';
4
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
5
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
+
7
+ export class QueryCreatePrestations {
8
+ @ApiProperty()
9
+ @IsString()
10
+ name: string;
11
+
12
+ @ApiPropertyOptional()
13
+ @IsNumber()
14
+ @IsOptional()
15
+ idFile?: number;
16
+
17
+ @ApiProperty()
18
+ @IsBoolean()
19
+ @ToBoolean()
20
+ isComptable: boolean;
21
+
22
+ @ApiProperty()
23
+ @IsBoolean()
24
+ @ToBoolean()
25
+ isJuridique: boolean;
26
+
27
+ @ApiProperty()
28
+ @IsBoolean()
29
+ @ToBoolean()
30
+ isSocial: boolean;
31
+
32
+ @ApiProperty()
33
+ @IsBoolean()
34
+ @ToBoolean()
35
+ isAttestation: boolean;
36
+
37
+ @ApiProperty()
38
+ @IsBoolean()
39
+ @ToBoolean()
40
+ inAverageCart: boolean;
41
+
42
+ @ApiProperty()
43
+ @IsBoolean()
44
+ @ToBoolean()
45
+ isBack: boolean;
46
+
47
+ @ApiPropertyOptional()
48
+ @IsNumber()
49
+ @IsOptional()
50
+ price?: number;
51
+
52
+ @ApiProperty()
53
+ @IsBoolean()
54
+ @ToBoolean()
55
+ isCatalog: boolean;
56
+
57
+ @ApiProperty()
58
+ @IsBoolean()
59
+ @ToBoolean()
60
+ hidden: boolean;
61
+
62
+ @ApiProperty()
63
+ @IsBoolean()
64
+ @ToBoolean()
65
+ isComplementary: boolean;
66
+
67
+ @ApiPropertyOptional()
68
+ @IsString()
69
+ @IsOptional()
70
+ signaturePosition?: string;
71
+
72
+ @ApiPropertyOptional()
73
+ @IsNumber()
74
+ @IsOptional()
75
+ signaturePage?: number;
76
+
77
+ @ApiPropertyOptional()
78
+ @IsString()
79
+ @IsOptional()
80
+ textDefault?: string;
81
+
82
+ @ApiPropertyOptional()
83
+ @IsString()
84
+ @IsOptional()
85
+ color?: string;
86
+
87
+ @ApiPropertyOptional()
88
+ @IsNumber()
89
+ @IsOptional()
90
+ point?: number;
91
+ }
@@ -0,0 +1,25 @@
1
+ import {
2
+ IsOptional, IsString, IsInt, IsIn, IsBoolean,
3
+ } from 'class-validator';
4
+ import { ApiPropertyOptional } from '../../../../utils';
5
+ import { PrestationListType } from '../../../Enum/PrestationListType';
6
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
7
+
8
+ export class QueryGetAllPrestations {
9
+ @ApiPropertyOptional()
10
+ @IsOptional()
11
+ @IsString()
12
+ search?: string;
13
+
14
+ @ApiPropertyOptional()
15
+ @IsOptional()
16
+ @IsInt()
17
+ @IsIn([PrestationListType.ACCOUNTANT, PrestationListType.JURIDIC, PrestationListType.SOCIAL, PrestationListType.ATTESTATION])
18
+ idType?: number;
19
+
20
+ @ApiPropertyOptional()
21
+ @IsOptional()
22
+ @IsBoolean()
23
+ @ToBoolean()
24
+ isHidden?: boolean;
25
+ }