reservations-service

Add Fastify reservation endpoints with Prisma logic and Vitest tests.

1|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/mattbutlerengineering/mattbutlerengineering --skill reservations-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reservations-service
Source: https://github.com/mattbutlerengineering/mattbutlerengineering/tree/main/.claude/skills/reservations-service
Command: npx skills add https://github.com/mattbutlerengineering/mattbutlerengineering --skill reservations-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you safely extend the Reservations Service API so new routes (tables, reservations, availability, holds, and cancellations) follow the project’s Fastify + Prisma patterns and produce correct, well-documented behavior.

Core Features & Use Cases

  • Add new Fastify endpoints with consistent request/response typing and OpenAPI schema metadata.
  • Implement business logic in the correct service layer (e.g., src/services/table.ts or src/services/reservation.ts) using Prisma models like Table and Reservation.
  • Create tests for routes using Vitest with mocked service layers and JWT verification behavior.

Use Case Example: You need a new endpoint to return availability for a table during a specific time range; you’ll add the route, wire it to the appropriate service method, ensure auth is correct (required vs optional), update OpenAPI schema, and add a focused test for status codes and payload shapes.

Quick Start

Use the reservations-service skill to add an endpoint to the Reservations Service under services/reservations, including route schema, auth handling, service-layer logic, and route tests.

Frequently Asked Questions about reservations-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Fastify route to an existing reservations service?

To add a new Fastify route, define the endpoint schema under `src/schemas`, implement the business logic in `src/services` using Prisma models, apply `requireAuth` or `optionalAuth`, and add Vitest coverage to validate response status codes and payloads.

How do I test Fastify reservation API endpoints with Vitest?

You can test Fastify reservation endpoints with Vitest by writing mocked route tests that mock the Prisma service layer and Auth0 JWT verification behavior, allowing you to validate expected HTTP status codes and response payload shapes without hitting the database.

What is the correct way to handle Auth0 JWT authentication in a table management API?

Handling Auth0 JWT authentication in a table management API requires using `requireAuth` for protected reservation operations and `optionalAuth` for endpoints like availability checks, ensuring Fastify route schemas enforce the correct access levels based on the endpoint's purpose.

Do I need to update the OpenAPI schema when adding new reservation endpoints?

Yes, you must update the OpenAPI schema under `src/schemas` when adding new reservation or table management endpoints to ensure the API documentation reflects the new Fastify routes, request parameters, and response payload structures accurately.

Can I use Prisma to manage table holds and cancellations in a Fastify backend?

Yes, you can use Prisma to manage table holds and cancellations by implementing the business logic within `src/services/reservation.ts` or `src/services/table.ts`, manipulating the `Table` and `Reservation` models according to your existing Fastify route structure patterns.

Why are my mocked Vitest tests failing for new reservation service routes?

Mocked Vitest tests for reservation routes often fail when the mock service layer does not match the exact Prisma model responses expected by the logic in `src/services`, or if the Auth0 JWT verification behavior is not properly mocked alongside the Fastify route schemas.