Structure Entity.prompt
# Phase 1 — Base structure and entities
## Context to read before starting
- `.cursorrules`
- `context/01-architecture.md`
- `context/02-data-model.md`
---
## Task
Generate only the base NestJS project structure and all TypeORM entities.
Do not implement business logic yet. Do not generate services or controllers.
---
## Deliverables checklist
### 1. Base configuration
- [ ] `package.json` with all stack dependencies from `.cursorrules`
- [ ] `main.ts` with global `ValidationPipe` and global `HttpExceptionFilter`
- [ ] `app.module.ts` with `TypeOrmModule` configured for SQLite
- [ ] `config/configuration.ts` with all environment variables from `context/01-architecture.md`
- [ ] `.env.example` with all variables and defaults
### 2. TypeORM entities
Each entity must include all fields, types, unique constraints, and indexes defined in `context/02-data-model.md`:
- [ ] `src/balance/entities/employee-balance.entity.ts`
- [ ] `src/requests/entities/time-off-request.entity.ts`
- [ ] `src/sync/entities/sync-log.entity.ts`
- [ ] `src/sync/entities/balance-snapshot-log.entity.ts`
- [ ] `src/audit/entities/audit-event.entity.ts`
### 3. Enums
- [ ] `src/common/enums/request-status.enum.ts` — include `PENDING_HCM`
- [ ] `src/common/enums/leave-type.enum.ts`
### 4. HttpExceptionFilter
- [ ] `src/common/filters/http-exception.filter.ts` — exact format from `context/04-errors.md`
### 5. Empty modules
Create modules with imports/exports but no logic yet:
- [ ] `balance.module.ts`
- [ ] `requests.module.ts`
- [ ] `sync.module.ts`
- [ ] `hcm-client.module.ts`
- [ ] `audit.module.ts`
### 6. TypeORM migrations
- [ ] `Migration001` — `employee_balance` + `time_off_request`
- [ ] `Migration002` — `balance_snapshot_log` + `sync_log` + `audit_event`
- [ ] `Migration003` — secondary indexes and constraints
---
## When finished
Confirm the list of created files.
Do not continue to Phase 2 until this phase is complete.when to use it
Community prompt sourced from the open-source GitHub repo JuniRanger/time-off-microservice (no explicit license). A "Structure Entity.prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
JuniRanger/time-off-microservice · no explicit license
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar