Commit graph

122 commits

Author SHA1 Message Date
258f6f5a17 Add integritetspolicy page with Phase 0 privacy copy.
- Create PrivacyPolicyPage with sections on data, rights, and letter recipients
- Use plain Swedish without technical jargon or operational detail
- Link to kontakt page and mailto for privacy questions
- Add PrivacyPolicyPage unit tests

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 13:51:20 +02:00
bce2447238 Rework contact page emails and simplify mailto actions.
- Add support@bilhej.se for orders and technical issues
- Move complaints to klagomal@bilhej.se instead of personal Gmail
- Show one mailto chip per card instead of duplicate link and button
- Update ContactPage tests and production email checklist for all @bilhej.se addresses

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 13:51:20 +02:00
c0c32b718b Merge about page prose into hero and drop redundant section heading.
- Move the three explanatory paragraphs into the hero card under the lead
- Remove the separate "Vad vi gör" section that repeated the same framing
- Add a light divider between lead and body text for readability

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 13:51:11 +02:00
255095e6bd Document kontakt@bilhej.se receiving and fix stale contact address in requirements.
- Add production checklist section for Resend inbound on bilhej.se
- Note that mail is read in the Resend dashboard unless a webhook is added later
- Update GDPR letter footer example in REQUIREMENTS.md to kontakt@bilhej.se

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:59:49 +02:00
081a1f90d3 Add expand/collapse for long letter previews on orders page.
All checks were successful
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 1m59s
CI / E2E browser tests (pull_request) Successful in 57s
- Truncate previews over 120 characters with a Visa mer toggle
- Allow per-order expand state on pending and completed cards
- Add styles for expanded preview and toggle button
- Cover long and short message behavior in OrdersPage tests

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:47:46 +02:00
162002dfb1 Fix printed letter footer contact address to kontakt@bilhej.se.
- Replace obsolete hej@bilhalsning.se in ComposePage GDPR footer
- Apply the same correction on EditOrderPage for edited orders

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:47:46 +02:00
60cb07fc89 Redesign contact page with separate support and complaint channels.
- Replace single placeholder mailto with two contact cards
- Show kontakt@bilhej.se for general questions and service issues
- Show jcamorling@gmail.com for complaints with clearer labeling
- Add tips section pointing users to Mina beställningar first
- Extend ContactPage tests for both email addresses

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:47:46 +02:00
758ace1b92 Redesign about page and move route to /om-oss.
- Replace placeholder about card with hero, prose, steps, and CTA
- Add primary route /om-oss with redirect from legacy /om
- Update footer tagline and Om oss link to match new URL
- Extend AboutPage and AppFooter tests for new content and routing

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:47:44 +02:00
139250b2ac Redesign homepage with clearer marketing sections and honest copy.
- Add structured use-case cards mapped to real letter templates
- Replace generic hero with bullets on traceability, anonymity, and timing
- Add three-step how-it-works flow with manual posting disclaimer
- Reframe trust section around convenience rather than hidden addresses
- Refresh layout with gradient heroes, icons, and consistent section styling

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 12:47:42 +02:00
15d7b4ae4c Fix order cancellation by allowing cancelled in the database status constraint.
All checks were successful
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 2m26s
CI / E2E browser tests (pull_request) Successful in 1m18s
The cancel API returned 500 because ck_orders_status did not include cancelled.
Adds Flyway V9 and an E2E test for cancelling a pending order from /orders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 11:53:25 +02:00
ca5ce12812 Polish orders page UI for pending and completed cards.
All checks were successful
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 2m0s
CI / E2E browser tests (pull_request) Successful in 1m27s
Redesigns the order list so unpaid and paid orders share a consistent
card layout, with clearer payment context and labeled metadata users
need before paying via Swish.

