work-hub-server/openspec/changes/project-crud-sync/specs/project-full-lifecycle/spec.md
Nicolas HOARAU aec3f2ff98
Some checks failed
ci / ci (22) (pull_request) Failing after 5m17s
feat(project-crud-sync): add planning artifacts for CRUD project lifecycle
- proposal.md: defines scope and motivation for unified CRUD operations
- design.md: documents architecture decisions (Postgres, Docker Compose,
  Nest CLI scaffolding, Schema-Driven Pipes from @workspace/schema)
- specs: contract for project lifecycle management, migrations and seeding
- tasks: implementation checklist covering infra, API, Web and testing
2026-06-12 23:15:55 +04:00

1.6 KiB

ADDED 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.