@revenexx/cover 0.6.0 → 0.7.1

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 (55) hide show
  1. package/app/app.config.ts +12 -0
  2. package/app/components/account/address/AccountAddressView.vue +12 -1
  3. package/app/components/account/orderlists/AccountOrderListDetail.vue +16 -2
  4. package/app/components/account/orderlists/AccountOrderListsTable.vue +9 -1
  5. package/app/components/account/quotes/AccountQuoteDetail.vue +77 -3
  6. package/app/components/auth/AuthLoginPanel.vue +31 -0
  7. package/app/components/auth/AuthRegisterPanel.vue +71 -3
  8. package/app/components/cart/drawer/CartDrawer.vue +2 -1
  9. package/app/components/cart/item/CartItem.vue +4 -1
  10. package/app/components/cart/position/CartPosition.vue +7 -2
  11. package/app/components/cart/quote/CartQuoteRequestModal.vue +9 -0
  12. package/app/components/cart/view/CartSummaryPanel.vue +42 -5
  13. package/app/components/category/info/CategoryPrice.vue +4 -2
  14. package/app/components/layout/header/TopBar.vue +13 -4
  15. package/app/components/product/card/Compact.vue +4 -2
  16. package/app/components/product/detail/ProductDetailAddToCart.vue +8 -3
  17. package/app/composables/useCartLimits.ts +54 -0
  18. package/app/composables/useCartStore.ts +39 -6
  19. package/app/composables/useCartSummaryFormatting.ts +21 -3
  20. package/app/composables/useDeliveryPromise.ts +112 -0
  21. package/app/composables/useOrderListRules.ts +72 -0
  22. package/app/composables/useProduct.ts +5 -2
  23. package/app/composables/useRegistrationConfig.ts +27 -6
  24. package/app/composables/useShopSettings.ts +66 -0
  25. package/app/config/navigation.ts +16 -2
  26. package/app/interfaces/account/quotes.ts +20 -0
  27. package/app/interfaces/cart-calculation.ts +9 -1
  28. package/app/interfaces/shopSettings.ts +246 -0
  29. package/app/plugins/shop-settings.ts +52 -0
  30. package/i18n/locales/de/account.json +6 -0
  31. package/i18n/locales/de/auth.json +12 -0
  32. package/i18n/locales/de/cart.json +12 -3
  33. package/i18n/locales/de/common.json +3 -2
  34. package/i18n/locales/en/account.json +6 -0
  35. package/i18n/locales/en/auth.json +12 -0
  36. package/i18n/locales/en/cart.json +12 -3
  37. package/i18n/locales/en/common.json +3 -2
  38. package/nuxt.config.ts +0 -1
  39. package/package.json +1 -1
  40. package/server/api/account/quotes/[id]/decline.post.ts +1 -1
  41. package/server/api/account/quotes/[id]/order.post.ts +25 -5
  42. package/server/api/account/quotes/[id].get.ts +1 -1
  43. package/server/api/account/quotes.get.ts +10 -3
  44. package/server/api/auth/registration-config.get.ts +19 -33
  45. package/server/api/cart/calculate.post.ts +35 -18
  46. package/server/api/orders/index.post.ts +30 -0
  47. package/server/api/shop/settings.get.ts +14 -0
  48. package/server/config/shop/app-settings.json +54 -0
  49. package/server/interfaces/cartCalculation.ts +22 -0
  50. package/server/services/MockB2BContextService.ts +43 -1
  51. package/server/services/MockCartCalculationService.ts +117 -11
  52. package/server/utils/appSettings.ts +242 -0
  53. package/server/utils/livePrices.ts +24 -2
  54. package/server/utils/quotesService.ts +109 -16
  55. package/server/utils/shopSettings.ts +130 -0
