Commit Graph

29 Commits

Author SHA1 Message Date
giles
0b2e59bc2c Add cart-mini and account-nav-item fragment handlers
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 59s
Phase 2 of fragment composition: cart exposes cart-mini fragment
(icon + item count badge) and account-nav-item fragment (orders
link) via /internal/fragments/ endpoint. Updates shared submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 09:11:50 +00:00
giles
ac458ba96c Add fragment blueprint + sync shared: micro-frontend infrastructure
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m33s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 08:27:49 +00:00
giles
739ad0451e Fix cart clearing on unpaid checkout
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
Cart was soft-deleted when the SumUp checkout was created, before the
user paid. If they navigated back, their cart was empty.

Move clear_cart_for_order into check_sumup_status so it only runs
when the order status transitions to "paid".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:27:33 +00:00
giles
d93e624b45 Switch to unified AP activity bus
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m0s
emit_event → emit_activity for order.created and order.paid events.
Update shared submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 16:20:12 +00:00
giles
058f0a1d8a Add csrf_exempt to SumUp webhook endpoint
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 55s
SumUp POSTs to /checkout/webhook/ externally with no session,
causing CSRF rejection. Mark endpoint as exempt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 21:13:00 +00:00
giles
e86c4a0cc8 Fix Decimal+float TypeError in cart total calculation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s
Product prices are float from DB but calendar/ticket totals are Decimal,
causing TypeError when summed in cart_context. Wrap prices in Decimal().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 21:11:54 +00:00
giles
28c10a3411 Fix TypeError: Decimal + float in cart_total computation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
ticket_total() returned float while total() returns Decimal, causing
a crash when summing cart totals. Standardise all total functions to
return Decimal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 09:36:22 +00:00
giles
fd89426ed9 Group cart tickets by event with +/- quantity buttons
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 51s
- Cart page groups tickets by entry+type instead of listing individually
- Each group shows event name, type, date, qty with +/- buttons, line total
- New POST /cart/ticket-quantity/ route for adjusting from cart page
- Summary includes ticket quantities in Items count

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 08:53:17 +00:00
giles
dc249ea9ce Decoupling audit: remove cart API, update shared submodule
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m13s
- Delete bp/cart/api.py (dead internal API endpoint)
- Remove registration from bp/__init__.py and app.py
- Update shared submodule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:15:28 +00:00
giles
cd41b6c8ef Add ticket-to-cart integration
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m6s
Tickets now appear as cart line items, are included in checkout totals,
confirmed on payment, and displayed on the checkout return page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 22:01:30 +00:00
giles
f299805c22 Group cart overview by market, show market name on cards
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 52s
A page can have multiple markets — the overview now groups cart items
by market_place_id instead of page. Each card shows the market name
as heading with the page title below it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:41:28 +00:00
giles
17ab7f09c7 Add delete endpoint with confirm modal, keep items at quantity 0
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 48s
- POST /delete/<product_id>/ removes the cart item entirely
- POST /quantity/ now clamps at 0 instead of deleting
- cart_delete_url Jinja global registered for template

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:43:35 +00:00
giles
6140c727c6 Add /quantity/ endpoint so cart +/- buttons work same-origin
Adds POST /quantity/<product_id>/ to set cart item quantity (or remove at 0),
and registers cart_quantity_url Jinja global so the shared template uses it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 09:31:11 +00:00
giles
8498807597 Remove Calendar model import from checkout, use DTO fields
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 47s
resolve_page_config() now reads entry.calendar_container_id from the
CalendarEntryDTO instead of fetching the Calendar ORM model. Fixes
stale CalendarEntry type hints to CalendarEntryDTO. Updates shared
submodule.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 06:07:12 +00:00
giles
edad7b299d Fix DTO compatibility in cart templates and page_cart service
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m58s
- page_cart.py: use ce.calendar_container_id instead of ce.calendar.container_id
- _cart.html: use entry.calendar_name instead of entry.calendar.name
- Update shared submodule with DTO field additions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 05:05:04 +00:00
giles
049b35479b Domain isolation: replace cross-domain imports with service calls
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
Replace direct Post, Calendar, CalendarEntry model queries and glue
lifecycle imports with typed service calls. Cart registers all 4
services via domain_services_fn with has() guards.

