toUserDto method

UserDto toUserDto()

Implementation

UserDto toUserDto() => UserDto(
    id: this.id?.also((it) {
          if (!Uuid.isValidUUID(fromString: it)) {
            throw FormatException("Invalid id, id must be a valid UUID");
          }
        }) ??
        uuid.v4(options: {'rng': UuidUtil.cryptoRNG}),
    properties: this.properties.map((it) => it.toPropertyStubDto()).toSet(),
    roles: this.roles,
    autoDelegations: this.autoDelegations,
    authenticationTokens: this.authenticationTokens.map((k, v) => MapEntry(k, v.toAuthenticationTokenDto())),
    rev: this.rev,
    deletionDate: this.deletionDate,
    created: this.created,
    name: this.name,
      login: this.login,
      passwordHash: this.passwordHash,
      secret: this.secret,
      use2fa: this.use2fa,
      groupId: this.groupId,
      healthcarePartyId: this.healthcarePartyId,
      patientId: this.patientId,
      deviceId: this.deviceId,
      email: this.email,
      mobilePhone: this.mobilePhone,
      status: this.status?.let((it) => UserStatusMapper(it).toUserDtoStatusEnum()),
    );