@silexpert/core 1.0.161 → 1.0.164

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 (104) hide show
  1. package/es/api/resources/Qonto.d.ts +2 -2
  2. package/es/api/resources/Qonto.d.ts.map +1 -1
  3. package/es/api/resources/Qonto.js.map +1 -1
  4. package/es/api/resources/Quotation.d.ts +17 -0
  5. package/es/api/resources/Quotation.d.ts.map +1 -0
  6. package/es/api/resources/Quotation.js +20 -0
  7. package/es/api/resources/Quotation.js.map +1 -0
  8. package/es/api/resources/Rating.d.ts +18 -0
  9. package/es/api/resources/Rating.d.ts.map +1 -0
  10. package/es/api/resources/Rating.js +20 -0
  11. package/es/api/resources/Rating.js.map +1 -0
  12. package/es/api/resources.d.ts +4 -0
  13. package/es/api/resources.d.ts.map +1 -1
  14. package/es/api/resources.js +4 -0
  15. package/es/api/resources.js.map +1 -1
  16. package/es/types/Enum/AbsenceType.d.ts +4 -3
  17. package/es/types/Enum/AbsenceType.d.ts.map +1 -1
  18. package/es/types/Enum/AbsenceType.js +5 -0
  19. package/es/types/Enum/AbsenceType.js.map +1 -1
  20. package/es/types/Enum/Channel.d.ts +3 -1
  21. package/es/types/Enum/Channel.d.ts.map +1 -1
  22. package/es/types/Enum/Channel.js +2 -0
  23. package/es/types/Enum/Channel.js.map +1 -1
  24. package/es/types/Enum/LegalForm.d.ts +2 -1
  25. package/es/types/Enum/LegalForm.d.ts.map +1 -1
  26. package/es/types/Enum/LegalForm.js +10 -0
  27. package/es/types/Enum/LegalForm.js.map +1 -1
  28. package/es/types/Interface/api/qonto/{ReadCreateConnection.d.ts → Read.d.ts} +5 -1
  29. package/es/types/Interface/api/qonto/Read.d.ts.map +1 -0
  30. package/es/types/Interface/api/qonto/Read.js +2 -0
  31. package/es/types/Interface/api/qonto/Read.js.map +1 -0
  32. package/es/types/Interface/api/quotation/ReadClientQuotation.d.ts +20 -0
  33. package/es/types/Interface/api/quotation/ReadClientQuotation.d.ts.map +1 -0
  34. package/es/types/Interface/api/quotation/ReadClientQuotation.js +2 -0
  35. package/es/types/Interface/api/quotation/ReadClientQuotation.js.map +1 -0
  36. package/es/types/Interface/api/rating/QueryRatingPaginated.d.ts +6 -0
  37. package/es/types/Interface/api/rating/QueryRatingPaginated.d.ts.map +1 -0
  38. package/es/types/Interface/api/rating/QueryRatingPaginated.js +42 -0
  39. package/es/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -0
  40. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts +1 -1
  41. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts.map +1 -1
  42. package/es/types/Interface/api/task/QueryPaginatedTask.js +3 -3
  43. package/es/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  44. package/es/types/Interface/models/IRating.d.ts +9 -5
  45. package/es/types/Interface/models/IRating.d.ts.map +1 -1
  46. package/es/types/Interface/models/IRating.js.map +1 -1
  47. package/es/types/index.d.ts +3 -1
  48. package/es/types/index.d.ts.map +1 -1
  49. package/es/types/index.js +3 -1
  50. package/es/types/index.js.map +1 -1
  51. package/es/utils/documents.js +1 -1
  52. package/es/utils/documents.js.map +1 -1
  53. package/es/utils/quotation.d.ts +5 -0
  54. package/es/utils/quotation.d.ts.map +1 -1
  55. package/es/utils/quotation.js +160 -0
  56. package/es/utils/quotation.js.map +1 -1
  57. package/js/api/resources/Qonto.js.map +1 -1
  58. package/js/api/resources/Quotation.js +27 -0
  59. package/js/api/resources/Quotation.js.map +1 -0
  60. package/js/api/resources/Rating.js +29 -0
  61. package/js/api/resources/Rating.js.map +1 -0
  62. package/js/api/resources.js +5 -1
  63. package/js/api/resources.js.map +1 -1
  64. package/js/types/Enum/AbsenceType.js +4 -0
  65. package/js/types/Enum/AbsenceType.js.map +1 -1
  66. package/js/types/Enum/Channel.js +2 -0
  67. package/js/types/Enum/Channel.js.map +1 -1
  68. package/js/types/Enum/LegalForm.js +10 -0
  69. package/js/types/Enum/LegalForm.js.map +1 -1
  70. package/js/types/Interface/api/qonto/{ReadCreateConnection.js → Read.js} +1 -1
  71. package/js/types/Interface/api/qonto/Read.js.map +1 -0
  72. package/js/types/Interface/api/quotation/ReadClientQuotation.js +6 -0
  73. package/js/types/Interface/api/quotation/ReadClientQuotation.js.map +1 -0
  74. package/js/types/Interface/api/rating/QueryRatingPaginated.js +40 -0
  75. package/js/types/Interface/api/rating/QueryRatingPaginated.js.map +1 -0
  76. package/js/types/Interface/api/task/QueryPaginatedTask.js +1 -1
  77. package/js/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  78. package/js/types/Interface/models/IRating.js.map +1 -1
  79. package/js/types/index.js +29 -9
  80. package/js/types/index.js.map +1 -1
  81. package/js/utils/documents.js +1 -1
  82. package/js/utils/documents.js.map +1 -1
  83. package/js/utils/quotation.js +158 -0
  84. package/js/utils/quotation.js.map +1 -1
  85. package/package.json +1 -1
  86. package/ts/api/resources/Qonto.ts +2 -2
  87. package/ts/api/resources/Quotation.ts +22 -0
  88. package/ts/api/resources/Rating.ts +23 -0
  89. package/ts/api/resources.ts +4 -0
  90. package/ts/types/Enum/AbsenceType.ts +6 -1
  91. package/ts/types/Enum/Channel.ts +2 -0
  92. package/ts/types/Enum/LegalForm.ts +10 -0
  93. package/ts/types/Interface/api/qonto/{ReadCreateConnection.ts → Read.ts} +6 -1
  94. package/ts/types/Interface/api/quotation/ReadClientQuotation.ts +19 -0
  95. package/ts/types/Interface/api/rating/QueryRatingPaginated.ts +29 -0
  96. package/ts/types/Interface/api/task/QueryPaginatedTask.ts +3 -3
  97. package/ts/types/Interface/models/IRating.ts +9 -5
  98. package/ts/types/index.ts +3 -1
  99. package/ts/utils/documents.ts +1 -1
  100. package/ts/utils/quotation.ts +178 -0
  101. package/es/types/Interface/api/qonto/ReadCreateConnection.d.ts.map +0 -1
  102. package/es/types/Interface/api/qonto/ReadCreateConnection.js +0 -2
  103. package/es/types/Interface/api/qonto/ReadCreateConnection.js.map +0 -1
  104. package/js/types/Interface/api/qonto/ReadCreateConnection.js.map +0 -1
