prasule/lib/api/recurring_entry.g.dart

49 lines
1.6 KiB
Dart

// SPDX-FileCopyrightText: (C) 2024 Matyáš Caras
//
// SPDX-License-Identifier: AGPL-3.0-only
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'recurring_entry.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RecurringWalletEntry _$RecurringWalletEntryFromJson(
Map<String, dynamic> json) =>
RecurringWalletEntry(
data: EntryData.fromJson(json['data'] as Map<String, dynamic>),
type: $enumDecode(_$EntryTypeEnumMap, json['type']),
date: DateTime.parse(json['date'] as String),
category:
WalletCategory.fromJson(json['category'] as Map<String, dynamic>),
id: json['id'] as int,
lastRunDate: DateTime.parse(json['lastRunDate'] as String),
repeatAfter: json['repeatAfter'] as int,
recurType: $enumDecode(_$RecurTypeEnumMap, json['recurType']),
);
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',
};