@@ -0,0 +1,246 @@
1
+ /**
2
+ * What the shop was configured to do — read from the apps, never decided here.
3
+ *
4
+ * Each platform app owns the settings for its own subject: the carts app says
5
+ * whether a buyer may hold two carts, the shipping app what makes delivery
6
+ * free, the quotes app who may accept one, the customers app how somebody
7
+ * signs in. The gateway resolves them per app and the BFF assembles them into
8
+ * this one shape, grouped by what the storefront does with them rather than by
9
+ * which app answered — a component asking "may this buyer paste ten codes"
10
+ * should not have to know that promotions is the app that decides.
11
+ *
12
+ * Every field names its app and its key, because that is the only way back to
13
+ * where a value can be CHANGED. A merchant surprised by what the shop tells a
14
+ * buyer needs to find the switch, and the switch is never here.
15
+ *
16
+ * Where an app declares no default the field is nullable, and null means the
17
+ * shop says nothing. That is the whole point of reading these: the storefront
18
+ * used to promise free delivery above 100 € from a constant, while the
19
+ * shipping app charged by a figure of its own. A promise nobody configured is
20
+ * better left unsaid than guessed.
21
+ */
22
+
23
+ /* ------------------------------------------------------------------ */
24
+ /* Cart */
25
+ /* ------------------------------------------------------------------ */
26
+
27
+ export interface CartAppSettings {
28
+ /** carts.multi_cart_enabled — may one buyer keep several named carts. */
29
+ multipleCarts: boolean;
30
+ /** carts.max_items_per_cart — distinct lines allowed; 0 = no limit. */
31
+ maxLines: number;
32
+ /** carts.max_quantity_per_line — ceiling per line; 0 = no limit. */
33
+ maxQuantityPerLine: number;
34
+ }
35
+
36
+ /* ------------------------------------------------------------------ */
37
+ /* Ordering */
38
+ /* ------------------------------------------------------------------ */
39
+
40
+ export interface OrderAppSettings {
41
+ /**
42
+ * orders.require_approval_above_value — grand total above which a placed
43
+ * order becomes a request awaiting approval. 0 switches the threshold off.
44
+ */
45
+ approvalAboveValue: number;
46
+ /** orders.max_items_per_order — positions one order may carry. */
47
+ maxPositions: number;
48
+ /**
49
+ * orders.on_unorderable_position — what becomes of a position that cannot be
50
+ * ordered: an article withdrawn since it went in the cart, a quantity nobody
51
+ * has, a price that is gone.
52
+ *
53
+ * `place` orders it anyway, `drop` leaves it out and orders the rest,
54
+ * `refuse` turns the whole order down. The cart renders each of the three
55
+ * differently, because what a buyer should do about such a position depends
56
+ * entirely on what will happen to it.
57
+ */
58
+ onUnorderablePosition: "place" | "drop" | "refuse";
59
+ }
60
+
61
+ /* ------------------------------------------------------------------ */
62
+ /* Delivery */
63
+ /* ------------------------------------------------------------------ */
64
+
65
+ export interface ShippingAppSettings {
66
+ /**
67
+ * shipping.free_shipping_threshold — order value from which delivery is
68
+ * free. The app declares NO default: null means this merchant has not
69
+ * promised free delivery, and the shop must not name a figure.
70
+ */
71
+ freeThreshold: number | null;
72
+ /** shipping.free_above_compares — whether the threshold is met net or gross. */
73
+ freeCompares: "net" | "gross";
74
+ /** shipping.cutoff_time — UTC time of day after which an order ships the next day. */
75
+ cutoffTime: string;
76
+ /** shipping.handling_days — working days before a shipment leaves. */
77
+ handlingDays: number;
78
+ }
79
+
80
+ /* ------------------------------------------------------------------ */
81
+ /* Prices */
82
+ /* ------------------------------------------------------------------ */
83
+
84
+ export interface PriceAppSettings {
85
+ /** prices.tax_inclusive_default — whether stored prices are net or gross. */
86
+ stored: "net" | "gross";
87
+ /**
88
+ * markets.prices_include_tax — whether THIS market quotes tax-inclusive.
89
+ * The app declares no default: null means the market has not said, and the
90
+ * tenant-wide `stored` basis stands.
91
+ */
92
+ marketIncludesTax: boolean | null;
93
+ /** prices.anonymous_resolve_allowed — may a buyer with no account see prices. */
94
+ anonymousAllowed: boolean;
95
+ /** prices.price_precision — decimals a price is stated to. */
96
+ precision: number;
97
+ }
98
+
99
+ /* ------------------------------------------------------------------ */
100
+ /* Discounts */
101
+ /* ------------------------------------------------------------------ */
102
+
103
+ export interface PromotionAppSettings {
104
+ /** promotions.max_codes_per_cart — how many codes one cart may carry. */
105
+ maxCodesPerCart: number;
106
+ /** promotions.code_case_sensitive — whether a typed code's case matters. */
107
+ codeCaseSensitive: boolean;
108
+ /** promotions.anonymous_promotions_allowed — discounts without an account. */
109
+ anonymousAllowed: boolean;
110
+ }
111
+
112
+ /* ------------------------------------------------------------------ */
113
+ /* Quotes */
114
+ /* ------------------------------------------------------------------ */
115
+
116
+ export interface QuoteAppSettings {
117
+ /** quotes.partial_acceptance_enabled — may a buyer accept some lines only. */
118
+ partialAcceptance: boolean;
119
+ /** quotes.acceptance_scope — the requester alone, or anybody in the company. */
120
+ acceptanceScope: "requester" | "organization";
121
+ /** quotes.default_validity_days — how long a quote is offered for. */
122
+ defaultValidityDays: number;
123
+ /** quotes.expiry_grace_hours — hours a lapsed quote may still be ordered. */
124
+ expiryGraceHours: number;
125
+ /** quotes.expiry_warning_days — days before expiry the buyer is warned. */
126
+ expiryWarningDays: number;
127
+ }
128
+
129
+ /* ------------------------------------------------------------------ */
130
+ /* Order lists */
131
+ /* ------------------------------------------------------------------ */
132
+
133
+ export interface OrderListAppSettings {
134
+ /** orderlists.max_items_per_list — positions one list may hold. */
135
+ maxItems: number;
136
+ /** orderlists.max_lists_per_owner — lists one contact may keep. */
137
+ maxLists: number;
138
+ /** orderlists.shared_lists_editable — may the whole company edit a shared list. */
139
+ sharedEditable: boolean;
140
+ /** orderlists.cart_merge_mode — adding a list to a cart appends or replaces. */
141
+ cartMergeMode: "append" | "replace";
142
+ /** orderlists.default_kind — the kind a new list starts as; null = unset. */
143
+ defaultKind: "shopping" | "label" | null;
144
+ }
145
+
146
+ /* ------------------------------------------------------------------ */
147
+ /* Registering and signing in */
148
+ /* ------------------------------------------------------------------ */
149
+
150
+ export interface RegistrationAppSettings {
151
+ /** customers.b2b_registration_enabled */
152
+ b2b: boolean;
153
+ /** customers.b2c_registration_enabled */
154
+ b2c: boolean;
155
+ /** customers.organization_vat_id_required */
156
+ vatRequired: boolean;
157
+ /**
158
+ * customers.registration_mode — `open` signs the applicant straight in,
159
+ * `approval_required` leaves them waiting for a decision.
160
+ */
161
+ mode: "open" | "approval_required";
162
+ /** customers.vat_id_validation — how far a VAT ID is checked. */
163
+ vatValidation: "off" | "format" | "vies";
164
+ }
165
+
166
+ export interface SignInAppSettings {
167
+ /** customers.login_password */
168
+ password: boolean;
169
+ /** customers.login_magic_link — a mailed link instead of a password. */
170
+ magicLink: boolean;
171
+ /** customers.login_email_otp — a mailed code. */
172
+ emailOtp: boolean;
173
+ /** customers.email_verification — when the address has to be confirmed. */
174
+ emailVerification: "off" | "on_registration" | "required_for_login";
175
+ }
176
+
177
+ /* ------------------------------------------------------------------ */
178
+ /* The account */
179
+ /* ------------------------------------------------------------------ */
180
+
181
+ export interface AccountAppSettings {
182
+ /** customers.single_default_address_per_type — one default per address type. */
183
+ singleDefaultAddressPerType: boolean;
184
+ }
185
+
186
+ /* ------------------------------------------------------------------ */
187
+ /* Stock */
188
+ /* ------------------------------------------------------------------ */
189
+
190
+ export interface InventoryAppSettings {
191
+ /** inventories.backorder_policy — may a buyer order beyond what is in stock. */
192
+ backorders: "deny" | "allow" | "allow_per_sku";
193
+ }
194
+
195
+ /* ------------------------------------------------------------------ */
196
+ /* Approvals */
197
+ /* ------------------------------------------------------------------ */
198
+
199
+ export interface ProcurementAppSettings {
200
+ /**
201
+ * procurement.approval_gate — whether a submitted cart goes through
202
+ * procurement's rules at all. `none` means it does not, and the shop then
203
+ * promises a buyer no approval step.
204
+ */
205
+ gate: "none" | "booking_account";
206
+ }
207
+
208
+ /* ------------------------------------------------------------------ */
209
+ /* The whole answer */
210
+ /* ------------------------------------------------------------------ */
211
+
212
+ export interface ShopSettings {
213
+ cart: CartAppSettings;
214
+ orders: OrderAppSettings;
215
+ shipping: ShippingAppSettings;
216
+ prices: PriceAppSettings;
217
+ promotions: PromotionAppSettings;
218
+ quotes: QuoteAppSettings;
219
+ orderLists: OrderListAppSettings;
220
+ registration: RegistrationAppSettings;
221
+ signIn: SignInAppSettings;
222
+ account: AccountAppSettings;
223
+ inventory: InventoryAppSettings;
224
+ procurement: ProcurementAppSettings;
225
+ /**
226
+ * Whether these came from the platform apps or from the bundled demo
227
+ * tenant. Both are configured values read the same way, so no surface has
228
+ * to behave differently — but a dev panel showing which source answered,
229
+ * and a test asserting it read the live one, both need to be able to ask.
230
+ */
231
+ source: "apps" | "demo";
232
+ }
233
+
234
+ /**
235
+ * Net or gross, as the buyer should read prices in this market.
236
+ *
237
+ * Two apps have a say: the prices app states the basis the tenant stores in,
238
+ * and a market may declare that it quotes tax-inclusive. The market is the
239
+ * narrower answer, so it wins where it has one.
240
+ */
241
+ export function resolvePriceBasis(prices: PriceAppSettings): "net" | "gross" {
242
+ if (prices.marketIncludesTax !== null) {
243
+ return prices.marketIncludesTax ? "gross" : "net";
244
+ }
245
+ return prices.stored;
246
+ }
@@ -0,0 +1,52 @@
1
+ import type { ShopSettings } from "../interfaces/shopSettings";
2
+
3
+ /**
4
+ * Reads what the shop was configured to do, once, before anything renders.
5
+ *
6
+ * These values decide what a page may say: whether free delivery is promised
7
+ * and above what, whether prices are quoted net or gross, how many discount
8
+ * codes a cart takes, which ways in the login page offers. Everything that
9
+ * reads them — components, composables, the cart store — needs the answer
10
+ * synchronously, and a store cannot open a fetch of its own.
11
+ *
12
+ * So one fetch per page load lands in shared state. On the server it runs
13
+ * against the BFF in-process; the client receives it in the payload and asks
14
+ * for nothing. The alternative — every consumer fetching for itself — would
15
+ * show a buyer a net price that turned gross a moment after the page appeared.
16
+ */
17
+ /**
18
+ * The headers an internal call has to carry, and why.
19
+ *
20
+ * An internal `$fetch` during SSR gets a FRESH event that inherits nothing from
21
+ * the navigation that triggered it. Without the cookie, the market the buyer
22
+ * chose and the dev panel's live/demo switch are both invisible, so the answer
23
+ * is a different tenant's terms or the demo's. Without the brokered tenant
24
+ * headers, a deployed multi-tenant Site has no credentials at all and the read
25
+ * fails open to every default — see fetchSessionUser(), which was bitten by
26
+ * exactly this.
27
+ *
28
+ * On the client this is {} and the browser's own request already carries all of
29
+ * it, so the same call works there unchanged.
30
+ */
31
+ const forwardedHeaders = () =>
32
+ useRequestHeaders(["cookie", "x-revenexx-tenant", "x-revenexx-context"]);
33
+
34
+ export default defineNuxtPlugin(async () => {
35
+ const state = useState<ShopSettings | null>("cover:shop-settings", () => null);
36
+
37
+ // Hydration: the server already put the answer in the payload.
38
+ if (state.value) {
39
+ return;
40
+ }
41
+
42
+ try {
43
+ state.value = await $fetch<ShopSettings>("/api/shop/settings", {
44
+ headers: forwardedHeaders(),
45
+ });
46
+ }
47
+ catch {
48
+ // Left null. Every reader falls back to what the layer has always done,
49
+ // and a page that cannot learn the merchant's terms states none — which
50
+ // is the same thing it does for a merchant who set none.
51
+ }
52
+ });
@@ -405,6 +405,7 @@
405
405
  "title": "Bestelllisten",
