@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.
- package/CHANGELOG.md +70 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +236 -0
- package/README.md +108 -0
- package/dist/modules/cpq/acl.js +30 -0
- package/dist/modules/cpq/acl.js.map +7 -0
- package/dist/modules/cpq/api/_helpers/handleArcError.js +37 -0
- package/dist/modules/cpq/api/_helpers/handleArcError.js.map +7 -0
- package/dist/modules/cpq/api/attribute-options/route.js +47 -0
- package/dist/modules/cpq/api/attribute-options/route.js.map +7 -0
- package/dist/modules/cpq/api/bundle-slots/route.js +101 -0
- package/dist/modules/cpq/api/bundle-slots/route.js.map +7 -0
- package/dist/modules/cpq/api/bundle-tree/route.js +28 -0
- package/dist/modules/cpq/api/bundle-tree/route.js.map +7 -0
- package/dist/modules/cpq/api/context.js +29 -0
- package/dist/modules/cpq/api/context.js.map +7 -0
- package/dist/modules/cpq/api/inventory/assets/route.js +113 -0
- package/dist/modules/cpq/api/inventory/assets/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/assets/status/route.js +35 -0
- package/dist/modules/cpq/api/inventory/assets/status/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.js +30 -0
- package/dist/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/customer/[customerId]/route.js +31 -0
- package/dist/modules/cpq/api/inventory/customer/[customerId]/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/subscription-items/route.js +99 -0
- package/dist/modules/cpq/api/inventory/subscription-items/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.js +57 -0
- package/dist/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/subscriptions/expiring/route.js +62 -0
- package/dist/modules/cpq/api/inventory/subscriptions/expiring/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/subscriptions/route.js +116 -0
- package/dist/modules/cpq/api/inventory/subscriptions/route.js.map +7 -0
- package/dist/modules/cpq/api/inventory/subscriptions/status/route.js +35 -0
- package/dist/modules/cpq/api/inventory/subscriptions/status/route.js.map +7 -0
- package/dist/modules/cpq/api/offering-components/route.js +91 -0
- package/dist/modules/cpq/api/offering-components/route.js.map +7 -0
- package/dist/modules/cpq/api/orders/[orderId]/activate/route.js +39 -0
- package/dist/modules/cpq/api/orders/[orderId]/activate/route.js.map +7 -0
- package/dist/modules/cpq/api/orders/[orderId]/route.js +28 -0
- package/dist/modules/cpq/api/orders/[orderId]/route.js.map +7 -0
- package/dist/modules/cpq/api/orders/[orderId]/status/route.js +38 -0
- package/dist/modules/cpq/api/orders/[orderId]/status/route.js.map +7 -0
- package/dist/modules/cpq/api/orders/route.js +71 -0
- package/dist/modules/cpq/api/orders/route.js.map +7 -0
- package/dist/modules/cpq/api/price-rules/route.js +180 -0
- package/dist/modules/cpq/api/price-rules/route.js.map +7 -0
- package/dist/modules/cpq/api/pricing-table-entries/route.js +142 -0
- package/dist/modules/cpq/api/pricing-table-entries/route.js.map +7 -0
- package/dist/modules/cpq/api/pricing-tables/route.js +179 -0
- package/dist/modules/cpq/api/pricing-tables/route.js.map +7 -0
- package/dist/modules/cpq/api/product-attributes/route.js +160 -0
- package/dist/modules/cpq/api/product-attributes/route.js.map +7 -0
- package/dist/modules/cpq/api/product-charges/route.js +166 -0
- package/dist/modules/cpq/api/product-charges/route.js.map +7 -0
- package/dist/modules/cpq/api/product-offerings/route.js +294 -0
- package/dist/modules/cpq/api/product-offerings/route.js.map +7 -0
- package/dist/modules/cpq/api/product-relationships/route.js +144 -0
- package/dist/modules/cpq/api/product-relationships/route.js.map +7 -0
- package/dist/modules/cpq/api/product-specifications/route.js +292 -0
- package/dist/modules/cpq/api/product-specifications/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.js +71 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/clone/route.js +29 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/clone/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.js +54 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/items/route.js +27 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/items/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/merge-meta/route.js +72 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/merge-meta/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/recalculate/route.js +35 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/recalculate/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/route.js +102 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/status/route.js +27 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/status/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.js +79 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.js +95 -0
- package/dist/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/attributes/route.js +52 -0
- package/dist/modules/cpq/api/quotes/attributes/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/from-subscription/route.js +72 -0
- package/dist/modules/cpq/api/quotes/from-subscription/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/price/route.js +69 -0
- package/dist/modules/cpq/api/quotes/price/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/route.js +97 -0
- package/dist/modules/cpq/api/quotes/route.js.map +7 -0
- package/dist/modules/cpq/api/quotes/validate-relationships/route.js +86 -0
- package/dist/modules/cpq/api/quotes/validate-relationships/route.js.map +7 -0
- package/dist/modules/cpq/api/resolveQuotingService.js +7 -0
- package/dist/modules/cpq/api/resolveQuotingService.js.map +7 -0
- package/dist/modules/cpq/api/wizards/resolve/route.js +38 -0
- package/dist/modules/cpq/api/wizards/resolve/route.js.map +7 -0
- package/dist/modules/cpq/api/wizards/route.js +111 -0
- package/dist/modules/cpq/api/wizards/route.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/AssetsTable.js +136 -0
- package/dist/modules/cpq/backend/cpq/inventory/AssetsTable.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/SubscriptionsTable.js +185 -0
- package/dist/modules/cpq/backend/cpq/inventory/SubscriptionsTable.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.js +343 -0
- package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.js +13 -0
- package/dist/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/page.js +35 -0
- package/dist/modules/cpq/backend/cpq/inventory/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/inventory/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/shared.js +20 -0
- package/dist/modules/cpq/backend/cpq/inventory/shared.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.js +794 -0
- package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.js +13 -0
- package/dist/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/offerings/[id]/page.js +917 -0
- package/dist/modules/cpq/backend/cpq/offerings/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/offerings/page.js +405 -0
- package/dist/modules/cpq/backend/cpq/offerings/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/offerings/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/offerings/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/orders/[id]/page.js +677 -0
- package/dist/modules/cpq/backend/cpq/orders/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/orders/page.js +134 -0
- package/dist/modules/cpq/backend/cpq/orders/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/orders/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/orders/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/price-rules/PriceRuleForm.js +272 -0
- package/dist/modules/cpq/backend/cpq/price-rules/PriceRuleForm.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.js +407 -0
- package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.meta.js +13 -0
- package/dist/modules/cpq/backend/cpq/price-rules/[id]/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/price-rules/page.js +211 -0
- package/dist/modules/cpq/backend/cpq/price-rules/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/price-rules/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/price-rules/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.js +275 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.js +112 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/page.js +492 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.js +50 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.js +249 -0
- package/dist/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/page.js +87 -0
- package/dist/modules/cpq/backend/cpq/pricing/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/pricing/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/pricing/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.js +652 -0
- package/dist/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/quotes/[id]/page.js +1289 -0
- package/dist/modules/cpq/backend/cpq/quotes/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/quotes/page.js +283 -0
- package/dist/modules/cpq/backend/cpq/quotes/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/quotes/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/quotes/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.js +214 -0
- package/dist/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/specifications/[id]/page.js +1399 -0
- package/dist/modules/cpq/backend/cpq/specifications/[id]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/specifications/page.js +148 -0
- package/dist/modules/cpq/backend/cpq/specifications/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/specifications/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/specifications/page.meta.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.js +204 -0
- package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/page.js +191 -0
- package/dist/modules/cpq/backend/cpq/wizards/[definitionCode]/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/wizards/page.js +119 -0
- package/dist/modules/cpq/backend/cpq/wizards/page.js.map +7 -0
- package/dist/modules/cpq/backend/cpq/wizards/page.meta.js +18 -0
- package/dist/modules/cpq/backend/cpq/wizards/page.meta.js.map +7 -0
- package/dist/modules/cpq/ce.js +151 -0
- package/dist/modules/cpq/ce.js.map +7 -0
- package/dist/modules/cpq/cli.js +11 -0
- package/dist/modules/cpq/cli.js.map +7 -0
- package/dist/modules/cpq/components/CpqListView.js +265 -0
- package/dist/modules/cpq/components/CpqListView.js.map +7 -0
- package/dist/modules/cpq/components/NumberInput.js +95 -0
- package/dist/modules/cpq/components/NumberInput.js.map +7 -0
- package/dist/modules/cpq/components/StatusPath.js +60 -0
- package/dist/modules/cpq/components/StatusPath.js.map +7 -0
- package/dist/modules/cpq/components/statusMaps.js +66 -0
- package/dist/modules/cpq/components/statusMaps.js.map +7 -0
- package/dist/modules/cpq/components/useCpqRowActions.js +125 -0
- package/dist/modules/cpq/components/useCpqRowActions.js.map +7 -0
- package/dist/modules/cpq/data/entities.js +1556 -0
- package/dist/modules/cpq/data/entities.js.map +7 -0
- package/dist/modules/cpq/data/validators.js +575 -0
- package/dist/modules/cpq/data/validators.js.map +7 -0
- package/dist/modules/cpq/di.js +57 -0
- package/dist/modules/cpq/di.js.map +7 -0
- package/dist/modules/cpq/events.js +50 -0
- package/dist/modules/cpq/events.js.map +7 -0
- package/dist/modules/cpq/index.js +16 -0
- package/dist/modules/cpq/index.js.map +7 -0
- package/dist/modules/cpq/lib/seeds/api.js +32 -0
- package/dist/modules/cpq/lib/seeds/api.js.map +7 -0
- package/dist/modules/cpq/lib/seeds/tenant-provisioning.js +158 -0
- package/dist/modules/cpq/lib/seeds/tenant-provisioning.js.map +7 -0
- package/dist/modules/cpq/lib/seeds.js +6 -0
- package/dist/modules/cpq/lib/seeds.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260220220000_cpq.js +40 -0
- package/dist/modules/cpq/migrations/Migration20260220220000_cpq.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.js +54 -0
- package/dist/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.js +15 -0
- package/dist/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.js +62 -0
- package/dist/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260402000000_cpq_workflows.js +56 -0
- package/dist/modules/cpq/migrations/Migration20260402000000_cpq_workflows.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.js +26 -0
- package/dist/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.js +37 -0
- package/dist/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.js +35 -0
- package/dist/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.js +21 -0
- package/dist/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.js +46 -0
- package/dist/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260410100000_cpq_inventory.js +118 -0
- package/dist/modules/cpq/migrations/Migration20260410100000_cpq_inventory.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260411000000_cpq_orders.js +63 -0
- package/dist/modules/cpq/migrations/Migration20260411000000_cpq_orders.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.js +28 -0
- package/dist/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260504064621_cpq_arc.js +36 -0
- package/dist/modules/cpq/migrations/Migration20260504064621_cpq_arc.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.js +14 -0
- package/dist/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.js +14 -0
- package/dist/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.js +58 -0
- package/dist/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.js.map +7 -0
- package/dist/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.js +29 -0
- package/dist/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.js.map +7 -0
- package/dist/modules/cpq/services/cpqBundleService.js +447 -0
- package/dist/modules/cpq/services/cpqBundleService.js.map +7 -0
- package/dist/modules/cpq/services/cpqInventoryService.js +1371 -0
- package/dist/modules/cpq/services/cpqInventoryService.js.map +7 -0
- package/dist/modules/cpq/services/cpqOrderService.js +901 -0
- package/dist/modules/cpq/services/cpqOrderService.js.map +7 -0
- package/dist/modules/cpq/services/cpqPricingService.js +289 -0
- package/dist/modules/cpq/services/cpqPricingService.js.map +7 -0
- package/dist/modules/cpq/services/cpqProductService.js +204 -0
- package/dist/modules/cpq/services/cpqProductService.js.map +7 -0
- package/dist/modules/cpq/services/cpqQuotingService.js +1867 -0
- package/dist/modules/cpq/services/cpqQuotingService.js.map +7 -0
- package/dist/modules/cpq/services/cpqValidationService.js +234 -0
- package/dist/modules/cpq/services/cpqValidationService.js.map +7 -0
- package/dist/modules/cpq/services/cpqWizardService.js +137 -0
- package/dist/modules/cpq/services/cpqWizardService.js.map +7 -0
- package/dist/modules/cpq/services/types.js +114 -0
- package/dist/modules/cpq/services/types.js.map +7 -0
- package/dist/modules/cpq/setup.js +49 -0
- package/dist/modules/cpq/setup.js.map +7 -0
- package/dist/modules/cpq/subscribers/subscription-amended-log.js +18 -0
- package/dist/modules/cpq/subscribers/subscription-amended-log.js.map +7 -0
- package/dist/modules/cpq/subscribers/subscription-cancelled-log.js +19 -0
- package/dist/modules/cpq/subscribers/subscription-cancelled-log.js.map +7 -0
- package/dist/modules/cpq/subscribers/subscription-merged-log.js +20 -0
- package/dist/modules/cpq/subscribers/subscription-merged-log.js.map +7 -0
- package/dist/modules/cpq/subscribers/subscription-renewed-log.js +18 -0
- package/dist/modules/cpq/subscribers/subscription-renewed-log.js.map +7 -0
- package/dist/modules/cpq/subscribers/subscription-superseded-log.js +18 -0
- package/dist/modules/cpq/subscribers/subscription-superseded-log.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/customer-inventory/widget.client.js +192 -0
- package/dist/modules/cpq/widgets/injection/customer-inventory/widget.client.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/customer-inventory/widget.js +17 -0
- package/dist/modules/cpq/widgets/injection/customer-inventory/widget.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.client.js +79 -0
- package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.client.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.js +17 -0
- package/dist/modules/cpq/widgets/injection/order-cpq-tab/widget.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/quote-configurator/widget.client.js +181 -0
- package/dist/modules/cpq/widgets/injection/quote-configurator/widget.client.js.map +7 -0
- package/dist/modules/cpq/widgets/injection/quote-configurator/widget.js +17 -0
- package/dist/modules/cpq/widgets/injection/quote-configurator/widget.js.map +7 -0
- package/dist/modules/cpq/widgets/injection-table.js +44 -0
- package/dist/modules/cpq/widgets/injection-table.js.map +7 -0
- package/dist/modules/cpq/workflows/WizardRunner.js +113 -0
- package/dist/modules/cpq/workflows/WizardRunner.js.map +7 -0
- package/dist/modules/cpq/workflows/WizardTrigger.js +116 -0
- package/dist/modules/cpq/workflows/WizardTrigger.js.map +7 -0
- package/dist/modules/cpq/workflows/engine.js +188 -0
- package/dist/modules/cpq/workflows/engine.js.map +7 -0
- package/dist/modules/cpq/workflows/registry.js +16 -0
- package/dist/modules/cpq/workflows/registry.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/CustomerSelectStep.js +119 -0
- package/dist/modules/cpq/workflows/steps/CustomerSelectStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/InventorySelectStep.js +24 -0
- package/dist/modules/cpq/workflows/steps/InventorySelectStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/ItemListStep.js +115 -0
- package/dist/modules/cpq/workflows/steps/ItemListStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/OfferingSelectStep.js +327 -0
- package/dist/modules/cpq/workflows/steps/OfferingSelectStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/ProductConfigureStep.js +231 -0
- package/dist/modules/cpq/workflows/steps/ProductConfigureStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/ReviewStep.js +152 -0
- package/dist/modules/cpq/workflows/steps/ReviewStep.js.map +7 -0
- package/dist/modules/cpq/workflows/steps/index.js +49 -0
- package/dist/modules/cpq/workflows/steps/index.js.map +7 -0
- package/dist/modules/cpq/workflows/types.js +1 -0
- package/dist/modules/cpq/workflows/types.js.map +7 -0
- package/package.json +150 -0
- package/src/modules/cpq/__integration__/TC-CPQ-001.spec.ts +177 -0
- package/src/modules/cpq/__integration__/TC-CPQ-002.spec.ts +123 -0
- package/src/modules/cpq/__integration__/TC-CPQ-003.spec.ts +115 -0
- package/src/modules/cpq/__integration__/TC-CPQ-004.spec.ts +184 -0
- package/src/modules/cpq/__integration__/TC-CPQ-005.spec.ts +43 -0
- package/src/modules/cpq/__integration__/TC-CPQ-006.spec.ts +87 -0
- package/src/modules/cpq/__integration__/TC-CPQ-007.spec.ts +79 -0
- package/src/modules/cpq/__integration__/TC-CPQ-008.spec.ts +55 -0
- package/src/modules/cpq/__integration__/TC-CPQ-009.spec.ts +45 -0
- package/src/modules/cpq/__integration__/TC-CPQ-010.spec.ts +54 -0
- package/src/modules/cpq/__integration__/TC-CPQ-011.spec.ts +24 -0
- package/src/modules/cpq/__integration__/TC-CPQ-012.spec.ts +62 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-001.spec.ts +52 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-002.spec.ts +65 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-003.spec.ts +107 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-004.spec.ts +74 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-005.spec.ts +86 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-006.spec.ts +79 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-007.spec.ts +63 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-008.spec.ts +62 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-009.spec.ts +62 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-010.spec.ts +59 -0
- package/src/modules/cpq/__integration__/TC-CPQ-ARC-011.spec.ts +128 -0
- package/src/modules/cpq/__integration__/_helpers/cpqArcFixtures.ts +208 -0
- package/src/modules/cpq/__tests__/package-isolation.test.ts +232 -0
- package/src/modules/cpq/acl.ts +26 -0
- package/src/modules/cpq/api/_helpers/__tests__/handleArcError.test.ts +117 -0
- package/src/modules/cpq/api/_helpers/handleArcError.ts +81 -0
- package/src/modules/cpq/api/attribute-options/route.ts +55 -0
- package/src/modules/cpq/api/bundle-slots/route.ts +112 -0
- package/src/modules/cpq/api/bundle-tree/route.ts +31 -0
- package/src/modules/cpq/api/context.ts +39 -0
- package/src/modules/cpq/api/inventory/assets/route.ts +123 -0
- package/src/modules/cpq/api/inventory/assets/status/route.ts +34 -0
- package/src/modules/cpq/api/inventory/customer/[customerId]/parent-items/route.ts +30 -0
- package/src/modules/cpq/api/inventory/customer/[customerId]/route.ts +31 -0
- package/src/modules/cpq/api/inventory/subscription-items/route.ts +107 -0
- package/src/modules/cpq/api/inventory/subscriptions/[subscriptionId]/change-log/route.ts +64 -0
- package/src/modules/cpq/api/inventory/subscriptions/expiring/route.ts +66 -0
- package/src/modules/cpq/api/inventory/subscriptions/route.ts +126 -0
- package/src/modules/cpq/api/inventory/subscriptions/status/route.ts +34 -0
- package/src/modules/cpq/api/offering-components/route.ts +103 -0
- package/src/modules/cpq/api/orders/[orderId]/activate/route.ts +48 -0
- package/src/modules/cpq/api/orders/[orderId]/route.ts +28 -0
- package/src/modules/cpq/api/orders/[orderId]/status/route.ts +38 -0
- package/src/modules/cpq/api/orders/route.ts +77 -0
- package/src/modules/cpq/api/price-rules/route.ts +210 -0
- package/src/modules/cpq/api/pricing-table-entries/route.ts +159 -0
- package/src/modules/cpq/api/pricing-tables/route.ts +202 -0
- package/src/modules/cpq/api/product-attributes/route.ts +175 -0
- package/src/modules/cpq/api/product-charges/route.ts +181 -0
- package/src/modules/cpq/api/product-offerings/route.ts +329 -0
- package/src/modules/cpq/api/product-relationships/route.ts +156 -0
- package/src/modules/cpq/api/product-specifications/route.ts +325 -0
- package/src/modules/cpq/api/quotes/[quoteId]/cancel-meta/route.ts +77 -0
- package/src/modules/cpq/api/quotes/[quoteId]/clone/route.ts +28 -0
- package/src/modules/cpq/api/quotes/[quoteId]/items/[lineId]/route.ts +55 -0
- package/src/modules/cpq/api/quotes/[quoteId]/items/route.ts +26 -0
- package/src/modules/cpq/api/quotes/[quoteId]/merge-meta/route.ts +78 -0
- package/src/modules/cpq/api/quotes/[quoteId]/recalculate/route.ts +34 -0
- package/src/modules/cpq/api/quotes/[quoteId]/route.ts +109 -0
- package/src/modules/cpq/api/quotes/[quoteId]/status/route.ts +26 -0
- package/src/modules/cpq/api/quotes/[quoteId]/target-subscriptions/[targetId]/route.ts +91 -0
- package/src/modules/cpq/api/quotes/[quoteId]/target-subscriptions/route.ts +107 -0
- package/src/modules/cpq/api/quotes/attributes/route.ts +61 -0
- package/src/modules/cpq/api/quotes/from-subscription/route.ts +85 -0
- package/src/modules/cpq/api/quotes/price/route.ts +81 -0
- package/src/modules/cpq/api/quotes/route.ts +114 -0
- package/src/modules/cpq/api/quotes/validate-relationships/route.ts +100 -0
- package/src/modules/cpq/api/resolveQuotingService.ts +11 -0
- package/src/modules/cpq/api/wizards/resolve/route.ts +39 -0
- package/src/modules/cpq/api/wizards/route.ts +127 -0
- package/src/modules/cpq/backend/cpq/inventory/AssetsTable.tsx +166 -0
- package/src/modules/cpq/backend/cpq/inventory/SubscriptionsTable.tsx +251 -0
- package/src/modules/cpq/backend/cpq/inventory/assets/[id]/page.meta.ts +9 -0
- package/src/modules/cpq/backend/cpq/inventory/assets/[id]/page.tsx +440 -0
- package/src/modules/cpq/backend/cpq/inventory/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/inventory/page.tsx +49 -0
- package/src/modules/cpq/backend/cpq/inventory/shared.tsx +32 -0
- package/src/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.meta.ts +9 -0
- package/src/modules/cpq/backend/cpq/inventory/subscriptions/[id]/page.tsx +1085 -0
- package/src/modules/cpq/backend/cpq/offerings/[id]/page.tsx +1165 -0
- package/src/modules/cpq/backend/cpq/offerings/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/offerings/page.tsx +468 -0
- package/src/modules/cpq/backend/cpq/orders/[id]/page.tsx +921 -0
- package/src/modules/cpq/backend/cpq/orders/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/orders/page.tsx +182 -0
- package/src/modules/cpq/backend/cpq/price-rules/PriceRuleForm.tsx +310 -0
- package/src/modules/cpq/backend/cpq/price-rules/[id]/page.meta.ts +9 -0
- package/src/modules/cpq/backend/cpq/price-rules/[id]/page.tsx +472 -0
- package/src/modules/cpq/backend/cpq/price-rules/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/price-rules/page.tsx +253 -0
- package/src/modules/cpq/backend/cpq/pricing/[id]/EntriesEditor.tsx +431 -0
- package/src/modules/cpq/backend/cpq/pricing/[id]/ImportPreview.tsx +122 -0
- package/src/modules/cpq/backend/cpq/pricing/[id]/page.tsx +588 -0
- package/src/modules/cpq/backend/cpq/pricing/[id]/xlsxExport.ts +90 -0
- package/src/modules/cpq/backend/cpq/pricing/[id]/xlsxImport.ts +338 -0
- package/src/modules/cpq/backend/cpq/pricing/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/pricing/page.tsx +111 -0
- package/src/modules/cpq/backend/cpq/quotes/[id]/_components/ArcQuoteConfigurator.tsx +737 -0
- package/src/modules/cpq/backend/cpq/quotes/[id]/page.tsx +1721 -0
- package/src/modules/cpq/backend/cpq/quotes/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/quotes/page.tsx +370 -0
- package/src/modules/cpq/backend/cpq/specifications/[id]/DependsOnRulesEditor.tsx +300 -0
- package/src/modules/cpq/backend/cpq/specifications/[id]/page.tsx +1722 -0
- package/src/modules/cpq/backend/cpq/specifications/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/specifications/page.tsx +191 -0
- package/src/modules/cpq/backend/cpq/wizards/[definitionCode]/detail/page.tsx +319 -0
- package/src/modules/cpq/backend/cpq/wizards/[definitionCode]/page.tsx +234 -0
- package/src/modules/cpq/backend/cpq/wizards/page.meta.ts +16 -0
- package/src/modules/cpq/backend/cpq/wizards/page.tsx +141 -0
- package/src/modules/cpq/ce.ts +150 -0
- package/src/modules/cpq/cli.ts +10 -0
- package/src/modules/cpq/components/CpqListView.tsx +431 -0
- package/src/modules/cpq/components/NumberInput.tsx +166 -0
- package/src/modules/cpq/components/StatusPath.tsx +116 -0
- package/src/modules/cpq/components/statusMaps.ts +148 -0
- package/src/modules/cpq/components/useCpqRowActions.tsx +183 -0
- package/src/modules/cpq/data/__tests__/validators.arc.test.ts +271 -0
- package/src/modules/cpq/data/__tests__/validators.test.ts +782 -0
- package/src/modules/cpq/data/entities.ts +1467 -0
- package/src/modules/cpq/data/validators.ts +663 -0
- package/src/modules/cpq/di.ts +70 -0
- package/src/modules/cpq/events.ts +62 -0
- package/src/modules/cpq/index.ts +15 -0
- package/src/modules/cpq/lib/seeds/__tests__/api.test.ts +86 -0
- package/src/modules/cpq/lib/seeds/__tests__/tenant-provisioning.test.ts +349 -0
- package/src/modules/cpq/lib/seeds/api.ts +119 -0
- package/src/modules/cpq/lib/seeds/tenant-provisioning.ts +239 -0
- package/src/modules/cpq/lib/seeds.ts +18 -0
- package/src/modules/cpq/migrations/.snapshot-open-mercato.json +7473 -0
- package/src/modules/cpq/migrations/Migration20260220220000_cpq.ts +51 -0
- package/src/modules/cpq/migrations/Migration20260330000000_cpq_product_domain.ts +70 -0
- package/src/modules/cpq/migrations/Migration20260331000000_cpq_charge_unique_per_offering.ts +15 -0
- package/src/modules/cpq/migrations/Migration20260401000000_cpq_quoting_v2.ts +73 -0
- package/src/modules/cpq/migrations/Migration20260402000000_cpq_workflows.ts +59 -0
- package/src/modules/cpq/migrations/Migration20260407000000_cpq_pricing_tables_v2.ts +30 -0
- package/src/modules/cpq/migrations/Migration20260407100000_cpq_price_rules.ts +36 -0
- package/src/modules/cpq/migrations/Migration20260408000000_cpq_price_rules.ts +33 -0
- package/src/modules/cpq/migrations/Migration20260410000000_cpq_drop_datacentres_inventory.ts +22 -0
- package/src/modules/cpq/migrations/Migration20260410000000_cpq_wizard_rename.ts +56 -0
- package/src/modules/cpq/migrations/Migration20260410100000_cpq_inventory.ts +118 -0
- package/src/modules/cpq/migrations/Migration20260411000000_cpq_orders.ts +62 -0
- package/src/modules/cpq/migrations/Migration20260412000000_cpq_bundled_offerings.ts +33 -0
- package/src/modules/cpq/migrations/Migration20260504064621_cpq_arc.ts +68 -0
- package/src/modules/cpq/migrations/Migration20260514000000_cpq_spec_merge_retired_deprecated.ts +30 -0
- package/src/modules/cpq/migrations/Migration20260514100000_cpq_offering_merge_retired_deprecated.ts +27 -0
- package/src/modules/cpq/migrations/Migration20260514110000_cpq_list_search_indexes.ts +82 -0
- package/src/modules/cpq/migrations/Migration20260515000000_cpq_inventory_subscriptions_search_indexes.ts +52 -0
- package/src/modules/cpq/services/__tests__/_helpers/mockEm.ts +59 -0
- package/src/modules/cpq/services/__tests__/cpqBundleService.test.ts +661 -0
- package/src/modules/cpq/services/__tests__/cpqInventoryService.arc.test.ts +357 -0
- package/src/modules/cpq/services/__tests__/cpqInventoryService.test.ts +718 -0
- package/src/modules/cpq/services/__tests__/cpqOrderService.test.ts +603 -0
- package/src/modules/cpq/services/__tests__/cpqPricingService.test.ts +1012 -0
- package/src/modules/cpq/services/__tests__/cpqProductService.test.ts +603 -0
- package/src/modules/cpq/services/__tests__/cpqQuotingService.arc.test.ts +143 -0
- package/src/modules/cpq/services/__tests__/cpqQuotingService.test.ts +658 -0
- package/src/modules/cpq/services/__tests__/cpqValidationService.test.ts +811 -0
- package/src/modules/cpq/services/__tests__/cpqWizardService.test.ts +389 -0
- package/src/modules/cpq/services/__tests__/types.test.ts +359 -0
- package/src/modules/cpq/services/cpqBundleService.ts +671 -0
- package/src/modules/cpq/services/cpqInventoryService.ts +1929 -0
- package/src/modules/cpq/services/cpqOrderService.ts +1230 -0
- package/src/modules/cpq/services/cpqPricingService.ts +412 -0
- package/src/modules/cpq/services/cpqProductService.ts +311 -0
- package/src/modules/cpq/services/cpqQuotingService.ts +2638 -0
- package/src/modules/cpq/services/cpqValidationService.ts +323 -0
- package/src/modules/cpq/services/cpqWizardService.ts +204 -0
- package/src/modules/cpq/services/types.ts +303 -0
- package/src/modules/cpq/setup.ts +63 -0
- package/src/modules/cpq/subscribers/subscription-amended-log.ts +20 -0
- package/src/modules/cpq/subscribers/subscription-cancelled-log.ts +19 -0
- package/src/modules/cpq/subscribers/subscription-merged-log.ts +22 -0
- package/src/modules/cpq/subscribers/subscription-renewed-log.ts +18 -0
- package/src/modules/cpq/subscribers/subscription-superseded-log.ts +19 -0
- package/src/modules/cpq/widgets/injection/customer-inventory/widget.client.tsx +339 -0
- package/src/modules/cpq/widgets/injection/customer-inventory/widget.ts +16 -0
- package/src/modules/cpq/widgets/injection/order-cpq-tab/widget.client.tsx +96 -0
- package/src/modules/cpq/widgets/injection/order-cpq-tab/widget.ts +16 -0
- package/src/modules/cpq/widgets/injection/quote-configurator/widget.client.tsx +265 -0
- package/src/modules/cpq/widgets/injection/quote-configurator/widget.ts +16 -0
- package/src/modules/cpq/widgets/injection-table.ts +42 -0
- package/src/modules/cpq/workflows/WizardRunner.tsx +158 -0
- package/src/modules/cpq/workflows/WizardTrigger.tsx +142 -0
- package/src/modules/cpq/workflows/engine.tsx +278 -0
- package/src/modules/cpq/workflows/registry.ts +15 -0
- package/src/modules/cpq/workflows/steps/CustomerSelectStep.tsx +136 -0
- package/src/modules/cpq/workflows/steps/InventorySelectStep.tsx +34 -0
- package/src/modules/cpq/workflows/steps/ItemListStep.tsx +146 -0
- package/src/modules/cpq/workflows/steps/OfferingSelectStep.tsx +438 -0
- package/src/modules/cpq/workflows/steps/ProductConfigureStep.tsx +287 -0
- package/src/modules/cpq/workflows/steps/ReviewStep.tsx +219 -0
- package/src/modules/cpq/workflows/steps/index.ts +51 -0
- package/src/modules/cpq/workflows/types.ts +102 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/cpq/data/validators.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\n// \u2500\u2500\u2500 Product Specification \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqProductSpecificationCreateSchema = z.object({\n productId: z.string().uuid().optional(),\n code: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n specType: z.enum(['simple', 'bundle']).optional().default('simple'),\n isAssetizable: z.boolean().optional().default(false),\n // `retired` was merged into `deprecated` \u2014 see migration\n // `<timestamp>-merge-spec-retired-into-deprecated.ts`. Offerings still have\n // four states because the user-facing semantics there are different\n // (a retired offering can't be re-sold; a deprecated one can but is\n // discouraged).\n lifecycleStatus: z.enum(['draft', 'active', 'deprecated']).optional().default('draft'),\n version: z.number().int().optional().default(1),\n effectiveFrom: z.string().datetime().nullish(),\n effectiveTo: z.string().datetime().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqProductSpecificationUpdateSchema = cpqProductSpecificationCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// \u2500\u2500\u2500 Product Offering \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqProductOfferingCreateSchema = z.object({\n specId: z.string().uuid(),\n catalogOfferId: z.string().uuid().nullish(),\n code: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n offeringType: z.enum(['simple', 'bundle']).optional().default('simple'),\n designTimeValues: z.record(z.string(), z.unknown()).optional().default({}),\n // `retired` was merged into `deprecated` \u2014 see migration\n // `<timestamp>-merge-offering-retired-into-deprecated.ts`. Aligned with\n // specifications: a single 3-state lifecycle keeps the UX uniform.\n lifecycleStatus: z.enum(['draft', 'active', 'deprecated']).optional().default('draft'),\n effectiveFrom: z.string().datetime().nullish(),\n effectiveTo: z.string().datetime().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqProductOfferingUpdateSchema = cpqProductOfferingCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// \u2500\u2500\u2500 Bundle Slot \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqBundleSlotCreateSchema = z.object({\n specId: z.string().uuid(),\n targetSpecId: z.string().uuid(),\n componentGroup: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n cardinalityMin: z.number().int().min(0).optional().default(0),\n cardinalityMax: z.number().int().min(0).nullish(),\n sortOrder: z.number().int().optional().default(0),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\nexport const cpqBundleSlotUpdateSchema = z.object({\n id: z.string().uuid(),\n componentGroup: z.string().min(1).optional(),\n name: z.string().min(1).optional(),\n description: z.string().nullish(),\n cardinalityMin: z.number().int().min(0).optional(),\n cardinalityMax: z.number().int().min(0).nullish(),\n sortOrder: z.number().int().optional(),\n isActive: z.boolean().optional(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\n// \u2500\u2500\u2500 Offering Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqOfferingComponentCreateSchema = z.object({\n offeringId: z.string().uuid(),\n slotId: z.string().uuid(),\n childOfferingId: z.string().uuid(),\n isDefault: z.boolean().optional().default(false),\n sortOrder: z.number().int().optional().default(0),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\nexport const cpqOfferingComponentUpdateSchema = z.object({\n id: z.string().uuid(),\n isDefault: z.boolean().optional(),\n sortOrder: z.number().int().optional(),\n isActive: z.boolean().optional(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\n// \u2500\u2500\u2500 Product Relationship \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqProductRelationshipCreateSchema = z.object({\n sourceSpecId: z.string().uuid(),\n targetSpecId: z.string().uuid(),\n relationshipType: z.enum(['parent_child', 'requires', 'excludes']),\n cardinalityMin: z.number().int().optional().default(0),\n cardinalityMax: z.number().int().nullish(),\n condition: z.record(z.string(), z.unknown()).nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqProductRelationshipUpdateSchema = cpqProductRelationshipCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// \u2500\u2500\u2500 Product Attribute \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqProductAttributeCreateSchema = z.object({\n productId: z.string().uuid().optional(),\n specId: z.string().uuid().nullish(),\n code: z.string().min(1),\n name: z.string().min(1),\n attributeType: z.enum(['enum', 'number', 'text', 'boolean', 'select', 'multi-select', 'reference']),\n resolutionTime: z.enum(['design_time', 'run_time']).optional().default('run_time'),\n options: z.array(z.object({ value: z.string(), label: z.string() })).nullish(),\n constraints: z.record(z.string(), z.unknown()).nullish(),\n referenceEntity: z.string().nullish(),\n referenceFilter: z.record(z.string(), z.unknown()).nullish(),\n dependsOn: z.record(z.string(), z.unknown()).nullish(),\n defaultValue: z.unknown().nullish(),\n helpText: z.string().nullish(),\n sortOrder: z.number().int().optional().default(0),\n isRequired: z.boolean().optional().default(true),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqProductAttributeUpdateSchema = cpqProductAttributeCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// `fixed` is a legacy alias for `flat` \u2014 older seeds (`demo_puffin`,\n// `demo_gix`) emit it directly and ~30+ rows in prod use it. The pricing\n// service treats them identically (fixedPrice + currencyCode, no table\n// lookup). We accept it on input and normalise to `flat` so storage\n// stays canonical.\nconst cpqChargePricingMethodEnum = z.enum(['flat', 'fixed', 'tiered', 'per_unit'])\n\nconst requireField = (\n ctx: z.RefinementCtx,\n value: unknown,\n path: string,\n msg: string,\n) => {\n if (value === undefined || value === null || value === '') {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [path], message: msg })\n }\n}\n\nconst forbidField = (\n ctx: z.RefinementCtx,\n value: unknown,\n path: string,\n msg: string,\n) => {\n if (value !== undefined && value !== null && value !== '') {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: [path], message: msg })\n }\n}\n\n// Shared shape between create/update so the refinement logic stays in one\n// place. Update is `.partial()` so its refinement runs only when fields\n// are present.\nconst cpqProductChargeBase = z.object({\n productId: z.string().uuid().optional(),\n offeringId: z.string().uuid().nullish(),\n code: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n chargeType: z.enum(['nrc', 'mrc', 'usage']),\n pricingMethod: cpqChargePricingMethodEnum.transform((v) => (v === 'fixed' ? 'flat' : v)),\n pricingTableId: z.string().uuid().nullish(),\n priceColumnKey: z.string().nullish(),\n fixedPrice: z.union([z.string(), z.number().transform(String)]).nullish(),\n currencyCode: z.string().nullish(),\n quantityAttributeCode: z.string().nullish(),\n applicabilityCondition: z.record(z.string(), z.unknown()).nullish(),\n sortOrder: z.number().int().optional().default(0),\n isActive: z.boolean().optional().default(true),\n})\n\n// V-CHG-1: pricing method must match the configured fields.\n// - flat \u2192 fixedPrice + currencyCode required; table fields forbidden\n// - per_unit \u2192 pricingTableId + priceColumnKey + quantityAttributeCode\n// required; fixedPrice forbidden\n// - tiered \u2192 same as per_unit (rangeFrom/rangeTo come from the table)\nconst refineChargePricingShape = (\n ctx: z.RefinementCtx,\n charge: {\n pricingMethod?: 'flat' | 'tiered' | 'per_unit'\n pricingTableId?: string | null\n priceColumnKey?: string | null\n fixedPrice?: string | null\n currencyCode?: string | null\n quantityAttributeCode?: string | null\n },\n) => {\n const method = charge.pricingMethod\n if (!method) return\n if (method === 'flat') {\n requireField(ctx, charge.fixedPrice, 'fixedPrice', 'V-CHG-1: fixedPrice is required for flat pricing')\n requireField(ctx, charge.currencyCode, 'currencyCode', 'V-CHG-1: currencyCode is required for flat pricing')\n forbidField(ctx, charge.pricingTableId, 'pricingTableId', 'V-CHG-1: pricingTableId must be empty for flat pricing')\n forbidField(ctx, charge.priceColumnKey, 'priceColumnKey', 'V-CHG-1: priceColumnKey must be empty for flat pricing')\n forbidField(ctx, charge.quantityAttributeCode, 'quantityAttributeCode', 'V-CHG-1: quantityAttributeCode must be empty for flat pricing')\n return\n }\n // per_unit | tiered\n requireField(ctx, charge.pricingTableId, 'pricingTableId', `V-CHG-1: pricingTableId is required for ${method} pricing`)\n requireField(ctx, charge.priceColumnKey, 'priceColumnKey', `V-CHG-1: priceColumnKey is required for ${method} pricing`)\n requireField(ctx, charge.quantityAttributeCode, 'quantityAttributeCode', `V-CHG-1: quantityAttributeCode is required for ${method} pricing`)\n forbidField(ctx, charge.fixedPrice, 'fixedPrice', `V-CHG-1: fixedPrice must be empty for ${method} pricing \u2014 price comes from the pricing table`)\n}\n\nexport const cpqProductChargeCreateSchema = cpqProductChargeBase.superRefine((data, ctx) => {\n refineChargePricingShape(ctx, data)\n})\n\nexport const cpqProductChargeUpdateSchema = cpqProductChargeBase.partial().extend({\n id: z.string().uuid(),\n}).superRefine((data, ctx) => {\n // On update, only enforce shape if pricingMethod is present in payload\n // (PATCH semantics \u2014 service merges with the persisted row).\n if (data.pricingMethod !== undefined) refineChargePricingShape(ctx, data)\n})\n\n// \u2500\u2500\u2500 Price Rule \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqPriceRuleCreateSchema = z.object({\n code: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n productOfferingId: z.string().uuid().nullish(),\n ruleType: z.enum(['discount_percent', 'discount_absolute', 'surcharge_percent', 'surcharge_absolute', 'price_override']),\n value: z.number().min(0),\n chargeCodeFilter: z.string().nullish(),\n chargeTypeFilter: z.enum(['nrc', 'mrc', 'usage']).nullish(),\n applicabilityCondition: z.record(z.string(), z.unknown()).nullish(),\n sortOrder: z.number().int().optional().default(0),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqPriceRuleUpdateSchema = cpqPriceRuleCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// \u2500\u2500\u2500 Pricing Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// V-PT-1: every dimension / price column needs a non-empty key + label,\n// and keys must be unique within their list (charges reference them by\n// key \u2014 duplicates would make lookup ambiguous).\nconst keyLabelItem = z.object({\n key: z.string().min(1, 'Key is required'),\n label: z.string().min(1, 'Label is required'),\n})\n\nconst uniqueKeys = (label: string) =>\n (items: Array<{ key: string }>, ctx: z.RefinementCtx) => {\n const seen = new Set<string>()\n items.forEach((item, idx) => {\n if (seen.has(item.key)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [idx, 'key'],\n message: `V-PT-1: duplicate ${label} key \"${item.key}\"`,\n })\n }\n seen.add(item.key)\n })\n }\n\nexport const cpqPricingTableCreateSchema = z.object({\n code: z.string().min(1),\n name: z.string().min(1),\n dimensions: z.array(keyLabelItem).superRefine(uniqueKeys('dimension')),\n priceColumns: z.array(keyLabelItem).superRefine(uniqueKeys('price column')),\n currencyCodeList: z.array(z.string().min(1)).min(1),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqPricingTableUpdateSchema = cpqPricingTableCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\nexport const cpqPricingTableEntryCreateSchema = z.object({\n pricingTableId: z.string().uuid(),\n dimensionValues: z.record(z.string(), z.string()),\n tierNumber: z.number().int().nullish(),\n rangeFrom: z.number().nullish(),\n rangeTo: z.number().nullish(),\n currencyCode: z.string().min(1).optional().default('USD'),\n prices: z.record(z.string(), z.number()),\n isActive: z.boolean().optional().default(true),\n})\n\nexport const cpqPricingTableEntryUpdateSchema = cpqPricingTableEntryCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n\n// \u2500\u2500\u2500 Quoting v2 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqQuoteTypeEnum = z.enum(['new', 'amend', 'renew', 'cancel'])\nexport const cpqArcQuoteTypeEnum = z.enum(['amend', 'renew', 'cancel'])\nexport const cpqMergeActionEnum = z.enum(['standalone', 'absorb'])\nexport const cpqArcReasonCodeEnum = z.enum([\n 'upgrade',\n 'downgrade',\n 'config-change',\n 'price-adjustment',\n 'term-extension',\n 'term-reduction',\n 'consolidation',\n 'customer-request',\n 'non-payment',\n 'contract-breach',\n 'other',\n])\n\nexport const cpqCreateQuoteSchema = z.object({\n customerId: z.string().uuid(),\n quoteId: z.string().uuid().optional(), // Link to existing SalesQuote\n dealId: z.string().uuid().optional(),\n currencyCode: z.string().min(1).optional(),\n quoteType: cpqQuoteTypeEnum.optional().default('new'),\n})\n\n// Server enforces the one-way rule (new \u2192 amend|renew|cancel only) in the\n// service layer; the schema just shapes the body.\nexport const cpqUpdateQuoteSchema = z.object({\n quoteType: cpqQuoteTypeEnum.optional(),\n})\n\nconst cpqPricePreviewItemSchema = z.object({\n offeringId: z.string().uuid().nullish(),\n productId: z.string().uuid().nullish(),\n configuration: z.record(z.string(), z.unknown()),\n}).refine(\n (item) => item.offeringId || item.productId,\n { message: 'One of offeringId or productId is required' },\n)\n\nexport const cpqPricePreviewSchema = z.object({\n primaryItem: cpqPricePreviewItemSchema.nullish(),\n childItems: z.array(cpqPricePreviewItemSchema),\n currencyCode: z.string().min(1).optional(),\n})\n\nexport const cpqAddQuoteItemSchema = z.object({\n offeringId: z.string().uuid().optional(),\n productId: z.string().uuid().optional(),\n configuration: z.record(z.string(), z.unknown()).default({}),\n quantity: z.number().int().min(1).optional().default(1),\n usageEstimates: z\n .array(\n z.object({\n chargeCode: z.string().min(1),\n estimatedQuantity: z.number().min(0),\n }),\n )\n .optional(),\n action: z.enum(['add', 'modify', 'cancel']).optional().default('add'),\n parentLineId: z.string().uuid().optional(),\n startDate: z.string().optional(),\n termMonths: z.number().int().min(1).optional(),\n endDate: z.string().optional(),\n // ARC (XD-250): per-line target sub for amend / renew (standalone) / cancel.\n targetSubscriptionId: z.string().uuid().nullish(),\n // ARC (XD-250): existing item being changed by cancel/modify lines.\n sourceSubscriptionItemId: z.string().uuid().nullish(),\n})\n\nexport const cpqUpdateQuoteItemSchema = z.object({\n configuration: z.record(z.string(), z.unknown()),\n quantity: z.number().int().min(1).optional(),\n usageEstimates: z\n .array(\n z.object({\n chargeCode: z.string().min(1),\n estimatedQuantity: z.number().min(0),\n }),\n )\n .optional(),\n startDate: z.string().optional(),\n termMonths: z.number().int().min(1).optional(),\n endDate: z.string().optional(),\n targetSubscriptionId: z.string().uuid().nullish(),\n sourceSubscriptionItemId: z.string().uuid().nullish(),\n})\n\n// \u2500\u2500\u2500 ARC (Amend / Renew / Cancel) \u2014 XD-250 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqCreateQuoteFromSubscriptionSchema = z.object({\n subscriptionId: z.string().uuid(),\n type: cpqArcQuoteTypeEnum,\n renewTerm: z\n .object({\n newTermStart: z.string().min(1),\n newTermEnd: z.string().min(1),\n newTermMonths: z.number().int().min(1).optional(),\n })\n .optional(),\n})\n\nexport const cpqAttachTargetSubscriptionSchema = z.object({\n subscriptionId: z.string().uuid(),\n quoteType: cpqArcQuoteTypeEnum,\n mergeAction: cpqMergeActionEnum.optional(),\n newTermStart: z.string().min(1).optional(),\n newTermEnd: z.string().min(1).optional(),\n newTermMonths: z.number().int().min(1).optional(),\n})\n\nexport const cpqUpdateTargetSubscriptionSchema = z.object({\n mergeAction: cpqMergeActionEnum.optional(),\n newTermStart: z.string().min(1).nullish(),\n newTermEnd: z.string().min(1).nullish(),\n newTermMonths: z.number().int().min(1).nullish(),\n})\n\nexport const cpqCancelMetaSchema = z.object({\n reasonCode: cpqArcReasonCodeEnum,\n reasonText: z.string().nullish(),\n etfAmount: z\n .union([z.string(), z.number().transform(String)])\n .nullish(),\n etfCurrency: z.string().min(1).max(3).nullish(),\n})\n\nexport const cpqMergeMetaSchema = z.object({\n newTermStart: z.string().min(1),\n newTermEnd: z.string().min(1),\n newTermMonths: z.number().int().min(1).optional(),\n newSubCode: z.string().min(1).nullish(),\n newSubName: z.string().min(1).nullish(),\n})\n\nexport const cpqExpiringSubscriptionsQuerySchema = z.object({\n withinDays: z.coerce.number().int().min(1).max(365).optional().default(30),\n customerId: z.string().uuid().optional(),\n billingCycle: z.enum(['monthly', 'quarterly', 'annually']).optional(),\n status: z.string().optional().default('active'),\n page: z.coerce.number().int().min(1).optional().default(1),\n pageSize: z.coerce.number().int().min(1).max(100).optional().default(50),\n})\n\nexport const cpqChangeLogQuerySchema = z.object({\n page: z.coerce.number().int().min(1).optional().default(1),\n pageSize: z.coerce.number().int().min(1).max(100).optional().default(50),\n})\n\nexport const cpqRecalculateSchema = z.object({\n save: z.boolean(),\n})\n\nexport const cpqTransitionStatusSchema = z.object({\n targetStatus: z.string().min(1),\n})\n\nexport const cpqValidateRelationshipsSchema = z.object({\n offeringIds: z.array(z.string().uuid()),\n parentChildPairs: z\n .array(\n z.object({\n parentOfferingId: z.string().uuid(),\n childOfferingId: z.string().uuid(),\n }),\n )\n .optional()\n})\n\n// \u2500\u2500\u2500 Wizard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst wizardTransitionConditionSchema = z.object({\n field: z.string().min(1),\n operator: z.enum(['eq', 'neq', 'gt', 'lt', 'gte', 'lte', 'exists', 'not_exists', 'in']),\n value: z.unknown().optional(),\n})\n\nconst wizardTransitionSchema = z.object({\n targetStepId: z.string().min(1),\n condition: wizardTransitionConditionSchema.optional(),\n isDefault: z.boolean().optional(),\n label: z.string().optional(),\n})\n\nconst wizardStepValidationSchema = z.object({\n field: z.string().min(1),\n operator: z.enum(['eq', 'neq', 'exists', 'not_exists']),\n value: z.unknown().optional(),\n message: z.string().min(1),\n})\n\nconst wizardStepDefinitionSchema = z.object({\n stepId: z.string().min(1),\n type: z.string().min(1),\n title: z.string().min(1),\n description: z.string().nullish(),\n config: z.record(z.string(), z.unknown()).default({}),\n transitions: z.array(wizardTransitionSchema).default([]),\n isOptional: z.boolean().optional().default(false),\n validationRules: z.array(wizardStepValidationSchema).optional(),\n})\n\nconst wizardApplicabilitySchema = z.object({\n specCodes: z.array(z.string()).optional(),\n offeringCodes: z.array(z.string()).optional(),\n customerSegments: z.array(z.string()).optional(),\n surface: z.enum(['backend', 'portal']).optional(),\n priority: z.number().int().optional().default(0),\n})\n\nexport const cpqWizardDefinitionCreateSchema = z.object({\n code: z.string().min(1),\n name: z.string().min(1),\n description: z.string().nullish(),\n steps: z.array(wizardStepDefinitionSchema).min(1),\n applicability: wizardApplicabilitySchema.nullish(),\n paramsSchema: z.record(z.string(), z.unknown()).nullish(),\n surface: z.enum(['backend', 'portal', 'any']).optional().default('backend'),\n isActive: z.boolean().optional().default(true),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\nexport const cpqWizardDefinitionUpdateSchema = cpqWizardDefinitionCreateSchema.partial().extend({\n id: z.string().uuid(),\n})\n// \u2500\u2500\u2500 Inventory Subscription \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst cpqInventorySubscriptionItemInputSchema = z.object({\n parentItemId: z.string().uuid().nullish(),\n productId: z.string().uuid().nullish(),\n offeringId: z.string().uuid().nullish(),\n specId: z.string().uuid().nullish(),\n name: z.string().min(1),\n configuration: z.record(z.string(), z.unknown()).optional().default({}),\n charges: z.array(z.record(z.string(), z.unknown())).nullish(),\n mrcAmount: z.number().optional().default(0),\n nrcAmount: z.number().optional().default(0),\n currencyCode: z.string().min(1).optional(),\n quantity: z.number().int().min(1).optional().default(1),\n capacityTotal: z.number().nullish(),\n capacityUnit: z.string().nullish(),\n sourceQuoteLineId: z.string().uuid().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n sortOrder: z.number().int().optional().default(0),\n})\n\nexport const cpqInventorySubscriptionCreateSchema = z.object({\n customerId: z.string().uuid(),\n code: z.string().min(1).optional(),\n name: z.string().min(1),\n description: z.string().nullish(),\n billingCycle: z.enum(['monthly', 'quarterly', 'annually']).optional().default('monthly'),\n currencyCode: z.string().min(1).optional(),\n startDate: z.string().nullish(),\n termMonths: z.number().int().min(1).nullish(),\n autoRenew: z.boolean().optional().default(true),\n sourceQuoteId: z.string().uuid().nullish(),\n sourceOrderId: z.string().uuid().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n items: z.array(cpqInventorySubscriptionItemInputSchema).min(1),\n})\n\nexport const cpqInventorySubscriptionUpdateSchema = z.object({\n id: z.string().uuid(),\n name: z.string().min(1).optional(),\n description: z.string().nullish(),\n billingCycle: z.enum(['monthly', 'quarterly', 'annually']).optional(),\n autoRenew: z.boolean().optional(),\n termMonths: z.number().int().min(1).nullish(),\n currentTermEnd: z.string().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\nexport const cpqInventoryStatusTransitionSchema = z.object({\n id: z.string().uuid(),\n targetStatus: z.string().min(1),\n})\n\n// \u2500\u2500\u2500 Inventory Subscription Item \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqInventorySubscriptionItemCreateSchema = z.object({\n subscriptionId: z.string().uuid(),\n parentItemId: z.string().uuid().nullish(),\n productId: z.string().uuid().nullish(),\n offeringId: z.string().uuid().nullish(),\n specId: z.string().uuid().nullish(),\n name: z.string().min(1),\n configuration: z.record(z.string(), z.unknown()).optional().default({}),\n charges: z.array(z.record(z.string(), z.unknown())).nullish(),\n mrcAmount: z.number().optional().default(0),\n nrcAmount: z.number().optional().default(0),\n currencyCode: z.string().min(1).optional(),\n quantity: z.number().int().min(1).optional().default(1),\n capacityTotal: z.number().nullish(),\n capacityUnit: z.string().nullish(),\n sourceQuoteLineId: z.string().uuid().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n sortOrder: z.number().int().optional().default(0),\n})\n\nexport const cpqInventorySubscriptionItemUpdateSchema = z.object({\n id: z.string().uuid(),\n name: z.string().min(1).optional(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n capacityTotal: z.number().nullish(),\n capacityUsed: z.number().nullish(),\n capacityUnit: z.string().nullish(),\n sortOrder: z.number().int().optional(),\n})\n\n// \u2500\u2500\u2500 Inventory Asset \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqInventoryAssetCreateSchema = z.object({\n customerId: z.string().uuid(),\n subscriptionId: z.string().uuid().nullish(),\n subscriptionItemId: z.string().uuid().nullish(),\n productId: z.string().uuid().nullish(),\n offeringId: z.string().uuid().nullish(),\n specId: z.string().uuid().nullish(),\n code: z.string().min(1).optional(),\n name: z.string().min(1),\n description: z.string().nullish(),\n assetType: z.enum(['one_time', 'license', 'physical', 'logical']).optional().default('one_time'),\n currencyCode: z.string().min(1).optional(),\n purchasePrice: z.number().optional().default(0),\n quantity: z.number().int().min(1).optional().default(1),\n purchaseDate: z.string().nullish(),\n deliveryDate: z.string().nullish(),\n configuration: z.record(z.string(), z.unknown()).optional().default({}),\n charges: z.array(z.record(z.string(), z.unknown())).nullish(),\n sourceQuoteId: z.string().uuid().nullish(),\n sourceOrderId: z.string().uuid().nullish(),\n sourceQuoteLineId: z.string().uuid().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\nexport const cpqInventoryAssetUpdateSchema = z.object({\n id: z.string().uuid(),\n name: z.string().min(1).optional(),\n description: z.string().nullish(),\n assetType: z.enum(['one_time', 'license', 'physical', 'logical']).optional(),\n deliveryDate: z.string().nullish(),\n metadata: z.record(z.string(), z.unknown()).nullish(),\n})\n\n// \u2500\u2500\u2500 CPQ Orders \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const cpqConvertQuoteToOrderSchema = z.object({\n quoteId: z.string().uuid(),\n})\n\nexport const cpqOrderStatusTransitionSchema = z.object({\n targetStatus: z.string().min(1),\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAIX,MAAM,sCAAsC,EAAE,OAAO;AAAA,EAC1D,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,EACtC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,aAAa,EAAE,OAAO,EAAE,QAAQ;AAAA,EAChC,UAAU,EAAE,KAAK,CAAC,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,QAAQ,QAAQ;A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,EAC5D,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ;AAAA,EACzC,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ;AAAA,EACzC,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ;AAAA,EAC7C,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ;AACtD,CAAC;AAEM,MAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,IAAI,EAAE,OAAO,EAAE,KAAK;AAAA,EACpB,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACjC,aAAa,EAAE,OAAO,EAAE,QAAQ;AAAA,EAChC,WAAW,EAAE,KAAK,CAAC,YAAY,WAAW,YAAY,SAAS,CAAC,EAAE,SAAS;AAAA,EAC3E,cAAc,EAAE,OAAO,EAAE,QAAQ;AAAA,EACjC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ;AACtD,CAAC;AAIM,MAAM,+BAA+B,EAAE,OAAO;AAAA,EACnD,SAAS,EAAE,OAAO,EAAE,KAAK;AAC3B,CAAC;AAEM,MAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC;AAChC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { asFunction } from "awilix";
|
|
2
|
+
import { DefaultCpqPricingService } from "./services/cpqPricingService.js";
|
|
3
|
+
import { DefaultCpqValidationService } from "./services/cpqValidationService.js";
|
|
4
|
+
import { DefaultCpqProductService } from "./services/cpqProductService.js";
|
|
5
|
+
import { DefaultCpqQuotingService } from "./services/cpqQuotingService.js";
|
|
6
|
+
import { DefaultCpqWizardService } from "./services/cpqWizardService.js";
|
|
7
|
+
import { DefaultCpqInventoryService } from "./services/cpqInventoryService.js";
|
|
8
|
+
import { DefaultCpqOrderService } from "./services/cpqOrderService.js";
|
|
9
|
+
import { DefaultCpqBundleService } from "./services/cpqBundleService.js";
|
|
10
|
+
function register(container) {
|
|
11
|
+
container.register({
|
|
12
|
+
cpqPricingService: asFunction(({ em }) => {
|
|
13
|
+
return new DefaultCpqPricingService(em);
|
|
14
|
+
}).scoped().proxy(),
|
|
15
|
+
cpqValidationService: asFunction(({ em }) => {
|
|
16
|
+
return new DefaultCpqValidationService(em);
|
|
17
|
+
}).scoped().proxy(),
|
|
18
|
+
cpqProductService: asFunction(({ em }) => {
|
|
19
|
+
return new DefaultCpqProductService(em);
|
|
20
|
+
}).scoped().proxy(),
|
|
21
|
+
cpqQuotingService: asFunction(({
|
|
22
|
+
em,
|
|
23
|
+
cpqPricingService,
|
|
24
|
+
cpqValidationService,
|
|
25
|
+
cpqProductService,
|
|
26
|
+
salesDocumentNumberGenerator
|
|
27
|
+
}) => {
|
|
28
|
+
return new DefaultCpqQuotingService({
|
|
29
|
+
em: container.resolve("em"),
|
|
30
|
+
cpqPricingService: container.resolve("cpqPricingService"),
|
|
31
|
+
cpqValidationService: container.resolve("cpqValidationService"),
|
|
32
|
+
cpqProductService: container.resolve("cpqProductService"),
|
|
33
|
+
salesDocumentNumberGenerator: container.resolve("salesDocumentNumberGenerator")
|
|
34
|
+
});
|
|
35
|
+
}).scoped().proxy(),
|
|
36
|
+
cpqInventoryService: asFunction(() => {
|
|
37
|
+
return new DefaultCpqInventoryService(container.resolve("em"));
|
|
38
|
+
}).scoped(),
|
|
39
|
+
cpqOrderService: asFunction(() => {
|
|
40
|
+
return new DefaultCpqOrderService({
|
|
41
|
+
em: container.resolve("em"),
|
|
42
|
+
cpqInventoryService: container.resolve("cpqInventoryService"),
|
|
43
|
+
salesDocumentNumberGenerator: container.resolve("salesDocumentNumberGenerator")
|
|
44
|
+
});
|
|
45
|
+
}).scoped(),
|
|
46
|
+
cpqWizardService: asFunction(({ em }) => {
|
|
47
|
+
return new DefaultCpqWizardService(em);
|
|
48
|
+
}).scoped().proxy(),
|
|
49
|
+
cpqBundleService: asFunction(() => {
|
|
50
|
+
return new DefaultCpqBundleService(container.resolve("em"));
|
|
51
|
+
}).scoped()
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
register
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=di.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/cpq/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { asFunction } from 'awilix'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport type { SalesDocumentNumberGenerator } from '@open-mercato/core/modules/sales/services/salesDocumentNumberGenerator'\nimport { DefaultCpqPricingService } from './services/cpqPricingService'\nimport { DefaultCpqValidationService } from './services/cpqValidationService'\nimport { DefaultCpqProductService } from './services/cpqProductService'\nimport { DefaultCpqQuotingService } from './services/cpqQuotingService'\nimport { DefaultCpqWizardService } from './services/cpqWizardService'\nimport { DefaultCpqInventoryService } from './services/cpqInventoryService'\nimport { DefaultCpqOrderService } from './services/cpqOrderService'\nimport { DefaultCpqBundleService } from './services/cpqBundleService'\n\n/**\n * Resolve dependencies from the container closure rather than via destructured\n * factory parameters. The container uses InjectionMode.CLASSIC, and Turbopack\n * transpiles destructured arrow functions in a way that breaks Awilix's\n * parameter-name parser. Core modules are unaffected because they ship\n * pre-compiled in node_modules.\n */\nexport function register(container: AppContainer) {\n container.register({\n cpqPricingService: asFunction(({ em }: { em: EntityManager }) => {\n return new DefaultCpqPricingService(em)\n }).scoped().proxy(),\n cpqValidationService: asFunction(({ em }: { em: EntityManager }) => {\n return new DefaultCpqValidationService(em)\n }).scoped().proxy(),\n cpqProductService: asFunction(({ em }: { em: EntityManager }) => {\n return new DefaultCpqProductService(em)\n }).scoped().proxy(),\n cpqQuotingService: asFunction(({\n em,\n cpqPricingService,\n cpqValidationService,\n cpqProductService,\n salesDocumentNumberGenerator,\n }: {\n em: EntityManager\n cpqPricingService: DefaultCpqPricingService\n cpqValidationService: DefaultCpqValidationService\n cpqProductService: DefaultCpqProductService\n salesDocumentNumberGenerator: SalesDocumentNumberGenerator\n }) => {\n return new DefaultCpqQuotingService({\n em: container.resolve('em'),\n cpqPricingService: container.resolve('cpqPricingService'),\n cpqValidationService: container.resolve('cpqValidationService'),\n cpqProductService: container.resolve('cpqProductService'),\n salesDocumentNumberGenerator: container.resolve('salesDocumentNumberGenerator'),\n })\n }).scoped().proxy(),\n cpqInventoryService: asFunction(() => {\n return new DefaultCpqInventoryService(container.resolve('em'))\n }).scoped(),\n cpqOrderService: asFunction(() => {\n return new DefaultCpqOrderService({\n em: container.resolve('em'),\n cpqInventoryService: container.resolve('cpqInventoryService'),\n salesDocumentNumberGenerator: container.resolve('salesDocumentNumberGenerator'),\n })\n }).scoped(),\n cpqWizardService: asFunction(({ em }: { em: EntityManager }) => {\n return new DefaultCpqWizardService(em)\n }).scoped().proxy(),\n cpqBundleService: asFunction(() => {\n return new DefaultCpqBundleService(container.resolve('em'))\n }).scoped(),\n })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAI3B,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;AAC5C,SAAS,gCAAgC;AACzC,SAAS,gCAAgC;AACzC,SAAS,+BAA+B;AACxC,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAS,+BAA+B;AASjC,SAAS,SAAS,WAAyB;AAChD,YAAU,SAAS;AAAA,IACjB,mBAAmB,WAAW,CAAC,EAAE,GAAG,MAA6B;AAC/D,aAAO,IAAI,yBAAyB,EAAE;AAAA,IACxC,CAAC,EAAE,OAAO,EAAE,MAAM;AAAA,IAClB,sBAAsB,WAAW,CAAC,EAAE,GAAG,MAA6B;AAClE,aAAO,IAAI,4BAA4B,EAAE;AAAA,IAC3C,CAAC,EAAE,OAAO,EAAE,MAAM;AA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/modules/events";
|
|
2
|
+
const events = [
|
|
3
|
+
{
|
|
4
|
+
id: "cpq.subscription.amended",
|
|
5
|
+
label: "Subscription Amended",
|
|
6
|
+
entity: "subscription",
|
|
7
|
+
category: "lifecycle",
|
|
8
|
+
clientBroadcast: true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "cpq.subscription.renewed",
|
|
12
|
+
label: "Subscription Renewed",
|
|
13
|
+
entity: "subscription",
|
|
14
|
+
category: "lifecycle",
|
|
15
|
+
clientBroadcast: true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "cpq.subscription.merged",
|
|
19
|
+
label: "Subscription Merged",
|
|
20
|
+
entity: "subscription",
|
|
21
|
+
category: "lifecycle",
|
|
22
|
+
clientBroadcast: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "cpq.subscription.cancelled",
|
|
26
|
+
label: "Subscription Cancelled",
|
|
27
|
+
entity: "subscription",
|
|
28
|
+
category: "lifecycle",
|
|
29
|
+
clientBroadcast: true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "cpq.subscription.superseded",
|
|
33
|
+
label: "Subscription Superseded",
|
|
34
|
+
entity: "subscription",
|
|
35
|
+
category: "lifecycle",
|
|
36
|
+
clientBroadcast: true
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const eventsConfig = createModuleEvents({
|
|
40
|
+
moduleId: "cpq",
|
|
41
|
+
events
|
|
42
|
+
});
|
|
43
|
+
const emitCpqEvent = eventsConfig.emit;
|
|
44
|
+
var events_default = eventsConfig;
|
|
45
|
+
export {
|
|
46
|
+
events_default as default,
|
|
47
|
+
emitCpqEvent,
|
|
48
|
+
eventsConfig
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/cpq/events.ts"],
|
|
4
|
+
"sourcesContent": ["import { createModuleEvents } from '@open-mercato/shared/modules/events'\n\n/**\n * CPQ Module Events.\n *\n * Currently only the XD-250 ARC (Amend / Renew / Cancel) lifecycle events\n * are declared here. Downstream modules (billing, notifications) subscribe\n * to these to react to subscription mutations driven by CPQ orders.\n *\n * Emission rule: events fire AFTER the activation transaction commits.\n * `cpqOrderService.activateOrder` is the sole emitter site.\n */\nconst events = [\n {\n id: 'cpq.subscription.amended',\n label: 'Subscription Amended',\n entity: 'subscription',\n category: 'lifecycle',\n clientBroadcast: true,\n },\n {\n id: 'cpq.subscription.renewed',\n label: 'Subscription Renewed',\n entity: 'subscription',\n category: 'lifecycle',\n clientBroadcast: true,\n },\n {\n id: 'cpq.subscription.merged',\n label: 'Subscription Merged',\n entity: 'subscription',\n category: 'lifecycle',\n clientBroadcast: true,\n },\n {\n id: 'cpq.subscription.cancelled',\n label: 'Subscription Cancelled',\n entity: 'subscription',\n category: 'lifecycle',\n clientBroadcast: true,\n },\n {\n id: 'cpq.subscription.superseded',\n label: 'Subscription Superseded',\n entity: 'subscription',\n category: 'lifecycle',\n clientBroadcast: true,\n },\n] as const\n\nexport const eventsConfig = createModuleEvents({\n moduleId: 'cpq',\n events,\n})\n\n/** Type-safe event emitter for the CPQ module. */\nexport const emitCpqEvent = eventsConfig.emit\n\n/** Event IDs that can be emitted by the CPQ module. */\nexport type CpqEventId = (typeof events)[number]['id']\n\nexport default eventsConfig\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,0BAA0B;AAYnC,MAAM,SAAS;AAAA,EACb;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,iBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,iBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,iBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,iBAAiB;AAAA,EACnB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,iBAAiB;AAAA,EACnB;AACF;AAEO,MAAM,eAAe,mBAAmB;AAAA,EAC7C,UAAU;AAAA,EACV;AACF,CAAC;AAGM,MAAM,eAAe,aAAa;AAKzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const metadata = {
|
|
2
|
+
name: "cpq",
|
|
3
|
+
title: "Configure, Price, Quote",
|
|
4
|
+
version: "0.1.0",
|
|
5
|
+
description: "Generic CPQ engine \u2014 configurable product attributes, multi-charge pricing tables, and guided quoting flows.",
|
|
6
|
+
author: "App",
|
|
7
|
+
license: "Proprietary",
|
|
8
|
+
requires: ["auth", "directory", "catalog", "sales", "customers", "dictionaries"],
|
|
9
|
+
ejectable: false
|
|
10
|
+
};
|
|
11
|
+
import { features } from "./acl.js";
|
|
12
|
+
export {
|
|
13
|
+
features,
|
|
14
|
+
metadata
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/cpq/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ModuleInfo } from '@open-mercato/shared/modules/registry'\n\nexport const metadata: ModuleInfo = {\n name: 'cpq',\n title: 'Configure, Price, Quote',\n version: '0.1.0',\n description:\n 'Generic CPQ engine \u2014 configurable product attributes, multi-charge pricing tables, and guided quoting flows.',\n author: 'App',\n license: 'Proprietary',\n requires: ['auth', 'directory', 'catalog', 'sales', 'customers', 'dictionaries'],\n ejectable: false,\n}\n\nexport { features } from './acl'\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,WAAuB;AAAA,EAClC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aACE;AAAA,EACF,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU,CAAC,QAAQ,aAAa,WAAW,SAAS,aAAa,cAAc;AAAA,EAC/E,WAAW;AACb;AAEA,SAAS,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const registry = /* @__PURE__ */ new Map();
|
|
2
|
+
function registerCpqUseCase(useCase) {
|
|
3
|
+
if (!useCase || typeof useCase.id !== "string" || useCase.id.length === 0) {
|
|
4
|
+
throw new Error("registerCpqUseCase: useCase.id is required");
|
|
5
|
+
}
|
|
6
|
+
if (!useCase.tenant || typeof useCase.tenant.adminEmail !== "string") {
|
|
7
|
+
throw new Error(`registerCpqUseCase[${useCase.id}]: tenant.adminEmail is required`);
|
|
8
|
+
}
|
|
9
|
+
if (typeof useCase.seedDefaults !== "function") {
|
|
10
|
+
throw new Error(`registerCpqUseCase[${useCase.id}]: seedDefaults must be a function`);
|
|
11
|
+
}
|
|
12
|
+
if (registry.has(useCase.id)) {
|
|
13
|
+
console.warn(`[cpq:seeds] Use case "${useCase.id}" re-registered \u2014 replacing prior registration.`);
|
|
14
|
+
}
|
|
15
|
+
registry.set(useCase.id, useCase);
|
|
16
|
+
}
|
|
17
|
+
function listCpqUseCases() {
|
|
18
|
+
return Array.from(registry.values());
|
|
19
|
+
}
|
|
20
|
+
function getCpqUseCase(id) {
|
|
21
|
+
return registry.get(id);
|
|
22
|
+
}
|
|
23
|
+
function clearCpqUseCases() {
|
|
24
|
+
registry.clear();
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
clearCpqUseCases,
|
|
28
|
+
getCpqUseCase,
|
|
29
|
+
listCpqUseCases,
|
|
30
|
+
registerCpqUseCase
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/cpq/lib/seeds/api.ts"],
|
|
4
|
+
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\nimport type { AwilixContainer } from 'awilix'\n\n/**\n * Public API for the CPQ multi-tenant use-case seeding system (XD-276).\n *\n * A use case is a self-contained, idempotent unit that knows how to seed one\n * tenant's worth of CPQ data (products, pricing tables, charges, attributes,\n * price rules, bundles, wizards, optional demo customers/quotes).\n *\n * Use cases live OUTSIDE the cpq module (in `src/modules/@app/demo_<x>/`) so\n * the cpq module remains free of customer-specific demo data when it is\n * extracted to `@dainamite/cpq` per SPEC-001.\n *\n * Registration is process-local module state \u2014 populated when each demo\n * module is imported by the framework's module bootstrap. The orchestrator\n * (`@app/demo_tenants`) walks this registry at init time.\n */\n\nexport type CpqUseCaseAdditionalUserSpec = {\n /** Email address for the additional user, e.g. `employee@gix.com`. */\n email: string\n /** Initial password (dev-only \u2014 overridable via env). */\n password: string\n /** Optional display name. */\n displayName?: string\n /** Roles assigned to this user. Default `['employee']`. */\n roles?: string[]\n}\n\nexport type CpqUseCaseTenantSpec = {\n /** Stable slug used as a key in env overrides, e.g. `gix`, `puffin`. */\n slug: string\n /** Tenant display name, e.g. `GIX Network Services Tenant`. */\n tenantName: string\n /** Organization display name, e.g. `GIX`. Defaults to `tenantName` if omitted. */\n organizationName?: string\n /** Primary admin email. e.g. `admin@gix.com`. */\n adminEmail: string\n /** Initial admin password (dev-only \u2014 overridable via env). */\n adminPassword: string\n /** Optional display name for the admin user. */\n adminDisplayName?: string\n /** Roles to ensure on the tenant; default `['admin', 'employee']` (no superadmin). */\n roleNames?: string[]\n /** Roles assigned to the primary admin user. Default `['admin']`. */\n primaryUserRoles?: string[]\n /** Whether to also create the derived `employee@<domain>` user. Default `false`. */\n includeDerivedUsers?: boolean\n /**\n * Additional users to provision in this tenant alongside the admin.\n * Each entry is created idempotently with the specified roles. Use this\n * to seed e.g. `employee@gix.com` so a non-admin login is available.\n */\n additionalUsers?: CpqUseCaseAdditionalUserSpec[]\n}\n\nexport type CpqUseCaseSeedContext = {\n em: EntityManager\n container: AwilixContainer\n tenantId: string\n organizationId: string\n /**\n * False when invoked under `mercato init --no-examples` \u2014 seeders MUST skip\n * any demo customer/quote/order creation. seedDefaults still runs.\n */\n withExamples: boolean\n}\n\nexport type CpqUseCase = {\n /** Stable id used by CLI flags and env vars; e.g. `gix`, `puffin`. */\n id: string\n /** Tenant provisioning spec \u2014 passed to `ensureDemoTenant`. */\n tenant: CpqUseCaseTenantSpec\n /** Idempotent. Seeds the catalog: specs, offerings, attributes, charges, pricing tables, rules, bundles, wizards. */\n seedDefaults(ctx: CpqUseCaseSeedContext): Promise<void>\n /** Optional. Seeds demo customers, quotes, orders. Skipped when --no-examples or CPQ_DEMO_SKIP_EXAMPLES. */\n seedExamples?(ctx: CpqUseCaseSeedContext): Promise<void>\n}\n\nconst registry = new Map<string, CpqUseCase>()\n\n/**\n * Register a use case. Called from the demo module's `setup.ts` on import.\n *\n * Re-registration with the same id overwrites and emits a warning. This keeps\n * dev-server HMR working without throwing on every reload, while still\n * surfacing accidental duplicate ids in logs.\n */\nexport function registerCpqUseCase(useCase: CpqUseCase): void {\n if (!useCase || typeof useCase.id !== 'string' || useCase.id.length === 0) {\n throw new Error('registerCpqUseCase: useCase.id is required')\n }\n if (!useCase.tenant || typeof useCase.tenant.adminEmail !== 'string') {\n throw new Error(`registerCpqUseCase[${useCase.id}]: tenant.adminEmail is required`)\n }\n if (typeof useCase.seedDefaults !== 'function') {\n throw new Error(`registerCpqUseCase[${useCase.id}]: seedDefaults must be a function`)\n }\n if (registry.has(useCase.id)) {\n console.warn(`[cpq:seeds] Use case \"${useCase.id}\" re-registered \u2014 replacing prior registration.`)\n }\n registry.set(useCase.id, useCase)\n}\n\n/** Returns all registered use cases in registration order. */\nexport function listCpqUseCases(): CpqUseCase[] {\n return Array.from(registry.values())\n}\n\n/** Returns the use case with the given id, or undefined. */\nexport function getCpqUseCase(id: string): CpqUseCase | undefined {\n return registry.get(id)\n}\n\n/** Test-only helper to reset the registry between unit tests. */\nexport function clearCpqUseCases(): void {\n registry.clear()\n}\n"],
|
|
5
|
+
"mappings": "AAgFA,MAAM,WAAW,oBAAI,IAAwB;AAStC,SAAS,mBAAmB,SAA2B;AAC5D,MAAI,CAAC,WAAW,OAAO,QAAQ,OAAO,YAAY,QAAQ,GAAG,WAAW,GAAG;AACzE,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AACA,MAAI,CAAC,QAAQ,UAAU,OAAO,QAAQ,OAAO,eAAe,UAAU;AACpE,UAAM,IAAI,MAAM,sBAAsB,QAAQ,EAAE,kCAAkC;AAAA,EACpF;AACA,MAAI,OAAO,QAAQ,iBAAiB,YAAY;AAC9C,UAAM,IAAI,MAAM,sBAAsB,QAAQ,EAAE,oCAAoC;AAAA,EACtF;AACA,MAAI,SAAS,IAAI,QAAQ,EAAE,GAAG;AAC5B,YAAQ,KAAK,yBAAyB,QAAQ,EAAE,sDAAiD;AAAA,EACnG;AACA,WAAS,IAAI,QAAQ,IAAI,OAAO;AAClC;AAGO,SAAS,kBAAgC;AAC9C,SAAO,MAAM,KAAK,SAAS,OAAO,CAAC;AACrC;AAGO,SAAS,cAAc,IAAoC;AAChE,SAAO,SAAS,IAAI,EAAE;AACxB;AAGO,SAAS,mBAAyB;AACvC,WAAS,MAAM;AACjB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { hash } from "bcryptjs";
|
|
2
|
+
import { setupInitialTenant } from "@open-mercato/core/modules/auth/lib/setup-app";
|
|
3
|
+
import { computeEmailHash } from "@open-mercato/core/modules/auth/lib/emailHash";
|
|
4
|
+
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
5
|
+
import { Role, User, UserRole } from "@open-mercato/core/modules/auth/data/entities";
|
|
6
|
+
import { isTenantDataEncryptionEnabled } from "@open-mercato/shared/lib/encryption/toggles";
|
|
7
|
+
import { TenantDataEncryptionService } from "@open-mercato/shared/lib/encryption/tenantDataEncryptionService";
|
|
8
|
+
import { createKmsService } from "@open-mercato/shared/lib/encryption/kms";
|
|
9
|
+
async function ensureDemoTenant(em, _container, spec, options = {}) {
|
|
10
|
+
const orgName = spec.organizationName ?? spec.tenantName;
|
|
11
|
+
const roleNames = spec.roleNames ?? ["admin", "employee"];
|
|
12
|
+
const primaryUserRoles = spec.primaryUserRoles ?? ["admin"];
|
|
13
|
+
const includeDerivedUsers = spec.includeDerivedUsers ?? false;
|
|
14
|
+
const result = await setupInitialTenant(em, {
|
|
15
|
+
orgName,
|
|
16
|
+
roleNames,
|
|
17
|
+
primaryUser: {
|
|
18
|
+
email: spec.adminEmail,
|
|
19
|
+
password: spec.adminPassword,
|
|
20
|
+
displayName: spec.adminDisplayName,
|
|
21
|
+
confirm: true
|
|
22
|
+
},
|
|
23
|
+
primaryUserRoles,
|
|
24
|
+
includeSuperadminRole: false,
|
|
25
|
+
includeDerivedUsers,
|
|
26
|
+
failIfUserExists: false,
|
|
27
|
+
modules: options.modules
|
|
28
|
+
});
|
|
29
|
+
const primarySnapshot = result.users.find(
|
|
30
|
+
(entry) => entry.user.email?.toLowerCase() === spec.adminEmail.toLowerCase()
|
|
31
|
+
);
|
|
32
|
+
let adminUserId = primarySnapshot?.user.id ? String(primarySnapshot.user.id) : null;
|
|
33
|
+
if (!adminUserId) {
|
|
34
|
+
const fallback = await findOneWithDecryption(
|
|
35
|
+
em,
|
|
36
|
+
User,
|
|
37
|
+
{ email: spec.adminEmail },
|
|
38
|
+
{},
|
|
39
|
+
{ tenantId: result.tenantId, organizationId: result.organizationId }
|
|
40
|
+
);
|
|
41
|
+
adminUserId = fallback ? String(fallback.id) : null;
|
|
42
|
+
}
|
|
43
|
+
if (!adminUserId) {
|
|
44
|
+
throw new Error(`ensureDemoTenant: failed to resolve admin user id for ${spec.adminEmail}`);
|
|
45
|
+
}
|
|
46
|
+
if (spec.additionalUsers && spec.additionalUsers.length > 0) {
|
|
47
|
+
for (const userSpec of spec.additionalUsers) {
|
|
48
|
+
await ensureAdditionalUser(em, {
|
|
49
|
+
tenantId: result.tenantId,
|
|
50
|
+
organizationId: result.organizationId,
|
|
51
|
+
spec: userSpec
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
tenantId: result.tenantId,
|
|
57
|
+
organizationId: result.organizationId,
|
|
58
|
+
adminUserId,
|
|
59
|
+
created: !result.reusedExistingUser
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async function findDemoTenant(em, spec) {
|
|
63
|
+
const user = await findOneWithDecryption(
|
|
64
|
+
em,
|
|
65
|
+
User,
|
|
66
|
+
{ email: spec.adminEmail },
|
|
67
|
+
{},
|
|
68
|
+
{ tenantId: null, organizationId: null }
|
|
69
|
+
);
|
|
70
|
+
if (!user || !user.tenantId || !user.organizationId) return null;
|
|
71
|
+
return {
|
|
72
|
+
tenantId: String(user.tenantId),
|
|
73
|
+
organizationId: String(user.organizationId),
|
|
74
|
+
adminUserId: String(user.id),
|
|
75
|
+
created: false
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
async function ensureAdditionalUser(em, args) {
|
|
79
|
+
const { tenantId, organizationId, spec } = args;
|
|
80
|
+
const roles = spec.roles && spec.roles.length > 0 ? spec.roles : ["employee"];
|
|
81
|
+
const existing = await findOneWithDecryption(
|
|
82
|
+
em,
|
|
83
|
+
User,
|
|
84
|
+
{ email: spec.email },
|
|
85
|
+
{},
|
|
86
|
+
{ tenantId: null, organizationId: null }
|
|
87
|
+
);
|
|
88
|
+
let user;
|
|
89
|
+
if (existing) {
|
|
90
|
+
user = existing;
|
|
91
|
+
if (!user.tenantId) user.tenantId = tenantId;
|
|
92
|
+
if (!user.organizationId) user.organizationId = organizationId;
|
|
93
|
+
if (user.isConfirmed === false) user.isConfirmed = true;
|
|
94
|
+
em.persist(user);
|
|
95
|
+
await em.flush();
|
|
96
|
+
} else {
|
|
97
|
+
const passwordHash = await hash(spec.password, 10);
|
|
98
|
+
let emailValue = spec.email;
|
|
99
|
+
let emailHashValue = computeEmailHash(spec.email);
|
|
100
|
+
if (isTenantDataEncryptionEnabled()) {
|
|
101
|
+
try {
|
|
102
|
+
const encryptionService = new TenantDataEncryptionService(em, { kms: createKmsService() });
|
|
103
|
+
await encryptionService.invalidateMap("auth:user", tenantId, organizationId);
|
|
104
|
+
const encrypted = await encryptionService.encryptEntityPayload(
|
|
105
|
+
"auth:user",
|
|
106
|
+
{ email: spec.email },
|
|
107
|
+
tenantId,
|
|
108
|
+
organizationId
|
|
109
|
+
);
|
|
110
|
+
emailValue = encrypted.email ?? spec.email;
|
|
111
|
+
emailHashValue = encrypted.emailHash ?? computeEmailHash(spec.email);
|
|
112
|
+
} catch (err) {
|
|
113
|
+
console.warn(`[cpq:tenant-provisioning] Failed to encrypt additional user payload, falling back to plaintext (${err.message})`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
user = em.create(User, {
|
|
117
|
+
email: emailValue,
|
|
118
|
+
emailHash: emailHashValue,
|
|
119
|
+
passwordHash,
|
|
120
|
+
organizationId,
|
|
121
|
+
tenantId,
|
|
122
|
+
name: spec.displayName ?? void 0,
|
|
123
|
+
isConfirmed: true,
|
|
124
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
125
|
+
});
|
|
126
|
+
em.persist(user);
|
|
127
|
+
await em.flush();
|
|
128
|
+
}
|
|
129
|
+
for (const roleName of roles) {
|
|
130
|
+
const role = await findOneWithDecryption(
|
|
131
|
+
em,
|
|
132
|
+
Role,
|
|
133
|
+
{ name: roleName, tenantId },
|
|
134
|
+
{},
|
|
135
|
+
{ tenantId, organizationId: null }
|
|
136
|
+
);
|
|
137
|
+
if (!role) {
|
|
138
|
+
console.warn(`[cpq:tenant-provisioning] Role "${roleName}" not found for tenant ${tenantId}; skipping link for ${spec.email}`);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const link = await findOneWithDecryption(
|
|
142
|
+
em,
|
|
143
|
+
UserRole,
|
|
144
|
+
{ user, role },
|
|
145
|
+
{},
|
|
146
|
+
{ tenantId, organizationId: null }
|
|
147
|
+
);
|
|
148
|
+
if (!link) {
|
|
149
|
+
em.persist(em.create(UserRole, { user, role, createdAt: /* @__PURE__ */ new Date() }));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
await em.flush();
|
|
153
|
+
}
|
|
154
|
+
export {
|
|
155
|
+
ensureDemoTenant,
|
|
156
|
+
findDemoTenant
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=tenant-provisioning.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/cpq/lib/seeds/tenant-provisioning.ts"],
|
|
4
|
+
"sourcesContent": ["import { hash } from 'bcryptjs'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { AwilixContainer } from 'awilix'\nimport { setupInitialTenant } from '@open-mercato/core/modules/auth/lib/setup-app'\nimport { computeEmailHash } from '@open-mercato/core/modules/auth/lib/emailHash'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { Role, User, UserRole } from '@open-mercato/core/modules/auth/data/entities'\nimport { isTenantDataEncryptionEnabled } from '@open-mercato/shared/lib/encryption/toggles'\nimport { TenantDataEncryptionService } from '@open-mercato/shared/lib/encryption/tenantDataEncryptionService'\nimport { createKmsService } from '@open-mercato/shared/lib/encryption/kms'\nimport type { Module } from '@open-mercato/shared/modules/registry'\nimport type { CpqUseCaseAdditionalUserSpec, CpqUseCaseTenantSpec } from './api'\n\n/**\n * Outcome of `ensureDemoTenant`. `created` is true iff this call provisioned\n * a new tenant; false if an existing tenant was reused (idempotent re-runs).\n */\nexport type EnsuredTenant = {\n tenantId: string\n organizationId: string\n adminUserId: string\n created: boolean\n}\n\nexport type EnsureDemoTenantOptions = {\n /**\n * The full module list, used by `setupInitialTenant` to merge each module's\n * `defaultRoleFeatures` into the tenant's role ACLs. MUST be passed when\n * called from CLI bootstrap \u2014 otherwise the framework falls back to the\n * runtime registry which may be empty in CLI context, leaving the new\n * admin role with zero features (e.g. missing `dashboards.view`).\n */\n modules?: Module[]\n}\n\n/**\n * Idempotent tenant provisioning for demo/use-case seeds (XD-276).\n *\n * Wraps `setupInitialTenant` from `@open-mercato/core/auth` so each demo\n * tenant is bootstrapped through the same code path the framework uses for\n * the primary tenant.\n *\n * Behavior:\n * - If a user with `spec.adminEmail` already exists, return that tenant \u2014\n * no-op idempotent path. Re-running `yarn initialize` is safe.\n * - Otherwise create Tenant, Organization, default Roles, primary admin\n * user (and optionally a derived employee user), assign roles, and\n * run all module `onTenantCreated` hooks.\n * - After the admin tenant exists, every entry in `spec.additionalUsers`\n * is provisioned idempotently in the new tenant scope.\n *\n * Demo tenants intentionally do NOT include the `superadmin` role \u2014 the\n * only superadmin in the system is the one created by `mercato init` for\n * the primary (ACME) tenant. Cross-tenant visibility for the primary\n * superadmin is the framework default and is preserved.\n *\n * Password policy is bypassed implicitly: this helper calls\n * `setupInitialTenant` directly (not via the `mercato auth setup` CLI\n * command), and the policy check lives only in the CLI wrapper.\n */\nexport async function ensureDemoTenant(\n em: EntityManager,\n _container: AwilixContainer,\n spec: CpqUseCaseTenantSpec,\n options: EnsureDemoTenantOptions = {},\n): Promise<EnsuredTenant> {\n const orgName = spec.organizationName ?? spec.tenantName\n const roleNames = spec.roleNames ?? ['admin', 'employee']\n const primaryUserRoles = spec.primaryUserRoles ?? ['admin']\n const includeDerivedUsers = spec.includeDerivedUsers ?? false\n\n const result = await setupInitialTenant(em, {\n orgName,\n roleNames,\n primaryUser: {\n email: spec.adminEmail,\n password: spec.adminPassword,\n displayName: spec.adminDisplayName,\n confirm: true,\n },\n primaryUserRoles,\n includeSuperadminRole: false,\n includeDerivedUsers,\n failIfUserExists: false,\n modules: options.modules,\n })\n\n const primarySnapshot = result.users.find(\n (entry) => entry.user.email?.toLowerCase() === spec.adminEmail.toLowerCase(),\n )\n let adminUserId = primarySnapshot?.user.id ? String(primarySnapshot.user.id) : null\n\n if (!adminUserId) {\n const fallback = await findOneWithDecryption(\n em,\n User,\n { email: spec.adminEmail },\n {},\n { tenantId: result.tenantId, organizationId: result.organizationId },\n )\n adminUserId = fallback ? String(fallback.id) : null\n }\n\n if (!adminUserId) {\n throw new Error(`ensureDemoTenant: failed to resolve admin user id for ${spec.adminEmail}`)\n }\n\n if (spec.additionalUsers && spec.additionalUsers.length > 0) {\n for (const userSpec of spec.additionalUsers) {\n await ensureAdditionalUser(em, {\n tenantId: result.tenantId,\n organizationId: result.organizationId,\n spec: userSpec,\n })\n }\n }\n\n return {\n tenantId: result.tenantId,\n organizationId: result.organizationId,\n adminUserId,\n created: !result.reusedExistingUser,\n }\n}\n\n/**\n * Look up a previously-provisioned demo tenant by admin email without\n * creating anything. Returns null if not found.\n *\n * Useful for CLI commands that operate on existing tenants (e.g. `seed\n * --use-case puffin` re-running on an already-initialized DB).\n */\nexport async function findDemoTenant(\n em: EntityManager,\n spec: CpqUseCaseTenantSpec,\n): Promise<EnsuredTenant | null> {\n const user = await findOneWithDecryption(\n em,\n User,\n { email: spec.adminEmail },\n {},\n { tenantId: null, organizationId: null },\n )\n if (!user || !user.tenantId || !user.organizationId) return null\n\n return {\n tenantId: String(user.tenantId),\n organizationId: String(user.organizationId),\n adminUserId: String(user.id),\n created: false,\n }\n}\n\nasync function ensureAdditionalUser(\n em: EntityManager,\n args: {\n tenantId: string\n organizationId: string\n spec: CpqUseCaseAdditionalUserSpec\n },\n): Promise<void> {\n const { tenantId, organizationId, spec } = args\n const roles = spec.roles && spec.roles.length > 0 ? spec.roles : ['employee']\n\n const existing = await findOneWithDecryption(\n em,\n User,\n { email: spec.email },\n {},\n { tenantId: null, organizationId: null },\n )\n\n let user: User\n if (existing) {\n user = existing\n if (!user.tenantId) user.tenantId = tenantId\n if (!user.organizationId) user.organizationId = organizationId\n if (user.isConfirmed === false) user.isConfirmed = true\n em.persist(user)\n await em.flush()\n } else {\n const passwordHash = await hash(spec.password, 10)\n let emailValue: string = spec.email\n let emailHashValue: string = computeEmailHash(spec.email)\n if (isTenantDataEncryptionEnabled()) {\n try {\n const encryptionService = new TenantDataEncryptionService(em as any, { kms: createKmsService() })\n await encryptionService.invalidateMap('auth:user', tenantId, organizationId)\n const encrypted = await encryptionService.encryptEntityPayload(\n 'auth:user',\n { email: spec.email },\n tenantId,\n organizationId,\n )\n emailValue = (encrypted as any).email ?? spec.email\n emailHashValue = (encrypted as any).emailHash ?? computeEmailHash(spec.email)\n } catch (err) {\n console.warn(`[cpq:tenant-provisioning] Failed to encrypt additional user payload, falling back to plaintext (${(err as Error).message})`)\n }\n }\n user = em.create(User, {\n email: emailValue,\n emailHash: emailHashValue,\n passwordHash,\n organizationId,\n tenantId,\n name: spec.displayName ?? undefined,\n isConfirmed: true,\n createdAt: new Date(),\n })\n em.persist(user)\n await em.flush()\n }\n\n for (const roleName of roles) {\n const role = await findOneWithDecryption(\n em,\n Role,\n { name: roleName, tenantId },\n {},\n { tenantId, organizationId: null },\n )\n if (!role) {\n console.warn(`[cpq:tenant-provisioning] Role \"${roleName}\" not found for tenant ${tenantId}; skipping link for ${spec.email}`)\n continue\n }\n const link = await findOneWithDecryption(\n em,\n UserRole,\n { user, role },\n {},\n { tenantId, organizationId: null },\n )\n if (!link) {\n em.persist(em.create(UserRole, { user, role, createdAt: new Date() }))\n }\n }\n await em.flush()\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAGrB,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,MAAM,MAAM,gBAAgB;AACrC,SAAS,qCAAqC;AAC9C,SAAS,mCAAmC;AAC5C,SAAS,wBAAwB;AAm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AA,IACvE;AAAA,EACF;AACA,QAAM,GAAG,MAAM;AACjB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/cpq/lib/seeds.ts"],
|
|
4
|
+
"sourcesContent": ["import type { EntityManager } from '@mikro-orm/postgresql'\n\nexport type CpqSeedScope = { tenantId: string; organizationId: string }\n\n/**\n * Generic CPQ defaults seed.\n *\n * After XD-276 the cpq module ships with no built-in wizard or product\n * defaults \u2014 vertical-specific seeds live in app-level `demo_<x>` modules\n * that register CPQ use cases via `cpq/lib/seeds/api.ts`.\n *\n * The export is kept as a no-op so existing call sites and any external\n * tooling that imported it before the refactor still resolve. New code\n * should not call this \u2014 register a use case instead.\n */\nexport async function seedCpqDefaults(_em: EntityManager, _scope: CpqSeedScope): Promise<void> {\n // Intentionally empty: see XD-276 for the migration rationale.\n}\n"],
|
|
5
|
+
"mappings": "AAeA,eAAsB,gBAAgB,KAAoB,QAAqC;AAE/F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260220220000_cpq extends Migration {
|
|
3
|
+
async up() {
|
|
4
|
+
this.addSql(`create table "cpq_data_centres" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "code" text not null, "name" text not null, "city" text null, "country" text null, "address" text null, "capabilities" jsonb null, "is_active" boolean not null default true, "metadata" jsonb null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_data_centres_pkey" primary key ("id"));`);
|
|
5
|
+
this.addSql(`create index "cpq_data_centres_scope_idx" on "cpq_data_centres" ("organization_id", "tenant_id");`);
|
|
6
|
+
this.addSql(`alter table "cpq_data_centres" add constraint "cpq_data_centres_code_unique" unique ("organization_id", "tenant_id", "code");`);
|
|
7
|
+
this.addSql(`create table "cpq_product_attributes" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "product_id" uuid not null, "code" text not null, "name" text not null, "attribute_type" text not null, "options" jsonb null, "constraints" jsonb null, "sort_order" int not null default 0, "is_required" boolean not null default true, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_product_attributes_pkey" primary key ("id"));`);
|
|
8
|
+
this.addSql(`create index "cpq_product_attributes_scope_idx" on "cpq_product_attributes" ("organization_id", "tenant_id", "product_id");`);
|
|
9
|
+
this.addSql(`alter table "cpq_product_attributes" add constraint "cpq_product_attributes_code_unique" unique ("organization_id", "tenant_id", "product_id", "code");`);
|
|
10
|
+
this.addSql(`create table "cpq_pricing_tables" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "code" text not null, "name" text not null, "description" text null, "product_id" uuid null, "dimensions" jsonb not null, "price_columns" jsonb not null, "pricing_model" text not null, "currency_code" text not null default 'USD', "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_pricing_tables_pkey" primary key ("id"));`);
|
|
11
|
+
this.addSql(`create index "cpq_pricing_tables_scope_idx" on "cpq_pricing_tables" ("organization_id", "tenant_id");`);
|
|
12
|
+
this.addSql(`alter table "cpq_pricing_tables" add constraint "cpq_pricing_tables_code_unique" unique ("organization_id", "tenant_id", "code");`);
|
|
13
|
+
this.addSql(`create table "cpq_pricing_table_entries" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "pricing_table_id" uuid not null, "dimension_values" jsonb not null, "tier_number" int null, "range_from" numeric null, "range_to" numeric null, "prices" jsonb not null, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_pricing_table_entries_pkey" primary key ("id"));`);
|
|
14
|
+
this.addSql(`create index "cpq_pricing_table_entries_scope_idx" on "cpq_pricing_table_entries" ("organization_id", "tenant_id", "pricing_table_id");`);
|
|
15
|
+
this.addSql(`create index "cpq_pricing_table_entries_dim_gin_idx" on "cpq_pricing_table_entries" using gin ("dimension_values");`);
|
|
16
|
+
this.addSql(`create table "cpq_product_charges" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "product_id" uuid not null, "code" text not null, "name" text not null, "charge_type" text not null, "pricing_method" text not null, "pricing_table_id" uuid null, "price_column_key" text null, "quantity_attribute_code" text null, "applicability_condition" jsonb null, "sort_order" int not null default 0, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_product_charges_pkey" primary key ("id"));`);
|
|
17
|
+
this.addSql(`create index "cpq_product_charges_scope_idx" on "cpq_product_charges" ("organization_id", "tenant_id", "product_id");`);
|
|
18
|
+
this.addSql(`alter table "cpq_product_charges" add constraint "cpq_product_charges_code_unique" unique ("organization_id", "tenant_id", "product_id", "code");`);
|
|
19
|
+
this.addSql(`create table "cpq_inventory_items" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "customer_id" uuid not null, "product_id" uuid not null, "parent_inventory_item_id" uuid null, "status" text not null default 'pending', "configuration" jsonb not null, "charges" jsonb null, "data_centre_id" uuid null, "currency_code" text not null default 'USD', "activated_at" timestamptz null, "terminated_at" timestamptz null, "source_quote_id" uuid null, "source_order_id" uuid null, "metadata" jsonb null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_inventory_items_pkey" primary key ("id"));`);
|
|
20
|
+
this.addSql(`create index "cpq_inventory_items_customer_idx" on "cpq_inventory_items" ("organization_id", "tenant_id", "customer_id");`);
|
|
21
|
+
this.addSql(`create index "cpq_inventory_items_parent_idx" on "cpq_inventory_items" ("organization_id", "tenant_id", "parent_inventory_item_id");`);
|
|
22
|
+
this.addSql(`create index "cpq_inventory_items_status_idx" on "cpq_inventory_items" ("customer_id", "status");`);
|
|
23
|
+
this.addSql(`create index "cpq_inventory_items_config_gin_idx" on "cpq_inventory_items" using gin ("configuration");`);
|
|
24
|
+
this.addSql(`create table "cpq_quote_configurations" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "quote_id" uuid not null, "customer_id" uuid not null, "quote_type" text not null, "selected_parent_inventory_item_id" uuid null, "primary_item_configuration" jsonb null, "child_item_configurations" jsonb null, "validation_result" jsonb null, "pricing_summary" jsonb null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "cpq_quote_configurations_pkey" primary key ("id"));`);
|
|
25
|
+
this.addSql(`alter table "cpq_quote_configurations" add constraint "cpq_quote_configurations_quote_unique" unique ("organization_id", "tenant_id", "quote_id");`);
|
|
26
|
+
}
|
|
27
|
+
async down() {
|
|
28
|
+
this.addSql(`drop table if exists "cpq_quote_configurations" cascade;`);
|
|
29
|
+
this.addSql(`drop table if exists "cpq_inventory_items" cascade;`);
|
|
30
|
+
this.addSql(`drop table if exists "cpq_product_charges" cascade;`);
|
|
31
|
+
this.addSql(`drop table if exists "cpq_pricing_table_entries" cascade;`);
|
|
32
|
+
this.addSql(`drop table if exists "cpq_pricing_tables" cascade;`);
|
|
33
|
+
this.addSql(`drop table if exists "cpq_product_attributes" cascade;`);
|
|
34
|
+
this.addSql(`drop table if exists "cpq_data_centres" cascade;`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
Migration20260220220000_cpq
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Migration20260220220000_cpq.js.map
|