backend/src/models/entities/FixedDonation.ts

19 lines
501 B
TypeScript

import { IsInt, IsPositive } from "class-validator";
import { ChildEntity, Column } from "typeorm";
import { Donation } from "./Donation";
/**
* Defines the FixedDonation entity.
* In the past there was no easy way to track fixed donations (eg. for creating donation receipts).
*/
@ChildEntity()
export class FixedDonation extends Donation {
/**
* The donation's amount in cents (or whatever your currency's smallest unit is.).
*/
@Column()
@IsInt()
@IsPositive()
amount: number;
}