406
406
  "description": "Einkaufs- und Etikettenlisten — gespeicherte Positionen, die direkt zurück in den Warenkorb fließen.",
407
407
  "add": "Liste anlegen",
408
+ "limitReached": "Sie haben die maximale Anzahl von {max} Listen erreicht. Löschen Sie eine Liste, um eine neue anzulegen.",
408
409
  "addTitle": "Neue Liste",
409
410
  "editTitle": "Liste bearbeiten",
410
411
  "namePlaceholder": "z. B. Onboarding-Paket",
@@ -604,6 +605,7 @@
604
605
  "review": "Ansehen & bestellen",
605
606
  "open": "Öffnen",
606
607
  "order": "Zum Angebotspreis bestellen ({total})",
608
+ "orderSelected": "{count} Position(en) bestellen ({total})",
607
609
  "decline": "Angebot ablehnen"
608
610
  },
609
611
  "detail": {
@@ -621,11 +623,14 @@
621
623
  "sellerNote": "Nachricht von uns",
622
624
  "trail": "Verlauf",
623
625
  "onRequest": "auf Anfrage",
626
+ "selectPosition": "Position {name} für die Bestellung auswählen",
627
+ "partialHint": "{remaining} Position(en) bleiben offen und können später separat bestellt werden.",
624
628
  "hint": {
625
629
  "ready": "Ihr Angebot liegt vor. Sie können es bis zum {date} zu diesen Konditionen bestellen.",
626
630
  "pending": "Wir kalkulieren die Fracht für Ihre Sendung und melden uns per E-Mail, sobald das Angebot vorliegt.",
627
631
  "expired": "Dieses Angebot ist abgelaufen. Fordern Sie bei Bedarf ein neues an.",
628
632
  "rejected": "Wir können hierzu leider kein Angebot machen: {reason}",
633
+ "expiresSoon": "Ihr Angebot läuft am {date} ab. Bis dahin können Sie es zu diesen Konditionen bestellen.",
629
634
  "ordered": "Dieses Angebot wurde bestellt."
630
635
  }
631
636
  },
@@ -643,6 +648,7 @@
643
648
  "order": {
644
649
  "title": "Angebot {number} bestellen",
645
650
  "intro": "Sie bestellen alle Positionen zu den angebotenen Preisen inklusive Fracht – insgesamt {total} netto, an die Lieferadresse aus dem Angebot. Bezahlt wird per Rechnung.",
651
+ "introSelected": "Sie bestellen {count} Position(en) zum Angebotspreis über {total} netto. Die übrigen Positionen bleiben offen und können später bestellt werden.",
646
652
  "customerOrderNumber": "Ihre Bestellnummer (optional)",
647
653
  "customerOrderNumberPlaceholder": "z. B. PO-2026-0815",
648
654
  "note": "Anmerkung zur Bestellung (optional)",
@@ -55,6 +55,7 @@
55
55
  },
56
56
  "fields2": {
57
57
  "vatId": "USt-IdNr.",
58
+ "vatIdVerified": "Wir prüfen die USt-IdNr. beim europäischen Register.",
58
59
  "vatIdHint": "Optional – für innergemeinschaftliche Lieferungen",
59
60
  "customerNumber": "Kundennummer",
60
61
  "customerNumberHint": "Sie finden Ihre Kundennummer auf jeder Rechnung",
@@ -75,6 +76,11 @@
75
76
  "phoneHint": "Optional – für Rückfragen zu Bestellungen"
76
77
  },
77
78
  "companyRequiredHint": "Pflichtfeld – wir liefern ausschließlich an Geschäftskunden",
79
+ "applied": {
80
+ "title": "Ihre Registrierung ist eingegangen",
81
+ "description": "Wir prüfen Ihre Angaben und melden uns per E-Mail an {email}, sobald Ihr Konto freigeschaltet ist.",
82
+ "confirmEmail": "Bitte bestätigen Sie zuerst die E-Mail, die wir an {email} gesendet haben. Anschließend prüfen wir Ihre Angaben und melden uns."
83
+ },
78
84
  "vettingNotice": "Ihre Registrierung wird von unserem Vertriebsteam geprüft. Großhandelspreise und Bestellfunktionen werden nach der Freischaltung aktiviert."
79
85
  },
80
86
  "login": {
@@ -100,6 +106,12 @@
100
106
  "heroHighlight": "Ein Konto.",
101
107
  "heroLine1": "Wir vereinen alle Funktionen unter einem zentralen Kundenkonto.",
102
108
  "heroLine2": "Melden Sie sich jetzt an oder registrieren Sie sich für Ihren persönlichen Zugang.",
109
+ "passwordDisabled": {
110
+ "title": "Anmeldung per E-Mail",
111
+ "magicLink": "Dieser Shop arbeitet ohne Passwort. Bitte fordern Sie einen Anmeldelink per E-Mail an — wenden Sie sich an unser Team, wenn Sie keinen erhalten.",
112
+ "emailOtp": "Dieser Shop arbeitet ohne Passwort. Die Anmeldung erfolgt über einen Code, den wir Ihnen per E-Mail senden.",
113
+ "contact": "Die Anmeldung mit Passwort ist für diesen Shop nicht aktiviert. Bitte wenden Sie sich an unser Team."
114
+ },
103
115
  "existingCustomer": "Ich habe bereits ein Konto",
104
116
  "newCustomer": "Ich bin Neukunde",
105
117
  "newCustomerText": "Registrieren Sie sich für Ihren persönlichen Zugang zu Preisen, Bestellungen und digitalen Services.",
@@ -81,6 +81,8 @@
81
81
  "summary": {
82
82
  "minOrderHint": "Mindestbestellwert {threshold} — die Differenz wird als Zuschlag berechnet.",
83
83
  "voucherPlaceholder": "Aktionscode",
84
+ "voucherLimit": "Es kann nur {max} Code pro Warenkorb eingelöst werden.",
85
+ "voucherDuplicate": "Dieser Code liegt bereits im Warenkorb.",
84
86
  "voucherApply": "Einlösen"
85
87
  },
86
88
  "workflow": {
@@ -212,7 +214,6 @@
212
214
  "add": "In den Warenkorb"
213
215
  },
214
216
  "trust": {
215
- "delivery": "Bis 16:00 Uhr bestellt – am nächsten Werktag geliefert",
216
217
  "invoice": "Kauf auf Rechnung für Geschäftskunden",
217
218
  "support": "Persönliches Service-Team, werktags 8–17 Uhr"
218
219
  },
@@ -229,7 +230,8 @@
229
230
  "steps": {
230
231
  "price": "Wir kalkulieren die Fracht und erstellen Ihnen ein Angebot.",
231
232
  "notify": "Sie erhalten eine E-Mail, sobald das Angebot vorliegt.",
232
- "order": "Sie bestellen es in Ihrem Kundenkonto unter „Angebote“ mit einem Klick."
233
+ "order": "Sie bestellen es in Ihrem Kundenkonto unter „Angebote“ mit einem Klick.",
234
+ "validity": "Das Angebot gilt {days} Tage ab Erstellung."
233
235
  },
234
236
  "cancel": "Abbrechen",
235
237
  "submit": "Angebot anfordern",
@@ -259,10 +261,17 @@
259
261
  "hints": {
260
262
  "quantityAdjusted": "Die Menge wurde auf {quantity} angepasst (Mindestmenge {min}, Verpackungseinheit {step}).",
261
263
  "duplicate": "Dieser Artikel ist mehrfach im Warenkorb vorhanden.",
262
- "missingCostCenter": "Bitte hinterlegen Sie auf dieser Position eine Kostenstelle."
264
+ "missingCostCenter": "Bitte hinterlegen Sie auf dieser Position eine Kostenstelle.",
265
+ "notOrderable": {
266
+ "place": "Nur {available} Stück verfügbar. Der Rest wird nachgeliefert.",
267
+ "drop": "Nur {available} Stück verfügbar. Diese Position entfällt bei der Bestellung.",
268
+ "refuse": "Nur {available} Stück verfügbar. Solange diese Position im Warenkorb liegt, kann nicht bestellt werden."
269
+ }
263
270
  },
264
271
  "messages": {
265
272
  "costCentersUnassigned": "Sie haben keine Kostenstellen, bitte wenden Sie sich an Ihren Organisationsadministrator.",
273
+ "positionsNotOrderable": "{count} Position(en) sind derzeit nicht bestellbar. Bitte passen Sie die Menge an oder entfernen Sie sie.",
274
+ "positionsWillBeDropped": "{count} Position(en) sind nicht bestellbar und entfallen bei der Bestellung.",
266
275
  "costCenterRequired": "Bitte wählen Sie für alle Positionen eine Kostenstelle aus."
267
276
  },
268
277
  "incentives": {
@@ -62,8 +62,9 @@
62
62
  }
63
63
  },
