@endora-commerce/mod-price-lists 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -0
  3. package/dist/admin/components/ApplicationRuleBuilder.d.ts +24 -0
  4. package/dist/admin/components/ApplicationRuleBuilder.d.ts.map +1 -0
  5. package/dist/admin/components/ApplicationRuleBuilder.js +249 -0
  6. package/dist/admin/components/ApplicationRuleBuilder.js.map +1 -0
  7. package/dist/admin/components/BracketGrid.d.ts +29 -0
  8. package/dist/admin/components/BracketGrid.d.ts.map +1 -0
  9. package/dist/admin/components/BracketGrid.js +252 -0
  10. package/dist/admin/components/BracketGrid.js.map +1 -0
  11. package/dist/admin/components/DisplayModeOverrideRow.d.ts +46 -0
  12. package/dist/admin/components/DisplayModeOverrideRow.d.ts.map +1 -0
  13. package/dist/admin/components/DisplayModeOverrideRow.js +109 -0
  14. package/dist/admin/components/DisplayModeOverrideRow.js.map +1 -0
  15. package/dist/admin/components/LinkedPriceListsPanel.d.ts +55 -0
  16. package/dist/admin/components/LinkedPriceListsPanel.d.ts.map +1 -0
  17. package/dist/admin/components/LinkedPriceListsPanel.js +131 -0
  18. package/dist/admin/components/LinkedPriceListsPanel.js.map +1 -0
  19. package/dist/admin/index.d.ts +34 -0
  20. package/dist/admin/index.d.ts.map +1 -0
  21. package/dist/admin/index.js +119 -0
  22. package/dist/admin/index.js.map +1 -0
  23. package/dist/admin/pages/DisplayModeOverridesPage.d.ts +25 -0
  24. package/dist/admin/pages/DisplayModeOverridesPage.d.ts.map +1 -0
  25. package/dist/admin/pages/DisplayModeOverridesPage.js +266 -0
  26. package/dist/admin/pages/DisplayModeOverridesPage.js.map +1 -0
  27. package/dist/admin/pages/PriceListDetailPage.d.ts +23 -0
  28. package/dist/admin/pages/PriceListDetailPage.d.ts.map +1 -0
  29. package/dist/admin/pages/PriceListDetailPage.js +421 -0
  30. package/dist/admin/pages/PriceListDetailPage.js.map +1 -0
  31. package/dist/admin/pages/PriceListsPage.d.ts +17 -0
  32. package/dist/admin/pages/PriceListsPage.d.ts.map +1 -0
  33. package/dist/admin/pages/PriceListsPage.js +198 -0
  34. package/dist/admin/pages/PriceListsPage.js.map +1 -0
  35. package/dist/admin/zones/CategoryDisplayMode.d.ts +27 -0
  36. package/dist/admin/zones/CategoryDisplayMode.d.ts.map +1 -0
  37. package/dist/admin/zones/CategoryDisplayMode.js +11 -0
  38. package/dist/admin/zones/CategoryDisplayMode.js.map +1 -0
  39. package/dist/admin/zones/OrganizationDisplayMode.d.ts +36 -0
  40. package/dist/admin/zones/OrganizationDisplayMode.d.ts.map +1 -0
  41. package/dist/admin/zones/OrganizationDisplayMode.js +12 -0
  42. package/dist/admin/zones/OrganizationDisplayMode.js.map +1 -0
  43. package/dist/admin/zones/ProductLinkedPriceLists.d.ts +16 -0
  44. package/dist/admin/zones/ProductLinkedPriceLists.d.ts.map +1 -0
  45. package/dist/admin/zones/ProductLinkedPriceLists.js +7 -0
  46. package/dist/admin/zones/ProductLinkedPriceLists.js.map +1 -0
  47. package/dist/backend/entities/price-display-mode-override.entity.d.ts +23 -0
  48. package/dist/backend/entities/price-display-mode-override.entity.d.ts.map +1 -0
  49. package/dist/backend/entities/price-display-mode-override.entity.js +58 -0
  50. package/dist/backend/entities/price-display-mode-override.entity.js.map +1 -0
  51. package/dist/backend/entities/price-list-price-bracket.entity.d.ts +26 -0
  52. package/dist/backend/entities/price-list-price-bracket.entity.d.ts.map +1 -0
  53. package/dist/backend/entities/price-list-price-bracket.entity.js +73 -0
  54. package/dist/backend/entities/price-list-price-bracket.entity.js.map +1 -0
  55. package/dist/backend/entities/price-list-product.entity.d.ts +15 -0
  56. package/dist/backend/entities/price-list-product.entity.d.ts.map +1 -0
  57. package/dist/backend/entities/price-list-product.entity.js +43 -0
  58. package/dist/backend/entities/price-list-product.entity.js.map +1 -0
  59. package/dist/backend/entities/price-list.entity.d.ts +34 -0
  60. package/dist/backend/entities/price-list.entity.d.ts.map +1 -0
  61. package/dist/backend/entities/price-list.entity.js +115 -0
  62. package/dist/backend/entities/price-list.entity.js.map +1 -0
  63. package/dist/backend/index.d.ts +125 -0
  64. package/dist/backend/index.d.ts.map +1 -0
  65. package/dist/backend/index.js +179 -0
  66. package/dist/backend/index.js.map +1 -0
  67. package/dist/backend/plugin.d.ts +68 -0
  68. package/dist/backend/plugin.d.ts.map +1 -0
  69. package/dist/backend/plugin.js +88 -0
  70. package/dist/backend/plugin.js.map +1 -0
  71. package/dist/backend/routes.d.ts +40 -0
  72. package/dist/backend/routes.d.ts.map +1 -0
  73. package/dist/backend/routes.js +447 -0
  74. package/dist/backend/routes.js.map +1 -0
  75. package/dist/backend/routes.storefront.d.ts +47 -0
  76. package/dist/backend/routes.storefront.d.ts.map +1 -0
  77. package/dist/backend/routes.storefront.js +131 -0
  78. package/dist/backend/routes.storefront.js.map +1 -0
  79. package/dist/backend/services/application-rule-evaluator.d.ts +25 -0
  80. package/dist/backend/services/application-rule-evaluator.d.ts.map +1 -0
  81. package/dist/backend/services/application-rule-evaluator.js +2 -0
  82. package/dist/backend/services/application-rule-evaluator.js.map +1 -0
  83. package/dist/backend/services/audit-references.d.ts +11 -0
  84. package/dist/backend/services/audit-references.d.ts.map +1 -0
  85. package/dist/backend/services/audit-references.js +23 -0
  86. package/dist/backend/services/audit-references.js.map +1 -0
  87. package/dist/backend/services/default-price-list-migration.d.ts +70 -0
  88. package/dist/backend/services/default-price-list-migration.d.ts.map +1 -0
  89. package/dist/backend/services/default-price-list-migration.js +177 -0
  90. package/dist/backend/services/default-price-list-migration.js.map +1 -0
  91. package/dist/backend/services/display-mode-resolver.d.ts +78 -0
  92. package/dist/backend/services/display-mode-resolver.d.ts.map +1 -0
  93. package/dist/backend/services/display-mode-resolver.js +71 -0
  94. package/dist/backend/services/display-mode-resolver.js.map +1 -0
  95. package/dist/backend/services/listing-price-chain.d.ts +26 -0
  96. package/dist/backend/services/listing-price-chain.d.ts.map +1 -0
  97. package/dist/backend/services/listing-price-chain.js +55 -0
  98. package/dist/backend/services/listing-price-chain.js.map +1 -0
  99. package/dist/backend/services/price-bracket-resolver.d.ts +24 -0
  100. package/dist/backend/services/price-bracket-resolver.d.ts.map +1 -0
  101. package/dist/backend/services/price-bracket-resolver.js +16 -0
  102. package/dist/backend/services/price-bracket-resolver.js.map +1 -0
  103. package/dist/backend/services/price-list-candidate-vector.d.ts +116 -0
  104. package/dist/backend/services/price-list-candidate-vector.d.ts.map +1 -0
  105. package/dist/backend/services/price-list-candidate-vector.js +133 -0
  106. package/dist/backend/services/price-list-candidate-vector.js.map +1 -0
  107. package/dist/backend/services/price-list-currency-reference.d.ts +12 -0
  108. package/dist/backend/services/price-list-currency-reference.d.ts.map +1 -0
  109. package/dist/backend/services/price-list-currency-reference.js +24 -0
  110. package/dist/backend/services/price-list-currency-reference.js.map +1 -0
  111. package/dist/backend/services/price-list-read-port.d.ts +29 -0
  112. package/dist/backend/services/price-list-read-port.d.ts.map +1 -0
  113. package/dist/backend/services/price-list-read-port.js +64 -0
  114. package/dist/backend/services/price-list-read-port.js.map +1 -0
  115. package/dist/backend/services/price-list-resolver.d.ts +26 -0
  116. package/dist/backend/services/price-list-resolver.d.ts.map +1 -0
  117. package/dist/backend/services/price-list-resolver.js +37 -0
  118. package/dist/backend/services/price-list-resolver.js.map +1 -0
  119. package/dist/backend/services/price-list-service.d.ts +431 -0
  120. package/dist/backend/services/price-list-service.d.ts.map +1 -0
  121. package/dist/backend/services/price-list-service.js +1238 -0
  122. package/dist/backend/services/price-list-service.js.map +1 -0
  123. package/dist/backend/services/price-list-status-worker.d.ts +28 -0
  124. package/dist/backend/services/price-list-status-worker.d.ts.map +1 -0
  125. package/dist/backend/services/price-list-status-worker.js +38 -0
  126. package/dist/backend/services/price-list-status-worker.js.map +1 -0
  127. package/dist/backend/services/pricing-cache.d.ts +53 -0
  128. package/dist/backend/services/pricing-cache.d.ts.map +1 -0
  129. package/dist/backend/services/pricing-cache.js +88 -0
  130. package/dist/backend/services/pricing-cache.js.map +1 -0
  131. package/dist/backend/services/pricing-service.d.ts +304 -0
  132. package/dist/backend/services/pricing-service.d.ts.map +1 -0
  133. package/dist/backend/services/pricing-service.interface.d.ts +151 -0
  134. package/dist/backend/services/pricing-service.interface.d.ts.map +1 -0
  135. package/dist/backend/services/pricing-service.interface.js +10 -0
  136. package/dist/backend/services/pricing-service.interface.js.map +1 -0
  137. package/dist/backend/services/pricing-service.js +803 -0
  138. package/dist/backend/services/pricing-service.js.map +1 -0
  139. package/dist/backend/services/unit-price-ordering.d.ts +121 -0
  140. package/dist/backend/services/unit-price-ordering.d.ts.map +1 -0
  141. package/dist/backend/services/unit-price-ordering.js +164 -0
  142. package/dist/backend/services/unit-price-ordering.js.map +1 -0
  143. package/dist/manifest.d.ts +218 -0
  144. package/dist/manifest.d.ts.map +1 -0
  145. package/dist/manifest.js +228 -0
  146. package/dist/manifest.js.map +1 -0
  147. package/dist/migrations/20260426T075235_price_lists_pricing_init.d.ts +24 -0
  148. package/dist/migrations/20260426T075235_price_lists_pricing_init.d.ts.map +1 -0
  149. package/dist/migrations/20260426T075235_price_lists_pricing_init.js +89 -0
  150. package/dist/migrations/20260426T075235_price_lists_pricing_init.js.map +1 -0
  151. package/dist/migrations/20260504T125655_price_lists_engine.d.ts +6 -0
  152. package/dist/migrations/20260504T125655_price_lists_engine.d.ts.map +1 -0
  153. package/dist/migrations/20260504T125655_price_lists_engine.js +319 -0
  154. package/dist/migrations/20260504T125655_price_lists_engine.js.map +1 -0
  155. package/dist/migrations/20260817T055457_price_lists_single_system_price_list.d.ts +15 -0
  156. package/dist/migrations/20260817T055457_price_lists_single_system_price_list.d.ts.map +1 -0
  157. package/dist/migrations/20260817T055457_price_lists_single_system_price_list.js +58 -0
  158. package/dist/migrations/20260817T055457_price_lists_single_system_price_list.js.map +1 -0
  159. package/dist/migrations/20260821T135907_price_lists_unit_price_amount_index.d.ts +40 -0
  160. package/dist/migrations/20260821T135907_price_lists_unit_price_amount_index.d.ts.map +1 -0
  161. package/dist/migrations/20260821T135907_price_lists_unit_price_amount_index.js +46 -0
  162. package/dist/migrations/20260821T135907_price_lists_unit_price_amount_index.js.map +1 -0
  163. package/dist/migrations/index.d.ts +30 -0
  164. package/dist/migrations/index.d.ts.map +1 -0
  165. package/dist/migrations/index.js +35 -0
  166. package/dist/migrations/index.js.map +1 -0
  167. package/docs/price_lists.md +278 -0
  168. package/i18n/en.json +14 -0
  169. package/i18n/pl.json +14 -0
  170. package/package.json +99 -0
  171. package/tailwind.css +14 -0