Key changes:
- app.py: use domain_services_fn, Post query → services.blog
- api.py: Calendar/CalendarEntry → services.calendar
- checkout: glue order_lifecycle → services.calendar.claim/confirm
- calendar_cart: CalendarEntry → services.calendar.pending_entries()
- page_cart: Post/Calendar queries → services.blog/calendar
- global_routes: glue imports → service calls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 04:30:17 +00:00
giles
8527ddb84b Decouple cart: use shared.models for all cross-app imports
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
- Replace all imports from blog.models, market.models, events.models
  and bare models.* with shared.models equivalents
- Convert cart/models/order.py and page_config.py to re-export stubs
- Update shared + glue submodule pointers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:58:10 +00:00
giles
91f05d41ca Add oob context processor to orders blueprint for full-page rendering
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 38s
The orders/index.html template extends auth/index.html which needs
the oob dict for template inheritance. Without it, direct navigation
to /orders/ fails with "'oob' is undefined".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:06:40 +00:00
giles
1256755a3a Fix checkout return: resolve product URLs and read status after SumUp check
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 43s
Resolve page_slug and market_slug from the order's page_config so that
product links on the checkout return page include the correct prefix.
Also move the status read after check_sumup_status so the template
reflects the actual payment result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:38:11 +00:00
giles
2af4dd2073 Remove dead code: routes_old.py and unused imports
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
- routes_old.py: 253 lines, completely unreferenced (replaced by
  global_routes, page_routes, overview_routes)
- page_routes.py: remove unused check_sumup_status, get_order_with_details
- global_routes.py: remove unused is_htmx_request, config imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:46:52 +00:00
giles
6aa2919f34 Remove dead adopt_session_cart_for_user.py (replaced by glue/services/cart_adoption.py)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 37s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:39:21 +00:00
giles
61686fd70c Remove dead login_helper.py (replaced by glue/services/cart_adoption.py)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 37s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:38:18 +00:00
giles
d407957928 Phase 5: Replace cross-domain writes with glue services, emit events
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 41s
- checkout.py: use claim_entries_for_order(), emit order.created
- check_sumup_status.py: use confirm_entries_for_order(), emit order.paid
- global_routes.py: use get_entries_for_order() instead of relationship
- order.py: remove calendar_entries relationship
- api.py: remove /adopt endpoint (replaced by event-driven adoption)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 17:35:43 +00:00
giles
5d0653bf2e feat: decouple cart from shared_lib, add app-owned models
Phase 1-3 of decoupling:
- path_setup.py adds project root to sys.path
- Cart-owned models in cart/models/ (order, page_config)
- All imports updated: shared.infrastructure, shared.db, shared.browser, etc.
- PageConfig uses container_type/container_id instead of post_id FK

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:46:34 +00:00
giles
cb2fcd9d32 feat: per-page carts with overview, page-scoped checkout, and split blueprints (Phase 4)
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 21s
Splits the monolithic cart blueprint into three: cart_overview (GET /),
page_cart (/<page_slug>/), and cart_global (webhook, return, add).

- New page_cart.py service: get_cart_for_page(), get_calendar_entries_for_page(), get_cart_grouped_by_page()
- clear_cart_for_order() and create_order_from_cart() accept page_post_id for scoping
- Cart app hydrates page_slug via url_value_preprocessor/url_defaults/hydrate_page
- Context processor provides page-scoped cart data when g.page_post exists
- Internal API /internal/cart/summary accepts ?page_slug= for page-scoped counts
- Overview template shows page cards with item counts and totals
- Page cart template reuses show_cart() macro with page-specific header

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:45:30 +00:00
giles
c8d927bf72 feat: per-page SumUp credentials in checkout flow (Phase 3)
- Add resolve_page_config() to determine PageConfig from cart/calendar context
- Set page_config_id on Order during checkout
- Pass page_config to SumUp create_checkout and build_sumup_reference
- check_sumup_status uses order.page_config for per-page credential resolution
- Fix: use session.flush() instead of g.s.flush() in check_sumup_status

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:49:45 +00:00
giles
347ce53363 fix: add register_order to bp/__init__.py (needed by orders)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 39s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 00:34:48 +00:00
giles
9f4fc41cc8 fix: add bp/__init__.py with register function exports
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 00:28:55 +00:00
giles
967303093d feat: initialize cart app with blueprints, templates, and CI
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Extract cart, order, and orders blueprints with their service layer,
templates, Dockerfile (APP_MODULE=app:app, IMAGE=cart), entrypoint,
and Gitea CI workflow from the coop monolith.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 23:17:41 +00:00