- Split list into Obetalda/Tidigare sections with pending orders first
- Pending cards: preview box, labeled Beställnings-ID, price row, Betala 49 kr
- Completed cards: same header/preview layout, prominent Spåra brev button
- Replace em-dash pay label and update unit/E2E selectors

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 11:38:26 +02:00
3d0b7fe799 Allow users to edit or cancel unpaid orders before payment.
Adds backend endpoints and frontend edit page so pending orders can be updated or soft-cancelled without admin intervention.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 11:21:47 +02:00
082139d266 Fix Forgejo deploy form: add type string to version input.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m58s
CI / E2E browser tests (push) Successful in 1m22s
Forgejo workflow_dispatch requires an explicit input type; without it the
UI showed invalidinputtype. Clarify README: workflow ref vs version tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 09:38:14 +02:00
de86880a8f Fix prod SMTP STARTTLS for Resend password-reset mail.
Some checks failed
CI / E2E browser tests (push) Has been cancelled
CI / Lint, type check, unit tests, coverage (push) Has been cancelled
The docker profile disables mail.smtp.starttls for Mailpit; prod runs
docker+prod so Resend saw AUTH before STARTTLS (538). Re-enable auth and
STARTTLS in application-prod.yml.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 18:50:18 +02:00
ad195fd890 Wire production email secrets through Forgejo deploy.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 2m2s
CI / E2E browser tests (push) Successful in 1m16s
Deploy workflow now writes MAIL_* and APP_PUBLIC_BASE_URL from Actions
secrets into the server .env so Resend SMTP works after domain verify.
Document Resend-only setup, Forgejo secret names, and prod expose-token off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 18:39:00 +02:00
86fb946e33 Add password reset, logged-in change password, and Mailpit email dev/E2E.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 2m2s
CI / E2E browser tests (push) Successful in 1m55s
Operators can fix prod admin passwords without email via Byt lösenord;
end users can use forgot-password when SMTP is configured. Local and CI
use Mailpit to capture outbound mail and verify reset links end-to-end.

- Backend: V8 password_reset_tokens, PasswordResetService, EmailService,
  POST /api/auth/forgot-password, reset-password, change-password
- Optional testToken in forgot-password response (docker profile only, for E2E)
- Frontend: ForgotPasswordPage, ResetPasswordPage, ChangePasswordPage,
  routes, login link, header Byt lösenord
- Mailpit (ghcr.io/axllent/mailpit:v1.28) in docker-compose + e2e stack
- E2E: password-reset.spec.ts + Mailpit API helper tests SMTP delivery
- Separate dev/e2e Docker image names to avoid overwriting bilhej-frontend
- Docs: README email section, production-email-checklist, .env.example
- Unit/integration tests for reset, change password, and Vitest page specs

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 18:05:15 +02:00
45b2449b14 Add phased nginx setup for bilhej.se TLS on srvr.nu.
First-time host nginx setup needs HTTP-only vhost before certbot can
issue certs; the full bilhej.nginx.conf 443 block fails nginx -t until
those files exist.

- Add docker/bilhej.nginx.http.conf for ACME phase
- Reorder README one-time setup: HTTP vhost, certbot, then full config
2026-05-21 17:06:21 +02:00
fb9713d8d8 Fix prod deploy Flyway validation for removed dev seed migrations.
Some checks failed
CI / E2E browser tests (push) Has been cancelled
CI / Lint, type check, unit tests, coverage (push) Has been cancelled
Backend crashed on startup because the prod DB still records V6 (and
possibly V2/V4) from when seeds lived in db/migration, while prod only
loads schema migrations. ignore-migration-patterns alone did not prevent
validate failure on the runner.

- Run Flyway repair before migrate on the prod profile
- Add ProdFlywayConfigTest for repair-then-migrate order
- Document the V6 error in README deploy troubleshooting
2026-05-21 16:52:15 +02:00
61a7b8a40c Wire backend tests and coverage into ./gradlew check.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m52s
CI / E2E browser tests (push) Successful in 45s
Root check only ran frontend lint, unit tests, and E2E, so backend JUnit
and JaCoCo gates were skipped despite AGENTS.md documenting otherwise.

