@dainamite/cpq 0.2.2

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 (504) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +21 -0
  3. package/MIGRATION.md +236 -0
  4. package/README.md +108 -0
  5. package/dist/modules/cpq/acl.js +30 -0
  6. package/dist/modules/cpq/acl.js.map +7 -0
  7. package/dist/modules/cpq/api/_helpers/handleArcError.js +37 -0
  8. package/dist/modules/cpq/api/_helpers/handleArcError.js.map +7 -0
  9. package/dist/modules/cpq/api/attribute-options/route.js +47 -0
  10. package/dist/modules/cpq/api/attribute-options/route.js.map +7 -0
  11. package/dist/modules/cpq/api/bundle-slots/route.js +101 -0
  12. package/dist/modules/cpq/api/bundle-slots/route.js.map +7 -0
  13. package/dist/modules/cpq/api/bundle-tree/route.js +28 -0
  14. package/dist/modules/cpq/api/bundle-tree/route.js.map +7 -0
  15. package/dist/modules/cpq/api/context.js +29 -0
  16. package/dist/modules/cpq/api/context.js.map +7 -0
  17. package/dist/modules/cpq/api/inventory/assets/route.js +113 -0
  18. package/dist/modules/cpq/api/inventory/assets/route.js.map +7 -0
  19. package/dist/modules/cpq/api/inventory/assets/status/route.js +35 -0
  20. package/dist/modules/cpq/api/inventory/assets/status/route.js.map +7 -0
  21. package/dist/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.js +30 -0
  22. package/dist/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.js.map +7 -0
  23. package/dist/modules/cpq/api/inventory/customer/[customerId]/route.js +31 -0
  24. package/dist/modules/cpq/api/inventory/customer/[customerId]/route.js.map +7 -0
  25. package/dist/modules/cpq/api/inventory/subscription-items/route.js +99 -0
  26. package/dist/modules/cpq/api/inventory/subscription-items/route.js.map +7 -0
  27. package/dist/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.js +57 -0
  28. package/dist/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.js.map +7 -0
  29. package/dist/modules/cpq/api/inventory/subscriptions/expiring/route.js +62 -0
  30. package/dist/modules/cpq/api/inventory/subscriptions/expiring/route.js.map +7 -0
  31. package/dist/modules/cpq/api/inventory/subscriptions/route.js +116 -0
  32. package/dist/modules/cpq/api/inventory/subscriptions/route.js.map +7 -0
  33. package/dist/modules/cpq/api/inventory/subscriptions/status/route.js +35 -0
  34. package/dist/modules/cpq/api/inventory/subscriptions/status/route.js.map +7 -0
  35. package/dist/modules/cpq/api/offering-components/route.js +91 -0
  36. package/dist/modules/cpq/api/offering-components/route.js.map +7 -0
  37. package/dist/modules/cpq/api/orders/[orderId]/activate/route.js +39 -0
  38. package/dist/modules/cpq/api/orders/[orderId]/activate/route.js.map +7 -0
  39. package/dist/modules/cpq/api/orders/[orderId]/route.js +28 -0
  40. package/dist/modules/cpq/api/orders/[orderId]/route.js.map +7 -0
  41. package/dist/modules/cpq/api/orders/[orderId]/status/route.js +38 -0
  42. package/dist/modules/cpq/api/orders/[orderId]/status/route.js.map +7 -0
  43. package/dist/modules/cpq/api/orders/route.js +71 -0
  44. package/dist/modules/cpq/api/orders/route.js.map +7 -0
  45. package/dist/modules/cpq/api/price-rules/route.js +180 -0
  46. package/dist/modules/cpq/api/price-rules/route.js.map +7 -0
  47. package/dist/modules/cpq/api/pricing-table-entries/route.js +142 -0
  48. package/dist/modules/cpq/api/pricing-table-entries/route.js.map +7 -0
  49. package/dist/modules/cpq/api/pricing-tables/route.js +179 -0
  50. package/dist/modules/cpq/api/pricing-tables/route.js.map +7 -0
  51. package/dist/modules/cpq/api/product-attributes/route.js +160 -0
  52. package/dist/modules/cpq/api/product-attributes/route.js.map +7 -0
  53. package/dist/modules/cpq/api/product-charges/route.js +166 -0
  54. package/dist/modules/cpq/api/product-charges/route.js.map +7 -0
  55. package/dist/modules/cpq/api/product-offerings/route.js +294 -0
  56. package/dist/modules/cpq/api/product-offerings/route.js.map +7 -0
  57. package/dist/modules/cpq/api/product-relationships/route.js +144 -0
  58. package/dist/modules/cpq/api/product-relationships/route.js.map +7 -0
  59. package/dist/modules/cpq/api/product-specifications/route.js +292 -0
  60. package/dist/modules/cpq/api/product-specifications/route.js.map +7 -0
  61. package/dist/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.js +71 -0
  62. package/dist/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.js.map +7 -0
  63. package/dist/modules/cpq/api/quotes/[quoteId]/clone/route.js +29 -0
  64. package/dist/modules/cpq/api/quotes/[quoteId]/clone/route.js.map +7 -0
  65. package/dist/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.js +54 -0
  66. package/dist/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.js.map +7 -0
  67. package/dist/modules/cpq/api/quotes/[quoteId]/items/route.js +27 -0
  68. package/dist/modules/cpq/api/quotes/[quoteId]/items/route.js.map +7 -0
  69. package/dist/modules/cpq/api/quotes/[quoteId]/merge-meta/route.js +72 -0
  70. package/dist/modules/cpq/api/quotes/[quoteId]/merge-meta/route.js.map +7 -0
  71. package/dist/modules/cpq/api/quotes/[quoteId]/recalculate/route.js +35 -0
  72. package/dist/modules/cpq/api/quotes/[quoteId]/recalculate/route.js.map +7 -0
  73. package/dist/modules/cpq/api/quotes/[quoteId]/route.js +102 -0
  74. package/dist/modules/cpq/api/quotes/[quoteId]/route.js.map +7 -0
  75. package/dist/modules/cpq/api/quotes/[quoteId]/status/route.js +27 -0
  76. package/dist/modules/cpq/api/quotes/[quoteId]/status/route.js.map +7 -0
  77. package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.js +79 -0
  78. package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.js.map +7 -0
  79. package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.js +95 -0
  80. package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.js.map +7 -0
  81. package/dist/modules/cpq/api/quotes/attributes/route.js +52 -0
  82. package/dist/modules/cpq/api/quotes/attributes/route.js.map +7 -0
  83. package/dist/modules/cpq/api/quotes/from-subscription/route.js +72 -0
  84. package/dist/modules/cpq/api/quotes/from-subscription/route.js.map +7 -0
  85. package/dist/modules/cpq/api/quotes/price/route.js +69 -0
  86. package/dist/modules/cpq/api/quotes/price/route.js.map +7 -0
  87. package/dist/modules/cpq/api/quotes/route.js +97 -0
  88. package/dist/modules/cpq/api/quotes/route.js.map +7 -0
  89. package/dist/modules/cpq/api/quotes/validate-relationships/route.js +86 -0
  90. package/dist/modules/cpq/api/quotes/validate-relationships/route.js.map +7 -0
  91. package/dist/modules/cpq/api/resolveQuotingService.js +7 -0
  92. package/dist/modules/cpq/api/resolveQuotingService.js.map +7 -0
  93. package/dist/modules/cpq/api/wizards/resolve/route.js +38 -0
  94. package/dist/modules/cpq/api/wizards/resolve/route.js.map +7 -0
  95. package/dist/modules/cpq/api/wizards/route.js +111 -0
  96. package/dist/modules/cpq/api/wizards/route.js.map +7 -0
  97. package/dist/modules/cpq/backend/cpq/inventory/AssetsTable.js +136 -0
  98. package/dist/modules/cpq/backend/cpq/inventory/AssetsTable.js.map +7 -0
  99. package/dist/modules/cpq/backend/cpq/inventory/SubscriptionsTable.js +185 -0
  100. package/dist/modules/cpq/backend/cpq/inventory/SubscriptionsTable.js.map +7 -0
  101. package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.js +343 -0
  102. package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.js.map +7 -0
  103. package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.js +13 -0
  104. package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.js.map +7 -0
  105. package/dist/modules/cpq/backend/cpq/inventory/page.js +35 -0
  106. package/dist/modules/cpq/backend/cpq/inventory/page.js.map +7 -0
  107. package/dist/modules/cpq/backend/cpq/inventory/page.meta.js +18 -0
  108. package/dist/modules/cpq/backend/cpq/inventory/page.meta.js.map +7 -0
  109. package/dist/modules/cpq/backend/cpq/inventory/shared.js +20 -0
  110. package/dist/modules/cpq/backend/cpq/inventory/shared.js.map +7 -0
  111. package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.js +794 -0
  112. package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.js.map +7 -0
  113. package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.js +13 -0
  114. package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.js.map +7 -0
  115. package/dist/modules/cpq/backend/cpq/offerings/[id]/page.js +917 -0
  116. package/dist/modules/cpq/backend/cpq/offerings/[id]/page.js.map +7 -0
  117. package/dist/modules/cpq/backend/cpq/offerings/page.js +405 -0
  118. package/dist/modules/cpq/backend/cpq/offerings/page.js.map +7 -0
  119. package/dist/modules/cpq/backend/cpq/offerings/page.meta.js +18 -0
  120. package/dist/modules/cpq/backend/cpq/offerings/page.meta.js.map +7 -0
  121. package/dist/modules/cpq/backend/cpq/orders/[id]/page.js +677 -0
  122. package/dist/modules/cpq/backend/cpq/orders/[id]/page.js.map +7 -0
  123. package/dist/modules/cpq/backend/cpq/orders/page.js +134 -0
  124. package/dist/modules/cpq/backend/cpq/orders/page.js.map +7 -0
  125. package/dist/modules/cpq/backend/cpq/orders/page.meta.js +18 -0
  126. package/dist/modules/cpq/backend/cpq/orders/page.meta.js.map +7 -0
  127. package/dist/modules/cpq/backend/cpq/price-rules/PriceRuleForm.js +272 -0
  128. package/dist/modules/cpq/backend/cpq/price-rules/PriceRuleForm.js.map +7 -0
  129. package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.js +407 -0
  130. package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.js.map +7 -0
  131. package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.meta.js +13 -0
  132. package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.meta.js.map +7 -0
  133. package/dist/modules/cpq/backend/cpq/price-rules/page.js +211 -0
  134. package/dist/modules/cpq/backend/cpq/price-rules/page.js.map +7 -0
  135. package/dist/modules/cpq/backend/cpq/price-rules/page.meta.js +18 -0
  136. package/dist/modules/cpq/backend/cpq/price-rules/page.meta.js.map +7 -0
  137. package/dist/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.js +275 -0
  138. package/dist/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.js.map +7 -0
  139. package/dist/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.js +112 -0
  140. package/dist/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.js.map +7 -0
  141. package/dist/modules/cpq/backend/cpq/pricing/[id]/page.js +492 -0
  142. package/dist/modules/cpq/backend/cpq/pricing/[id]/page.js.map +7 -0
  143. package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.js +50 -0
  144. package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.js.map +7 -0
  145. package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.js +249 -0
  146. package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.js.map +7 -0
  147. package/dist/modules/cpq/backend/cpq/pricing/page.js +87 -0
  148. package/dist/modules/cpq/backend/cpq/pricing/page.js.map +7 -0
  149. package/dist/modules/cpq/backend/cpq/pricing/page.meta.js +18 -0
  150. package/dist/modules/cpq/backend/cpq/pricing/page.meta.js.map +7 -0
  151. package/dist/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.js +652 -0
  152. package/dist/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.js.map +7 -0
  153. package/dist/modules/cpq/backend/cpq/quotes/[id]/page.js +1289 -0
  154. package/dist/modules/cpq/backend/cpq/quotes/[id]/page.js.map +7 -0
  155. package/dist/modules/cpq/backend/cpq/quotes/page.js +283 -0
  156. package/dist/modules/cpq/backend/cpq/quotes/page.js.map +7 -0
  157. package/dist/modules/cpq/backend/cpq/quotes/page.meta.js +18 -0
  158. package/dist/modules/cpq/backend/cpq/quotes/page.meta.js.map +7 -0
  159. package/dist/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.js +214 -0
  160. package/dist/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.js.map +7 -0
  161. package/dist/modules/cpq/backend/cpq/specifications/[id]/page.js +1399 -0
  162. package/dist/modules/cpq/backend/cpq/specifications/[id]/page.js.map +7 -0
  163. package/dist/modules/cpq/backend/cpq/specifications/page.js +148 -0
  164. package/dist/modules/cpq/backend/cpq/specifications/page.js.map +7 -0
  165. package/dist/modules/cpq/backend/cpq/specifications/page.meta.js +18 -0
  166. package/dist/modules/cpq/backend/cpq/specifications/page.meta.js.map +7 -0
  167. package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.js +204 -0
  168. package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.js.map +7 -0
  169. package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/page.js +191 -0
  170. package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/page.js.map +7 -0
  171. package/dist/modules/cpq/backend/cpq/wizards/page.js +119 -0
  172. package/dist/modules/cpq/backend/cpq/wizards/page.js.map +7 -0
  173. package/dist/modules/cpq/backend/cpq/wizards/page.meta.js +18 -0
  174. package/dist/modules/cpq/backend/cpq/wizards/page.meta.js.map +7 -0
  175. package/dist/modules/cpq/ce.js +151 -0
  176. package/dist/modules/cpq/ce.js.map +7 -0
  177. package/dist/modules/cpq/cli.js +11 -0
  178. package/dist/modules/cpq/cli.js.map +7 -0
  179. package/dist/modules/cpq/components/CpqListView.js +265 -0
  180. package/dist/modules/cpq/components/CpqListView.js.map +7 -0
  181. package/dist/modules/cpq/components/NumberInput.js +95 -0
  182. package/dist/modules/cpq/components/NumberInput.js.map +7 -0
  183. package/dist/modules/cpq/components/StatusPath.js +60 -0
  184. package/dist/modules/cpq/components/StatusPath.js.map +7 -0
  185. package/dist/modules/cpq/components/statusMaps.js +66 -0
  186. package/dist/modules/cpq/components/statusMaps.js.map +7 -0
  187. package/dist/modules/cpq/components/useCpqRowActions.js +125 -0
  188. package/dist/modules/cpq/components/useCpqRowActions.js.map +7 -0
  189. package/dist/modules/cpq/data/entities.js +1556 -0
  190. package/dist/modules/cpq/data/entities.js.map +7 -0
  191. package/dist/modules/cpq/data/validators.js +575 -0
  192. package/dist/modules/cpq/data/validators.js.map +7 -0
  193. package/dist/modules/cpq/di.js +57 -0
  194. package/dist/modules/cpq/di.js.map +7 -0
  195. package/dist/modules/cpq/events.js +50 -0
  196. package/dist/modules/cpq/events.js.map +7 -0
  197. package/dist/modules/cpq/index.js +16 -0
  198. package/dist/modules/cpq/index.js.map +7 -0
  199. package/dist/modules/cpq/lib/seeds/api.js +32 -0
  200. package/dist/modules/cpq/lib/seeds/api.js.map +7 -0
  201. package/dist/modules/cpq/lib/seeds/tenant-provisioning.js +158 -0
  202. package/dist/modules/cpq/lib/seeds/tenant-provisioning.js.map +7 -0
  203. package/dist/modules/cpq/lib/seeds.js +6 -0
  204. package/dist/modules/cpq/lib/seeds.js.map +7 -0
  205. package/dist/modules/cpq/migrations/Migration20260220220000_cpq.js +40 -0
  206. package/dist/modules/cpq/migrations/Migration20260220220000_cpq.js.map +7 -0
  207. package/dist/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.js +54 -0
  208. package/dist/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.js.map +7 -0
  209. package/dist/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.js +15 -0
  210. package/dist/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.js.map +7 -0
  211. package/dist/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.js +62 -0
  212. package/dist/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.js.map +7 -0
  213. package/dist/modules/cpq/migrations/Migration20260402000000_cpq_workflows.js +56 -0
  214. package/dist/modules/cpq/migrations/Migration20260402000000_cpq_workflows.js.map +7 -0
  215. package/dist/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.js +26 -0
  216. package/dist/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.js.map +7 -0
  217. package/dist/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.js +37 -0
  218. package/dist/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.js.map +7 -0
  219. package/dist/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.js +35 -0
  220. package/dist/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.js.map +7 -0
  221. package/dist/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.js +21 -0
  222. package/dist/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.js.map +7 -0
  223. package/dist/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.js +46 -0
  224. package/dist/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.js.map +7 -0
  225. package/dist/modules/cpq/migrations/Migration20260410100000_cpq_inventory.js +118 -0
  226. package/dist/modules/cpq/migrations/Migration20260410100000_cpq_inventory.js.map +7 -0
  227. package/dist/modules/cpq/migrations/Migration20260411000000_cpq_orders.js +63 -0
  228. package/dist/modules/cpq/migrations/Migration20260411000000_cpq_orders.js.map +7 -0
  229. package/dist/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.js +28 -0
  230. package/dist/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.js.map +7 -0
  231. package/dist/modules/cpq/migrations/Migration20260504064621_cpq_arc.js +36 -0
  232. package/dist/modules/cpq/migrations/Migration20260504064621_cpq_arc.js.map +7 -0
  233. package/dist/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.js +14 -0
  234. package/dist/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.js.map +7 -0
  235. package/dist/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.js +14 -0
  236. package/dist/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.js.map +7 -0
  237. package/dist/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.js +58 -0
  238. package/dist/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.js.map +7 -0
  239. package/dist/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.js +29 -0
  240. package/dist/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.js.map +7 -0
  241. package/dist/modules/cpq/services/cpqBundleService.js +447 -0
  242. package/dist/modules/cpq/services/cpqBundleService.js.map +7 -0
  243. package/dist/modules/cpq/services/cpqInventoryService.js +1371 -0
  244. package/dist/modules/cpq/services/cpqInventoryService.js.map +7 -0
  245. package/dist/modules/cpq/services/cpqOrderService.js +901 -0
  246. package/dist/modules/cpq/services/cpqOrderService.js.map +7 -0
  247. package/dist/modules/cpq/services/cpqPricingService.js +289 -0
  248. package/dist/modules/cpq/services/cpqPricingService.js.map +7 -0
  249. package/dist/modules/cpq/services/cpqProductService.js +204 -0
  250. package/dist/modules/cpq/services/cpqProductService.js.map +7 -0
  251. package/dist/modules/cpq/services/cpqQuotingService.js +1867 -0
  252. package/dist/modules/cpq/services/cpqQuotingService.js.map +7 -0
  253. package/dist/modules/cpq/services/cpqValidationService.js +234 -0
  254. package/dist/modules/cpq/services/cpqValidationService.js.map +7 -0
  255. package/dist/modules/cpq/services/cpqWizardService.js +137 -0
  256. package/dist/modules/cpq/services/cpqWizardService.js.map +7 -0
  257. package/dist/modules/cpq/services/types.js +114 -0
  258. package/dist/modules/cpq/services/types.js.map +7 -0
  259. package/dist/modules/cpq/setup.js +49 -0
  260. package/dist/modules/cpq/setup.js.map +7 -0
  261. package/dist/modules/cpq/subscribers/subscription-amended-log.js +18 -0
  262. package/dist/modules/cpq/subscribers/subscription-amended-log.js.map +7 -0
  263. package/dist/modules/cpq/subscribers/subscription-cancelled-log.js +19 -0
  264. package/dist/modules/cpq/subscribers/subscription-cancelled-log.js.map +7 -0
  265. package/dist/modules/cpq/subscribers/subscription-merged-log.js +20 -0
  266. package/dist/modules/cpq/subscribers/subscription-merged-log.js.map +7 -0
  267. package/dist/modules/cpq/subscribers/subscription-renewed-log.js +18 -0
  268. package/dist/modules/cpq/subscribers/subscription-renewed-log.js.map +7 -0
  269. package/dist/modules/cpq/subscribers/subscription-superseded-log.js +18 -0
  270. package/dist/modules/cpq/subscribers/subscription-superseded-log.js.map +7 -0
  271. package/dist/modules/cpq/widgets/injection/customer-inventory/widget.client.js +192 -0
  272. package/dist/modules/cpq/widgets/injection/customer-inventory/widget.client.js.map +7 -0
  273. package/dist/modules/cpq/widgets/injection/customer-inventory/widget.js +17 -0
  274. package/dist/modules/cpq/widgets/injection/customer-inventory/widget.js.map +7 -0
  275. package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.client.js +79 -0
  276. package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.client.js.map +7 -0
  277. package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.js +17 -0
  278. package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.js.map +7 -0
  279. package/dist/modules/cpq/widgets/injection/quote-configurator/widget.client.js +181 -0
  280. package/dist/modules/cpq/widgets/injection/quote-configurator/widget.client.js.map +7 -0
  281. package/dist/modules/cpq/widgets/injection/quote-configurator/widget.js +17 -0
  282. package/dist/modules/cpq/widgets/injection/quote-configurator/widget.js.map +7 -0
  283. package/dist/modules/cpq/widgets/injection-table.js +44 -0
  284. package/dist/modules/cpq/widgets/injection-table.js.map +7 -0
  285. package/dist/modules/cpq/workflows/WizardRunner.js +113 -0
  286. package/dist/modules/cpq/workflows/WizardRunner.js.map +7 -0
  287. package/dist/modules/cpq/workflows/WizardTrigger.js +116 -0
  288. package/dist/modules/cpq/workflows/WizardTrigger.js.map +7 -0
  289. package/dist/modules/cpq/workflows/engine.js +188 -0
  290. package/dist/modules/cpq/workflows/engine.js.map +7 -0
  291. package/dist/modules/cpq/workflows/registry.js +16 -0
  292. package/dist/modules/cpq/workflows/registry.js.map +7 -0
  293. package/dist/modules/cpq/workflows/steps/CustomerSelectStep.js +119 -0
  294. package/dist/modules/cpq/workflows/steps/CustomerSelectStep.js.map +7 -0
  295. package/dist/modules/cpq/workflows/steps/InventorySelectStep.js +24 -0
  296. package/dist/modules/cpq/workflows/steps/InventorySelectStep.js.map +7 -0
  297. package/dist/modules/cpq/workflows/steps/ItemListStep.js +115 -0
  298. package/dist/modules/cpq/workflows/steps/ItemListStep.js.map +7 -0
  299. package/dist/modules/cpq/workflows/steps/OfferingSelectStep.js +327 -0
  300. package/dist/modules/cpq/workflows/steps/OfferingSelectStep.js.map +7 -0
  301. package/dist/modules/cpq/workflows/steps/ProductConfigureStep.js +231 -0
  302. package/dist/modules/cpq/workflows/steps/ProductConfigureStep.js.map +7 -0
  303. package/dist/modules/cpq/workflows/steps/ReviewStep.js +152 -0
  304. package/dist/modules/cpq/workflows/steps/ReviewStep.js.map +7 -0
  305. package/dist/modules/cpq/workflows/steps/index.js +49 -0
  306. package/dist/modules/cpq/workflows/steps/index.js.map +7 -0
  307. package/dist/modules/cpq/workflows/types.js +1 -0
  308. package/dist/modules/cpq/workflows/types.js.map +7 -0
  309. package/package.json +150 -0
  310. package/src/modules/cpq/__integration__/TC-CPQ-001.spec.ts +177 -0
  311. package/src/modules/cpq/__integration__/TC-CPQ-002.spec.ts +123 -0
  312. package/src/modules/cpq/__integration__/TC-CPQ-003.spec.ts +115 -0
  313. package/src/modules/cpq/__integration__/TC-CPQ-004.spec.ts +184 -0
  314. package/src/modules/cpq/__integration__/TC-CPQ-005.spec.ts +43 -0
  315. package/src/modules/cpq/__integration__/TC-CPQ-006.spec.ts +87 -0
  316. package/src/modules/cpq/__integration__/TC-CPQ-007.spec.ts +79 -0
  317. package/src/modules/cpq/__integration__/TC-CPQ-008.spec.ts +55 -0
  318. package/src/modules/cpq/__integration__/TC-CPQ-009.spec.ts +45 -0
  319. package/src/modules/cpq/__integration__/TC-CPQ-010.spec.ts +54 -0
  320. package/src/modules/cpq/__integration__/TC-CPQ-011.spec.ts +24 -0
  321. package/src/modules/cpq/__integration__/TC-CPQ-012.spec.ts +62 -0
  322. package/src/modules/cpq/__integration__/TC-CPQ-ARC-001.spec.ts +52 -0
  323. package/src/modules/cpq/__integration__/TC-CPQ-ARC-002.spec.ts +65 -0
  324. package/src/modules/cpq/__integration__/TC-CPQ-ARC-003.spec.ts +107 -0
  325. package/src/modules/cpq/__integration__/TC-CPQ-ARC-004.spec.ts +74 -0
  326. package/src/modules/cpq/__integration__/TC-CPQ-ARC-005.spec.ts +86 -0
  327. package/src/modules/cpq/__integration__/TC-CPQ-ARC-006.spec.ts +79 -0
  328. package/src/modules/cpq/__integration__/TC-CPQ-ARC-007.spec.ts +63 -0
  329. package/src/modules/cpq/__integration__/TC-CPQ-ARC-008.spec.ts +62 -0
  330. package/src/modules/cpq/__integration__/TC-CPQ-ARC-009.spec.ts +62 -0
  331. package/src/modules/cpq/__integration__/TC-CPQ-ARC-010.spec.ts +59 -0
  332. package/src/modules/cpq/__integration__/TC-CPQ-ARC-011.spec.ts +128 -0
  333. package/src/modules/cpq/__integration__/_helpers/cpqArcFixtures.ts +208 -0
  334. package/src/modules/cpq/__tests__/package-isolation.test.ts +232 -0
  335. package/src/modules/cpq/acl.ts +26 -0
  336. package/src/modules/cpq/api/_helpers/__tests__/handleArcError.test.ts +117 -0
  337. package/src/modules/cpq/api/_helpers/handleArcError.ts +81 -0
  338. package/src/modules/cpq/api/attribute-options/route.ts +55 -0
  339. package/src/modules/cpq/api/bundle-slots/route.ts +112 -0
  340. package/src/modules/cpq/api/bundle-tree/route.ts +31 -0
  341. package/src/modules/cpq/api/context.ts +39 -0
  342. package/src/modules/cpq/api/inventory/assets/route.ts +123 -0
  343. package/src/modules/cpq/api/inventory/assets/status/route.ts +34 -0
  344. package/src/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.ts +30 -0
  345. package/src/modules/cpq/api/inventory/customer/[customerId]/route.ts +31 -0
  346. package/src/modules/cpq/api/inventory/subscription-items/route.ts +107 -0
  347. package/src/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.ts +64 -0
  348. package/src/modules/cpq/api/inventory/subscriptions/expiring/route.ts +66 -0
  349. package/src/modules/cpq/api/inventory/subscriptions/route.ts +126 -0
  350. package/src/modules/cpq/api/inventory/subscriptions/status/route.ts +34 -0
  351. package/src/modules/cpq/api/offering-components/route.ts +103 -0
  352. package/src/modules/cpq/api/orders/[orderId]/activate/route.ts +48 -0
  353. package/src/modules/cpq/api/orders/[orderId]/route.ts +28 -0
  354. package/src/modules/cpq/api/orders/[orderId]/status/route.ts +38 -0
  355. package/src/modules/cpq/api/orders/route.ts +77 -0
  356. package/src/modules/cpq/api/price-rules/route.ts +210 -0
  357. package/src/modules/cpq/api/pricing-table-entries/route.ts +159 -0
  358. package/src/modules/cpq/api/pricing-tables/route.ts +202 -0
  359. package/src/modules/cpq/api/product-attributes/route.ts +175 -0
  360. package/src/modules/cpq/api/product-charges/route.ts +181 -0
  361. package/src/modules/cpq/api/product-offerings/route.ts +329 -0
  362. package/src/modules/cpq/api/product-relationships/route.ts +156 -0
  363. package/src/modules/cpq/api/product-specifications/route.ts +325 -0
  364. package/src/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.ts +77 -0
  365. package/src/modules/cpq/api/quotes/[quoteId]/clone/route.ts +28 -0
  366. package/src/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.ts +55 -0
  367. package/src/modules/cpq/api/quotes/[quoteId]/items/route.ts +26 -0
  368. package/src/modules/cpq/api/quotes/[quoteId]/merge-meta/route.ts +78 -0
  369. package/src/modules/cpq/api/quotes/[quoteId]/recalculate/route.ts +34 -0
  370. package/src/modules/cpq/api/quotes/[quoteId]/route.ts +109 -0
  371. package/src/modules/cpq/api/quotes/[quoteId]/status/route.ts +26 -0
  372. package/src/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.ts +91 -0
  373. package/src/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.ts +107 -0
  374. package/src/modules/cpq/api/quotes/attributes/route.ts +61 -0
  375. package/src/modules/cpq/api/quotes/from-subscription/route.ts +85 -0
  376. package/src/modules/cpq/api/quotes/price/route.ts +81 -0
  377. package/src/modules/cpq/api/quotes/route.ts +114 -0
  378. package/src/modules/cpq/api/quotes/validate-relationships/route.ts +100 -0
  379. package/src/modules/cpq/api/resolveQuotingService.ts +11 -0
  380. package/src/modules/cpq/api/wizards/resolve/route.ts +39 -0
  381. package/src/modules/cpq/api/wizards/route.ts +127 -0
  382. package/src/modules/cpq/backend/cpq/inventory/AssetsTable.tsx +166 -0
  383. package/src/modules/cpq/backend/cpq/inventory/SubscriptionsTable.tsx +251 -0
  384. package/src/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.ts +9 -0
  385. package/src/modules/cpq/backend/cpq/inventory/assets/[id]/page.tsx +440 -0
  386. package/src/modules/cpq/backend/cpq/inventory/page.meta.ts +16 -0
  387. package/src/modules/cpq/backend/cpq/inventory/page.tsx +49 -0
  388. package/src/modules/cpq/backend/cpq/inventory/shared.tsx +32 -0
  389. package/src/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.ts +9 -0
  390. package/src/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.tsx +1085 -0
  391. package/src/modules/cpq/backend/cpq/offerings/[id]/page.tsx +1165 -0
  392. package/src/modules/cpq/backend/cpq/offerings/page.meta.ts +16 -0
  393. package/src/modules/cpq/backend/cpq/offerings/page.tsx +468 -0
  394. package/src/modules/cpq/backend/cpq/orders/[id]/page.tsx +921 -0
  395. package/src/modules/cpq/backend/cpq/orders/page.meta.ts +16 -0
  396. package/src/modules/cpq/backend/cpq/orders/page.tsx +182 -0
  397. package/src/modules/cpq/backend/cpq/price-rules/PriceRuleForm.tsx +310 -0
  398. package/src/modules/cpq/backend/cpq/price-rules/[id]/page.meta.ts +9 -0
  399. package/src/modules/cpq/backend/cpq/price-rules/[id]/page.tsx +472 -0
  400. package/src/modules/cpq/backend/cpq/price-rules/page.meta.ts +16 -0
  401. package/src/modules/cpq/backend/cpq/price-rules/page.tsx +253 -0
  402. package/src/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.tsx +431 -0
  403. package/src/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.tsx +122 -0
  404. package/src/modules/cpq/backend/cpq/pricing/[id]/page.tsx +588 -0
  405. package/src/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.ts +90 -0
  406. package/src/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.ts +338 -0
  407. package/src/modules/cpq/backend/cpq/pricing/page.meta.ts +16 -0
  408. package/src/modules/cpq/backend/cpq/pricing/page.tsx +111 -0
  409. package/src/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.tsx +737 -0
  410. package/src/modules/cpq/backend/cpq/quotes/[id]/page.tsx +1721 -0
  411. package/src/modules/cpq/backend/cpq/quotes/page.meta.ts +16 -0
  412. package/src/modules/cpq/backend/cpq/quotes/page.tsx +370 -0
  413. package/src/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.tsx +300 -0
  414. package/src/modules/cpq/backend/cpq/specifications/[id]/page.tsx +1722 -0
  415. package/src/modules/cpq/backend/cpq/specifications/page.meta.ts +16 -0
  416. package/src/modules/cpq/backend/cpq/specifications/page.tsx +191 -0
  417. package/src/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.tsx +319 -0
  418. package/src/modules/cpq/backend/cpq/wizards/[definitionCode]/page.tsx +234 -0
  419. package/src/modules/cpq/backend/cpq/wizards/page.meta.ts +16 -0
  420. package/src/modules/cpq/backend/cpq/wizards/page.tsx +141 -0
  421. package/src/modules/cpq/ce.ts +150 -0
  422. package/src/modules/cpq/cli.ts +10 -0
  423. package/src/modules/cpq/components/CpqListView.tsx +431 -0
  424. package/src/modules/cpq/components/NumberInput.tsx +166 -0
  425. package/src/modules/cpq/components/StatusPath.tsx +116 -0
  426. package/src/modules/cpq/components/statusMaps.ts +148 -0
  427. package/src/modules/cpq/components/useCpqRowActions.tsx +183 -0
  428. package/src/modules/cpq/data/__tests__/validators.arc.test.ts +271 -0
  429. package/src/modules/cpq/data/__tests__/validators.test.ts +782 -0
  430. package/src/modules/cpq/data/entities.ts +1467 -0
  431. package/src/modules/cpq/data/validators.ts +663 -0
  432. package/src/modules/cpq/di.ts +70 -0
  433. package/src/modules/cpq/events.ts +62 -0
  434. package/src/modules/cpq/index.ts +15 -0
  435. package/src/modules/cpq/lib/seeds/__tests__/api.test.ts +86 -0
  436. package/src/modules/cpq/lib/seeds/__tests__/tenant-provisioning.test.ts +349 -0
  437. package/src/modules/cpq/lib/seeds/api.ts +119 -0
  438. package/src/modules/cpq/lib/seeds/tenant-provisioning.ts +239 -0
  439. package/src/modules/cpq/lib/seeds.ts +18 -0
  440. package/src/modules/cpq/migrations/.snapshot-open-mercato.json +7473 -0
  441. package/src/modules/cpq/migrations/Migration20260220220000_cpq.ts +51 -0
  442. package/src/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.ts +70 -0
  443. package/src/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.ts +15 -0
  444. package/src/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.ts +73 -0
  445. package/src/modules/cpq/migrations/Migration20260402000000_cpq_workflows.ts +59 -0
  446. package/src/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.ts +30 -0
  447. package/src/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.ts +36 -0
  448. package/src/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.ts +33 -0
  449. package/src/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.ts +22 -0
  450. package/src/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.ts +56 -0
  451. package/src/modules/cpq/migrations/Migration20260410100000_cpq_inventory.ts +118 -0
  452. package/src/modules/cpq/migrations/Migration20260411000000_cpq_orders.ts +62 -0
  453. package/src/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.ts +33 -0
  454. package/src/modules/cpq/migrations/Migration20260504064621_cpq_arc.ts +68 -0
  455. package/src/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.ts +30 -0
  456. package/src/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.ts +27 -0
  457. package/src/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.ts +82 -0
  458. package/src/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.ts +52 -0
  459. package/src/modules/cpq/services/__tests__/_helpers/mockEm.ts +59 -0
  460. package/src/modules/cpq/services/__tests__/cpqBundleService.test.ts +661 -0
  461. package/src/modules/cpq/services/__tests__/cpqInventoryService.arc.test.ts +357 -0
  462. package/src/modules/cpq/services/__tests__/cpqInventoryService.test.ts +718 -0
  463. package/src/modules/cpq/services/__tests__/cpqOrderService.test.ts +603 -0
  464. package/src/modules/cpq/services/__tests__/cpqPricingService.test.ts +1012 -0
  465. package/src/modules/cpq/services/__tests__/cpqProductService.test.ts +603 -0
  466. package/src/modules/cpq/services/__tests__/cpqQuotingService.arc.test.ts +143 -0
  467. package/src/modules/cpq/services/__tests__/cpqQuotingService.test.ts +658 -0
  468. package/src/modules/cpq/services/__tests__/cpqValidationService.test.ts +811 -0
  469. package/src/modules/cpq/services/__tests__/cpqWizardService.test.ts +389 -0
  470. package/src/modules/cpq/services/__tests__/types.test.ts +359 -0
  471. package/src/modules/cpq/services/cpqBundleService.ts +671 -0
  472. package/src/modules/cpq/services/cpqInventoryService.ts +1929 -0
  473. package/src/modules/cpq/services/cpqOrderService.ts +1230 -0
  474. package/src/modules/cpq/services/cpqPricingService.ts +412 -0
  475. package/src/modules/cpq/services/cpqProductService.ts +311 -0
  476. package/src/modules/cpq/services/cpqQuotingService.ts +2638 -0
  477. package/src/modules/cpq/services/cpqValidationService.ts +323 -0
  478. package/src/modules/cpq/services/cpqWizardService.ts +204 -0
  479. package/src/modules/cpq/services/types.ts +303 -0
  480. package/src/modules/cpq/setup.ts +63 -0
  481. package/src/modules/cpq/subscribers/subscription-amended-log.ts +20 -0
  482. package/src/modules/cpq/subscribers/subscription-cancelled-log.ts +19 -0
  483. package/src/modules/cpq/subscribers/subscription-merged-log.ts +22 -0
  484. package/src/modules/cpq/subscribers/subscription-renewed-log.ts +18 -0
  485. package/src/modules/cpq/subscribers/subscription-superseded-log.ts +19 -0
  486. package/src/modules/cpq/widgets/injection/customer-inventory/widget.client.tsx +339 -0
  487. package/src/modules/cpq/widgets/injection/customer-inventory/widget.ts +16 -0
  488. package/src/modules/cpq/widgets/injection/order-cpq-tab/widget.client.tsx +96 -0
  489. package/src/modules/cpq/widgets/injection/order-cpq-tab/widget.ts +16 -0
  490. package/src/modules/cpq/widgets/injection/quote-configurator/widget.client.tsx +265 -0
  491. package/src/modules/cpq/widgets/injection/quote-configurator/widget.ts +16 -0
  492. package/src/modules/cpq/widgets/injection-table.ts +42 -0
  493. package/src/modules/cpq/workflows/WizardRunner.tsx +158 -0
  494. package/src/modules/cpq/workflows/WizardTrigger.tsx +142 -0
  495. package/src/modules/cpq/workflows/engine.tsx +278 -0
  496. package/src/modules/cpq/workflows/registry.ts +15 -0
  497. package/src/modules/cpq/workflows/steps/CustomerSelectStep.tsx +136 -0
  498. package/src/modules/cpq/workflows/steps/InventorySelectStep.tsx +34 -0
  499. package/src/modules/cpq/workflows/steps/ItemListStep.tsx +146 -0
  500. package/src/modules/cpq/workflows/steps/OfferingSelectStep.tsx +438 -0
  501. package/src/modules/cpq/workflows/steps/ProductConfigureStep.tsx +287 -0
  502. package/src/modules/cpq/workflows/steps/ReviewStep.tsx +219 -0
  503. package/src/modules/cpq/workflows/steps/index.ts +51 -0
  504. package/src/modules/cpq/workflows/types.ts +102 -0
