|
|
|
@@ -1,34 +1,43 @@ |
|
|
|
import {PeopleModel} from './people.model'; |
|
|
|
import {UserExtraModel} from './user-extra.model'; |
|
|
|
|
|
|
|
export class BrokerModel{ |
|
|
|
constructor( |
|
|
|
public Id: string, |
|
|
|
public First: string, |
|
|
|
public Last: string, |
|
|
|
public Middle: string, |
|
|
|
public Title: string, |
|
|
|
public Display: string, |
|
|
|
public Nick: string, |
|
|
|
public Login: string, |
|
|
|
public Enabled: boolean, |
|
|
|
public BSB: string, |
|
|
|
public ACC: string, |
|
|
|
public License: string, |
|
|
|
public Organization: string |
|
|
|
){} |
|
|
|
export class BrokerModel extends PeopleModel { |
|
|
|
public Login: string; |
|
|
|
public BSB: string; |
|
|
|
public ACC: string; |
|
|
|
public License: string; |
|
|
|
public Organization: string; |
|
|
|
constructor( payload: Partial<BrokerModel>) { |
|
|
|
super(payload); |
|
|
|
this.Login = payload.Login || ''; |
|
|
|
this.BSB = payload.BSB || ''; |
|
|
|
this.ACC = payload.ACC || ''; |
|
|
|
this.License = payload.License || ''; |
|
|
|
this.Organization = payload.Organization || ''; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static EmptyNew(): BrokerModel { |
|
|
|
return new BrokerModel('', '', '', '', '', '', '', |
|
|
|
'', false, '', '', '', ''); |
|
|
|
return new BrokerModel({}); |
|
|
|
} |
|
|
|
|
|
|
|
public static getFromUserAndExtra(u: PeopleModel, ex: UserExtraModel): BrokerModel { |
|
|
|
return new BrokerModel( |
|
|
|
u.Id, u.First, u.Last, u.Middle, u.Title, u.Display, u.Nick, ex.Login, u.Enabled, ex.BSB, ex.ACC, ex.License, ex.Organization |
|
|
|
); |
|
|
|
const ret = new BrokerModel({}); |
|
|
|
ret.Id = u.Id; |
|
|
|
ret.First = u.First; |
|
|
|
ret.Last = u.Last; |
|
|
|
ret.Middle = u.Middle; |
|
|
|
ret.Title = u.Title; |
|
|
|
ret.Display = u.Display; |
|
|
|
ret.Nick = u.Nick; |
|
|
|
ret.Login = ex.Login; |
|
|
|
ret.Enabled = u.Enabled; |
|
|
|
ret.BSB = ex.BSB; |
|
|
|
ret.ACC = ex.ACC; |
|
|
|
ret.License = ex.License; |
|
|
|
ret.Organization = ex.Organization; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
public toPeopleModel(): PeopleModel{ |