# CRUD REST API — {{entity}}

## Overview
Full CRUD REST API for the {{entity}} resource at {{base_path}}, with {{id_type}} identifiers, input validation, pagination, and consistent error responses.

## Acceptance Criteria

### AC-1: Create
- `POST {{base_path}}` accepts a JSON body and creates a new {{entity}}
- Validates all required fields and returns 422 with field-level errors on failure
- Returns 201 with the created resource including its generated {{id_type}} ID

### AC-2: Read
- `GET {{base_path}}/:id` returns a single {{entity}} by {{id_type}} ID
- `GET {{base_path}}` returns a paginated list with `page`, `limit`, and `total` fields
- Returns 404 when the resource does not exist

### AC-3: Update
- `PUT {{base_path}}/:id` fully replaces the {{entity}} resource
- `PATCH {{base_path}}/:id` partially updates only provided fields
- Returns 200 with the updated resource

### AC-4: Delete
- `DELETE {{base_path}}/:id` soft-deletes the {{entity}} (sets `deletedAt` timestamp)
- Returns 204 on success, 404 if not found

### AC-5: Filtering and Sorting
- Support query parameters `filter[field]=value` for equality filters
- Support `sort=field` and `order=asc|desc` query parameters
- Ignore unknown filter parameters without error

## Technical Notes
- All timestamps in ISO 8601 format
- IDs are {{id_type}} type — validate format before database lookup
- Paginate using cursor-based pagination for large datasets