64
64
  "topbar": {
65
- "freeShipping": "Versandkostenfrei ab 100 € Bestellwert",
66
- "nextDayDelivery": "Bis 16:00 Uhr bestellt. Am nächsten Tag geliefert.",
65
+ "freeShipping": "Versandkostenfrei ab {amount} Bestellwert",
66
+ "nextDayDelivery": "Bis {time} Uhr bestellt. Am nächsten Tag geliefert.",
67
+ "deliveryInDays": "Bis {time} Uhr bestellt. Lieferung in {days} Werktagen.",
67
68
  "directOrder": "Direktbestellung",
68
69
  "orderOrders": "Bestellungen",
69
70
  "localeSelector": "Deutschland (Deutsch) in €",
@@ -405,6 +405,7 @@
405
405
  "title": "Order lists",
406
406
  "description": "Shopping and label lists — saved positions that flow straight back into the cart.",
407
407
  "add": "Add list",
408
+ "limitReached": "You have reached the maximum of {max} lists. Delete one to create another.",
408
409
  "addTitle": "New list",
409
410
  "editTitle": "Edit list",
410
411
  "namePlaceholder": "e.g. Onboarding kit",
@@ -604,6 +605,7 @@
604
605
  "review": "Review & order",
605
606
  "open": "Open",
606
607
  "order": "Order at the quoted price ({total})",
608
+ "orderSelected": "Order {count} position(s) ({total})",
607
609
  "decline": "Decline quote"
608
610
  },
609
611
  "detail": {
@@ -621,11 +623,14 @@
621
623
  "sellerNote": "Our message",
622
624
  "trail": "History",
623
625
  "onRequest": "on request",
626
+ "selectPosition": "Select position {name} for the order",
627
+ "partialHint": "{remaining} position(s) stay open and can be ordered separately later.",
624
628
  "hint": {
625
629
  "ready": "Your quote is ready. You can order it on these terms until {date}.",
626
630
  "pending": "We are pricing the carriage for your consignment and will email you as soon as the quote is ready.",
627
631
  "expired": "This quote has expired. Request a new one if you still need it.",
628
632
  "rejected": "We cannot make an offer for this: {reason}",
633
+ "expiresSoon": "Your quote expires on {date}. Until then you can order it on these terms.",
629
634
  "ordered": "This quote has been ordered."
630
635
  }
631
636
  },
@@ -643,6 +648,7 @@
643
648
  "order": {
644
649
  "title": "Order quote {number}",
645
650
  "intro": "You order every position at the quoted prices including carriage – {total} net in total, to the shipping address on the quote. Payment is by invoice.",
651
+ "introSelected": "You are ordering {count} position(s) at the quoted price, {total} net. The remaining positions stay open and can be ordered later.",
646
652
  "customerOrderNumber": "Your order number (optional)",
647
653
  "customerOrderNumberPlaceholder": "e.g. PO-2026-0815",
648
654
  "note": "Note for the order (optional)",
@@ -55,6 +55,7 @@
55
55
  },
