Added gen files

This commit is contained in:
Nathan Anderson 2024-05-30 19:11:46 -06:00
parent ddba989576
commit 64baa04a47
9 changed files with 249 additions and 1 deletions

2
.gitignore vendored
View File

@ -44,5 +44,5 @@ app.*.map.json
/android/app/release /android/app/release
#generated files #generated files
lib/**/*.g.dart # lib/**/*.g.dart
.direnv/ .direnv/

27
lib/models/budget.g.dart Normal file
View File

@ -0,0 +1,27 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'budget.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Budget _$BudgetFromJson(Map<String, dynamic> 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<String, dynamic> _$BudgetToJson(Budget instance) => <String, dynamic>{
'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),
};

View File

@ -0,0 +1,31 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'budget_category_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BudgetCategory _$BudgetCategoryFromJson(Map<String, dynamic> 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<String, dynamic> _$BudgetCategoryToJson(BudgetCategory instance) =>
<String, dynamic>{
'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),
};

View File

@ -0,0 +1,24 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'family_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
FamilyModel _$FamilyModelFromJson(Map<String, dynamic> 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<String, dynamic> _$FamilyModelToJson(FamilyModel instance) =>
<String, dynamic>{
'id': instance.id,
'code': instance.code,
'hide': boolToJson(instance.hide),
'created_at': dateToJson(instance.createdAt),
'updated_at': dateToJson(instance.updatedAt),
};

View File

@ -0,0 +1,38 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'shared_note.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SharedNote _$SharedNoteFromJson(Map<String, dynamic> 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<String, dynamic> _$SharedNoteToJson(SharedNote instance) =>
<String, dynamic>{
'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),
};

33
lib/models/tag.g.dart Normal file
View File

@ -0,0 +1,33 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tag.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Tag _$TagFromJson(Map<String, dynamic> 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<String, dynamic> _$TagToJson(Tag instance) => <String, dynamic>{
'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',
};

21
lib/models/token.g.dart Normal file
View File

@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'token.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Token _$TokenFromJson(Map<String, dynamic> 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<String, dynamic> _$TokenToJson(Token instance) => <String, dynamic>{
'family_id': instance.familyId,
'user_id': instance.userId,
'generated_at': dateToJson(instance.generatedAt),
'expires_at': dateToJson(instance.expiresAt),
};

View File

@ -0,0 +1,41 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'transaction_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Transaction _$TransactionFromJson(Map<String, dynamic> 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<String, dynamic> _$TransactionToJson(Transaction instance) =>
<String, dynamic>{
'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',
};

33
lib/models/user.g.dart Normal file
View File

@ -0,0 +1,33 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
User _$UserFromJson(Map<String, dynamic> 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<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
'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),
};