Add wedding and divorce inputs

This commit is contained in:
2023-08-16 12:29:27 +02:00
parent ac2004a51d
commit dd18ee129d
2 changed files with 68 additions and 0 deletions
geneit_app/src

@@ -1,4 +1,5 @@
import { APIClient } from "./ApiClient";
import { DateValue } from "./MemberApi";
interface CoupleApiInterface {
id: number;
@@ -76,6 +77,28 @@ export class Couple implements CoupleApiInterface {
if (!this.signed_photo_id) return null;
return `${APIClient.backendURL()}/photo/${this.signed_photo_id}/thumbnail`;
}
get dateOfWedding(): DateValue | undefined {
if (!this.wedding_day && !this.wedding_month && !this.wedding_year)
return undefined;
return {
year: this.wedding_year,
month: this.wedding_month,
day: this.wedding_day,
};
}
get dateOfDivorce(): DateValue | undefined {
if (!this.divorce_day && !this.divorce_month && !this.divorce_year)
return undefined;
return {
year: this.divorce_year,
month: this.divorce_month,
day: this.divorce_day,
};
}
}
export class CouplesList {