- Wallet EnakPoint & EnakCoin: beranda, riwayat, saldo kedaluwarsa, kode bayar, tukar EnakCoin, transfer - PIN (buat, ganti, lupa), outlet, riwayat order, game spin - Halaman community, webview, coming soon, dan ikon menu beranda baru - Redesign Reward Saya: kartu tiket, filter chip, detail kode + QR - Hapus customer point loader, menu, dan checkout lama - Base URL ke enaklo-pos-api.altru.id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.2 KiB
Dart
44 lines
1.2 KiB
Dart
part of '../wallet_dtos.dart';
|
|
|
|
@freezed
|
|
abstract class PinStatusDto with _$PinStatusDto {
|
|
const factory PinStatusDto({
|
|
@JsonKey(name: 'has_pin') bool? hasPin,
|
|
@JsonKey(name: 'locked_until') String? lockedUntil,
|
|
@JsonKey(name: 'transfer_blocked_until') String? transferBlockedUntil,
|
|
}) = _PinStatusDto;
|
|
|
|
factory PinStatusDto.fromJson(Map<String, dynamic> json) =>
|
|
_$PinStatusDtoFromJson(json);
|
|
|
|
const PinStatusDto._();
|
|
|
|
PinStatus toDomain() => PinStatus(
|
|
hasPin: hasPin ?? false,
|
|
lockedUntil: _parseDateTime(lockedUntil),
|
|
transferBlockedUntil: _parseDateTime(transferBlockedUntil),
|
|
);
|
|
}
|
|
|
|
@freezed
|
|
abstract class PinOtpDto with _$PinOtpDto {
|
|
const factory PinOtpDto({
|
|
@JsonKey(name: 'purpose') String? purpose,
|
|
@JsonKey(name: 'otp_token') String? otpToken,
|
|
@JsonKey(name: 'expires_at') String? expiresAt,
|
|
}) = _PinOtpDto;
|
|
|
|
factory PinOtpDto.fromJson(Map<String, dynamic> json) =>
|
|
_$PinOtpDtoFromJson(json);
|
|
|
|
const PinOtpDto._();
|
|
|
|
PinOtp toDomain() => PinOtp(
|
|
purpose: purpose == PinOtpPurpose.reset.apiValue
|
|
? PinOtpPurpose.reset
|
|
: PinOtpPurpose.setup,
|
|
otpToken: otpToken ?? '',
|
|
expiresAt: _parseDateTime(expiresAt),
|
|
);
|
|
}
|