Fully implemented addresses feature/105-addresses #107

Manually merged
niggl merged 23 commits from feature/105-addresses into dev 2021-01-19 15:37:37 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit ae7c5ff0c3 - Show all commits

View File

@ -29,7 +29,7 @@ export class CreateDonor extends CreateParticipant {
newDonor.receiptNeeded = this.receiptNeeded; newDonor.receiptNeeded = this.receiptNeeded;
newDonor.address = this.address; newDonor.address = this.address;
if (this.receiptNeeded == true && this.address == null) { if (this.receiptNeeded == true && this.address.isValidAddress == false) {
throw new DonorReceiptAddressNeededError() throw new DonorReceiptAddressNeededError()
} }

View File

@ -57,9 +57,10 @@ export class Address {
country: string; country: string;
/** /**
* Turns this entity into it's response class. * Checks if this is a valid address
*/ */
public toResponse() { public get isValidAddress(): Boolean {
return new Error("NotImplemented"); if (!this.address1 || !this.city || !this.country || !this.postalcode) { return false; }
return true;
} }
} }