56
56
  "fields2": {
57
57
  "vatId": "VAT ID",
58
+ "vatIdVerified": "We verify the VAT ID against the European register.",
58
59
  "vatIdHint": "Optional – for intra-community deliveries",
59
60
  "customerNumber": "Customer number",
60
61
  "customerNumberHint": "You find your customer number on every invoice",
@@ -75,6 +76,11 @@
75
76
  "phoneHint": "Optional – for questions about your orders"
76
77
  },
77
78
  "companyRequiredHint": "Required – we deliver to business customers only",
79
+ "applied": {
80
+ "title": "Your registration has arrived",
81
+ "description": "We are reviewing your details and will email {email} as soon as your account is open.",
82
+ "confirmEmail": "Please confirm the e-mail we sent to {email} first. We then review your details and get back to you."
83
+ },
78
84
  "vettingNotice": "Your registration is reviewed by our sales team. Wholesale prices and ordering are activated after approval."
79
85
  },
80
86
  "login": {
@@ -100,6 +106,12 @@
100
106
  "heroHighlight": "One account.",
101
107
  "heroLine1": "We unite every function under one central customer account.",
102
108
  "heroLine2": "Sign in now or register for your personal access.",
109
+ "passwordDisabled": {
110
+ "title": "Signing in by e-mail",
111
+ "magicLink": "This shop works without a password. Please request a sign-in link by e-mail — contact our team if you do not receive one.",
112
+ "emailOtp": "This shop works without a password. You sign in with a code we send you by e-mail.",
113
+ "contact": "Signing in with a password is not enabled for this shop. Please contact our team."
114
+ },
103
115
  "existingCustomer": "I already have an account",
104
116
  "newCustomer": "I am a new customer",
105
117
  "newCustomerText": "Register for personal access to prices, orders and digital services.",
@@ -81,6 +81,8 @@
81
81
  "summary": {
82
82
  "minOrderHint": "Minimum order value {threshold} — the difference is charged as a surcharge.",
83
83
  "voucherPlaceholder": "Promotion code",
84
+ "voucherLimit": "Only {max} code can be redeemed per cart.",
85
+ "voucherDuplicate": "This code is already in the cart.",
84
86
  "voucherApply": "Apply"
85
87
  },
86
88
  "workflow": {
@@ -212,7 +214,6 @@
212
214
  "add": "Add to cart"
213
215
  },
214
216
  "trust": {
215
- "delivery": "Ordered by 4 pm – delivered the next business day",
216
217
  "invoice": "Buy on invoice for business customers",
217
218
  "support": "Personal service team, weekdays 8 am–5 pm"
218
219
  },
@@ -229,7 +230,8 @@
229
230
  "steps": {
230
231
  "price": "We price the carriage and make you a quote.",
231
232
  "notify": "You receive an email as soon as the quote is ready.",
232
- "order": "You order it with one click under “Quotes” in your account."
233
+ "order": "You order it with one click under “Quotes” in your account.",
234
+ "validity": "The quote is valid for {days} days from the day it is made."
233
235
  },
234
236
  "cancel": "Cancel",
235
237
  "submit": "Request quote",
@@ -259,10 +261,17 @@
259
261
  "hints": {
260
262
  "quantityAdjusted": "The quantity was adjusted to {quantity} (minimum {min}, packaging unit {step}).",
261
263
  "duplicate": "This article appears more than once in the cart.",
262
- "missingCostCenter": "Please assign a cost center to this position."
264
+ "missingCostCenter": "Please assign a cost center to this position.",
265
+ "notOrderable": {
266
+ "place": "Only {available} available. The rest follows later.",
267
+ "drop": "Only {available} available. This position will be left out of the order.",
268
+ "refuse": "Only {available} available. The cart cannot be ordered while this position is in it."
269
+ }
263
270
  },
264
271
  "messages": {
265
272
  "costCentersUnassigned": "You have no cost centers assigned — please contact your organization administrator.",
273
+ "positionsNotOrderable": "{count} position(s) cannot be ordered right now. Adjust the quantity or remove them.",
274
+ "positionsWillBeDropped": "{count} position(s) cannot be ordered and will be left out of the order.",
266
275
  "costCenterRequired": "Please select a cost center for every position."
267
276
  },
268
277
  "incentives": {
@@ -62,8 +62,9 @@
62
62
  }
63
63
  },
