2018-01-24 17:33:15 +01:00
|
|
|
import { View } from './view';
|
|
|
|
|
|
|
|
import { Identity } from '../domain/identity';
|
|
|
|
|
|
|
|
export class IdentityView implements View {
|
|
|
|
title: string;
|
|
|
|
middleName: string;
|
|
|
|
address1: string;
|
|
|
|
address2: string;
|
|
|
|
address3: string;
|
|
|
|
city: string;
|
|
|
|
state: string;
|
|
|
|
postalCode: string;
|
|
|
|
country: string;
|
|
|
|
company: string;
|
|
|
|
email: string;
|
|
|
|
phone: string;
|
|
|
|
ssn: string;
|
|
|
|
username: string;
|
|
|
|
passportNumber: string;
|
|
|
|
licenseNumber: string;
|
|
|
|
|
2018-01-24 22:58:34 +01:00
|
|
|
// tslint:disable
|
|
|
|
private _firstName: string;
|
|
|
|
private _lastName: string;
|
|
|
|
private _subTitle: string;
|
|
|
|
// tslint:enable
|
|
|
|
|
2018-01-24 17:33:15 +01:00
|
|
|
constructor(i?: Identity) {
|
|
|
|
// ctor
|
|
|
|
}
|
2018-01-24 22:58:34 +01:00
|
|
|
|
|
|
|
get firstName(): string {
|
|
|
|
return this._firstName;
|
|
|
|
}
|
|
|
|
set firstName(value: string) {
|
|
|
|
this._firstName = value;
|
|
|
|
this._subTitle = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
get lastName(): string {
|
|
|
|
return this._lastName;
|
|
|
|
}
|
|
|
|
set lastName(value: string) {
|
|
|
|
this._lastName = value;
|
|
|
|
this._subTitle = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
get subTitle(): string {
|
|
|
|
if (this._subTitle == null && (this.firstName != null || this.lastName != null)) {
|
|
|
|
this._subTitle = '';
|
|
|
|
if (this.firstName != null) {
|
|
|
|
this._subTitle = this.firstName;
|
|
|
|
}
|
|
|
|
if (this.lastName != null) {
|
|
|
|
if (this._subTitle !== '') {
|
|
|
|
this._subTitle += ' ';
|
|
|
|
}
|
|
|
|
this._subTitle += this.lastName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return this._subTitle;
|
|
|
|
}
|
2018-01-24 17:33:15 +01:00
|
|
|
}
|