Commit Graph

110 Commits

Author SHA1 Message Date
19e493a3d5 feat(bring): send X-Bring-Client-URL header on booking reqs, defaulting to https://sshops.uk and overridable via BRING_CLIENT_URL env var 2026-05-22 20:02:43 +02:00
2e6dda190f feat(audit): persist every order-scoped audit.X(...) call to a new order_events table alongside the existing slog line, builds the foundation for an admin order timeline view without changing the slog primary path 2026-05-22 20:01:29 +02:00
96e76f7e5b feat(slack): add slack mark status buttons for bring orders, post-label thread now block kit, synthesize shippo webhook over loopback to reuse state-date guard and delivered transition
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 18:09:34 +02:00
9d3ac9761d feat(tui): add tracking redirect endpoint, render the short uril in the tui order detail instead of the old broken stuff ive been trying. this change is made by claude code and has not been reviewed carefully, this might break
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 15:26:38 +02:00
e49fa01ca9 feat(tui): use BEL terminator for tracking url osc 8 link - hopefully this works
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 15:12:56 +02:00
d9e9895913 revert(tui): render raw tracking url, last change wouldnt render the url for some reason
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 15:07:14 +02:00
f73e1d18da feat(tui): make tracking url clickable osc 8 hyperlink
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 14:55:32 +02:00
29f57000a7 feat(notify): pin paid order messages in the #orders channel in slack, unpin on label purchase
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-20 14:01:28 +02:00
1aaf82d7d6 feat(tui): poll orders every 10 seconds so that the order status refreshes live in the tui without logging out and in
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-19 20:12:03 +02:00
9515603b32 feat(tui): split account orders into active and history tabls
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-19 19:50:21 +02:00
e43040f702 feat(notify): post order vents into per-order slack threads - made by claude
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-15 12:25:45 +02:00
2966474ff5 feat(notify): render slack order notification as block kit receipt with line items
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-15 12:11:16 +02:00
0e4d267adb fix(orders): write NULL instead of empty string for unpopulated shipp_transaction_id
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-15 11:27:00 +02:00
c1b3ccf302 feat(notify): add buy label button via slack
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-15 10:57:23 +02:00
f6eed76456 feat(notify): post Slack message when an order is paid
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-15 08:54:23 +02:00
e5ec247a6b feat(orders): customer-facking tracking labels and webhook response body
Some checks failed
Deploy / deploy (push) Has been cancelled
the big colored status on the order detail page used to just say
"Shipped" the moment i bought the label, which didnt really feel right
since the carrier hadnt actually picked anything up yet. now it walks
through "Label created" -> "In transit" -> "Delivered" as real scans
come in, and keeps the "Delivery Issue" / "Returned to sender" labels
for unhappy paths

also wired up the existing tracking_status_details column to the tui. i
skipped it before but the response actually includes a description of
the delivery, that is now subtext under the colored statu.

and the shippo webhook now returns a small json body instead of an empty
200. this is just for the operator that runs the curls commands to
     update the shipment, which makes debugging a lot less guesswork
2026-05-14 21:17:50 +02:00
ee6e14a424 feat(shipping): shippo webhook fro tracking status updates
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-14 13:30:37 +02:00
387758aa13 feat(shipping): add Bring booking client and country dispatch for label purchase
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-13 22:14:32 +02:00
ff9615b75a fix(shippo): fix rate-filter
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-13 08:58:09 +02:00
37ad51949b fix(shipping): require sender email on shippo address_from
Some checks failed
Deploy / deploy (push) Has been cancelled
Shippo's transaction validation rejects labels where the from-address
has no email — fails at the poll step with
"Attribute address_from.email must not be empty."

Add Email to Address, plumb it into addrPayload, and read
SHIP_FROM_EMAIL alongside the other SHIP_FROM_* env vars.
2026-05-12 21:17:32 +02:00
99f34788ea fix(shipping): round weights before posting to shippo
Some checks failed
Deploy / deploy (push) Has been cancelled
Shippo's /v1/orders endpoint rejects >2 decimal places on parcel
weight and >4 on line_items[].weight. Converting ounces to kg
(oz * 0.0283495) routinely produces 6-decimal values, so the first
real label purchase 400'd with "Ensure that there are no more than
N decimal places".

Round at the payload boundary in createShippoOrder rather than in
the caller — keeps the precision of the source (Coffee.Ounces) and
only loses it when the wire format demands it.
2026-05-12 21:12:31 +02:00
c22b64d6fa feat(shipping): shippo label purchase endpoint
Some checks failed
Deploy / deploy (push) Has been cancelled
Adds POST /api/v1/orders/{id}/label (admin-only) that buys a shipping
  label through Shippo and writes carrier + tracking + label fields back
  onto the order, transitioning paid -> shipped.
