59 lines
1.9 KiB
Dart
59 lines
1.9 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'recurring_entry.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
RecurringWalletEntry _$RecurringWalletEntryFromJson(Map<String, dynamic> json) {
|
|
$checkKeys(
|
|
json,
|
|
requiredKeys: const ['id'],
|
|
disallowNullValues: const ['id'],
|
|
);
|
|
return RecurringWalletEntry(
|
|
data: json['data'] == null
|
|
? EntryData.unknown()
|
|
: EntryData.fromJson(json['data'] as Map<String, dynamic>),
|
|
type: $enumDecodeNullable(_$EntryTypeEnumMap, json['type']) ??
|
|
EntryType.expense,
|
|
date: json['date'] == null
|
|
? DateTime.now()
|
|
: DateTime.parse(json['date'] as String),
|
|
category: json['category'] == null
|
|
? WalletCategory.unknown()
|
|
: WalletCategory.fromJson(json['category'] as Map<String, dynamic>),
|
|
id: (json['id'] as num).toInt(),
|
|
lastRunDate: json['lastRunDate'] == null
|
|
? DateTime.now()
|
|
: DateTime.parse(json['lastRunDate'] as String),
|
|
recurType: $enumDecodeNullable(_$RecurTypeEnumMap, json['recurType']) ??
|
|
RecurType.month,
|
|
repeatAfter: (json['repeatAfter'] as num?)?.toInt() ?? 1,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> _$RecurringWalletEntryToJson(
|
|
RecurringWalletEntry instance) =>
|
|
<String, dynamic>{
|
|
'type': _$EntryTypeEnumMap[instance.type]!,
|
|
'data': instance.data,
|
|
'date': instance.date.toIso8601String(),
|
|
'category': instance.category,
|
|
'id': instance.id,
|
|
'lastRunDate': instance.lastRunDate.toIso8601String(),
|
|
'repeatAfter': instance.repeatAfter,
|
|
'recurType': _$RecurTypeEnumMap[instance.recurType]!,
|
|
};
|
|
|
|
const _$EntryTypeEnumMap = {
|
|
EntryType.expense: 'expense',
|
|
EntryType.income: 'income',
|
|
};
|
|
|
|
const _$RecurTypeEnumMap = {
|
|
RecurType.month: 'month',
|
|
RecurType.year: 'year',
|
|
RecurType.day: 'day',
|
|
};
|