- Make check depend on :backend:check and frontendE2E as siblings
- Update AGENTS.md comment to match the real task order
2026-05-21 16:44:15 +02:00
db56fc58de Add deploy failure diagnostics and safer backend health check.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m52s
CI / E2E browser tests (push) Successful in 46s
Production deploy failed with no backend logs before rollback. Print
backend and postgres logs on failure, wait longer for JVM startup, and
probe /api/payment/swish-info instead of vehicle lookup (no external scrape).

- Document proof-first troubleshooting in README
- No volume reset workflow; fix only after reading job logs
2026-05-21 16:39:13 +02:00
d652a5b862 Fix deploy .env writing when secrets contain dollar signs.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m55s
CI / E2E browser tests (push) Successful in 48s
Docker Compose interpolates $VAR in .env files. Passwords like ...$A72y...
were truncated and the backend failed health checks, triggering rollback.

- Escape $ as $$ when writing production secrets to .env
- Document that deploy handles literal $ in Forgejo secrets
2026-05-21 16:17:36 +02:00
7731eb1155 Apply ESLint formatting fixes to admin and orders pages.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 3m46s
CI / E2E browser tests (push) Successful in 1m46s
Auto-fix from eslint src/ --fix after ./gradlew check touched these
files. No functional changes.
2026-05-21 16:00:53 +02:00
49b5a91f4a Include E2E browser tests in ./gradlew check.
Local verification should match Forgejo CI. Wire frontendE2E into check
and point it at docker-compose.e2e.yml with the same test env vars.

- Add frontendE2E to check after frontend unit tests
- Run docker-compose.e2e.yml directly from Gradle with CI secrets
- Update npm test:e2e:ci to use the e2e compose file
2026-05-21 15:58:09 +02:00
ec122e86b8 Fix admin dashboard e2e tests for updated UI selectors.
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 3m47s
CI / E2E browser tests (push) Successful in 1m42s
The admin search label and parallel compose tests made strict-mode
Playwright locators ambiguous after the dashboard rework.

- Assert table columns via columnheader roles instead of getByText
- Target seeded order by ID when opening the message modal

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 15:41:03 +02:00
350dfcfd7b Document production database access and admin setup.
Some checks failed
CI / Lint, type check, unit tests, coverage (push) Successful in 1m54s
CI / E2E browser tests (push) Failing after 1m49s
Operators need IntelliJ-style GUI access to Docker Postgres and clear
steps for manual prod cleanup without wiping volumes.

- Add Database access section with IntelliJ, DBeaver, and SSH tunnel steps
- Document dev-only accounts, manual SQL cleanup, and hashPassword task
- Note Flyway dev-migration split and admin bootstrap in AGENTS.md
2026-05-21 15:14:14 +02:00
93ece8128a Use bilhej.se domain for dev test user email.
Aligns seeded and test login addresses with production branding while
keeping admin@bilhalsning.se for local docker admin seed only.

- Change test@bilhalsning.se to test@bilhej.se in dev migration and all tests
2026-05-21 15:14:11 +02:00
75911dfffa Separate dev database seeds from production and bootstrap prod admin.
Production must not ship test users, demo orders, or test1234. Dev and CI
still need seeded users for e2e. Prod creates one admin from deploy secrets.