2026-05-12 20:57:11 +02:00
700ad4926b feat(models): derive order state from status + tracking
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-09 16:50:33 +02:00
c5f4e492c0 refactor(orders): embed tracking on orders, drop shipments table
Some checks failed
Deploy / deploy (push) Has been cancelled
realized per-shipment table is kinda bad, switched to single embedded tracking blob. since im only
shipping from my house  no split is needed. adds tracking_status, tracking_status_details,
tracking_status_updated_at columns. reverse-backfills any historical shipments rows back onto orders
(idempotent, table-guarded). UpdateTracking rewritten to write to otder columns direcly
2026-05-09 10:08:32 +02:00
add6e573b3 feat: extract shipments to dedicated table 2026-05-08 14:54:17 +02:00
9b45fb5138 updating
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-08 13:43:03 +02:00
1849e324fc feat: add admin tracking updates
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-08 10:47:57 +02:00
c90dadf9ad test was failing after some AI change. this should fix it
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-06 13:53:38 +02:00
38cdda3d54 cleanup
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-06 13:41:23 +02:00
c037a6e9f9 removing unused param
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-05 22:05:29 +02:00
ffb476ec2d updating variable to camelcase
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-05 22:04:24 +02:00
177b080117 some change
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-05 21:04:02 +02:00
c96f922c70 refactor(tui): rebuild header with lipgloss/table
Replaces the manual string-concat + separator layout with a
lipgloss/table row, mirroring the reference TUI structure. Drops the
parallel bold-vs-gray styling for a single-weight accent/base scheme,
extracts a small tab() closure to remove the duplicated active/inactive
branches, and uses m.renderer.NewStyle() for the border so per-session
color profiles render correctly under SSH.

Cart label still tracks inCartFlow() (covers shipping/payment/review/
confirm), which the reference doesn't need since it has no multi-step
checkout.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 09:51:21 +02:00
17df27ae20 some updates
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 17:48:07 +02:00
52d58583e9 db telemetry
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 16:29:07 +02:00
327bb9c867 cleanup
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-05-02 11:28:28 +02:00
ae7eaa8e97 feat: route audit + recovery through slog levels
Some checks failed
Deploy / deploy (push) Has been cancelled
Audit events now emit at Info/Warn/Error so the log-level counter has variety
instead of being pinned to info. Panic recovery uses structured slog.Error
with method/path/stack attrs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 13:55:54 +02:00
8ca209a4cc feat: add cart/auth/stripe metrics and slog-based log-level counter
Some checks failed
Deploy / deploy (push) Has been cancelled
Adds Prometheus instrumentation across the checkout funnel, auth flow,
Stripe calls, rate limiters, and HTTP middleware (inflight gauge, request
and response sizes). Introduces a slog handler that counts log lines by
level so the dashboard can show error/warn rates; existing log.Printf
calls are routed through slog and counted as info.

Backs the new "terminalshop — Service Overview" Grafana dashboard.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 13:38:24 +02:00
9d4549a32d feat: add OpenTelemetry tracing
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-30 11:35:10 +02:00
f47c10ed8a refactor: structured error handling + CreateBox/formatListItem in checkout
Some checks failed
Deploy / deploy (push) Has been cancelled
Replace ErrorMsg string with typed VisibleError struct. Add catch-all
error handler at top of Update() that auto-recovers cart on shop/cart
errors. ESC now dismisses error banners. Refactor shipping address and
payment card checkout lists to use CreateBox + formatListItem for
consistent bordered cards with radio indicators.

Written with Claude Code (claude.ai/code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-27 20:52:52 +02:00
b35103657d refactor: add formatListItem helper and apply address/card lists
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 20:13:25 +02:00
42abf11d04 refactor: extract reusable CreateBox component for bordered card styling
Some checks failed
Deploy / deploy (push) Has been cancelled
replacing duplicated border/selection logic in
  account_orders.go and cart.go. Also fixes a latent SSH rendering bug
  in cart.go where lipgloss.NewStyle() was used instead of theme.Base().
2026-04-27 15:04:00 +02:00
96c9be61ff updating the about section
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:54:58 +02:00
80166ae8d0 lets try this instead
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:48:30 +02:00
6bcf651afd fix: my last change was very wrong, i think i made it in my sleep. this should do the trick though
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 10:40:41 +02:00
cbb3e59878 update: update the not-selected address items in th address list
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-27 08:15:10 +02:00
00dd63668b fix: fix address not appending to address list in account page after adding it
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 13:16:14 +02:00
bd93989036 fix: all keybinds becoming unreactive after completing an order
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 12:50:51 +02:00
4083495704 fix: fixed payment not going through if no address and card were saved
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 12:21:16 +02:00
7bebdeebed fix: fixed card and address list having duplicate items, and a checkout flow infinate loop condition
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-04-26 11:59:24 +02:00