Commit Graph
12 Commits
Author SHA1 Message Date
libretech 8931afc670 feat(checkout): show a German message when a checkout step fails
checkoutErrorMessage (utils/checkoutError.ts) maps the status and body of a
failed request, the shop's answer or a raw CMS (Strapi) error, to one fixed
message for the customer, addressed with "du": an invalid e-mail address
(when data.email is among the rejected fields), other invalid input, an order
already paid, a product no longer available, an order not ready for checkout
(naming the missing steps), a payment that does not fit the order or an order
changed during the payment ("Bitte starte die Zahlung neu"), PayPal not
reachable ("versuche es in ein paar Minuten noch einmal"), a payment PayPal
may have taken that the CMS could not confirm or record ("Bitte bezahle nicht
noch einmal"), and a general fallback. It never shows the server's text.

Steps 1 and 2 show the message above their submit button, in the style of
step 3's payment error, instead of logging the error only. Step 3 shows it
for a failed PayPal order creation or capture. The e-mail input of step 1 is
type="email" (Input.vue takes a type).

Refs libretech/mp#71
2026-10-09 02:32:32 +02:00
libretech bfcbbfac39 fix(orders): forward only the checkout's fields on an order update
PUT /api/orders/:uuid forwarded the browser's body to the CMS unchanged. It
now forwards { data } with only the seven fields of the checkout's steps:
email, acceptedTermsAndConditionsAt, invoiceAddress, deliveryAddress,
invoiceAddressStructured, deliveryAddressStructured and delivery. Any other
field, a field beside data, or a body of another shape is answered 400
"Invalid order update" with the CMS's error format, without calling the
CMS. The values are left to the CMS, which checks them and stays the
authority; this is defence in depth.

pickCustomerUpdate (server/utils/customerUpdate.ts) is pure and tested with
the exact payloads of steps 1 and 2 and with every server-only attribute of
the order.

Refs libretech/mp#71
2026-10-09 02:32:20 +02:00
libretech 5c773a99e6 feat(orders): pass the CMS's status and safe error fields to the browser
The order routes (get, put, add-product, remove-product, checkout, capture)
call forwardToCms, which throws a CMS error on as
createError({ statusCode, statusMessage, data: { message, errors?, missing? } }),
built by the pure shopErrorFromCms (server/utils/cmsError.ts).

Before, the FetchError was thrown on as it was: the browser got the CMS's
status, but Nitro treated it as unhandled, answered "Server Error" without
data and logged every CMS 4xx as [unhandled]. Now the browser also gets the
CMS's message, the errors of a rejected update and the fields a checkout
misses, and no other field. A status that is the shop's own fault (401, 403,
...) is answered 500, a CMS that does not answer 503; 5xx are logged without
the query and the order uuid.

npm test runs tests/unit with Node's type stripping and no dependencies, as
in libreshop/cms. nuxt.config keeps tests/ out of the app's type check.

Refs libretech/mp#71
2026-10-09 02:32:14 +02:00
libretech 61a74e649b feat(selection): lock single-option boxes, drop the about link
build / build (push) Successful in 1m38s
Recovered work in progress that sat uncommitted since 2026-05: a
SelectionBox renders as a plain div instead of a NuxtLink when locked,
so a variant with only one choice reads as decided rather than
clickable, and it reports aria-checked in that state. useProductContent
gained the content lookups the details and index pages now use, the
cookie banner says Schließen instead of Akzeptieren, the Über uns
header entry is gone, and ProductCard's hover shadow no longer relies
on a short-circuit that could yield a non-array.
2026-09-23 22:09:52 +02:00
libretech e9cd3d9c20 ci: bump runner-image pin v0.1.0 → v0.2.0 (#15)
build / build (push) Successful in 1m18s
Co-authored-by: Michael Czechowski <mail@dailysh.it>
Co-committed-by: Michael Czechowski <mail@dailysh.it>
2026-05-04 23:46:04 +02:00
libretech cfe37519bd fix(ci): correct image digest separator
build / build (push) Successful in 1m6s
2026-04-30 12:20:40 +02:00
libretech 60ab9dcc23 ci: digest-pin runner-image v0.1.0
build / build (push) Failing after 0s
2026-04-30 12:18:04 +02:00
libretech 4fe5b9043d ci: update runner-image path to public/ namespace
build / build (push) Failing after 1s
2026-04-30 11:57:33 +02:00
libretech f8d4c6a47d chore: update action ref to public/actions
build / build (push) Successful in 1m28s
2026-04-29 22:51:08 +02:00
libretech ed6771e03a chore: slim build.yml to use shared docker-build action (#1)
build / build (push) Successful in 1m22s
2026-04-29 22:08:36 +02:00
Michael Czechowski 304c20c1b8 ci: kick first build after enabling Gitea Actions
Build and publish / build (push) Successful in 1m41s
v0.1.0
2026-04-29 17:51:13 +02:00
Michael Czechowski 44107c0734 feat: extract shop from mp/shop — initial libreshop/shop
Build and publish / build (push) Failing after 19s
Source moved verbatim from mp/shop/ on 2026-04-29; mp was the first
concrete adapter consuming the libreshop toolkit. Builds and publishes
git.librete.ch/libreshop/shop on every main / v* push via the standard
.gitea/workflows/build.yml shared across libreshop components.
2026-04-29 17:48:56 +02:00