fromResponse static method

ClientUserEntity fromResponse({
  1. required ClientUserResponse response,
})

Implementation

static ClientUserEntity fromResponse({
  required ClientUserResponse response,
}) =>
    ClientUserEntity(
      id: response.id ?? 0,
      name: response.name ?? '',
      company: response.company ?? '',
      jurStatus: JurStatus.values.firstWhere(
        (JurStatus status) => status.shortName == (response.jurStatus ?? 'J'),
      ),
      jurAddress: response.jurAddress ?? '',
      registrationDate: response.registrationDate ?? '',
      registrationAuthority: response.registrationAuthority ?? '',
      taxId: response.taxId ?? '',
      email: response.email ?? '',
      emailConfirmed: response.emailConfirmed ?? false,
      phone: response.phone ?? '',
      // if [sales_rep_id > 0] true
      // if [sales_rep_id  == 0] false
      isSalesRep: response.salesRepId > 0,
    );