Add the ability to filter forms by Person.
[ustaxlib.git] / src / core / Person.ts
1 export enum Relation {
2 Self,
3 Spouse,
4 Dependent,
5 };
6
7 export default class Person {
8 private _name: string;
9 private _relation: Relation;
10
11 static joint = Symbol('Joint') as unknown as Person;
12
13 constructor(name: string, relation: Relation) {
14 this._name = name;
15 this._relation = relation;
16 }
17
18 get name(): string {
19 return this._name;
20 }
21
22 get relation(): Relation {
23 return this._relation;
24 }
25
26 static self(name: string): Person {
27 return new Person(name, Relation.Self);
28 }
29
30 static spouse(name: string): Person {
31 return new Person(name, Relation.Spouse);
32 }
33
34 static dependent(name: string): Person {
35 return new Person(name, Relation.Dependent);
36 }
37 };