@silexpert/core 1.0.12 → 1.0.15

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 (304) hide show
  1. package/es/api/resources/{commercialDocument.d.ts → CommercialDocument.d.ts} +4 -2
  2. package/es/api/resources/CommercialDocument.d.ts.map +1 -0
  3. package/es/api/resources/{commercialDocument.js → CommercialDocument.js} +7 -1
  4. package/es/api/resources/CommercialDocument.js.map +1 -0
  5. package/es/api/resources/Dashboard.d.ts +1 -2
  6. package/es/api/resources/Dashboard.d.ts.map +1 -1
  7. package/es/api/resources/Dashboard.js +0 -3
  8. package/es/api/resources/Dashboard.js.map +1 -1
  9. package/es/api/resources/Exercice.d.ts +1 -0
  10. package/es/api/resources/Exercice.d.ts.map +1 -1
  11. package/es/api/resources/Exercice.js +3 -0
  12. package/es/api/resources/Exercice.js.map +1 -1
  13. package/es/api/resources/Invoice.d.ts +1 -0
  14. package/es/api/resources/Invoice.d.ts.map +1 -1
  15. package/es/api/resources/Invoice.js +3 -0
  16. package/es/api/resources/Invoice.js.map +1 -1
  17. package/es/api/resources/Mail.js +2 -2
  18. package/es/api/resources/Mail.js.map +1 -1
  19. package/es/api/resources/Qonto.d.ts +2 -1
  20. package/es/api/resources/Qonto.d.ts.map +1 -1
  21. package/es/api/resources/Qonto.js +3 -0
  22. package/es/api/resources/Qonto.js.map +1 -1
  23. package/es/api/resources/Recurrence.d.ts +9 -0
  24. package/es/api/resources/Recurrence.d.ts.map +1 -0
  25. package/es/api/resources/Recurrence.js +13 -0
  26. package/es/api/resources/Recurrence.js.map +1 -0
  27. package/es/api/resources/{reminder.d.ts → Reminder.d.ts} +1 -1
  28. package/es/api/resources/{reminder.d.ts.map → Reminder.d.ts.map} +1 -1
  29. package/es/api/resources/{reminder.js → Reminder.js} +2 -2
  30. package/es/api/resources/{reminder.js.map → Reminder.js.map} +1 -1
  31. package/es/api/resources/User.d.ts +2 -2
  32. package/es/api/resources/User.d.ts.map +1 -1
  33. package/es/api/resources/User.js +2 -11
  34. package/es/api/resources/User.js.map +1 -1
  35. package/es/api/resources.d.ts +4 -2
  36. package/es/api/resources.d.ts.map +1 -1
  37. package/es/api/resources.js +4 -2
  38. package/es/api/resources.js.map +1 -1
  39. package/es/types/Enum/BrandClementine.d.ts +3 -1
  40. package/es/types/Enum/BrandClementine.d.ts.map +1 -1
  41. package/es/types/Enum/BrandClementine.js +3 -0
  42. package/es/types/Enum/BrandClementine.js.map +1 -1
  43. package/es/types/Enum/CommercialManagement.d.ts +4 -2
  44. package/es/types/Enum/CommercialManagement.d.ts.map +1 -1
  45. package/es/types/Enum/CommercialManagement.js +3 -1
  46. package/es/types/Enum/CommercialManagement.js.map +1 -1
  47. package/es/types/Enum/RecurrenceType.d.ts +11 -0
  48. package/es/types/Enum/RecurrenceType.d.ts.map +1 -0
  49. package/es/types/Enum/RecurrenceType.js +26 -0
  50. package/es/types/Enum/RecurrenceType.js.map +1 -0
  51. package/es/types/Enum/Role.d.ts +6 -11
  52. package/es/types/Enum/Role.d.ts.map +1 -1
  53. package/es/types/Enum/Role.js +15 -10
  54. package/es/types/Enum/Role.js.map +1 -1
  55. package/es/types/Enum/RoleDetail.d.ts +40 -56
  56. package/es/types/Enum/RoleDetail.d.ts.map +1 -1
  57. package/es/types/Enum/RoleDetail.js +120 -64
  58. package/es/types/Enum/RoleDetail.js.map +1 -1
  59. package/es/types/Enum/TaskResponseType.d.ts +9 -0
  60. package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
  61. package/es/types/Enum/TaskResponseType.js +35 -2
  62. package/es/types/Enum/TaskResponseType.js.map +1 -1
  63. package/es/types/Enum/TimeCounterType.js +7 -7
  64. package/es/types/Enum/TimeCounterType.js.map +1 -1
  65. package/es/types/Interface/api/commercialManagement/Create.d.ts +25 -18
  66. package/es/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  67. package/es/types/Interface/api/commercialManagement/Create.js +65 -81
  68. package/es/types/Interface/api/commercialManagement/Create.js.map +1 -1
  69. package/es/types/Interface/api/commercialManagement/Query.d.ts +6 -0
  70. package/es/types/Interface/api/commercialManagement/Query.d.ts.map +1 -1
  71. package/es/types/Interface/api/commercialManagement/Query.js +29 -0
  72. package/es/types/Interface/api/commercialManagement/Query.js.map +1 -1
  73. package/es/types/Interface/api/commercialManagement/Read.d.ts +19 -0
  74. package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
  75. package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
  76. package/es/types/Interface/api/commercialManagement/Update.d.ts +6 -0
  77. package/es/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
  78. package/es/types/Interface/api/commercialManagement/Update.js +29 -1
  79. package/es/types/Interface/api/commercialManagement/Update.js.map +1 -1
  80. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.d.ts +1 -1
  81. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.d.ts.map +1 -1
  82. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js +1 -1
  83. package/es/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js.map +1 -1
  84. package/es/types/Interface/api/mail/QueryPaginatedMail.d.ts +1 -1
  85. package/es/types/Interface/api/mail/QueryPaginatedMail.d.ts.map +1 -1
  86. package/es/types/Interface/api/mail/QueryPaginatedMail.js +1 -1
  87. package/es/types/Interface/api/mail/QueryPaginatedMail.js.map +1 -1
  88. package/es/types/Interface/api/qonto/CreateImportation.d.ts +5 -0
  89. package/es/types/Interface/api/qonto/CreateImportation.d.ts.map +1 -0
  90. package/es/types/Interface/api/{dashboard/QueryGescom.js → qonto/CreateImportation.js} +12 -19
  91. package/es/types/Interface/api/qonto/CreateImportation.js.map +1 -0
  92. package/es/types/Interface/api/qonto/Query.d.ts +78 -0
  93. package/es/types/Interface/api/qonto/Query.d.ts.map +1 -0
  94. package/es/types/Interface/api/qonto/Query.js +2 -0
  95. package/es/types/Interface/api/qonto/Query.js.map +1 -0
  96. package/es/types/Interface/api/revision/QueryRevision.d.ts +2 -0
  97. package/es/types/Interface/api/revision/QueryRevision.d.ts.map +1 -1
  98. package/es/types/Interface/api/revision/QueryRevision.js +16 -2
  99. package/es/types/Interface/api/revision/QueryRevision.js.map +1 -1
  100. package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts +1 -1
  101. package/es/types/Interface/api/revision/QueryRevisionAccount.d.ts.map +1 -1
  102. package/es/types/Interface/api/revision/QueryRevisionAccount.js +11 -5
  103. package/es/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -1
  104. package/es/types/Interface/api/revision/QueryRevisionPaginate.d.ts +2 -0
  105. package/es/types/Interface/api/revision/QueryRevisionPaginate.d.ts.map +1 -1
  106. package/es/types/Interface/api/revision/QueryRevisionPaginate.js +16 -2
  107. package/es/types/Interface/api/revision/QueryRevisionPaginate.js.map +1 -1
  108. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts +1 -1
  109. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.d.ts.map +1 -1
  110. package/es/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
  111. package/es/types/Interface/api/task/QueryCountTask.d.ts +1 -1
  112. package/es/types/Interface/api/task/QueryCountTask.d.ts.map +1 -1
  113. package/es/types/Interface/api/task/QueryCountTask.js +1 -1
  114. package/es/types/Interface/api/task/QueryCountTask.js.map +1 -1
  115. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts +2 -0
  116. package/es/types/Interface/api/task/QueryPaginatedTask.d.ts.map +1 -1
  117. package/es/types/Interface/api/task/QueryPaginatedTask.js +11 -0
  118. package/es/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  119. package/es/types/Interface/api/user/ParamsGetAllCollaborators.d.ts +1 -0
  120. package/es/types/Interface/api/user/ParamsGetAllCollaborators.d.ts.map +1 -1
  121. package/es/types/Interface/api/user/ParamsGetAllCollaborators.js +10 -1
  122. package/es/types/Interface/api/user/ParamsGetAllCollaborators.js.map +1 -1
  123. package/es/types/Interface/api/user/QueryGetAllCollaborators.d.ts +1 -0
  124. package/es/types/Interface/api/user/QueryGetAllCollaborators.d.ts.map +1 -1
  125. package/es/types/Interface/api/user/QueryGetAllCollaborators.js +11 -1
  126. package/es/types/Interface/api/user/QueryGetAllCollaborators.js.map +1 -1
  127. package/es/types/Interface/models/IApiError.d.ts +2 -1
  128. package/es/types/Interface/models/IApiError.d.ts.map +1 -1
  129. package/es/types/Interface/models/IApiError.js +1 -0
  130. package/es/types/Interface/models/IApiError.js.map +1 -1
  131. package/es/types/Interface/models/IEstimateInvoice.d.ts +4 -2
  132. package/es/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
  133. package/es/types/Interface/models/IEstimateInvoice.js.map +1 -1
  134. package/es/types/Interface/models/IInvoiceRecurrence.d.ts +15 -0
  135. package/es/types/Interface/models/IInvoiceRecurrence.d.ts.map +1 -0
  136. package/es/types/Interface/models/IInvoiceRecurrence.js +2 -0
  137. package/es/types/Interface/models/IInvoiceRecurrence.js.map +1 -0
  138. package/es/types/Interface/models/IInvoiceReminder.d.ts +1 -1
  139. package/es/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
  140. package/es/types/Interface/models/IInvoiceReminder.js.map +1 -1
  141. package/es/types/Interface/models/ITask.d.ts +2 -2
  142. package/es/types/Interface/models/ITask.d.ts.map +1 -1
  143. package/es/types/Interface/models/ITask.js.map +1 -1
  144. package/es/types/index.d.ts +4 -2
  145. package/es/types/index.d.ts.map +1 -1
  146. package/es/types/index.js +4 -2
  147. package/es/types/index.js.map +1 -1
  148. package/es/utils/commercialManagement/document.d.ts.map +1 -1
  149. package/es/utils/commercialManagement/document.js +1 -5
  150. package/es/utils/commercialManagement/document.js.map +1 -1
  151. package/es/utils/commercialManagement/recurrence.d.ts +7 -0
  152. package/es/utils/commercialManagement/recurrence.d.ts.map +1 -0
  153. package/es/utils/commercialManagement/recurrence.js +31 -0
  154. package/es/utils/commercialManagement/recurrence.js.map +1 -0
  155. package/es/utils/index.d.ts +1 -0
  156. package/es/utils/index.d.ts.map +1 -1
  157. package/es/utils/index.js +1 -0
  158. package/es/utils/index.js.map +1 -1
  159. package/es/utils/task.d.ts +3 -2
  160. package/es/utils/task.d.ts.map +1 -1
  161. package/es/utils/task.js +23 -19
  162. package/es/utils/task.js.map +1 -1
  163. package/es/utils/webmail.d.ts.map +1 -1
  164. package/es/utils/webmail.js +1 -4
  165. package/es/utils/webmail.js.map +1 -1
  166. package/js/api/resources/{commercialDocument.js → CommercialDocument.js} +11 -1
  167. package/js/api/resources/CommercialDocument.js.map +1 -0
  168. package/js/api/resources/Dashboard.js +0 -6
  169. package/js/api/resources/Dashboard.js.map +1 -1
  170. package/js/api/resources/Exercice.js +4 -0
  171. package/js/api/resources/Exercice.js.map +1 -1
  172. package/js/api/resources/Invoice.js +4 -0
  173. package/js/api/resources/Invoice.js.map +1 -1
  174. package/js/api/resources/Mail.js +2 -2
  175. package/js/api/resources/Mail.js.map +1 -1
  176. package/js/api/resources/Qonto.js +4 -0
  177. package/js/api/resources/Qonto.js.map +1 -1
  178. package/js/api/resources/Recurrence.js +26 -0
  179. package/js/api/resources/Recurrence.js.map +1 -0
  180. package/js/api/resources/{reminder.js → Reminder.js} +2 -2
  181. package/js/api/resources/{reminder.js.map → Reminder.js.map} +1 -1
  182. package/js/api/resources/User.js +5 -3
  183. package/js/api/resources/User.js.map +1 -1
  184. package/js/api/resources.js +7 -4
  185. package/js/api/resources.js.map +1 -1
  186. package/js/types/Enum/BrandClementine.js +3 -0
  187. package/js/types/Enum/BrandClementine.js.map +1 -1
  188. package/js/types/Enum/CommercialManagement.js +3 -1
  189. package/js/types/Enum/CommercialManagement.js.map +1 -1
  190. package/js/types/Enum/RecurrenceType.js +28 -0
  191. package/js/types/Enum/RecurrenceType.js.map +1 -0
  192. package/js/types/Enum/Role.js +18 -13
  193. package/js/types/Enum/Role.js.map +1 -1
  194. package/js/types/Enum/RoleDetail.js +142 -86
  195. package/js/types/Enum/RoleDetail.js.map +1 -1
  196. package/js/types/Enum/TaskResponseType.js +36 -3
  197. package/js/types/Enum/TaskResponseType.js.map +1 -1
  198. package/js/types/Enum/TimeCounterType.js +7 -7
  199. package/js/types/Enum/TimeCounterType.js.map +1 -1
  200. package/js/types/Interface/api/commercialManagement/Create.js +47 -33
  201. package/js/types/Interface/api/commercialManagement/Create.js.map +1 -1
  202. package/js/types/Interface/api/commercialManagement/Query.js +15 -3
  203. package/js/types/Interface/api/commercialManagement/Query.js.map +1 -1
  204. package/js/types/Interface/api/commercialManagement/Update.js +15 -1
  205. package/js/types/Interface/api/commercialManagement/Update.js.map +1 -1
  206. package/js/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js +1 -1
  207. package/js/types/Interface/api/mail/QueryCountUnprocessedByUserMail.js.map +1 -1
  208. package/js/types/Interface/api/mail/QueryPaginatedMail.js +1 -1
  209. package/js/types/Interface/api/mail/QueryPaginatedMail.js.map +1 -1
  210. package/js/types/Interface/api/{dashboard/QueryGescom.js → qonto/CreateImportation.js} +8 -12
  211. package/js/types/Interface/api/qonto/CreateImportation.js.map +1 -0
  212. package/js/types/Interface/api/qonto/Query.js +6 -0
  213. package/js/types/Interface/api/qonto/Query.js.map +1 -0
  214. package/js/types/Interface/api/revision/QueryRevision.js +6 -0
  215. package/js/types/Interface/api/revision/QueryRevision.js.map +1 -1
  216. package/js/types/Interface/api/revision/QueryRevisionAccount.js +7 -5
  217. package/js/types/Interface/api/revision/QueryRevisionAccount.js.map +1 -1
  218. package/js/types/Interface/api/revision/QueryRevisionPaginate.js +6 -0
  219. package/js/types/Interface/api/revision/QueryRevisionPaginate.js.map +1 -1
  220. package/js/types/Interface/api/revision/QueryRevisionSearchEntries.js.map +1 -1
  221. package/js/types/Interface/api/task/QueryCountTask.js +1 -1
  222. package/js/types/Interface/api/task/QueryCountTask.js.map +1 -1
  223. package/js/types/Interface/api/task/QueryPaginatedTask.js +6 -0
  224. package/js/types/Interface/api/task/QueryPaginatedTask.js.map +1 -1
  225. package/js/types/Interface/api/user/ParamsGetAllCollaborators.js +6 -0
  226. package/js/types/Interface/api/user/ParamsGetAllCollaborators.js.map +1 -1
  227. package/js/types/Interface/api/user/QueryGetAllCollaborators.js +8 -0
  228. package/js/types/Interface/api/user/QueryGetAllCollaborators.js.map +1 -1
  229. package/js/types/Interface/models/IApiError.js +1 -0
  230. package/js/types/Interface/models/IApiError.js.map +1 -1
  231. package/js/types/Interface/models/IInvoiceRecurrence.js +6 -0
  232. package/js/types/Interface/models/IInvoiceRecurrence.js.map +1 -0
  233. package/js/types/index.js +48 -24
  234. package/js/types/index.js.map +1 -1
  235. package/js/utils/commercialManagement/document.js +1 -6
  236. package/js/utils/commercialManagement/document.js.map +1 -1
  237. package/js/utils/commercialManagement/recurrence.js +47 -0
  238. package/js/utils/commercialManagement/recurrence.js.map +1 -0
  239. package/js/utils/index.js +12 -0
  240. package/js/utils/index.js.map +1 -1
  241. package/js/utils/task.js +29 -20
  242. package/js/utils/task.js.map +1 -1
  243. package/js/utils/webmail.js +1 -3
  244. package/js/utils/webmail.js.map +1 -1
  245. package/package.json +1 -1
  246. package/ts/api/resources/{commercialDocument.ts → CommercialDocument.ts} +10 -0
  247. package/ts/api/resources/Dashboard.ts +0 -6
  248. package/ts/api/resources/Exercice.ts +4 -0
  249. package/ts/api/resources/Invoice.ts +4 -0
  250. package/ts/api/resources/Mail.ts +2 -2
  251. package/ts/api/resources/Qonto.ts +7 -1
  252. package/ts/api/resources/Recurrence.ts +17 -0
  253. package/ts/api/resources/{reminder.ts → Reminder.ts} +1 -1
  254. package/ts/api/resources/User.ts +3 -12
  255. package/ts/api/resources.ts +4 -2
  256. package/ts/types/Enum/BrandClementine.ts +3 -0
  257. package/ts/types/Enum/CommercialManagement.ts +3 -1
  258. package/ts/types/Enum/RecurrenceType.ts +25 -0
  259. package/ts/types/Enum/Role.ts +15 -10
  260. package/ts/types/Enum/RoleDetail.ts +120 -64
  261. package/ts/types/Enum/TaskResponseType.ts +35 -2
  262. package/ts/types/Enum/TimeCounterType.ts +7 -7
  263. package/ts/types/Interface/api/commercialManagement/Create.ts +62 -81
  264. package/ts/types/Interface/api/commercialManagement/Query.ts +25 -0
  265. package/ts/types/Interface/api/commercialManagement/Read.ts +19 -0
  266. package/ts/types/Interface/api/commercialManagement/Update.ts +25 -1
  267. package/ts/types/Interface/api/mail/QueryCountUnprocessedByUserMail.ts +1 -1
  268. package/ts/types/Interface/api/mail/QueryPaginatedMail.ts +1 -1
  269. package/ts/types/Interface/api/qonto/CreateImportation.ts +14 -0
  270. package/ts/types/Interface/api/qonto/Query.ts +80 -0
  271. package/ts/types/Interface/api/revision/QueryRevision.ts +15 -2
  272. package/ts/types/Interface/api/revision/QueryRevisionAccount.ts +11 -4
  273. package/ts/types/Interface/api/revision/QueryRevisionPaginate.ts +15 -2
  274. package/ts/types/Interface/api/revision/QueryRevisionSearchEntries.ts +1 -1
  275. package/ts/types/Interface/api/task/QueryCountTask.ts +1 -1
  276. package/ts/types/Interface/api/task/QueryPaginatedTask.ts +9 -0
  277. package/ts/types/Interface/api/user/ParamsGetAllCollaborators.ts +9 -0
  278. package/ts/types/Interface/api/user/QueryGetAllCollaborators.ts +10 -1
  279. package/ts/types/Interface/models/IApiError.ts +1 -0
  280. package/ts/types/Interface/models/IEstimateInvoice.ts +4 -2
  281. package/ts/types/Interface/models/IInvoiceRecurrence.ts +16 -0
  282. package/ts/types/Interface/models/IInvoiceReminder.ts +1 -1
  283. package/ts/types/Interface/models/ITask.ts +2 -2
  284. package/ts/types/index.ts +4 -2
  285. package/ts/utils/commercialManagement/document.ts +1 -6
  286. package/ts/utils/commercialManagement/recurrence.ts +39 -0
  287. package/ts/utils/index.ts +1 -0
  288. package/ts/utils/task.ts +24 -16
  289. package/ts/utils/webmail.ts +1 -3
  290. package/es/api/resources/commercialDocument.d.ts.map +0 -1
  291. package/es/api/resources/commercialDocument.js.map +0 -1
  292. package/es/types/Interface/api/dashboard/QueryGescom.d.ts +0 -8
  293. package/es/types/Interface/api/dashboard/QueryGescom.d.ts.map +0 -1
  294. package/es/types/Interface/api/dashboard/QueryGescom.js.map +0 -1
  295. package/es/types/Interface/api/dashboard/ReadGescom.d.ts +0 -22
  296. package/es/types/Interface/api/dashboard/ReadGescom.d.ts.map +0 -1
  297. package/es/types/Interface/api/dashboard/ReadGescom.js +0 -9
  298. package/es/types/Interface/api/dashboard/ReadGescom.js.map +0 -1
  299. package/js/api/resources/commercialDocument.js.map +0 -1
  300. package/js/types/Interface/api/dashboard/QueryGescom.js.map +0 -1
  301. package/js/types/Interface/api/dashboard/ReadGescom.js +0 -22
  302. package/js/types/Interface/api/dashboard/ReadGescom.js.map +0 -1
  303. package/ts/types/Interface/api/dashboard/QueryGescom.ts +0 -18
  304. package/ts/types/Interface/api/dashboard/ReadGescom.ts +0 -24
