From 64baa04a472f1a2452760b7c87a2ccf5ad5b6d8a Mon Sep 17 00:00:00 2001 From: Nathan Anderson Date: Thu, 30 May 2024 19:11:46 -0600 Subject: [PATCH] Added gen files --- .gitignore | 2 +- lib/models/budget.g.dart | 27 ++++++++++++++++ lib/models/budget_category_model.g.dart | 31 +++++++++++++++++++ lib/models/family_model.g.dart | 24 +++++++++++++++ lib/models/shared_note.g.dart | 38 +++++++++++++++++++++++ lib/models/tag.g.dart | 33 ++++++++++++++++++++ lib/models/token.g.dart | 21 +++++++++++++ lib/models/transaction_model.g.dart | 41 +++++++++++++++++++++++++ lib/models/user.g.dart | 33 ++++++++++++++++++++ 9 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 lib/models/budget.g.dart create mode 100644 lib/models/budget_category_model.g.dart create mode 100644 lib/models/family_model.g.dart create mode 100644 lib/models/shared_note.g.dart create mode 100644 lib/models/tag.g.dart create mode 100644 lib/models/token.g.dart create mode 100644 lib/models/transaction_model.g.dart create mode 100644 lib/models/user.g.dart diff --git a/.gitignore b/.gitignore index 23592fc..6c8cd01 100644 --- a/.gitignore +++ b/.gitignore @@ -44,5 +44,5 @@ app.*.map.json /android/app/release #generated files -lib/**/*.g.dart +# lib/**/*.g.dart .direnv/ diff --git a/lib/models/budget.g.dart b/lib/models/budget.g.dart new file mode 100644 index 0000000..6073daf --- /dev/null +++ b/lib/models/budget.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'budget.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Budget _$BudgetFromJson(Map json) => Budget( + id: json['id'] as int?, + familyId: json['family_id'] as int, + name: json['name'] as String, + expectedIncome: (json['expected_income'] as num?)?.toDouble(), + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$BudgetToJson(Budget instance) => { + 'id': instance.id, + 'family_id': instance.familyId, + 'expected_income': instance.expectedIncome, + 'name': instance.name, + 'hide': boolToJson(instance.hide), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; diff --git a/lib/models/budget_category_model.g.dart b/lib/models/budget_category_model.g.dart new file mode 100644 index 0000000..d7498c1 --- /dev/null +++ b/lib/models/budget_category_model.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'budget_category_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BudgetCategory _$BudgetCategoryFromJson(Map json) => + BudgetCategory( + id: json['id'] as int?, + budgetId: json['budget_id'] as int, + name: json['name'] as String, + color: colorFromJson(json['color'] as String), + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + amount: (json['amount'] as num).toDouble(), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$BudgetCategoryToJson(BudgetCategory instance) => + { + 'budget_id': instance.budgetId, + 'id': instance.id, + 'name': instance.name, + 'amount': instance.amount, + 'hide': boolToJson(instance.hide), + 'color': colorToJson(instance.color), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; diff --git a/lib/models/family_model.g.dart b/lib/models/family_model.g.dart new file mode 100644 index 0000000..4ad8284 --- /dev/null +++ b/lib/models/family_model.g.dart @@ -0,0 +1,24 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'family_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +FamilyModel _$FamilyModelFromJson(Map json) => FamilyModel( + id: json['id'] as int, + code: json['code'] as String?, + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$FamilyModelToJson(FamilyModel instance) => + { + 'id': instance.id, + 'code': instance.code, + 'hide': boolToJson(instance.hide), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; diff --git a/lib/models/shared_note.g.dart b/lib/models/shared_note.g.dart new file mode 100644 index 0000000..0aa6034 --- /dev/null +++ b/lib/models/shared_note.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'shared_note.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SharedNote _$SharedNoteFromJson(Map json) => SharedNote( + id: json['id'] as int?, + familyId: json['family_id'] as int, + createdByUserId: json['created_by_user_id'] as int, + content: json['content'] as String, + title: json['title'] as String, + color: optionalColorFromJson(json['color'] as String?), + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + tagIds: _tagIdsFromJson(json['tag_ids'] as String), + isMarkdown: json['is_markdown'] == null + ? false + : boolFromJson(json['is_markdown'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$SharedNoteToJson(SharedNote instance) => + { + 'id': instance.id, + 'family_id': instance.familyId, + 'created_by_user_id': instance.createdByUserId, + 'content': instance.content, + 'title': instance.title, + 'tag_ids': _tagIdsToJson(instance.tagIds), + 'color': optionalColorToJson(instance.color), + 'is_markdown': boolToJson(instance.isMarkdown), + 'hide': boolToJson(instance.hide), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; diff --git a/lib/models/tag.g.dart b/lib/models/tag.g.dart new file mode 100644 index 0000000..137b880 --- /dev/null +++ b/lib/models/tag.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tag.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Tag _$TagFromJson(Map json) => Tag( + id: json['id'] as int?, + familyId: json['family_id'] as int, + createdByUserId: json['created_by_user_id'] as int, + name: json['name'] as String, + type: $enumDecode(_$TagTypeEnumMap, json['type']), + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$TagToJson(Tag instance) => { + 'id': instance.id, + 'family_id': instance.familyId, + 'created_by_user_id': instance.createdByUserId, + 'name': instance.name, + 'type': _$TagTypeEnumMap[instance.type]!, + 'hide': boolToJson(instance.hide), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; + +const _$TagTypeEnumMap = { + TagType.note: 'note', +}; diff --git a/lib/models/token.g.dart b/lib/models/token.g.dart new file mode 100644 index 0000000..5899882 --- /dev/null +++ b/lib/models/token.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'token.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Token _$TokenFromJson(Map json) => Token( + userId: json['user_id'] as int, + familyId: json['family_id'] as int, + generatedAt: dateFromJson(json['generated_at'] as int), + expiresAt: dateFromJson(json['expires_at'] as int), + ); + +Map _$TokenToJson(Token instance) => { + 'family_id': instance.familyId, + 'user_id': instance.userId, + 'generated_at': dateToJson(instance.generatedAt), + 'expires_at': dateToJson(instance.expiresAt), + }; diff --git a/lib/models/transaction_model.g.dart b/lib/models/transaction_model.g.dart new file mode 100644 index 0000000..2fba12a --- /dev/null +++ b/lib/models/transaction_model.g.dart @@ -0,0 +1,41 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'transaction_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Transaction _$TransactionFromJson(Map json) => Transaction( + id: json['id'] as int?, + amount: (json['amount'] as num).toDouble(), + type: $enumDecode(_$TransactionTypeEnumMap, json['type']), + budgetId: json['budget_id'] as int, + budgetCategoryId: json['budget_category_id'] as int?, + createdByUserId: json['created_by_user_id'] as int, + date: dateFromJson(json['date'] as int), + memo: json['memo'] as String?, + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$TransactionToJson(Transaction instance) => + { + 'id': instance.id, + 'budget_category_id': instance.budgetCategoryId, + 'budget_id': instance.budgetId, + 'created_by_user_id': instance.createdByUserId, + 'amount': instance.amount, + 'memo': instance.memo, + 'type': _$TransactionTypeEnumMap[instance.type]!, + 'hide': boolToJson(instance.hide), + 'date': dateToJson(instance.date), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + }; + +const _$TransactionTypeEnumMap = { + TransactionType.income: 'income', + TransactionType.expense: 'expense', +}; diff --git a/lib/models/user.g.dart b/lib/models/user.g.dart new file mode 100644 index 0000000..f82a4d6 --- /dev/null +++ b/lib/models/user.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'user.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +User _$UserFromJson(Map json) => User( + id: json['id'] as int?, + name: json['name'] as String, + familyId: json['family_id'] as int, + budgetId: json['budget_id'] as int, + email: json['email'] as String?, + username: json['username'] as String?, + createdAt: dateFromJson(json['created_at'] as int), + updatedAt: dateFromJson(json['updated_at'] as int), + lastActivityAt: dateFromJson(json['last_activity_at'] as int), + hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int), + ); + +Map _$UserToJson(User instance) => { + 'id': instance.id, + 'family_id': instance.familyId, + 'budget_id': instance.budgetId, + 'name': instance.name, + 'username': instance.username, + 'email': instance.email, + 'hide': boolToJson(instance.hide), + 'created_at': dateToJson(instance.createdAt), + 'updated_at': dateToJson(instance.updatedAt), + 'last_activity_at': dateToJson(instance.lastActivityAt), + };