@stacksjs/defaults 0.75.529 → 0.75.537

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 (248) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-build/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +2 -2
  4. package/ai/skills/stacks-database/SKILL.md +1 -1
  5. package/ai/skills/stacks-migrations/SKILL.md +2 -2
  6. package/ai/skills/stacks-native/CATALOG.md +6 -6
  7. package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
  8. package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
  9. package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
  10. package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
  11. package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
  12. package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
  13. package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
  14. package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
  15. package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
  16. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
  17. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
  18. package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
  19. package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
  20. package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
  21. package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
  22. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
  23. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
  25. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
  26. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
  28. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
  29. package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
  30. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
  31. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
  32. package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
  33. package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
  34. package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
  35. package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
  36. package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
  37. package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
  38. package/app/Actions/Dashboard/Models/model-write.ts +36 -3
  39. package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
  40. package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
  41. package/app/Actions/SitemapAction.ts +3 -1
  42. package/app/Models/Notification.ts +3 -1
  43. package/app/Models/NotificationDelivery.ts +4 -0
  44. package/app/Models/User.ts +10 -1
  45. package/bootstrap.ts +10 -2
  46. package/functions/commerce/tax-types.ts +21 -0
  47. package/functions/dashboard-list.test.ts +16 -0
  48. package/functions/dashboard-list.ts +14 -6
  49. package/functions/dashboard-model-record.test.ts +139 -0
  50. package/functions/dashboard-model-record.ts +353 -0
  51. package/functions/monitoring/errors.ts +22 -103
  52. package/functions/notifications/deliveries.ts +7 -38
  53. package/functions/queries.ts +7 -10
  54. package/ide/vscode/package.json +1 -1
  55. package/package.json +5 -5
  56. package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
  57. package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
  58. package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
  59. package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
  60. package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
  61. package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
  62. package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
  63. package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
  64. package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
  65. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
  66. package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
  67. package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
  68. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
  69. package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
  70. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
  71. package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
  72. package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
  73. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
  74. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
  75. package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
  76. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
  77. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
  78. package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
  79. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
  80. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
  81. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
  82. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
  83. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
  84. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
  85. package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
  86. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
  87. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
  88. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
  89. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
  90. package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
  91. package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
  92. package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
  93. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
  94. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
  95. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
  96. package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
  97. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
  98. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
  99. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
  100. package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
  101. package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
  102. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
  103. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
  104. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
  105. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
  106. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
  107. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
  108. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
  109. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
  110. package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
  111. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
  112. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
  113. package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
  114. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
  115. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
  116. package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
  117. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
  118. package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
  119. package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
  120. package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
  121. package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
  122. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
  123. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
  124. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
  125. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
  126. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
  127. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
  128. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
  129. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
  130. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
  131. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
  132. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
  133. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
  134. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
  135. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
  136. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
  137. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
  138. package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
  139. package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
  140. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
  141. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
  142. package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
  143. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
  144. package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
  145. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
  146. package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
  147. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
  148. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
  149. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
  150. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
  151. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
  152. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
  153. package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
  154. package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
  155. package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
  156. package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
  157. package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
  158. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
  159. package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
  160. package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
  161. package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
  162. package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
  163. package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
  164. package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
  165. package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
  166. package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
  167. package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
  168. package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
  169. package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
  170. package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
  171. package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
  172. package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
  173. package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
  174. package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
  175. package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
  176. package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
  177. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
  178. package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
  179. package/resources/components/Dashboard/GlobalSearch.stx +19 -21
  180. package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
  181. package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
  182. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
  183. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
  184. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
  185. package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
  186. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
  187. package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
  188. package/resources/components/Dashboard/Jobs/JobHistory.stx +44 -57
  189. package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
  190. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
  191. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
  192. package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
  193. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
  194. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
  195. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
  196. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
  197. package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
  198. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
  199. package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
  200. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
  201. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
  202. package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
  203. package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
  204. package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
  205. package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
  206. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
  207. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
  208. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
  209. package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
  210. package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
  211. package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
  212. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
  213. package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
  214. package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
  215. package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
  216. package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
  217. package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
  218. package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
  219. package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
  220. package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
  221. package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
  222. package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
  223. package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
  224. package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
  225. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
  226. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
  227. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
  228. package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
  229. package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
  230. package/resources/components/Dashboard/UI/Button.stx +15 -0
  231. package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
  232. package/resources/components/Dashboard/UI/Pagination.stx +3 -5
  233. package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
  234. package/resources/components/Dashboard/UI/Select.stx +1 -0
  235. package/resources/components/Dashboard/UI/Table.stx +139 -96
  236. package/resources/components/Dashboard/UI/Tabs.stx +18 -20
  237. package/routes/dashboard-api.ts +2 -0
  238. package/routes/dashboard.ts +246 -253
  239. package/routes/storefront.ts +31 -0
  240. package/stx-components-plugin.ts +12 -1
  241. package/views/dashboard/content/categories/index.stx +1 -1
  242. package/views/dashboard/content/tags/index.stx +1 -1
  243. package/views/dashboard/layouts/default.stx +27 -12
  244. package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
  245. package/views/dashboard/models/[model]/[id].stx +8 -0
  246. package/views/dashboard/models/[model]/create.stx +8 -0
  247. package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
  248. package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