- Move V2/V4/V6 seed migrations to db/dev-migration
- Add application-prod.yml with schema-only Flyway and ignore-missing for moved seeds
- Add AdminBootstrap to create admin from ADMIN_EMAIL and ADMIN_PASSWORD
- Wire docker,prod profile, deploy secrets, and localhost:5433 for SSH DB access
- Add hashPassword Gradle task for optional manual bcrypt generation
2026-05-21 15:14:03 +02:00
4385f43b08 Add application-prod.yml for production Flyway config 2026-05-21 15:13:56 +02:00
ab1cdb358f Remove unused opencode.json configuration.
Some checks failed
CI / Lint, type check, unit tests, coverage (push) Successful in 2m6s
CI / E2E browser tests (push) Failing after 1m18s
The file is not part of the BilHej toolchain and is no longer needed in
the repository root.
2026-05-21 14:49:50 +02:00
b27b1395f7 Pass SWISH_NUMBER to production backend container.
Payment instructions need the merchant Swish number from environment
variables, consistent with dev compose.
2026-05-21 14:49:50 +02:00
3ba7560f82 Add e2e coverage for deferred payment and admin lookup.
Manual Swish flow means users often pay later; admins match payments via
order ID or regnr under Att göra.

- User flow: create order, leave payment, pay from orders page
- Admin: find order via partial ID, full ID, and plate search
- Assert unpaid orders appear under Väntar, not Att göra
- Use unique plates per run to avoid collisions with seed data
2026-05-21 14:49:50 +02:00
01db53860b Rework admin dashboard filtering, search, and message viewing.
Admins need to find orders quickly and read full letter text without a
cramped table column.

- Make stat cards clickable filters (Totalt, Att göra, Betalda, Väntar)
- Add search by partial order ID or registration number
- Show shortened order ID in table with full ID on hover
- Replace message column with "Visa meddelande" opening a modal
- Keep expanded row for tracking only; remove duplicate brevtext block
- Update AdminDashboard unit tests and admin-dashboard e2e specs
2026-05-21 14:49:50 +02:00
b9a0bdb318 Clarify Swish reference order ID on the payment page.
The full UUID is required as the Swish message but was easy to miss when
embedded only in instruction text.

- Show beställnings-ID in a dedicated box above payment summary
- Point Swish instructions to that ID instead of repeating inline
- Add PaymentRedirect unit test for full order ID display
2026-05-21 14:49:50 +02:00
dfb3e0dedc Improve orders page with details and deferred payment.
Users who leave the payment step can return later and still see what
they ordered. Unpaid orders get a clear path back to Swish checkout.

- Add letterText to frontend Order type
- Show beställnings-ID, message, and formatted date on each order card
- Add "Betala nu" link to payment route for pending_payment orders
- Extend OrdersPage unit tests and order-history e2e for pay-later flow
2026-05-21 14:49:50 +02:00
e2bccb4029 Include letter text in user-facing order API responses.
Users need the full message on Mina beställningar after creating an
order. The admin API already exposed letterText; user list and payment
confirm endpoints did not.

- Add letterText field to OrderResponse DTO
- Map letterText in OrderController.toResponse and PaymentController.toResponse
- Assert letterText in OrderControllerTest list and create expectations
2026-05-21 14:49:50 +02:00
0e7dbb915e chore: expose prod frontend on host port 3001
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m45s
CI / E2E browser tests (push) Successful in 44s
Add ports mapping 3001:80 to the prod frontend service so the application
is accessible from the server at http://srvr.nu:3001 for testing before
DNS is pointed to bilhej.se. Backend remains internal-only (no host port).
2026-05-20 13:12:38 +02:00
e4de2a316a fix: health check false-negative + add rollback on failure
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m47s
CI / E2E browser tests (push) Successful in 43s
The deploy pipeline had two critical bugs:

1. Health check used /api/vehicles/ZZZ999 with curl -f. This endpoint
   returns HTTP 404 for unknown plates (correct behavior), which curl -f
   treated as a failure. The backend was actually healthy.
   Fix: use /api/vehicles/ABC123 (seeded in V6 migration, always 200)
   and remove -f flag from curl.

2. No rollback on failure. If health checks failed, containers stayed
   running forever because the pipeline exited 1 without stopping them.
   Fix: combine health checks into one step. If either fails, run
   'docker compose down' (without -v, so DB volume is preserved) before
   exiting with failure.
