latest work #20

Merged
philipp merged 233 commits from dev into main 2020-12-09 18:49:33 +00:00
Showing only changes of commit 57ba0c3051 - Show all commits

37
src/models/Donation.ts Normal file
View File

@ -0,0 +1,37 @@
import { PrimaryGeneratedColumn, Column } from "typeorm";
import {
IsInt,
IsNotEmpty,
IsOptional,
IsPositive,
} from "class-validator";
import { Participant } from "./Participant";
/**
* Defines the donation interface.
*/
export abstract class Donation {
/**
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsOptional()
@IsInt()
id: number;
/**
* The donations's donor.
*/
@Column()
@IsNotEmpty()
//TODO: Relationship
donor: Participant;
/**
* The donation's amount in cents (or whatever your currency's smallest unit is.).
*/
@Column()
@IsInt()
@IsPositive()
amount: number;
}