dto / mapper / model separation of verification purpose
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/models/verification/purpose.dart';
|
||||
import 'package:pshared/api/requests/tokens/session_identifier.dart';
|
||||
import 'package:pshared/data/dto/verification/purpose.dart';
|
||||
|
||||
part 'login.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class LoginVerificationRequest {
|
||||
final VerificationPurpose purpose;
|
||||
final VerificationPurposeDTO purpose;
|
||||
final String? target;
|
||||
final String idempotencyKey;
|
||||
|
||||
const LoginVerificationRequest({
|
||||
this.purpose = VerificationPurpose.login,
|
||||
this.purpose = VerificationPurposeDTO.login,
|
||||
this.target,
|
||||
required this.idempotencyKey,
|
||||
});
|
||||
|
||||
factory LoginVerificationRequest.fromJson(Map<String, dynamic> json) => _$LoginVerificationRequestFromJson(json);
|
||||
factory LoginVerificationRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$LoginVerificationRequestFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$LoginVerificationRequestToJson(this);
|
||||
}
|
||||
|
||||
@@ -28,14 +28,15 @@ class LoginCodeVerifyicationRequest extends LoginVerificationRequest {
|
||||
final SessionIdentifierDTO sessionIdentifier;
|
||||
|
||||
const LoginCodeVerifyicationRequest({
|
||||
super.purpose = VerificationPurpose.login,
|
||||
super.purpose = VerificationPurposeDTO.login,
|
||||
super.target,
|
||||
required super.idempotencyKey,
|
||||
required this.code,
|
||||
required this.sessionIdentifier,
|
||||
});
|
||||
|
||||
factory LoginCodeVerifyicationRequest.fromJson(Map<String, dynamic> json) => _$LoginCodeVerifyicationRequestFromJson(json);
|
||||
factory LoginCodeVerifyicationRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$LoginCodeVerifyicationRequestFromJson(json);
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$LoginCodeVerifyicationRequestToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user