Added payed amount fileld to donation class

ref #193
This commit is contained in:
Nicolai Ort 2021-04-14 18:12:45 +02:00
parent 0c61ff457d
commit b8fbb72fa0
1 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import {
IsInt,
IsNotEmpty
} from "class-validator";
import { Entity, ManyToOne, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
import { ResponseDonation } from '../responses/ResponseDonation';
import { Donor } from './Donor';
@ -34,6 +34,13 @@ export abstract class Donation {
*/
public abstract get amount(): number;
/**
* The donation's payed amount in cents (or whatever your currency's smallest unit is.).
* Used to mark donations as payed.
*/
@Column({ nullable: true })
@IsInt()
payedAmount: number;
/**
* Turns this entity into it's response class.