Skip to content

Spec-driven Booking API with tests#26

Open
digitalPavel wants to merge 6 commits intoautomationExamples:mainfrom
digitalPavel:main
Open

Spec-driven Booking API with tests#26
digitalPavel wants to merge 6 commits intoautomationExamples:mainfrom
digitalPavel:main

Conversation

@digitalPavel
Copy link
Copy Markdown

Summary

This PR implements a small appointment booking API using a spec-driven development approach with code generation tools.

The application supports creating and viewing appointments while enforcing domain rules such as time validation and overlap prevention.

Spec-Driven Approach

  • Domain rules and API contract defined in Booking/booking.spec.md
  • Implementation generated and refined from the spec
  • Unit tests derived directly from the spec rules

Code Generation Tools

  • GPT-5.2 / ChatGPT for domain model, service logic, and tests
  • GitHub Copilot for scaffolding and refactoring

Prompts and workflow are documented in:
Booking/docs/codegen-log.md

Workflow Implemented

  • POST /appointments — create appointment
  • GET /appointments — list appointments

Domain rules enforced:

  • EndUtc must be after StartUtc
  • Minimum duration 15 minutes
  • Cannot book in the past
  • No overlapping appointments

Testing

Unit tests implemented using xUnit + FluentAssertions.

Run tests locally:

dotnet test

Run Application

dotnet run --project Booking/Booking.Api

Swagger UI is available at runtime at /swagger.

Notes

  • In-memory storage (no database)
  • No secrets or credentials
  • Clean separation: Core / Infrastructure / Api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant