import {PeopleModel} from './people.model';
import {BrokerModel} from './broker.model';

export enum UserRoles {
  Unknown = 'Unknown',
  People = 'People',
  Broker = 'Broker',
  Beneficiary = 'Beneficiary',
  Admin = 'admin',
  Accountant = 'accountant',
  Super = 'super',
}

export class UserExModel extends PeopleModel{
  Role: UserRoles;
  Broker?: BrokerModel;
  Login: string;
  constructor(payload?: Partial<UserExModel>) {
    super(payload);
    if ( ! payload ) { payload = {}; }
    this.Role = payload.Role || 'People' as UserRoles;
    this.Login = payload.Login || '';
    this.Broker = new BrokerModel(payload);
  }
}
