archived specs
All checks were successful
ci / ci (22) (pull_request) Successful in 10m58s

This commit is contained in:
Nicolas HOARAU 2026-06-22 21:29:25 +04:00
parent 0febf5fdb0
commit 98c282834c
6 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,32 @@
## Purpose
TBD — Project full-lifecycle management covers the creation, persistence, retrieval, update, and deletion of `Project` resources across the stack (schema → database → API → web).
## Requirements
### Requirement: Project Lifecycle Management (CRUD)
The system SHALL provide full CRUD functionality for the `Project` resource, managed by a central service layer. All operations must be atomic and transactionally consistent across API and Web paths. This includes validation on creation (name uniqueness).
#### Scenario: Successful Project Creation
- **WHEN** valid payload {name, ownerId, templateType} is submitted to POST /projects
- **THEN** a unique Project resource record is created with status 'ACTIVE', and all related metadata are initialized correctly.
### Requirement: Schema Migration Enforcement
The system SHALL enforce database schema changes via versioned migrations (e.g., using an established ORM migration tool). The deployment process MUST fail if the current schema does not match the expected state defined by the latest migration script.
#### Scenario: Applying New Schema
- **WHEN** deploying a change requiring a new column (`last_updated`) on `projects` table
- **THEN** the deployment pipeline runs the required migration, adding the column without breaking existing application runtime logic (e.g., providing a default value or nullability).
### Requirement: Optional Data Seeding
The system SHALL support optional data seeding scripts for development and testing environments. These scripts MUST be idempotent to allow multiple safe executions.
#### Scenario: Running Seed Scripts
- **WHEN** running the setup script `pnpm run db:seed` in a test environment with existing data
- **THEN** any record matching seed criteria (e.g., default user) is updated rather than duplicated, and the script logs successful updates/inserts.