@open-mercato/core 0.6.8-develop.6998.1.d2bc46c56c → 0.6.8-develop.7001.1.03608ab252

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 (651) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/dist/generated/entities/warranty_claim/index.js +105 -0
  3. package/dist/generated/entities/warranty_claim/index.js.map +7 -0
  4. package/dist/generated/entities/warranty_claim_event/index.js +25 -0
  5. package/dist/generated/entities/warranty_claim_event/index.js.map +7 -0
  6. package/dist/generated/entities/warranty_claim_line/index.js +77 -0
  7. package/dist/generated/entities/warranty_claim_line/index.js.map +7 -0
  8. package/dist/generated/entities/warranty_claim_registration/index.js +43 -0
  9. package/dist/generated/entities/warranty_claim_registration/index.js.map +7 -0
  10. package/dist/generated/entities/warranty_claim_sequence/index.js +17 -0
  11. package/dist/generated/entities/warranty_claim_sequence/index.js.map +7 -0
  12. package/dist/generated/entities/warranty_claim_settings/index.js +43 -0
  13. package/dist/generated/entities/warranty_claim_settings/index.js.map +7 -0
  14. package/dist/generated/entities/warranty_claim_sla_signal/index.js +25 -0
  15. package/dist/generated/entities/warranty_claim_sla_signal/index.js.map +7 -0
  16. package/dist/generated/entities/warranty_troubleshooting_guide/index.js +25 -0
  17. package/dist/generated/entities/warranty_troubleshooting_guide/index.js.map +7 -0
  18. package/dist/generated/entities/warranty_vendor_policy/index.js +31 -0
  19. package/dist/generated/entities/warranty_vendor_policy/index.js.map +7 -0
  20. package/dist/generated/entities.ids.generated.js +12 -0
  21. package/dist/generated/entities.ids.generated.js.map +2 -2
  22. package/dist/generated/entity-fields-registry.js +200 -0
  23. package/dist/generated/entity-fields-registry.js.map +2 -2
  24. package/dist/helpers/integration/api.js +3 -2
  25. package/dist/helpers/integration/api.js.map +2 -2
  26. package/dist/helpers/integration/salesFixtures.js +13 -6
  27. package/dist/helpers/integration/salesFixtures.js.map +2 -2
  28. package/dist/modules/attachments/di.js +18 -0
  29. package/dist/modules/attachments/di.js.map +2 -2
  30. package/dist/modules/attachments/fields/attachment.js +186 -26
  31. package/dist/modules/attachments/fields/attachment.js.map +2 -2
  32. package/dist/modules/attachments/lib/scoped-upload-service.js +202 -0
  33. package/dist/modules/attachments/lib/scoped-upload-service.js.map +7 -0
  34. package/dist/modules/attachments/lib/target-access-service.js +39 -0
  35. package/dist/modules/attachments/lib/target-access-service.js.map +7 -0
  36. package/dist/modules/auth/api/logout.js +37 -10
  37. package/dist/modules/auth/api/logout.js.map +2 -2
  38. package/dist/modules/auth/api/reset/confirm.js +7 -0
  39. package/dist/modules/auth/api/reset/confirm.js.map +2 -2
  40. package/dist/modules/auth/api/reset.js +7 -0
  41. package/dist/modules/auth/api/reset.js.map +2 -2
  42. package/dist/modules/auth/commands/users.js +13 -0
  43. package/dist/modules/auth/commands/users.js.map +2 -2
  44. package/dist/modules/auth/events.js +15 -0
  45. package/dist/modules/auth/events.js.map +2 -2
  46. package/dist/modules/customers/api/companies/route.js +1 -0
  47. package/dist/modules/customers/api/companies/route.js.map +2 -2
  48. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +2 -2
  49. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
  50. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +2 -2
  51. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
  52. package/dist/modules/customers/components/detail/assignableStaff.js +6 -69
  53. package/dist/modules/customers/components/detail/assignableStaff.js.map +2 -2
  54. package/dist/modules/customers/lib/assignableStaff.js +76 -0
  55. package/dist/modules/customers/lib/assignableStaff.js.map +7 -0
  56. package/dist/modules/data_sync/lib/batch-stream.js +56 -0
  57. package/dist/modules/data_sync/lib/batch-stream.js.map +7 -0
  58. package/dist/modules/data_sync/lib/sync-engine.js +165 -103
  59. package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
  60. package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js +4 -0
  61. package/dist/modules/inbox_ops/api/emails/[id]/reprocess/route.js.map +2 -2
  62. package/dist/modules/inbox_ops/api/extract/route.js +4 -0
  63. package/dist/modules/inbox_ops/api/extract/route.js.map +2 -2
  64. package/dist/modules/inbox_ops/api/webhook/inbound.js +4 -0
  65. package/dist/modules/inbox_ops/api/webhook/inbound.js.map +2 -2
  66. package/dist/modules/sales/commands/documents.js +8 -8
  67. package/dist/modules/sales/commands/documents.js.map +2 -2
  68. package/dist/modules/warranty_claims/acl.js +75 -0
  69. package/dist/modules/warranty_claims/acl.js.map +7 -0
  70. package/dist/modules/warranty_claims/ai-agents.js +161 -0
  71. package/dist/modules/warranty_claims/ai-agents.js.map +7 -0
  72. package/dist/modules/warranty_claims/ai-tools.js +591 -0
  73. package/dist/modules/warranty_claims/ai-tools.js.map +7 -0
  74. package/dist/modules/warranty_claims/api/ai/assess/route.js +304 -0
  75. package/dist/modules/warranty_claims/api/ai/assess/route.js.map +7 -0
  76. package/dist/modules/warranty_claims/api/ai/draft-reply/route.js +127 -0
  77. package/dist/modules/warranty_claims/api/ai/draft-reply/route.js.map +7 -0
  78. package/dist/modules/warranty_claims/api/ai/suggest/route.js +177 -0
  79. package/dist/modules/warranty_claims/api/ai/suggest/route.js.map +7 -0
  80. package/dist/modules/warranty_claims/api/assign/route.js +124 -0
  81. package/dist/modules/warranty_claims/api/assign/route.js.map +7 -0
  82. package/dist/modules/warranty_claims/api/assignees/route.js +97 -0
  83. package/dist/modules/warranty_claims/api/assignees/route.js.map +7 -0
  84. package/dist/modules/warranty_claims/api/credit-memo/route.js +152 -0
  85. package/dist/modules/warranty_claims/api/credit-memo/route.js.map +7 -0
  86. package/dist/modules/warranty_claims/api/entitlement/route.js +145 -0
  87. package/dist/modules/warranty_claims/api/entitlement/route.js.map +7 -0
  88. package/dist/modules/warranty_claims/api/events/route.js +199 -0
  89. package/dist/modules/warranty_claims/api/events/route.js.map +7 -0
  90. package/dist/modules/warranty_claims/api/external/claims/route.js +446 -0
  91. package/dist/modules/warranty_claims/api/external/claims/route.js.map +7 -0
  92. package/dist/modules/warranty_claims/api/lines/route.js +258 -0
  93. package/dist/modules/warranty_claims/api/lines/route.js.map +7 -0
  94. package/dist/modules/warranty_claims/api/openapi.js +27 -0
  95. package/dist/modules/warranty_claims/api/openapi.js.map +7 -0
  96. package/dist/modules/warranty_claims/api/portal/attachments/route.js +490 -0
  97. package/dist/modules/warranty_claims/api/portal/attachments/route.js.map +7 -0
  98. package/dist/modules/warranty_claims/api/portal/claims/[id]/route.js +178 -0
  99. package/dist/modules/warranty_claims/api/portal/claims/[id]/route.js.map +7 -0
  100. package/dist/modules/warranty_claims/api/portal/claims/[id]/shared.js +101 -0
  101. package/dist/modules/warranty_claims/api/portal/claims/[id]/shared.js.map +7 -0
  102. package/dist/modules/warranty_claims/api/portal/claims/[id]/submit/route.js +78 -0
  103. package/dist/modules/warranty_claims/api/portal/claims/[id]/submit/route.js.map +7 -0
  104. package/dist/modules/warranty_claims/api/portal/claims/[id]/withdraw/route.js +81 -0
  105. package/dist/modules/warranty_claims/api/portal/claims/[id]/withdraw/route.js.map +7 -0
  106. package/dist/modules/warranty_claims/api/portal/claims/route.js +462 -0
  107. package/dist/modules/warranty_claims/api/portal/claims/route.js.map +7 -0
  108. package/dist/modules/warranty_claims/api/portal/events/route.js +228 -0
  109. package/dist/modules/warranty_claims/api/portal/events/route.js.map +7 -0
  110. package/dist/modules/warranty_claims/api/portal/options/route.js +91 -0
  111. package/dist/modules/warranty_claims/api/portal/options/route.js.map +7 -0
  112. package/dist/modules/warranty_claims/api/portal/orders/lines/route.js +172 -0
  113. package/dist/modules/warranty_claims/api/portal/orders/lines/route.js.map +7 -0
  114. package/dist/modules/warranty_claims/api/portal/orders/route.js +151 -0
  115. package/dist/modules/warranty_claims/api/portal/orders/route.js.map +7 -0
  116. package/dist/modules/warranty_claims/api/portal/troubleshooting/route.js +121 -0
  117. package/dist/modules/warranty_claims/api/portal/troubleshooting/route.js.map +7 -0
  118. package/dist/modules/warranty_claims/api/receiving/route.js +176 -0
  119. package/dist/modules/warranty_claims/api/receiving/route.js.map +7 -0
  120. package/dist/modules/warranty_claims/api/registrations/route.js +382 -0
  121. package/dist/modules/warranty_claims/api/registrations/route.js.map +7 -0
  122. package/dist/modules/warranty_claims/api/replacement-order/route.js +150 -0
  123. package/dist/modules/warranty_claims/api/replacement-order/route.js.map +7 -0
  124. package/dist/modules/warranty_claims/api/return-label/route.js +235 -0
  125. package/dist/modules/warranty_claims/api/return-label/route.js.map +7 -0
  126. package/dist/modules/warranty_claims/api/risk/route.js +101 -0
  127. package/dist/modules/warranty_claims/api/risk/route.js.map +7 -0
  128. package/dist/modules/warranty_claims/api/route.js +482 -0
  129. package/dist/modules/warranty_claims/api/route.js.map +7 -0
  130. package/dist/modules/warranty_claims/api/sales-return/route.js +151 -0
  131. package/dist/modules/warranty_claims/api/sales-return/route.js.map +7 -0
  132. package/dist/modules/warranty_claims/api/settings-general/route.js +195 -0
  133. package/dist/modules/warranty_claims/api/settings-general/route.js.map +7 -0
  134. package/dist/modules/warranty_claims/api/stats/route.js +199 -0
  135. package/dist/modules/warranty_claims/api/stats/route.js.map +7 -0
  136. package/dist/modules/warranty_claims/api/submit/route.js +120 -0
  137. package/dist/modules/warranty_claims/api/submit/route.js.map +7 -0
  138. package/dist/modules/warranty_claims/api/transition/route.js +126 -0
  139. package/dist/modules/warranty_claims/api/transition/route.js.map +7 -0
  140. package/dist/modules/warranty_claims/api/troubleshooting-guides/route.js +261 -0
  141. package/dist/modules/warranty_claims/api/troubleshooting-guides/route.js.map +7 -0
  142. package/dist/modules/warranty_claims/api/vendor-policies/route.js +311 -0
  143. package/dist/modules/warranty_claims/api/vendor-policies/route.js.map +7 -0
  144. package/dist/modules/warranty_claims/api/vendor-recovery/route.js +130 -0
  145. package/dist/modules/warranty_claims/api/vendor-recovery/route.js.map +7 -0
  146. package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js +153 -0
  147. package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js.map +7 -0
  148. package/dist/modules/warranty_claims/backend/components/AiAssessButtons.js +268 -0
  149. package/dist/modules/warranty_claims/backend/components/AiAssessButtons.js.map +7 -0
  150. package/dist/modules/warranty_claims/backend/components/ClaimStageProgress.js +54 -0
  151. package/dist/modules/warranty_claims/backend/components/ClaimStageProgress.js.map +7 -0
  152. package/dist/modules/warranty_claims/backend/components/ClaimStatusBadge.js +87 -0
  153. package/dist/modules/warranty_claims/backend/components/ClaimStatusBadge.js.map +7 -0
  154. package/dist/modules/warranty_claims/backend/components/ClaimsKpiStrip.js +120 -0
  155. package/dist/modules/warranty_claims/backend/components/ClaimsKpiStrip.js.map +7 -0
  156. package/dist/modules/warranty_claims/backend/components/EntitlementLookupBadge.js +135 -0
  157. package/dist/modules/warranty_claims/backend/components/EntitlementLookupBadge.js.map +7 -0
  158. package/dist/modules/warranty_claims/backend/components/ReceivingPanel.js +218 -0
  159. package/dist/modules/warranty_claims/backend/components/ReceivingPanel.js.map +7 -0
  160. package/dist/modules/warranty_claims/backend/components/ReturnLabelPanel.js +231 -0
  161. package/dist/modules/warranty_claims/backend/components/ReturnLabelPanel.js.map +7 -0
  162. package/dist/modules/warranty_claims/backend/components/TroubleshootingWalker.js +82 -0
  163. package/dist/modules/warranty_claims/backend/components/TroubleshootingWalker.js.map +7 -0
  164. package/dist/modules/warranty_claims/backend/components/VendorRecoverySuggestionsPanel.js +136 -0
  165. package/dist/modules/warranty_claims/backend/components/VendorRecoverySuggestionsPanel.js.map +7 -0
  166. package/dist/modules/warranty_claims/backend/components/WarrantyWorkspace.js +41 -0
  167. package/dist/modules/warranty_claims/backend/components/WarrantyWorkspace.js.map +7 -0
  168. package/dist/modules/warranty_claims/backend/components/claimReasonOptions.js +45 -0
  169. package/dist/modules/warranty_claims/backend/components/claimReasonOptions.js.map +7 -0
  170. package/dist/modules/warranty_claims/backend/components/claimSla.js +92 -0
  171. package/dist/modules/warranty_claims/backend/components/claimSla.js.map +7 -0
  172. package/dist/modules/warranty_claims/backend/components/orderLookup.js +81 -0
  173. package/dist/modules/warranty_claims/backend/components/orderLookup.js.map +7 -0
  174. package/dist/modules/warranty_claims/backend/components/productLookup.js +317 -0
  175. package/dist/modules/warranty_claims/backend/components/productLookup.js.map +7 -0
  176. package/dist/modules/warranty_claims/backend/components/useUserDisplayNames.js +61 -0
  177. package/dist/modules/warranty_claims/backend/components/useUserDisplayNames.js.map +7 -0
  178. package/dist/modules/warranty_claims/backend/page.js +1088 -0
  179. package/dist/modules/warranty_claims/backend/page.js.map +7 -0
  180. package/dist/modules/warranty_claims/backend/page.meta.js +16 -0
  181. package/dist/modules/warranty_claims/backend/page.meta.js.map +7 -0
  182. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.js +427 -0
  183. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.js.map +7 -0
  184. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.meta.js +16 -0
  185. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.meta.js.map +7 -0
  186. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/page.js +2101 -0
  187. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/page.js.map +7 -0
  188. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/page.meta.js +16 -0
  189. package/dist/modules/warranty_claims/backend/warranty_claims/[id]/page.meta.js.map +7 -0
  190. package/dist/modules/warranty_claims/backend/warranty_claims/create/page.js +1249 -0
  191. package/dist/modules/warranty_claims/backend/warranty_claims/create/page.js.map +7 -0
  192. package/dist/modules/warranty_claims/backend/warranty_claims/create/page.meta.js +16 -0
  193. package/dist/modules/warranty_claims/backend/warranty_claims/create/page.meta.js.map +7 -0
  194. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.js +110 -0
  195. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.js.map +7 -0
  196. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.meta.js +17 -0
  197. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.meta.js.map +7 -0
  198. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/create/page.js +49 -0
  199. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/create/page.js.map +7 -0
  200. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/create/page.meta.js +17 -0
  201. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/create/page.meta.js.map +7 -0
  202. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js +485 -0
  203. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js.map +7 -0
  204. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.meta.js +19 -0
  205. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.meta.js.map +7 -0
  206. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/registrationForm.js +253 -0
  207. package/dist/modules/warranty_claims/backend/warranty_claims/registrations/registrationForm.js.map +7 -0
  208. package/dist/modules/warranty_claims/backend/warranty_claims/settings/page.js +1565 -0
  209. package/dist/modules/warranty_claims/backend/warranty_claims/settings/page.js.map +7 -0
  210. package/dist/modules/warranty_claims/backend/warranty_claims/settings/page.meta.js +19 -0
  211. package/dist/modules/warranty_claims/backend/warranty_claims/settings/page.meta.js.map +7 -0
  212. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/TroubleshootingTreeBuilder.js +472 -0
  213. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/TroubleshootingTreeBuilder.js.map +7 -0
  214. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.js +115 -0
  215. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.js.map +7 -0
  216. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.meta.js +19 -0
  217. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.meta.js.map +7 -0
  218. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.js +54 -0
  219. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.js.map +7 -0
  220. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.meta.js +19 -0
  221. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.meta.js.map +7 -0
  222. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js +414 -0
  223. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js.map +7 -0
  224. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.meta.js +21 -0
  225. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.meta.js.map +7 -0
  226. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/troubleshootingGuideForm.js +171 -0
  227. package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/troubleshootingGuideForm.js.map +7 -0
  228. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.js +111 -0
  229. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.js.map +7 -0
  230. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.meta.js +19 -0
  231. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.meta.js.map +7 -0
  232. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.js +48 -0
  233. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.js.map +7 -0
  234. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.meta.js +19 -0
  235. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.meta.js.map +7 -0
  236. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js +429 -0
  237. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js.map +7 -0
  238. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.meta.js +21 -0
  239. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.meta.js.map +7 -0
  240. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/vendorPolicyForm.js +182 -0
  241. package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/vendorPolicyForm.js.map +7 -0
  242. package/dist/modules/warranty_claims/ce.js +48 -0
  243. package/dist/modules/warranty_claims/ce.js.map +7 -0
  244. package/dist/modules/warranty_claims/commands/claim-lines.js +911 -0
  245. package/dist/modules/warranty_claims/commands/claim-lines.js.map +7 -0
  246. package/dist/modules/warranty_claims/commands/claims.js +2577 -0
  247. package/dist/modules/warranty_claims/commands/claims.js.map +7 -0
  248. package/dist/modules/warranty_claims/commands/index.js +4 -0
  249. package/dist/modules/warranty_claims/commands/index.js.map +7 -0
  250. package/dist/modules/warranty_claims/commands/settings.js +169 -0
  251. package/dist/modules/warranty_claims/commands/settings.js.map +7 -0
  252. package/dist/modules/warranty_claims/commands/shared.js +162 -0
  253. package/dist/modules/warranty_claims/commands/shared.js.map +7 -0
  254. package/dist/modules/warranty_claims/data/constants.js +35 -0
  255. package/dist/modules/warranty_claims/data/constants.js.map +7 -0
  256. package/dist/modules/warranty_claims/data/enrichers.js +97 -0
  257. package/dist/modules/warranty_claims/data/enrichers.js.map +7 -0
  258. package/dist/modules/warranty_claims/data/entities.js +731 -0
  259. package/dist/modules/warranty_claims/data/entities.js.map +7 -0
  260. package/dist/modules/warranty_claims/data/validators.js +488 -0
  261. package/dist/modules/warranty_claims/data/validators.js.map +7 -0
  262. package/dist/modules/warranty_claims/di.js +29 -0
  263. package/dist/modules/warranty_claims/di.js.map +7 -0
  264. package/dist/modules/warranty_claims/encryption.js +28 -0
  265. package/dist/modules/warranty_claims/encryption.js.map +7 -0
  266. package/dist/modules/warranty_claims/events.js +81 -0
  267. package/dist/modules/warranty_claims/events.js.map +7 -0
  268. package/dist/modules/warranty_claims/extension-points.js +19 -0
  269. package/dist/modules/warranty_claims/extension-points.js.map +7 -0
  270. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.js +825 -0
  271. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.js.map +7 -0
  272. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.meta.js +11 -0
  273. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.meta.js.map +7 -0
  274. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.js +1139 -0
  275. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.js.map +7 -0
  276. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.meta.js +11 -0
  277. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.meta.js.map +7 -0
  278. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js +253 -0
  279. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js.map +7 -0
  280. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.meta.js +18 -0
  281. package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.meta.js.map +7 -0
  282. package/dist/modules/warranty_claims/index.js +15 -0
  283. package/dist/modules/warranty_claims/index.js.map +7 -0
  284. package/dist/modules/warranty_claims/lib/aiAssist.js +496 -0
  285. package/dist/modules/warranty_claims/lib/aiAssist.js.map +7 -0
  286. package/dist/modules/warranty_claims/lib/apiIdsFilter.js +11 -0
  287. package/dist/modules/warranty_claims/lib/apiIdsFilter.js.map +7 -0
  288. package/dist/modules/warranty_claims/lib/assigneeNames.js +153 -0
  289. package/dist/modules/warranty_claims/lib/assigneeNames.js.map +7 -0
  290. package/dist/modules/warranty_claims/lib/attachmentVisibility.js +9 -0
  291. package/dist/modules/warranty_claims/lib/attachmentVisibility.js.map +7 -0
  292. package/dist/modules/warranty_claims/lib/bulkFeedback.js +8 -0
  293. package/dist/modules/warranty_claims/lib/bulkFeedback.js.map +7 -0
  294. package/dist/modules/warranty_claims/lib/businessHours.js +250 -0
  295. package/dist/modules/warranty_claims/lib/businessHours.js.map +7 -0
  296. package/dist/modules/warranty_claims/lib/businessHoursForm.js +146 -0
  297. package/dist/modules/warranty_claims/lib/businessHoursForm.js.map +7 -0
  298. package/dist/modules/warranty_claims/lib/claimTypeConfig.js +39 -0
  299. package/dist/modules/warranty_claims/lib/claimTypeConfig.js.map +7 -0
  300. package/dist/modules/warranty_claims/lib/decryptionSafety.js +17 -0
  301. package/dist/modules/warranty_claims/lib/decryptionSafety.js.map +7 -0
  302. package/dist/modules/warranty_claims/lib/deskFilters.js +88 -0
  303. package/dist/modules/warranty_claims/lib/deskFilters.js.map +7 -0
  304. package/dist/modules/warranty_claims/lib/dictionaries.js +157 -0
  305. package/dist/modules/warranty_claims/lib/dictionaries.js.map +7 -0
  306. package/dist/modules/warranty_claims/lib/dictionaryLabels.js +12 -0
  307. package/dist/modules/warranty_claims/lib/dictionaryLabels.js.map +7 -0
  308. package/dist/modules/warranty_claims/lib/emailIntake.js +87 -0
  309. package/dist/modules/warranty_claims/lib/emailIntake.js.map +7 -0
  310. package/dist/modules/warranty_claims/lib/escalation.js +58 -0
  311. package/dist/modules/warranty_claims/lib/escalation.js.map +7 -0
  312. package/dist/modules/warranty_claims/lib/externalIntake.js +233 -0
  313. package/dist/modules/warranty_claims/lib/externalIntake.js.map +7 -0
  314. package/dist/modules/warranty_claims/lib/grading.js +21 -0
  315. package/dist/modules/warranty_claims/lib/grading.js.map +7 -0
  316. package/dist/modules/warranty_claims/lib/listSegments.js +18 -0
  317. package/dist/modules/warranty_claims/lib/listSegments.js.map +7 -0
  318. package/dist/modules/warranty_claims/lib/orderOwnership.js +25 -0
  319. package/dist/modules/warranty_claims/lib/orderOwnership.js.map +7 -0
  320. package/dist/modules/warranty_claims/lib/portalAttachmentUpload.js +11 -0
  321. package/dist/modules/warranty_claims/lib/portalAttachmentUpload.js.map +7 -0
  322. package/dist/modules/warranty_claims/lib/portalAttachmentValidation.js +108 -0
  323. package/dist/modules/warranty_claims/lib/portalAttachmentValidation.js.map +7 -0
  324. package/dist/modules/warranty_claims/lib/portalClaimAccess.js +26 -0
  325. package/dist/modules/warranty_claims/lib/portalClaimAccess.js.map +7 -0
  326. package/dist/modules/warranty_claims/lib/quantity.js +19 -0
  327. package/dist/modules/warranty_claims/lib/quantity.js.map +7 -0
  328. package/dist/modules/warranty_claims/lib/risk.js +204 -0
  329. package/dist/modules/warranty_claims/lib/risk.js.map +7 -0
  330. package/dist/modules/warranty_claims/lib/settings.js +55 -0
  331. package/dist/modules/warranty_claims/lib/settings.js.map +7 -0
  332. package/dist/modules/warranty_claims/lib/stateMachine.js +88 -0
  333. package/dist/modules/warranty_claims/lib/stateMachine.js.map +7 -0
  334. package/dist/modules/warranty_claims/lib/timelineFilters.js +16 -0
  335. package/dist/modules/warranty_claims/lib/timelineFilters.js.map +7 -0
  336. package/dist/modules/warranty_claims/lib/triage.js +241 -0
  337. package/dist/modules/warranty_claims/lib/triage.js.map +7 -0
  338. package/dist/modules/warranty_claims/lib/troubleshooting.js +111 -0
  339. package/dist/modules/warranty_claims/lib/troubleshooting.js.map +7 -0
  340. package/dist/modules/warranty_claims/lib/tryResolve.js +11 -0
  341. package/dist/modules/warranty_claims/lib/tryResolve.js.map +7 -0
  342. package/dist/modules/warranty_claims/lib/vendorPolicyRecovery.js +101 -0
  343. package/dist/modules/warranty_claims/lib/vendorPolicyRecovery.js.map +7 -0
  344. package/dist/modules/warranty_claims/lib/warrantyPreview.js +18 -0
  345. package/dist/modules/warranty_claims/lib/warrantyPreview.js.map +7 -0
  346. package/dist/modules/warranty_claims/migrations/Migration20260703191537_warranty_claims.js +32 -0
  347. package/dist/modules/warranty_claims/migrations/Migration20260703191537_warranty_claims.js.map +7 -0
  348. package/dist/modules/warranty_claims/migrations/Migration20260704115605_warranty_claims.js +16 -0
  349. package/dist/modules/warranty_claims/migrations/Migration20260704115605_warranty_claims.js.map +7 -0
  350. package/dist/modules/warranty_claims/migrations/Migration20260704230000_warranty_claims.js +17 -0
  351. package/dist/modules/warranty_claims/migrations/Migration20260704230000_warranty_claims.js.map +7 -0
  352. package/dist/modules/warranty_claims/migrations/Migration20260705121601_warranty_claims.js +29 -0
  353. package/dist/modules/warranty_claims/migrations/Migration20260705121601_warranty_claims.js.map +7 -0
  354. package/dist/modules/warranty_claims/migrations/Migration20260709120000_warranty_claims.js +25 -0
  355. package/dist/modules/warranty_claims/migrations/Migration20260709120000_warranty_claims.js.map +7 -0
  356. package/dist/modules/warranty_claims/migrations/Migration20260710023607_warranty_claims.js +13 -0
  357. package/dist/modules/warranty_claims/migrations/Migration20260710023607_warranty_claims.js.map +7 -0
  358. package/dist/modules/warranty_claims/migrations/Migration20260716203936_warranty_claims.js +15 -0
  359. package/dist/modules/warranty_claims/migrations/Migration20260716203936_warranty_claims.js.map +7 -0
  360. package/dist/modules/warranty_claims/migrations/Migration20260717150000_warranty_claims.js +13 -0
  361. package/dist/modules/warranty_claims/migrations/Migration20260717150000_warranty_claims.js.map +7 -0
  362. package/dist/modules/warranty_claims/migrations/Migration20260719120000_warranty_claims.js +13 -0
  363. package/dist/modules/warranty_claims/migrations/Migration20260719120000_warranty_claims.js.map +7 -0
  364. package/dist/modules/warranty_claims/migrations/Migration20260813103053_warranty_claims.js +12 -0
  365. package/dist/modules/warranty_claims/migrations/Migration20260813103053_warranty_claims.js.map +7 -0
  366. package/dist/modules/warranty_claims/notifications.client.js +67 -0
  367. package/dist/modules/warranty_claims/notifications.client.js.map +7 -0
  368. package/dist/modules/warranty_claims/notifications.js +103 -0
  369. package/dist/modules/warranty_claims/notifications.js.map +7 -0
  370. package/dist/modules/warranty_claims/search.js +174 -0
  371. package/dist/modules/warranty_claims/search.js.map +7 -0
  372. package/dist/modules/warranty_claims/services/adjudicationEvaluator.js +202 -0
  373. package/dist/modules/warranty_claims/services/adjudicationEvaluator.js.map +7 -0
  374. package/dist/modules/warranty_claims/services/claimNumberGenerator.js +58 -0
  375. package/dist/modules/warranty_claims/services/claimNumberGenerator.js.map +7 -0
  376. package/dist/modules/warranty_claims/services/entitlementResolver.js +69 -0
  377. package/dist/modules/warranty_claims/services/entitlementResolver.js.map +7 -0
  378. package/dist/modules/warranty_claims/services/returnLabelProvider.js +14 -0
  379. package/dist/modules/warranty_claims/services/returnLabelProvider.js.map +7 -0
  380. package/dist/modules/warranty_claims/setup.js +121 -0
  381. package/dist/modules/warranty_claims/setup.js.map +7 -0
  382. package/dist/modules/warranty_claims/subscribers/auto-vendor-recovery.js +119 -0
  383. package/dist/modules/warranty_claims/subscribers/auto-vendor-recovery.js.map +7 -0
  384. package/dist/modules/warranty_claims/subscribers/claim-assigned-notification.js +47 -0
  385. package/dist/modules/warranty_claims/subscribers/claim-assigned-notification.js.map +7 -0
  386. package/dist/modules/warranty_claims/subscribers/claim-customer-reply-notification.js +60 -0
  387. package/dist/modules/warranty_claims/subscribers/claim-customer-reply-notification.js.map +7 -0
  388. package/dist/modules/warranty_claims/subscribers/claim-status-notification.js +83 -0
  389. package/dist/modules/warranty_claims/subscribers/claim-status-notification.js.map +7 -0
  390. package/dist/modules/warranty_claims/subscribers/claim-submitted-notification.js +46 -0
  391. package/dist/modules/warranty_claims/subscribers/claim-submitted-notification.js.map +7 -0
  392. package/dist/modules/warranty_claims/subscribers/email-to-claim.js +135 -0
  393. package/dist/modules/warranty_claims/subscribers/email-to-claim.js.map +7 -0
  394. package/dist/modules/warranty_claims/subscribers/return-shipment-tracking.js +164 -0
  395. package/dist/modules/warranty_claims/subscribers/return-shipment-tracking.js.map +7 -0
  396. package/dist/modules/warranty_claims/subscribers/vendor-recovery-reconciliation-undo.js +24 -0
  397. package/dist/modules/warranty_claims/subscribers/vendor-recovery-reconciliation-undo.js.map +7 -0
  398. package/dist/modules/warranty_claims/subscribers/vendor-recovery-reconciliation.js +26 -0
  399. package/dist/modules/warranty_claims/subscribers/vendor-recovery-reconciliation.js.map +7 -0
  400. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/config.js +15 -0
  401. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/config.js.map +7 -0
  402. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/widget.client.js +197 -0
  403. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/widget.client.js.map +7 -0
  404. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/widget.js +28 -0
  405. package/dist/modules/warranty_claims/widgets/dashboard/claims-queue/widget.js.map +7 -0
  406. package/dist/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.client.js +418 -0
  407. package/dist/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.client.js.map +7 -0
  408. package/dist/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.js +18 -0
  409. package/dist/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.js.map +7 -0
  410. package/dist/modules/warranty_claims/widgets/injection/customer-claims-tab/widget.js +17 -0
  411. package/dist/modules/warranty_claims/widgets/injection/customer-claims-tab/widget.js.map +7 -0
  412. package/dist/modules/warranty_claims/widgets/injection/customer-claims-tab.js +146 -0
  413. package/dist/modules/warranty_claims/widgets/injection/customer-claims-tab.js.map +7 -0
  414. package/dist/modules/warranty_claims/widgets/injection/order-claims-tab/widget.js +17 -0
  415. package/dist/modules/warranty_claims/widgets/injection/order-claims-tab/widget.js.map +7 -0
  416. package/dist/modules/warranty_claims/widgets/injection/order-claims-tab.js +147 -0
  417. package/dist/modules/warranty_claims/widgets/injection/order-claims-tab.js.map +7 -0
  418. package/dist/modules/warranty_claims/widgets/injection-table.js +38 -0
  419. package/dist/modules/warranty_claims/widgets/injection-table.js.map +7 -0
  420. package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js +223 -0
  421. package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js.map +7 -0
  422. package/dist/modules/warranty_claims/widgets/notifications/index.js +5 -0
  423. package/dist/modules/warranty_claims/widgets/notifications/index.js.map +7 -0
  424. package/dist/modules/warranty_claims/workers/sla-escalation-sweep.js +334 -0
  425. package/dist/modules/warranty_claims/workers/sla-escalation-sweep.js.map +7 -0
  426. package/generated/entities/warranty_claim/index.ts +51 -0
  427. package/generated/entities/warranty_claim_event/index.ts +11 -0
  428. package/generated/entities/warranty_claim_line/index.ts +37 -0
  429. package/generated/entities/warranty_claim_registration/index.ts +20 -0
  430. package/generated/entities/warranty_claim_sequence/index.ts +7 -0
  431. package/generated/entities/warranty_claim_settings/index.ts +20 -0
  432. package/generated/entities/warranty_claim_sla_signal/index.ts +11 -0
  433. package/generated/entities/warranty_troubleshooting_guide/index.ts +11 -0
  434. package/generated/entities/warranty_vendor_policy/index.ts +14 -0
  435. package/generated/entities.ids.generated.ts +12 -0
  436. package/generated/entity-fields-registry.ts +200 -0
  437. package/package.json +7 -7
  438. package/src/helpers/integration/api.ts +10 -3
  439. package/src/helpers/integration/salesFixtures.ts +17 -7
  440. package/src/modules/attachments/di.ts +30 -1
  441. package/src/modules/attachments/fields/attachment.tsx +215 -23
  442. package/src/modules/attachments/i18n/de.json +5 -0
  443. package/src/modules/attachments/i18n/en.json +5 -0
  444. package/src/modules/attachments/i18n/es.json +5 -0
  445. package/src/modules/attachments/i18n/ko.json +5 -0
  446. package/src/modules/attachments/i18n/pl.json +5 -0
  447. package/src/modules/attachments/lib/scoped-upload-service.ts +257 -0
  448. package/src/modules/attachments/lib/target-access-service.ts +57 -0
  449. package/src/modules/auth/api/logout.ts +46 -10
  450. package/src/modules/auth/api/reset/confirm.ts +7 -0
  451. package/src/modules/auth/api/reset.ts +7 -0
  452. package/src/modules/auth/commands/users.ts +22 -0
  453. package/src/modules/auth/events.ts +15 -0
  454. package/src/modules/customers/api/companies/route.ts +1 -0
  455. package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +4 -2
  456. package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +4 -2
  457. package/src/modules/customers/components/detail/assignableStaff.ts +14 -177
  458. package/src/modules/customers/lib/assignableStaff.ts +177 -0
  459. package/src/modules/data_sync/AGENTS.md +3 -0
  460. package/src/modules/data_sync/lib/batch-stream.ts +117 -0
  461. package/src/modules/data_sync/lib/sync-engine.ts +190 -115
  462. package/src/modules/inbox_ops/api/emails/[id]/reprocess/route.ts +4 -0
  463. package/src/modules/inbox_ops/api/extract/route.ts +4 -0
  464. package/src/modules/inbox_ops/api/webhook/inbound.ts +4 -0
  465. package/src/modules/sales/commands/documents.ts +16 -8
  466. package/src/modules/warranty_claims/AGENTS.md +49 -0
  467. package/src/modules/warranty_claims/acl.ts +71 -0
  468. package/src/modules/warranty_claims/ai-agents.ts +189 -0
  469. package/src/modules/warranty_claims/ai-tools.ts +711 -0
  470. package/src/modules/warranty_claims/api/ai/assess/route.ts +371 -0
  471. package/src/modules/warranty_claims/api/ai/draft-reply/route.ts +149 -0
  472. package/src/modules/warranty_claims/api/ai/suggest/route.ts +190 -0
  473. package/src/modules/warranty_claims/api/assign/route.ts +142 -0
  474. package/src/modules/warranty_claims/api/assignees/route.ts +102 -0
  475. package/src/modules/warranty_claims/api/credit-memo/route.ts +191 -0
  476. package/src/modules/warranty_claims/api/entitlement/route.ts +224 -0
  477. package/src/modules/warranty_claims/api/events/route.ts +226 -0
  478. package/src/modules/warranty_claims/api/external/claims/route.ts +528 -0
  479. package/src/modules/warranty_claims/api/lines/route.ts +275 -0
  480. package/src/modules/warranty_claims/api/openapi.ts +28 -0
  481. package/src/modules/warranty_claims/api/portal/attachments/route.ts +547 -0
  482. package/src/modules/warranty_claims/api/portal/claims/[id]/route.ts +195 -0
  483. package/src/modules/warranty_claims/api/portal/claims/[id]/shared.ts +125 -0
  484. package/src/modules/warranty_claims/api/portal/claims/[id]/submit/route.ts +82 -0
  485. package/src/modules/warranty_claims/api/portal/claims/[id]/withdraw/route.ts +87 -0
  486. package/src/modules/warranty_claims/api/portal/claims/route.ts +579 -0
  487. package/src/modules/warranty_claims/api/portal/events/route.ts +260 -0
  488. package/src/modules/warranty_claims/api/portal/options/route.ts +113 -0
  489. package/src/modules/warranty_claims/api/portal/orders/lines/route.ts +258 -0
  490. package/src/modules/warranty_claims/api/portal/orders/route.ts +206 -0
  491. package/src/modules/warranty_claims/api/portal/troubleshooting/route.ts +151 -0
  492. package/src/modules/warranty_claims/api/receiving/route.ts +215 -0
  493. package/src/modules/warranty_claims/api/registrations/route.ts +417 -0
  494. package/src/modules/warranty_claims/api/replacement-order/route.ts +188 -0
  495. package/src/modules/warranty_claims/api/return-label/route.ts +291 -0
  496. package/src/modules/warranty_claims/api/risk/route.ts +112 -0
  497. package/src/modules/warranty_claims/api/route.ts +543 -0
  498. package/src/modules/warranty_claims/api/sales-return/route.ts +183 -0
  499. package/src/modules/warranty_claims/api/settings-general/route.ts +230 -0
  500. package/src/modules/warranty_claims/api/stats/route.ts +306 -0
  501. package/src/modules/warranty_claims/api/submit/route.ts +146 -0
  502. package/src/modules/warranty_claims/api/transition/route.ts +144 -0
  503. package/src/modules/warranty_claims/api/troubleshooting-guides/route.ts +295 -0
  504. package/src/modules/warranty_claims/api/vendor-policies/route.ts +351 -0
  505. package/src/modules/warranty_claims/api/vendor-recovery/route.ts +148 -0
  506. package/src/modules/warranty_claims/api/vendor-recovery-suggestions/route.ts +167 -0
  507. package/src/modules/warranty_claims/backend/components/AiAssessButtons.tsx +389 -0
  508. package/src/modules/warranty_claims/backend/components/ClaimStageProgress.tsx +65 -0
  509. package/src/modules/warranty_claims/backend/components/ClaimStatusBadge.tsx +137 -0
  510. package/src/modules/warranty_claims/backend/components/ClaimsKpiStrip.tsx +169 -0
  511. package/src/modules/warranty_claims/backend/components/EntitlementLookupBadge.tsx +203 -0
  512. package/src/modules/warranty_claims/backend/components/ReceivingPanel.tsx +300 -0
  513. package/src/modules/warranty_claims/backend/components/ReturnLabelPanel.tsx +292 -0
  514. package/src/modules/warranty_claims/backend/components/TroubleshootingWalker.tsx +125 -0
  515. package/src/modules/warranty_claims/backend/components/VendorRecoverySuggestionsPanel.tsx +217 -0
  516. package/src/modules/warranty_claims/backend/components/WarrantyWorkspace.tsx +66 -0
  517. package/src/modules/warranty_claims/backend/components/claimReasonOptions.ts +57 -0
  518. package/src/modules/warranty_claims/backend/components/claimSla.tsx +127 -0
  519. package/src/modules/warranty_claims/backend/components/orderLookup.ts +109 -0
  520. package/src/modules/warranty_claims/backend/components/productLookup.tsx +433 -0
  521. package/src/modules/warranty_claims/backend/components/useUserDisplayNames.ts +66 -0
  522. package/src/modules/warranty_claims/backend/page.meta.ts +12 -0
  523. package/src/modules/warranty_claims/backend/page.tsx +1302 -0
  524. package/src/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.meta.ts +12 -0
  525. package/src/modules/warranty_claims/backend/warranty_claims/[id]/edit/page.tsx +531 -0
  526. package/src/modules/warranty_claims/backend/warranty_claims/[id]/page.meta.ts +12 -0
  527. package/src/modules/warranty_claims/backend/warranty_claims/[id]/page.tsx +2599 -0
  528. package/src/modules/warranty_claims/backend/warranty_claims/create/page.meta.ts +12 -0
  529. package/src/modules/warranty_claims/backend/warranty_claims/create/page.tsx +1533 -0
  530. package/src/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.meta.ts +13 -0
  531. package/src/modules/warranty_claims/backend/warranty_claims/registrations/[id]/edit/page.tsx +136 -0
  532. package/src/modules/warranty_claims/backend/warranty_claims/registrations/create/page.meta.ts +13 -0
  533. package/src/modules/warranty_claims/backend/warranty_claims/registrations/create/page.tsx +52 -0
  534. package/src/modules/warranty_claims/backend/warranty_claims/registrations/page.meta.ts +15 -0
  535. package/src/modules/warranty_claims/backend/warranty_claims/registrations/page.tsx +555 -0
  536. package/src/modules/warranty_claims/backend/warranty_claims/registrations/registrationForm.tsx +295 -0
  537. package/src/modules/warranty_claims/backend/warranty_claims/settings/page.meta.ts +15 -0
  538. package/src/modules/warranty_claims/backend/warranty_claims/settings/page.tsx +1903 -0
  539. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/TroubleshootingTreeBuilder.tsx +550 -0
  540. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.meta.ts +15 -0
  541. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/[id]/edit/page.tsx +141 -0
  542. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.meta.ts +15 -0
  543. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/create/page.tsx +57 -0
  544. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.meta.ts +17 -0
  545. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.tsx +477 -0
  546. package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/troubleshootingGuideForm.tsx +214 -0
  547. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.meta.ts +15 -0
  548. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/[id]/edit/page.tsx +137 -0
  549. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.meta.ts +15 -0
  550. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/create/page.tsx +51 -0
  551. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.meta.ts +17 -0
  552. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.tsx +506 -0
  553. package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/vendorPolicyForm.tsx +220 -0
  554. package/src/modules/warranty_claims/ce.ts +44 -0
  555. package/src/modules/warranty_claims/commands/claim-lines.ts +1082 -0
  556. package/src/modules/warranty_claims/commands/claims.ts +3364 -0
  557. package/src/modules/warranty_claims/commands/index.ts +3 -0
  558. package/src/modules/warranty_claims/commands/settings.ts +198 -0
  559. package/src/modules/warranty_claims/commands/shared.ts +212 -0
  560. package/src/modules/warranty_claims/data/constants.ts +37 -0
  561. package/src/modules/warranty_claims/data/enrichers.ts +165 -0
  562. package/src/modules/warranty_claims/data/entities.ts +663 -0
  563. package/src/modules/warranty_claims/data/validators.ts +634 -0
  564. package/src/modules/warranty_claims/di.ts +34 -0
  565. package/src/modules/warranty_claims/encryption.ts +26 -0
  566. package/src/modules/warranty_claims/events.ts +81 -0
  567. package/src/modules/warranty_claims/extension-points.ts +16 -0
  568. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.meta.ts +9 -0
  569. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.tsx +1037 -0
  570. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.meta.ts +9 -0
  571. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.tsx +1409 -0
  572. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.meta.ts +16 -0
  573. package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.tsx +304 -0
  574. package/src/modules/warranty_claims/i18n/de.json +1270 -0
  575. package/src/modules/warranty_claims/i18n/en.json +1270 -0
  576. package/src/modules/warranty_claims/i18n/es.json +1270 -0
  577. package/src/modules/warranty_claims/i18n/ko.json +1270 -0
  578. package/src/modules/warranty_claims/i18n/pl.json +1270 -0
  579. package/src/modules/warranty_claims/index.ts +13 -0
  580. package/src/modules/warranty_claims/lib/aiAssist.ts +677 -0
  581. package/src/modules/warranty_claims/lib/apiIdsFilter.ts +12 -0
  582. package/src/modules/warranty_claims/lib/assigneeNames.ts +184 -0
  583. package/src/modules/warranty_claims/lib/attachmentVisibility.ts +5 -0
  584. package/src/modules/warranty_claims/lib/bulkFeedback.ts +6 -0
  585. package/src/modules/warranty_claims/lib/businessHours.ts +333 -0
  586. package/src/modules/warranty_claims/lib/businessHoursForm.ts +206 -0
  587. package/src/modules/warranty_claims/lib/claimTypeConfig.ts +49 -0
  588. package/src/modules/warranty_claims/lib/decryptionSafety.ts +19 -0
  589. package/src/modules/warranty_claims/lib/deskFilters.ts +131 -0
  590. package/src/modules/warranty_claims/lib/dictionaries.ts +212 -0
  591. package/src/modules/warranty_claims/lib/dictionaryLabels.ts +16 -0
  592. package/src/modules/warranty_claims/lib/emailIntake.ts +123 -0
  593. package/src/modules/warranty_claims/lib/escalation.ts +83 -0
  594. package/src/modules/warranty_claims/lib/externalIntake.ts +362 -0
  595. package/src/modules/warranty_claims/lib/grading.ts +23 -0
  596. package/src/modules/warranty_claims/lib/listSegments.ts +19 -0
  597. package/src/modules/warranty_claims/lib/orderOwnership.ts +58 -0
  598. package/src/modules/warranty_claims/lib/portalAttachmentUpload.ts +11 -0
  599. package/src/modules/warranty_claims/lib/portalAttachmentValidation.ts +115 -0
  600. package/src/modules/warranty_claims/lib/portalClaimAccess.ts +37 -0
  601. package/src/modules/warranty_claims/lib/quantity.ts +15 -0
  602. package/src/modules/warranty_claims/lib/risk.ts +371 -0
  603. package/src/modules/warranty_claims/lib/settings.ts +76 -0
  604. package/src/modules/warranty_claims/lib/stateMachine.ts +130 -0
  605. package/src/modules/warranty_claims/lib/timelineFilters.ts +22 -0
  606. package/src/modules/warranty_claims/lib/triage.ts +366 -0
  607. package/src/modules/warranty_claims/lib/troubleshooting.ts +157 -0
  608. package/src/modules/warranty_claims/lib/tryResolve.ts +7 -0
  609. package/src/modules/warranty_claims/lib/vendorPolicyRecovery.ts +182 -0
  610. package/src/modules/warranty_claims/lib/warrantyPreview.ts +20 -0
  611. package/src/modules/warranty_claims/migrations/.snapshot-open-mercato.json +3525 -0
  612. package/src/modules/warranty_claims/migrations/Migration20260703191537_warranty_claims.ts +38 -0
  613. package/src/modules/warranty_claims/migrations/Migration20260704115605_warranty_claims.ts +17 -0
  614. package/src/modules/warranty_claims/migrations/Migration20260704230000_warranty_claims.ts +17 -0
  615. package/src/modules/warranty_claims/migrations/Migration20260705121601_warranty_claims.ts +37 -0
  616. package/src/modules/warranty_claims/migrations/Migration20260709120000_warranty_claims.ts +25 -0
  617. package/src/modules/warranty_claims/migrations/Migration20260710023607_warranty_claims.ts +13 -0
  618. package/src/modules/warranty_claims/migrations/Migration20260716203936_warranty_claims.ts +15 -0
  619. package/src/modules/warranty_claims/migrations/Migration20260717150000_warranty_claims.ts +13 -0
  620. package/src/modules/warranty_claims/migrations/Migration20260719120000_warranty_claims.ts +13 -0
  621. package/src/modules/warranty_claims/migrations/Migration20260813103053_warranty_claims.ts +11 -0
  622. package/src/modules/warranty_claims/notifications.client.ts +78 -0
  623. package/src/modules/warranty_claims/notifications.ts +101 -0
  624. package/src/modules/warranty_claims/search.ts +199 -0
  625. package/src/modules/warranty_claims/services/adjudicationEvaluator.ts +344 -0
  626. package/src/modules/warranty_claims/services/claimNumberGenerator.ts +69 -0
  627. package/src/modules/warranty_claims/services/entitlementResolver.ts +102 -0
  628. package/src/modules/warranty_claims/services/returnLabelProvider.ts +30 -0
  629. package/src/modules/warranty_claims/setup.ts +154 -0
  630. package/src/modules/warranty_claims/subscribers/auto-vendor-recovery.ts +140 -0
  631. package/src/modules/warranty_claims/subscribers/claim-assigned-notification.ts +54 -0
  632. package/src/modules/warranty_claims/subscribers/claim-customer-reply-notification.ts +68 -0
  633. package/src/modules/warranty_claims/subscribers/claim-status-notification.ts +100 -0
  634. package/src/modules/warranty_claims/subscribers/claim-submitted-notification.ts +53 -0
  635. package/src/modules/warranty_claims/subscribers/email-to-claim.ts +175 -0
  636. package/src/modules/warranty_claims/subscribers/return-shipment-tracking.ts +226 -0
  637. package/src/modules/warranty_claims/subscribers/vendor-recovery-reconciliation-undo.ts +28 -0
  638. package/src/modules/warranty_claims/subscribers/vendor-recovery-reconciliation.ts +31 -0
  639. package/src/modules/warranty_claims/widgets/dashboard/claims-queue/config.ts +15 -0
  640. package/src/modules/warranty_claims/widgets/dashboard/claims-queue/widget.client.tsx +237 -0
  641. package/src/modules/warranty_claims/widgets/dashboard/claims-queue/widget.ts +27 -0
  642. package/src/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.client.tsx +527 -0
  643. package/src/modules/warranty_claims/widgets/injection/claims-ai-trigger/widget.ts +37 -0
  644. package/src/modules/warranty_claims/widgets/injection/customer-claims-tab/widget.ts +21 -0
  645. package/src/modules/warranty_claims/widgets/injection/customer-claims-tab.tsx +210 -0
  646. package/src/modules/warranty_claims/widgets/injection/order-claims-tab/widget.ts +21 -0
  647. package/src/modules/warranty_claims/widgets/injection/order-claims-tab.tsx +210 -0
  648. package/src/modules/warranty_claims/widgets/injection-table.ts +36 -0
  649. package/src/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.tsx +253 -0
  650. package/src/modules/warranty_claims/widgets/notifications/index.ts +1 -0
  651. package/src/modules/warranty_claims/workers/sla-escalation-sweep.ts +450 -0
@@ -0,0 +1,663 @@
1
+ import { Collection, OptionalProps } from '@mikro-orm/core'
2
+ import {
3
+ Entity,
4
+ Index,
5
+ ManyToOne,
6
+ OneToMany,
7
+ PrimaryKey,
8
+ Property,
9
+ Unique,
10
+ } from '@mikro-orm/decorators/legacy'
11
+ import type {
12
+ WarrantyClaimChannel,
13
+ WarrantyClaimDisposition,
14
+ WarrantyClaimEventKind,
15
+ WarrantyClaimEventVisibility,
16
+ WarrantyClaimLineStatus,
17
+ WarrantyClaimPriority,
18
+ WarrantyClaimRegistrationCoverageType,
19
+ WarrantyClaimRegistrationSource,
20
+ WarrantyClaimStatus,
21
+ WarrantyClaimType,
22
+ WarrantyClaimWarrantyStatus,
23
+ } from './validators'
24
+ import { DEFAULT_SLA_HOURS } from './constants'
25
+
26
+ @Entity({ tableName: 'warranty_claims' })
27
+ @Index({ name: 'warranty_claims_customer_idx', properties: ['customerId', 'organizationId', 'tenantId'] })
28
+ @Index({ name: 'warranty_claims_order_idx', properties: ['orderId', 'organizationId', 'tenantId'] })
29
+ @Index({ name: 'warranty_claims_status_idx', properties: ['organizationId', 'tenantId', 'status'] })
30
+ @Index({
31
+ name: 'warranty_claims_external_ref_unique',
32
+ expression:
33
+ 'create unique index "warranty_claims_external_ref_unique" on "warranty_claims" ("tenant_id", "organization_id", "external_ref") where "external_ref" is not null and "deleted_at" is null',
34
+ })
35
+ @Index({
36
+ name: 'warranty_claims_intake_message_ref_unique',
37
+ expression:
38
+ 'create unique index "warranty_claims_intake_message_ref_unique" on "warranty_claims" ("tenant_id", "organization_id", "intake_message_ref") where "intake_message_ref" is not null and "deleted_at" is null',
39
+ })
40
+ @Index({
41
+ name: 'warranty_claims_return_tracking_idx',
42
+ expression:
43
+ 'create index "warranty_claims_return_tracking_idx" on "warranty_claims" ("tenant_id", "organization_id", "return_tracking_number") where "return_tracking_number" is not null and "deleted_at" is null',
44
+ })
45
+ @Unique({
46
+ name: 'warranty_claims_number_unique',
47
+ properties: ['tenantId', 'organizationId', 'claimNumber'],
48
+ })
49
+ export class WarrantyClaim {
50
+ [OptionalProps]?: 'createdAt' | 'updatedAt' | 'escalationLevel' | 'awaitingStaffReply'
51
+
52
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
53
+ id!: string
54
+
55
+ @Property({ name: 'organization_id', type: 'uuid' })
56
+ organizationId!: string
57
+
58
+ @Property({ name: 'tenant_id', type: 'uuid' })
59
+ tenantId!: string
60
+
61
+ @Property({ name: 'claim_number', type: 'text' })
62
+ claimNumber!: string
63
+
64
+ @Property({ name: 'claim_type', type: 'text' })
65
+ claimType!: WarrantyClaimType
66
+
67
+ @Property({ name: 'status', type: 'text', default: 'draft' })
68
+ status: WarrantyClaimStatus = 'draft'
69
+
70
+ @Property({ name: 'channel', type: 'text', default: 'staff' })
71
+ channel: WarrantyClaimChannel = 'staff'
72
+
73
+ @Property({ name: 'priority', type: 'text', default: 'normal' })
74
+ priority: WarrantyClaimPriority = 'normal'
75
+
76
+ @Property({ name: 'customer_id', type: 'uuid', nullable: true })
77
+ customerId?: string | null
78
+
79
+ @Property({ name: 'customer_name', type: 'text', nullable: true })
80
+ customerName?: string | null
81
+
82
+ @Property({ name: 'external_ref', type: 'text', nullable: true })
83
+ externalRef?: string | null
84
+
85
+ @Property({ name: 'contact_email', type: 'text', nullable: true })
86
+ contactEmail?: string | null
87
+
88
+ @Property({ name: 'return_label_url', type: 'text', nullable: true })
89
+ returnLabelUrl?: string | null
90
+
91
+ @Property({ name: 'return_tracking_number', type: 'text', nullable: true })
92
+ returnTrackingNumber?: string | null
93
+
94
+ @Property({ name: 'return_carrier', type: 'text', nullable: true })
95
+ returnCarrier?: string | null
96
+
97
+ @Property({ name: 'escalation_level', type: 'int', default: 0 })
98
+ escalationLevel: number = 0
99
+
100
+ @Property({ name: 'escalated_at', type: Date, nullable: true })
101
+ escalatedAt?: Date | null
102
+
103
+ @Property({ name: 'intake_message_ref', type: 'text', nullable: true })
104
+ intakeMessageRef?: string | null
105
+
106
+ @Property({ name: 'entitlement_source', type: 'text', nullable: true })
107
+ entitlementSource?: string | null
108
+
109
+ @Property({ name: 'vendor_name', type: 'text', nullable: true })
110
+ vendorName?: string | null
111
+
112
+ @Property({ name: 'vendor_ref', type: 'text', nullable: true })
113
+ vendorRef?: string | null
114
+
115
+ @Property({ name: 'order_id', type: 'uuid', nullable: true })
116
+ orderId?: string | null
117
+
118
+ @Property({ name: 'order_number', type: 'text', nullable: true })
119
+ orderNumber?: string | null
120
+
121
+ @Property({ name: 'awaiting_staff_reply', type: 'boolean', default: false })
122
+ awaitingStaffReply: boolean = false
123
+
124
+ @Property({ name: 'sales_return_id', type: 'uuid', nullable: true })
125
+ salesReturnId?: string | null
126
+
127
+ @Property({ name: 'replacement_order_id', type: 'uuid', nullable: true })
128
+ replacementOrderId?: string | null
129
+
130
+ @Property({ name: 'credit_memo_id', type: 'uuid', nullable: true })
131
+ creditMemoId?: string | null
132
+
133
+ @Property({ name: 'source_claim_id', type: 'uuid', nullable: true })
134
+ sourceClaimId?: string | null
135
+
136
+ @Property({ name: 'advance_replacement', type: 'boolean', default: false })
137
+ advanceReplacement: boolean = false
138
+
139
+ @Property({ name: 'advance_shipped_at', type: Date, nullable: true })
140
+ advanceShippedAt?: Date | null
141
+
142
+ @Property({ name: 'reason_code', type: 'text', nullable: true })
143
+ reasonCode?: string | null
144
+
145
+ @Property({ name: 'rejection_reason_code', type: 'text', nullable: true })
146
+ rejectionReasonCode?: string | null
147
+
148
+ @Property({ name: 'resolution_summary', type: 'text', nullable: true })
149
+ resolutionSummary?: string | null
150
+
151
+ @Property({ name: 'notes', type: 'text', nullable: true })
152
+ notes?: string | null
153
+
154
+ @Property({ name: 'currency_code', type: 'text', nullable: true })
155
+ currencyCode?: string | null
156
+
157
+ @Property({ name: 'total_claimed_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
158
+ totalClaimedAmount?: string | null
159
+
160
+ @Property({ name: 'total_approved_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
161
+ totalApprovedAmount?: string | null
162
+
163
+ @Property({ name: 'total_recovered_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
164
+ totalRecoveredAmount?: string | null
165
+
166
+ @Property({ name: 'sla_due_at', type: Date, nullable: true })
167
+ slaDueAt?: Date | null
168
+
169
+ @Property({ name: 'sla_paused_at', type: Date, nullable: true })
170
+ slaPausedAt?: Date | null
171
+
172
+ @Property({ name: 'sla_at_risk_notified_at', type: Date, nullable: true })
173
+ slaAtRiskNotifiedAt?: Date | null
174
+
175
+ @Property({ name: 'sla_breached_notified_at', type: Date, nullable: true })
176
+ slaBreachedNotifiedAt?: Date | null
177
+
178
+ @Property({ name: 'submitted_at', type: Date, nullable: true })
179
+ submittedAt?: Date | null
180
+
181
+ @Property({ name: 'resolved_at', type: Date, nullable: true })
182
+ resolvedAt?: Date | null
183
+
184
+ @Property({ name: 'closed_at', type: Date, nullable: true })
185
+ closedAt?: Date | null
186
+
187
+ @Property({ name: 'assignee_user_id', type: 'uuid', nullable: true })
188
+ assigneeUserId?: string | null
189
+
190
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
191
+ createdAt: Date = new Date()
192
+
193
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
194
+ updatedAt: Date = new Date()
195
+
196
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
197
+ deletedAt?: Date | null
198
+
199
+ @OneToMany(() => WarrantyClaimLine, (line) => line.claim)
200
+ lines = new Collection<WarrantyClaimLine>(this)
201
+
202
+ @OneToMany(() => WarrantyClaimEvent, (event) => event.claim)
203
+ events = new Collection<WarrantyClaimEvent>(this)
204
+ }
205
+
206
+ @Entity({ tableName: 'warranty_claim_settings' })
207
+ @Unique({ name: 'warranty_claim_settings_scope_unique', properties: ['organizationId', 'tenantId'] })
208
+ export class WarrantyClaimSettings {
209
+ [OptionalProps]?: 'createdAt' | 'updatedAt' | 'adjudicationUseRules'
210
+
211
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
212
+ id!: string
213
+
214
+ @Property({ name: 'organization_id', type: 'uuid' })
215
+ organizationId!: string
216
+
217
+ @Property({ name: 'tenant_id', type: 'uuid' })
218
+ tenantId!: string
219
+
220
+ @Property({ name: 'sla_hours', type: 'int', default: DEFAULT_SLA_HOURS })
221
+ slaHours: number = DEFAULT_SLA_HOURS
222
+
223
+ @Property({ name: 'sla_pause_on_info_requested', type: 'boolean', default: true })
224
+ slaPauseOnInfoRequested: boolean = true
225
+
226
+ @Property({ name: 'sla_at_risk_threshold_pct', type: 'int', default: 75 })
227
+ slaAtRiskThresholdPct: number = 75
228
+
229
+ @Property({ name: 'auto_approve_enabled', type: 'boolean', default: false })
230
+ autoApproveEnabled: boolean = false
231
+
232
+ @Property({ name: 'auto_approve_max_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
233
+ autoApproveMaxAmount?: string | null
234
+
235
+ @Property({ name: 'auto_approve_currency_code', type: 'text', nullable: true })
236
+ autoApproveCurrencyCode?: string | null
237
+
238
+ @Property({ name: 'auto_approve_require_in_warranty', type: 'boolean', default: true })
239
+ autoApproveRequireInWarranty: boolean = true
240
+
241
+ @Property({ name: 'default_warranty_months', type: 'int', nullable: true })
242
+ defaultWarrantyMonths?: number | null
243
+
244
+ @Property({ name: 'business_hours', type: 'jsonb', nullable: true })
245
+ businessHours?: Record<string, unknown> | null
246
+
247
+ @Property({ name: 'escalation_tiers', type: 'jsonb', nullable: true })
248
+ escalationTiers?: Record<string, unknown>[] | null
249
+
250
+ @Property({ name: 'adjudication_use_rules', type: 'boolean', default: false })
251
+ adjudicationUseRules: boolean = false
252
+
253
+ @Property({ name: 'quarantine_grades', type: 'jsonb', nullable: true })
254
+ quarantineGrades?: string[] | null
255
+
256
+ @Property({ name: 'return_label_provider', type: 'text', nullable: true })
257
+ returnLabelProvider?: string | null
258
+
259
+ @Property({ name: 'return_window_days', type: 'int', nullable: true })
260
+ returnWindowDays?: number | null
261
+
262
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
263
+ createdAt: Date = new Date()
264
+
265
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
266
+ updatedAt: Date = new Date()
267
+
268
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
269
+ deletedAt?: Date | null
270
+ }
271
+
272
+ @Entity({ tableName: 'warranty_claim_lines' })
273
+ @Index({ name: 'warranty_claim_lines_claim_idx', properties: ['claim', 'organizationId', 'tenantId'] })
274
+ @Index({ name: 'warranty_claim_lines_order_line_idx', properties: ['orderLineId', 'organizationId', 'tenantId'] })
275
+ @Index({ name: 'warranty_claim_lines_product_idx', properties: ['productId', 'organizationId', 'tenantId'] })
276
+ @Index({ name: 'warranty_claim_lines_serial_idx', properties: ['tenantId', 'organizationId', 'serialNumber'] })
277
+ export class WarrantyClaimLine {
278
+ [OptionalProps]?: 'createdAt' | 'updatedAt' | 'quarantineStatus'
279
+
280
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
281
+ id!: string
282
+
283
+ @ManyToOne(() => WarrantyClaim, { fieldName: 'claim_id' })
284
+ claim!: WarrantyClaim
285
+
286
+ @Property({ name: 'organization_id', type: 'uuid' })
287
+ organizationId!: string
288
+
289
+ @Property({ name: 'tenant_id', type: 'uuid' })
290
+ tenantId!: string
291
+
292
+ @Property({ name: 'line_no', type: 'int' })
293
+ lineNo!: number
294
+
295
+ @Property({ name: 'product_id', type: 'uuid', nullable: true })
296
+ productId?: string | null
297
+
298
+ @Property({ name: 'variant_id', type: 'uuid', nullable: true })
299
+ variantId?: string | null
300
+
301
+ @Property({ name: 'sku', type: 'text', nullable: true })
302
+ sku?: string | null
303
+
304
+ @Property({ name: 'product_name', type: 'text', nullable: true })
305
+ productName?: string | null
306
+
307
+ @Property({ name: 'order_line_id', type: 'uuid', nullable: true })
308
+ orderLineId?: string | null
309
+
310
+ @Property({ name: 'serial_number', type: 'text', nullable: true })
311
+ serialNumber?: string | null
312
+
313
+ @Property({ name: 'lot_number', type: 'text', nullable: true })
314
+ lotNumber?: string | null
315
+
316
+ @Property({ name: 'purchase_date', type: Date, nullable: true })
317
+ purchaseDate?: Date | null
318
+
319
+ @Property({ name: 'warranty_months', type: 'int', nullable: true })
320
+ warrantyMonths?: number | null
321
+
322
+ @Property({ name: 'warranty_expires_at', type: Date, nullable: true })
323
+ warrantyExpiresAt?: Date | null
324
+
325
+ @Property({ name: 'warranty_status', type: 'text', default: 'unknown' })
326
+ warrantyStatus: WarrantyClaimWarrantyStatus = 'unknown'
327
+
328
+ @Property({ name: 'fault_code', type: 'text', nullable: true })
329
+ faultCode?: string | null
330
+
331
+ @Property({ name: 'fault_description', type: 'text', nullable: true })
332
+ faultDescription?: string | null
333
+
334
+ @Property({ name: 'qty_claimed', type: 'numeric', precision: 18, scale: 4, default: '1' })
335
+ qtyClaimed: string = '1'
336
+
337
+ @Property({ name: 'qty_approved', type: 'numeric', precision: 18, scale: 4, nullable: true })
338
+ qtyApproved?: string | null
339
+
340
+ @Property({ name: 'qty_received', type: 'numeric', precision: 18, scale: 4, nullable: true })
341
+ qtyReceived?: string | null
342
+
343
+ @Property({ name: 'condition_on_receipt', type: 'text', nullable: true })
344
+ conditionOnReceipt?: string | null
345
+
346
+ @Property({ name: 'condition_grade', type: 'text', nullable: true })
347
+ conditionGrade?: string | null
348
+
349
+ @Property({ name: 'quarantine_status', type: 'text', default: 'none' })
350
+ quarantineStatus: string = 'none'
351
+
352
+ @Property({ name: 'inspection_notes', type: 'text', nullable: true })
353
+ inspectionNotes?: string | null
354
+
355
+ @Property({ name: 'assessment_payload', type: 'jsonb', nullable: true })
356
+ assessmentPayload?: Record<string, unknown> | null
357
+
358
+ @Property({ name: 'disposition', type: 'text', nullable: true })
359
+ disposition?: WarrantyClaimDisposition | null
360
+
361
+ @Property({ name: 'line_status', type: 'text', default: 'pending' })
362
+ lineStatus: WarrantyClaimLineStatus = 'pending'
363
+
364
+ @Property({ name: 'credit_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
365
+ creditAmount?: string | null
366
+
367
+ @Property({ name: 'restocking_fee', type: 'numeric', precision: 18, scale: 4, nullable: true })
368
+ restockingFee?: string | null
369
+
370
+ @Property({ name: 'core_charge_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
371
+ coreChargeAmount?: string | null
372
+
373
+ @Property({ name: 'core_credit_amount', type: 'numeric', precision: 18, scale: 4, nullable: true })
374
+ coreCreditAmount?: string | null
375
+
376
+ @Property({ name: 'vendor_claim_line_id', type: 'uuid', nullable: true })
377
+ vendorClaimLineId?: string | null
378
+
379
+ @Property({ name: 'vendor_name', type: 'text', nullable: true })
380
+ vendorName?: string | null
381
+
382
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
383
+ createdAt: Date = new Date()
384
+
385
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
386
+ updatedAt: Date = new Date()
387
+
388
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
389
+ deletedAt?: Date | null
390
+ }
391
+
392
+ @Entity({ tableName: 'warranty_claim_registrations' })
393
+ @Index({ name: 'warranty_claim_registrations_serial_idx', properties: ['tenantId', 'organizationId', 'serialNumber'] })
394
+ @Index({ name: 'warranty_claim_registrations_customer_idx', properties: ['tenantId', 'organizationId', 'customerId'] })
395
+ export class WarrantyClaimRegistration {
396
+ [OptionalProps]?: 'createdAt' | 'updatedAt'
397
+
398
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
399
+ id!: string
400
+
401
+ @Property({ name: 'organization_id', type: 'uuid' })
402
+ organizationId!: string
403
+
404
+ @Property({ name: 'tenant_id', type: 'uuid' })
405
+ tenantId!: string
406
+
407
+ @Property({ name: 'serial_number', type: 'text', nullable: true })
408
+ serialNumber?: string | null
409
+
410
+ @Property({ name: 'product_id', type: 'uuid', nullable: true })
411
+ productId?: string | null
412
+
413
+ @Property({ name: 'variant_id', type: 'uuid', nullable: true })
414
+ variantId?: string | null
415
+
416
+ @Property({ name: 'sku', type: 'text', nullable: true })
417
+ sku?: string | null
418
+
419
+ @Property({ name: 'product_name', type: 'text', nullable: true })
420
+ productName?: string | null
421
+
422
+ @Property({ name: 'customer_id', type: 'uuid', nullable: true })
423
+ customerId?: string | null
424
+
425
+ @Property({ name: 'order_id', type: 'uuid', nullable: true })
426
+ orderId?: string | null
427
+
428
+ @Property({ name: 'purchase_date', type: Date, nullable: true })
429
+ purchaseDate?: Date | null
430
+
431
+ @Property({ name: 'warranty_months', type: 'int', nullable: true })
432
+ warrantyMonths?: number | null
433
+
434
+ @Property({ name: 'warranty_expires_at', type: Date, nullable: true })
435
+ warrantyExpiresAt?: Date | null
436
+
437
+ @Property({ name: 'coverage_type', type: 'text', nullable: true })
438
+ coverageType?: WarrantyClaimRegistrationCoverageType | null
439
+
440
+ @Property({ name: 'source', type: 'text', nullable: true })
441
+ source?: WarrantyClaimRegistrationSource | null
442
+
443
+ @Property({ name: 'proof_attachment_id', type: 'uuid', nullable: true })
444
+ proofAttachmentId?: string | null
445
+
446
+ @Property({ name: 'notes', type: 'text', nullable: true })
447
+ notes?: string | null
448
+
449
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
450
+ createdAt: Date = new Date()
451
+
452
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
453
+ updatedAt: Date = new Date()
454
+
455
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
456
+ deletedAt?: Date | null
457
+ }
458
+
459
+ @Entity({ tableName: 'warranty_claim_vendor_policies' })
460
+ @Index({ name: 'warranty_claim_vendor_policies_vendor_idx', properties: ['tenantId', 'organizationId', 'vendorName'] })
461
+ export class WarrantyVendorPolicy {
462
+ [OptionalProps]?: 'createdAt' | 'updatedAt' | 'autoGenerateRecovery' | 'isActive'
463
+
464
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
465
+ id!: string
466
+
467
+ @Property({ name: 'organization_id', type: 'uuid' })
468
+ organizationId!: string
469
+
470
+ @Property({ name: 'tenant_id', type: 'uuid' })
471
+ tenantId!: string
472
+
473
+ @Property({ name: 'vendor_name', type: 'text' })
474
+ vendorName!: string
475
+
476
+ @Property({ name: 'vendor_ref', type: 'text', nullable: true })
477
+ vendorRef?: string | null
478
+
479
+ @Property({ name: 'coverage_months', type: 'int', nullable: true })
480
+ coverageMonths?: number | null
481
+
482
+ @Property({ name: 'claimable_reason_codes', type: 'jsonb', nullable: true })
483
+ claimableReasonCodes?: string[] | null
484
+
485
+ @Property({ name: 'recovery_rate_pct', type: 'numeric', precision: 5, scale: 2, nullable: true })
486
+ recoveryRatePct?: string | null
487
+
488
+ @Property({ name: 'contact_email', type: 'text', nullable: true })
489
+ contactEmail?: string | null
490
+
491
+ @Property({ name: 'auto_generate_recovery', type: 'boolean', default: false })
492
+ autoGenerateRecovery: boolean = false
493
+
494
+ @Property({ name: 'is_active', type: 'boolean', default: true })
495
+ isActive: boolean = true
496
+
497
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
498
+ createdAt: Date = new Date()
499
+
500
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
501
+ updatedAt: Date = new Date()
502
+
503
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
504
+ deletedAt?: Date | null
505
+ }
506
+
507
+ @Entity({ tableName: 'warranty_claim_troubleshooting_guides' })
508
+ @Index({ name: 'warranty_claim_troubleshooting_guides_lookup_idx', properties: ['tenantId', 'organizationId', 'claimType', 'reasonCode'] })
509
+ export class WarrantyTroubleshootingGuide {
510
+ [OptionalProps]?: 'createdAt' | 'updatedAt' | 'isActive'
511
+
512
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
513
+ id!: string
514
+
515
+ @Property({ name: 'organization_id', type: 'uuid' })
516
+ organizationId!: string
517
+
518
+ @Property({ name: 'tenant_id', type: 'uuid' })
519
+ tenantId!: string
520
+
521
+ @Property({ name: 'claim_type', type: 'text', nullable: true })
522
+ claimType?: WarrantyClaimType | null
523
+
524
+ @Property({ name: 'reason_code', type: 'text', nullable: true })
525
+ reasonCode?: string | null
526
+
527
+ @Property({ name: 'title', type: 'text' })
528
+ title!: string
529
+
530
+ @Property({ name: 'steps', type: 'jsonb', nullable: true })
531
+ steps?: Record<string, unknown> | null
532
+
533
+ @Property({ name: 'is_active', type: 'boolean', default: true })
534
+ isActive: boolean = true
535
+
536
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
537
+ createdAt: Date = new Date()
538
+
539
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
540
+ updatedAt: Date = new Date()
541
+
542
+ @Property({ name: 'deleted_at', type: Date, nullable: true })
543
+ deletedAt?: Date | null
544
+ }
545
+
546
+ @Entity({ tableName: 'warranty_claim_events' })
547
+ @Index({ name: 'warranty_claim_events_claim_created_idx', properties: ['claim', 'createdAt'] })
548
+ export class WarrantyClaimEvent {
549
+ [OptionalProps]?: 'createdAt'
550
+
551
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
552
+ id!: string
553
+
554
+ @ManyToOne(() => WarrantyClaim, { fieldName: 'claim_id' })
555
+ claim!: WarrantyClaim
556
+
557
+ @Property({ name: 'organization_id', type: 'uuid' })
558
+ organizationId!: string
559
+
560
+ @Property({ name: 'tenant_id', type: 'uuid' })
561
+ tenantId!: string
562
+
563
+ @Property({ name: 'kind', type: 'text' })
564
+ kind!: WarrantyClaimEventKind
565
+
566
+ @Property({ name: 'visibility', type: 'text', default: 'internal' })
567
+ visibility: WarrantyClaimEventVisibility = 'internal'
568
+
569
+ @Property({ name: 'body', type: 'text', nullable: true })
570
+ body?: string | null
571
+
572
+ @Property({ name: 'payload', type: 'jsonb', nullable: true })
573
+ payload?: Record<string, unknown> | null
574
+
575
+ @Property({ name: 'actor_user_id', type: 'uuid', nullable: true })
576
+ actorUserId?: string | null
577
+
578
+ @Property({ name: 'actor_customer_id', type: 'uuid', nullable: true })
579
+ actorCustomerId?: string | null
580
+
581
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
582
+ createdAt: Date = new Date()
583
+ }
584
+
585
+ export type WarrantyClaimSlaSignalEventId =
586
+ | 'warranty_claims.claim.sla_at_risk'
587
+ | 'warranty_claims.claim.sla_breached'
588
+
589
+ @Entity({ tableName: 'warranty_claim_sla_signals' })
590
+ @Index({
591
+ name: 'warranty_claim_sla_signals_pending_scope_idx',
592
+ properties: ['tenantId', 'organizationId', 'publishedAt', 'createdAt'],
593
+ })
594
+ @Unique({
595
+ name: 'warranty_claim_sla_signals_claim_event_cycle_unique',
596
+ properties: ['tenantId', 'organizationId', 'claimId', 'eventId', 'cycleKey'],
597
+ })
598
+ export class WarrantyClaimSlaSignal {
599
+ [OptionalProps]?: 'createdAt'
600
+
601
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
602
+ id!: string
603
+
604
+ @Property({ name: 'organization_id', type: 'uuid' })
605
+ organizationId!: string
606
+
607
+ @Property({ name: 'tenant_id', type: 'uuid' })
608
+ tenantId!: string
609
+
610
+ @Property({ name: 'claim_id', type: 'uuid' })
611
+ claimId!: string
612
+
613
+ @Property({ name: 'event_id', type: 'text' })
614
+ eventId!: WarrantyClaimSlaSignalEventId
615
+
616
+ @Property({ name: 'cycle_key', type: 'text' })
617
+ cycleKey!: string
618
+
619
+ @Property({ name: 'payload', type: 'jsonb' })
620
+ payload!: Record<string, unknown>
621
+
622
+ @Property({ name: 'lease_token', type: 'uuid', nullable: true })
623
+ leaseToken?: string | null
624
+
625
+ @Property({ name: 'lease_expires_at', type: Date, nullable: true })
626
+ leaseExpiresAt?: Date | null
627
+
628
+ @Property({ name: 'published_at', type: Date, nullable: true })
629
+ publishedAt?: Date | null
630
+
631
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
632
+ createdAt: Date = new Date()
633
+ }
634
+
635
+ @Entity({ tableName: 'warranty_claim_sequences' })
636
+ @Unique({
637
+ name: 'warranty_claim_sequences_type_unique',
638
+ properties: ['tenantId', 'organizationId', 'claimType'],
639
+ })
640
+ export class WarrantyClaimSequence {
641
+ [OptionalProps]?: 'createdAt' | 'updatedAt'
642
+
643
+ @PrimaryKey({ type: 'uuid', defaultRaw: 'gen_random_uuid()' })
644
+ id!: string
645
+
646
+ @Property({ name: 'organization_id', type: 'uuid' })
647
+ organizationId!: string
648
+
649
+ @Property({ name: 'tenant_id', type: 'uuid' })
650
+ tenantId!: string
651
+
652
+ @Property({ name: 'claim_type', type: 'text' })
653
+ claimType!: WarrantyClaimType
654
+
655
+ @Property({ name: 'next_number', type: 'int', default: 1 })
656
+ nextNumber: number = 1
657
+
658
+ @Property({ name: 'created_at', type: Date, onCreate: () => new Date() })
659
+ createdAt: Date = new Date()
660
+
661
+ @Property({ name: 'updated_at', type: Date, onUpdate: () => new Date() })
662
+ updatedAt: Date = new Date()
663
+ }