This commit is contained in:
efrilm
2025-09-18 07:16:56 +07:00
parent b20854f329
commit 3b26b19b25
17 changed files with 1672 additions and 0 deletions
@@ -0,0 +1,36 @@
part of '../auth_dtos.dart';
@freezed
class ResendDto with _$ResendDto {
const factory ResendDto({
@JsonKey(name: 'status') String? status,
@JsonKey(name: 'message') String? message,
@JsonKey(name: 'data') ResendDataDto? data,
}) = _ResendDto;
factory ResendDto.fromJson(Map<String, dynamic> json) =>
_$ResendDtoFromJson(json);
const ResendDto._();
/// mapping ke domain
Resend toDomain() => Resend(
status: status ?? '',
message: message ?? '',
otpToken: data?.otpToken ?? '',
expiresIn: data?.expiresIn ?? 0,
nextResendIn: data?.nextResendIn ?? 0,
);
}
@freezed
class ResendDataDto with _$ResendDataDto {
const factory ResendDataDto({
@JsonKey(name: 'otp_token') String? otpToken,
@JsonKey(name: 'expires_in') int? expiresIn,
@JsonKey(name: 'next_resend_in') int? nextResendIn,
}) = _ResendDataDto;
factory ResendDataDto.fromJson(Map<String, dynamic> json) =>
_$ResendDataDtoFromJson(json);
}