feat: online ordering settings (services, hours, preparation, slots) and the order app e2e (platform-v2 3S, S.4)
- connect_orders.ordering setting; GET/PUT /api/connect/fees/ordering (validated: services, hours per day incl. past midnight, preparation, slot minutes, days ahead, ASAP); pushed to the cloud with the menu (snapshot `ordering`). - Manager: the Online ordering page gains "Services and hours" (OrderingSettings.jsx; logic in feesLogic.js, unit-tested); nav label "Online ordering". - tests/e2e/order_app.mjs: a real cloud + the built order app in a phone-sized browser: takeaway and delivery placed, priced by the cloud (fee by area, minimum refused), the site moves the delivery to delivered and the page follows; a rejection with its reason; Greek. In run-all, with the order app's unit tests. - Tests: backend +1 (406), manager unit +1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Delivery areas and fees (plan phase 3S, step S.3). Backend: /api/connect/fees
|
||||
// Online ordering (plan phase 3S, steps S.3–S.4): the ordering settings (OrderingSettings),
|
||||
// delivery areas and fees. Backend: /api/connect/fees
|
||||
// (connect_orders.fees). The venue lists the areas it delivers to and the fee rules, looked
|
||||
// at from the top: a rule whose conditions hold changes the fee (set, add, % of the
|
||||
// products, free) or refuses the order below a minimum; "stop here" makes the first match
|
||||
@@ -12,6 +13,7 @@ import { useFormat, useTranslation } from '@xenia/i18n'
|
||||
import { SALES_POINTS } from '@xenia/access'
|
||||
import { Button, Dialog, EmptyState, Field, IconButton, Input, Select, Spinner, Switch } from '@xenia/ui'
|
||||
import client from '../../api/client'
|
||||
import OrderingSettings from './OrderingSettings'
|
||||
import { ACTIONS, DAYS, describeRule, emptyRule, moveRule, parsePostcodes, previewBody, ruleBody, ruleProblems, ruleToForm } from './feesLogic'
|
||||
|
||||
const chip = on => `px-3 min-h-[var(--x-control-sm)] rounded-full text-label font-medium transition-colors duration-fast
|
||||
@@ -51,10 +53,16 @@ export default function FeesPage() {
|
||||
return (
|
||||
<div className="p-4 md:p-6 grid gap-6 max-w-6xl" data-testid="fees-page">
|
||||
<header className="grid gap-1">
|
||||
<h1 className="text-heading font-semibold text-ink">{t('fees.title')}</h1>
|
||||
<p className="text-body text-ink-2 max-w-3xl">{t('fees.intro')}</p>
|
||||
<h1 className="text-heading font-semibold text-ink">{t('ordering.pageTitle')}</h1>
|
||||
</header>
|
||||
|
||||
<OrderingSettings key={JSON.stringify(data.ordering)} ordering={data.ordering} />
|
||||
|
||||
<div className="grid gap-1">
|
||||
<h2 className="text-title font-semibold text-ink">{t('fees.title')}</h2>
|
||||
<p className="text-body text-ink-2 max-w-3xl">{t('fees.intro')}</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-6 lg:grid-cols-[1fr_22rem] items-start">
|
||||
<section className="grid gap-3" aria-labelledby="fee-rules">
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user