@@ -29,7 +29,7 @@ export class CreateDonor extends CreateParticipant {
 | 
			
		||||
        newDonor.receiptNeeded = this.receiptNeeded;
 | 
			
		||||
        newDonor.address = this.address;
 | 
			
		||||
 | 
			
		||||
        if (this.receiptNeeded == true && this.address == null) {
 | 
			
		||||
        if (this.receiptNeeded == true && this.address.isValidAddress == false) {
 | 
			
		||||
            throw new DonorReceiptAddressNeededError()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -57,9 +57,10 @@ export class Address {
 | 
			
		||||
  country: string;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Turns this entity into it's response class.
 | 
			
		||||
   * Checks if this is a valid address
 | 
			
		||||
   */
 | 
			
		||||
  public toResponse() {
 | 
			
		||||
    return new Error("NotImplemented");
 | 
			
		||||
  public get isValidAddress(): Boolean {
 | 
			
		||||
    if (!this.address1 || !this.city || !this.country || !this.postalcode) { return false; }
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user