@@ -17,7 +17,7 @@ const requiredListDocs = (idLegalForm, isOnlyPrevi, isOnlyJuridic, isOnlySocial,
17
17
  if ([_LegalForm.LegalForm.SAS.id, _LegalForm.LegalForm.SA.id].includes(idLegalForm)) {
18
18
  generique.push(_Ged.GedFileType.DISTRIBUTION_OF_SHARE);
19
19
  }
20
- if ([_LegalForm.LegalForm.EURL.id, _LegalForm.LegalForm.SASU.id, _LegalForm.LegalForm.SA.id, _LegalForm.LegalForm.SAS.id, _LegalForm.LegalForm.SARL.id, _LegalForm.LegalForm.SCI.id, _LegalForm.LegalForm.EARL.id].includes(idLegalForm)) {
20
+ if ([_LegalForm.LegalForm.SELARLU.id, _LegalForm.LegalForm.EURL.id, _LegalForm.LegalForm.SASU.id, _LegalForm.LegalForm.SA.id, _LegalForm.LegalForm.SAS.id, _LegalForm.LegalForm.SARL.id, _LegalForm.LegalForm.SCI.id, _LegalForm.LegalForm.EARL.id].includes(idLegalForm)) {
21
21
  return [...generique, _Ged.GedFileType.KBIS, _Ged.GedFileType.STATUTES, _Ged.GedFileType.DBE2, _Ged.GedFileType.SEPA];
22
22
  }
23
23
  if ([_LegalForm.LegalForm.SELARL.id].includes(idLegalForm)) {
@@ -1 +1 @@
1
- {"version":3,"file":"documents.js","names":["_Ged","require","_LegalForm","requiredListDocs","idLegalForm","isOnlyPrevi","isOnlyJuridic","isOnlySocial","isCreation","GedFileType","IDENTITY_CARD","PLAQUETTE","RIB","SEPA","generique","LegalForm","SAS","id","SA","includes","push","DISTRIBUTION_OF_SHARE","EURL","SASU","SARL","SCI","EARL","KBIS","STATUTES","DBE2","SELARL","EI","AUTO_ENTREPRENEUR","SIRENE","EIRL","PATRIMONY","ASSOCIATION","RULES_OF_PROCEDURE","REGISTRATION_OF_THE_ASSOCIATION_AT_THE_PREFECTURE","REPRESENTATIVE_OF_THE_ASSOCIATION","exports"],"sources":["../../ts/utils/documents.ts"],"sourcesContent":["import { GedFileType } from '../types/Enum/Ged';\nimport { LegalForm } from '../types/Enum/LegalForm';\n\nconst requiredListDocs = (idLegalForm: number, isOnlyPrevi?: boolean, isOnlyJuridic?: boolean, isOnlySocial?: boolean, isCreation?: boolean): GedFileType[] => {\n if (isOnlyPrevi) {\n return [GedFileType.IDENTITY_CARD, GedFileType.PLAQUETTE, GedFileType.RIB, GedFileType.SEPA];\n }\n if (isCreation || isOnlyJuridic || isOnlySocial) {\n return [GedFileType.RIB, GedFileType.PLAQUETTE];\n }\n\n const generique = [GedFileType.IDENTITY_CARD, GedFileType.RIB, GedFileType.PLAQUETTE];\n\n if ([LegalForm.SAS.id, LegalForm.SA.id].includes(idLegalForm)) {\n generique.push(GedFileType.DISTRIBUTION_OF_SHARE);\n }\n\n if ([LegalForm.EURL.id, LegalForm.SASU.id, LegalForm.SA.id, LegalForm.SAS.id, LegalForm.SARL.id, LegalForm.SCI.id, LegalForm.EARL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.KBIS, GedFileType.STATUTES, GedFileType.DBE2, GedFileType.SEPA];\n }\n if ([LegalForm.SELARL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.KBIS, GedFileType.STATUTES, GedFileType.SEPA];\n }\n if ([LegalForm.EI.id, LegalForm.AUTO_ENTREPRENEUR.id].includes(idLegalForm)) {\n return [...generique, GedFileType.SIRENE, GedFileType.SEPA];\n }\n if ([LegalForm.EIRL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.SIRENE, GedFileType.SEPA, GedFileType.PATRIMONY];\n }\n if ([LegalForm.ASSOCIATION.id].includes(idLegalForm)) {\n return [...generique, GedFileType.RULES_OF_PROCEDURE, GedFileType.REGISTRATION_OF_THE_ASSOCIATION_AT_THE_PREFECTURE, GedFileType.REPRESENTATIVE_OF_THE_ASSOCIATION];\n }\n return generique;\n};\n\nexport {\n requiredListDocs,\n};"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,gBA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EAAE;IAC/C,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACkB,IAAI,EAAElB,gBAAW,CAACmB,QAAQ,EAAEnB,gBAAW,CAACI,IAAI,CAAC;;EAEjF,IAAI,CAACE,oBAAS,CAACgB,EAAE,CAACd,EAAE,EAAEF,oBAAS,CAACiB,iBAAiB,CAACf,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IAC3E,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACwB,MAAM,EAAExB,gBAAW,CAACI,IAAI,CAAC;;EAE7D,IAAI,CAACE,oBAAS,CAACmB,IAAI,CAACjB,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IAC7C,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACwB,MAAM,EAAExB,gBAAW,CAACI,IAAI,EAAEJ,gBAAW,CAAC0B,SAAS,CAAC;;EAEpF,IAAI,CAACpB,oBAAS,CAACqB,WAAW,CAACnB,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IACpD,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAAC4B,kBAAkB,EAAE5B,gBAAW,CAAC6B,iDAAiD,EAAE7B,gBAAW,CAAC8B,iCAAiC,CAAC;;EAErK,OAAOzB,SAAS;AAClB,CAAC;AAAC0B,OAAA,CAGArC,gBAAgB,GAAhBA,gBAAgB"}
1
+ {"version":3,"file":"documents.js","names":["_Ged","require","_LegalForm","requiredListDocs","idLegalForm","isOnlyPrevi","isOnlyJuridic","isOnlySocial","isCreation","GedFileType","IDENTITY_CARD","PLAQUETTE","RIB","SEPA","generique","LegalForm","SAS","id","SA","includes","push","DISTRIBUTION_OF_SHARE","SELARLU","EURL","SASU","SARL","SCI","EARL","KBIS","STATUTES","DBE2","SELARL","EI","AUTO_ENTREPRENEUR","SIRENE","EIRL","PATRIMONY","ASSOCIATION","RULES_OF_PROCEDURE","REGISTRATION_OF_THE_ASSOCIATION_AT_THE_PREFECTURE","REPRESENTATIVE_OF_THE_ASSOCIATION","exports"],"sources":["../../ts/utils/documents.ts"],"sourcesContent":["import { GedFileType } from '../types/Enum/Ged';\nimport { LegalForm } from '../types/Enum/LegalForm';\n\nconst requiredListDocs = (idLegalForm: number, isOnlyPrevi?: boolean, isOnlyJuridic?: boolean, isOnlySocial?: boolean, isCreation?: boolean): GedFileType[] => {\n if (isOnlyPrevi) {\n return [GedFileType.IDENTITY_CARD, GedFileType.PLAQUETTE, GedFileType.RIB, GedFileType.SEPA];\n }\n if (isCreation || isOnlyJuridic || isOnlySocial) {\n return [GedFileType.RIB, GedFileType.PLAQUETTE];\n }\n\n const generique = [GedFileType.IDENTITY_CARD, GedFileType.RIB, GedFileType.PLAQUETTE];\n\n if ([LegalForm.SAS.id, LegalForm.SA.id].includes(idLegalForm)) {\n generique.push(GedFileType.DISTRIBUTION_OF_SHARE);\n }\n\n if ([LegalForm.SELARLU.id, LegalForm.EURL.id, LegalForm.SASU.id, LegalForm.SA.id, LegalForm.SAS.id, LegalForm.SARL.id, LegalForm.SCI.id, LegalForm.EARL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.KBIS, GedFileType.STATUTES, GedFileType.DBE2, GedFileType.SEPA];\n }\n if ([LegalForm.SELARL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.KBIS, GedFileType.STATUTES, GedFileType.SEPA];\n }\n if ([LegalForm.EI.id, LegalForm.AUTO_ENTREPRENEUR.id].includes(idLegalForm)) {\n return [...generique, GedFileType.SIRENE, GedFileType.SEPA];\n }\n if ([LegalForm.EIRL.id].includes(idLegalForm)) {\n return [...generique, GedFileType.SIRENE, GedFileType.SEPA, GedFileType.PATRIMONY];\n }\n if ([LegalForm.ASSOCIATION.id].includes(idLegalForm)) {\n return [...generique, GedFileType.RULES_OF_PROCEDURE, GedFileType.REGISTRATION_OF_THE_ASSOCIATION_AT_THE_PREFECTURE, GedFileType.REPRESENTATIVE_OF_THE_ASSO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EnB,gBAAW,CAACoB,QAAQ,EAAEpB,gBAAW,CAACqB,IAAI,EAAErB,gBAAW,CAACI,IAAI,CAAC;;EAEnG,IAAI,CAACE,oBAAS,CAACgB,MAAM,CAACd,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IAC/C,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACmB,IAAI,EAAEnB,gBAAW,CAACoB,QAAQ,EAAEpB,gBAAW,CAACI,IAAI,CAAC;;EAEjF,IAAI,CAACE,oBAAS,CAACiB,EAAE,CAACf,EAAE,EAAEF,oBAAS,CAACkB,iBAAiB,CAAChB,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IAC3E,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACyB,MAAM,EAAEzB,gBAAW,CAACI,IAAI,CAAC;;EAE7D,IAAI,CAACE,oBAAS,CAACoB,IAAI,CAAClB,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IAC7C,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAACyB,MAAM,EAAEzB,gBAAW,CAACI,IAAI,EAAEJ,gBAAW,CAAC2B,SAAS,CAAC;;EAEpF,IAAI,CAACrB,oBAAS,CAACsB,WAAW,CAACpB,EAAE,CAAC,CAACE,QAAQ,CAACf,WAAW,CAAC,EAAE;IACpD,OAAO,CAAC,GAAGU,SAAS,EAAEL,gBAAW,CAAC6B,kBAAkB,EAAE7B,gBAAW,CAAC8B,iDAAiD,EAAE9B,gBAAW,CAAC+B,iCAAiC,CAAC;;EAErK,OAAO1B,SAAS;AAClB,CAAC;AAAC2B,OAAA,CAGAtC,gBAAgB,GAAhBA,gBAAgB"}
@@ -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,155 @@ 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) {
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 = dayjs().diff(dayjs(society.dateIsClient, 'YYYY-MM-DD'), 'years');
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 < dateIsClient < 2 ans (+10) / 2 ans < dateIsClient (+15 / année)) */
149
+ if (society.dateIsClient) {
150
+ const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(society.dateIsClient).getFullYear());
151
+ if (yearAsClient > 0) {
152
+ quotationPositive += 10;
153
+ detailQuotation.seniority += 10;
154
+ if (yearAsClient > 1) {
155
+ quotationPositive += 15 * (yearAsClient - 1);
156
+ detailQuotation.seniority += 15 * (yearAsClient - 1);
157
+ }
158
+ }
159
+ }
160
+ /* Prestations Complémentaires (+5 / prestation) */
161
+ if ((_a = society.prestationsSocieties) === null || _a === void 0 ? void 0 : _a.length) {
162
+ const prestationsCompl = society.prestationsSocieties.filter(prestation => prestation.idPrestationComplementary);
163
+ prestationsCompl.forEach(() => {
164
+ quotationPositive += Math.ceil(5 * ponderation);
165
+ detailQuotation.additionalBenefits += Math.ceil(5 * ponderation);
166
+ });
167
+ }
168
+ /* Sociétés supplémentaires (+8 / société) */
169
+ if (otherSocieties.length) {
170
+ quotationPositive += Math.ceil(8 * otherSocieties.length * ponderation);
171
+ detailQuotation.additionalCompanies += Math.ceil(8 * otherSocieties.length * ponderation);
172
+ }
173
+ /* Impayés (-15 / mois) */
174
+ if (unpaidDetails.length) {
175
+ quotationNegative -= Math.ceil(15 * unpaidDetails.length * ponderation);
176
+ detailQuotation.unpayed -= Math.ceil(15 * unpaidDetails.length * ponderation);
177
+ }
178
+ /* annotations à jour */
179
+ if ((_b = tabBankAccount.societyAccountingTransactions) === null || _b === void 0 ? void 0 : _b.length) {
180
+ // on check s'il y a 80% des lignes annotées (dateLocked)
181
+ let countNotAnnoted = 0;
182
+ let percentageAnnotations = 100;
183
+ tabBankAccount.societyAccountingTransactions.map(na => {
184
+ if (na.dateLocked === null) {
185
+ countNotAnnoted += 1;
186
+ }
187
+ return countNotAnnoted;
188
+ });
189
+ if (countNotAnnoted !== 0) percentageAnnotations = countNotAnnoted / ((_c = tabBankAccount.societyAccountingTransactions) === null || _c === void 0 ? void 0 : _c.length) * 100;
190
+ if (percentageAnnotations >= 80) {
191
+ quotationPositive += Math.ceil(12 * ponderation);
192
+ detailQuotation.updatedAnnotations += Math.ceil(12 * ponderation);
193
+ } else {
194
+ quotationNegative -= Math.ceil(12 * ponderation);
195
+ detailQuotation.updatedAnnotations -= Math.ceil(12 * ponderation);
196
+ }
197
+ }
198
+ /* synchronisation bancaire */
199
+ if ((_d = tabBankAccount.societyActivatedBankAccounts) === null || _d === void 0 ? void 0 : _d.length) {
200
+ // comptes synchro
201
+ const synchro = tabBankAccount.societyActivatedBankAccounts.length - tabBankAccount.desactivatedBankAccount.length;
202
+ quotationPositive += Math.ceil(12 * synchro * ponderation);
203
+ detailQuotation.bankSynchronization += Math.ceil(12 * synchro * ponderation);
204
+ // comptes desynchro
205
+ quotationNegative -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);
206
+ detailQuotation.bankSynchronization -= Math.ceil(12 * tabBankAccount.desactivatedBankAccount.length * ponderation);
207
+ }
208
+ /* avis */
209
+ if (lastNotice && lastNotice.data.length === 1) {
210
+ if (lastNotice.data[0].average === 5) {
211
+ quotationPositive += Math.ceil(10 * ponderation);
212
+ detailQuotation.rating += Math.ceil(10 * ponderation);
213
+ } else {
214
+ quotationNegative -= 10;
215
+ detailQuotation.rating -= 10;
216
+ }
217
+ }
218
+ /* LAB refusée */
219
+ if (!((_e = society.societyDetail) === null || _e === void 0 ? void 0 : _e.acceptation)) {
220
+ quotationNegative -= 10;
221
+ detailQuotation.labRefused -= 10;
222
+ }
223
+ /* Cessation de paiement - redressement judiciaire - procédure en cours / signalements / résiliation */
224
+ if (societyProcedings === null || societyProcedings === void 0 ? void 0 : societyProcedings.length) {
225
+ quotationNegative -= 5 * societyProcedings.length;
226
+ detailQuotation.ongoingProceedings -= 5 * societyProcedings.length;
227
+ }
228
+ if (reports === null || reports === void 0 ? void 0 : reports.length) {
229
+ quotationNegative -= 10;
230
+ detailQuotation.report -= 10;
231
+ }
232
+ if (society.isWaitingEnd) {
233
+ quotationNegative -= 50;
234
+ detailQuotation.termination -= 50;
235
+ }
236
+ /* Création chez nous */
237
+ if ((_f = society.prestationsSocieties) === null || _f === void 0 ? void 0 : _f.length) {
238
+ const prestationsCreation = society.prestationsSocieties.filter(prestation => prestation.idPrestationList === 15); // creation pas d'enum
239
+ prestationsCreation.forEach(() => {
240
+ quotationPositive += 10;
241
+ detailQuotation.created += 10;
242
+ });
243
+ }
244
+ if (quotationPositive > 100) quotationPositive = 100;
245
+ if (quotationNegative > 100) quotationNegative = 100;
246
+ quotation = quotationPositive + quotationNegative;
247
+ if (quotation < 0) quotation = 0;
248
+ return {
249
+ cotation: quotation,
250
+ data: detailQuotation,
251
+ idSociety: society.id
252
+ };
253
+ }
254
+ function compareTwoCotation(cotations) {
255
+ // on recupere les 2 dernieres cotations de la societe
256
+ const higher = false;
257
+ if (cotations[0].cotation === cotations[1].cotation) {
258
+ return null;
259
+ }
260
+ if (cotations[0].cotation > cotations[1].cotation) {
261
+ return true;
262
+ }
263
+ return higher;
264
+ }
107
265
  //# 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.RESTAURATION, Activity.COMMERCANT, Activity.MEDICAL, Activity.PROF_LIB].includes(activitySector)) {\n quotation += 5;\n }\n\n return quotation;\n}"],"mappings":";;;;;QAcgBA,gBAAgB,GAAhBA,gBAAgB;AAdhC,IAAAC,eAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAaM,SAAUF,gBAAgBA,CAACI,MAA8B;EAC7D,MAAM;IACJC,SAAS;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,IAAI;IAAEC,cAAc;IAA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AEC,KAAK,EAAEC,IAAI,EAAEC,cAAc,EAAEG,cAAc,CAAC,CAACqB,MAAM,CAAEC,IAAI,IAAK,CAAC,CAACA,IAAI,CAAC,CAACC,MAAM;EACtH,QAAQH,WAAW;IACjB,KAAK,CAAC;MACJlB,SAAS,IAAI,EAAE;MACf;IACF,KAAK,CAAC;MACJA,SAAS,IAAI,CAAC;MACd;IACF,KAAK,CAAC;MACJA,SAAS,IAAI,CAAC;MACd;IACF,KAAK,CAAC;MACJA,SAAS,IAAI,CAAC;MACd;IACF,KAAK,CAAC;MACJA,SAAS,IAAI,CAAC;MACd;IACF;MACE;EAAM;EAGV;EACA,IAAIH,YAAY,EAAEG,SAAS,IAAI,CAAC;EAEhC;EACA,IAAI,CAACsB,kBAAQ,CAACC,YAAY,EAAED,kBAAQ,CAACE,OAAO,CAAC,CAACzB,QAAQ,CAACD,cAAc,CAAC,EAAE;IACtEE,SAAS,IAAI,EAAE;GAChB,MAAM,IAAI,CAACsB,kBAAQ,CAACG,SAAS,EAAEH,kBAAQ,CAACI,GAAG,EAAEJ,kBAAQ,CAACK,YAAY,EAAEL,kBAAQ,CAACM,UAAU,EAAEN,kBAAQ,CAACO,OAAO,EAAEP,kBAAQ,CAACQ,QAAQ,CAAC,CAAC/B,QAAQ,CAACD,cAAc,CAAC,EAAE;IACvJE,SAAS,IAAI,CAAC;;EAGhB,OAAOA,SAAS;AAClB"}
1
+ {"version":3,"file":"quotation.js","names":["getLeadQuotation","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","quotationPositive","quotationNegative","detailQuotation","signature","seniority","additionalBenefits","additionalCompanies","unpayed","updatedAnnotations","bankSynchronization","rating","labRefused","ongoingProceedings","report","termination","created","anciennete","diff","dateIsClient","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 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): 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 = dayjs().diff(dayjs(society.dateIsClient, 'YYYY-MM-DD'), 'years');\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 < dateIsClient < 2 ans (+10) / 2 ans < dateIsClient (+15 / année)) */\n if (society.dateIsClient) {\n const yearAsClient = Number(new Date().getFullYear()) - Number(new Date(society.dateIsClient).getFullYear());\n if (yearAsClient > 0) {\n quotationPositive += 10;\n detailQuotation.seniority += 10;\n if (yearAsClient > 1) {\n quotationPositive += 15 * (yearAsClient - 1);\n detailQuotation.seniority += 15 * (yearAsClient - 1);\n }\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":";;;;;QAsBgBA,gBAAgB,GAAhBA,gBAAgB;AAAAC,OAAA,CAiHhBC,kBAA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;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.161",
3
+ "version": "1.0.164",
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",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ProcessBankAccount,
3
3
  CreateQontoConnection,
4
- CreateImportation, GetConnectionInformation, GetQontoOrganization, IAccountingTransaction, IBankAccount, IBankConnection, ReadCreateConnection, UpdateConnection,
4
+ CreateImportation, GetConnectionInformation, GetQontoOrganization, IBankAccount, IBankConnection, ReadCreateConnection, UpdateConnection, CreateImportationResult,
5
5
  } from '../../types';
6
6
  import { Resource } from '../Resource';
7
7
 
@@ -14,7 +14,7 @@ export class Qonto extends Resource {
14
14
  return this.axios.$get('connectors/qonto/connections', { params: queries });
15
15
  }
16
16
 
17
- importBankAccount(idBankAccount: number, payload: CreateImportation): Promise<IAccountingTransaction[]> {
17
+ importBankAccount(idBankAccount: number, payload: CreateImportation): Promise<CreateImportationResult> {
18
18
  return this.axios.$post(`connectors/qonto/${idBankAccount}/importation`, payload);
19
19
  }
20
20
 
@@ -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,8 @@ 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';
120
122
 
121
123
  export const resources = {
122
124
  simulation: Simulation,
@@ -237,5 +239,7 @@ export const resources = {
237
239
  societyConfigBalanceSheet: SocietyConfigBalanceSheet,
238
240
  signFile: SignFile,
239
241
  rule: Rule,
242
+ rating: Rating,
240
243
  acceptance: Acceptance,
244
+ quotation: Quotation,
241
245
  };
@@ -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
  ];
@@ -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
  }
@@ -20,6 +20,7 @@ export enum LegalFormTypeEnum {
20
20
  SCP = 19,
21
21
  SOCIETE_CIVILE = 20,
22
22
  SELASU = 21,
23
+ SELARLU = 22,
23
24
  }
24
25
 
25
26
  export type LegalFormTypeContent = {
@@ -223,4 +224,13 @@ export const LegalForm: LegalFormType = {
223
224
  individual: false,
224
225
  pappersLabel: 'Selas unipersonnelle',
225
226
  },
227
+ SELARLU: {
228
+ id: LegalFormTypeEnum.SELARLU,
229
+ name: 'SELARLU',
230
+ alias: 'Selarlu',
231
+ diaCode: null,
232
+ hideVat: false,
233
+ individual: false,
234
+ pappersLabel: 'Selarl unipersonnelle',
235
+ },
226
236
  };
@@ -1,6 +1,11 @@
1
1
  import { GetQontoOrganization } from './Query';
2
2
 
3
+ export type CreateImportationResult = {
4
+ transactionCreated: number;
5
+ transactionUpdated: number;
6
+ };
7
+
3
8
  export interface ReadCreateConnection {
4
9
  idBankConnection: number;
5
10
  qontoConnection: GetQontoOrganization;
6
- }
11
+ }
@@ -0,0 +1,19 @@
1
+ export type ReadClientQuotation = {
2
+ cotation: number,
3
+ data: {
4
+ signature: number,
5
+ seniority: number,
6
+ additionalBenefits: number,
7
+ additionalCompanies: number,
8
+ unpayed: number,
9
+ updatedAnnotations: number,
10
+ bankSynchronization: number,
11
+ rating: number,
12
+ labRefused: number,
13
+ ongoingProceedings: number,
14
+ report: number,
15
+ termination: number,
16
+ created: number,
17
+ },
18
+ idSociety: number
19
+ };
@@ -0,0 +1,29 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
+
3
+ export class QueryRatingPaginated {
4
+ @ApiProperty({
5
+ description: 'limit of element',
6
+ required: true,
7
+ type: Number,
8
+ default: 50,
9
+ example: 50,
10
+ })
11
+ limit: number;
12
+
13
+ @ApiProperty({
14
+ description: 'limit of element',
15
+ required: true,
16
+ type: Number,
17
+ default: 1,
18
+ example: 5,
19
+ })
20
+ page: number;
21
+
22
+ @ApiPropertyOptional({
23
+ description: 'idSociety',
24
+ required: false,
25
+ type: Number,
26
+ example: 1,
27
+ })
28
+ idSociety: number;
29
+ }
@@ -1,5 +1,5 @@
1
1
  import {
2
- IsBoolean, IsNumber, IsOptional, IsString, IsInt, IsDate, IsIn,
2
+ IsBoolean, IsNumber, IsOptional, IsString, IsInt, IsDate, IsIn, IsArray,
3
3
  } from 'class-validator';
4
4
  import { ApiPropertyOptional } from '../../../../utils';
5
5
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
@@ -52,8 +52,8 @@ export class QueryPaginatedTask {
52
52
 
53
53
  @ApiPropertyOptional({ description: 'user who create the task' })
54
54
  @IsOptional()
55
- @IsInt()
56
- idUserWhoCreated?: number;
55
+ @IsArray()
56
+ idUserWhoCreated?: number[];
57
57
 
58
58
  @ApiPropertyOptional()
59
59
  @IsOptional()
@@ -3,14 +3,18 @@ import { ISociety } from './ISociety';
3
3
  // ratings
4
4
  export interface IRating {
5
5
  id?: number;
6
- notes: string;
7
- comment: string;
8
- average: number;
9
- dateNotShowPopUp: Date | null;
6
+ notes?: string;
7
+ comment?: string;
8
+ average?: number;
9
+ dateNotShowPopUp?: Date | null;
10
+ link?: string | null;
11
+ idUserWhoInsert: number | null;
12
+ noticeDate?: Date | null;
13
+ isMugSent?: boolean | null;
10
14
  idSociety: number;
11
15
  createdAt?: Date | null;
12
16
  updatedAt?: Date | null;
13
17
 
14
18
  // Associations
15
- society: ISociety;
19
+ society?: ISociety;
16
20
  }
package/ts/types/index.ts CHANGED
@@ -638,6 +638,7 @@ export * from './Interface/api/timeRecorder/ReadUsersNotConnected';
638
638
  export * from './Interface/api/timeRecorder/UpdateRecorder';
639
639
  export * from './Interface/api/inpiBalance/QueryInpiBalanceStatistic';
640
640
  export * from './Interface/api/inpiBalance/QueryInpiBalancePaginated';
641
+ export * from './Interface/api/rating/QueryRatingPaginated';
641
642
  export * from './Interface/api/inpiBalance/inpiBalanceStatistic';
642
643
  export * from './Interface/api/inpiPayment/QueryInpiPaymentStatistic';
643
644
  export * from './Interface/api/inpiPayment/QueryInpiPaymentPaginated';
@@ -857,7 +858,7 @@ export * from './Interface/api/qonto/UpdateConnection';
857
858
  export * from './Interface/api/qonto/CreateQontoConnection';
858
859
  export * from './Interface/api/qonto/GetConnectionInformation';
859
860
  export * from './Interface/api/qonto/ProcessBankAccount';
860
- export * from './Interface/api/qonto/ReadCreateConnection';
861
+ export * from './Interface/api/qonto/Read';
861
862
  export * from './Interface/api/file/Create';
862
863
  export * from './Interface/api/file/Read';
863
864
  export * from './Interface/api/societyConfig/update';
@@ -882,6 +883,7 @@ export * from './Interface/api/rule/Update';
882
883
  export * from './Interface/api/rule/Read';
883
884
  export * from './Interface/api/revive/PostRevive';
884
885
  export * from './Interface/api/acceptance/CreateAcceptance';
886
+ export * from './Interface/api/quotation/ReadClientQuotation';
885
887
 
886
888
  // Enums types
887
889
  export * from './Interface/enum/Util';
@@ -15,7 +15,7 @@ const requiredListDocs = (idLegalForm: number, isOnlyPrevi?: boolean, isOnlyJuri
15
15
  generique.push(GedFileType.DISTRIBUTION_OF_SHARE);
16
16
  }
17
17
 
18
- if ([LegalForm.EURL.id, LegalForm.SASU.id, LegalForm.SA.id, LegalForm.SAS.id, LegalForm.SARL.id, LegalForm.SCI.id, LegalForm.EARL.id].includes(idLegalForm)) {
18
+ if ([LegalForm.SELARLU.id, LegalForm.EURL.id, LegalForm.SASU.id, LegalForm.SA.id, LegalForm.SAS.id, LegalForm.SARL.id, LegalForm.SCI.id, LegalForm.EARL.id].includes(idLegalForm)) {
19
19
  return [...generique, GedFileType.KBIS, GedFileType.STATUTES, GedFileType.DBE2, GedFileType.SEPA];
20
20
  }
21
21
  if ([LegalForm.SELARL.id].includes(idLegalForm)) {