Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Feat - Implement ticket reservation confirmation flow#5

Open
Alex0jk wants to merge 1 commit into
mainfrom
ticket-reservation-logic
Open

Feat - Implement ticket reservation confirmation flow#5
Alex0jk wants to merge 1 commit into
mainfrom
ticket-reservation-logic

Conversation

@Alex0jk
Copy link
Copy Markdown
Collaborator

@Alex0jk Alex0jk commented Apr 21, 2026

Summary

Implements the ticket reservation confirmation feature using a ticket-row state model (no separate reservation entity), plus endpoint contracts, tests, and a runnable API validation script.

What changed

  • Added reservation state fields on tickets (reservation_status, reservation_created_at, reservation_expires_at, reservation_confirmed_at).
  • Implemented reservation domain logic in service layer:
    • POST /api/tickets/<ticket_id>/reservation
    • POST /api/tickets/<ticket_id>/confirm
    • Runtime expiration checks (no persisted EXPIRED status)
    • Idempotent confirmation (200 when already confirmed)
    • Deterministic error contract (error_code, message, details)
  • Added RESERVATION_TTL_SECONDS config default (60).
  • Added API test-case script: scripts/api_test_cases.sh.
  • Added integration tests for the reservation/confirm flow.
  • Updated project docs to reference easy startup commands via run.sh.
  • Added design session record for this feature.

API behavior

  • Reserve endpoint returns:
    • 201 on tentative reservation
    • 409 when already active tentative reservation
    • 409 when already confirmed
    • 404 when ticket not found
  • Confirm endpoint returns:
    • 200 on success
    • 200 when already confirmed (idempotent)
    • 409 when no active tentative reservation / expired at runtime
    • 404 when ticket not found

Validation performed

  • Dockerized app startup verified via run.sh (--docker-detached).
  • Health endpoint verified: GET /api/health.
  • End-to-end API flow verified with:
    • ./scripts/api_test_cases.sh
    • Result: all checks passed.

Notes

  • This PR follows the approved design decisions for single-reservation-per-ticket semantics and runtime expiration evaluation.

@Alex0jk Alex0jk self-assigned this Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant