TF-48 Create and update object for compose email
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
class AccountRequest with EquatableMixin {
|
||||
final UserName userName;
|
||||
final Password password;
|
||||
|
||||
AccountRequest(this.userName, this.password);
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'username': userName.userName,
|
||||
'password': password.value,
|
||||
};
|
||||
|
||||
@override
|
||||
List<Object> get props => [userName, password];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Attribute {
|
||||
static const id = '_id';
|
||||
static const firstname = 'firstname';
|
||||
static const lastname = 'lastname';
|
||||
static const job_title = 'job_title';
|
||||
static const building_location = 'building_location';
|
||||
static const office_location = 'office_location';
|
||||
static const main_phone = 'main_phone';
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
part 'presentation_account_response.g.dart';
|
||||
|
||||
@PresentationEmailAddressConverter()
|
||||
@JsonSerializable()
|
||||
class PresentationAccountResponse with EquatableMixin {
|
||||
final List<PresentationEmailAddress>? emails;
|
||||
final int preferredEmailIndex;
|
||||
final AccountType type;
|
||||
|
||||
PresentationAccountResponse(this.emails, this.preferredEmailIndex, this.type);
|
||||
|
||||
factory PresentationAccountResponse.fromJson(Map<String, dynamic> json) => _$PresentationAccountResponseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PresentationAccountResponseToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [emails, preferredEmailIndex, type];
|
||||
}
|
||||
|
||||
extension PresentationAccountResponseExtension on PresentationAccountResponse {
|
||||
PresentationAccount toPresentationAccount() {
|
||||
return PresentationAccount(emails ?? [], preferredEmailIndex, type);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user