@revenexx/cover 0.7.0 → 0.10.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 (101) hide show
  1. package/app/api/forms.ts +1 -0
  2. package/app/app.config.ts +17 -12
  3. package/app/components/RevenexxForm.vue +80 -12
  4. package/app/components/account/AccountShell.vue +18 -0
  5. package/app/components/account/approvals/AccountPendingApprovals.vue +178 -0
  6. package/app/components/account/orderlists/AccountOrderListDetail.vue +47 -4
  7. package/app/components/account/orders/AccountOrderDetail.vue +186 -1
  8. package/app/components/account/payments/AccountPayments.vue +129 -0
  9. package/app/components/account/quotes/AccountQuoteDetail.vue +48 -16
  10. package/app/components/auth/AuthLoginPanel.vue +131 -15
  11. package/app/components/auth/AuthMagicLinkPanel.vue +70 -0
  12. package/app/components/cart/view/CartSummaryPanel.vue +54 -0
  13. package/app/components/checkout/onepage/CheckoutDeliverySection.vue +13 -1
  14. package/app/components/checkout/onepage/CheckoutGate.vue +8 -7
  15. package/app/components/form/FormPage.vue +40 -0
  16. package/app/components/layout/header/AppBar.vue +7 -1
  17. package/app/components/layout/header/MainNav.vue +23 -1
  18. package/app/components/layout/header/MobileMenu.vue +12 -0
  19. package/app/components/product/detail/ProductDetailPriceRequest.vue +39 -0
  20. package/app/components/product/detail/ProductDetailView.vue +57 -0
  21. package/app/composables/useAccountHold.ts +45 -0
  22. package/app/composables/useAccountPayments.ts +21 -0
  23. package/app/composables/useAccountQuotes.ts +15 -2
  24. package/app/composables/useAuthStore.ts +82 -2
  25. package/app/composables/useAuthoredForms.ts +26 -0
  26. package/app/composables/useAvailableOffers.ts +42 -0
  27. package/app/composables/useGuestOrdering.ts +28 -0
  28. package/app/composables/useMasterDataEditable.ts +22 -7
  29. package/app/composables/useOrderListRules.ts +21 -1
  30. package/app/composables/usePendingApprovals.ts +37 -0
  31. package/app/config/icons.ts +2 -0
  32. package/app/config/navigation.ts +2 -2
  33. package/app/formkit.config.ts +14 -0
  34. package/app/interfaces/account/approvals.ts +37 -0
  35. package/app/interfaces/account/order-list.ts +29 -0
  36. package/app/interfaces/account/order-lists.ts +9 -0
  37. package/app/interfaces/account/payments.ts +48 -0
  38. package/app/interfaces/auth.ts +11 -0
  39. package/app/interfaces/b2b.ts +8 -8
  40. package/app/interfaces/offers.ts +35 -0
  41. package/app/interfaces/shopSettings.ts +77 -0
  42. package/app/plugins/account-hold.client.ts +20 -0
  43. package/app/plugins/shop-settings.ts +27 -12
  44. package/i18n/locales/de/account.json +80 -0
  45. package/i18n/locales/de/auth.json +29 -0
  46. package/i18n/locales/de/cart.json +7 -0
  47. package/i18n/locales/de/checkout.json +2 -1
  48. package/i18n/locales/de/common.json +4 -2
  49. package/i18n/locales/de/forms.json +27 -0
  50. package/i18n/locales/en/account.json +80 -0
  51. package/i18n/locales/en/auth.json +29 -0
  52. package/i18n/locales/en/cart.json +7 -0
  53. package/i18n/locales/en/checkout.json +2 -1
  54. package/i18n/locales/en/common.json +2 -0
  55. package/i18n/locales/en/forms.json +27 -0
  56. package/package.json +2 -1
  57. package/server/api/account/address/[id].delete.ts +1 -1
  58. package/server/api/account/address/[id].put.ts +1 -1
  59. package/server/api/account/address/index.post.ts +1 -1
  60. package/server/api/account/order-lists/[id].get.ts +37 -3
  61. package/server/api/account/orders/[id]/cancel.post.ts +54 -0
  62. package/server/api/account/orders/[id]/messages.get.ts +63 -0
  63. package/server/api/account/orders/[id]/messages.post.ts +44 -0
  64. package/server/api/account/organization.put.ts +1 -1
  65. package/server/api/account/payments.get.ts +54 -0
  66. package/server/api/account/pending-approvals/[id]/approve.post.ts +10 -0
  67. package/server/api/account/pending-approvals/[id]/decline.post.ts +10 -0
  68. package/server/api/account/pending-approvals/index.get.ts +25 -0
  69. package/server/api/account/profile.put.ts +1 -1
  70. package/server/api/account/quotes/[id]/decline.post.ts +35 -6
  71. package/server/api/account/team/[id].put.ts +1 -1
  72. package/server/api/account/team.post.ts +1 -1
  73. package/server/api/auth/magic-link.post.ts +32 -0
  74. package/server/api/auth/magic-link.put.ts +30 -0
  75. package/server/api/auth/otp.post.ts +33 -0
  76. package/server/api/auth/otp.put.ts +28 -0
  77. package/server/api/checkout/profile.get.ts +6 -3
  78. package/server/api/forms/[slug]/submit.post.ts +27 -16
  79. package/server/api/forms/[slug].get.ts +9 -1
  80. package/server/api/forms/index.get.ts +23 -0
  81. package/server/api/orders/index.post.ts +8 -0
  82. package/server/api/promotions/available.post.ts +37 -0
  83. package/server/config/account/organization.json +0 -4
  84. package/server/config/shop/app-settings.json +4 -0
  85. package/server/data/forms/authored.json +337 -0
  86. package/server/interfaces/forms.ts +51 -0
  87. package/server/services/ApiAuthService.ts +10 -0
  88. package/server/services/ApiFormsService.ts +56 -0
  89. package/server/services/MockB2BContextService.ts +1 -5
  90. package/server/services/MockFormsService.ts +63 -0
  91. package/server/utils/accountPayments.ts +45 -0
  92. package/server/utils/appSettings.ts +69 -4
  93. package/server/utils/forms.ts +62 -14
  94. package/server/utils/formsService.ts +29 -0
  95. package/server/utils/liveOrders.ts +26 -0
  96. package/server/utils/masterData.ts +31 -11
  97. package/server/utils/passwordlessSignIn.ts +73 -0
  98. package/server/utils/pendingApprovals.ts +153 -0
  99. package/server/utils/promotionsService.ts +90 -0
  100. package/server/utils/quotesService.ts +15 -0
  101. package/server/utils/shopSettings.ts +35 -4
@@ -4,9 +4,9 @@ import type { ShopSettings } from "../../app/interfaces/shopSettings";
4
4
  /**
5
5
  * The shop's configured behaviour, assembled from the apps that own it.
6
6
  *
7
- * Eleven apps are asked in one round — carts, orders, shipping, prices, markets,
8
- * promotions, quotes, orderlists, customers, inventories and procurement — and
9
- * their answers are folded into the one shape the storefront reads
7
+ * Twelve apps are asked in one round — carts, orders, shipping, prices, markets,
8
+ * promotions, quotes, orderlists, customers, inventories, procurement and forms
9
+ * — and their answers are folded into the one shape the storefront reads
10
10
  * (app/interfaces/shopSettings.ts).
11
11
  *
12
12
  * Every fallback below is the app's OWN declared default, copied from its
@@ -38,6 +38,7 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
38
38
  "customers",
39
39
  "inventories",
40
40
  "procurement",
41
+ "forms",
41
42
  ] as const);
42
43
 
43
44
  return {
@@ -45,6 +46,7 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
45
46
  multipleCarts: boolSetting(s.carts, "multi_cart_enabled", true),
46
47
  maxLines: numberSetting(s.carts, "max_items_per_cart", 0),
47
48
  maxQuantityPerLine: numberSetting(s.carts, "max_quantity_per_line", 0),
49
+ currency: stringSetting(s.carts, "default_currency", "EUR"),
48
50
  },
49
51
  orders: {
50
52
  approvalAboveValue: numberSetting(s.orders, "require_approval_above_value", 0),
@@ -55,6 +57,8 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
55
57
  ["place", "drop", "refuse"] as const,
56
58
  "place",
57
59
  ),
60
+ guestOrdering: enumSetting(s.orders, "guest_ordering", ["both", "b2c", "b2b", "none"] as const, "both"),
61
+ partialShipment: enumSetting(s.orders, "partial_shipment", ["allowed", "never"] as const, "allowed"),
58
62
  },
59
63
  shipping: {
60
64
  // No default in the app, and none invented here.
@@ -85,6 +89,12 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
85
89
  maxItems: numberSetting(s.orderlists, "max_items_per_list", 200),
86
90
  maxLists: numberSetting(s.orderlists, "max_lists_per_owner", 100),
87
91
  sharedEditable: boolSetting(s.orderlists, "shared_lists_editable", false),
92
+ onMissingArticle: enumSetting(
93
+ s.orderlists,
94
+ "on_missing_article",
95
+ ["include", "skip", "fail"] as const,
96
+ "include",
97
+ ),
88
98
  cartMergeMode: enumSetting(s.orderlists, "cart_merge_mode", ["append", "replace"] as const, "append"),
89
99
  defaultKind: nullableEnum(s.orderlists, "default_kind", ["shopping", "label"] as const),
90
100
  },
@@ -108,6 +118,18 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
108
118
  },
109
119
  account: {
110
120
  singleDefaultAddressPerType: boolSetting(s.customers, "single_default_address_per_type", true),
121
+ selfService: enumSetting(
122
+ s.customers,
123
+ "self_service_master_data",
124
+ ["all", "addresses_only", "none"] as const,
125
+ "all",
126
+ ),
127
+ blockedBuyer: enumSetting(
128
+ s.customers,
129
+ "blocked_contact_behavior",
130
+ ["keep", "catalog_only", "deny_all"] as const,
131
+ "keep",
132
+ ),
111
133
  },
112
134
  inventory: {
113
135
  backorders: enumSetting(s.inventories, "backorder_policy", ["deny", "allow", "allow_per_sku"] as const, "deny"),
@@ -115,7 +137,16 @@ export async function getShopSettings(event?: H3Event): Promise<ShopSettings> {
115
137
  procurement: {
116
138
  gate: enumSetting(s.procurement, "approval_gate", ["none", "booking_account"] as const, "none"),
117
139
  },
118
- source: live ? "apps" : "demo",
140
+ forms: {
141
+ // The app's declared default is the empty string, which means no trap.
142
+ // Null says the same thing in a shape a template can test.
143
+ honeypotField: optionalStringSetting(s.forms, "honeypot_field"),
144
+ spamHandling: enumSetting(s.forms, "spam_handling", ["flag", "reject"] as const, "flag"),
145
+ },
146
+ // A tried-out setting makes the whole answer the demo's, whatever it was
147
+ // read from: a value somebody is experimenting with must never be mistaken
148
+ // for one the merchant configured.
149
+ source: live && !hasAppSettingsOverride(event) ? "apps" : "demo",
119
150
  };
120
151
  }
121
152