64
64
  "topbar": {
65
- "freeShipping": "Free shipping on orders over €100",
66
- "nextDayDelivery": "Ordered by 4 pm. Delivered the next day.",
65
+ "freeShipping": "Free shipping on orders over {amount}",
66
+ "nextDayDelivery": "Ordered by {time}. Delivered the next day.",
67
+ "deliveryInDays": "Ordered by {time}. Delivered in {days} working days.",
67
68
  "directOrder": "Direct order",
68
69
  "orderOrders": "Orders",
69
70
  "localeSelector": "Germany (German) in €",
package/nuxt.config.ts CHANGED
@@ -112,7 +112,6 @@ export default defineNuxtConfig({
112
112
  // the layer must ship working defaults (an undefined TTL turns the
113
113
  // inactivity timer into setTimeout(..., NaN) = clear immediately).
114
114
  cartInactivityTtl: 31 * 60 * 1_000,
115
- taxIncludedPrices: false,
116
115
  },
117
116
  },
118
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -7,7 +7,7 @@ export default defineEventHandler(async (event): Promise<{ ok: true }> => {
7
7
  throw createError({ statusCode: 401, message: "Unauthorized" });
8
8
  }
9
9
  const quote = await loadOwnQuote(event, id, actor);
10
- if (!mapQuote(quote).canDecline) {
10
+ if (!mapQuote(quote, await quoteTerms(event)).canDecline) {
11
11
  throw createError({ statusCode: 422, message: "This quote can no longer be declined" });
12
12
  }
13
13
 
@@ -34,8 +34,9 @@ export default defineEventHandler(async (event): Promise<QuoteOrderResult> => {
34
34
  throw createError({ statusCode: 401, message: "Unauthorized" });
35
35
  }
36
36
 
37
+ const terms = await quoteTerms(event);
37
38
  const quote = await loadOwnQuote(event, id, actor);
38
- const view = mapQuote(quote);
39
+ const view = mapQuote(quote, terms);
39
40
  if (!view.canOrder) {
40
41
  throw createError({
41
42
  statusCode: 422,
@@ -43,6 +44,18 @@ export default defineEventHandler(async (event): Promise<QuoteOrderResult> => {
43
44
  });
44
45
  }
45
46
 
47
+ // Which positions the buyer picked. Naming a subset is only offered where the
48
+ // quotes app allows a basket to be taken apart, and it refuses such a call
49
+ // where the merchant does not — so the shop drops the selection rather than
50
+ // sending one that comes back as an error.
51
+ const openLineIds = new Set(view.lines.filter(line => line.decision === "open").map(line => line.id));
52
+ const picked = terms.partialAcceptance
53
+ ? (body?.lineIds ?? []).filter(lineId => openLineIds.has(lineId))
54
+ : [];
55
+ // Every open position is not a subset; sending none says the same thing and
56
+ // keeps the app on its own simpler path.
57
+ const lineIds = picked.length > 0 && picked.length < openLineIds.size ? picked : undefined;
58
+
46
59
  const config = useAppConfig() as { quotes?: { paymentMethod?: string } };
47
60
  const paymentMethod = config.quotes?.paymentMethod ?? "invoice";
48
61
 
@@ -55,8 +68,12 @@ export default defineEventHandler(async (event): Promise<QuoteOrderResult> => {
55
68
  ? q
56
69
  : {
57
70
  ...q,
58
- status: "accepted",
59
- items: (q.items ?? []).map(i => (i.decision === "open" ? { ...i, decision: "accepted", order_id: orderNumber } : i)),
71
+ status: lineIds ? "partially_accepted" : "accepted",
72
+ // The same subset the live path would take, so the showcase and a
73
+ // live tenant answer a partial acceptance the same way.
74
+ items: (q.items ?? []).map(i => (i.decision === "open" && (!lineIds || lineIds.includes(i.id))
75
+ ? { ...i, decision: "accepted", order_id: orderNumber }
76
+ : i)),
60
77
  events: [...(q.events ?? []), { kind: "ordered", actor: "buyer", body: null, visibility: "customer", created_at: now }],
61
78
  }));
62
79
  return { orderId: orderNumber, orderNumber };
@@ -66,7 +83,7 @@ export default defineEventHandler(async (event): Promise<QuoteOrderResult> => {
66
83
  const sdk = useRevenexxSdk();
67
84
  let draft;
68
85
  try {
69
- draft = (await liveQuoteAccept(id)).order_draft;
86
+ draft = (await liveQuoteAccept(id, lineIds)).order_draft;
70
87
  }
71
88
  catch (err) {
72
89
  if (err instanceof RevenexxException && [403, 409, 422].includes(err.code)) {
@@ -143,7 +160,10 @@ export default defineEventHandler(async (event): Promise<QuoteOrderResult> => {
143
160
  }
144
161
 
145
162
  try {
146
- await liveQuoteOrdered(id, placed.id);
163
+ // A partial acceptance names what went on this order: left out, the app
164
+ // claims every accepted position not yet on one, and a second order from
165
+ // the same quote would then find nothing to claim.
166
+ await liveQuoteOrdered(id, placed.id, lineIds);
147
167
  }
148
168
  catch (err) {
149
169
  getLogService().error(`Writing order ${placed.number} back to quote ${quote.number} failed`, apiErrorContext(err));