@@ -0,0 +1,1556 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+ import { OptionalProps } from "@mikro-orm/core";
12
+ import { Entity, Index, PrimaryKey, Property, Unique } from "@mikro-orm/decorators/legacy";
13
+ OptionalProps;
14
+ let CpqProductSpecification = class {
15
+ constructor() {
16
+ this.specType = "simple";
17
+ this.isAssetizable = false;
18
+ this.lifecycleStatus = "draft";
19
+ this.version = 1;
20
+ this.isActive = true;
21
+ this.createdAt = /* @__PURE__ */ new Date();
22
+ this.updatedAt = /* @__PURE__ */ new Date();
23
+ }
24
+ };
25
+ __decorateClass([
26
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
27
+ ], CpqProductSpecification.prototype, "id", 2);
28
+ __decorateClass([
29
+ Property({ name: "organization_id", type: "uuid" })
30
+ ], CpqProductSpecification.prototype, "organizationId", 2);
31
+ __decorateClass([
32
+ Property({ name: "tenant_id", type: "uuid" })
33
+ ], CpqProductSpecification.prototype, "tenantId", 2);
34
+ __decorateClass([
35
+ Property({ name: "product_id", type: "uuid" })
36
+ ], CpqProductSpecification.prototype, "productId", 2);
37
+ __decorateClass([
38
+ Property({ type: "text" })
39
+ ], CpqProductSpecification.prototype, "code", 2);
40
+ __decorateClass([
41
+ Property({ type: "text" })
42
+ ], CpqProductSpecification.prototype, "name", 2);
43
+ __decorateClass([
44
+ Property({ type: "text", nullable: true })
45
+ ], CpqProductSpecification.prototype, "description", 2);
46
+ __decorateClass([
47
+ Property({ name: "spec_type", type: "text", default: "simple" })
48
+ ], CpqProductSpecification.prototype, "specType", 2);
49
+ __decorateClass([
50
+ Property({ name: "is_assetizable", type: "boolean", default: false })
51
+ ], CpqProductSpecification.prototype, "isAssetizable", 2);
52
+ __decorateClass([
53
+ Property({ name: "lifecycle_status", type: "text", default: "draft" })
54
+ ], CpqProductSpecification.prototype, "lifecycleStatus", 2);
55
+ __decorateClass([
56
+ Property({ type: "integer", default: 1 })
57
+ ], CpqProductSpecification.prototype, "version", 2);
58
+ __decorateClass([
59
+ Property({ name: "effective_from", type: Date, nullable: true })
60
+ ], CpqProductSpecification.prototype, "effectiveFrom", 2);
61
+ __decorateClass([
62
+ Property({ name: "effective_to", type: Date, nullable: true })
63
+ ], CpqProductSpecification.prototype, "effectiveTo", 2);
64
+ __decorateClass([
65
+ Property({ type: "jsonb", nullable: true })
66
+ ], CpqProductSpecification.prototype, "metadata", 2);
67
+ __decorateClass([
68
+ Property({ name: "is_active", type: "boolean", default: true })
69
+ ], CpqProductSpecification.prototype, "isActive", 2);
70
+ __decorateClass([
71
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
72
+ ], CpqProductSpecification.prototype, "createdAt", 2);
73
+ __decorateClass([
74
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
75
+ ], CpqProductSpecification.prototype, "updatedAt", 2);
76
+ __decorateClass([
77
+ Property({ name: "deleted_at", type: Date, nullable: true })
78
+ ], CpqProductSpecification.prototype, "deletedAt", 2);
79
+ CpqProductSpecification = __decorateClass([
80
+ Entity({ tableName: "cpq_product_specifications" }),
81
+ Unique({ name: "cpq_product_specifications_product_unique", properties: ["organizationId", "tenantId", "productId"] }),
82
+ Unique({ name: "cpq_product_specifications_code_unique", properties: ["organizationId", "tenantId", "code"] }),
83
+ Index({ name: "cpq_product_specifications_lifecycle_idx", properties: ["organizationId", "tenantId", "lifecycleStatus"] })
84
+ ], CpqProductSpecification);
85
+ OptionalProps;
86
+ let CpqProductOffering = class {
87
+ constructor() {
88
+ this.offeringType = "simple";
89
+ this.designTimeValues = {};
90
+ this.lifecycleStatus = "draft";
91
+ this.isActive = true;
92
+ this.createdAt = /* @__PURE__ */ new Date();
93
+ this.updatedAt = /* @__PURE__ */ new Date();
94
+ }
95
+ };
96
+ __decorateClass([
97
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
98
+ ], CpqProductOffering.prototype, "id", 2);
99
+ __decorateClass([
100
+ Property({ name: "organization_id", type: "uuid" })
101
+ ], CpqProductOffering.prototype, "organizationId", 2);
102
+ __decorateClass([
103
+ Property({ name: "tenant_id", type: "uuid" })
104
+ ], CpqProductOffering.prototype, "tenantId", 2);
105
+ __decorateClass([
106
+ Property({ name: "spec_id", type: "uuid" })
107
+ ], CpqProductOffering.prototype, "specId", 2);
108
+ __decorateClass([
109
+ Property({ name: "catalog_offer_id", type: "uuid", nullable: true })
110
+ ], CpqProductOffering.prototype, "catalogOfferId", 2);
111
+ __decorateClass([
112
+ Property({ type: "text" })
113
+ ], CpqProductOffering.prototype, "code", 2);
114
+ __decorateClass([
115
+ Property({ type: "text" })
116
+ ], CpqProductOffering.prototype, "name", 2);
117
+ __decorateClass([
118
+ Property({ type: "text", nullable: true })
119
+ ], CpqProductOffering.prototype, "description", 2);
120
+ __decorateClass([
121
+ Property({ name: "offering_type", type: "text", default: "simple" })
122
+ ], CpqProductOffering.prototype, "offeringType", 2);
123
+ __decorateClass([
124
+ Property({ name: "design_time_values", type: "jsonb", default: "{}" })
125
+ ], CpqProductOffering.prototype, "designTimeValues", 2);
126
+ __decorateClass([
127
+ Property({ name: "lifecycle_status", type: "text", default: "draft" })
128
+ ], CpqProductOffering.prototype, "lifecycleStatus", 2);
129
+ __decorateClass([
130
+ Property({ name: "effective_from", type: Date, nullable: true })
131
+ ], CpqProductOffering.prototype, "effectiveFrom", 2);
132
+ __decorateClass([
133
+ Property({ name: "effective_to", type: Date, nullable: true })
134
+ ], CpqProductOffering.prototype, "effectiveTo", 2);
135
+ __decorateClass([
136
+ Property({ type: "jsonb", nullable: true })
137
+ ], CpqProductOffering.prototype, "metadata", 2);
138
+ __decorateClass([
139
+ Property({ name: "is_active", type: "boolean", default: true })
140
+ ], CpqProductOffering.prototype, "isActive", 2);
141
+ __decorateClass([
142
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
143
+ ], CpqProductOffering.prototype, "createdAt", 2);
144
+ __decorateClass([
145
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
146
+ ], CpqProductOffering.prototype, "updatedAt", 2);
147
+ __decorateClass([
148
+ Property({ name: "deleted_at", type: Date, nullable: true })
149
+ ], CpqProductOffering.prototype, "deletedAt", 2);
150
+ CpqProductOffering = __decorateClass([
151
+ Entity({ tableName: "cpq_product_offerings" }),
152
+ Unique({ name: "cpq_product_offerings_code_unique", properties: ["organizationId", "tenantId", "code"] }),
153
+ Index({ name: "cpq_product_offerings_spec_idx", properties: ["organizationId", "tenantId", "specId"] }),
154
+ Index({ name: "cpq_product_offerings_lifecycle_idx", properties: ["organizationId", "tenantId", "lifecycleStatus"] })
155
+ ], CpqProductOffering);
156
+ OptionalProps;
157
+ let CpqProductRelationship = class {
158
+ constructor() {
159
+ this.cardinalityMin = 0;
160
+ this.isActive = true;
161
+ this.createdAt = /* @__PURE__ */ new Date();
162
+ this.updatedAt = /* @__PURE__ */ new Date();
163
+ }
164
+ };
165
+ __decorateClass([
166
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
167
+ ], CpqProductRelationship.prototype, "id", 2);
168
+ __decorateClass([
169
+ Property({ name: "organization_id", type: "uuid" })
170
+ ], CpqProductRelationship.prototype, "organizationId", 2);
171
+ __decorateClass([
172
+ Property({ name: "tenant_id", type: "uuid" })
173
+ ], CpqProductRelationship.prototype, "tenantId", 2);
174
+ __decorateClass([
175
+ Property({ name: "source_spec_id", type: "uuid" })
176
+ ], CpqProductRelationship.prototype, "sourceSpecId", 2);
177
+ __decorateClass([
178
+ Property({ name: "target_spec_id", type: "uuid" })
179
+ ], CpqProductRelationship.prototype, "targetSpecId", 2);
180
+ __decorateClass([
181
+ Property({ name: "relationship_type", type: "text" })
182
+ ], CpqProductRelationship.prototype, "relationshipType", 2);
183
+ __decorateClass([
184
+ Property({ name: "cardinality_min", type: "integer", default: 0 })
185
+ ], CpqProductRelationship.prototype, "cardinalityMin", 2);
186
+ __decorateClass([
187
+ Property({ name: "cardinality_max", type: "integer", nullable: true })
188
+ ], CpqProductRelationship.prototype, "cardinalityMax", 2);
189
+ __decorateClass([
190
+ Property({ type: "jsonb", nullable: true })
191
+ ], CpqProductRelationship.prototype, "condition", 2);
192
+ __decorateClass([
193
+ Property({ type: "jsonb", nullable: true })
194
+ ], CpqProductRelationship.prototype, "metadata", 2);
195
+ __decorateClass([
196
+ Property({ name: "is_active", type: "boolean", default: true })
197
+ ], CpqProductRelationship.prototype, "isActive", 2);
198
+ __decorateClass([
199
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
200
+ ], CpqProductRelationship.prototype, "createdAt", 2);
201
+ __decorateClass([
202
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
203
+ ], CpqProductRelationship.prototype, "updatedAt", 2);
204
+ __decorateClass([
205
+ Property({ name: "deleted_at", type: Date, nullable: true })
206
+ ], CpqProductRelationship.prototype, "deletedAt", 2);
207
+ CpqProductRelationship = __decorateClass([
208
+ Entity({ tableName: "cpq_product_relationships" }),
209
+ Unique({
210
+ name: "cpq_product_relationships_unique",
211
+ properties: ["organizationId", "tenantId", "sourceSpecId", "targetSpecId", "relationshipType"]
212
+ }),
213
+ Index({ name: "cpq_product_relationships_source_idx", properties: ["organizationId", "tenantId", "sourceSpecId"] }),
214
+ Index({ name: "cpq_product_relationships_target_idx", properties: ["organizationId", "tenantId", "targetSpecId"] })
215
+ ], CpqProductRelationship);
216
+ OptionalProps;
217
+ let CpqBundleSlot = class {
218
+ constructor() {
219
+ this.cardinalityMin = 0;
220
+ this.sortOrder = 0;
221
+ this.isActive = true;
222
+ this.createdAt = /* @__PURE__ */ new Date();
223
+ this.updatedAt = /* @__PURE__ */ new Date();
224
+ }
225
+ };
226
+ __decorateClass([
227
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
228
+ ], CpqBundleSlot.prototype, "id", 2);
229
+ __decorateClass([
230
+ Property({ name: "organization_id", type: "uuid" })
231
+ ], CpqBundleSlot.prototype, "organizationId", 2);
232
+ __decorateClass([
233
+ Property({ name: "tenant_id", type: "uuid" })
234
+ ], CpqBundleSlot.prototype, "tenantId", 2);
235
+ __decorateClass([
236
+ Property({ name: "spec_id", type: "uuid" })
237
+ ], CpqBundleSlot.prototype, "specId", 2);
238
+ __decorateClass([
239
+ Property({ name: "target_spec_id", type: "uuid" })
240
+ ], CpqBundleSlot.prototype, "targetSpecId", 2);
241
+ __decorateClass([
242
+ Property({ name: "component_group", type: "text" })
243
+ ], CpqBundleSlot.prototype, "componentGroup", 2);
244
+ __decorateClass([
245
+ Property({ type: "text" })
246
+ ], CpqBundleSlot.prototype, "name", 2);
247
+ __decorateClass([
248
+ Property({ type: "text", nullable: true })
249
+ ], CpqBundleSlot.prototype, "description", 2);
250
+ __decorateClass([
251
+ Property({ name: "cardinality_min", type: "integer", default: 0 })
252
+ ], CpqBundleSlot.prototype, "cardinalityMin", 2);
253
+ __decorateClass([
254
+ Property({ name: "cardinality_max", type: "integer", nullable: true })
255
+ ], CpqBundleSlot.prototype, "cardinalityMax", 2);
256
+ __decorateClass([
257
+ Property({ name: "sort_order", type: "integer", default: 0 })
258
+ ], CpqBundleSlot.prototype, "sortOrder", 2);
259
+ __decorateClass([
260
+ Property({ name: "is_active", type: "boolean", default: true })
261
+ ], CpqBundleSlot.prototype, "isActive", 2);
262
+ __decorateClass([
263
+ Property({ type: "jsonb", nullable: true })
264
+ ], CpqBundleSlot.prototype, "metadata", 2);
265
+ __decorateClass([
266
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
267
+ ], CpqBundleSlot.prototype, "createdAt", 2);
268
+ __decorateClass([
269
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
270
+ ], CpqBundleSlot.prototype, "updatedAt", 2);
271
+ __decorateClass([
272
+ Property({ name: "deleted_at", type: Date, nullable: true })
273
+ ], CpqBundleSlot.prototype, "deletedAt", 2);
274
+ CpqBundleSlot = __decorateClass([
275
+ Entity({ tableName: "cpq_bundle_slots" }),
276
+ Index({ name: "cpq_bundle_slot_spec_idx", properties: ["organizationId", "tenantId", "specId"] }),
277
+ Index({ name: "cpq_bundle_slot_target_idx", properties: ["organizationId", "tenantId", "targetSpecId"] }),
278
+ Index({ name: "cpq_bundle_slot_group_idx", properties: ["organizationId", "tenantId", "specId", "componentGroup"] })
279
+ ], CpqBundleSlot);
280
+ OptionalProps;
281
+ let CpqOfferingComponent = class {
282
+ constructor() {
283
+ this.isDefault = false;
284
+ this.sortOrder = 0;
285
+ this.isActive = true;
286
+ this.createdAt = /* @__PURE__ */ new Date();
287
+ this.updatedAt = /* @__PURE__ */ new Date();
288
+ }
289
+ };
290
+ __decorateClass([
291
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
292
+ ], CpqOfferingComponent.prototype, "id", 2);
293
+ __decorateClass([
294
+ Property({ name: "organization_id", type: "uuid" })
295
+ ], CpqOfferingComponent.prototype, "organizationId", 2);
296
+ __decorateClass([
297
+ Property({ name: "tenant_id", type: "uuid" })
298
+ ], CpqOfferingComponent.prototype, "tenantId", 2);
299
+ __decorateClass([
300
+ Property({ name: "offering_id", type: "uuid" })
301
+ ], CpqOfferingComponent.prototype, "offeringId", 2);
302
+ __decorateClass([
303
+ Property({ name: "slot_id", type: "uuid" })
304
+ ], CpqOfferingComponent.prototype, "slotId", 2);
305
+ __decorateClass([
306
+ Property({ name: "child_offering_id", type: "uuid" })
307
+ ], CpqOfferingComponent.prototype, "childOfferingId", 2);
308
+ __decorateClass([
309
+ Property({ name: "is_default", type: "boolean", default: false })
310
+ ], CpqOfferingComponent.prototype, "isDefault", 2);
311
+ __decorateClass([
312
+ Property({ name: "sort_order", type: "integer", default: 0 })
313
+ ], CpqOfferingComponent.prototype, "sortOrder", 2);
314
+ __decorateClass([
315
+ Property({ name: "is_active", type: "boolean", default: true })
316
+ ], CpqOfferingComponent.prototype, "isActive", 2);
317
+ __decorateClass([
318
+ Property({ type: "jsonb", nullable: true })
319
+ ], CpqOfferingComponent.prototype, "metadata", 2);
320
+ __decorateClass([
321
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
322
+ ], CpqOfferingComponent.prototype, "createdAt", 2);
323
+ __decorateClass([
324
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
325
+ ], CpqOfferingComponent.prototype, "updatedAt", 2);
326
+ __decorateClass([
327
+ Property({ name: "deleted_at", type: Date, nullable: true })
328
+ ], CpqOfferingComponent.prototype, "deletedAt", 2);
329
+ CpqOfferingComponent = __decorateClass([
330
+ Entity({ tableName: "cpq_offering_components" }),
331
+ Index({ name: "cpq_off_comp_offering_idx", properties: ["organizationId", "tenantId", "offeringId"] }),
332
+ Index({ name: "cpq_off_comp_slot_idx", properties: ["organizationId", "tenantId", "offeringId", "slotId"] }),
333
+ Index({ name: "cpq_off_comp_child_idx", properties: ["organizationId", "tenantId", "childOfferingId"] }),
334
+ Unique({ name: "cpq_off_comp_unique", properties: ["organizationId", "tenantId", "offeringId", "childOfferingId"] })
335
+ ], CpqOfferingComponent);
336
+ OptionalProps;
337
+ let CpqProductAttribute = class {
338
+ constructor() {
339
+ this.resolutionTime = "run_time";
340
+ this.sortOrder = 0;
341
+ this.isRequired = true;
342
+ this.isActive = true;
343
+ this.createdAt = /* @__PURE__ */ new Date();
344
+ this.updatedAt = /* @__PURE__ */ new Date();
345
+ }
346
+ };
347
+ __decorateClass([
348
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
349
+ ], CpqProductAttribute.prototype, "id", 2);
350
+ __decorateClass([
351
+ Property({ name: "organization_id", type: "uuid" })
352
+ ], CpqProductAttribute.prototype, "organizationId", 2);
353
+ __decorateClass([
354
+ Property({ name: "tenant_id", type: "uuid" })
355
+ ], CpqProductAttribute.prototype, "tenantId", 2);
356
+ __decorateClass([
357
+ Property({ name: "product_id", type: "uuid" })
358
+ ], CpqProductAttribute.prototype, "productId", 2);
359
+ __decorateClass([
360
+ Property({ name: "spec_id", type: "uuid", nullable: true })
361
+ ], CpqProductAttribute.prototype, "specId", 2);
362
+ __decorateClass([
363
+ Property({ type: "text" })
364
+ ], CpqProductAttribute.prototype, "code", 2);
365
+ __decorateClass([
366
+ Property({ type: "text" })
367
+ ], CpqProductAttribute.prototype, "name", 2);
368
+ __decorateClass([
369
+ Property({ name: "attribute_type", type: "text" })
370
+ ], CpqProductAttribute.prototype, "attributeType", 2);
371
+ __decorateClass([
372
+ Property({ name: "resolution_time", type: "text", default: "run_time" })
373
+ ], CpqProductAttribute.prototype, "resolutionTime", 2);
374
+ __decorateClass([
375
+ Property({ type: "jsonb", nullable: true })
376
+ ], CpqProductAttribute.prototype, "options", 2);
377
+ __decorateClass([
378
+ Property({ type: "jsonb", nullable: true })
379
+ ], CpqProductAttribute.prototype, "constraints", 2);
380
+ __decorateClass([
381
+ Property({ name: "reference_entity", type: "text", nullable: true })
382
+ ], CpqProductAttribute.prototype, "referenceEntity", 2);
383
+ __decorateClass([
384
+ Property({ name: "reference_filter", type: "jsonb", nullable: true })
385
+ ], CpqProductAttribute.prototype, "referenceFilter", 2);
386
+ __decorateClass([
387
+ Property({ name: "depends_on", type: "jsonb", nullable: true })
388
+ ], CpqProductAttribute.prototype, "dependsOn", 2);
389
+ __decorateClass([
390
+ Property({ name: "default_value", type: "jsonb", nullable: true })
391
+ ], CpqProductAttribute.prototype, "defaultValue", 2);
392
+ __decorateClass([
393
+ Property({ name: "help_text", type: "text", nullable: true })
394
+ ], CpqProductAttribute.prototype, "helpText", 2);
395
+ __decorateClass([
396
+ Property({ name: "sort_order", type: "integer", default: 0 })
397
+ ], CpqProductAttribute.prototype, "sortOrder", 2);
398
+ __decorateClass([
399
+ Property({ name: "is_required", type: "boolean", default: true })
400
+ ], CpqProductAttribute.prototype, "isRequired", 2);
401
+ __decorateClass([
402
+ Property({ name: "is_active", type: "boolean", default: true })
403
+ ], CpqProductAttribute.prototype, "isActive", 2);
404
+ __decorateClass([
405
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
406
+ ], CpqProductAttribute.prototype, "createdAt", 2);
407
+ __decorateClass([
408
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
409
+ ], CpqProductAttribute.prototype, "updatedAt", 2);
410
+ __decorateClass([
411
+ Property({ name: "deleted_at", type: Date, nullable: true })
412
+ ], CpqProductAttribute.prototype, "deletedAt", 2);
413
+ CpqProductAttribute = __decorateClass([
414
+ Entity({ tableName: "cpq_product_attributes" }),
415
+ Index({ name: "cpq_product_attributes_scope_idx", properties: ["organizationId", "tenantId", "productId"] }),
416
+ Index({ name: "cpq_product_attributes_spec_idx", properties: ["organizationId", "tenantId", "specId"] }),
417
+ Index({ name: "cpq_product_attributes_spec_resolution_idx", properties: ["organizationId", "tenantId", "specId", "resolutionTime"] }),
418
+ Unique({
419
+ name: "cpq_product_attributes_code_unique",
420
+ properties: ["organizationId", "tenantId", "productId", "code"]
421
+ })
422
+ ], CpqProductAttribute);
423
+ OptionalProps;
424
+ let CpqPricingTable = class {
425
+ constructor() {
426
+ this.isActive = true;
427
+ this.createdAt = /* @__PURE__ */ new Date();
428
+ this.updatedAt = /* @__PURE__ */ new Date();
429
+ }
430
+ };
431
+ __decorateClass([
432
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
433
+ ], CpqPricingTable.prototype, "id", 2);
434
+ __decorateClass([
435
+ Property({ name: "organization_id", type: "uuid" })
436
+ ], CpqPricingTable.prototype, "organizationId", 2);
437
+ __decorateClass([
438
+ Property({ name: "tenant_id", type: "uuid" })
439
+ ], CpqPricingTable.prototype, "tenantId", 2);
440
+ __decorateClass([
441
+ Property({ type: "text" })
442
+ ], CpqPricingTable.prototype, "code", 2);
443
+ __decorateClass([
444
+ Property({ type: "text" })
445
+ ], CpqPricingTable.prototype, "name", 2);
446
+ __decorateClass([
447
+ Property({ type: "jsonb" })
448
+ ], CpqPricingTable.prototype, "dimensions", 2);
449
+ __decorateClass([
450
+ Property({ name: "price_columns", type: "jsonb" })
451
+ ], CpqPricingTable.prototype, "priceColumns", 2);
452
+ __decorateClass([
453
+ Property({ name: "currency_code_list", type: "jsonb" })
454
+ ], CpqPricingTable.prototype, "currencyCodeList", 2);
455
+ __decorateClass([
456
+ Property({ name: "is_active", type: "boolean", default: true })
457
+ ], CpqPricingTable.prototype, "isActive", 2);
458
+ __decorateClass([
459
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
460
+ ], CpqPricingTable.prototype, "createdAt", 2);
461
+ __decorateClass([
462
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
463
+ ], CpqPricingTable.prototype, "updatedAt", 2);
464
+ __decorateClass([
465
+ Property({ name: "deleted_at", type: Date, nullable: true })
466
+ ], CpqPricingTable.prototype, "deletedAt", 2);
467
+ CpqPricingTable = __decorateClass([
468
+ Entity({ tableName: "cpq_pricing_tables" }),
469
+ Index({ name: "cpq_pricing_tables_scope_idx", properties: ["organizationId", "tenantId"] }),
470
+ Unique({ name: "cpq_pricing_tables_code_unique", properties: ["organizationId", "tenantId", "code"] })
471
+ ], CpqPricingTable);
472
+ OptionalProps;
473
+ let CpqPricingTableEntry = class {
474
+ constructor() {
475
+ this.currencyCode = "USD";
476
+ this.isActive = true;
477
+ this.createdAt = /* @__PURE__ */ new Date();
478
+ this.updatedAt = /* @__PURE__ */ new Date();
479
+ }
480
+ };
481
+ __decorateClass([
482
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
483
+ ], CpqPricingTableEntry.prototype, "id", 2);
484
+ __decorateClass([
485
+ Property({ name: "organization_id", type: "uuid" })
486
+ ], CpqPricingTableEntry.prototype, "organizationId", 2);
487
+ __decorateClass([
488
+ Property({ name: "tenant_id", type: "uuid" })
489
+ ], CpqPricingTableEntry.prototype, "tenantId", 2);
490
+ __decorateClass([
491
+ Property({ name: "pricing_table_id", type: "uuid" })
492
+ ], CpqPricingTableEntry.prototype, "pricingTableId", 2);
493
+ __decorateClass([
494
+ Property({ name: "dimension_values", type: "jsonb" })
495
+ ], CpqPricingTableEntry.prototype, "dimensionValues", 2);
496
+ __decorateClass([
497
+ Property({ name: "tier_number", type: "integer", nullable: true })
498
+ ], CpqPricingTableEntry.prototype, "tierNumber", 2);
499
+ __decorateClass([
500
+ Property({ name: "range_from", type: "numeric", nullable: true })
501
+ ], CpqPricingTableEntry.prototype, "rangeFrom", 2);
502
+ __decorateClass([
503
+ Property({ name: "range_to", type: "numeric", nullable: true })
504
+ ], CpqPricingTableEntry.prototype, "rangeTo", 2);
505
+ __decorateClass([
506
+ Property({ name: "currency_code", type: "text", default: "USD" })
507
+ ], CpqPricingTableEntry.prototype, "currencyCode", 2);
508
+ __decorateClass([
509
+ Property({ type: "jsonb" })
510
+ ], CpqPricingTableEntry.prototype, "prices", 2);
511
+ __decorateClass([
512
+ Property({ name: "is_active", type: "boolean", default: true })
513
+ ], CpqPricingTableEntry.prototype, "isActive", 2);
514
+ __decorateClass([
515
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
516
+ ], CpqPricingTableEntry.prototype, "createdAt", 2);
517
+ __decorateClass([
518
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
519
+ ], CpqPricingTableEntry.prototype, "updatedAt", 2);
520
+ __decorateClass([
521
+ Property({ name: "deleted_at", type: Date, nullable: true })
522
+ ], CpqPricingTableEntry.prototype, "deletedAt", 2);
523
+ CpqPricingTableEntry = __decorateClass([
524
+ Entity({ tableName: "cpq_pricing_table_entries" }),
525
+ Index({ name: "cpq_pricing_table_entries_scope_idx", properties: ["organizationId", "tenantId", "pricingTableId"] }),
526
+ Index({ name: "cpq_pricing_table_entries_dim_gin_idx", properties: ["dimensionValues"], type: "GIN" })
527
+ ], CpqPricingTableEntry);
528
+ OptionalProps;
529
+ let CpqProductCharge = class {
530
+ constructor() {
531
+ this.sortOrder = 0;
532
+ this.isActive = true;
533
+ this.createdAt = /* @__PURE__ */ new Date();
534
+ this.updatedAt = /* @__PURE__ */ new Date();
535
+ }
536
+ };
537
+ __decorateClass([
538
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
539
+ ], CpqProductCharge.prototype, "id", 2);
540
+ __decorateClass([
541
+ Property({ name: "organization_id", type: "uuid" })
542
+ ], CpqProductCharge.prototype, "organizationId", 2);
543
+ __decorateClass([
544
+ Property({ name: "tenant_id", type: "uuid" })
545
+ ], CpqProductCharge.prototype, "tenantId", 2);
546
+ __decorateClass([
547
+ Property({ name: "product_id", type: "uuid" })
548
+ ], CpqProductCharge.prototype, "productId", 2);
549
+ __decorateClass([
550
+ Property({ name: "offering_id", type: "uuid", nullable: true })
551
+ ], CpqProductCharge.prototype, "offeringId", 2);
552
+ __decorateClass([
553
+ Property({ type: "text" })
554
+ ], CpqProductCharge.prototype, "code", 2);
555
+ __decorateClass([
556
+ Property({ type: "text" })
557
+ ], CpqProductCharge.prototype, "name", 2);
558
+ __decorateClass([
559
+ Property({ type: "text", nullable: true })
560
+ ], CpqProductCharge.prototype, "description", 2);
561
+ __decorateClass([
562
+ Property({ name: "charge_type", type: "text" })
563
+ ], CpqProductCharge.prototype, "chargeType", 2);
564
+ __decorateClass([
565
+ Property({ name: "pricing_method", type: "text" })
566
+ ], CpqProductCharge.prototype, "pricingMethod", 2);
567
+ __decorateClass([
568
+ Property({ name: "pricing_table_id", type: "uuid", nullable: true })
569
+ ], CpqProductCharge.prototype, "pricingTableId", 2);
570
+ __decorateClass([
571
+ Property({ name: "price_column_key", type: "text", nullable: true })
572
+ ], CpqProductCharge.prototype, "priceColumnKey", 2);
573
+ __decorateClass([
574
+ Property({ name: "fixed_price", type: "numeric", nullable: true })
575
+ ], CpqProductCharge.prototype, "fixedPrice", 2);
576
+ __decorateClass([
577
+ Property({ name: "currency_code", type: "text", nullable: true })
578
+ ], CpqProductCharge.prototype, "currencyCode", 2);
579
+ __decorateClass([
580
+ Property({ name: "quantity_attribute_code", type: "text", nullable: true })
581
+ ], CpqProductCharge.prototype, "quantityAttributeCode", 2);
582
+ __decorateClass([
583
+ Property({ name: "applicability_condition", type: "jsonb", nullable: true })
584
+ ], CpqProductCharge.prototype, "applicabilityCondition", 2);
585
+ __decorateClass([
586
+ Property({ name: "sort_order", type: "integer", default: 0 })
587
+ ], CpqProductCharge.prototype, "sortOrder", 2);
588
+ __decorateClass([
589
+ Property({ name: "is_active", type: "boolean", default: true })
590
+ ], CpqProductCharge.prototype, "isActive", 2);
591
+ __decorateClass([
592
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
593
+ ], CpqProductCharge.prototype, "createdAt", 2);
594
+ __decorateClass([
595
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
596
+ ], CpqProductCharge.prototype, "updatedAt", 2);
597
+ __decorateClass([
598
+ Property({ name: "deleted_at", type: Date, nullable: true })
599
+ ], CpqProductCharge.prototype, "deletedAt", 2);
600
+ CpqProductCharge = __decorateClass([
601
+ Entity({ tableName: "cpq_product_charges" }),
602
+ Index({ name: "cpq_product_charges_scope_idx", properties: ["organizationId", "tenantId", "productId"] }),
603
+ Index({ name: "cpq_product_charges_offering_idx", properties: ["organizationId", "tenantId", "offeringId"] }),
604
+ Unique({
605
+ name: "cpq_product_charges_offering_code_unique",
606
+ properties: ["organizationId", "tenantId", "offeringId", "code"]
607
+ })
608
+ ], CpqProductCharge);
609
+ OptionalProps;
610
+ let CpqPriceRule = class {
611
+ constructor() {
612
+ this.sortOrder = 0;
613
+ this.isActive = true;
614
+ this.createdAt = /* @__PURE__ */ new Date();
615
+ this.updatedAt = /* @__PURE__ */ new Date();
616
+ }
617
+ };
618
+ __decorateClass([
619
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
620
+ ], CpqPriceRule.prototype, "id", 2);
621
+ __decorateClass([
622
+ Property({ name: "organization_id", type: "uuid" })
623
+ ], CpqPriceRule.prototype, "organizationId", 2);
624
+ __decorateClass([
625
+ Property({ name: "tenant_id", type: "uuid" })
626
+ ], CpqPriceRule.prototype, "tenantId", 2);
627
+ __decorateClass([
628
+ Property({ type: "text" })
629
+ ], CpqPriceRule.prototype, "code", 2);
630
+ __decorateClass([
631
+ Property({ type: "text" })
632
+ ], CpqPriceRule.prototype, "name", 2);
633
+ __decorateClass([
634
+ Property({ type: "text", nullable: true })
635
+ ], CpqPriceRule.prototype, "description", 2);
636
+ __decorateClass([
637
+ Property({ name: "product_offering_id", type: "uuid", nullable: true })
638
+ ], CpqPriceRule.prototype, "productOfferingId", 2);
639
+ __decorateClass([
640
+ Property({ name: "rule_type", type: "text" })
641
+ ], CpqPriceRule.prototype, "ruleType", 2);
642
+ __decorateClass([
643
+ Property({ type: "numeric" })
644
+ ], CpqPriceRule.prototype, "value", 2);
645
+ __decorateClass([
646
+ Property({ name: "charge_code_filter", type: "text", nullable: true })
647
+ ], CpqPriceRule.prototype, "chargeCodeFilter", 2);
648
+ __decorateClass([
649
+ Property({ name: "charge_type_filter", type: "text", nullable: true })
650
+ ], CpqPriceRule.prototype, "chargeTypeFilter", 2);
651
+ __decorateClass([
652
+ Property({ name: "applicability_condition", type: "jsonb", nullable: true })
653
+ ], CpqPriceRule.prototype, "applicabilityCondition", 2);
654
+ __decorateClass([
655
+ Property({ name: "sort_order", type: "integer", default: 0 })
656
+ ], CpqPriceRule.prototype, "sortOrder", 2);
657
+ __decorateClass([
658
+ Property({ name: "is_active", type: "boolean", default: true })
659
+ ], CpqPriceRule.prototype, "isActive", 2);
660
+ __decorateClass([
661
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
662
+ ], CpqPriceRule.prototype, "createdAt", 2);
663
+ __decorateClass([
664
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
665
+ ], CpqPriceRule.prototype, "updatedAt", 2);
666
+ __decorateClass([
667
+ Property({ name: "deleted_at", type: Date, nullable: true })
668
+ ], CpqPriceRule.prototype, "deletedAt", 2);
669
+ CpqPriceRule = __decorateClass([
670
+ Entity({ tableName: "cpq_price_rules" }),
671
+ Index({ name: "cpq_price_rules_scope_idx", properties: ["organizationId", "tenantId"] }),
672
+ Unique({ name: "cpq_price_rules_code_unique", properties: ["organizationId", "tenantId", "code"] }),
673
+ Index({ name: "cpq_price_rules_product_idx", properties: ["organizationId", "tenantId", "productOfferingId"] })
674
+ ], CpqPriceRule);
675
+ OptionalProps;
676
+ let CpqQuoteConfiguration = class {
677
+ constructor() {
678
+ this.cpqStatus = "new";
679
+ this.version = 1;
680
+ this.currencyCode = "USD";
681
+ this.quoteType = "new";
682
+ this.createdAt = /* @__PURE__ */ new Date();
683
+ this.updatedAt = /* @__PURE__ */ new Date();
684
+ }
685
+ };
686
+ __decorateClass([
687
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
688
+ ], CpqQuoteConfiguration.prototype, "id", 2);
689
+ __decorateClass([
690
+ Property({ name: "organization_id", type: "uuid" })
691
+ ], CpqQuoteConfiguration.prototype, "organizationId", 2);
692
+ __decorateClass([
693
+ Property({ name: "tenant_id", type: "uuid" })
694
+ ], CpqQuoteConfiguration.prototype, "tenantId", 2);
695
+ __decorateClass([
696
+ Property({ name: "quote_id", type: "uuid" })
697
+ ], CpqQuoteConfiguration.prototype, "quoteId", 2);
698
+ __decorateClass([
699
+ Property({ name: "customer_id", type: "uuid" })
700
+ ], CpqQuoteConfiguration.prototype, "customerId", 2);
701
+ __decorateClass([
702
+ Property({ name: "cpq_status", type: "text", default: "new" })
703
+ ], CpqQuoteConfiguration.prototype, "cpqStatus", 2);
704
+ __decorateClass([
705
+ Property({ type: "integer", default: 1 })
706
+ ], CpqQuoteConfiguration.prototype, "version", 2);
707
+ __decorateClass([
708
+ Property({ name: "parent_quote_id", type: "uuid", nullable: true })
709
+ ], CpqQuoteConfiguration.prototype, "parentQuoteId", 2);
710
+ __decorateClass([
711
+ Property({ name: "currency_code", type: "text", default: "USD" })
712
+ ], CpqQuoteConfiguration.prototype, "currencyCode", 2);
713
+ __decorateClass([
714
+ Property({ name: "quote_context", type: "jsonb", nullable: true })
715
+ ], CpqQuoteConfiguration.prototype, "quoteContext", 2);
716
+ __decorateClass([
717
+ Property({ name: "validation_result", type: "jsonb", nullable: true })
718
+ ], CpqQuoteConfiguration.prototype, "validationResult", 2);
719
+ __decorateClass([
720
+ Property({ name: "pricing_summary", type: "jsonb", nullable: true })
721
+ ], CpqQuoteConfiguration.prototype, "pricingSummary", 2);
722
+ __decorateClass([
723
+ Property({ name: "quote_type", type: "text", default: "new" })
724
+ ], CpqQuoteConfiguration.prototype, "quoteType", 2);
725
+ __decorateClass([
726
+ Property({ name: "arc_reason_code", type: "text", nullable: true })
727
+ ], CpqQuoteConfiguration.prototype, "arcReasonCode", 2);
728
+ __decorateClass([
729
+ Property({ name: "arc_reason_text", type: "text", nullable: true })
730
+ ], CpqQuoteConfiguration.prototype, "arcReasonText", 2);
731
+ __decorateClass([
732
+ Property({ name: "arc_etf_amount", type: "numeric", columnType: "numeric(18, 4)", nullable: true })
733
+ ], CpqQuoteConfiguration.prototype, "arcEtfAmount", 2);
734
+ __decorateClass([
735
+ Property({ name: "arc_etf_currency", type: "text", nullable: true })
736
+ ], CpqQuoteConfiguration.prototype, "arcEtfCurrency", 2);
737
+ __decorateClass([
738
+ Property({ name: "arc_merge_new_term_start", type: "date", nullable: true })
739
+ ], CpqQuoteConfiguration.prototype, "arcMergeNewTermStart", 2);
740
+ __decorateClass([
741
+ Property({ name: "arc_merge_new_term_end", type: "date", nullable: true })
742
+ ], CpqQuoteConfiguration.prototype, "arcMergeNewTermEnd", 2);
743
+ __decorateClass([
744
+ Property({ name: "arc_merge_new_term_months", type: "integer", nullable: true })
745
+ ], CpqQuoteConfiguration.prototype, "arcMergeNewTermMonths", 2);
746
+ __decorateClass([
747
+ Property({ name: "arc_merge_new_sub_code", type: "text", nullable: true })
748
+ ], CpqQuoteConfiguration.prototype, "arcMergeNewSubCode", 2);
749
+ __decorateClass([
750
+ Property({ name: "arc_merge_new_sub_name", type: "text", nullable: true })
751
+ ], CpqQuoteConfiguration.prototype, "arcMergeNewSubName", 2);
752
+ __decorateClass([
753
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
754
+ ], CpqQuoteConfiguration.prototype, "createdAt", 2);
755
+ __decorateClass([
756
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
757
+ ], CpqQuoteConfiguration.prototype, "updatedAt", 2);
758
+ __decorateClass([
759
+ Property({ name: "deleted_at", type: Date, nullable: true })
760
+ ], CpqQuoteConfiguration.prototype, "deletedAt", 2);
761
+ CpqQuoteConfiguration = __decorateClass([
762
+ Entity({ tableName: "cpq_quote_configurations" }),
763
+ Unique({ name: "cpq_quote_configurations_quote_unique", properties: ["organizationId", "tenantId", "quoteId"] }),
764
+ Index({ name: "cpq_quote_configurations_quote_type_idx", properties: ["organizationId", "tenantId", "quoteType"] })
765
+ ], CpqQuoteConfiguration);
766
+ OptionalProps;
767
+ let CpqWizardDefinition = class {
768
+ constructor() {
769
+ this.version = 1;
770
+ this.surface = "backend";
771
+ this.isActive = true;
772
+ this.createdAt = /* @__PURE__ */ new Date();
773
+ this.updatedAt = /* @__PURE__ */ new Date();
774
+ }
775
+ };
776
+ __decorateClass([
777
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
778
+ ], CpqWizardDefinition.prototype, "id", 2);
779
+ __decorateClass([
780
+ Property({ name: "organization_id", type: "uuid" })
781
+ ], CpqWizardDefinition.prototype, "organizationId", 2);
782
+ __decorateClass([
783
+ Property({ name: "tenant_id", type: "uuid" })
784
+ ], CpqWizardDefinition.prototype, "tenantId", 2);
785
+ __decorateClass([
786
+ Property({ type: "text" })
787
+ ], CpqWizardDefinition.prototype, "code", 2);
788
+ __decorateClass([
789
+ Property({ type: "text" })
790
+ ], CpqWizardDefinition.prototype, "name", 2);
791
+ __decorateClass([
792
+ Property({ type: "text", nullable: true })
793
+ ], CpqWizardDefinition.prototype, "description", 2);
794
+ __decorateClass([
795
+ Property({ type: "integer", default: 1 })
796
+ ], CpqWizardDefinition.prototype, "version", 2);
797
+ __decorateClass([
798
+ Property({ type: "jsonb", default: "[]" })
799
+ ], CpqWizardDefinition.prototype, "steps", 2);
800
+ __decorateClass([
801
+ Property({ type: "jsonb", nullable: true })
802
+ ], CpqWizardDefinition.prototype, "applicability", 2);
803
+ __decorateClass([
804
+ Property({ name: "params_schema", type: "jsonb", nullable: true })
805
+ ], CpqWizardDefinition.prototype, "paramsSchema", 2);
806
+ __decorateClass([
807
+ Property({ type: "text", default: "backend" })
808
+ ], CpqWizardDefinition.prototype, "surface", 2);
809
+ __decorateClass([
810
+ Property({ name: "is_active", type: "boolean", default: true })
811
+ ], CpqWizardDefinition.prototype, "isActive", 2);
812
+ __decorateClass([
813
+ Property({ type: "jsonb", nullable: true })
814
+ ], CpqWizardDefinition.prototype, "metadata", 2);
815
+ __decorateClass([
816
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
817
+ ], CpqWizardDefinition.prototype, "createdAt", 2);
818
+ __decorateClass([
819
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
820
+ ], CpqWizardDefinition.prototype, "updatedAt", 2);
821
+ __decorateClass([
822
+ Property({ name: "deleted_at", type: Date, nullable: true })
823
+ ], CpqWizardDefinition.prototype, "deletedAt", 2);
824
+ CpqWizardDefinition = __decorateClass([
825
+ Entity({ tableName: "cpq_wizard_definitions" }),
826
+ Unique({ name: "cpq_wizard_definitions_code_unique", properties: ["organizationId", "tenantId", "code"] }),
827
+ Index({ name: "cpq_wizard_definitions_active_idx", properties: ["organizationId", "tenantId", "isActive"] }),
828
+ Index({ name: "cpq_wizard_definitions_surface_idx", properties: ["organizationId", "tenantId", "surface"] })
829
+ ], CpqWizardDefinition);
830
+ OptionalProps;
831
+ let CpqQuoteLineConfiguration = class {
832
+ constructor() {
833
+ this.action = "add";
834
+ this.configuration = {};
835
+ this.quantity = 1;
836
+ this.nrcTotal = "0";
837
+ this.mrcTotal = "0";
838
+ this.isConfigured = false;
839
+ this.createdAt = /* @__PURE__ */ new Date();
840
+ this.updatedAt = /* @__PURE__ */ new Date();
841
+ }
842
+ };
843
+ __decorateClass([
844
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
845
+ ], CpqQuoteLineConfiguration.prototype, "id", 2);
846
+ __decorateClass([
847
+ Property({ name: "organization_id", type: "uuid" })
848
+ ], CpqQuoteLineConfiguration.prototype, "organizationId", 2);
849
+ __decorateClass([
850
+ Property({ name: "tenant_id", type: "uuid" })
851
+ ], CpqQuoteLineConfiguration.prototype, "tenantId", 2);
852
+ __decorateClass([
853
+ Property({ name: "quote_line_id", type: "uuid" })
854
+ ], CpqQuoteLineConfiguration.prototype, "quoteLineId", 2);
855
+ __decorateClass([
856
+ Property({ name: "quote_configuration_id", type: "uuid" })
857
+ ], CpqQuoteLineConfiguration.prototype, "quoteConfigurationId", 2);
858
+ __decorateClass([
859
+ Property({ name: "offering_id", type: "uuid", nullable: true })
860
+ ], CpqQuoteLineConfiguration.prototype, "offeringId", 2);
861
+ __decorateClass([
862
+ Property({ name: "product_id", type: "uuid", nullable: true })
863
+ ], CpqQuoteLineConfiguration.prototype, "productId", 2);
864
+ __decorateClass([
865
+ Property({ name: "spec_id", type: "uuid", nullable: true })
866
+ ], CpqQuoteLineConfiguration.prototype, "specId", 2);
867
+ __decorateClass([
868
+ Property({ type: "text", default: "add" })
869
+ ], CpqQuoteLineConfiguration.prototype, "action", 2);
870
+ __decorateClass([
871
+ Property({ name: "parent_line_id", type: "uuid", nullable: true })
872
+ ], CpqQuoteLineConfiguration.prototype, "parentLineId", 2);
873
+ __decorateClass([
874
+ Property({ name: "start_date", type: "date", nullable: true })
875
+ ], CpqQuoteLineConfiguration.prototype, "startDate", 2);
876
+ __decorateClass([
877
+ Property({ name: "term_months", type: "integer", nullable: true })
878
+ ], CpqQuoteLineConfiguration.prototype, "termMonths", 2);
879
+ __decorateClass([
880
+ Property({ name: "end_date", type: "date", nullable: true })
881
+ ], CpqQuoteLineConfiguration.prototype, "endDate", 2);
882
+ __decorateClass([
883
+ Property({ type: "jsonb", default: "{}" })
884
+ ], CpqQuoteLineConfiguration.prototype, "configuration", 2);
885
+ __decorateClass([
886
+ Property({ type: "integer", default: 1 })
887
+ ], CpqQuoteLineConfiguration.prototype, "quantity", 2);
888
+ __decorateClass([
889
+ Property({ type: "jsonb", nullable: true })
890
+ ], CpqQuoteLineConfiguration.prototype, "charges", 2);
891
+ __decorateClass([
892
+ Property({ name: "nrc_total", columnType: "numeric(18, 4)", default: 0 })
893
+ ], CpqQuoteLineConfiguration.prototype, "nrcTotal", 2);
894
+ __decorateClass([
895
+ Property({ name: "mrc_total", columnType: "numeric(18, 4)", default: 0 })
896
+ ], CpqQuoteLineConfiguration.prototype, "mrcTotal", 2);
897
+ __decorateClass([
898
+ Property({ name: "usage_estimates", type: "jsonb", nullable: true })
899
+ ], CpqQuoteLineConfiguration.prototype, "usageEstimates", 2);
900
+ __decorateClass([
901
+ Property({ name: "usage_total_estimated", type: "numeric", columnType: "numeric(18, 4)", nullable: true })
902
+ ], CpqQuoteLineConfiguration.prototype, "usageTotalEstimated", 2);
903
+ __decorateClass([
904
+ Property({ name: "validation_errors", type: "jsonb", nullable: true })
905
+ ], CpqQuoteLineConfiguration.prototype, "validationErrors", 2);
906
+ __decorateClass([
907
+ Property({ name: "is_configured", type: "boolean", default: false })
908
+ ], CpqQuoteLineConfiguration.prototype, "isConfigured", 2);
909
+ __decorateClass([
910
+ Property({ name: "target_subscription_id", type: "uuid", nullable: true })
911
+ ], CpqQuoteLineConfiguration.prototype, "targetSubscriptionId", 2);
912
+ __decorateClass([
913
+ Property({ name: "source_subscription_item_id", type: "uuid", nullable: true })
914
+ ], CpqQuoteLineConfiguration.prototype, "sourceSubscriptionItemId", 2);
915
+ __decorateClass([
916
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
917
+ ], CpqQuoteLineConfiguration.prototype, "createdAt", 2);
918
+ __decorateClass([
919
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
920
+ ], CpqQuoteLineConfiguration.prototype, "updatedAt", 2);
921
+ __decorateClass([
922
+ Property({ name: "deleted_at", type: Date, nullable: true })
923
+ ], CpqQuoteLineConfiguration.prototype, "deletedAt", 2);
924
+ CpqQuoteLineConfiguration = __decorateClass([
925
+ Entity({ tableName: "cpq_quote_line_configurations" }),
926
+ Unique({ name: "cpq_qlc_quote_line_unique", properties: ["organizationId", "tenantId", "quoteLineId"] }),
927
+ Index({ name: "cpq_qlc_quote_config_idx", properties: ["organizationId", "tenantId", "quoteConfigurationId"] }),
928
+ Index({ name: "cpq_qlc_parent_line_idx", properties: ["organizationId", "tenantId", "parentLineId"] }),
929
+ Index({ name: "cpq_qlc_target_sub_idx", properties: ["organizationId", "tenantId", "targetSubscriptionId"] })
930
+ ], CpqQuoteLineConfiguration);
931
+ OptionalProps;
932
+ let CpqInventorySubscription = class {
933
+ constructor() {
934
+ this.status = "pending";
935
+ this.billingCycle = "monthly";
936
+ this.currencyCode = "USD";
937
+ this.mrcAmount = "0";
938
+ this.nrcAmount = "0";
939
+ this.autoRenew = true;
940
+ this.version = 1;
941
+ this.createdAt = /* @__PURE__ */ new Date();
942
+ this.updatedAt = /* @__PURE__ */ new Date();
943
+ }
944
+ };
945
+ __decorateClass([
946
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
947
+ ], CpqInventorySubscription.prototype, "id", 2);
948
+ __decorateClass([
949
+ Property({ name: "organization_id", type: "uuid" })
950
+ ], CpqInventorySubscription.prototype, "organizationId", 2);
951
+ __decorateClass([
952
+ Property({ name: "tenant_id", type: "uuid" })
953
+ ], CpqInventorySubscription.prototype, "tenantId", 2);
954
+ __decorateClass([
955
+ Property({ name: "customer_id", type: "uuid" })
956
+ ], CpqInventorySubscription.prototype, "customerId", 2);
957
+ __decorateClass([
958
+ Property({ type: "text" })
959
+ ], CpqInventorySubscription.prototype, "code", 2);
960
+ __decorateClass([
961
+ Property({ type: "text" })
962
+ ], CpqInventorySubscription.prototype, "name", 2);
963
+ __decorateClass([
964
+ Property({ type: "text", nullable: true })
965
+ ], CpqInventorySubscription.prototype, "description", 2);
966
+ __decorateClass([
967
+ Property({ type: "text", default: "pending" })
968
+ ], CpqInventorySubscription.prototype, "status", 2);
969
+ __decorateClass([
970
+ Property({ name: "billing_cycle", type: "text", default: "monthly" })
971
+ ], CpqInventorySubscription.prototype, "billingCycle", 2);
972
+ __decorateClass([
973
+ Property({ name: "currency_code", type: "text", default: "USD" })
974
+ ], CpqInventorySubscription.prototype, "currencyCode", 2);
975
+ __decorateClass([
976
+ Property({ name: "mrc_amount", columnType: "numeric(18, 4)", default: 0 })
977
+ ], CpqInventorySubscription.prototype, "mrcAmount", 2);
978
+ __decorateClass([
979
+ Property({ name: "nrc_amount", columnType: "numeric(18, 4)", default: 0 })
980
+ ], CpqInventorySubscription.prototype, "nrcAmount", 2);
981
+ __decorateClass([
982
+ Property({ name: "start_date", type: "date", nullable: true })
983
+ ], CpqInventorySubscription.prototype, "startDate", 2);
984
+ __decorateClass([
985
+ Property({ name: "current_term_start", type: "date", nullable: true })
986
+ ], CpqInventorySubscription.prototype, "currentTermStart", 2);
987
+ __decorateClass([
988
+ Property({ name: "current_term_end", type: "date", nullable: true })
989
+ ], CpqInventorySubscription.prototype, "currentTermEnd", 2);
990
+ __decorateClass([
991
+ Property({ name: "term_months", type: "integer", nullable: true })
992
+ ], CpqInventorySubscription.prototype, "termMonths", 2);
993
+ __decorateClass([
994
+ Property({ name: "auto_renew", type: "boolean", default: true })
995
+ ], CpqInventorySubscription.prototype, "autoRenew", 2);
996
+ __decorateClass([
997
+ Property({ name: "activated_at", type: Date, nullable: true })
998
+ ], CpqInventorySubscription.prototype, "activatedAt", 2);
999
+ __decorateClass([
1000
+ Property({ name: "suspended_at", type: Date, nullable: true })
1001
+ ], CpqInventorySubscription.prototype, "suspendedAt", 2);
1002
+ __decorateClass([
1003
+ Property({ name: "terminated_at", type: Date, nullable: true })
1004
+ ], CpqInventorySubscription.prototype, "terminatedAt", 2);
1005
+ __decorateClass([
1006
+ Property({ name: "pricing_summary", type: "jsonb", nullable: true })
1007
+ ], CpqInventorySubscription.prototype, "pricingSummary", 2);
1008
+ __decorateClass([
1009
+ Property({ name: "source_quote_id", type: "uuid", nullable: true })
1010
+ ], CpqInventorySubscription.prototype, "sourceQuoteId", 2);
1011
+ __decorateClass([
1012
+ Property({ name: "source_order_id", type: "uuid", nullable: true })
1013
+ ], CpqInventorySubscription.prototype, "sourceOrderId", 2);
1014
+ __decorateClass([
1015
+ Property({ name: "merged_into_subscription_id", type: "uuid", nullable: true })
1016
+ ], CpqInventorySubscription.prototype, "mergedIntoSubscriptionId", 2);
1017
+ __decorateClass([
1018
+ Property({ name: "last_change_log_id", type: "uuid", nullable: true })
1019
+ ], CpqInventorySubscription.prototype, "lastChangeLogId", 2);
1020
+ __decorateClass([
1021
+ Property({ type: "integer", version: true })
1022
+ ], CpqInventorySubscription.prototype, "version", 2);
1023
+ __decorateClass([
1024
+ Property({ type: "jsonb", nullable: true })
1025
+ ], CpqInventorySubscription.prototype, "metadata", 2);
1026
+ __decorateClass([
1027
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1028
+ ], CpqInventorySubscription.prototype, "createdAt", 2);
1029
+ __decorateClass([
1030
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1031
+ ], CpqInventorySubscription.prototype, "updatedAt", 2);
1032
+ __decorateClass([
1033
+ Property({ name: "deleted_at", type: Date, nullable: true })
1034
+ ], CpqInventorySubscription.prototype, "deletedAt", 2);
1035
+ CpqInventorySubscription = __decorateClass([
1036
+ Entity({ tableName: "cpq_inventory_subscriptions" }),
1037
+ Index({ name: "cpq_inventory_subscriptions_scope_idx", properties: ["organizationId", "tenantId"] }),
1038
+ Unique({ name: "cpq_inventory_subscriptions_code_unique", properties: ["organizationId", "tenantId", "code"] }),
1039
+ Index({ name: "cpq_inventory_subscriptions_customer_idx", properties: ["organizationId", "tenantId", "customerId"] }),
1040
+ Index({ name: "cpq_inventory_subscriptions_status_idx", properties: ["organizationId", "tenantId", "status"] }),
1041
+ Index({ name: "cpq_inventory_subscriptions_source_quote_idx", properties: ["organizationId", "tenantId", "sourceQuoteId"] }),
1042
+ Index({ name: "cpq_inventory_subscriptions_term_end_idx", properties: ["organizationId", "tenantId", "currentTermEnd"] }),
1043
+ Index({ name: "cpq_inventory_subscriptions_merged_into_idx", properties: ["organizationId", "tenantId", "mergedIntoSubscriptionId"] })
1044
+ ], CpqInventorySubscription);
1045
+ OptionalProps;
1046
+ let CpqInventorySubscriptionItem = class {
1047
+ constructor() {
1048
+ this.status = "pending";
1049
+ this.configuration = {};
1050
+ this.mrcAmount = "0";
1051
+ this.nrcAmount = "0";
1052
+ this.currencyCode = "USD";
1053
+ this.quantity = 1;
1054
+ this.sortOrder = 0;
1055
+ this.createdAt = /* @__PURE__ */ new Date();
1056
+ this.updatedAt = /* @__PURE__ */ new Date();
1057
+ }
1058
+ };
1059
+ __decorateClass([
1060
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1061
+ ], CpqInventorySubscriptionItem.prototype, "id", 2);
1062
+ __decorateClass([
1063
+ Property({ name: "organization_id", type: "uuid" })
1064
+ ], CpqInventorySubscriptionItem.prototype, "organizationId", 2);
1065
+ __decorateClass([
1066
+ Property({ name: "tenant_id", type: "uuid" })
1067
+ ], CpqInventorySubscriptionItem.prototype, "tenantId", 2);
1068
+ __decorateClass([
1069
+ Property({ name: "subscription_id", type: "uuid" })
1070
+ ], CpqInventorySubscriptionItem.prototype, "subscriptionId", 2);
1071
+ __decorateClass([
1072
+ Property({ name: "customer_id", type: "uuid" })
1073
+ ], CpqInventorySubscriptionItem.prototype, "customerId", 2);
1074
+ __decorateClass([
1075
+ Property({ name: "parent_item_id", type: "uuid", nullable: true })
1076
+ ], CpqInventorySubscriptionItem.prototype, "parentItemId", 2);
1077
+ __decorateClass([
1078
+ Property({ name: "product_id", type: "uuid", nullable: true })
1079
+ ], CpqInventorySubscriptionItem.prototype, "productId", 2);
1080
+ __decorateClass([
1081
+ Property({ name: "offering_id", type: "uuid", nullable: true })
1082
+ ], CpqInventorySubscriptionItem.prototype, "offeringId", 2);
1083
+ __decorateClass([
1084
+ Property({ name: "spec_id", type: "uuid", nullable: true })
1085
+ ], CpqInventorySubscriptionItem.prototype, "specId", 2);
1086
+ __decorateClass([
1087
+ Property({ type: "text" })
1088
+ ], CpqInventorySubscriptionItem.prototype, "name", 2);
1089
+ __decorateClass([
1090
+ Property({ type: "text", default: "pending" })
1091
+ ], CpqInventorySubscriptionItem.prototype, "status", 2);
1092
+ __decorateClass([
1093
+ Property({ type: "jsonb", default: "{}" })
1094
+ ], CpqInventorySubscriptionItem.prototype, "configuration", 2);
1095
+ __decorateClass([
1096
+ Property({ type: "jsonb", nullable: true })
1097
+ ], CpqInventorySubscriptionItem.prototype, "charges", 2);
1098
+ __decorateClass([
1099
+ Property({ name: "mrc_amount", columnType: "numeric(18, 4)", default: 0 })
1100
+ ], CpqInventorySubscriptionItem.prototype, "mrcAmount", 2);
1101
+ __decorateClass([
1102
+ Property({ name: "nrc_amount", columnType: "numeric(18, 4)", default: 0 })
1103
+ ], CpqInventorySubscriptionItem.prototype, "nrcAmount", 2);
1104
+ __decorateClass([
1105
+ Property({ name: "currency_code", type: "text", default: "USD" })
1106
+ ], CpqInventorySubscriptionItem.prototype, "currencyCode", 2);
1107
+ __decorateClass([
1108
+ Property({ type: "integer", default: 1 })
1109
+ ], CpqInventorySubscriptionItem.prototype, "quantity", 2);
1110
+ __decorateClass([
1111
+ Property({ name: "capacity_total", type: "numeric", columnType: "numeric(18, 4)", nullable: true })
1112
+ ], CpqInventorySubscriptionItem.prototype, "capacityTotal", 2);
1113
+ __decorateClass([
1114
+ Property({ name: "capacity_used", type: "numeric", columnType: "numeric(18, 4)", nullable: true })
1115
+ ], CpqInventorySubscriptionItem.prototype, "capacityUsed", 2);
1116
+ __decorateClass([
1117
+ Property({ name: "capacity_unit", type: "text", nullable: true })
1118
+ ], CpqInventorySubscriptionItem.prototype, "capacityUnit", 2);
1119
+ __decorateClass([
1120
+ Property({ name: "source_quote_line_id", type: "uuid", nullable: true })
1121
+ ], CpqInventorySubscriptionItem.prototype, "sourceQuoteLineId", 2);
1122
+ __decorateClass([
1123
+ Property({ type: "jsonb", nullable: true })
1124
+ ], CpqInventorySubscriptionItem.prototype, "metadata", 2);
1125
+ __decorateClass([
1126
+ Property({ name: "sort_order", type: "integer", default: 0 })
1127
+ ], CpqInventorySubscriptionItem.prototype, "sortOrder", 2);
1128
+ __decorateClass([
1129
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1130
+ ], CpqInventorySubscriptionItem.prototype, "createdAt", 2);
1131
+ __decorateClass([
1132
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1133
+ ], CpqInventorySubscriptionItem.prototype, "updatedAt", 2);
1134
+ __decorateClass([
1135
+ Property({ name: "deleted_at", type: Date, nullable: true })
1136
+ ], CpqInventorySubscriptionItem.prototype, "deletedAt", 2);
1137
+ CpqInventorySubscriptionItem = __decorateClass([
1138
+ Entity({ tableName: "cpq_inventory_subscription_items" }),
1139
+ Index({ name: "cpq_inventory_subscription_items_scope_idx", properties: ["organizationId", "tenantId", "subscriptionId"] }),
1140
+ Index({ name: "cpq_inventory_subscription_items_customer_idx", properties: ["organizationId", "tenantId", "customerId"] }),
1141
+ Index({ name: "cpq_inventory_subscription_items_parent_idx", properties: ["organizationId", "tenantId", "parentItemId"] }),
1142
+ Index({ name: "cpq_inventory_subscription_items_status_idx", properties: ["organizationId", "tenantId", "status"] })
1143
+ ], CpqInventorySubscriptionItem);
1144
+ OptionalProps;
1145
+ let CpqInventoryAsset = class {
1146
+ constructor() {
1147
+ this.status = "pending";
1148
+ this.assetType = "one_time";
1149
+ this.currencyCode = "USD";
1150
+ this.purchasePrice = "0";
1151
+ this.quantity = 1;
1152
+ this.configuration = {};
1153
+ this.createdAt = /* @__PURE__ */ new Date();
1154
+ this.updatedAt = /* @__PURE__ */ new Date();
1155
+ }
1156
+ };
1157
+ __decorateClass([
1158
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1159
+ ], CpqInventoryAsset.prototype, "id", 2);
1160
+ __decorateClass([
1161
+ Property({ name: "organization_id", type: "uuid" })
1162
+ ], CpqInventoryAsset.prototype, "organizationId", 2);
1163
+ __decorateClass([
1164
+ Property({ name: "tenant_id", type: "uuid" })
1165
+ ], CpqInventoryAsset.prototype, "tenantId", 2);
1166
+ __decorateClass([
1167
+ Property({ name: "customer_id", type: "uuid" })
1168
+ ], CpqInventoryAsset.prototype, "customerId", 2);
1169
+ __decorateClass([
1170
+ Property({ name: "subscription_id", type: "uuid", nullable: true })
1171
+ ], CpqInventoryAsset.prototype, "subscriptionId", 2);
1172
+ __decorateClass([
1173
+ Property({ name: "subscription_item_id", type: "uuid", nullable: true })
1174
+ ], CpqInventoryAsset.prototype, "subscriptionItemId", 2);
1175
+ __decorateClass([
1176
+ Property({ name: "product_id", type: "uuid", nullable: true })
1177
+ ], CpqInventoryAsset.prototype, "productId", 2);
1178
+ __decorateClass([
1179
+ Property({ name: "offering_id", type: "uuid", nullable: true })
1180
+ ], CpqInventoryAsset.prototype, "offeringId", 2);
1181
+ __decorateClass([
1182
+ Property({ name: "spec_id", type: "uuid", nullable: true })
1183
+ ], CpqInventoryAsset.prototype, "specId", 2);
1184
+ __decorateClass([
1185
+ Property({ type: "text" })
1186
+ ], CpqInventoryAsset.prototype, "code", 2);
1187
+ __decorateClass([
1188
+ Property({ type: "text" })
1189
+ ], CpqInventoryAsset.prototype, "name", 2);
1190
+ __decorateClass([
1191
+ Property({ type: "text", nullable: true })
1192
+ ], CpqInventoryAsset.prototype, "description", 2);
1193
+ __decorateClass([
1194
+ Property({ type: "text", default: "pending" })
1195
+ ], CpqInventoryAsset.prototype, "status", 2);
1196
+ __decorateClass([
1197
+ Property({ name: "asset_type", type: "text", default: "one_time" })
1198
+ ], CpqInventoryAsset.prototype, "assetType", 2);
1199
+ __decorateClass([
1200
+ Property({ name: "currency_code", type: "text", default: "USD" })
1201
+ ], CpqInventoryAsset.prototype, "currencyCode", 2);
1202
+ __decorateClass([
1203
+ Property({ name: "purchase_price", columnType: "numeric(18, 4)", default: 0 })
1204
+ ], CpqInventoryAsset.prototype, "purchasePrice", 2);
1205
+ __decorateClass([
1206
+ Property({ type: "integer", default: 1 })
1207
+ ], CpqInventoryAsset.prototype, "quantity", 2);
1208
+ __decorateClass([
1209
+ Property({ name: "purchase_date", type: "date", nullable: true })
1210
+ ], CpqInventoryAsset.prototype, "purchaseDate", 2);
1211
+ __decorateClass([
1212
+ Property({ name: "delivery_date", type: "date", nullable: true })
1213
+ ], CpqInventoryAsset.prototype, "deliveryDate", 2);
1214
+ __decorateClass([
1215
+ Property({ type: "jsonb", default: "{}" })
1216
+ ], CpqInventoryAsset.prototype, "configuration", 2);
1217
+ __decorateClass([
1218
+ Property({ type: "jsonb", nullable: true })
1219
+ ], CpqInventoryAsset.prototype, "charges", 2);
1220
+ __decorateClass([
1221
+ Property({ name: "source_quote_id", type: "uuid", nullable: true })
1222
+ ], CpqInventoryAsset.prototype, "sourceQuoteId", 2);
1223
+ __decorateClass([
1224
+ Property({ name: "source_order_id", type: "uuid", nullable: true })
1225
+ ], CpqInventoryAsset.prototype, "sourceOrderId", 2);
1226
+ __decorateClass([
1227
+ Property({ name: "source_quote_line_id", type: "uuid", nullable: true })
1228
+ ], CpqInventoryAsset.prototype, "sourceQuoteLineId", 2);
1229
+ __decorateClass([
1230
+ Property({ type: "jsonb", nullable: true })
1231
+ ], CpqInventoryAsset.prototype, "metadata", 2);
1232
+ __decorateClass([
1233
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1234
+ ], CpqInventoryAsset.prototype, "createdAt", 2);
1235
+ __decorateClass([
1236
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1237
+ ], CpqInventoryAsset.prototype, "updatedAt", 2);
1238
+ __decorateClass([
1239
+ Property({ name: "deleted_at", type: Date, nullable: true })
1240
+ ], CpqInventoryAsset.prototype, "deletedAt", 2);
1241
+ CpqInventoryAsset = __decorateClass([
1242
+ Entity({ tableName: "cpq_inventory_assets" }),
1243
+ Index({ name: "cpq_inventory_assets_scope_idx", properties: ["organizationId", "tenantId"] }),
1244
+ Unique({ name: "cpq_inventory_assets_code_unique", properties: ["organizationId", "tenantId", "code"] }),
1245
+ Index({ name: "cpq_inventory_assets_customer_idx", properties: ["organizationId", "tenantId", "customerId"] }),
1246
+ Index({ name: "cpq_inventory_assets_status_idx", properties: ["organizationId", "tenantId", "status"] }),
1247
+ Index({ name: "cpq_inventory_assets_subscription_idx", properties: ["organizationId", "tenantId", "subscriptionId"] }),
1248
+ Index({ name: "cpq_inventory_assets_item_idx", properties: ["organizationId", "tenantId", "subscriptionItemId"] })
1249
+ ], CpqInventoryAsset);
1250
+ OptionalProps;
1251
+ let CpqOrderConfiguration = class {
1252
+ constructor() {
1253
+ this.cpqStatus = "draft";
1254
+ this.currencyCode = "USD";
1255
+ this.createdAt = /* @__PURE__ */ new Date();
1256
+ this.updatedAt = /* @__PURE__ */ new Date();
1257
+ }
1258
+ };
1259
+ __decorateClass([
1260
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1261
+ ], CpqOrderConfiguration.prototype, "id", 2);
1262
+ __decorateClass([
1263
+ Property({ name: "organization_id", type: "uuid" })
1264
+ ], CpqOrderConfiguration.prototype, "organizationId", 2);
1265
+ __decorateClass([
1266
+ Property({ name: "tenant_id", type: "uuid" })
1267
+ ], CpqOrderConfiguration.prototype, "tenantId", 2);
1268
+ __decorateClass([
1269
+ Property({ name: "order_id", type: "uuid" })
1270
+ ], CpqOrderConfiguration.prototype, "orderId", 2);
1271
+ __decorateClass([
1272
+ Property({ name: "source_quote_id", type: "uuid", nullable: true })
1273
+ ], CpqOrderConfiguration.prototype, "sourceQuoteId", 2);
1274
+ __decorateClass([
1275
+ Property({ name: "customer_id", type: "uuid" })
1276
+ ], CpqOrderConfiguration.prototype, "customerId", 2);
1277
+ __decorateClass([
1278
+ Property({ name: "cpq_status", type: "text", default: "draft" })
1279
+ ], CpqOrderConfiguration.prototype, "cpqStatus", 2);
1280
+ __decorateClass([
1281
+ Property({ name: "currency_code", type: "text", default: "USD" })
1282
+ ], CpqOrderConfiguration.prototype, "currencyCode", 2);
1283
+ __decorateClass([
1284
+ Property({ name: "pricing_summary", type: "jsonb", nullable: true })
1285
+ ], CpqOrderConfiguration.prototype, "pricingSummary", 2);
1286
+ __decorateClass([
1287
+ Property({ type: "jsonb", nullable: true })
1288
+ ], CpqOrderConfiguration.prototype, "metadata", 2);
1289
+ __decorateClass([
1290
+ Property({ name: "activated_at", type: Date, nullable: true })
1291
+ ], CpqOrderConfiguration.prototype, "activatedAt", 2);
1292
+ __decorateClass([
1293
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1294
+ ], CpqOrderConfiguration.prototype, "createdAt", 2);
1295
+ __decorateClass([
1296
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1297
+ ], CpqOrderConfiguration.prototype, "updatedAt", 2);
1298
+ __decorateClass([
1299
+ Property({ name: "deleted_at", type: Date, nullable: true })
1300
+ ], CpqOrderConfiguration.prototype, "deletedAt", 2);
1301
+ CpqOrderConfiguration = __decorateClass([
1302
+ Entity({ tableName: "cpq_order_configurations" }),
1303
+ Unique({ name: "cpq_order_configurations_order_unique", properties: ["organizationId", "tenantId", "orderId"] }),
1304
+ Index({ name: "cpq_order_configurations_scope_idx", properties: ["organizationId", "tenantId"] }),
1305
+ Index({ name: "cpq_order_configurations_customer_idx", properties: ["organizationId", "tenantId", "customerId"] }),
1306
+ Index({ name: "cpq_order_configurations_source_quote_idx", properties: ["organizationId", "tenantId", "sourceQuoteId"] }),
1307
+ Index({ name: "cpq_order_configurations_status_idx", properties: ["organizationId", "tenantId", "cpqStatus"] })
1308
+ ], CpqOrderConfiguration);
1309
+ OptionalProps;
1310
+ let CpqOrderLineConfiguration = class {
1311
+ constructor() {
1312
+ this.action = "add";
1313
+ this.configuration = {};
1314
+ this.quantity = 1;
1315
+ this.nrcTotal = "0";
1316
+ this.mrcTotal = "0";
1317
+ this.createdAt = /* @__PURE__ */ new Date();
1318
+ this.updatedAt = /* @__PURE__ */ new Date();
1319
+ }
1320
+ };
1321
+ __decorateClass([
1322
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1323
+ ], CpqOrderLineConfiguration.prototype, "id", 2);
1324
+ __decorateClass([
1325
+ Property({ name: "organization_id", type: "uuid" })
1326
+ ], CpqOrderLineConfiguration.prototype, "organizationId", 2);
1327
+ __decorateClass([
1328
+ Property({ name: "tenant_id", type: "uuid" })
1329
+ ], CpqOrderLineConfiguration.prototype, "tenantId", 2);
1330
+ __decorateClass([
1331
+ Property({ name: "order_line_id", type: "uuid" })
1332
+ ], CpqOrderLineConfiguration.prototype, "orderLineId", 2);
1333
+ __decorateClass([
1334
+ Property({ name: "order_configuration_id", type: "uuid" })
1335
+ ], CpqOrderLineConfiguration.prototype, "orderConfigurationId", 2);
1336
+ __decorateClass([
1337
+ Property({ name: "offering_id", type: "uuid", nullable: true })
1338
+ ], CpqOrderLineConfiguration.prototype, "offeringId", 2);
1339
+ __decorateClass([
1340
+ Property({ name: "product_id", type: "uuid", nullable: true })
1341
+ ], CpqOrderLineConfiguration.prototype, "productId", 2);
1342
+ __decorateClass([
1343
+ Property({ name: "spec_id", type: "uuid", nullable: true })
1344
+ ], CpqOrderLineConfiguration.prototype, "specId", 2);
1345
+ __decorateClass([
1346
+ Property({ type: "text", default: "add" })
1347
+ ], CpqOrderLineConfiguration.prototype, "action", 2);
1348
+ __decorateClass([
1349
+ Property({ name: "parent_line_id", type: "uuid", nullable: true })
1350
+ ], CpqOrderLineConfiguration.prototype, "parentLineId", 2);
1351
+ __decorateClass([
1352
+ Property({ name: "start_date", type: "date", nullable: true })
1353
+ ], CpqOrderLineConfiguration.prototype, "startDate", 2);
1354
+ __decorateClass([
1355
+ Property({ name: "term_months", type: "integer", nullable: true })
1356
+ ], CpqOrderLineConfiguration.prototype, "termMonths", 2);
1357
+ __decorateClass([
1358
+ Property({ name: "end_date", type: "date", nullable: true })
1359
+ ], CpqOrderLineConfiguration.prototype, "endDate", 2);
1360
+ __decorateClass([
1361
+ Property({ type: "jsonb", default: "{}" })
1362
+ ], CpqOrderLineConfiguration.prototype, "configuration", 2);
1363
+ __decorateClass([
1364
+ Property({ type: "integer", default: 1 })
1365
+ ], CpqOrderLineConfiguration.prototype, "quantity", 2);
1366
+ __decorateClass([
1367
+ Property({ type: "jsonb", nullable: true })
1368
+ ], CpqOrderLineConfiguration.prototype, "charges", 2);
1369
+ __decorateClass([
1370
+ Property({ name: "nrc_total", columnType: "numeric(18, 4)", default: 0 })
1371
+ ], CpqOrderLineConfiguration.prototype, "nrcTotal", 2);
1372
+ __decorateClass([
1373
+ Property({ name: "mrc_total", columnType: "numeric(18, 4)", default: 0 })
1374
+ ], CpqOrderLineConfiguration.prototype, "mrcTotal", 2);
1375
+ __decorateClass([
1376
+ Property({ name: "source_quote_line_id", type: "uuid", nullable: true })
1377
+ ], CpqOrderLineConfiguration.prototype, "sourceQuoteLineId", 2);
1378
+ __decorateClass([
1379
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1380
+ ], CpqOrderLineConfiguration.prototype, "createdAt", 2);
1381
+ __decorateClass([
1382
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1383
+ ], CpqOrderLineConfiguration.prototype, "updatedAt", 2);
1384
+ __decorateClass([
1385
+ Property({ name: "deleted_at", type: Date, nullable: true })
1386
+ ], CpqOrderLineConfiguration.prototype, "deletedAt", 2);
1387
+ CpqOrderLineConfiguration = __decorateClass([
1388
+ Entity({ tableName: "cpq_order_line_configurations" }),
1389
+ Unique({ name: "cpq_olc_order_line_unique", properties: ["organizationId", "tenantId", "orderLineId"] }),
1390
+ Index({ name: "cpq_olc_order_config_idx", properties: ["organizationId", "tenantId", "orderConfigurationId"] }),
1391
+ Index({ name: "cpq_olc_parent_line_idx", properties: ["organizationId", "tenantId", "parentLineId"] })
1392
+ ], CpqOrderLineConfiguration);
1393
+ OptionalProps;
1394
+ let CpqQuoteTargetSubscription = class {
1395
+ constructor() {
1396
+ this.createdAt = /* @__PURE__ */ new Date();
1397
+ this.updatedAt = /* @__PURE__ */ new Date();
1398
+ }
1399
+ };
1400
+ __decorateClass([
1401
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1402
+ ], CpqQuoteTargetSubscription.prototype, "id", 2);
1403
+ __decorateClass([
1404
+ Property({ name: "organization_id", type: "uuid" })
1405
+ ], CpqQuoteTargetSubscription.prototype, "organizationId", 2);
1406
+ __decorateClass([
1407
+ Property({ name: "tenant_id", type: "uuid" })
1408
+ ], CpqQuoteTargetSubscription.prototype, "tenantId", 2);
1409
+ __decorateClass([
1410
+ Property({ name: "quote_id", type: "uuid" })
1411
+ ], CpqQuoteTargetSubscription.prototype, "quoteId", 2);
1412
+ __decorateClass([
1413
+ Property({ name: "subscription_id", type: "uuid" })
1414
+ ], CpqQuoteTargetSubscription.prototype, "subscriptionId", 2);
1415
+ __decorateClass([
1416
+ Property({ name: "quote_type", type: "text" })
1417
+ ], CpqQuoteTargetSubscription.prototype, "quoteType", 2);
1418
+ __decorateClass([
1419
+ Property({ name: "merge_action", type: "text", nullable: true })
1420
+ ], CpqQuoteTargetSubscription.prototype, "mergeAction", 2);
1421
+ __decorateClass([
1422
+ Property({ name: "new_term_start", type: "date", nullable: true })
1423
+ ], CpqQuoteTargetSubscription.prototype, "newTermStart", 2);
1424
+ __decorateClass([
1425
+ Property({ name: "new_term_end", type: "date", nullable: true })
1426
+ ], CpqQuoteTargetSubscription.prototype, "newTermEnd", 2);
1427
+ __decorateClass([
1428
+ Property({ name: "new_term_months", type: "integer", nullable: true })
1429
+ ], CpqQuoteTargetSubscription.prototype, "newTermMonths", 2);
1430
+ __decorateClass([
1431
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1432
+ ], CpqQuoteTargetSubscription.prototype, "createdAt", 2);
1433
+ __decorateClass([
1434
+ Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
1435
+ ], CpqQuoteTargetSubscription.prototype, "updatedAt", 2);
1436
+ __decorateClass([
1437
+ Property({ name: "deleted_at", type: Date, nullable: true })
1438
+ ], CpqQuoteTargetSubscription.prototype, "deletedAt", 2);
1439
+ CpqQuoteTargetSubscription = __decorateClass([
1440
+ Entity({ tableName: "cpq_quote_target_subscriptions" }),
1441
+ Unique({
1442
+ name: "cpq_qts_quote_sub_unique",
1443
+ properties: ["organizationId", "tenantId", "quoteId", "subscriptionId"]
1444
+ }),
1445
+ Index({ name: "cpq_qts_quote_idx", properties: ["organizationId", "tenantId", "quoteId"] }),
1446
+ Index({
1447
+ name: "cpq_qts_sub_type_idx",
1448
+ properties: ["organizationId", "tenantId", "subscriptionId", "quoteType"]
1449
+ })
1450
+ ], CpqQuoteTargetSubscription);
1451
+ OptionalProps;
1452
+ let CpqSubscriptionChangeLog = class {
1453
+ constructor() {
1454
+ this.effectiveAt = /* @__PURE__ */ new Date();
1455
+ this.createdAt = /* @__PURE__ */ new Date();
1456
+ }
1457
+ };
1458
+ __decorateClass([
1459
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
1460
+ ], CpqSubscriptionChangeLog.prototype, "id", 2);
1461
+ __decorateClass([
1462
+ Property({ name: "organization_id", type: "uuid" })
1463
+ ], CpqSubscriptionChangeLog.prototype, "organizationId", 2);
1464
+ __decorateClass([
1465
+ Property({ name: "tenant_id", type: "uuid" })
1466
+ ], CpqSubscriptionChangeLog.prototype, "tenantId", 2);
1467
+ __decorateClass([
1468
+ Property({ name: "subscription_id", type: "uuid" })
1469
+ ], CpqSubscriptionChangeLog.prototype, "subscriptionId", 2);
1470
+ __decorateClass([
1471
+ Property({ name: "change_type", type: "text" })
1472
+ ], CpqSubscriptionChangeLog.prototype, "changeType", 2);
1473
+ __decorateClass([
1474
+ Property({ name: "source_quote_id", type: "uuid", nullable: true })
1475
+ ], CpqSubscriptionChangeLog.prototype, "sourceQuoteId", 2);
1476
+ __decorateClass([
1477
+ Property({ name: "source_order_id", type: "uuid", nullable: true })
1478
+ ], CpqSubscriptionChangeLog.prototype, "sourceOrderId", 2);
1479
+ __decorateClass([
1480
+ Property({ name: "performed_by_user_id", type: "uuid", nullable: true })
1481
+ ], CpqSubscriptionChangeLog.prototype, "performedByUserId", 2);
1482
+ __decorateClass([
1483
+ Property({ name: "effective_at", type: Date })
1484
+ ], CpqSubscriptionChangeLog.prototype, "effectiveAt", 2);
1485
+ __decorateClass([
1486
+ Property({ name: "before_snapshot", type: "jsonb", nullable: true })
1487
+ ], CpqSubscriptionChangeLog.prototype, "beforeSnapshot", 2);
1488
+ __decorateClass([
1489
+ Property({ name: "after_snapshot", type: "jsonb", nullable: true })
1490
+ ], CpqSubscriptionChangeLog.prototype, "afterSnapshot", 2);
1491
+ __decorateClass([
1492
+ Property({ name: "line_changes", type: "jsonb", nullable: true })
1493
+ ], CpqSubscriptionChangeLog.prototype, "lineChanges", 2);
1494
+ __decorateClass([
1495
+ Property({ name: "term_change", type: "jsonb", nullable: true })
1496
+ ], CpqSubscriptionChangeLog.prototype, "termChange", 2);
1497
+ __decorateClass([
1498
+ Property({ name: "merged_into_subscription_id", type: "uuid", nullable: true })
1499
+ ], CpqSubscriptionChangeLog.prototype, "mergedIntoSubscriptionId", 2);
1500
+ __decorateClass([
1501
+ Property({ name: "merged_from_subscription_ids", type: "jsonb", nullable: true })
1502
+ ], CpqSubscriptionChangeLog.prototype, "mergedFromSubscriptionIds", 2);
1503
+ __decorateClass([
1504
+ Property({ name: "reason_code", type: "text", nullable: true })
1505
+ ], CpqSubscriptionChangeLog.prototype, "reasonCode", 2);
1506
+ __decorateClass([
1507
+ Property({ name: "reason_text", type: "text", nullable: true })
1508
+ ], CpqSubscriptionChangeLog.prototype, "reasonText", 2);
1509
+ __decorateClass([
1510
+ Property({ name: "etf_amount", type: "numeric", columnType: "numeric(18, 4)", nullable: true })
1511
+ ], CpqSubscriptionChangeLog.prototype, "etfAmount", 2);
1512
+ __decorateClass([
1513
+ Property({ name: "etf_currency", type: "text", nullable: true })
1514
+ ], CpqSubscriptionChangeLog.prototype, "etfCurrency", 2);
1515
+ __decorateClass([
1516
+ Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
1517
+ ], CpqSubscriptionChangeLog.prototype, "createdAt", 2);
1518
+ __decorateClass([
1519
+ Property({ name: "deleted_at", type: Date, nullable: true })
1520
+ ], CpqSubscriptionChangeLog.prototype, "deletedAt", 2);
1521
+ CpqSubscriptionChangeLog = __decorateClass([
1522
+ Entity({ tableName: "cpq_subscription_change_logs" }),
1523
+ Index({
1524
+ name: "cpq_scl_sub_history_idx",
1525
+ properties: ["organizationId", "tenantId", "subscriptionId", "createdAt"]
1526
+ }),
1527
+ Index({ name: "cpq_scl_source_order_idx", properties: ["sourceOrderId"] }),
1528
+ Index({ name: "cpq_scl_merged_into_idx", properties: ["mergedIntoSubscriptionId"] }),
1529
+ Unique({
1530
+ name: "cpq_scl_order_sub_unique",
1531
+ properties: ["sourceOrderId", "subscriptionId"]
1532
+ })
1533
+ ], CpqSubscriptionChangeLog);
1534
+ export {
1535
+ CpqBundleSlot,
1536
+ CpqInventoryAsset,
1537
+ CpqInventorySubscription,
1538
+ CpqInventorySubscriptionItem,
1539
+ CpqOfferingComponent,
1540
+ CpqOrderConfiguration,
1541
+ CpqOrderLineConfiguration,
1542
+ CpqPriceRule,
1543
+ CpqPricingTable,
1544
+ CpqPricingTableEntry,
1545
+ CpqProductAttribute,
1546
+ CpqProductCharge,
1547
+ CpqProductOffering,
1548
+ CpqProductRelationship,
1549
+ CpqProductSpecification,
1550
+ CpqQuoteConfiguration,
1551
+ CpqQuoteLineConfiguration,
1552
+ CpqQuoteTargetSubscription,
1553
+ CpqSubscriptionChangeLog,
1554
+ CpqWizardDefinition
1555
+ };
1556
+ //# sourceMappingURL=entities.js.map