@@ -81,10 +81,12 @@ export class QueryDocumentPaginated {
81
81
 
82
82
  @ApiPropertyOptional()
83
83
  @IsDateString()
84
+ @IsOptional()
84
85
  minDate?: string;
85
86
 
86
87
  @ApiPropertyOptional()
87
88
  @IsDateString()
89
+ @IsOptional()
88
90
  maxDate?: string;
89
91
 
90
92
  @ApiPropertyOptional()
@@ -112,4 +114,27 @@ export class QueryDocumentPaginated {
112
114
  @IsBoolean()
113
115
  @ToBoolean()
114
116
  isDraft?: boolean;
117
+ }
118
+
119
+ export class QueryCountByStatus {
120
+ @ApiPropertyOptional()
121
+ @IsDateString()
122
+ @IsOptional()
123
+ minDate?: string;
124
+
125
+ @ApiPropertyOptional()
126
+ @IsDateString()
127
+ @IsOptional()
128
+ maxDate?: string;
129
+
130
+ @ApiPropertyOptional()
131
+ @IsOptional()
132
+ @IsString()
133
+ search?: string;
134
+
135
+ @ApiPropertyOptional()
136
+ @IsBoolean()
137
+ @ToBoolean()
138
+ @IsOptional()
139
+ isDraft?: boolean;
115
140
  }
@@ -4,6 +4,7 @@ import { IProductInvoice } from '../../models/IProductInvoice';
4
4
  import { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';
5
5
  import { CommercialDocumentInputs } from './Create';
6
6
  import { IEstimateInvoice } from '../../models/IEstimateInvoice';
7
+ import { EstimateStatus, InvoiceStatus } from '../../../Enum/CommercialManagement';
7
8
 
8
9
  export type ReadCashBasedInvoice = Partial<IAccountingFile>;
9
10
 
@@ -64,4 +65,22 @@ export type ReadCommercialDocumentTemplate = {
64
65
  body: string;
65
66
  footer: string;
66
67
  data: ReadDocumentEditing;
68
+ };
69
+
70
+ export type ReadEstimateInvoiceStatus =
71
+ InvoiceStatus.PAID |
72
+ InvoiceStatus.UNPAID |
73
+ InvoiceStatus.CANCELED |
74
+ InvoiceStatus.WAITING |
75
+ EstimateStatus.REFUSED |
76
+ EstimateStatus.BILLED |
77
+ EstimateStatus.ACCEPTED |
78
+ EstimateStatus.WAITING |
79
+ EstimateStatus.EXPIRED;
80
+
81
+ type CountAndNumber = { count: number; amount: number; };
82
+
83
+ export type ReadCountDocumentByStatus = {
84
+ invoices: { paid: CountAndNumber; waiting: CountAndNumber; unpaid: CountAndNumber; }
85
+ preSales: { accepted: CountAndNumber; waiting: CountAndNumber; refused: CountAndNumber; }
67
86
  };
@@ -1,8 +1,9 @@
1
1
  import {
2
- IsBoolean, IsDate, IsOptional, IsString,
2
+ IsBoolean, IsDate, IsDateString, IsEnum, IsOptional, IsString,
3
3
  } from 'class-validator';
4
4
  import { ApiPropertyOptional } from '../../../../utils';
5
5
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
+ import { RecurrenceType } from '../../../Enum/RecurrenceType';
6
7
 
7
8
  export class UpdateCommercialDocument {
8
9
  @ApiPropertyOptional()
@@ -69,4 +70,27 @@ export class UpdateReminder {
69
70
  @IsString()
70
71
  @IsOptional()
71
72
  message?: string;
73
+ }
74
+
75
+ export class UpdateRecurrence {
76
+ @ApiPropertyOptional()
77
+ @IsEnum(RecurrenceType)
78
+ @IsOptional()
79
+ type?: number;
80
+
81
+ @ApiPropertyOptional()
82
+ @IsDateString()
83
+ @IsOptional()
84
+ startDate?: string;
85
+
86
+ @ApiPropertyOptional()
87
+ @IsDateString()
88
+ @IsOptional()
89
+ endDate?: string;
90
+
91
+ @ApiPropertyOptional()
92
+ @ToBoolean()
93
+ @IsBoolean()
94
+ @IsOptional()
95
+ isActive?: boolean;
72
96
  }
@@ -21,5 +21,5 @@ export class QueryCountUnprocessedByUserMail {
21
21
  @IsOptional()
22
22
  @IsBoolean()
23
23
  @ToBoolean()
24
- isCountingManagerRoleMails?: boolean;
24
+ handlingManagerRoleMails?: boolean;
25
25
  }
@@ -88,7 +88,7 @@ export class QueryPaginatedMail {
88
88
  @IsOptional()
89
89
  @IsBoolean()
90
90
  @ToBoolean()
91
- displayManagerRoleMails?: boolean;
91
+ handlingManagerRoleMails?: boolean;
92
92
 
93
93
  @ApiPropertyOptional()
94
94
  @IsOptional()
@@ -0,0 +1,14 @@
1
+ import { IsDateString, IsOptional } from 'class-validator';
2
+ import { ApiPropertyOptional } from '../../../../utils';
3
+
4
+ export class CreateImportation {
5
+ @ApiPropertyOptional()
6
+ @IsOptional()
7
+ @IsDateString()
8
+ minDate?: string;
9
+
10
+ @ApiPropertyOptional()
11
+ @IsOptional()
12
+ @IsDateString()
13
+ maxDate?: string ;
14
+ }
@@ -0,0 +1,80 @@
1
+ type QontoOrganisationBankAccount = {
2
+ slug: string;
3
+ iban: string;
4
+ bic: string | null;
5
+ currency: string;
6
+ balance: number;
7
+ balance_cents: number;
8
+ authorized_balance: number;
9
+ authorized_balance_cents: number;
10
+ updated_at: string;
11
+ status: 'active' | 'closed';
12
+ };
13
+
14
+ export type GetQontoOrganization = {
15
+ organization: {
16
+ slug: string;
17
+ legal_name: string | null;
18
+ bank_accounts: QontoOrganisationBankAccount[];
19
+ }
20
+ };
21
+
22
+ export type GetQontoTransactionsResponse = {
23
+ transactions: QontoTransaction[];
24
+ meta: {
25
+ current_page: number;
26
+ next_page: number | null;
27
+ prev_page: number | null;
28
+ total_pages: number;
29
+ total_count: number;
30
+ per_page: number;
31
+ }
32
+ };
33
+
34
+ export type QontoTransaction = {
35
+ transaction_id: string;
36
+ amount: number;
37
+ amount_cents: number;
38
+ settled_balance: number;
39
+ settled_balance_cents: number;
40
+ attachment_ids: string[],
41
+ local_amount: number;
42
+ local_amount_cents: number;
43
+ side: string;
44
+ operation_type: string;
45
+ currency: string;
46
+ local_currency: string;
47
+ label: string;
48
+ settled_at: string;
49
+ emitted_at: string;
50
+ updated_at: string;
51
+ status: string;
52
+ note: string;
53
+ reference: string | null;
54
+ vat_amount: number | null;
55
+ vat_amount_cents: number | null;
56
+ vat_rate: number | null;
57
+ initiator_id: string | null;
58
+ label_ids: string[];
59
+ attachment_lost: boolean,
60
+ attachment_required: boolean,
61
+ card_last_digits: string | null,
62
+ category: string | null,
63
+ id: string | null
64
+ };
65
+
66
+ export type GetQontoAttachment = {
67
+ id: string;
68
+ created_at: string;
69
+ file_name: string;
70
+ file_size: string;
71
+ file_content_type: string;
72
+ url: string;
73
+ probative_attachment: {
74
+ status: string;
75
+ file_name: string;
76
+ file_content_type: string;
77
+ file_size:string;
78
+ url: string | null;
79
+ }
80
+ };
@@ -1,7 +1,9 @@
1
1
  import {
2
- IsDate, IsInt, IsNumber,
2
+ IsBoolean,
3
+ IsDate, IsInt, IsNumber, IsOptional, IsString,
3
4
  } from 'class-validator';
4
- import { ApiProperty } from '../../../..';
5
+ import { ApiProperty, ApiPropertyOptional } from '../../../..';
6
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
5
7
 
6
8
  export class QueryRevision {
7
9
  @ApiProperty()
@@ -16,6 +18,17 @@ export class QueryRevision {
16
18
  @IsInt()
17
19
  idSociety: number;
18
20
 
21
+ @ApiPropertyOptional()
22
+ @IsString()
23
+ @IsOptional()
24
+ orderBy?: 'designation' | 'amount' | 'number';
25
+
26
+ @ApiPropertyOptional()
27
+ @IsBoolean()
28
+ @ToBoolean()
29
+ @IsOptional()
30
+ descending?: boolean;
31
+
19
32
  // Interface paginate
20
33
  @ApiProperty({ default: 25 })
21
34
  @IsNumber()
@@ -1,17 +1,16 @@
1
1
  import {
2
- IsDate, IsInt, IsNumber,
2
+ IsBoolean,
3
+ IsDate, IsInt, IsNumber, IsOptional, IsString,
3
4
  } from 'class-validator';
4
5
  import { ApiProperty, QueryPaginate } from '../../../..';
5
6
  import { ApiPropertyOptional } from '../../../../utils';
7
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
8
 
7
9
  export class QueryRevisionAccount implements QueryPaginate {
8
10
  @ApiProperty({ default: 1 })
9
11
  @IsNumber()
10
12
  page: number;
11
13
 
12
- @ApiPropertyOptional({ default: 'idAccount' })
13
- orderBy?: string;
14
-
15
14
  @ApiProperty()
16
15
  @IsDate()
17
16
  startDate: Date;
@@ -24,7 +23,15 @@ export class QueryRevisionAccount implements QueryPaginate {
24
23
  @IsNumber()
25
24
  limit: number;
26
25
 
26
+ @ApiPropertyOptional({ default: 'idAccount' })
27
+ @IsString()
28
+ @IsOptional()
29
+ orderBy?: 'date' | 'designation' | 'idAccount' | 'debit' | 'credit';
30
+
27
31
  @ApiPropertyOptional({ default: true })
32
+ @IsBoolean()
33
+ @ToBoolean()
34
+ @IsOptional()
28
35
  descending?: boolean;
29
36
 
30
37
  @ApiPropertyOptional()
@@ -1,7 +1,9 @@
1
1
  import {
2
- IsDate, IsInt, IsNumber,
2
+ IsBoolean,
3
+ IsDate, IsInt, IsNumber, IsOptional, IsString,
3
4
  } from 'class-validator';
4
- import { ApiProperty } from '../../../..';
5
+ import { ApiProperty, ApiPropertyOptional } from '../../../..';
6
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
5
7
 
6
8
  export class QueryRevisionPaginate {
7
9
  @ApiProperty()
@@ -16,6 +18,17 @@ export class QueryRevisionPaginate {
16
18
  @IsInt()
17
19
  idSociety: number;
18
20
 
21
+ @ApiPropertyOptional()
22
+ @IsString()
23
+ @IsOptional()
24
+ orderBy?: 'designation' | 'amount' | 'number';
25
+
26
+ @ApiPropertyOptional()
27
+ @IsBoolean()
28
+ @ToBoolean()
29
+ @IsOptional()
30
+ descending?: boolean;
31
+
19
32
  // Interface paginate
20
33
  @ApiProperty({ default: 25 })
21
34
  @IsNumber()
@@ -82,7 +82,7 @@ export class QueryRevisionSearchEntries {
82
82
  @ApiPropertyOptional({ default: 'date' })
83
83
  @IsString()
84
84
  @IsOptional()
85
- orderBy?: 'date' | 'accountNumber' | 'amount' | 'designation' | 'vatRate';
85
+ orderBy?: 'date' | 'accountNumber' | 'amount' | 'designation' | 'vatRate' | 'debit' | 'credit';
86
86
 
87
87
  @ApiPropertyOptional()
88
88
  @IsBoolean()
@@ -14,7 +14,7 @@ export class QueryCountTask {
14
14
  @ApiPropertyOptional()
15
15
  @IsOptional()
16
16
  @IsInt()
17
- idRole?: number;
17
+ idService?: number;
18
18
 
19
19
  @ApiPropertyOptional()
20
20
  @IsOptional()
@@ -5,6 +5,10 @@ import { ApiPropertyOptional } from '../../../../utils';
5
5
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
6
6
 
7
7
  export class QueryPaginatedTask {
8
+ @ApiPropertyOptional()
9
+ @IsOptional()
10
+ isIntern?: boolean;
11
+
8
12
  @ApiPropertyOptional()
9
13
  @IsOptional()
10
14
  @IsInt()
@@ -36,6 +40,11 @@ export class QueryPaginatedTask {
36
40
  @IsInt()
37
41
  idUser?: number;
38
42
 
43
+ @ApiPropertyOptional({ description: 'roles for filter tasks' })
44
+ @IsOptional()
45
+ @IsInt()
46
+ idService?: number;
47
+
39
48
  @ApiPropertyOptional({ description: 'user who terminate the task' })
40
49
  @IsOptional()
41
50
  @IsInt()
@@ -1,4 +1,5 @@
1
1
  import {
2
+ IsIn,
2
3
  IsNumber,
3
4
  IsOptional, IsString,
4
5
  } from 'class-validator';
@@ -26,4 +27,12 @@ export class ParamsGetAllCollaborators {
26
27
  @IsOptional()
27
28
  @IsNumber()
28
29
  idUser?: number[];
30
+
31
+ @ApiPropertyOptional()
32
+ @IsOptional()
33
+ @IsString({
34
+ each: true,
35
+ })
36
+ @IsIn(['avatar', 'teams', 'businessLines'], { each: true })
37
+ include?: string[];
29
38
  }
@@ -1,4 +1,5 @@
1
- import { ApiProperty } from '../../../../utils';
1
+ import { IsIn, IsOptional, IsString } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
3
 
3
4
  export class QueryGetAllCollaborators {
4
5
  @ApiProperty({
@@ -8,4 +9,12 @@ export class QueryGetAllCollaborators {
8
9
  example: [1, 13],
9
10
  })
10
11
  idUser?: number[];
12
+
13
+ @ApiPropertyOptional()
14
+ @IsOptional()
15
+ @IsString({
16
+ each: true,
17
+ })
18
+ @IsIn(['avatar', 'teams', 'businessLines'], { each: true })
19
+ include?: string[];
11
20
  }
@@ -173,6 +173,7 @@ export enum Code {
173
173
  // Gescom
174
174
  CAN_NOT_DELETE_DOCUMENT = 'can_not_delete_document',
175
175
  CAN_NOT_EDIT_INVOICE = 'can_not_edit_invoice',
176
+ INVALID_INVOICE_TYPE = 'invalid_invoice_type',
176
177
  }
177
178
 
178
179
  export interface IApiError {
@@ -1,5 +1,4 @@
1
1
  import { IProductInvoice } from './IProductInvoice';
2
- import { IEstimateInvoiceRepeat } from './IEstimateInvoiceRepeat';
3
2
  import { IPaymentExpectationCustomer } from './IPaymentExpectationCustomer';
4
3
  import { IThirdParty } from './IThirdParty';
5
4
  import { IFrequency } from './IFrequency';
@@ -7,6 +6,8 @@ import { IEstimateInvoiceType } from './IEstimateInvoiceType';
7
6
  import { ISociety } from './ISociety';
8
7
  import { IInvoiceReminder } from './IInvoiceReminder';
9
8
  import { IFile } from './IFile';
9
+ import { IInvoiceRecurrence } from './IInvoiceRecurrence';
10
+ import { ReadEstimateInvoiceStatus } from '../api/commercialManagement/Read';
10
11
 
11
12
  // estimatesInvoices
12
13
  export interface IEstimateInvoice {
@@ -38,6 +39,7 @@ export interface IEstimateInvoice {
38
39
  lastRelanceDate: Date | null;
39
40
  isRefused: boolean;
40
41
  isCanceled: boolean;
42
+ status?: ReadEstimateInvoiceStatus;
41
43
  idFile?: number | null;
42
44
  idRelatedInvoice: number | null;
43
45
  idTypeEstimateInvoice: number | number[];
@@ -58,9 +60,9 @@ export interface IEstimateInvoice {
58
60
  society?: ISociety;
59
61
  assetRelatedToThisEstimateInvoice?: IEstimateInvoice;
60
62
  estimateInvoiceForThisAsset?: IEstimateInvoice;
61
- estimateInvoiceEstimateInvoiceRepeat?: IEstimateInvoiceRepeat;
62
63
  estimateInvoiceForThisRepeat?: IEstimateInvoice;
63
64
  invoiceReminder?: IInvoiceReminder;
64
65
  relatedInvoice?: IEstimateInvoice;
66
+ recurrence?: IInvoiceRecurrence;
65
67
  file?: IFile;
66
68
  }
@@ -0,0 +1,16 @@
1
+ import { IEstimateInvoice } from '../..';
2
+ import { RecurrenceType } from '../../Enum/RecurrenceType';
3
+
4
+ export interface IInvoiceRecurrence {
5
+ id?: number;
6
+ type: RecurrenceType;
7
+ startDate: Date;
8
+ endDate: Date;
9
+ lastSend: Date | null;
10
+ isActive: boolean;
11
+ idEstimateInvoice: number;
12
+ createdAt?: Date;
13
+ updatedAt?: Date;
14
+
15
+ estimateInvoice?: IEstimateInvoice;
16
+ }
@@ -18,5 +18,5 @@ export interface IInvoiceReminder {
18
18
 
19
19
  // Associations
20
20
  society?: ISociety;
21
- estimatesInvoice?: IEstimateInvoice;
21
+ estimateInvoice?: IEstimateInvoice;
22
22
  }
@@ -16,7 +16,7 @@ export interface ITask {
16
16
  idSociety: number,
17
17
  description?: string | null,
18
18
  idRole?: number,
19
- idUser?: number,
19
+ idService?: number,
20
20
  idMail?: number,
21
21
  deadlineAt: Date,
22
22
  idUserWhoProcessed?: number,
@@ -29,7 +29,7 @@ export interface ITask {
29
29
  userWhoCreated?: IUser;
30
30
  society?: ISociety;
31
31
  role?: IRole;
32
- user?: IUser;
32
+ service?: IRole;
33
33
  userWhoProcessed?: IUser;
34
34
  userWhoRefused?: IUser;
35
35
  calendarEvent?: ICalendarEvent;
package/ts/types/index.ts CHANGED
@@ -311,6 +311,7 @@ export * from './Interface/models/ITask';
311
311
  export * from './Interface/models/IMobileNotificationLog';
312
312
  export * from './Interface/models/IMobileNotificationSetting';
313
313
  export * from './Interface/models/ITimeRecorder';
314
+ export * from './Interface/models/IInvoiceRecurrence';
314
315
  export * from './Interface/models/ILoanFile';
315
316
  export * from './Interface/models/ICommercialMail';
316
317
 
@@ -434,6 +435,7 @@ export * from './Enum/InternalService';
434
435
  export * from './Enum/SocietyTypeEvent';
435
436
  export * from './Enum/Call';
436
437
  export * from './Enum/ConnectionError';
438
+ export * from './Enum/RecurrenceType';
437
439
 
438
440
  // Interfaces API
439
441
  export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
@@ -520,11 +522,9 @@ export * from './Interface/api/dashboard/QueryBalanceBankAccount';
520
522
  export * from './Interface/api/dashboard/QueryTopBuys';
521
523
  export * from './Interface/api/dashboard/QueryTopProviders';
522
524
  export * from './Interface/api/dashboard/ReadBalanceBankAccount';
523
- export * from './Interface/api/dashboard/QueryGescom';
524
525
  export * from './Interface/api/dashboard/QueryDeadline';
525
526
  export * from './Interface/api/dashboard/ReadTopBuys';
526
527
  export * from './Interface/api/dashboard/ReadTopProviders';
527
- export * from './Interface/api/dashboard/ReadGescom';
528
528
  export * from './Interface/api/dashboard/ReadDeadline';
529
529
  export * from './Interface/api/accountant/ReadAccountantBalance';
530
530
  export * from './Interface/api/quotes/QueryQuotesAccount';
@@ -772,6 +772,8 @@ export * from './Interface/api/connector/CreateConnector';
772
772
  export * from './Interface/api/connector/QueryConnector';
773
773
  export * from './Interface/api/connection/QueryConnectionState';
774
774
  export * from './Interface/api/connection/ReadConnectionState';
775
+ export * from './Interface/api/qonto/Query';
776
+ export * from './Interface/api/qonto/CreateImportation';
775
777
 
776
778
  // Enums types
777
779
  export * from './Interface/enum/Util';
@@ -13,12 +13,7 @@ import { productToReadProductEditing } from './product';
13
13
  import { vatToReadVatEditing } from './vat';
14
14
  import { CreateInvoiceDocument, CreatePreSaleDocument } from '../../types';
15
15
 
16
- let ejs: any = null;
17
-
18
- if (process.version) {
19
- // eslint-disable-next-line global-require
20
- ejs = require('ejs');
21
- }
16
+ const ejs = require('ejs');
22
17
 
23
18
  export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument): ReadCommercialDocumentTemplate {
24
19
  const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
@@ -0,0 +1,39 @@
1
+ import * as dayjs from 'dayjs';
2
+ import { OpUnitType } from 'dayjs';
3
+ import { RecurrenceType } from '../../types/Enum/RecurrenceType';
4
+
5
+ const isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
6
+ const quarterOfYear = require('dayjs/plugin/quarterOfYear');
7
+
8
+ dayjs.extend(quarterOfYear);
9
+ dayjs.extend(isSameOrBefore);
10
+
11
+ export function getAllRecurrences(params: {
12
+ startDate: string;
13
+ endDate: string | null;
14
+ type: RecurrenceType;
15
+ }): string[] {
16
+ const { startDate, type } = params;
17
+ const endDate = params.endDate ?? '2100-01-01';
18
+
19
+ let loop = 0;
20
+
21
+ let recurrency: OpUnitType = 'month';
22
+
23
+ if (type === RecurrenceType.MONHLY) recurrency = 'month';
24
+ // @ts-ignore
25
+ else if (type === RecurrenceType.QUATERLY) recurrency = 'quarter';
26
+ else if (type === RecurrenceType.WEEKLY) recurrency = 'week';
27
+ else if (type === RecurrenceType.YEARLY) recurrency = 'year';
28
+
29
+ const nextInvoices: string[] = [];
30
+
31
+ // @ts-ignore
32
+ while (dayjs(startDate).add(loop, recurrency).isSameOrBefore(endDate)) {
33
+ const currentDate = dayjs(startDate).add(loop, recurrency);
34
+ nextInvoices.push(currentDate.format('YYYY-MM-DD'));
35
+ loop += 1;
36
+ }
37
+
38
+ return nextInvoices;
39
+ }
package/ts/utils/index.ts CHANGED
@@ -8,4 +8,5 @@ export * from './siretValidation';
8
8
  export * from './task';
9
9
  export * from './social';
10
10
  export * from './commercialManagement/document';
11
+ export * from './commercialManagement/recurrence';
11
12
  export * from './amount';
package/ts/utils/task.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Role } from '../types/Enum/Role';
2
+ import { TaskResponseType, RoleAvailableForTask } from '../types/Enum/TaskResponseType';
2
3
 
3
4
  const getIdRoleUsedForTask = (listRoles: number[]): number => {
4
5
  let idRole = 0;
5
- if (listRoles.includes(Role.COMMERCIAL) || listRoles.includes(Role.COMMERCIAL_MANAGER)) {
6
+ if (listRoles.includes(Role.COMMERCIAL)) {
6
7
  idRole = Role.COMMERCIAL;
7
8
  } else if (listRoles.includes(Role.JURIDIC)) {
8
9
  idRole = Role.JURIDIC;
@@ -10,28 +11,35 @@ const getIdRoleUsedForTask = (listRoles: number[]): number => {
10
11
  idRole = Role.SOCIAL;
11
12
  } else if (listRoles.includes(Role.FACTURATION)) {
12
13
  idRole = Role.FACTURATION;
13
- } else if (listRoles.includes(Role.CUSTOMER_SUCCESS) || listRoles.includes(Role.CUSTOMER_SUCCESS_MANAGER)) {
14
+ } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
14
15
  idRole = Role.CUSTOMER_SUCCESS;
15
- } else if (listRoles.includes(Role.FRONT_OFFICE) || listRoles.includes(Role.FRONT_MANAGER)) {
16
+ } else if (listRoles.includes(Role.FRONT_OFFICE)) {
16
17
  idRole = Role.FRONT_OFFICE;
17
18
  }
18
19
  return idRole;
19
20
  };
20
21
 
21
- const getIdRoleUsedForManagerTask = (listRoles: number[]): number => {
22
- let idRole = 0;
23
- if (listRoles.includes(Role.COMMERCIAL)) {
24
- idRole = Role.COMMERCIAL_MANAGER;
25
- } else if (listRoles.includes(Role.JURIDIC) || listRoles.includes(Role.SOCIAL) || listRoles.includes(Role.FACTURATION)) {
26
- idRole = Role.MANAGER;
27
- } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
28
- idRole = Role.CUSTOMER_SUCCESS_MANAGER;
29
- } else if (listRoles.includes(Role.FRONT_OFFICE)) {
30
- idRole = Role.FRONT_MANAGER;
31
- }
32
- return idRole;
22
+ // const getIdRoleUsedForManagerTask = (listRoles: number[]): number => {
23
+ // let idRole = 0;
24
+ // if (listRoles.includes(Role.COMMERCIAL)) {
25
+ // idRole = Role.MANAGER;
26
+ // } else if (listRoles.includes(Role.JURIDIC) || listRoles.includes(Role.SOCIAL) || listRoles.includes(Role.FACTURATION)) {
27
+ // idRole = Role.MANAGER;
28
+ // } else if (listRoles.includes(Role.CUSTOMER_SUCCESS)) {
29
+ // idRole = Role.MANAGER;
30
+ // } else if (listRoles.includes(Role.FRONT_OFFICE)) {
31
+ // idRole = Role.MANAGER;
32
+ // }
33
+ // return idRole;
34
+ // };
35
+
36
+ const getIdRoleUsedForAttribution = (isIntern: boolean, idTaskType: number): number | undefined => {
37
+ const taskTypeList = isIntern ? TaskResponseType.INTERN.types : TaskResponseType.EXTERN.types;
38
+ return taskTypeList.find((taskType) => taskType.id === idTaskType)?.role;
33
39
  };
34
40
 
41
+ const getIdRoleUsedForGetTaskOfUser = (idRole: number): boolean => !!Object.values(RoleAvailableForTask).find((role) => role === idRole);
42
+
35
43
  export {
36
- getIdRoleUsedForTask, getIdRoleUsedForManagerTask,
44
+ getIdRoleUsedForTask, getIdRoleUsedForAttribution, getIdRoleUsedForGetTaskOfUser,
37
45
  };
@@ -4,13 +4,11 @@ const getIdRoleUsedForEmail = (listRoles: number[]): number => {
4
4
  let idRole = Role.CUSTOMER_SUCCESS;
5
5
  if (listRoles.includes(Role.FACTURATION)) {
6
6
  idRole = Role.FACTURATION;
7
- } else if (listRoles.includes(Role.BACK_MANAGER)) {
8
- idRole = Role.BACK_MANAGER;
9
7
  } else if (listRoles.includes(Role.FRONT_OFFICE)) {
10
8
  idRole = Role.FRONT_OFFICE;
11
9
  } else if (listRoles.includes(Role.FRONT_OFFICE_EXPRESS)) {
12
10
  idRole = Role.FRONT_OFFICE_EXPRESS;
13
- } else if (listRoles.includes(Role.COMMERCIAL) || listRoles.includes(Role.COMMERCIAL_MANAGER)) {
11
+ } else if (listRoles.includes(Role.COMMERCIAL)) {
14
12
  idRole = Role.COMMERCIAL;
15
13
  } else if (listRoles.includes(Role.EXPERT_ACCOUNTANT)) {
16
14
  idRole = Role.EXPERT_ACCOUNTANT;