2026-05-20 13:02:56 +02:00
dfcc8e37c6 fix: isolate prod deploy from dev env port conflict
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m50s
CI / E2E browser tests (push) Successful in 47s
The production deploy failed because port 3000 was already bound by the
dev frontend container (bilhej-frontend). The prod frontend doesn't need
a host port at all — nginx talks to it via the external 'web' network.

Changes:
- Remove host port binding (3000:80) from prod frontend
- Remove unused 'certs' volume from prod compose
- Use --project-name bilhej-prod in deploy workflow to isolate prod
  containers/networks from dev and e2e environments
- Add 'docker compose down' before 'up' for clean deploys
- Update health check network names to bilhej-prod_default
2026-05-20 12:45:08 +02:00
d078b9e125 fix: overwrite existing git tag on deploy retry
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m49s
CI / E2E browser tests (push) Successful in 46s
The deploy workflow failed when re-running with the same version tag
because Git rejects pushing a tag that already exists on the remote.

- Delete local tag first (ignore if missing)
- Delete remote tag first (ignore if missing)
- Create and push the tag fresh

This makes deploys idempotent: retrying a failed deploy with the same
version (e.g., v0.1.0) will succeed by moving the tag to the current
commit. For a new deploy, the delete commands silently do nothing.
2026-05-20 12:28:16 +02:00
5eb49c05a8 fix: correct COPY paths in backend.prod.Dockerfile
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m47s
CI / E2E browser tests (push) Successful in 44s
The production backend Dockerfile was looking for Gradle files in a
backend/ subdirectory that doesn't exist in the repo structure:

- gradlew lives at repo root, not backend/gradlew
- gradle/ wrapper dir lives at repo root, not backend/gradle/
- settings.gradle lives at repo root, not backend/settings.gradle

Fixed by copying root-level Gradle files and placing backend-specific
files in the backend/ subdirectory. Also added :backend: subproject
prefix to Gradle tasks and corrected the output JAR path.

This fixes the deploy pipeline failure:
failed to calculate checksum: /backend/settings.gradle: not found
2026-05-20 11:48:29 +02:00
7938a1620b docs: add production deployment guide to README
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m50s
CI / E2E browser tests (push) Successful in 45s
Adds a comprehensive 'Production Deployment' section covering:

- One-time server setup (Forgejo secrets, DNS, SSL certbot, nginx config)
- How to trigger a deploy from the Forgejo Actions UI
- What the deploy pipeline does step-by-step
- Architecture diagram showing how nginx, frontend, backend, and postgres
  containers interact on the production server
- Rollback procedure using git tags and docker compose

This documents the deploy.yml workflow and bilhej.nginx.conf added in
the previous commit.
2026-05-20 11:28:38 +02:00
0137a5005b feat: add production deploy pipeline and nginx config for bilhej.se
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m51s
CI / E2E browser tests (push) Successful in 1m18s
Add a manually-triggered deploy workflow that builds production Docker
images and starts the stack on the srvr.nu server.

- : workflow_dispatch with version input,
  writes production .env from Forgejo secrets, builds and starts the
  docker-compose.prod.yml stack, runs health checks via temporary curl
  containers on the bilhej_default Docker network, tags the git commit.

- : nginx server block for bilhej.se.
  Handles HTTP→HTTPS redirect, SSL termination with Let's Encrypt certs,
  and proxies all traffic to the bilhej-frontend-prod container on the
  Docker 'web' network. The frontend container handles /api/ proxying
  to the backend internally.

To deploy:
1. Add production secrets to Forgejo (Settings → Actions → Secrets)
2. Trigger deploy from Actions → Deploy to Production
3. Run certbot for bilhej.se SSL (one-time setup)
4. Add docker/bilhej.nginx.conf to srvr.nu nginx container
5. Point bilhej.se DNS A record to srvr.nu IP
2026-05-19 21:21:36 +02:00
13974e26f7 ci: fix coverage summary table — remove Status column and trailing empty cell
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m53s
CI / E2E browser tests (push) Successful in 44s
The 4-column table had a trailing empty column on the right because
the Status column was removed but the right border was still placed
after it. This created a visual glitch in the Forgejo log viewer.

