diff --git a/apps/api/src/domain/generated/donation/dto/create-donation.dto.ts b/apps/api/src/domain/generated/donation/dto/create-donation.dto.ts index 290d9bee..538847f8 100644 --- a/apps/api/src/domain/generated/donation/dto/create-donation.dto.ts +++ b/apps/api/src/domain/generated/donation/dto/create-donation.dto.ts @@ -1,7 +1 @@ -import { DonationType } from '@prisma/client' -import { ApiProperty } from '@nestjs/swagger' - -export class CreateDonationDto { - @ApiProperty({ enum: DonationType }) - type: DonationType -} +export class CreateDonationDto {} diff --git a/apps/api/src/domain/generated/donation/dto/update-donation.dto.ts b/apps/api/src/domain/generated/donation/dto/update-donation.dto.ts index 050aef5e..730ce551 100644 --- a/apps/api/src/domain/generated/donation/dto/update-donation.dto.ts +++ b/apps/api/src/domain/generated/donation/dto/update-donation.dto.ts @@ -1,7 +1 @@ -import { DonationType } from '@prisma/client' -import { ApiProperty } from '@nestjs/swagger' - -export class UpdateDonationDto { - @ApiProperty({ enum: DonationType }) - type?: DonationType -} +export class UpdateDonationDto {} diff --git a/migrations/20240517165753_set_default_donation_type/migration.sql b/migrations/20240517165753_set_default_donation_type/migration.sql new file mode 100644 index 00000000..02392865 --- /dev/null +++ b/migrations/20240517165753_set_default_donation_type/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "donations" ALTER COLUMN "type" SET DEFAULT 'donation'; diff --git a/podkrepi.dbml b/podkrepi.dbml index 26ccf535..f16494f6 100644 --- a/podkrepi.dbml +++ b/podkrepi.dbml @@ -393,7 +393,7 @@ Table payments { Table donations { id String [pk] paymentId String [not null] - type DonationType [not null] + type DonationType [not null, default: 'donation'] targetVaultId String [not null, note: 'Vault where the funds are going'] amount Int [not null, default: 0] personId String diff --git a/schema.prisma b/schema.prisma index 1e41d536..89dc2b28 100644 --- a/schema.prisma +++ b/schema.prisma @@ -475,7 +475,7 @@ model Donation { id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid paymentId String @map("payment_id") @db.Uuid - type DonationType + type DonationType @default(donation) /// Vault where the funds are going targetVaultId String @map("target_vault_id") @db.Uuid amount Int @default(0)