@@ -15,6 +15,7 @@
15
15
  * ```
16
16
  */
17
17
 
18
+ import { feature } from '@stacksjs/config'
18
19
  import { isLocalDeployment } from '@stacksjs/env'
19
20
  import { projectPath } from '@stacksjs/path'
20
21
  import { dashboardGroupMiddleware, describeUnknownDashboardGroups, resolveDashboardAccess, route } from '@stacksjs/router'
@@ -102,28 +103,8 @@ route.post('/api/team-invitations/{token}/accept', 'Actions/Teams/AcceptInvitati
102
103
  // leaked, not about guessing.
103
104
  route.post('/api/feedback/{token}', 'Actions/Dashboard/Feedback/FeedbackStoreAction').name('feedback.store').skipCsrf().rateLimit(10, 'minute')
104
105
 
105
- // ============================================================================
106
- // Storefront (anonymous cart + multi-step checkout)
107
- //
108
- // CSRF is skipped because the storefront uses progressive-enhancement
109
- // HTML forms — there's no JS to mint a token — and each cart is
110
- // already gated by an opaque, HttpOnly session cookie that can't be
111
- // guessed. Apps that want classic CSRF on top can re-register the
112
- // same routes in their `routes/api.ts` without `.skipCsrf()`.
113
- // ============================================================================
114
-
115
- route.get('/api/cart', 'Actions/Storefront/GetCartAction').skipCsrf()
116
- route.post('/api/cart/add', 'Actions/Storefront/AddToCartAction').skipCsrf()
117
- route.post('/api/cart/update', 'Actions/Storefront/UpdateCartItemAction').skipCsrf()
118
- route.post('/api/checkout/contact', 'Actions/Storefront/CheckoutContactAction').skipCsrf()
119
- route.post('/api/checkout/shipping', 'Actions/Storefront/CheckoutShippingAction').skipCsrf()
120
- route.post('/api/checkout/place', 'Actions/Storefront/PlaceOrderAction').skipCsrf()
121
-
122
- // Buyer-submitted product review. Tied to a shipped order via
123
- // order_id + email match (the SubmitReviewAction verifies ownership
124
- // and stamps is_verified_purchase=1). Stored as is_approved=0 for
125
- // admin moderation through `/dashboard/commerce/reviews`.
126
- route.post('/api/reviews/submit', 'Actions/Storefront/SubmitReviewAction').skipCsrf()
106
+ // The storefront (cart, checkout, buyer reviews) is its own bundle,
107
+ // `storefront.ts`, mounted with the commerce feature.
127
108
 
128
109
  // ============================================================================
129
110
  // Health & System
@@ -323,46 +304,48 @@ route.group({ prefix: '/api/monitoring', middleware: guarded('/api/monitoring')
323
304
  // is no longer a DB/CMS mirror. /cms below remains the authoring API.
324
305
  // ============================================================================
325
306
 
326
- route.group({ prefix: '/cms', middleware: guarded('/cms') }, () => {
327
- route.get('/dashboard', 'Actions/Dashboard/Content/ContentDashboardAction')
328
- route.get('/posts', 'Actions/Cms/PostIndexAction')
329
- route.get('/posts/{id}', 'Actions/Cms/PostShowAction')
330
- route.post('/posts', 'Actions/Cms/PostStoreAction')
331
- route.patch('/posts/{id}', 'Actions/Cms/PostUpdateAction')
332
- route.delete('/posts/{id}', 'Actions/Cms/PostDestroyAction')
333
- route.patch('/posts/{id}/views', 'Actions/Cms/PostViewsUpdateAction')
334
-
335
- route.get('/authors', 'Actions/Cms/AuthorIndexAction')
336
- route.get('/authors/{id}', 'Actions/Cms/AuthorShowAction')
337
- route.post('/authors', 'Actions/Cms/AuthorStoreAction')
338
- route.patch('/authors/{id}', 'Actions/Cms/AuthorUpdateAction')
339
- route.delete('/authors/{id}', 'Actions/Cms/AuthorDestroyAction')
340
-
341
- route.get('/categories', 'Actions/Cms/CategorizableIndexAction')
342
- route.get('/categories/{id}', 'Actions/Cms/CategorizableShowAction')
343
- route.post('/categories', 'Actions/Cms/CategorizableStoreAction')
344
- route.patch('/categories/{id}', 'Actions/Cms/CategorizableUpdateAction')
345
- route.delete('/categories/{id}', 'Actions/Cms/CategorizableDestroyAction')
346
-
347
- route.get('/tags', 'Actions/Cms/TaggableIndexAction')
348
- route.get('/tags/{id}', 'Actions/Cms/TaggableShowAction')
349
- route.post('/tags', 'Actions/Cms/TaggableStoreAction')
350
- route.patch('/tags/{id}', 'Actions/Cms/TaggableUpdateAction')
351
- route.delete('/tags/{id}', 'Actions/Cms/TaggableDestroyAction')
352
-
353
- route.get('/comments', 'Actions/Cms/CommentIndexAction')
354
- route.get('/comments/{id}', 'Actions/Cms/CommentShowAction')
355
- route.post('/comments', 'Actions/Cms/CommentStoreAction')
356
- route.patch('/comments/{id}', 'Actions/Cms/CommentUpdateAction')
357
- route.delete('/comments/{id}', 'Actions/Cms/CommentDestroyAction')
358
-
359
- route.get('/pages', 'Actions/Cms/PageIndexAction')
360
- route.post('/pages', 'Actions/Cms/PageStoreAction')
361
- route.patch('/pages/{id}', 'Actions/Cms/PageUpdateAction')
362
- route.delete('/pages/{id}', 'Actions/Cms/PageDestroyAction')
363
-
364
- route.get('/files', 'Actions/Dashboard/Content/FileIndexAction')
365
- })
307
+ if (feature('cms')) {
308
+ route.group({ prefix: '/cms', middleware: guarded('/cms') }, () => {
309
+ route.get('/dashboard', 'Actions/Dashboard/Content/ContentDashboardAction')
310
+ route.get('/posts', 'Actions/Cms/PostIndexAction')
311
+ route.get('/posts/{id}', 'Actions/Cms/PostShowAction')
312
+ route.post('/posts', 'Actions/Cms/PostStoreAction')
313
+ route.patch('/posts/{id}', 'Actions/Cms/PostUpdateAction')
314
+ route.delete('/posts/{id}', 'Actions/Cms/PostDestroyAction')
315
+ route.patch('/posts/{id}/views', 'Actions/Cms/PostViewsUpdateAction')
316
+
317
+ route.get('/authors', 'Actions/Cms/AuthorIndexAction')
318
+ route.get('/authors/{id}', 'Actions/Cms/AuthorShowAction')
319
+ route.post('/authors', 'Actions/Cms/AuthorStoreAction')
320
+ route.patch('/authors/{id}', 'Actions/Cms/AuthorUpdateAction')
321
+ route.delete('/authors/{id}', 'Actions/Cms/AuthorDestroyAction')
322
+
323
+ route.get('/categories', 'Actions/Cms/CategorizableIndexAction')
324
+ route.get('/categories/{id}', 'Actions/Cms/CategorizableShowAction')
325
+ route.post('/categories', 'Actions/Cms/CategorizableStoreAction')
326
+ route.patch('/categories/{id}', 'Actions/Cms/CategorizableUpdateAction')
327
+ route.delete('/categories/{id}', 'Actions/Cms/CategorizableDestroyAction')
328
+
329
+ route.get('/tags', 'Actions/Cms/TaggableIndexAction')
330
+ route.get('/tags/{id}', 'Actions/Cms/TaggableShowAction')
331
+ route.post('/tags', 'Actions/Cms/TaggableStoreAction')
332
+ route.patch('/tags/{id}', 'Actions/Cms/TaggableUpdateAction')
333
+ route.delete('/tags/{id}', 'Actions/Cms/TaggableDestroyAction')
334
+
335
+ route.get('/comments', 'Actions/Cms/CommentIndexAction')
336
+ route.get('/comments/{id}', 'Actions/Cms/CommentShowAction')
337
+ route.post('/comments', 'Actions/Cms/CommentStoreAction')
338
+ route.patch('/comments/{id}', 'Actions/Cms/CommentUpdateAction')
339
+ route.delete('/comments/{id}', 'Actions/Cms/CommentDestroyAction')
340
+
341
+ route.get('/pages', 'Actions/Cms/PageIndexAction')
342
+ route.post('/pages', 'Actions/Cms/PageStoreAction')
343
+ route.patch('/pages/{id}', 'Actions/Cms/PageUpdateAction')
344
+ route.delete('/pages/{id}', 'Actions/Cms/PageDestroyAction')
345
+
346
+ route.get('/files', 'Actions/Dashboard/Content/FileIndexAction')
347
+ })
348
+ }
366
349
 
367
350
  // (The public /blog mirror — posts/categories/tags/feed/sitemap from the DB —
368
351
  // was retired. The blog is now BunPress + markdown; its feed.xml and
@@ -377,183 +360,184 @@ route.group({ prefix: '/cms', middleware: guarded('/cms') }, () => {
377
360
  // underlying actions, since user routes load before framework routes.
378
361
  // ============================================================================
379
362
 
380
- route.group({ prefix: '/api/commerce', middleware: guarded('/api/commerce') }, () => {
381
- route.get('/dashboard', 'Actions/Dashboard/Commerce/CommerceDashboardAction')
382
- route.get('/pos', 'Actions/Dashboard/Commerce/PosIndexAction')
383
- route.get('/products', 'Actions/Commerce/Product/ProductIndexAction')
384
- route.get('/products/{id}', 'Actions/Commerce/Product/ProductShowAction')
385
- route.post('/products', 'Actions/Commerce/Product/ProductStoreAction')
386
- route.patch('/products/{id}', 'Actions/Commerce/Product/ProductUpdateAction')
387
- route.delete('/products/{id}', 'Actions/Commerce/Product/ProductDestroyAction')
388
-
389
- // Product subresources nested under /products/* to match the
390
- // frontend composables (defaults/functions/commerce/products/*.ts).
391
- route.get('/products/{productId}/variants', 'Actions/Commerce/Product/ProductVariantIndexAction')
392
- route.get('/products/variants', 'Actions/Commerce/Product/ProductVariantIndexAction')
393
- route.get('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantShowAction')
394
- route.post('/products/variants', 'Actions/Commerce/Product/ProductVariantStoreAction')
395
- route.patch('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantUpdateAction')
396
- route.delete('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantDestroyAction')
397
-
398
- route.get('/products/units', 'Actions/Commerce/Product/ProductUnitIndexAction')
399
- route.get('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitShowAction')
400
- route.post('/products/units', 'Actions/Commerce/Product/ProductUnitStoreAction')
401
- route.patch('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitUpdateAction')
402
- route.delete('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitDestroyAction')
403
-
404
- route.get('/product-categories', 'Actions/Commerce/Product/ProductCategoryIndexAction')
405
- route.post('/product-categories', 'Actions/Commerce/Product/ProductCategoryStoreAction')
406
-
407
- // Manufacturers — frontend composable hits `/commerce/product-manufacturers`,
408
- // so the resource name is namespaced to disambiguate from any future
409
- // standalone manufacturers concept.
410
- route.get('/product-manufacturers', 'Actions/Commerce/Product/ManufacturerIndexAction')
411
- route.get('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerShowAction')
412
- route.post('/product-manufacturers', 'Actions/Commerce/Product/ManufacturerStoreAction')
413
- route.patch('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerUpdateAction')
414
- route.delete('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerDestroyAction')
415
-
416
- route.get('/orders', 'Actions/Commerce/OrderIndexAction')
417
- route.get('/orders/{id}', 'Actions/Commerce/OrderShowAction')
418
- route.post('/orders', 'Actions/Commerce/OrderStoreAction')
419
- route.patch('/orders/{id}', 'Actions/Commerce/OrderUpdateAction')
420
- route.delete('/orders/{id}', 'Actions/Commerce/OrderDestroyAction')
421
- route.get('/orders/export', 'Actions/Commerce/OrderExportAction')
422
-
423
- route.get('/customers', 'Actions/Commerce/CustomerIndexAction')
424
- route.get('/customers/{id}', 'Actions/Commerce/CustomerShowAction')
425
- route.post('/customers', 'Actions/Commerce/CustomerStoreAction')
426
- route.patch('/customers/{id}', 'Actions/Commerce/CustomerUpdateAction')
427
- route.delete('/customers/{id}', 'Actions/Commerce/CustomerDestroyAction')
428
-
429
- route.get('/coupons', 'Actions/Commerce/CouponIndexAction')
430
- route.get('/coupons/{id}', 'Actions/Commerce/CouponShowAction')
431
- route.post('/coupons', 'Actions/Commerce/CouponStoreAction')
432
- route.patch('/coupons/{id}', 'Actions/Commerce/CouponUpdateAction')
433
- route.delete('/coupons/{id}', 'Actions/Commerce/CouponDestroyAction')
434
-
435
- route.get('/gift-cards', 'Actions/Commerce/GiftCardIndexAction')
436
- route.get('/gift-cards/stats', 'Actions/Commerce/GiftCardStatsAction')
437
- route.get('/gift-cards/{id}', 'Actions/Commerce/GiftCardShowAction')
438
- route.post('/gift-cards', 'Actions/Commerce/GiftCardStoreAction')
439
- route.patch('/gift-cards/{id}', 'Actions/Commerce/GiftCardUpdateAction')
440
- route.patch('/gift-cards/{id}/balance', 'Actions/Commerce/GiftCardUpdateBalanceAction')
441
- route.delete('/gift-cards/{id}', 'Actions/Commerce/GiftCardDestroyAction')
442
-
443
- route.get('/tax-rates', 'Actions/Commerce/TaxRateIndexAction')
444
- route.get('/tax-rates/{id}', 'Actions/Commerce/TaxRateShowAction')
445
- route.post('/tax-rates', 'Actions/Commerce/TaxRateStoreAction')
446
- route.patch('/tax-rates/{id}', 'Actions/Commerce/TaxRateUpdateAction')
447
- route.delete('/tax-rates/{id}', 'Actions/Commerce/TaxRateDestroyAction')
448
-
449
- // Reviews are scoped to products — frontend composable hits
450
- // `/commerce/products/reviews`, not `/commerce/reviews`.
451
- route.get('/products/reviews', 'Actions/Commerce/ReviewIndexAction')
452
- route.get('/products/reviews/{id}', 'Actions/Commerce/ReviewShowAction')
453
- route.post('/products/reviews', 'Actions/Commerce/ReviewStoreAction')
454
- route.patch('/products/reviews/{id}', 'Actions/Commerce/ReviewUpdateAction')
455
- route.delete('/products/reviews/{id}', 'Actions/Commerce/ReviewDestroyAction')
456
-
457
- route.get('/receipts', 'Actions/Commerce/ReceiptIndexAction')
458
- route.get('/receipts/{id}', 'Actions/Commerce/ReceiptShowAction')
459
- route.post('/receipts', 'Actions/Commerce/ReceiptStoreAction')
460
- route.patch('/receipts/{id}', 'Actions/Commerce/ReceiptUpdateAction')
461
- route.delete('/receipts/{id}', 'Actions/Commerce/ReceiptDestroyAction')
462
-
463
- route.get('/print-devices', 'Actions/Commerce/PrintDeviceIndexAction')
464
- route.get('/print-devices/{id}', 'Actions/Commerce/PrintDeviceShowAction')
465
- route.post('/print-devices', 'Actions/Commerce/PrintDeviceStoreAction')
466
- route.patch('/print-devices/{id}', 'Actions/Commerce/PrintDeviceUpdateAction')
467
- route.delete('/print-devices/{id}', 'Actions/Commerce/PrintDeviceDestroyAction')
468
-
469
- route.get('/payment-stats', 'Actions/Commerce/PaymentFetchStatsAction')
470
- route.get('/payment-trends', 'Actions/Commerce/PaymentMonthlyTrendsAction')
471
- // Renamed from `/commerce-payments` — that path was double-prefixed
472
- // because this group already mounts under `/commerce`, so callers
473
- // hitting `/api/commerce/payments` (which the frontend composable
474
- // does — see defaults/functions/commerce/payments.ts) were 404ing.
475
- route.get('/payments', 'Actions/Commerce/PaymentIndexAction')
476
- route.get('/payments/{id}', 'Actions/Commerce/PaymentShowAction')
477
- route.post('/payments', 'Actions/Commerce/PaymentStoreAction')
478
- route.patch('/payments/{id}', 'Actions/Commerce/PaymentUpdateAction')
479
- route.delete('/payments/{id}', 'Actions/Commerce/PaymentDestroyAction')
480
-
481
- route.get('/waitlist/products', 'Actions/Commerce/WaitlistProductIndexAction')
482
- route.get('/waitlist/products/analytics', 'Actions/Commerce/WaitlistProductAnalyticsAction')
483
- route.get('/waitlist/products/status', 'Actions/Commerce/WaitlistProductStatusAction')
484
- route.get('/waitlist/products/time-series', 'Actions/Commerce/WaitlistProductTimeSeriesAction')
485
- route.get('/waitlist/products/quantity-distribution', 'Actions/Commerce/WaitlistProductQuantityDistributionAction')
486
- route.get('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductShowAction')
487
- route.post('/waitlist/products', 'Actions/Commerce/WaitlistProductStoreAction')
488
- route.patch('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductUpdateAction')
489
- route.delete('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductDestroyAction')
490
-
491
- route.get('/waitlist/restaurants', 'Actions/Commerce/WaitlistRestaurantIndexAction')
492
- route.get('/waitlist/restaurants/dashboard', 'Actions/Commerce/WaitlistRestaurantDashboardAction')
493
- route.get('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantShowAction')
494
- route.post('/waitlist/restaurants', 'Actions/Commerce/WaitlistRestaurantStoreAction')
495
- route.patch('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantUpdateAction')
496
- route.delete('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantDestroyAction')
497
-
498
- // ----------------------------------------------------------------
499
- // Shipping (moved from a top-level /shipping group on 2026-05-08).
500
- // The frontend composables (defaults/functions/commerce/shippings/*.ts)
501
- // all expect these resources under /commerce/*, so the prior /shipping
502
- // group was orphaned — every shipping/courier/license/digital call
503
- // from the dashboard was 404ing. Resource names match the composable
504
- // file names: shipping-methods/rates/zones, delivery-routes, couriers,
505
- // digital-deliveries, license-keys.
506
- // ----------------------------------------------------------------
507
- route.get('/shipping-methods', 'Actions/Commerce/Shipping/ShippingMethodIndexAction')
508
- route.get('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodShowAction')
509
- route.post('/shipping-methods', 'Actions/Commerce/Shipping/ShippingMethodStoreAction')
510
- route.patch('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodUpdateAction')
511
- route.delete('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodDestroyAction')
512
-
513
- route.get('/shipping-rates', 'Actions/Commerce/Shipping/ShippingRateIndexAction')
514
- route.get('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateShowAction')
515
- route.post('/shipping-rates', 'Actions/Commerce/Shipping/ShippingRateStoreAction')
516
- route.patch('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateUpdateAction')
517
- route.delete('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateDestroyAction')
518
-
519
- route.get('/shipping-zones', 'Actions/Commerce/Shipping/ShippingZoneIndexAction')
520
- route.get('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneShowAction')
521
- route.post('/shipping-zones', 'Actions/Commerce/Shipping/ShippingZoneStoreAction')
522
- route.patch('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneUpdateAction')
523
- route.delete('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneDestroyAction')
524
-
525
- route.get('/delivery-routes', 'Actions/Commerce/Shipping/DeliveryRouteIndexAction')
526
- route.get('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteShowAction')
527
- route.post('/delivery-routes', 'Actions/Commerce/Shipping/DeliveryRouteStoreAction')
528
- route.patch('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteUpdateAction')
529
- route.delete('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteDestroyAction')
530
-
531
- route.get('/couriers', 'Actions/Commerce/Shipping/CourierIndexAction')
532
- route.get('/couriers/{id}', 'Actions/Commerce/Shipping/CourierShowAction')
533
- route.post('/couriers', 'Actions/Commerce/Shipping/CourierStoreAction')
534
- route.patch('/couriers/{id}', 'Actions/Commerce/Shipping/CourierUpdateAction')
535
- route.delete('/couriers/{id}', 'Actions/Commerce/Shipping/CourierDestroyAction')
536
-
537
- // Renamed from `/digital` — frontend composable expects `/digital-deliveries`.
538
- route.get('/digital-deliveries', 'Actions/Commerce/Shipping/DigitalDeliveryIndexAction')
539
- route.get('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryShowAction')
540
- route.post('/digital-deliveries', 'Actions/Commerce/Shipping/DigitalDeliveryStoreAction')
541
- route.patch('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryUpdateAction')
542
- route.delete('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryDestroyAction')
543
-
544
- route.get('/license-keys', 'Actions/Commerce/Shipping/LicenseKeyIndexAction')
545
- route.get('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyShowAction')
546
- route.post('/license-keys', 'Actions/Commerce/Shipping/LicenseKeyStoreAction')
547
- route.patch('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyUpdateAction')
548
- route.delete('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyDestroyAction')
549
- })
363
+ if (feature('commerce')) {
364
+ route.group({ prefix: '/api/commerce', middleware: guarded('/api/commerce') }, () => {
365
+ route.get('/dashboard', 'Actions/Dashboard/Commerce/CommerceDashboardAction')
366
+ route.get('/pos', 'Actions/Dashboard/Commerce/PosIndexAction')
367
+ route.get('/products', 'Actions/Commerce/Product/ProductIndexAction')
368
+ route.get('/products/{id}', 'Actions/Commerce/Product/ProductShowAction')
369
+ route.post('/products', 'Actions/Commerce/Product/ProductStoreAction')
370
+ route.patch('/products/{id}', 'Actions/Commerce/Product/ProductUpdateAction')
371
+ route.delete('/products/{id}', 'Actions/Commerce/Product/ProductDestroyAction')
372
+
373
+ // Product subresources nested under /products/* to match the
374
+ // frontend composables (defaults/functions/commerce/products/*.ts).
375
+ route.get('/products/{productId}/variants', 'Actions/Commerce/Product/ProductVariantIndexAction')
376
+ route.get('/products/variants', 'Actions/Commerce/Product/ProductVariantIndexAction')
377
+ route.get('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantShowAction')
378
+ route.post('/products/variants', 'Actions/Commerce/Product/ProductVariantStoreAction')
379
+ route.patch('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantUpdateAction')
380
+ route.delete('/products/variants/{id}', 'Actions/Commerce/Product/ProductVariantDestroyAction')
381
+
382
+ route.get('/products/units', 'Actions/Commerce/Product/ProductUnitIndexAction')
383
+ route.get('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitShowAction')
384
+ route.post('/products/units', 'Actions/Commerce/Product/ProductUnitStoreAction')
385
+ route.patch('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitUpdateAction')
386
+ route.delete('/products/units/{id}', 'Actions/Commerce/Product/ProductUnitDestroyAction')
387
+
388
+ route.get('/product-categories', 'Actions/Commerce/Product/ProductCategoryIndexAction')
389
+ route.post('/product-categories', 'Actions/Commerce/Product/ProductCategoryStoreAction')
390
+
391
+ // Manufacturers — frontend composable hits `/commerce/product-manufacturers`,
392
+ // so the resource name is namespaced to disambiguate from any future
393
+ // standalone manufacturers concept.
394
+ route.get('/product-manufacturers', 'Actions/Commerce/Product/ManufacturerIndexAction')
395
+ route.get('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerShowAction')
396
+ route.post('/product-manufacturers', 'Actions/Commerce/Product/ManufacturerStoreAction')
397
+ route.patch('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerUpdateAction')
398
+ route.delete('/product-manufacturers/{id}', 'Actions/Commerce/Product/ManufacturerDestroyAction')
399
+
400
+ route.get('/orders', 'Actions/Commerce/OrderIndexAction')
401
+ route.get('/orders/{id}', 'Actions/Commerce/OrderShowAction')
402
+ route.post('/orders', 'Actions/Commerce/OrderStoreAction')
403
+ route.patch('/orders/{id}', 'Actions/Commerce/OrderUpdateAction')
404
+ route.delete('/orders/{id}', 'Actions/Commerce/OrderDestroyAction')
405
+ route.get('/orders/export', 'Actions/Commerce/OrderExportAction')
406
+
407
+ route.get('/customers', 'Actions/Commerce/CustomerIndexAction')
408
+ route.get('/customers/{id}', 'Actions/Commerce/CustomerShowAction')
409
+ route.post('/customers', 'Actions/Commerce/CustomerStoreAction')
410
+ route.patch('/customers/{id}', 'Actions/Commerce/CustomerUpdateAction')
411
+ route.delete('/customers/{id}', 'Actions/Commerce/CustomerDestroyAction')
412
+
413
+ route.get('/coupons', 'Actions/Commerce/CouponIndexAction')
414
+ route.get('/coupons/{id}', 'Actions/Commerce/CouponShowAction')
415
+ route.post('/coupons', 'Actions/Commerce/CouponStoreAction')
416
+ route.patch('/coupons/{id}', 'Actions/Commerce/CouponUpdateAction')
417
+ route.delete('/coupons/{id}', 'Actions/Commerce/CouponDestroyAction')
418
+
419
+ route.get('/gift-cards', 'Actions/Commerce/GiftCardIndexAction')
420
+ route.get('/gift-cards/stats', 'Actions/Commerce/GiftCardStatsAction')
421
+ route.get('/gift-cards/{id}', 'Actions/Commerce/GiftCardShowAction')
422
+ route.post('/gift-cards', 'Actions/Commerce/GiftCardStoreAction')
423
+ route.patch('/gift-cards/{id}', 'Actions/Commerce/GiftCardUpdateAction')
424
+ route.patch('/gift-cards/{id}/balance', 'Actions/Commerce/GiftCardUpdateBalanceAction')
425
+ route.delete('/gift-cards/{id}', 'Actions/Commerce/GiftCardDestroyAction')
426
+
427
+ route.get('/tax-rates', 'Actions/Commerce/TaxRateIndexAction')
428
+ route.get('/tax-rates/{id}', 'Actions/Commerce/TaxRateShowAction')
429
+ route.post('/tax-rates', 'Actions/Commerce/TaxRateStoreAction')
430
+ route.patch('/tax-rates/{id}', 'Actions/Commerce/TaxRateUpdateAction')
431
+ route.delete('/tax-rates/{id}', 'Actions/Commerce/TaxRateDestroyAction')
432
+
433
+ // Reviews are scoped to products — frontend composable hits
434
+ // `/commerce/products/reviews`, not `/commerce/reviews`.
435
+ route.get('/products/reviews', 'Actions/Commerce/ReviewIndexAction')
436
+ route.get('/products/reviews/{id}', 'Actions/Commerce/ReviewShowAction')
437
+ route.post('/products/reviews', 'Actions/Commerce/ReviewStoreAction')
438
+ route.patch('/products/reviews/{id}', 'Actions/Commerce/ReviewUpdateAction')
439
+ route.delete('/products/reviews/{id}', 'Actions/Commerce/ReviewDestroyAction')
440
+
441
+ route.get('/receipts', 'Actions/Commerce/ReceiptIndexAction')
442
+ route.get('/receipts/{id}', 'Actions/Commerce/ReceiptShowAction')
443
+ route.post('/receipts', 'Actions/Commerce/ReceiptStoreAction')
444
+ route.patch('/receipts/{id}', 'Actions/Commerce/ReceiptUpdateAction')
445
+ route.delete('/receipts/{id}', 'Actions/Commerce/ReceiptDestroyAction')
446
+
447
+ route.get('/print-devices', 'Actions/Commerce/PrintDeviceIndexAction')
448
+ route.get('/print-devices/{id}', 'Actions/Commerce/PrintDeviceShowAction')
449
+ route.post('/print-devices', 'Actions/Commerce/PrintDeviceStoreAction')
450
+ route.patch('/print-devices/{id}', 'Actions/Commerce/PrintDeviceUpdateAction')
451
+ route.delete('/print-devices/{id}', 'Actions/Commerce/PrintDeviceDestroyAction')
452
+
453
+ route.get('/payment-stats', 'Actions/Commerce/PaymentFetchStatsAction')
454
+ route.get('/payment-trends', 'Actions/Commerce/PaymentMonthlyTrendsAction')
455
+ // Renamed from `/commerce-payments` — that path was double-prefixed
456
+ // because this group already mounts under `/commerce`, so callers
457
+ // hitting `/api/commerce/payments` (which the frontend composable
458
+ // does — see defaults/functions/commerce/payments.ts) were 404ing.
459
+ route.get('/payments', 'Actions/Commerce/PaymentIndexAction')
460
+ route.get('/payments/{id}', 'Actions/Commerce/PaymentShowAction')
461
+ route.post('/payments', 'Actions/Commerce/PaymentStoreAction')
462
+ route.patch('/payments/{id}', 'Actions/Commerce/PaymentUpdateAction')
463
+ route.delete('/payments/{id}', 'Actions/Commerce/PaymentDestroyAction')
464
+
465
+ route.get('/waitlist/products', 'Actions/Commerce/WaitlistProductIndexAction')
466
+ route.get('/waitlist/products/analytics', 'Actions/Commerce/WaitlistProductAnalyticsAction')
467
+ route.get('/waitlist/products/status', 'Actions/Commerce/WaitlistProductStatusAction')
468
+ route.get('/waitlist/products/time-series', 'Actions/Commerce/WaitlistProductTimeSeriesAction')
469
+ route.get('/waitlist/products/quantity-distribution', 'Actions/Commerce/WaitlistProductQuantityDistributionAction')
470
+ route.get('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductShowAction')
471
+ route.post('/waitlist/products', 'Actions/Commerce/WaitlistProductStoreAction')
472
+ route.patch('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductUpdateAction')
473
+ route.delete('/waitlist/products/{id}', 'Actions/Commerce/WaitlistProductDestroyAction')
474
+
475
+ route.get('/waitlist/restaurants', 'Actions/Commerce/WaitlistRestaurantIndexAction')
476
+ route.get('/waitlist/restaurants/dashboard', 'Actions/Commerce/WaitlistRestaurantDashboardAction')
477
+ route.get('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantShowAction')
478
+ route.post('/waitlist/restaurants', 'Actions/Commerce/WaitlistRestaurantStoreAction')
479
+ route.patch('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantUpdateAction')
480
+ route.delete('/waitlist/restaurants/{id}', 'Actions/Commerce/WaitlistRestaurantDestroyAction')
481
+
482
+ // ----------------------------------------------------------------
483
+ // Shipping (moved from a top-level /shipping group on 2026-05-08).
484
+ // The frontend composables (defaults/functions/commerce/shippings/*.ts)
485
+ // all expect these resources under /commerce/*, so the prior /shipping
486
+ // group was orphaned — every shipping/courier/license/digital call
487
+ // from the dashboard was 404ing. Resource names match the composable
488
+ // file names: shipping-methods/rates/zones, delivery-routes, couriers,
489
+ // digital-deliveries, license-keys.
490
+ // ----------------------------------------------------------------
491
+ route.get('/shipping-methods', 'Actions/Commerce/Shipping/ShippingMethodIndexAction')
492
+ route.get('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodShowAction')
493
+ route.post('/shipping-methods', 'Actions/Commerce/Shipping/ShippingMethodStoreAction')
494
+ route.patch('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodUpdateAction')
495
+ route.delete('/shipping-methods/{id}', 'Actions/Commerce/Shipping/ShippingMethodDestroyAction')
496
+
497
+ route.get('/shipping-rates', 'Actions/Commerce/Shipping/ShippingRateIndexAction')
498
+ route.get('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateShowAction')
499
+ route.post('/shipping-rates', 'Actions/Commerce/Shipping/ShippingRateStoreAction')
500
+ route.patch('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateUpdateAction')
501
+ route.delete('/shipping-rates/{id}', 'Actions/Commerce/Shipping/ShippingRateDestroyAction')
502
+
503
+ route.get('/shipping-zones', 'Actions/Commerce/Shipping/ShippingZoneIndexAction')
504
+ route.get('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneShowAction')
505
+ route.post('/shipping-zones', 'Actions/Commerce/Shipping/ShippingZoneStoreAction')
506
+ route.patch('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneUpdateAction')
507
+ route.delete('/shipping-zones/{id}', 'Actions/Commerce/Shipping/ShippingZoneDestroyAction')
508
+
509
+ route.get('/delivery-routes', 'Actions/Commerce/Shipping/DeliveryRouteIndexAction')
510
+ route.get('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteShowAction')
511
+ route.post('/delivery-routes', 'Actions/Commerce/Shipping/DeliveryRouteStoreAction')
512
+ route.patch('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteUpdateAction')
513
+ route.delete('/delivery-routes/{id}', 'Actions/Commerce/Shipping/DeliveryRouteDestroyAction')
514
+
515
+ route.get('/couriers', 'Actions/Commerce/Shipping/CourierIndexAction')
516
+ route.get('/couriers/{id}', 'Actions/Commerce/Shipping/CourierShowAction')
517
+ route.post('/couriers', 'Actions/Commerce/Shipping/CourierStoreAction')
518
+ route.patch('/couriers/{id}', 'Actions/Commerce/Shipping/CourierUpdateAction')
519
+ route.delete('/couriers/{id}', 'Actions/Commerce/Shipping/CourierDestroyAction')
520
+
521
+ // Renamed from `/digital` — frontend composable expects `/digital-deliveries`.
522
+ route.get('/digital-deliveries', 'Actions/Commerce/Shipping/DigitalDeliveryIndexAction')
523
+ route.get('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryShowAction')
524
+ route.post('/digital-deliveries', 'Actions/Commerce/Shipping/DigitalDeliveryStoreAction')
525
+ route.patch('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryUpdateAction')
526
+ route.delete('/digital-deliveries/{id}', 'Actions/Commerce/Shipping/DigitalDeliveryDestroyAction')
527
+
528
+ route.get('/license-keys', 'Actions/Commerce/Shipping/LicenseKeyIndexAction')
529
+ route.get('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyShowAction')
530
+ route.post('/license-keys', 'Actions/Commerce/Shipping/LicenseKeyStoreAction')
531
+ route.patch('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyUpdateAction')
532
+ route.delete('/license-keys/{id}', 'Actions/Commerce/Shipping/LicenseKeyDestroyAction')
533
+ })
534
+ }
550
535
 
551
536
  // ============================================================================
552
537
  // Analytics
553
538
  // ============================================================================
554
539
 
555
540
  route.group({ prefix: '/api/analytics', middleware: guarded('/api/analytics') }, () => {
556
- route.get('/sales', 'Actions/Dashboard/Analytics/SalesAnalyticsAction')
557
541
  route.get('/web', 'Actions/Dashboard/Analytics/WebAnalyticsAction')
558
542
  route.get('/blog', 'Actions/Dashboard/Analytics/BlogAnalyticsAction')
559
543
  route.get('/browsers', 'Actions/Dashboard/Analytics/BrowserAnalyticsAction')
@@ -563,7 +547,12 @@ route.group({ prefix: '/api/analytics', middleware: guarded('/api/analytics') },
563
547
  route.get('/marketing', 'Actions/Dashboard/Analytics/MarketingAnalyticsAction')
564
548
  route.get('/pages', 'Actions/Dashboard/Analytics/PageAnalyticsAction')
565
549
  route.get('/referrers', 'Actions/Dashboard/Analytics/ReferrerAnalyticsAction')
566
- route.get('/commerce', 'Actions/Dashboard/Analytics/CommerceAnalyticsAction')
550
+ // Sales and commerce analytics read the commerce tables, so they exist only
551
+ // with commerce installed.
552
+ if (feature('commerce')) {
553
+ route.get('/sales', 'Actions/Dashboard/Analytics/SalesAnalyticsAction')
554
+ route.get('/commerce', 'Actions/Dashboard/Analytics/CommerceAnalyticsAction')
555
+ }
567
556
  })
568
557
 
569
558
  // ============================================================================
@@ -632,30 +621,34 @@ route.get('/api/serverless', 'Actions/Dashboard/Cloud/ServerlessIndexAction').mi
632
621
  // Dashboard Views — Commerce
633
622
  // ============================================================================
634
623
 
635
- route.group({ prefix: '/dashboard/commerce', middleware: guarded('/dashboard/commerce') }, () => {
636
- route.get('/customers', 'Actions/Dashboard/Commerce/CommerceCustomersAction')
637
- route.get('/orders', 'Actions/Dashboard/Commerce/CommerceOrdersAction')
638
- route.get('/products', 'Actions/Dashboard/Commerce/CommerceProductsAction')
639
- route.get('/coupons', 'Actions/Dashboard/Commerce/CommerceCouponsAction')
640
- route.get('/gift-cards', 'Actions/Dashboard/Commerce/CommerceGiftCardsAction')
641
- route.get('/payments', 'Actions/Dashboard/Commerce/CommercePaymentsAction')
642
- route.get('/delivery', 'Actions/Dashboard/Commerce/CommerceDeliveryAction')
643
- route.get('/taxes', 'Actions/Dashboard/Commerce/CommerceTaxesAction')
644
- route.get('/reviews', 'Actions/Dashboard/Commerce/ReviewIndexAction')
645
- })
624
+ if (feature('commerce')) {
625
+ route.group({ prefix: '/dashboard/commerce', middleware: guarded('/dashboard/commerce') }, () => {
626
+ route.get('/customers', 'Actions/Dashboard/Commerce/CommerceCustomersAction')
627
+ route.get('/orders', 'Actions/Dashboard/Commerce/CommerceOrdersAction')
628
+ route.get('/products', 'Actions/Dashboard/Commerce/CommerceProductsAction')
629
+ route.get('/coupons', 'Actions/Dashboard/Commerce/CommerceCouponsAction')
630
+ route.get('/gift-cards', 'Actions/Dashboard/Commerce/CommerceGiftCardsAction')
631
+ route.get('/payments', 'Actions/Dashboard/Commerce/CommercePaymentsAction')
632
+ route.get('/delivery', 'Actions/Dashboard/Commerce/CommerceDeliveryAction')
633
+ route.get('/taxes', 'Actions/Dashboard/Commerce/CommerceTaxesAction')
634
+ route.get('/reviews', 'Actions/Dashboard/Commerce/ReviewIndexAction')
635
+ })
636
+ }
646
637
 
647
638
  // ============================================================================
648
639
  // Dashboard Views — CMS Content
649
640
  // ============================================================================
650
641
 
651
- route.group({ prefix: '/dashboard/cms', middleware: guarded('/dashboard/cms') }, () => {
652
- route.get('/posts', 'Actions/Dashboard/Content/PostIndexAction')
653
- route.get('/pages', 'Actions/Dashboard/Content/PageIndexAction')
654
- route.get('/categories', 'Actions/Dashboard/Content/CategoryIndexAction')
655
- route.get('/tags', 'Actions/Dashboard/Content/TagIndexAction')
656
- route.get('/comments', 'Actions/Dashboard/Content/CommentIndexAction')
657
- route.get('/authors', 'Actions/Dashboard/Content/AuthorIndexAction')
658
- })
642
+ if (feature('cms')) {
643
+ route.group({ prefix: '/dashboard/cms', middleware: guarded('/dashboard/cms') }, () => {
644
+ route.get('/posts', 'Actions/Dashboard/Content/PostIndexAction')
645
+ route.get('/pages', 'Actions/Dashboard/Content/PageIndexAction')
646
+ route.get('/categories', 'Actions/Dashboard/Content/CategoryIndexAction')
647
+ route.get('/tags', 'Actions/Dashboard/Content/TagIndexAction')
648
+ route.get('/comments', 'Actions/Dashboard/Content/CommentIndexAction')
649
+ route.get('/authors', 'Actions/Dashboard/Content/AuthorIndexAction')
650
+ })
651
+ }
659
652
 
660
653
  // ============================================================================
661
654
  // Marketing