@@ -0,0 +1,228 @@
1
+ import { defineModuleManifest, defineModuleRecentActivity, defineModuleSettingsManifest, PRICING_SETTING_CODES, } from '@endora-commerce/contracts';
2
+ /**
3
+ * Admin permission codes owned by this module (issue #219).
4
+ *
5
+ * Before these existed every admin route here was gated by `catalog:write`, so
6
+ * a role granted catalogue content work could change what customers pay. That
7
+ * boundary was never chosen — it was the side effect of the module declaring no
8
+ * codes of its own. Pricing is not catalogue content.
9
+ *
10
+ * The split is read/write rather than one code because the two authorities are
11
+ * genuinely different: reading a price list, its brackets and the rule-target
12
+ * pickers is what an operator needs to understand a quoted price, while editing
13
+ * a bracket changes what a customer is charged.
14
+ */
15
+ export const PRICE_LIST_PERMISSIONS = {
16
+ READ: 'price_lists:read',
17
+ WRITE: 'price_lists:write',
18
+ };
19
+ /**
20
+ * Settings manifest for the Price Lists module — feature 011.
21
+ *
22
+ * Two settings (FR-037). Setting codes follow the foundation regex
23
+ * `^[a-z][a-z0-9_][a-z0-9_.]*[a-z0-9]$`.
24
+ */
25
+ const settings = defineModuleSettingsManifest({
26
+ moduleCode: 'price_lists',
27
+ groups: [{ code: 'pricing', name: 'Pricing' }],
28
+ settings: [
29
+ {
30
+ code: PRICING_SETTING_CODES.DEFAULT_DISPLAY_MODE,
31
+ name: 'Default price display mode',
32
+ description: 'How storefront product surfaces render prices for signed-in customers: gross_only / net_only / both / none.',
33
+ groupCode: 'pricing',
34
+ valueType: 'string',
35
+ defaultValue: 'gross_only',
36
+ enumOptions: ['gross_only', 'net_only', 'both', 'none'],
37
+ },
38
+ {
39
+ code: PRICING_SETTING_CODES.UNAUTHENTICATED_DISPLAY_MODE,
40
+ name: 'Unauthenticated price display mode',
41
+ description: 'Display mode for anonymous (not signed in) visitors. Defaults to the same as `default_display_mode` — set to `none` to hide prices until login.',
42
+ groupCode: 'pricing',
43
+ valueType: 'string',
44
+ defaultValue: 'gross_only',
45
+ enumOptions: ['gross_only', 'net_only', 'both', 'none'],
46
+ },
47
+ ],
48
+ });
49
+ /** Module-lifecycle manifest (feature 018). */
50
+ export const manifest = defineModuleManifest({
51
+ id: 'price_lists',
52
+ name: 'Price Lists',
53
+ description: 'Customer-group pricing, brackets, display modes, and rule-based engine.',
54
+ version: '1.0.0',
55
+ // `customer_accounts` since feature 076 (D-79): customer groups moved to the
56
+ // module that owns the customer, so this module reads `customerGroupReadPort`
57
+ // for the rule-target picker and its validation, and `customerAccountReadPort`
58
+ // for the admin resolved-price probe. Both fail closed, which is why the edge
59
+ // is binding — pricing for a customer the platform will not identify is worse
60
+ // than refusing the probe.
61
+ // `currencies` owns `currencyReferenceRegistry`, the registry this module
62
+ // contributes its "who still prices in this currency" descriptor to (feature
63
+ // 077, D-87). `currencies` used to ask the question itself, with a
64
+ // `count(*) from "price_lists"` naming this module's table.
65
+ // `audit_logs` owns `auditReferenceRegistry`, the registry this module pushes
66
+ // its own "what is this audit row called, and where does the admin app show
67
+ // it?" resolver into (feature 075, D-87). The registry is ungated and its
68
+ // owner is non-deactivatable, so the declaration buys install and migration
69
+ // order rather than a flip-time refusal.
70
+ dependencies: [
71
+ 'audit_logs',
72
+ 'catalog',
73
+ 'currencies',
74
+ 'customer_accounts',
75
+ 'organizations',
76
+ 'settings',
77
+ ],
78
+ permissions: [
79
+ { code: PRICE_LIST_PERMISSIONS.READ, label: 'View price lists and pricing rules' },
80
+ { code: PRICE_LIST_PERMISSIONS.WRITE, label: 'Edit price lists, brackets and display modes' },
81
+ ],
82
+ /**
83
+ * The palette advertisement for this module's landing screen (Principle
84
+ * XVI), arriving with feature 091's Phase 4 batch 13.
85
+ *
86
+ * It replaces a hand-written `PALETTE_ITEMS` row in
87
+ * `admin/src/components/AppShell.tsx` and carries that row's destination, its
88
+ * code and its keywords, so an operator's ⌘K answer for *cennik* is what it
89
+ * was. What changes is who answers: the shell's array was a copy the server
90
+ * was never asked about, while this declaration is resolved from the manifest
91
+ * against the effective enabled-set — which for a module that declares
92
+ * `activation.nonDeactivatable` is inert today and stops being inert the day
93
+ * the lock is lifted. Unlike batch 12's `quote_requests` row there was
94
+ * nothing here for it to duplicate: this module declared no action at all.
95
+ *
96
+ * The label and the description are this module's own bundle's, the two
97
+ * strings the deleted row rendered out of `_i18n`'s.
98
+ */
99
+ actions: [
100
+ {
101
+ id: 'open-price-lists',
102
+ labelKey: 'actions.openPriceLists.label',
103
+ descriptionKey: 'actions.openPriceLists.description',
104
+ icon: 'CircleDollarSign',
105
+ targetRoute: '/price-lists',
106
+ // The code the landing `GET` enforces and the code this module's own
107
+ // `./admin` route declaration carries — read off the route rather than
108
+ // chosen, so the palette never advertises a 403 (issue #232).
109
+ requiredPermission: PRICE_LIST_PERMISSIONS.READ,
110
+ keywords: ['pricing', 'prices', 'price list', 'cennik', 'cenniki'],
111
+ weight: 240,
112
+ },
113
+ ],
114
+ settings,
115
+ // Feature 074 (Constitution XVII), test C2 — functional base, and one of the
116
+ // escalation answers. B2B *is* contract pricing. The deciding fact is the
117
+ // same shape as `taxes`: absent, the resolution falls back to the base price
118
+ // silently, so every buyer pays list and nothing on any surface says so. A
119
+ // platform where that happens is a B2C shop, not a reduced B2B one.
120
+ //
121
+ // As with `taxes` this closes the operator route only; the platform route —
122
+ // a deployment that never installs the module — is a separate follow-up.
123
+ //
124
+ // `price_lists.enabled` goes with the control it backed: one of the nineteen
125
+ // that never accepted a deactivation. The existing rows are removed by a core
126
+ // data migration (feature 074, FR-010a).
127
+ activation: {
128
+ nonDeactivatable: true,
129
+ reason: 'B2B is contract pricing. Absent, every buyer silently pays base price, which makes the ' +
130
+ 'platform a B2C shop rather than a reduced B2B one.',
131
+ },
132
+ /**
133
+ * Nothing to demonstrate of its own (feature 113, T225 — contract §1.2).
134
+ *
135
+ * The demo's prices are a backfill over `catalog`'s demo products into this
136
+ * module's default list — two modules' rows in one step, so it is step 3 of
137
+ * `backend/src/seeds/demo-composition.ts` and not this module's demo data
138
+ * (§5.1). The default list itself is **platform data**: a migration creates
139
+ * it and the platform needs it whether or not anybody ever seeds a demo.
140
+ *
141
+ * `false` rather than absent, because the two are different states: this is
142
+ * a decision that the module owes nothing, not a module nobody has looked at.
143
+ */
144
+ demo: false,
145
+ i18n: { bundlesDir: 'i18n' },
146
+ docs: { dir: 'docs' },
147
+ /**
148
+ * `PRICE_LIST_NOT_FOUND` — D-129's remaining sweep, Tier A
149
+ * (`specs/090-module-owned-error-codes/d129-sweep.md` §5.2, Appendix A;
150
+ * MR 3).
151
+ *
152
+ * Declared by `_i18n` until this merge request, not because anybody judged
153
+ * it the platform's but because the deleted prefix chain had no rule for it
154
+ * and its last line was `return 'core'`. **D-121 T1 puts it here**: the noun
155
+ * is a price list, which is this module's own entity.
156
+ *
157
+ * **It is the sweep's cleanest disagreement with the raise-site count**
158
+ * (`d129-sweep.md` §2.2). The one place that raises it is
159
+ * `pim_ergonode`'s mapping service, which asks this module's read port for a
160
+ * price list, gets a 404 and re-answers it under a name of its own; that
161
+ * makes `pim_ergonode` the caller and not the owner. It is why the prefix
162
+ * split in MR 2 was deliberate: `pim_ergonode` took thirteen codes in that
163
+ * batch and left this one behind precisely because it does not name an
164
+ * Ergonode noun.
165
+ *
166
+ * **No sentence moves with it.** It has none in either language anywhere in
167
+ * the tree; it was already on `UNTRANSLATED_ERROR_CODES` under `_i18n` and
168
+ * moves to this module's group there, so the bundle this module already
169
+ * ships gains no key. The admin's Ergonode price-binding screen maps the
170
+ * code to its own copy (`admin/src/modules/pim_ergonode/api.ts`), which is a
171
+ * surface string and not the envelope's sentence.
172
+ *
173
+ * **`tokens` is derived from the raise sites, not from the bundle**
174
+ * (runbook §5), and there are none: the single raise is a bare
175
+ * `HttpError(404, code, message)` with no `details`.
176
+ *
177
+ * **The neighbouring code that does *not* come here is `PRICE_UNAVAILABLE`**,
178
+ * and the reason is written down so nobody moves it in passing: the noun
179
+ * "price" is claimed by `catalog` and by this module both, which is D-122's
180
+ * condition, and nothing raises it. It stays with the platform (`d129-sweep.md`
181
+ * §2.4).
182
+ */
183
+ errorCodes: [{ code: 'PRICE_LIST_NOT_FOUND' }],
184
+ });
185
+ /** Legacy export retained for backward compatibility. */
186
+ export const priceListsManifest = settings;
187
+ /**
188
+ * What this module offers the admin home dashboard's Recent Activity card —
189
+ * feature 080, T042j / D-163.1.
190
+ *
191
+ * The **declaration** axis: eligibility, never a decision. Whether these rows
192
+ * appear is the operator's, held in `price_lists.recent_activity_visible` and
193
+ * defaulting to visible, flipped beside this module's activation control on the
194
+ * platform modules screen.
195
+ */
196
+ export const recentActivity = defineModuleRecentActivity({
197
+ entries: [
198
+ {
199
+ action: 'price_list.create',
200
+ icon: 'CircleDollarSign',
201
+ labelKey: 'activity.verb.price_list.create',
202
+ },
203
+ { action: 'price_list.update', icon: 'Edit', labelKey: 'activity.verb.price_list.update' },
204
+ {
205
+ action: 'price_list.activate',
206
+ icon: 'CircleDollarSign',
207
+ labelKey: 'activity.verb.price_list.activate',
208
+ },
209
+ { action: 'price_list.draftify', icon: 'Edit', labelKey: 'activity.verb.price_list.draftify' },
210
+ {
211
+ action: 'price_list.duplicate',
212
+ icon: 'Plus',
213
+ labelKey: 'activity.verb.price_list.duplicate',
214
+ },
215
+ { action: 'price_list.expire', icon: 'Archive', labelKey: 'activity.verb.price_list.expire' },
216
+ {
217
+ action: 'price_list.products_replace',
218
+ icon: 'Edit',
219
+ labelKey: 'activity.verb.price_list.products_replace',
220
+ },
221
+ {
222
+ action: 'price_list.bracket_update',
223
+ icon: 'CircleDollarSign',
224
+ labelKey: 'activity.verb.price_list.bracket_update',
225
+ },
226
+ ],
227
+ });
228
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,mBAAmB;CAClB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,4BAA4B,CAAC;IAC5C,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC9C,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,qBAAqB,CAAC,oBAAoB;YAChD,IAAI,EAAE,4BAA4B;YAClC,WAAW,EACT,6GAA6G;YAC/G,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC;SACxD;QACD;YACE,IAAI,EAAE,qBAAqB,CAAC,4BAA4B;YACxD,IAAI,EAAE,oCAAoC;YAC1C,WAAW,EACT,iJAAiJ;YACnJ,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC;SACxD;KACF;CACF,CAAC,CAAC;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IAC3C,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,aAAa;IACnB,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* Pricing init (T127). Adds:
4
+ * - price_lists
5
+ * - price_list_items
6
+ * - price_list_assignments
7
+ * - organizations.customer_group_id (nullable FK)
8
+ *
9
+ * It also created `customer_groups` until
10
+ * `specs/120-migration-closure-bridge-ownership/` Phase 3. That table is owned
11
+ * by `customer_accounts`, whose `CustomerGroup` entity declares the table name
12
+ * — tiered pricing simply needed customer groups first, so the table was
13
+ * created by whoever needed it rather than by whoever owns it. The owner's
14
+ * ruling of 2026-09-12 moved the creation to
15
+ * `Migration20260611T140403CustomerAccountsLifecycle`, which is where the only
16
+ * reference to the table in the whole corpus lives. Nothing here references it:
17
+ * `price_list_assignments.customer_group_id` is a nullable column with an index
18
+ * and no foreign key, and so is `organizations.customer_group_id`.
19
+ */
20
+ export declare class Migration20260426T075235PriceListsPricingInit extends Migration {
21
+ up(): Promise<void>;
22
+ down(): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=20260426T075235_price_lists_pricing_init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260426T075235_price_lists_pricing_init.d.ts","sourceRoot":"","sources":["../../src/migrations/20260426T075235_price_lists_pricing_init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,6CAA8C,SAAQ,SAAS;IAC3D,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAsEnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAOrC"}
@@ -0,0 +1,89 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+ /**
3
+ * Pricing init (T127). Adds:
4
+ * - price_lists
5
+ * - price_list_items
6
+ * - price_list_assignments
7
+ * - organizations.customer_group_id (nullable FK)
8
+ *
9
+ * It also created `customer_groups` until
10
+ * `specs/120-migration-closure-bridge-ownership/` Phase 3. That table is owned
11
+ * by `customer_accounts`, whose `CustomerGroup` entity declares the table name
12
+ * — tiered pricing simply needed customer groups first, so the table was
13
+ * created by whoever needed it rather than by whoever owns it. The owner's
14
+ * ruling of 2026-09-12 moved the creation to
15
+ * `Migration20260611T140403CustomerAccountsLifecycle`, which is where the only
16
+ * reference to the table in the whole corpus lives. Nothing here references it:
17
+ * `price_list_assignments.customer_group_id` is a nullable column with an index
18
+ * and no foreign key, and so is `organizations.customer_group_id`.
19
+ */
20
+ export class Migration20260426T075235PriceListsPricingInit extends Migration {
21
+ async up() {
22
+ this.addSql(`
23
+ create table "price_lists" (
24
+ "id" uuid not null,
25
+ "code" varchar(64) not null,
26
+ "name" varchar(160) not null,
27
+ "currency" varchar(3) not null,
28
+ "is_default" boolean not null default false,
29
+ "priority" int not null default 0,
30
+ "created_at" timestamptz not null,
31
+ "updated_at" timestamptz not null,
32
+ constraint "price_lists_pkey" primary key ("id"),
33
+ constraint "price_lists_code_unique" unique ("code")
34
+ );
35
+ `);
36
+ this.addSql('create unique index "uniq_price_lists_one_default" on "price_lists" ("is_default") where "is_default" = true;');
37
+ this.addSql(`
38
+ create table "price_list_items" (
39
+ "id" uuid not null,
40
+ "price_list_id" uuid not null,
41
+ "mode" varchar(24) not null,
42
+ "product_id" uuid null,
43
+ "variant_id" uuid null,
44
+ "category_id" uuid null,
45
+ "min_quantity" int not null default 1,
46
+ "unit_price" numeric(14, 4) null,
47
+ "adjustment_value" numeric(14, 4) null,
48
+ "created_at" timestamptz not null,
49
+ "updated_at" timestamptz not null,
50
+ constraint "price_list_items_pkey" primary key ("id"),
51
+ constraint "price_list_items_price_list_fk"
52
+ foreign key ("price_list_id") references "price_lists" ("id") on delete cascade
53
+ );
54
+ `);
55
+ this.addSql('create index "price_list_items_price_list_id_index" on "price_list_items" ("price_list_id");');
56
+ this.addSql('create index "price_list_items_product_id_index" on "price_list_items" ("product_id");');
57
+ this.addSql('create index "price_list_items_category_id_index" on "price_list_items" ("category_id");');
58
+ this.addSql('create index "price_list_items_mode_index" on "price_list_items" ("mode");');
59
+ this.addSql(`
60
+ create table "price_list_assignments" (
61
+ "id" uuid not null,
62
+ "price_list_id" uuid not null,
63
+ "organization_id" uuid null,
64
+ "customer_group_id" uuid null,
65
+ "sales_channel_id" uuid null,
66
+ "is_default" boolean not null default false,
67
+ "priority" int not null default 0,
68
+ "created_at" timestamptz not null,
69
+ "updated_at" timestamptz not null,
70
+ constraint "price_list_assignments_pkey" primary key ("id"),
71
+ constraint "price_list_assignments_price_list_fk"
72
+ foreign key ("price_list_id") references "price_lists" ("id") on delete cascade
73
+ );
74
+ `);
75
+ this.addSql('create index "price_list_assignments_price_list_id_index" on "price_list_assignments" ("price_list_id");');
76
+ this.addSql('create index "price_list_assignments_organization_id_index" on "price_list_assignments" ("organization_id");');
77
+ this.addSql('create index "price_list_assignments_customer_group_id_index" on "price_list_assignments" ("customer_group_id");');
78
+ this.addSql('alter table "organizations" add column "customer_group_id" uuid null;');
79
+ this.addSql('create index "organizations_customer_group_id_index" on "organizations" ("customer_group_id");');
80
+ }
81
+ async down() {
82
+ this.addSql('drop index if exists "organizations_customer_group_id_index";');
83
+ this.addSql('alter table "organizations" drop column if exists "customer_group_id";');
84
+ this.addSql('drop table if exists "price_list_assignments" cascade;');
85
+ this.addSql('drop table if exists "price_list_items" cascade;');
86
+ this.addSql('drop table if exists "price_lists" cascade;');
87
+ }
88
+ }
89
+ //# sourceMappingURL=20260426T075235_price_lists_pricing_init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260426T075235_price_lists_pricing_init.js","sourceRoot":"","sources":["../../src/migrations/20260426T075235_price_lists_pricing_init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,6CAA8C,SAAQ,SAAS;IACjE,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;KAaX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CACT,+GAA+G,CAChH,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;KAiBX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,8FAA8F,CAAC,CAAC;QAC5G,IAAI,CAAC,MAAM,CAAC,wFAAwF,CAAC,CAAC;QACtG,IAAI,CAAC,MAAM,CAAC,0FAA0F,CAAC,CAAC;QACxG,IAAI,CAAC,MAAM,CAAC,4EAA4E,CAAC,CAAC;QAE1F,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;KAeX,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,0GAA0G,CAAC,CAAC;QACxH,IAAI,CAAC,MAAM,CAAC,8GAA8G,CAAC,CAAC;QAC5H,IAAI,CAAC,MAAM,CAAC,kHAAkH,CAAC,CAAC;QAEhI,IAAI,CAAC,MAAM,CACT,uEAAuE,CACxE,CAAC;QACF,IAAI,CAAC,MAAM,CACT,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,+DAA+D,CAAC,CAAC;QAC7E,IAAI,CAAC,MAAM,CAAC,wEAAwE,CAAC,CAAC;QACtF,IAAI,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+ export declare class Migration20260504T125655PriceListsEngine extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260504T125655_price_lists_engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260504T125655_price_lists_engine.d.ts","sourceRoot":"","sources":["../../src/migrations/20260504T125655_price_lists_engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAgClD,qBAAa,wCAAyC,SAAQ,SAAS;IACtD,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA8QnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CA6BrC"}