forked from Code-4-Community/scaffolding
    
        
        - 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Closed
Description
Summary:
Create the Donation TypeORM entity and a reversible migration that creates the donations table. Wire the entity into the data source configuration.
Files to create:
- apps/backend/src/donations/donation.entity.ts(new)
- apps/backend/src/migrations/<timestamp>-add_donations.ts(new)
- apps/backend/src/data-source.ts(update to include entity and migration pattern, also update migration path ending to *.ts instead of *.js)
Acceptance criteria:
- Donationentity fields:- id(PK serial),- firstName,- lastName,- email,- amount(numeric(10,2)),- isAnonymous(boolean default false),- donationType(enum:- one_time|- recurring),- recurringInterval(nullable string "monthly" "yearly" "weekly" "bimonthly" "biweekly" ),- dedicationMessage(nullable text),- createdAt,- updatedAt.
- Migration creates donationstable inup()and drops it indown().
- data-source.tsincludes- Donationin- entitiesand sets- migrationspattern to- apps/backend/src/migrations/*.ts.
- Running yarn docker:migrate:devapplies the migration;yarn docker:migrate:revertrolls it back.
Testing steps:
- Start dev stack: yarn docker:up:dev
- Run migration: yarn docker:migrate:dev
- Check DB
- Revert migration: yarn docker:migrate:revert
Metadata
Metadata
Assignees
Labels
No labels