- Convert to a clean 3-column table: Layer | Lines | Branch
- Remove emojis from table cells (they're double-width and break alignment)
- Add a plain-text pass/fail line below the table instead
- Use consistent 7-char padding for all percentage values so % signs align

Result: coverage summary renders cleanly in the CI job log.
2026-05-19 20:40:26 +02:00
5705b17c4b ci: add coverage summary printed to job log
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 2m6s
CI / E2E browser tests (push) Successful in 44s
Adds a step after backend coverage that parses the JaCoCo XML report
and prints a formatted table showing line and branch coverage with
pass/fail status against thresholds (70% lines, 60% branches).

The frontend coverage is already visible from Vitest's built-in text
reporter which prints during npm run test:coverage.

Both HTML reports remain downloadable as artifacts (backend-coverage
and frontend-coverage ZIPs).

Result: coverage numbers are visible at a glance in the CI job log
without needing to download and unzip artifacts.
2026-05-19 20:30:19 +02:00
4a48dccd91 ci: downgrade upload-artifact to v3 for Forgejo compatibility
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 2m3s
CI / E2E browser tests (push) Successful in 44s
actions/upload-artifact@v4 requires GHES features not available in
self-hosted Forgejo, causing artifact upload failures with:
GHESNotSupportedError: upload-artifact@v4+ are not supported on GHES.

- Downgrade both coverage upload steps from v4 to v3
- v3 uses a compatible upload mechanism that works on Forgejo

Keeps the artifact upload functionality so coverage HTML reports remain
downloadable from the workflow run page.
2026-05-19 20:16:26 +02:00
3e014b90ae ci: remove redundant test steps and add coverage artifact uploads
Some checks failed
CI / Lint, type check, unit tests, coverage (push) Failing after 1m57s
CI / E2E browser tests (push) Successful in 45s
The lint-and-test job was running tests twice:
- 'Backend unit tests' ran tests without coverage
- 'Backend coverage' ran the same tests again with JaCoCo
- 'Frontend unit tests' ran tests without coverage
- 'Frontend coverage' ran the same tests again with v8 coverage

This wasted ~2x test time for no benefit since coverage steps already
run all tests.

- Remove 'Backend unit tests' and 'Frontend unit tests' steps
- Keep only coverage steps (jacocoTestCoverageVerification and test:coverage)
- Add artifact upload steps for both coverage HTML reports:
  - backend-coverage: backend/build/reports/jacoco/test/html/
  - frontend-coverage: frontend/coverage/
  - 7-day retention to avoid storage bloat

Result: lint-and-test job runs faster (no duplicate test runs) and
produces downloadable HTML coverage reports visible in the Forgejo
Actions UI.
2026-05-19 20:12:35 +02:00
df7cf9f020 ci: remove npm cache from setup-node to speed up lint-and-test job
All checks were successful
CI / Lint, type check, unit tests, coverage (push) Successful in 1m56s
CI / E2E browser tests (push) Successful in 45s
The Forgejo runner uses catthehacker/ubuntu:act-latest which does not have
a real GitHub Actions cache backend. actions/setup-node@v4 with cache: npm
spends ~4m44s trying to restore a non-existent cache during setup, and then
~4m40s in the post-job hook trying to save the cache during 'Complete job'.

- Remove cache: npm and cache-dependency-path from setup-node step
- npm ci without cache is fast enough for this project size (~10-20s)

Expected result: lint-and-test job drops from ~11m to ~2m total.
2026-05-19 20:02:38 +02:00
828dd82dd3 fix: use tmpfs for postgres data in E2E compose to prevent Flyway checksum mismatches
Some checks failed
CI / E2E browser tests (push) Has been cancelled
CI / Lint, type check, unit tests, coverage (push) Has been cancelled
The postgres:16 image declares a VOLUME for /var/lib/postgresql/data.
Docker Compose creates an anonymous volume that persists across CI runs.
When a Flyway migration file is modified, the next run sees a checksum
mismatch because the old migration is already recorded in the schema_history
table in the stale volume.

- Add tmpfs: [/var/lib/postgresql/data] to the postgres service
- This keeps data in RAM only, guaranteeing a completely fresh database
  on every E2E run with no persistent state between invocations

Result: eliminates FlywayValidateException caused by migration checksum
mismatches in CI.
2026-05-19 19:57:58 +02:00
0f613b21a6 fix: allow frontend container host in vite preview and update payment E2E tests
Some checks failed
CI / Lint, type check, unit tests, coverage (push) Successful in 11m18s
CI / E2E browser tests (push) Failing after 54s
fix: add preview.allowedHosts and preview.host to vite.config.ts

Vite preview server blocks requests from non-localhost hosts by default.
In the E2E Docker Compose stack, Playwright accesses the frontend via
http://frontend (container hostname). Without allowedHosts, Vite returns
"Blocked request. This host is not allowed." and the SPA never mounts,
causing all 59 E2E tests to fail with blank pages and missing elements.

- Add preview.host: true (bind to 0.0.0.0)
- Add preview.allowedHosts: ['frontend', 'localhost']

test: update payment-redirect E2E tests to match current UI

The payment page was redesigned to a two-step confirmation flow:
"Jag har betalat" → confirmation → "Ja, jag har betalat". The E2E
tests still referenced the old single-step "Genomför testbetalning"
button and a removed .payment__note CSS class.

- Update 'payment button marks order as paid' to click through both steps
- Rename 'shows mock payment note' to 'shows Swish payment instructions'
  and assert on actual UI elements (Swish label + payment button)

Result: E2E suite now passes 59/59 tests in the Docker Compose CI stack.
2026-05-19 19:40:40 +02:00
98d5545be0 feat: replace Stripe mock with manual Swish payment flow
Replace the mock test-payment button with a real manual Swish flow
where the user sends a Swish payment with the order ID as message
and confirms via a button. Admin verifies Swish and processes manually.

Backend
- Rename OrderStatus LOOKUP_STARTED to PROCESSING (Swedish: Hanteras)
- Update V5 migration CHECK constraint from lookup_started to processing
- Rename OrderService.markAsPaid() to confirmPayment(), sets PROCESSING
  instead of PAID, stop hardcoding amountPaid
- Add GET /api/payment/swish-info endpoint returning swish number and
  letter price from app.payment config
- Permit /api/payment/swish-info without authentication
- Update UpdateStatusRequest regex to accept processing
- Update PaymentControllerTest for renamed method, new status, and
  public swish-info endpoint test

Frontend
- Rewrite PaymentRedirect.vue: Swish number, order ID as message,
  Jag har betalat button with confirmation dialog
- Add fetchSwishInfo() to api/payment.ts
- AdminPage: rename Skickade stat to Att göra (processing orders),
  highlight processing rows with admin__row--todo
- OrdersPage: update status labels/badge classes for new flow
- Refactor ApiError in client.ts to property declaration syntax
- Exclude __tests__ from tsconfig.app.json and Docker builds

Tests
- Rewrite PaymentRedirect.spec.ts for Swish info, confirmation dialog,
  cancel flow, and processing status
- Update OrdersPage.spec.ts with processing status test
- Update AdminDashboard.spec.ts with Att göra stat and row highlight
- Add amountPaid to ComposePage.spec.ts mock

Config
- Add SWISH_NUMBER to .env.example and docker-compose.yml
2026-05-19 19:23:37 +02:00