@@ -1,5 +1,6 @@
|
||||
import { IsInt, IsPositive } from "class-validator";
|
||||
import { ChildEntity, Column } from "typeorm";
|
||||
import { ResponseDonation } from '../responses/ResponseDonation';
|
||||
import { Donation } from "./Donation";
|
||||
|
||||
/**
|
||||
@@ -11,16 +12,33 @@ export class FixedDonation extends Donation {
|
||||
|
||||
/**
|
||||
* The donation's amount in cents (or whatever your currency's smallest unit is.).
|
||||
* This is the "real" value used by fixed donations.
|
||||
*/
|
||||
@Column()
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
amount: number;
|
||||
private _amount: number;
|
||||
|
||||
/**
|
||||
* The donation's amount in cents (or whatever your currency's smallest unit is.).
|
||||
*/
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
public get amount(): number {
|
||||
return this._amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* The donation's amount in cents (or whatever your currency's smallest unit is.).
|
||||
*/
|
||||
public set amount(value: number) {
|
||||
this._amount = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns this entity into it's response class.
|
||||
*/
|
||||
public toResponse() {
|
||||
return new Error("NotImplemented");
|
||||
public toResponse(): ResponseDonation {
|
||||
return new ResponseDonation(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user