From facbc16bb245e6472f1d6f320bf6bd8c9f80ce53 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sun, 18 May 2025 14:46:48 +0200 Subject: [PATCH] Fix budgets appearing multiple times --- lib/database/sqlite.dart | 19 +- lib/database/sqlite.g.dart | 7902 +++++++++++++++---------- lib/ui/pages/transaction_details.dart | 2 +- lib/ui/state/core.dart | 3 +- lib/ui/state/core.freezed.dart | 514 +- lib/ui/widgets/account_indicator.dart | 2 +- 6 files changed, 4909 insertions(+), 3533 deletions(-) diff --git a/lib/database/sqlite.dart b/lib/database/sqlite.dart index bf83c51..6d171ac 100644 --- a/lib/database/sqlite.dart +++ b/lib/database/sqlite.dart @@ -386,19 +386,12 @@ class BudgetsDao extends DatabaseAccessor BudgetsDao(OkaneDatabase db) : super(db); Stream> budgetsStream(Account account) { - return (select(budgets)..where((b) => b.accountId.equals(account.id))) - .join([ - leftOuterJoin( - budgetItems, - budgetItems.budgetId.equalsExp(budgets.id), - ), - ]) - .watch() - .map((rows) { - return rows.map((row) { - return BudgetsDto(budget: row.readTable(budgets)); - }).toList(); - }); + return (select(budgets) + ..where((b) => b.accountId.equals(account.id))).watch().map((rows) { + return rows.map((row) { + return BudgetsDto(budget: row); + }).toList(); + }); } Future> getBudgets(Account? account) { diff --git a/lib/database/sqlite.g.dart b/lib/database/sqlite.g.dart index 2bb367c..db8ec36 100644 --- a/lib/database/sqlite.g.dart +++ b/lib/database/sqlite.g.dart @@ -11,17 +11,25 @@ class $AccountsTable extends Accounts with TableInfo<$AccountsTable, Account> { static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); @override List get $columns => [id, name]; @override @@ -30,8 +38,10 @@ class $AccountsTable extends Accounts with TableInfo<$AccountsTable, Account> { String get actualTableName => $name; static const String $name = 'accounts'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -39,7 +49,9 @@ class $AccountsTable extends Accounts with TableInfo<$AccountsTable, Account> { } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } @@ -52,10 +64,16 @@ class $AccountsTable extends Accounts with TableInfo<$AccountsTable, Account> { Account map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Account( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + name: + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, ); } @@ -78,14 +96,13 @@ class Account extends DataClass implements Insertable { } AccountsCompanion toCompanion(bool nullToAbsent) { - return AccountsCompanion( - id: Value(id), - name: Value(name), - ); + return AccountsCompanion(id: Value(id), name: Value(name)); } - factory Account.fromJson(Map json, - {ValueSerializer? serializer}) { + factory Account.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Account( id: serializer.fromJson(json['id']), @@ -101,10 +118,8 @@ class Account extends DataClass implements Insertable { }; } - Account copyWith({int? id, String? name}) => Account( - id: id ?? this.id, - name: name ?? this.name, - ); + Account copyWith({int? id, String? name}) => + Account(id: id ?? this.id, name: name ?? this.name); Account copyWithCompanion(AccountsCompanion data) { return Account( id: data.id.present ? data.id.value : this.id, @@ -151,10 +166,7 @@ class AccountsCompanion extends UpdateCompanion { } AccountsCompanion copyWith({Value? id, Value? name}) { - return AccountsCompanion( - id: id ?? this.id, - name: name ?? this.name, - ); + return AccountsCompanion(id: id ?? this.id, name: name ?? this.name); } @override @@ -188,39 +200,60 @@ class $BeneficiariesTable extends Beneficiaries static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE')); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'), + ); @override late final GeneratedColumnWithTypeConverter type = - GeneratedColumn('type', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true) - .withConverter($BeneficiariesTable.$convertertype); - static const VerificationMeta _accountIdMeta = - const VerificationMeta('accountId'); + GeneratedColumn( + 'type', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($BeneficiariesTable.$convertertype); + static const VerificationMeta _accountIdMeta = const VerificationMeta( + 'accountId', + ); @override late final GeneratedColumn accountId = GeneratedColumn( - 'account_id', aliasedName, true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES accounts (id)')); - static const VerificationMeta _imagePathMeta = - const VerificationMeta('imagePath'); + 'account_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES accounts (id)', + ), + ); + static const VerificationMeta _imagePathMeta = const VerificationMeta( + 'imagePath', + ); @override late final GeneratedColumn imagePath = GeneratedColumn( - 'image_path', aliasedName, true, - type: DriftSqlType.string, requiredDuringInsert: false); + 'image_path', + aliasedName, + true, + type: DriftSqlType.string, + requiredDuringInsert: false, + ); @override List get $columns => [id, name, type, accountId, imagePath]; @override @@ -229,8 +262,10 @@ class $BeneficiariesTable extends Beneficiaries String get actualTableName => $name; static const String $name = 'beneficiaries'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -238,17 +273,23 @@ class $BeneficiariesTable extends Beneficiaries } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('account_id')) { - context.handle(_accountIdMeta, - accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta)); + context.handle( + _accountIdMeta, + accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), + ); } if (data.containsKey('image_path')) { - context.handle(_imagePathMeta, - imagePath.isAcceptableOrUnknown(data['image_path']!, _imagePathMeta)); + context.handle( + _imagePathMeta, + imagePath.isAcceptableOrUnknown(data['image_path']!, _imagePathMeta), + ); } return context; } @@ -259,17 +300,30 @@ class $BeneficiariesTable extends Beneficiaries Beneficiary map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Beneficiary( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, - type: $BeneficiariesTable.$convertertype.fromSql(attachedDatabase - .typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}type'])!), - accountId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}account_id']), - imagePath: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}image_path']), + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + name: + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, + type: $BeneficiariesTable.$convertertype.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}type'], + )!, + ), + accountId: attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}account_id'], + ), + imagePath: attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}image_path'], + ), ); } @@ -288,20 +342,22 @@ class Beneficiary extends DataClass implements Insertable { final BeneficiaryType type; final int? accountId; final String? imagePath; - const Beneficiary( - {required this.id, - required this.name, - required this.type, - this.accountId, - this.imagePath}); + const Beneficiary({ + required this.id, + required this.name, + required this.type, + this.accountId, + this.imagePath, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); { - map['type'] = - Variable($BeneficiariesTable.$convertertype.toSql(type)); + map['type'] = Variable( + $BeneficiariesTable.$convertertype.toSql(type), + ); } if (!nullToAbsent || accountId != null) { map['account_id'] = Variable(accountId); @@ -317,23 +373,28 @@ class Beneficiary extends DataClass implements Insertable { id: Value(id), name: Value(name), type: Value(type), - accountId: accountId == null && nullToAbsent - ? const Value.absent() - : Value(accountId), - imagePath: imagePath == null && nullToAbsent - ? const Value.absent() - : Value(imagePath), + accountId: + accountId == null && nullToAbsent + ? const Value.absent() + : Value(accountId), + imagePath: + imagePath == null && nullToAbsent + ? const Value.absent() + : Value(imagePath), ); } - factory Beneficiary.fromJson(Map json, - {ValueSerializer? serializer}) { + factory Beneficiary.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Beneficiary( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), - type: $BeneficiariesTable.$convertertype - .fromJson(serializer.fromJson(json['type'])), + type: $BeneficiariesTable.$convertertype.fromJson( + serializer.fromJson(json['type']), + ), accountId: serializer.fromJson(json['accountId']), imagePath: serializer.fromJson(json['imagePath']), ); @@ -344,26 +405,27 @@ class Beneficiary extends DataClass implements Insertable { return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), - 'type': serializer - .toJson($BeneficiariesTable.$convertertype.toJson(type)), + 'type': serializer.toJson( + $BeneficiariesTable.$convertertype.toJson(type), + ), 'accountId': serializer.toJson(accountId), 'imagePath': serializer.toJson(imagePath), }; } - Beneficiary copyWith( - {int? id, - String? name, - BeneficiaryType? type, - Value accountId = const Value.absent(), - Value imagePath = const Value.absent()}) => - Beneficiary( - id: id ?? this.id, - name: name ?? this.name, - type: type ?? this.type, - accountId: accountId.present ? accountId.value : this.accountId, - imagePath: imagePath.present ? imagePath.value : this.imagePath, - ); + Beneficiary copyWith({ + int? id, + String? name, + BeneficiaryType? type, + Value accountId = const Value.absent(), + Value imagePath = const Value.absent(), + }) => Beneficiary( + id: id ?? this.id, + name: name ?? this.name, + type: type ?? this.type, + accountId: accountId.present ? accountId.value : this.accountId, + imagePath: imagePath.present ? imagePath.value : this.imagePath, + ); Beneficiary copyWithCompanion(BeneficiariesCompanion data) { return Beneficiary( id: data.id.present ? data.id.value : this.id, @@ -418,8 +480,8 @@ class BeneficiariesCompanion extends UpdateCompanion { required BeneficiaryType type, this.accountId = const Value.absent(), this.imagePath = const Value.absent(), - }) : name = Value(name), - type = Value(type); + }) : name = Value(name), + type = Value(type); static Insertable custom({ Expression? id, Expression? name, @@ -436,12 +498,13 @@ class BeneficiariesCompanion extends UpdateCompanion { }); } - BeneficiariesCompanion copyWith( - {Value? id, - Value? name, - Value? type, - Value? accountId, - Value? imagePath}) { + BeneficiariesCompanion copyWith({ + Value? id, + Value? name, + Value? type, + Value? accountId, + Value? imagePath, + }) { return BeneficiariesCompanion( id: id ?? this.id, name: name ?? this.name, @@ -462,7 +525,8 @@ class BeneficiariesCompanion extends UpdateCompanion { } if (type.present) { map['type'] = Variable( - $BeneficiariesTable.$convertertype.toSql(type.value)); + $BeneficiariesTable.$convertertype.toSql(type.value), + ); } if (accountId.present) { map['account_id'] = Variable(accountId.value); @@ -494,56 +558,90 @@ class $BudgetsTable extends Budgets with TableInfo<$BudgetsTable, Budget> { static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); @override late final GeneratedColumnWithTypeConverter period = - GeneratedColumn('period', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true) - .withConverter($BudgetsTable.$converterperiod); + GeneratedColumn( + 'period', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ).withConverter($BudgetsTable.$converterperiod); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); static const VerificationMeta _incomeMeta = const VerificationMeta('income'); @override late final GeneratedColumn income = GeneratedColumn( - 'income', aliasedName, false, - type: DriftSqlType.double, requiredDuringInsert: true); + 'income', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); static const VerificationMeta _includeOtherSpendingsMeta = const VerificationMeta('includeOtherSpendings'); @override late final GeneratedColumn includeOtherSpendings = - GeneratedColumn('include_other_spendings', aliasedName, false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("include_other_spendings" IN (0, 1))')); - static const VerificationMeta _accountIdMeta = - const VerificationMeta('accountId'); + GeneratedColumn( + 'include_other_spendings', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("include_other_spendings" IN (0, 1))', + ), + ); + static const VerificationMeta _accountIdMeta = const VerificationMeta( + 'accountId', + ); @override late final GeneratedColumn accountId = GeneratedColumn( - 'account_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES accounts (id)')); + 'account_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES accounts (id)', + ), + ); @override - List get $columns => - [id, period, name, income, includeOtherSpendings, accountId]; + List get $columns => [ + id, + period, + name, + income, + includeOtherSpendings, + accountId, + ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'budgets'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -551,27 +649,36 @@ class $BudgetsTable extends Budgets with TableInfo<$BudgetsTable, Budget> { } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('income')) { - context.handle(_incomeMeta, - income.isAcceptableOrUnknown(data['income']!, _incomeMeta)); + context.handle( + _incomeMeta, + income.isAcceptableOrUnknown(data['income']!, _incomeMeta), + ); } else if (isInserting) { context.missing(_incomeMeta); } if (data.containsKey('include_other_spendings')) { context.handle( + _includeOtherSpendingsMeta, + includeOtherSpendings.isAcceptableOrUnknown( + data['include_other_spendings']!, _includeOtherSpendingsMeta, - includeOtherSpendings.isAcceptableOrUnknown( - data['include_other_spendings']!, _includeOtherSpendingsMeta)); + ), + ); } else if (isInserting) { context.missing(_includeOtherSpendingsMeta); } if (data.containsKey('account_id')) { - context.handle(_accountIdMeta, - accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta)); + context.handle( + _accountIdMeta, + accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), + ); } else if (isInserting) { context.missing(_accountIdMeta); } @@ -584,20 +691,37 @@ class $BudgetsTable extends Budgets with TableInfo<$BudgetsTable, Budget> { Budget map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Budget( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - period: $BudgetsTable.$converterperiod.fromSql(attachedDatabase - .typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}period'])!), - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, - income: attachedDatabase.typeMapping - .read(DriftSqlType.double, data['${effectivePrefix}income'])!, - includeOtherSpendings: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}include_other_spendings'])!, - accountId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}account_id'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + period: $BudgetsTable.$converterperiod.fromSql( + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}period'], + )!, + ), + name: + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, + income: + attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}income'], + )!, + includeOtherSpendings: + attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}include_other_spendings'], + )!, + accountId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}account_id'], + )!, ); } @@ -617,20 +741,22 @@ class Budget extends DataClass implements Insertable { final double income; final bool includeOtherSpendings; final int accountId; - const Budget( - {required this.id, - required this.period, - required this.name, - required this.income, - required this.includeOtherSpendings, - required this.accountId}); + const Budget({ + required this.id, + required this.period, + required this.name, + required this.income, + required this.includeOtherSpendings, + required this.accountId, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); { - map['period'] = - Variable($BudgetsTable.$converterperiod.toSql(period)); + map['period'] = Variable( + $BudgetsTable.$converterperiod.toSql(period), + ); } map['name'] = Variable(name); map['income'] = Variable(income); @@ -650,17 +776,21 @@ class Budget extends DataClass implements Insertable { ); } - factory Budget.fromJson(Map json, - {ValueSerializer? serializer}) { + factory Budget.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Budget( id: serializer.fromJson(json['id']), - period: $BudgetsTable.$converterperiod - .fromJson(serializer.fromJson(json['period'])), + period: $BudgetsTable.$converterperiod.fromJson( + serializer.fromJson(json['period']), + ), name: serializer.fromJson(json['name']), income: serializer.fromJson(json['income']), - includeOtherSpendings: - serializer.fromJson(json['includeOtherSpendings']), + includeOtherSpendings: serializer.fromJson( + json['includeOtherSpendings'], + ), accountId: serializer.fromJson(json['accountId']), ); } @@ -669,8 +799,9 @@ class Budget extends DataClass implements Insertable { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), - 'period': serializer - .toJson($BudgetsTable.$converterperiod.toJson(period)), + 'period': serializer.toJson( + $BudgetsTable.$converterperiod.toJson(period), + ), 'name': serializer.toJson(name), 'income': serializer.toJson(income), 'includeOtherSpendings': serializer.toJson(includeOtherSpendings), @@ -678,31 +809,31 @@ class Budget extends DataClass implements Insertable { }; } - Budget copyWith( - {int? id, - BudgetPeriod? period, - String? name, - double? income, - bool? includeOtherSpendings, - int? accountId}) => - Budget( - id: id ?? this.id, - period: period ?? this.period, - name: name ?? this.name, - income: income ?? this.income, - includeOtherSpendings: - includeOtherSpendings ?? this.includeOtherSpendings, - accountId: accountId ?? this.accountId, - ); + Budget copyWith({ + int? id, + BudgetPeriod? period, + String? name, + double? income, + bool? includeOtherSpendings, + int? accountId, + }) => Budget( + id: id ?? this.id, + period: period ?? this.period, + name: name ?? this.name, + income: income ?? this.income, + includeOtherSpendings: includeOtherSpendings ?? this.includeOtherSpendings, + accountId: accountId ?? this.accountId, + ); Budget copyWithCompanion(BudgetsCompanion data) { return Budget( id: data.id.present ? data.id.value : this.id, period: data.period.present ? data.period.value : this.period, name: data.name.present ? data.name.value : this.name, income: data.income.present ? data.income.value : this.income, - includeOtherSpendings: data.includeOtherSpendings.present - ? data.includeOtherSpendings.value - : this.includeOtherSpendings, + includeOtherSpendings: + data.includeOtherSpendings.present + ? data.includeOtherSpendings.value + : this.includeOtherSpendings, accountId: data.accountId.present ? data.accountId.value : this.accountId, ); } @@ -757,11 +888,11 @@ class BudgetsCompanion extends UpdateCompanion { required double income, required bool includeOtherSpendings, required int accountId, - }) : period = Value(period), - name = Value(name), - income = Value(income), - includeOtherSpendings = Value(includeOtherSpendings), - accountId = Value(accountId); + }) : period = Value(period), + name = Value(name), + income = Value(income), + includeOtherSpendings = Value(includeOtherSpendings), + accountId = Value(accountId); static Insertable custom({ Expression? id, Expression? period, @@ -781,13 +912,14 @@ class BudgetsCompanion extends UpdateCompanion { }); } - BudgetsCompanion copyWith( - {Value? id, - Value? period, - Value? name, - Value? income, - Value? includeOtherSpendings, - Value? accountId}) { + BudgetsCompanion copyWith({ + Value? id, + Value? period, + Value? name, + Value? income, + Value? includeOtherSpendings, + Value? accountId, + }) { return BudgetsCompanion( id: id ?? this.id, period: period ?? this.period, @@ -806,8 +938,9 @@ class BudgetsCompanion extends UpdateCompanion { map['id'] = Variable(id.value); } if (period.present) { - map['period'] = - Variable($BudgetsTable.$converterperiod.toSql(period.value)); + map['period'] = Variable( + $BudgetsTable.$converterperiod.toSql(period.value), + ); } if (name.present) { map['name'] = Variable(name.value); @@ -816,8 +949,9 @@ class BudgetsCompanion extends UpdateCompanion { map['income'] = Variable(income.value); } if (includeOtherSpendings.present) { - map['include_other_spendings'] = - Variable(includeOtherSpendings.value); + map['include_other_spendings'] = Variable( + includeOtherSpendings.value, + ); } if (accountId.present) { map['account_id'] = Variable(accountId.value); @@ -848,17 +982,25 @@ class $ExpenseCategoriesTable extends ExpenseCategories static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); @override List get $columns => [id, name]; @override @@ -867,8 +1009,10 @@ class $ExpenseCategoriesTable extends ExpenseCategories String get actualTableName => $name; static const String $name = 'expense_categories'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -876,7 +1020,9 @@ class $ExpenseCategoriesTable extends ExpenseCategories } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } @@ -889,10 +1035,16 @@ class $ExpenseCategoriesTable extends ExpenseCategories ExpenseCategory map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return ExpenseCategory( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + name: + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, ); } @@ -915,14 +1067,13 @@ class ExpenseCategory extends DataClass implements Insertable { } ExpenseCategoriesCompanion toCompanion(bool nullToAbsent) { - return ExpenseCategoriesCompanion( - id: Value(id), - name: Value(name), - ); + return ExpenseCategoriesCompanion(id: Value(id), name: Value(name)); } - factory ExpenseCategory.fromJson(Map json, - {ValueSerializer? serializer}) { + factory ExpenseCategory.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return ExpenseCategory( id: serializer.fromJson(json['id']), @@ -938,10 +1089,8 @@ class ExpenseCategory extends DataClass implements Insertable { }; } - ExpenseCategory copyWith({int? id, String? name}) => ExpenseCategory( - id: id ?? this.id, - name: name ?? this.name, - ); + ExpenseCategory copyWith({int? id, String? name}) => + ExpenseCategory(id: id ?? this.id, name: name ?? this.name); ExpenseCategory copyWithCompanion(ExpenseCategoriesCompanion data) { return ExpenseCategory( id: data.id.present ? data.id.value : this.id, @@ -1027,68 +1176,99 @@ class $BudgetItemsTable extends BudgetItems static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _amountMeta = const VerificationMeta('amount'); @override late final GeneratedColumn amount = GeneratedColumn( - 'amount', aliasedName, false, - type: DriftSqlType.double, requiredDuringInsert: true); - static const VerificationMeta _expenseCategoryIdMeta = - const VerificationMeta('expenseCategoryId'); + 'amount', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _expenseCategoryIdMeta = const VerificationMeta( + 'expenseCategoryId', + ); @override late final GeneratedColumn expenseCategoryId = GeneratedColumn( - 'expense_category_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES expense_categories (id)')); - static const VerificationMeta _budgetIdMeta = - const VerificationMeta('budgetId'); + 'expense_category_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES expense_categories (id)', + ), + ); + static const VerificationMeta _budgetIdMeta = const VerificationMeta( + 'budgetId', + ); @override late final GeneratedColumn budgetId = GeneratedColumn( - 'budget_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES budgets (id)')); + 'budget_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES budgets (id)', + ), + ); @override - List get $columns => - [id, amount, expenseCategoryId, budgetId]; + List get $columns => [ + id, + amount, + expenseCategoryId, + budgetId, + ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'budget_items'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('amount')) { - context.handle(_amountMeta, - amount.isAcceptableOrUnknown(data['amount']!, _amountMeta)); + context.handle( + _amountMeta, + amount.isAcceptableOrUnknown(data['amount']!, _amountMeta), + ); } else if (isInserting) { context.missing(_amountMeta); } if (data.containsKey('expense_category_id')) { context.handle( + _expenseCategoryIdMeta, + expenseCategoryId.isAcceptableOrUnknown( + data['expense_category_id']!, _expenseCategoryIdMeta, - expenseCategoryId.isAcceptableOrUnknown( - data['expense_category_id']!, _expenseCategoryIdMeta)); + ), + ); } else if (isInserting) { context.missing(_expenseCategoryIdMeta); } if (data.containsKey('budget_id')) { - context.handle(_budgetIdMeta, - budgetId.isAcceptableOrUnknown(data['budget_id']!, _budgetIdMeta)); + context.handle( + _budgetIdMeta, + budgetId.isAcceptableOrUnknown(data['budget_id']!, _budgetIdMeta), + ); } else if (isInserting) { context.missing(_budgetIdMeta); } @@ -1101,14 +1281,26 @@ class $BudgetItemsTable extends BudgetItems BudgetItem map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return BudgetItem( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - amount: attachedDatabase.typeMapping - .read(DriftSqlType.double, data['${effectivePrefix}amount'])!, - expenseCategoryId: attachedDatabase.typeMapping.read( - DriftSqlType.int, data['${effectivePrefix}expense_category_id'])!, - budgetId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}budget_id'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + amount: + attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}amount'], + )!, + expenseCategoryId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}expense_category_id'], + )!, + budgetId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}budget_id'], + )!, ); } @@ -1123,11 +1315,12 @@ class BudgetItem extends DataClass implements Insertable { final double amount; final int expenseCategoryId; final int budgetId; - const BudgetItem( - {required this.id, - required this.amount, - required this.expenseCategoryId, - required this.budgetId}); + const BudgetItem({ + required this.id, + required this.amount, + required this.expenseCategoryId, + required this.budgetId, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -1147,8 +1340,10 @@ class BudgetItem extends DataClass implements Insertable { ); } - factory BudgetItem.fromJson(Map json, - {ValueSerializer? serializer}) { + factory BudgetItem.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return BudgetItem( id: serializer.fromJson(json['id']), @@ -1168,21 +1363,25 @@ class BudgetItem extends DataClass implements Insertable { }; } - BudgetItem copyWith( - {int? id, double? amount, int? expenseCategoryId, int? budgetId}) => - BudgetItem( - id: id ?? this.id, - amount: amount ?? this.amount, - expenseCategoryId: expenseCategoryId ?? this.expenseCategoryId, - budgetId: budgetId ?? this.budgetId, - ); + BudgetItem copyWith({ + int? id, + double? amount, + int? expenseCategoryId, + int? budgetId, + }) => BudgetItem( + id: id ?? this.id, + amount: amount ?? this.amount, + expenseCategoryId: expenseCategoryId ?? this.expenseCategoryId, + budgetId: budgetId ?? this.budgetId, + ); BudgetItem copyWithCompanion(BudgetItemsCompanion data) { return BudgetItem( id: data.id.present ? data.id.value : this.id, amount: data.amount.present ? data.amount.value : this.amount, - expenseCategoryId: data.expenseCategoryId.present - ? data.expenseCategoryId.value - : this.expenseCategoryId, + expenseCategoryId: + data.expenseCategoryId.present + ? data.expenseCategoryId.value + : this.expenseCategoryId, budgetId: data.budgetId.present ? data.budgetId.value : this.budgetId, ); } @@ -1226,9 +1425,9 @@ class BudgetItemsCompanion extends UpdateCompanion { required double amount, required int expenseCategoryId, required int budgetId, - }) : amount = Value(amount), - expenseCategoryId = Value(expenseCategoryId), - budgetId = Value(budgetId); + }) : amount = Value(amount), + expenseCategoryId = Value(expenseCategoryId), + budgetId = Value(budgetId); static Insertable custom({ Expression? id, Expression? amount, @@ -1243,11 +1442,12 @@ class BudgetItemsCompanion extends UpdateCompanion { }); } - BudgetItemsCompanion copyWith( - {Value? id, - Value? amount, - Value? expenseCategoryId, - Value? budgetId}) { + BudgetItemsCompanion copyWith({ + Value? id, + Value? amount, + Value? expenseCategoryId, + Value? budgetId, + }) { return BudgetItemsCompanion( id: id ?? this.id, amount: amount ?? this.amount, @@ -1294,21 +1494,30 @@ class $LoansTable extends Loans with TableInfo<$LoansTable, Loan> { static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); - static const VerificationMeta _beneficiaryIdMeta = - const VerificationMeta('beneficiaryId'); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); + static const VerificationMeta _beneficiaryIdMeta = const VerificationMeta( + 'beneficiaryId', + ); @override late final GeneratedColumn beneficiaryId = GeneratedColumn( - 'beneficiary_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES beneficiaries (id)')); + 'beneficiary_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES beneficiaries (id)', + ), + ); @override List get $columns => [id, beneficiaryId]; @override @@ -1317,8 +1526,10 @@ class $LoansTable extends Loans with TableInfo<$LoansTable, Loan> { String get actualTableName => $name; static const String $name = 'loans'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -1326,9 +1537,12 @@ class $LoansTable extends Loans with TableInfo<$LoansTable, Loan> { } if (data.containsKey('beneficiary_id')) { context.handle( + _beneficiaryIdMeta, + beneficiaryId.isAcceptableOrUnknown( + data['beneficiary_id']!, _beneficiaryIdMeta, - beneficiaryId.isAcceptableOrUnknown( - data['beneficiary_id']!, _beneficiaryIdMeta)); + ), + ); } else if (isInserting) { context.missing(_beneficiaryIdMeta); } @@ -1341,10 +1555,16 @@ class $LoansTable extends Loans with TableInfo<$LoansTable, Loan> { Loan map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Loan( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - beneficiaryId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}beneficiary_id'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + beneficiaryId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}beneficiary_id'], + )!, ); } @@ -1367,14 +1587,13 @@ class Loan extends DataClass implements Insertable { } LoansCompanion toCompanion(bool nullToAbsent) { - return LoansCompanion( - id: Value(id), - beneficiaryId: Value(beneficiaryId), - ); + return LoansCompanion(id: Value(id), beneficiaryId: Value(beneficiaryId)); } - factory Loan.fromJson(Map json, - {ValueSerializer? serializer}) { + factory Loan.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Loan( id: serializer.fromJson(json['id']), @@ -1391,15 +1610,16 @@ class Loan extends DataClass implements Insertable { } Loan copyWith({int? id, int? beneficiaryId}) => Loan( - id: id ?? this.id, - beneficiaryId: beneficiaryId ?? this.beneficiaryId, - ); + id: id ?? this.id, + beneficiaryId: beneficiaryId ?? this.beneficiaryId, + ); Loan copyWithCompanion(LoansCompanion data) { return Loan( id: data.id.present ? data.id.value : this.id, - beneficiaryId: data.beneficiaryId.present - ? data.beneficiaryId.value - : this.beneficiaryId, + beneficiaryId: + data.beneficiaryId.present + ? data.beneficiaryId.value + : this.beneficiaryId, ); } @@ -1481,30 +1701,46 @@ class $LoanChangesTable extends LoanChanges static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _loanIdMeta = const VerificationMeta('loanId'); @override late final GeneratedColumn loanId = GeneratedColumn( - 'loan_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES loans (id)')); + 'loan_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES loans (id)', + ), + ); static const VerificationMeta _amountMeta = const VerificationMeta('amount'); @override late final GeneratedColumn amount = GeneratedColumn( - 'amount', aliasedName, false, - type: DriftSqlType.double, requiredDuringInsert: true); + 'amount', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); static const VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( - 'date', aliasedName, false, - type: DriftSqlType.dateTime, requiredDuringInsert: true); + 'date', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); @override List get $columns => [id, loanId, amount, date]; @override @@ -1513,28 +1749,36 @@ class $LoanChangesTable extends LoanChanges String get actualTableName => $name; static const String $name = 'loan_changes'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('loan_id')) { - context.handle(_loanIdMeta, - loanId.isAcceptableOrUnknown(data['loan_id']!, _loanIdMeta)); + context.handle( + _loanIdMeta, + loanId.isAcceptableOrUnknown(data['loan_id']!, _loanIdMeta), + ); } else if (isInserting) { context.missing(_loanIdMeta); } if (data.containsKey('amount')) { - context.handle(_amountMeta, - amount.isAcceptableOrUnknown(data['amount']!, _amountMeta)); + context.handle( + _amountMeta, + amount.isAcceptableOrUnknown(data['amount']!, _amountMeta), + ); } else if (isInserting) { context.missing(_amountMeta); } if (data.containsKey('date')) { context.handle( - _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta)); + _dateMeta, + date.isAcceptableOrUnknown(data['date']!, _dateMeta), + ); } else if (isInserting) { context.missing(_dateMeta); } @@ -1547,14 +1791,26 @@ class $LoanChangesTable extends LoanChanges LoanChange map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return LoanChange( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - loanId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}loan_id'])!, - amount: attachedDatabase.typeMapping - .read(DriftSqlType.double, data['${effectivePrefix}amount'])!, - date: attachedDatabase.typeMapping - .read(DriftSqlType.dateTime, data['${effectivePrefix}date'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + loanId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}loan_id'], + )!, + amount: + attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}amount'], + )!, + date: + attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}date'], + )!, ); } @@ -1569,11 +1825,12 @@ class LoanChange extends DataClass implements Insertable { final int loanId; final double amount; final DateTime date; - const LoanChange( - {required this.id, - required this.loanId, - required this.amount, - required this.date}); + const LoanChange({ + required this.id, + required this.loanId, + required this.amount, + required this.date, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -1593,8 +1850,10 @@ class LoanChange extends DataClass implements Insertable { ); } - factory LoanChange.fromJson(Map json, - {ValueSerializer? serializer}) { + factory LoanChange.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return LoanChange( id: serializer.fromJson(json['id']), @@ -1669,9 +1928,9 @@ class LoanChangesCompanion extends UpdateCompanion { required int loanId, required double amount, required DateTime date, - }) : loanId = Value(loanId), - amount = Value(amount), - date = Value(date); + }) : loanId = Value(loanId), + amount = Value(amount), + date = Value(date); static Insertable custom({ Expression? id, Expression? loanId, @@ -1686,11 +1945,12 @@ class LoanChangesCompanion extends UpdateCompanion { }); } - LoanChangesCompanion copyWith( - {Value? id, - Value? loanId, - Value? amount, - Value? date}) { + LoanChangesCompanion copyWith({ + Value? id, + Value? loanId, + Value? amount, + Value? date, + }) { return LoanChangesCompanion( id: id ?? this.id, loanId: loanId ?? this.loanId, @@ -1738,68 +1998,100 @@ class $TransactionTemplatesTable extends TransactionTemplates static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _nameMeta = const VerificationMeta('name'); @override late final GeneratedColumn name = GeneratedColumn( - 'name', aliasedName, false, - type: DriftSqlType.string, requiredDuringInsert: true); + 'name', + aliasedName, + false, + type: DriftSqlType.string, + requiredDuringInsert: true, + ); static const VerificationMeta _amountMeta = const VerificationMeta('amount'); @override late final GeneratedColumn amount = GeneratedColumn( - 'amount', aliasedName, false, - type: DriftSqlType.double, requiredDuringInsert: true); - static const VerificationMeta _recurringMeta = - const VerificationMeta('recurring'); + 'amount', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); + static const VerificationMeta _recurringMeta = const VerificationMeta( + 'recurring', + ); @override late final GeneratedColumn recurring = GeneratedColumn( - 'recurring', aliasedName, false, - type: DriftSqlType.bool, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('CHECK ("recurring" IN (0, 1))')); - static const VerificationMeta _expenseCategoryIdMeta = - const VerificationMeta('expenseCategoryId'); + 'recurring', + aliasedName, + false, + type: DriftSqlType.bool, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'CHECK ("recurring" IN (0, 1))', + ), + ); + static const VerificationMeta _expenseCategoryIdMeta = const VerificationMeta( + 'expenseCategoryId', + ); @override late final GeneratedColumn expenseCategoryId = GeneratedColumn( - 'expense_category_id', aliasedName, true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES expense_categories (id)')); - static const VerificationMeta _beneficiaryIdMeta = - const VerificationMeta('beneficiaryId'); + 'expense_category_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES expense_categories (id)', + ), + ); + static const VerificationMeta _beneficiaryIdMeta = const VerificationMeta( + 'beneficiaryId', + ); @override late final GeneratedColumn beneficiaryId = GeneratedColumn( - 'beneficiary_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES beneficiaries (id)')); - static const VerificationMeta _accountIdMeta = - const VerificationMeta('accountId'); + 'beneficiary_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES beneficiaries (id)', + ), + ); + static const VerificationMeta _accountIdMeta = const VerificationMeta( + 'accountId', + ); @override late final GeneratedColumn accountId = GeneratedColumn( - 'account_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES accounts (id)')); + 'account_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES accounts (id)', + ), + ); @override List get $columns => [ - id, - name, - amount, - recurring, - expenseCategoryId, - beneficiaryId, - accountId - ]; + id, + name, + amount, + recurring, + expenseCategoryId, + beneficiaryId, + accountId, + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -1807,8 +2099,9 @@ class $TransactionTemplatesTable extends TransactionTemplates static const String $name = 'transaction_templates'; @override VerificationContext validateIntegrity( - Insertable instance, - {bool isInserting = false}) { + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -1816,39 +2109,53 @@ class $TransactionTemplatesTable extends TransactionTemplates } if (data.containsKey('name')) { context.handle( - _nameMeta, name.isAcceptableOrUnknown(data['name']!, _nameMeta)); + _nameMeta, + name.isAcceptableOrUnknown(data['name']!, _nameMeta), + ); } else if (isInserting) { context.missing(_nameMeta); } if (data.containsKey('amount')) { - context.handle(_amountMeta, - amount.isAcceptableOrUnknown(data['amount']!, _amountMeta)); + context.handle( + _amountMeta, + amount.isAcceptableOrUnknown(data['amount']!, _amountMeta), + ); } else if (isInserting) { context.missing(_amountMeta); } if (data.containsKey('recurring')) { - context.handle(_recurringMeta, - recurring.isAcceptableOrUnknown(data['recurring']!, _recurringMeta)); + context.handle( + _recurringMeta, + recurring.isAcceptableOrUnknown(data['recurring']!, _recurringMeta), + ); } else if (isInserting) { context.missing(_recurringMeta); } if (data.containsKey('expense_category_id')) { context.handle( + _expenseCategoryIdMeta, + expenseCategoryId.isAcceptableOrUnknown( + data['expense_category_id']!, _expenseCategoryIdMeta, - expenseCategoryId.isAcceptableOrUnknown( - data['expense_category_id']!, _expenseCategoryIdMeta)); + ), + ); } if (data.containsKey('beneficiary_id')) { context.handle( + _beneficiaryIdMeta, + beneficiaryId.isAcceptableOrUnknown( + data['beneficiary_id']!, _beneficiaryIdMeta, - beneficiaryId.isAcceptableOrUnknown( - data['beneficiary_id']!, _beneficiaryIdMeta)); + ), + ); } else if (isInserting) { context.missing(_beneficiaryIdMeta); } if (data.containsKey('account_id')) { - context.handle(_accountIdMeta, - accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta)); + context.handle( + _accountIdMeta, + accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), + ); } else if (isInserting) { context.missing(_accountIdMeta); } @@ -1861,20 +2168,40 @@ class $TransactionTemplatesTable extends TransactionTemplates TransactionTemplate map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return TransactionTemplate( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - name: attachedDatabase.typeMapping - .read(DriftSqlType.string, data['${effectivePrefix}name'])!, - amount: attachedDatabase.typeMapping - .read(DriftSqlType.double, data['${effectivePrefix}amount'])!, - recurring: attachedDatabase.typeMapping - .read(DriftSqlType.bool, data['${effectivePrefix}recurring'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + name: + attachedDatabase.typeMapping.read( + DriftSqlType.string, + data['${effectivePrefix}name'], + )!, + amount: + attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}amount'], + )!, + recurring: + attachedDatabase.typeMapping.read( + DriftSqlType.bool, + data['${effectivePrefix}recurring'], + )!, expenseCategoryId: attachedDatabase.typeMapping.read( - DriftSqlType.int, data['${effectivePrefix}expense_category_id']), - beneficiaryId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}beneficiary_id'])!, - accountId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}account_id'])!, + DriftSqlType.int, + data['${effectivePrefix}expense_category_id'], + ), + beneficiaryId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}beneficiary_id'], + )!, + accountId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}account_id'], + )!, ); } @@ -1893,14 +2220,15 @@ class TransactionTemplate extends DataClass final int? expenseCategoryId; final int beneficiaryId; final int accountId; - const TransactionTemplate( - {required this.id, - required this.name, - required this.amount, - required this.recurring, - this.expenseCategoryId, - required this.beneficiaryId, - required this.accountId}); + const TransactionTemplate({ + required this.id, + required this.name, + required this.amount, + required this.recurring, + this.expenseCategoryId, + required this.beneficiaryId, + required this.accountId, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -1922,16 +2250,19 @@ class TransactionTemplate extends DataClass name: Value(name), amount: Value(amount), recurring: Value(recurring), - expenseCategoryId: expenseCategoryId == null && nullToAbsent - ? const Value.absent() - : Value(expenseCategoryId), + expenseCategoryId: + expenseCategoryId == null && nullToAbsent + ? const Value.absent() + : Value(expenseCategoryId), beneficiaryId: Value(beneficiaryId), accountId: Value(accountId), ); } - factory TransactionTemplate.fromJson(Map json, - {ValueSerializer? serializer}) { + factory TransactionTemplate.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return TransactionTemplate( id: serializer.fromJson(json['id']), @@ -1957,37 +2288,40 @@ class TransactionTemplate extends DataClass }; } - TransactionTemplate copyWith( - {int? id, - String? name, - double? amount, - bool? recurring, - Value expenseCategoryId = const Value.absent(), - int? beneficiaryId, - int? accountId}) => - TransactionTemplate( - id: id ?? this.id, - name: name ?? this.name, - amount: amount ?? this.amount, - recurring: recurring ?? this.recurring, - expenseCategoryId: expenseCategoryId.present + TransactionTemplate copyWith({ + int? id, + String? name, + double? amount, + bool? recurring, + Value expenseCategoryId = const Value.absent(), + int? beneficiaryId, + int? accountId, + }) => TransactionTemplate( + id: id ?? this.id, + name: name ?? this.name, + amount: amount ?? this.amount, + recurring: recurring ?? this.recurring, + expenseCategoryId: + expenseCategoryId.present ? expenseCategoryId.value : this.expenseCategoryId, - beneficiaryId: beneficiaryId ?? this.beneficiaryId, - accountId: accountId ?? this.accountId, - ); + beneficiaryId: beneficiaryId ?? this.beneficiaryId, + accountId: accountId ?? this.accountId, + ); TransactionTemplate copyWithCompanion(TransactionTemplatesCompanion data) { return TransactionTemplate( id: data.id.present ? data.id.value : this.id, name: data.name.present ? data.name.value : this.name, amount: data.amount.present ? data.amount.value : this.amount, recurring: data.recurring.present ? data.recurring.value : this.recurring, - expenseCategoryId: data.expenseCategoryId.present - ? data.expenseCategoryId.value - : this.expenseCategoryId, - beneficiaryId: data.beneficiaryId.present - ? data.beneficiaryId.value - : this.beneficiaryId, + expenseCategoryId: + data.expenseCategoryId.present + ? data.expenseCategoryId.value + : this.expenseCategoryId, + beneficiaryId: + data.beneficiaryId.present + ? data.beneficiaryId.value + : this.beneficiaryId, accountId: data.accountId.present ? data.accountId.value : this.accountId, ); } @@ -2008,7 +2342,14 @@ class TransactionTemplate extends DataClass @override int get hashCode => Object.hash( - id, name, amount, recurring, expenseCategoryId, beneficiaryId, accountId); + id, + name, + amount, + recurring, + expenseCategoryId, + beneficiaryId, + accountId, + ); @override bool operator ==(Object other) => identical(this, other) || @@ -2048,11 +2389,11 @@ class TransactionTemplatesCompanion this.expenseCategoryId = const Value.absent(), required int beneficiaryId, required int accountId, - }) : name = Value(name), - amount = Value(amount), - recurring = Value(recurring), - beneficiaryId = Value(beneficiaryId), - accountId = Value(accountId); + }) : name = Value(name), + amount = Value(amount), + recurring = Value(recurring), + beneficiaryId = Value(beneficiaryId), + accountId = Value(accountId); static Insertable custom({ Expression? id, Expression? name, @@ -2073,14 +2414,15 @@ class TransactionTemplatesCompanion }); } - TransactionTemplatesCompanion copyWith( - {Value? id, - Value? name, - Value? amount, - Value? recurring, - Value? expenseCategoryId, - Value? beneficiaryId, - Value? accountId}) { + TransactionTemplatesCompanion copyWith({ + Value? id, + Value? name, + Value? amount, + Value? recurring, + Value? expenseCategoryId, + Value? beneficiaryId, + Value? accountId, + }) { return TransactionTemplatesCompanion( id: id ?? this.id, name: name ?? this.name, @@ -2143,44 +2485,73 @@ class $RecurringTransactionsTable extends RecurringTransactions static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _daysMeta = const VerificationMeta('days'); @override late final GeneratedColumn days = GeneratedColumn( - 'days', aliasedName, false, - type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _lastExecutionMeta = - const VerificationMeta('lastExecution'); + 'days', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + ); + static const VerificationMeta _lastExecutionMeta = const VerificationMeta( + 'lastExecution', + ); @override late final GeneratedColumn lastExecution = - GeneratedColumn('last_execution', aliasedName, true, - type: DriftSqlType.dateTime, requiredDuringInsert: false); - static const VerificationMeta _templateIdMeta = - const VerificationMeta('templateId'); + GeneratedColumn( + 'last_execution', + aliasedName, + true, + type: DriftSqlType.dateTime, + requiredDuringInsert: false, + ); + static const VerificationMeta _templateIdMeta = const VerificationMeta( + 'templateId', + ); @override late final GeneratedColumn templateId = GeneratedColumn( - 'template_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES transaction_templates (id)')); - static const VerificationMeta _accountIdMeta = - const VerificationMeta('accountId'); + 'template_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES transaction_templates (id)', + ), + ); + static const VerificationMeta _accountIdMeta = const VerificationMeta( + 'accountId', + ); @override late final GeneratedColumn accountId = GeneratedColumn( - 'account_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES accounts (id)')); + 'account_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES accounts (id)', + ), + ); @override - List get $columns => - [id, days, lastExecution, templateId, accountId]; + List get $columns => [ + id, + days, + lastExecution, + templateId, + accountId, + ]; @override String get aliasedName => _alias ?? actualTableName; @override @@ -2188,8 +2559,9 @@ class $RecurringTransactionsTable extends RecurringTransactions static const String $name = 'recurring_transactions'; @override VerificationContext validateIntegrity( - Insertable instance, - {bool isInserting = false}) { + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { @@ -2197,27 +2569,34 @@ class $RecurringTransactionsTable extends RecurringTransactions } if (data.containsKey('days')) { context.handle( - _daysMeta, days.isAcceptableOrUnknown(data['days']!, _daysMeta)); + _daysMeta, + days.isAcceptableOrUnknown(data['days']!, _daysMeta), + ); } else if (isInserting) { context.missing(_daysMeta); } if (data.containsKey('last_execution')) { context.handle( + _lastExecutionMeta, + lastExecution.isAcceptableOrUnknown( + data['last_execution']!, _lastExecutionMeta, - lastExecution.isAcceptableOrUnknown( - data['last_execution']!, _lastExecutionMeta)); + ), + ); } if (data.containsKey('template_id')) { context.handle( - _templateIdMeta, - templateId.isAcceptableOrUnknown( - data['template_id']!, _templateIdMeta)); + _templateIdMeta, + templateId.isAcceptableOrUnknown(data['template_id']!, _templateIdMeta), + ); } else if (isInserting) { context.missing(_templateIdMeta); } if (data.containsKey('account_id')) { - context.handle(_accountIdMeta, - accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta)); + context.handle( + _accountIdMeta, + accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), + ); } else if (isInserting) { context.missing(_accountIdMeta); } @@ -2230,16 +2609,30 @@ class $RecurringTransactionsTable extends RecurringTransactions RecurringTransaction map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return RecurringTransaction( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - days: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}days'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + days: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}days'], + )!, lastExecution: attachedDatabase.typeMapping.read( - DriftSqlType.dateTime, data['${effectivePrefix}last_execution']), - templateId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}template_id'])!, - accountId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}account_id'])!, + DriftSqlType.dateTime, + data['${effectivePrefix}last_execution'], + ), + templateId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}template_id'], + )!, + accountId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}account_id'], + )!, ); } @@ -2256,12 +2649,13 @@ class RecurringTransaction extends DataClass final DateTime? lastExecution; final int templateId; final int accountId; - const RecurringTransaction( - {required this.id, - required this.days, - this.lastExecution, - required this.templateId, - required this.accountId}); + const RecurringTransaction({ + required this.id, + required this.days, + this.lastExecution, + required this.templateId, + required this.accountId, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -2279,16 +2673,19 @@ class RecurringTransaction extends DataClass return RecurringTransactionsCompanion( id: Value(id), days: Value(days), - lastExecution: lastExecution == null && nullToAbsent - ? const Value.absent() - : Value(lastExecution), + lastExecution: + lastExecution == null && nullToAbsent + ? const Value.absent() + : Value(lastExecution), templateId: Value(templateId), accountId: Value(accountId), ); } - factory RecurringTransaction.fromJson(Map json, - {ValueSerializer? serializer}) { + factory RecurringTransaction.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return RecurringTransaction( id: serializer.fromJson(json['id']), @@ -2310,27 +2707,28 @@ class RecurringTransaction extends DataClass }; } - RecurringTransaction copyWith( - {int? id, - int? days, - Value lastExecution = const Value.absent(), - int? templateId, - int? accountId}) => - RecurringTransaction( - id: id ?? this.id, - days: days ?? this.days, - lastExecution: - lastExecution.present ? lastExecution.value : this.lastExecution, - templateId: templateId ?? this.templateId, - accountId: accountId ?? this.accountId, - ); + RecurringTransaction copyWith({ + int? id, + int? days, + Value lastExecution = const Value.absent(), + int? templateId, + int? accountId, + }) => RecurringTransaction( + id: id ?? this.id, + days: days ?? this.days, + lastExecution: + lastExecution.present ? lastExecution.value : this.lastExecution, + templateId: templateId ?? this.templateId, + accountId: accountId ?? this.accountId, + ); RecurringTransaction copyWithCompanion(RecurringTransactionsCompanion data) { return RecurringTransaction( id: data.id.present ? data.id.value : this.id, days: data.days.present ? data.days.value : this.days, - lastExecution: data.lastExecution.present - ? data.lastExecution.value - : this.lastExecution, + lastExecution: + data.lastExecution.present + ? data.lastExecution.value + : this.lastExecution, templateId: data.templateId.present ? data.templateId.value : this.templateId, accountId: data.accountId.present ? data.accountId.value : this.accountId, @@ -2383,9 +2781,9 @@ class RecurringTransactionsCompanion this.lastExecution = const Value.absent(), required int templateId, required int accountId, - }) : days = Value(days), - templateId = Value(templateId), - accountId = Value(accountId); + }) : days = Value(days), + templateId = Value(templateId), + accountId = Value(accountId); static Insertable custom({ Expression? id, Expression? days, @@ -2402,12 +2800,13 @@ class RecurringTransactionsCompanion }); } - RecurringTransactionsCompanion copyWith( - {Value? id, - Value? days, - Value? lastExecution, - Value? templateId, - Value? accountId}) { + RecurringTransactionsCompanion copyWith({ + Value? id, + Value? days, + Value? lastExecution, + Value? templateId, + Value? accountId, + }) { return RecurringTransactionsCompanion( id: id ?? this.id, days: days ?? this.days, @@ -2460,94 +2859,141 @@ class $TransactionsTable extends Transactions static const VerificationMeta _idMeta = const VerificationMeta('id'); @override late final GeneratedColumn id = GeneratedColumn( - 'id', aliasedName, false, - hasAutoIncrement: true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: - GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT')); + 'id', + aliasedName, + false, + hasAutoIncrement: true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'PRIMARY KEY AUTOINCREMENT', + ), + ); static const VerificationMeta _amountMeta = const VerificationMeta('amount'); @override late final GeneratedColumn amount = GeneratedColumn( - 'amount', aliasedName, false, - type: DriftSqlType.double, requiredDuringInsert: true); + 'amount', + aliasedName, + false, + type: DriftSqlType.double, + requiredDuringInsert: true, + ); static const VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( - 'date', aliasedName, false, - type: DriftSqlType.dateTime, requiredDuringInsert: true); - static const VerificationMeta _expenseCategoryIdMeta = - const VerificationMeta('expenseCategoryId'); + 'date', + aliasedName, + false, + type: DriftSqlType.dateTime, + requiredDuringInsert: true, + ); + static const VerificationMeta _expenseCategoryIdMeta = const VerificationMeta( + 'expenseCategoryId', + ); @override late final GeneratedColumn expenseCategoryId = GeneratedColumn( - 'expense_category_id', aliasedName, true, - type: DriftSqlType.int, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES expense_categories (id)')); - static const VerificationMeta _accountIdMeta = - const VerificationMeta('accountId'); + 'expense_category_id', + aliasedName, + true, + type: DriftSqlType.int, + requiredDuringInsert: false, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES expense_categories (id)', + ), + ); + static const VerificationMeta _accountIdMeta = const VerificationMeta( + 'accountId', + ); @override late final GeneratedColumn accountId = GeneratedColumn( - 'account_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES accounts (id)')); - static const VerificationMeta _beneficiaryIdMeta = - const VerificationMeta('beneficiaryId'); + 'account_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES accounts (id)', + ), + ); + static const VerificationMeta _beneficiaryIdMeta = const VerificationMeta( + 'beneficiaryId', + ); @override late final GeneratedColumn beneficiaryId = GeneratedColumn( - 'beneficiary_id', aliasedName, false, - type: DriftSqlType.int, - requiredDuringInsert: true, - defaultConstraints: - GeneratedColumn.constraintIsAlways('REFERENCES beneficiaries (id)')); + 'beneficiary_id', + aliasedName, + false, + type: DriftSqlType.int, + requiredDuringInsert: true, + defaultConstraints: GeneratedColumn.constraintIsAlways( + 'REFERENCES beneficiaries (id)', + ), + ); @override - List get $columns => - [id, amount, date, expenseCategoryId, accountId, beneficiaryId]; + List get $columns => [ + id, + amount, + date, + expenseCategoryId, + accountId, + beneficiaryId, + ]; @override String get aliasedName => _alias ?? actualTableName; @override String get actualTableName => $name; static const String $name = 'transactions'; @override - VerificationContext validateIntegrity(Insertable instance, - {bool isInserting = false}) { + VerificationContext validateIntegrity( + Insertable instance, { + bool isInserting = false, + }) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('id')) { context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); } if (data.containsKey('amount')) { - context.handle(_amountMeta, - amount.isAcceptableOrUnknown(data['amount']!, _amountMeta)); + context.handle( + _amountMeta, + amount.isAcceptableOrUnknown(data['amount']!, _amountMeta), + ); } else if (isInserting) { context.missing(_amountMeta); } if (data.containsKey('date')) { context.handle( - _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta)); + _dateMeta, + date.isAcceptableOrUnknown(data['date']!, _dateMeta), + ); } else if (isInserting) { context.missing(_dateMeta); } if (data.containsKey('expense_category_id')) { context.handle( + _expenseCategoryIdMeta, + expenseCategoryId.isAcceptableOrUnknown( + data['expense_category_id']!, _expenseCategoryIdMeta, - expenseCategoryId.isAcceptableOrUnknown( - data['expense_category_id']!, _expenseCategoryIdMeta)); + ), + ); } if (data.containsKey('account_id')) { - context.handle(_accountIdMeta, - accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta)); + context.handle( + _accountIdMeta, + accountId.isAcceptableOrUnknown(data['account_id']!, _accountIdMeta), + ); } else if (isInserting) { context.missing(_accountIdMeta); } if (data.containsKey('beneficiary_id')) { context.handle( + _beneficiaryIdMeta, + beneficiaryId.isAcceptableOrUnknown( + data['beneficiary_id']!, _beneficiaryIdMeta, - beneficiaryId.isAcceptableOrUnknown( - data['beneficiary_id']!, _beneficiaryIdMeta)); + ), + ); } else if (isInserting) { context.missing(_beneficiaryIdMeta); } @@ -2560,18 +3006,35 @@ class $TransactionsTable extends Transactions Transaction map(Map data, {String? tablePrefix}) { final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; return Transaction( - id: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}id'])!, - amount: attachedDatabase.typeMapping - .read(DriftSqlType.double, data['${effectivePrefix}amount'])!, - date: attachedDatabase.typeMapping - .read(DriftSqlType.dateTime, data['${effectivePrefix}date'])!, + id: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}id'], + )!, + amount: + attachedDatabase.typeMapping.read( + DriftSqlType.double, + data['${effectivePrefix}amount'], + )!, + date: + attachedDatabase.typeMapping.read( + DriftSqlType.dateTime, + data['${effectivePrefix}date'], + )!, expenseCategoryId: attachedDatabase.typeMapping.read( - DriftSqlType.int, data['${effectivePrefix}expense_category_id']), - accountId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}account_id'])!, - beneficiaryId: attachedDatabase.typeMapping - .read(DriftSqlType.int, data['${effectivePrefix}beneficiary_id'])!, + DriftSqlType.int, + data['${effectivePrefix}expense_category_id'], + ), + accountId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}account_id'], + )!, + beneficiaryId: + attachedDatabase.typeMapping.read( + DriftSqlType.int, + data['${effectivePrefix}beneficiary_id'], + )!, ); } @@ -2588,13 +3051,14 @@ class Transaction extends DataClass implements Insertable { final int? expenseCategoryId; final int accountId; final int beneficiaryId; - const Transaction( - {required this.id, - required this.amount, - required this.date, - this.expenseCategoryId, - required this.accountId, - required this.beneficiaryId}); + const Transaction({ + required this.id, + required this.amount, + required this.date, + this.expenseCategoryId, + required this.accountId, + required this.beneficiaryId, + }); @override Map toColumns(bool nullToAbsent) { final map = {}; @@ -2614,16 +3078,19 @@ class Transaction extends DataClass implements Insertable { id: Value(id), amount: Value(amount), date: Value(date), - expenseCategoryId: expenseCategoryId == null && nullToAbsent - ? const Value.absent() - : Value(expenseCategoryId), + expenseCategoryId: + expenseCategoryId == null && nullToAbsent + ? const Value.absent() + : Value(expenseCategoryId), accountId: Value(accountId), beneficiaryId: Value(beneficiaryId), ); } - factory Transaction.fromJson(Map json, - {ValueSerializer? serializer}) { + factory Transaction.fromJson( + Map json, { + ValueSerializer? serializer, + }) { serializer ??= driftRuntimeOptions.defaultSerializer; return Transaction( id: serializer.fromJson(json['id']), @@ -2647,35 +3114,38 @@ class Transaction extends DataClass implements Insertable { }; } - Transaction copyWith( - {int? id, - double? amount, - DateTime? date, - Value expenseCategoryId = const Value.absent(), - int? accountId, - int? beneficiaryId}) => - Transaction( - id: id ?? this.id, - amount: amount ?? this.amount, - date: date ?? this.date, - expenseCategoryId: expenseCategoryId.present + Transaction copyWith({ + int? id, + double? amount, + DateTime? date, + Value expenseCategoryId = const Value.absent(), + int? accountId, + int? beneficiaryId, + }) => Transaction( + id: id ?? this.id, + amount: amount ?? this.amount, + date: date ?? this.date, + expenseCategoryId: + expenseCategoryId.present ? expenseCategoryId.value : this.expenseCategoryId, - accountId: accountId ?? this.accountId, - beneficiaryId: beneficiaryId ?? this.beneficiaryId, - ); + accountId: accountId ?? this.accountId, + beneficiaryId: beneficiaryId ?? this.beneficiaryId, + ); Transaction copyWithCompanion(TransactionsCompanion data) { return Transaction( id: data.id.present ? data.id.value : this.id, amount: data.amount.present ? data.amount.value : this.amount, date: data.date.present ? data.date.value : this.date, - expenseCategoryId: data.expenseCategoryId.present - ? data.expenseCategoryId.value - : this.expenseCategoryId, + expenseCategoryId: + data.expenseCategoryId.present + ? data.expenseCategoryId.value + : this.expenseCategoryId, accountId: data.accountId.present ? data.accountId.value : this.accountId, - beneficiaryId: data.beneficiaryId.present - ? data.beneficiaryId.value - : this.beneficiaryId, + beneficiaryId: + data.beneficiaryId.present + ? data.beneficiaryId.value + : this.beneficiaryId, ); } @@ -2694,7 +3164,13 @@ class Transaction extends DataClass implements Insertable { @override int get hashCode => Object.hash( - id, amount, date, expenseCategoryId, accountId, beneficiaryId); + id, + amount, + date, + expenseCategoryId, + accountId, + beneficiaryId, + ); @override bool operator ==(Object other) => identical(this, other) || @@ -2729,10 +3205,10 @@ class TransactionsCompanion extends UpdateCompanion { this.expenseCategoryId = const Value.absent(), required int accountId, required int beneficiaryId, - }) : amount = Value(amount), - date = Value(date), - accountId = Value(accountId), - beneficiaryId = Value(beneficiaryId); + }) : amount = Value(amount), + date = Value(date), + accountId = Value(accountId), + beneficiaryId = Value(beneficiaryId); static Insertable custom({ Expression? id, Expression? amount, @@ -2751,13 +3227,14 @@ class TransactionsCompanion extends UpdateCompanion { }); } - TransactionsCompanion copyWith( - {Value? id, - Value? amount, - Value? date, - Value? expenseCategoryId, - Value? accountId, - Value? beneficiaryId}) { + TransactionsCompanion copyWith({ + Value? id, + Value? amount, + Value? date, + Value? expenseCategoryId, + Value? accountId, + Value? beneficiaryId, + }) { return TransactionsCompanion( id: id ?? this.id, amount: amount ?? this.amount, @@ -2823,130 +3300,157 @@ abstract class _$OkaneDatabase extends GeneratedDatabase { $RecurringTransactionsTable(this); late final $TransactionsTable transactions = $TransactionsTable(this); late final AccountsDao accountsDao = AccountsDao(this as OkaneDatabase); - late final BeneficiariesDao beneficiariesDao = - BeneficiariesDao(this as OkaneDatabase); + late final BeneficiariesDao beneficiariesDao = BeneficiariesDao( + this as OkaneDatabase, + ); late final BudgetsDao budgetsDao = BudgetsDao(this as OkaneDatabase); - late final ExpenseCategoriesDao expenseCategoriesDao = - ExpenseCategoriesDao(this as OkaneDatabase); + late final ExpenseCategoriesDao expenseCategoriesDao = ExpenseCategoriesDao( + this as OkaneDatabase, + ); late final LoansDao loansDao = LoansDao(this as OkaneDatabase); late final RecurringTransactionsDao recurringTransactionsDao = RecurringTransactionsDao(this as OkaneDatabase); late final TransactionTemplatesDao transactionTemplatesDao = TransactionTemplatesDao(this as OkaneDatabase); - late final TransactionsDao transactionsDao = - TransactionsDao(this as OkaneDatabase); + late final TransactionsDao transactionsDao = TransactionsDao( + this as OkaneDatabase, + ); @override Iterable> get allTables => allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ - accounts, - beneficiaries, - budgets, - expenseCategories, - budgetItems, - loans, - loanChanges, - transactionTemplates, - recurringTransactions, - transactions - ]; + accounts, + beneficiaries, + budgets, + expenseCategories, + budgetItems, + loans, + loanChanges, + transactionTemplates, + recurringTransactions, + transactions, + ]; } -typedef $$AccountsTableCreateCompanionBuilder = AccountsCompanion Function({ - Value id, - required String name, -}); -typedef $$AccountsTableUpdateCompanionBuilder = AccountsCompanion Function({ - Value id, - Value name, -}); +typedef $$AccountsTableCreateCompanionBuilder = + AccountsCompanion Function({Value id, required String name}); +typedef $$AccountsTableUpdateCompanionBuilder = + AccountsCompanion Function({Value id, Value name}); final class $$AccountsTableReferences extends BaseReferences<_$OkaneDatabase, $AccountsTable, Account> { $$AccountsTableReferences(super.$_db, super.$_table, super.$_typedResult); static MultiTypedResultKey<$BeneficiariesTable, List> - _beneficiariesRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.beneficiaries, - aliasName: $_aliasNameGenerator( - db.accounts.id, db.beneficiaries.accountId)); + _beneficiariesRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.beneficiaries, + aliasName: $_aliasNameGenerator(db.accounts.id, db.beneficiaries.accountId), + ); $$BeneficiariesTableProcessedTableManager get beneficiariesRefs { - final manager = $$BeneficiariesTableTableManager($_db, $_db.beneficiaries) - .filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$BeneficiariesTableTableManager( + $_db, + $_db.beneficiaries, + ).filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_beneficiariesRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } static MultiTypedResultKey<$BudgetsTable, List> _budgetsRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.budgets, - aliasName: - $_aliasNameGenerator(db.accounts.id, db.budgets.accountId)); + _$OkaneDatabase db, + ) => MultiTypedResultKey.fromTable( + db.budgets, + aliasName: $_aliasNameGenerator(db.accounts.id, db.budgets.accountId), + ); $$BudgetsTableProcessedTableManager get budgetsRefs { - final manager = $$BudgetsTableTableManager($_db, $_db.budgets) - .filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$BudgetsTableTableManager( + $_db, + $_db.budgets, + ).filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_budgetsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } - static MultiTypedResultKey<$TransactionTemplatesTable, - List> _transactionTemplatesRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactionTemplates, - aliasName: $_aliasNameGenerator( - db.accounts.id, db.transactionTemplates.accountId)); + static MultiTypedResultKey< + $TransactionTemplatesTable, + List + > + _transactionTemplatesRefsTable(_$OkaneDatabase db) => + MultiTypedResultKey.fromTable( + db.transactionTemplates, + aliasName: $_aliasNameGenerator( + db.accounts.id, + db.transactionTemplates.accountId, + ), + ); $$TransactionTemplatesTableProcessedTableManager - get transactionTemplatesRefs { - final manager = - $$TransactionTemplatesTableTableManager($_db, $_db.transactionTemplates) - .filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); + get transactionTemplatesRefs { + final manager = $$TransactionTemplatesTableTableManager( + $_db, + $_db.transactionTemplates, + ).filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); - final cache = - $_typedResult.readTableOrNull(_transactionTemplatesRefsTable($_db)); + final cache = $_typedResult.readTableOrNull( + _transactionTemplatesRefsTable($_db), + ); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } - static MultiTypedResultKey<$RecurringTransactionsTable, - List> _recurringTransactionsRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.recurringTransactions, - aliasName: $_aliasNameGenerator( - db.accounts.id, db.recurringTransactions.accountId)); + static MultiTypedResultKey< + $RecurringTransactionsTable, + List + > + _recurringTransactionsRefsTable(_$OkaneDatabase db) => + MultiTypedResultKey.fromTable( + db.recurringTransactions, + aliasName: $_aliasNameGenerator( + db.accounts.id, + db.recurringTransactions.accountId, + ), + ); $$RecurringTransactionsTableProcessedTableManager - get recurringTransactionsRefs { + get recurringTransactionsRefs { final manager = $$RecurringTransactionsTableTableManager( - $_db, $_db.recurringTransactions) - .filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); + $_db, + $_db.recurringTransactions, + ).filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); - final cache = - $_typedResult.readTableOrNull(_recurringTransactionsRefsTable($_db)); + final cache = $_typedResult.readTableOrNull( + _recurringTransactionsRefsTable($_db), + ); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } static MultiTypedResultKey<$TransactionsTable, List> - _transactionsRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactions, - aliasName: $_aliasNameGenerator( - db.accounts.id, db.transactions.accountId)); + _transactionsRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.transactions, + aliasName: $_aliasNameGenerator(db.accounts.id, db.transactions.accountId), + ); $$TransactionsTableProcessedTableManager get transactionsRefs { - final manager = $$TransactionsTableTableManager($_db, $_db.transactions) - .filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$TransactionsTableTableManager( + $_db, + $_db.transactions, + ).filter((f) => f.accountId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_transactionsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -2960,116 +3464,138 @@ class $$AccountsTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); Expression beneficiariesRefs( - Expression Function($$BeneficiariesTableFilterComposer f) f) { + Expression Function($$BeneficiariesTableFilterComposer f) f, + ) { final $$BeneficiariesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableFilterComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableFilterComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression budgetsRefs( - Expression Function($$BudgetsTableFilterComposer f) f) { + Expression Function($$BudgetsTableFilterComposer f) f, + ) { final $$BudgetsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgets, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetsTableFilterComposer( - $db: $db, - $table: $db.budgets, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgets, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetsTableFilterComposer( + $db: $db, + $table: $db.budgets, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableFilterComposer f) - f) { + Expression Function($$TransactionTemplatesTableFilterComposer f) f, + ) { final $$TransactionTemplatesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableFilterComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableFilterComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression recurringTransactionsRefs( - Expression Function($$RecurringTransactionsTableFilterComposer f) - f) { + Expression Function($$RecurringTransactionsTableFilterComposer f) f, + ) { final $$RecurringTransactionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.recurringTransactions, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$RecurringTransactionsTableFilterComposer( - $db: $db, - $table: $db.recurringTransactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.recurringTransactions, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$RecurringTransactionsTableFilterComposer( + $db: $db, + $table: $db.recurringTransactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableFilterComposer f) f) { + Expression Function($$TransactionsTableFilterComposer f) f, + ) { final $$TransactionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableFilterComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableFilterComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -3084,10 +3610,14 @@ class $$AccountsTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); } class $$AccountsTableAnnotationComposer @@ -3106,168 +3636,190 @@ class $$AccountsTableAnnotationComposer $composableBuilder(column: $table.name, builder: (column) => column); Expression beneficiariesRefs( - Expression Function($$BeneficiariesTableAnnotationComposer a) f) { + Expression Function($$BeneficiariesTableAnnotationComposer a) f, + ) { final $$BeneficiariesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableAnnotationComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableAnnotationComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression budgetsRefs( - Expression Function($$BudgetsTableAnnotationComposer a) f) { + Expression Function($$BudgetsTableAnnotationComposer a) f, + ) { final $$BudgetsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgets, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetsTableAnnotationComposer( - $db: $db, - $table: $db.budgets, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgets, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetsTableAnnotationComposer( + $db: $db, + $table: $db.budgets, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableAnnotationComposer a) - f) { + Expression Function($$TransactionTemplatesTableAnnotationComposer a) f, + ) { final $$TransactionTemplatesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableAnnotationComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableAnnotationComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression recurringTransactionsRefs( - Expression Function($$RecurringTransactionsTableAnnotationComposer a) - f) { + Expression Function($$RecurringTransactionsTableAnnotationComposer a) f, + ) { final $$RecurringTransactionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.recurringTransactions, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$RecurringTransactionsTableAnnotationComposer( - $db: $db, - $table: $db.recurringTransactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.recurringTransactions, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$RecurringTransactionsTableAnnotationComposer( + $db: $db, + $table: $db.recurringTransactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableAnnotationComposer a) f) { + Expression Function($$TransactionsTableAnnotationComposer a) f, + ) { final $$TransactionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.accountId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableAnnotationComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.accountId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableAnnotationComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$AccountsTableTableManager extends RootTableManager< - _$OkaneDatabase, - $AccountsTable, - Account, - $$AccountsTableFilterComposer, - $$AccountsTableOrderingComposer, - $$AccountsTableAnnotationComposer, - $$AccountsTableCreateCompanionBuilder, - $$AccountsTableUpdateCompanionBuilder, - (Account, $$AccountsTableReferences), - Account, - PrefetchHooks Function( - {bool beneficiariesRefs, - bool budgetsRefs, - bool transactionTemplatesRefs, - bool recurringTransactionsRefs, - bool transactionsRefs})> { +class $$AccountsTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $AccountsTable, + Account, + $$AccountsTableFilterComposer, + $$AccountsTableOrderingComposer, + $$AccountsTableAnnotationComposer, + $$AccountsTableCreateCompanionBuilder, + $$AccountsTableUpdateCompanionBuilder, + (Account, $$AccountsTableReferences), + Account, + PrefetchHooks Function({ + bool beneficiariesRefs, + bool budgetsRefs, + bool transactionTemplatesRefs, + bool recurringTransactionsRefs, + bool transactionsRefs, + }) + > { $$AccountsTableTableManager(_$OkaneDatabase db, $AccountsTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$AccountsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$AccountsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$AccountsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - }) => - AccountsCompanion( - id: id, - name: name, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required String name, - }) => - AccountsCompanion.insert( - id: id, - name: name, - ), - withReferenceMapper: (p0) => p0 - .map((e) => - (e.readTable(table), $$AccountsTableReferences(db, table, e))) - .toList(), - prefetchHooksCallback: ( - {beneficiariesRefs = false, - budgetsRefs = false, - transactionTemplatesRefs = false, - recurringTransactionsRefs = false, - transactionsRefs = false}) { + createFilteringComposer: + () => $$AccountsTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$AccountsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => $$AccountsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value name = const Value.absent(), + }) => AccountsCompanion(id: id, name: name), + createCompanionCallback: + ({Value id = const Value.absent(), required String name}) => + AccountsCompanion.insert(id: id, name: name), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$AccountsTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + beneficiariesRefs = false, + budgetsRefs = false, + transactionTemplatesRefs = false, + recurringTransactionsRefs = false, + transactionsRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ @@ -3275,183 +3827,258 @@ class $$AccountsTableTableManager extends RootTableManager< if (budgetsRefs) db.budgets, if (transactionTemplatesRefs) db.transactionTemplates, if (recurringTransactionsRefs) db.recurringTransactions, - if (transactionsRefs) db.transactions + if (transactionsRefs) db.transactions, ], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (beneficiariesRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$AccountsTableReferences - ._beneficiariesRefsTable(db), - managerFromTypedResult: (p0) => - $$AccountsTableReferences(db, table, p0) - .beneficiariesRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.accountId == item.id), - typedResults: items), + await $_getPrefetchedData< + Account, + $AccountsTable, + Beneficiary + >( + currentTable: table, + referencedTable: $$AccountsTableReferences + ._beneficiariesRefsTable(db), + managerFromTypedResult: + (p0) => + $$AccountsTableReferences( + db, + table, + p0, + ).beneficiariesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.accountId == item.id, + ), + typedResults: items, + ), if (budgetsRefs) await $_getPrefetchedData( - currentTable: table, - referencedTable: - $$AccountsTableReferences._budgetsRefsTable(db), - managerFromTypedResult: (p0) => - $$AccountsTableReferences(db, table, p0) - .budgetsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.accountId == item.id), - typedResults: items), + currentTable: table, + referencedTable: $$AccountsTableReferences + ._budgetsRefsTable(db), + managerFromTypedResult: + (p0) => + $$AccountsTableReferences( + db, + table, + p0, + ).budgetsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.accountId == item.id, + ), + typedResults: items, + ), if (transactionTemplatesRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$AccountsTableReferences - ._transactionTemplatesRefsTable(db), - managerFromTypedResult: (p0) => - $$AccountsTableReferences(db, table, p0) - .transactionTemplatesRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.accountId == item.id), - typedResults: items), + await $_getPrefetchedData< + Account, + $AccountsTable, + TransactionTemplate + >( + currentTable: table, + referencedTable: $$AccountsTableReferences + ._transactionTemplatesRefsTable(db), + managerFromTypedResult: + (p0) => + $$AccountsTableReferences( + db, + table, + p0, + ).transactionTemplatesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.accountId == item.id, + ), + typedResults: items, + ), if (recurringTransactionsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$AccountsTableReferences - ._recurringTransactionsRefsTable(db), - managerFromTypedResult: (p0) => - $$AccountsTableReferences(db, table, p0) - .recurringTransactionsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.accountId == item.id), - typedResults: items), + await $_getPrefetchedData< + Account, + $AccountsTable, + RecurringTransaction + >( + currentTable: table, + referencedTable: $$AccountsTableReferences + ._recurringTransactionsRefsTable(db), + managerFromTypedResult: + (p0) => + $$AccountsTableReferences( + db, + table, + p0, + ).recurringTransactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.accountId == item.id, + ), + typedResults: items, + ), if (transactionsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$AccountsTableReferences - ._transactionsRefsTable(db), - managerFromTypedResult: (p0) => - $$AccountsTableReferences(db, table, p0) - .transactionsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.accountId == item.id), - typedResults: items) + await $_getPrefetchedData< + Account, + $AccountsTable, + Transaction + >( + currentTable: table, + referencedTable: $$AccountsTableReferences + ._transactionsRefsTable(db), + managerFromTypedResult: + (p0) => + $$AccountsTableReferences( + db, + table, + p0, + ).transactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.accountId == item.id, + ), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$AccountsTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $AccountsTable, - Account, - $$AccountsTableFilterComposer, - $$AccountsTableOrderingComposer, - $$AccountsTableAnnotationComposer, - $$AccountsTableCreateCompanionBuilder, - $$AccountsTableUpdateCompanionBuilder, - (Account, $$AccountsTableReferences), - Account, - PrefetchHooks Function( - {bool beneficiariesRefs, +typedef $$AccountsTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $AccountsTable, + Account, + $$AccountsTableFilterComposer, + $$AccountsTableOrderingComposer, + $$AccountsTableAnnotationComposer, + $$AccountsTableCreateCompanionBuilder, + $$AccountsTableUpdateCompanionBuilder, + (Account, $$AccountsTableReferences), + Account, + PrefetchHooks Function({ + bool beneficiariesRefs, bool budgetsRefs, bool transactionTemplatesRefs, bool recurringTransactionsRefs, - bool transactionsRefs})>; -typedef $$BeneficiariesTableCreateCompanionBuilder = BeneficiariesCompanion - Function({ - Value id, - required String name, - required BeneficiaryType type, - Value accountId, - Value imagePath, -}); -typedef $$BeneficiariesTableUpdateCompanionBuilder = BeneficiariesCompanion - Function({ - Value id, - Value name, - Value type, - Value accountId, - Value imagePath, -}); + bool transactionsRefs, + }) + >; +typedef $$BeneficiariesTableCreateCompanionBuilder = + BeneficiariesCompanion Function({ + Value id, + required String name, + required BeneficiaryType type, + Value accountId, + Value imagePath, + }); +typedef $$BeneficiariesTableUpdateCompanionBuilder = + BeneficiariesCompanion Function({ + Value id, + Value name, + Value type, + Value accountId, + Value imagePath, + }); final class $$BeneficiariesTableReferences extends BaseReferences<_$OkaneDatabase, $BeneficiariesTable, Beneficiary> { $$BeneficiariesTableReferences( - super.$_db, super.$_table, super.$_typedResult); + super.$_db, + super.$_table, + super.$_typedResult, + ); static $AccountsTable _accountIdTable(_$OkaneDatabase db) => db.accounts.createAlias( - $_aliasNameGenerator(db.beneficiaries.accountId, db.accounts.id)); + $_aliasNameGenerator(db.beneficiaries.accountId, db.accounts.id), + ); $$AccountsTableProcessedTableManager? get accountId { final $_column = $_itemColumn('account_id'); if ($_column == null) return null; - final manager = $$AccountsTableTableManager($_db, $_db.accounts) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$AccountsTableTableManager( + $_db, + $_db.accounts, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_accountIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static MultiTypedResultKey<$LoansTable, List> _loansRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.loans, - aliasName: $_aliasNameGenerator( - db.beneficiaries.id, db.loans.beneficiaryId)); + _$OkaneDatabase db, + ) => MultiTypedResultKey.fromTable( + db.loans, + aliasName: $_aliasNameGenerator( + db.beneficiaries.id, + db.loans.beneficiaryId, + ), + ); $$LoansTableProcessedTableManager get loansRefs { - final manager = $$LoansTableTableManager($_db, $_db.loans) - .filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$LoansTableTableManager( + $_db, + $_db.loans, + ).filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_loansRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } - static MultiTypedResultKey<$TransactionTemplatesTable, - List> _transactionTemplatesRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactionTemplates, - aliasName: $_aliasNameGenerator( - db.beneficiaries.id, db.transactionTemplates.beneficiaryId)); + static MultiTypedResultKey< + $TransactionTemplatesTable, + List + > + _transactionTemplatesRefsTable(_$OkaneDatabase db) => + MultiTypedResultKey.fromTable( + db.transactionTemplates, + aliasName: $_aliasNameGenerator( + db.beneficiaries.id, + db.transactionTemplates.beneficiaryId, + ), + ); $$TransactionTemplatesTableProcessedTableManager - get transactionTemplatesRefs { + get transactionTemplatesRefs { final manager = $$TransactionTemplatesTableTableManager( - $_db, $_db.transactionTemplates) - .filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); + $_db, + $_db.transactionTemplates, + ).filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); - final cache = - $_typedResult.readTableOrNull(_transactionTemplatesRefsTable($_db)); + final cache = $_typedResult.readTableOrNull( + _transactionTemplatesRefsTable($_db), + ); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } static MultiTypedResultKey<$TransactionsTable, List> - _transactionsRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactions, - aliasName: $_aliasNameGenerator( - db.beneficiaries.id, db.transactions.beneficiaryId)); + _transactionsRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.transactions, + aliasName: $_aliasNameGenerator( + db.beneficiaries.id, + db.transactions.beneficiaryId, + ), + ); $$TransactionsTableProcessedTableManager get transactionsRefs { - final manager = $$TransactionsTableTableManager($_db, $_db.transactions) - .filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$TransactionsTableTableManager( + $_db, + $_db.transactions, + ).filter((f) => f.beneficiaryId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_transactionsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -3465,100 +4092,121 @@ class $$BeneficiariesTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); ColumnWithTypeConverterFilters - get type => $composableBuilder( - column: $table.type, - builder: (column) => ColumnWithTypeConverterFilters(column)); + get type => $composableBuilder( + column: $table.type, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); ColumnFilters get imagePath => $composableBuilder( - column: $table.imagePath, builder: (column) => ColumnFilters(column)); + column: $table.imagePath, + builder: (column) => ColumnFilters(column), + ); $$AccountsTableFilterComposer get accountId { final $$AccountsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableFilterComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableFilterComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression loansRefs( - Expression Function($$LoansTableFilterComposer f) f) { + Expression Function($$LoansTableFilterComposer f) f, + ) { final $$LoansTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.loans, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoansTableFilterComposer( - $db: $db, - $table: $db.loans, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.loans, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoansTableFilterComposer( + $db: $db, + $table: $db.loans, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableFilterComposer f) - f) { + Expression Function($$TransactionTemplatesTableFilterComposer f) f, + ) { final $$TransactionTemplatesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableFilterComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableFilterComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableFilterComposer f) f) { + Expression Function($$TransactionsTableFilterComposer f) f, + ) { final $$TransactionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableFilterComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableFilterComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -3573,34 +4221,45 @@ class $$BeneficiariesTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get type => $composableBuilder( - column: $table.type, builder: (column) => ColumnOrderings(column)); + column: $table.type, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get imagePath => $composableBuilder( - column: $table.imagePath, builder: (column) => ColumnOrderings(column)); + column: $table.imagePath, + builder: (column) => ColumnOrderings(column), + ); $$AccountsTableOrderingComposer get accountId { final $$AccountsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableOrderingComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableOrderingComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -3628,185 +4287,220 @@ class $$BeneficiariesTableAnnotationComposer $$AccountsTableAnnotationComposer get accountId { final $$AccountsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableAnnotationComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableAnnotationComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression loansRefs( - Expression Function($$LoansTableAnnotationComposer a) f) { + Expression Function($$LoansTableAnnotationComposer a) f, + ) { final $$LoansTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.loans, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoansTableAnnotationComposer( - $db: $db, - $table: $db.loans, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.loans, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoansTableAnnotationComposer( + $db: $db, + $table: $db.loans, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableAnnotationComposer a) - f) { + Expression Function($$TransactionTemplatesTableAnnotationComposer a) f, + ) { final $$TransactionTemplatesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableAnnotationComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableAnnotationComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableAnnotationComposer a) f) { + Expression Function($$TransactionsTableAnnotationComposer a) f, + ) { final $$TransactionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.beneficiaryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableAnnotationComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.beneficiaryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableAnnotationComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$BeneficiariesTableTableManager extends RootTableManager< - _$OkaneDatabase, - $BeneficiariesTable, - Beneficiary, - $$BeneficiariesTableFilterComposer, - $$BeneficiariesTableOrderingComposer, - $$BeneficiariesTableAnnotationComposer, - $$BeneficiariesTableCreateCompanionBuilder, - $$BeneficiariesTableUpdateCompanionBuilder, - (Beneficiary, $$BeneficiariesTableReferences), - Beneficiary, - PrefetchHooks Function( - {bool accountId, - bool loansRefs, - bool transactionTemplatesRefs, - bool transactionsRefs})> { +class $$BeneficiariesTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $BeneficiariesTable, + Beneficiary, + $$BeneficiariesTableFilterComposer, + $$BeneficiariesTableOrderingComposer, + $$BeneficiariesTableAnnotationComposer, + $$BeneficiariesTableCreateCompanionBuilder, + $$BeneficiariesTableUpdateCompanionBuilder, + (Beneficiary, $$BeneficiariesTableReferences), + Beneficiary, + PrefetchHooks Function({ + bool accountId, + bool loansRefs, + bool transactionTemplatesRefs, + bool transactionsRefs, + }) + > { $$BeneficiariesTableTableManager( - _$OkaneDatabase db, $BeneficiariesTable table) - : super(TableManagerState( + _$OkaneDatabase db, + $BeneficiariesTable table, + ) : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$BeneficiariesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$BeneficiariesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$BeneficiariesTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value type = const Value.absent(), - Value accountId = const Value.absent(), - Value imagePath = const Value.absent(), - }) => - BeneficiariesCompanion( - id: id, - name: name, - type: type, - accountId: accountId, - imagePath: imagePath, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required String name, - required BeneficiaryType type, - Value accountId = const Value.absent(), - Value imagePath = const Value.absent(), - }) => - BeneficiariesCompanion.insert( - id: id, - name: name, - type: type, - accountId: accountId, - imagePath: imagePath, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$BeneficiariesTableReferences(db, table, e) - )) - .toList(), - prefetchHooksCallback: ( - {accountId = false, - loansRefs = false, - transactionTemplatesRefs = false, - transactionsRefs = false}) { + createFilteringComposer: + () => $$BeneficiariesTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => + $$BeneficiariesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => $$BeneficiariesTableAnnotationComposer( + $db: db, + $table: table, + ), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value name = const Value.absent(), + Value type = const Value.absent(), + Value accountId = const Value.absent(), + Value imagePath = const Value.absent(), + }) => BeneficiariesCompanion( + id: id, + name: name, + type: type, + accountId: accountId, + imagePath: imagePath, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required String name, + required BeneficiaryType type, + Value accountId = const Value.absent(), + Value imagePath = const Value.absent(), + }) => BeneficiariesCompanion.insert( + id: id, + name: name, + type: type, + accountId: accountId, + imagePath: imagePath, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$BeneficiariesTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + accountId = false, + loansRefs = false, + transactionTemplatesRefs = false, + transactionsRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (loansRefs) db.loans, if (transactionTemplatesRefs) db.transactionTemplates, - if (transactionsRefs) db.transactions + if (transactionsRefs) db.transactions, ], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (accountId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.accountId, - referencedTable: - $$BeneficiariesTableReferences._accountIdTable(db), - referencedColumn: - $$BeneficiariesTableReferences._accountIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.accountId, + referencedTable: $$BeneficiariesTableReferences + ._accountIdTable(db), + referencedColumn: + $$BeneficiariesTableReferences + ._accountIdTable(db) + .id, + ) + as T; } return state; @@ -3814,83 +4508,116 @@ class $$BeneficiariesTableTableManager extends RootTableManager< getPrefetchedDataCallback: (items) async { return [ if (loansRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: - $$BeneficiariesTableReferences._loansRefsTable(db), - managerFromTypedResult: (p0) => - $$BeneficiariesTableReferences(db, table, p0) - .loansRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.beneficiaryId == item.id), - typedResults: items), + await $_getPrefetchedData< + Beneficiary, + $BeneficiariesTable, + Loan + >( + currentTable: table, + referencedTable: $$BeneficiariesTableReferences + ._loansRefsTable(db), + managerFromTypedResult: + (p0) => + $$BeneficiariesTableReferences( + db, + table, + p0, + ).loansRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.beneficiaryId == item.id, + ), + typedResults: items, + ), if (transactionTemplatesRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$BeneficiariesTableReferences - ._transactionTemplatesRefsTable(db), - managerFromTypedResult: (p0) => - $$BeneficiariesTableReferences(db, table, p0) - .transactionTemplatesRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.beneficiaryId == item.id), - typedResults: items), + await $_getPrefetchedData< + Beneficiary, + $BeneficiariesTable, + TransactionTemplate + >( + currentTable: table, + referencedTable: $$BeneficiariesTableReferences + ._transactionTemplatesRefsTable(db), + managerFromTypedResult: + (p0) => + $$BeneficiariesTableReferences( + db, + table, + p0, + ).transactionTemplatesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.beneficiaryId == item.id, + ), + typedResults: items, + ), if (transactionsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$BeneficiariesTableReferences - ._transactionsRefsTable(db), - managerFromTypedResult: (p0) => - $$BeneficiariesTableReferences(db, table, p0) - .transactionsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.beneficiaryId == item.id), - typedResults: items) + await $_getPrefetchedData< + Beneficiary, + $BeneficiariesTable, + Transaction + >( + currentTable: table, + referencedTable: $$BeneficiariesTableReferences + ._transactionsRefsTable(db), + managerFromTypedResult: + (p0) => + $$BeneficiariesTableReferences( + db, + table, + p0, + ).transactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.beneficiaryId == item.id, + ), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$BeneficiariesTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $BeneficiariesTable, - Beneficiary, - $$BeneficiariesTableFilterComposer, - $$BeneficiariesTableOrderingComposer, - $$BeneficiariesTableAnnotationComposer, - $$BeneficiariesTableCreateCompanionBuilder, - $$BeneficiariesTableUpdateCompanionBuilder, - (Beneficiary, $$BeneficiariesTableReferences), - Beneficiary, - PrefetchHooks Function( - {bool accountId, +typedef $$BeneficiariesTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $BeneficiariesTable, + Beneficiary, + $$BeneficiariesTableFilterComposer, + $$BeneficiariesTableOrderingComposer, + $$BeneficiariesTableAnnotationComposer, + $$BeneficiariesTableCreateCompanionBuilder, + $$BeneficiariesTableUpdateCompanionBuilder, + (Beneficiary, $$BeneficiariesTableReferences), + Beneficiary, + PrefetchHooks Function({ + bool accountId, bool loansRefs, bool transactionTemplatesRefs, - bool transactionsRefs})>; -typedef $$BudgetsTableCreateCompanionBuilder = BudgetsCompanion Function({ - Value id, - required BudgetPeriod period, - required String name, - required double income, - required bool includeOtherSpendings, - required int accountId, -}); -typedef $$BudgetsTableUpdateCompanionBuilder = BudgetsCompanion Function({ - Value id, - Value period, - Value name, - Value income, - Value includeOtherSpendings, - Value accountId, -}); + bool transactionsRefs, + }) + >; +typedef $$BudgetsTableCreateCompanionBuilder = + BudgetsCompanion Function({ + Value id, + required BudgetPeriod period, + required String name, + required double income, + required bool includeOtherSpendings, + required int accountId, + }); +typedef $$BudgetsTableUpdateCompanionBuilder = + BudgetsCompanion Function({ + Value id, + Value period, + Value name, + Value income, + Value includeOtherSpendings, + Value accountId, + }); final class $$BudgetsTableReferences extends BaseReferences<_$OkaneDatabase, $BudgetsTable, Budget> { @@ -3902,27 +4629,33 @@ final class $$BudgetsTableReferences $$AccountsTableProcessedTableManager get accountId { final $_column = $_itemColumn('account_id')!; - final manager = $$AccountsTableTableManager($_db, $_db.accounts) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$AccountsTableTableManager( + $_db, + $_db.accounts, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_accountIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static MultiTypedResultKey<$BudgetItemsTable, List> - _budgetItemsRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.budgetItems, - aliasName: - $_aliasNameGenerator(db.budgets.id, db.budgetItems.budgetId)); + _budgetItemsRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.budgetItems, + aliasName: $_aliasNameGenerator(db.budgets.id, db.budgetItems.budgetId), + ); $$BudgetItemsTableProcessedTableManager get budgetItemsRefs { - final manager = $$BudgetItemsTableTableManager($_db, $_db.budgetItems) - .filter((f) => f.budgetId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$BudgetItemsTableTableManager( + $_db, + $_db.budgetItems, + ).filter((f) => f.budgetId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_budgetItemsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -3936,61 +4669,76 @@ class $$BudgetsTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnWithTypeConverterFilters - get period => $composableBuilder( - column: $table.period, - builder: (column) => ColumnWithTypeConverterFilters(column)); + get period => $composableBuilder( + column: $table.period, + builder: (column) => ColumnWithTypeConverterFilters(column), + ); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get income => $composableBuilder( - column: $table.income, builder: (column) => ColumnFilters(column)); + column: $table.income, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get includeOtherSpendings => $composableBuilder( - column: $table.includeOtherSpendings, - builder: (column) => ColumnFilters(column)); + column: $table.includeOtherSpendings, + builder: (column) => ColumnFilters(column), + ); $$AccountsTableFilterComposer get accountId { final $$AccountsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableFilterComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableFilterComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression budgetItemsRefs( - Expression Function($$BudgetItemsTableFilterComposer f) f) { + Expression Function($$BudgetItemsTableFilterComposer f) f, + ) { final $$BudgetItemsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgetItems, - getReferencedColumn: (t) => t.budgetId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetItemsTableFilterComposer( - $db: $db, - $table: $db.budgetItems, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgetItems, + getReferencedColumn: (t) => t.budgetId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetItemsTableFilterComposer( + $db: $db, + $table: $db.budgetItems, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -4005,38 +4753,50 @@ class $$BudgetsTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get period => $composableBuilder( - column: $table.period, builder: (column) => ColumnOrderings(column)); + column: $table.period, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get income => $composableBuilder( - column: $table.income, builder: (column) => ColumnOrderings(column)); + column: $table.income, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get includeOtherSpendings => $composableBuilder( - column: $table.includeOtherSpendings, - builder: (column) => ColumnOrderings(column)); + column: $table.includeOtherSpendings, + builder: (column) => ColumnOrderings(column), + ); $$AccountsTableOrderingComposer get accountId { final $$AccountsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableOrderingComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableOrderingComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -4063,135 +4823,160 @@ class $$BudgetsTableAnnotationComposer $composableBuilder(column: $table.income, builder: (column) => column); GeneratedColumn get includeOtherSpendings => $composableBuilder( - column: $table.includeOtherSpendings, builder: (column) => column); + column: $table.includeOtherSpendings, + builder: (column) => column, + ); $$AccountsTableAnnotationComposer get accountId { final $$AccountsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableAnnotationComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableAnnotationComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression budgetItemsRefs( - Expression Function($$BudgetItemsTableAnnotationComposer a) f) { + Expression Function($$BudgetItemsTableAnnotationComposer a) f, + ) { final $$BudgetItemsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgetItems, - getReferencedColumn: (t) => t.budgetId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetItemsTableAnnotationComposer( - $db: $db, - $table: $db.budgetItems, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgetItems, + getReferencedColumn: (t) => t.budgetId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetItemsTableAnnotationComposer( + $db: $db, + $table: $db.budgetItems, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$BudgetsTableTableManager extends RootTableManager< - _$OkaneDatabase, - $BudgetsTable, - Budget, - $$BudgetsTableFilterComposer, - $$BudgetsTableOrderingComposer, - $$BudgetsTableAnnotationComposer, - $$BudgetsTableCreateCompanionBuilder, - $$BudgetsTableUpdateCompanionBuilder, - (Budget, $$BudgetsTableReferences), - Budget, - PrefetchHooks Function({bool accountId, bool budgetItemsRefs})> { +class $$BudgetsTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $BudgetsTable, + Budget, + $$BudgetsTableFilterComposer, + $$BudgetsTableOrderingComposer, + $$BudgetsTableAnnotationComposer, + $$BudgetsTableCreateCompanionBuilder, + $$BudgetsTableUpdateCompanionBuilder, + (Budget, $$BudgetsTableReferences), + Budget, + PrefetchHooks Function({bool accountId, bool budgetItemsRefs}) + > { $$BudgetsTableTableManager(_$OkaneDatabase db, $BudgetsTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$BudgetsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$BudgetsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$BudgetsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value period = const Value.absent(), - Value name = const Value.absent(), - Value income = const Value.absent(), - Value includeOtherSpendings = const Value.absent(), - Value accountId = const Value.absent(), - }) => - BudgetsCompanion( - id: id, - period: period, - name: name, - income: income, - includeOtherSpendings: includeOtherSpendings, - accountId: accountId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required BudgetPeriod period, - required String name, - required double income, - required bool includeOtherSpendings, - required int accountId, - }) => - BudgetsCompanion.insert( - id: id, - period: period, - name: name, - income: income, - includeOtherSpendings: includeOtherSpendings, - accountId: accountId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => - (e.readTable(table), $$BudgetsTableReferences(db, table, e))) - .toList(), - prefetchHooksCallback: ( - {accountId = false, budgetItemsRefs = false}) { + createFilteringComposer: + () => $$BudgetsTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$BudgetsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => $$BudgetsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value period = const Value.absent(), + Value name = const Value.absent(), + Value income = const Value.absent(), + Value includeOtherSpendings = const Value.absent(), + Value accountId = const Value.absent(), + }) => BudgetsCompanion( + id: id, + period: period, + name: name, + income: income, + includeOtherSpendings: includeOtherSpendings, + accountId: accountId, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required BudgetPeriod period, + required String name, + required double income, + required bool includeOtherSpendings, + required int accountId, + }) => BudgetsCompanion.insert( + id: id, + period: period, + name: name, + income: income, + includeOtherSpendings: includeOtherSpendings, + accountId: accountId, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$BudgetsTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + accountId = false, + budgetItemsRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (budgetItemsRefs) db.budgetItems], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (accountId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.accountId, - referencedTable: - $$BudgetsTableReferences._accountIdTable(db), - referencedColumn: - $$BudgetsTableReferences._accountIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.accountId, + referencedTable: $$BudgetsTableReferences + ._accountIdTable(db), + referencedColumn: + $$BudgetsTableReferences._accountIdTable(db).id, + ) + as T; } return state; @@ -4199,103 +4984,135 @@ class $$BudgetsTableTableManager extends RootTableManager< getPrefetchedDataCallback: (items) async { return [ if (budgetItemsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: - $$BudgetsTableReferences._budgetItemsRefsTable(db), - managerFromTypedResult: (p0) => - $$BudgetsTableReferences(db, table, p0) - .budgetItemsRefs, - referencedItemsForCurrentItem: (item, - referencedItems) => - referencedItems.where((e) => e.budgetId == item.id), - typedResults: items) + await $_getPrefetchedData< + Budget, + $BudgetsTable, + BudgetItem + >( + currentTable: table, + referencedTable: $$BudgetsTableReferences + ._budgetItemsRefsTable(db), + managerFromTypedResult: + (p0) => + $$BudgetsTableReferences( + db, + table, + p0, + ).budgetItemsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.budgetId == item.id, + ), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$BudgetsTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $BudgetsTable, - Budget, - $$BudgetsTableFilterComposer, - $$BudgetsTableOrderingComposer, - $$BudgetsTableAnnotationComposer, - $$BudgetsTableCreateCompanionBuilder, - $$BudgetsTableUpdateCompanionBuilder, - (Budget, $$BudgetsTableReferences), - Budget, - PrefetchHooks Function({bool accountId, bool budgetItemsRefs})>; -typedef $$ExpenseCategoriesTableCreateCompanionBuilder - = ExpenseCategoriesCompanion Function({ - Value id, - required String name, -}); -typedef $$ExpenseCategoriesTableUpdateCompanionBuilder - = ExpenseCategoriesCompanion Function({ - Value id, - Value name, -}); +typedef $$BudgetsTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $BudgetsTable, + Budget, + $$BudgetsTableFilterComposer, + $$BudgetsTableOrderingComposer, + $$BudgetsTableAnnotationComposer, + $$BudgetsTableCreateCompanionBuilder, + $$BudgetsTableUpdateCompanionBuilder, + (Budget, $$BudgetsTableReferences), + Budget, + PrefetchHooks Function({bool accountId, bool budgetItemsRefs}) + >; +typedef $$ExpenseCategoriesTableCreateCompanionBuilder = + ExpenseCategoriesCompanion Function({Value id, required String name}); +typedef $$ExpenseCategoriesTableUpdateCompanionBuilder = + ExpenseCategoriesCompanion Function({Value id, Value name}); -final class $$ExpenseCategoriesTableReferences extends BaseReferences< - _$OkaneDatabase, $ExpenseCategoriesTable, ExpenseCategory> { +final class $$ExpenseCategoriesTableReferences + extends + BaseReferences< + _$OkaneDatabase, + $ExpenseCategoriesTable, + ExpenseCategory + > { $$ExpenseCategoriesTableReferences( - super.$_db, super.$_table, super.$_typedResult); + super.$_db, + super.$_table, + super.$_typedResult, + ); static MultiTypedResultKey<$BudgetItemsTable, List> - _budgetItemsRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.budgetItems, - aliasName: $_aliasNameGenerator( - db.expenseCategories.id, db.budgetItems.expenseCategoryId)); + _budgetItemsRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.budgetItems, + aliasName: $_aliasNameGenerator( + db.expenseCategories.id, + db.budgetItems.expenseCategoryId, + ), + ); $$BudgetItemsTableProcessedTableManager get budgetItemsRefs { - final manager = $$BudgetItemsTableTableManager($_db, $_db.budgetItems) - .filter( - (f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$BudgetItemsTableTableManager( + $_db, + $_db.budgetItems, + ).filter((f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_budgetItemsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } - static MultiTypedResultKey<$TransactionTemplatesTable, - List> _transactionTemplatesRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactionTemplates, - aliasName: $_aliasNameGenerator(db.expenseCategories.id, - db.transactionTemplates.expenseCategoryId)); + static MultiTypedResultKey< + $TransactionTemplatesTable, + List + > + _transactionTemplatesRefsTable(_$OkaneDatabase db) => + MultiTypedResultKey.fromTable( + db.transactionTemplates, + aliasName: $_aliasNameGenerator( + db.expenseCategories.id, + db.transactionTemplates.expenseCategoryId, + ), + ); $$TransactionTemplatesTableProcessedTableManager - get transactionTemplatesRefs { + get transactionTemplatesRefs { final manager = $$TransactionTemplatesTableTableManager( - $_db, $_db.transactionTemplates) - .filter( - (f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); + $_db, + $_db.transactionTemplates, + ).filter((f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); - final cache = - $_typedResult.readTableOrNull(_transactionTemplatesRefsTable($_db)); + final cache = $_typedResult.readTableOrNull( + _transactionTemplatesRefsTable($_db), + ); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } static MultiTypedResultKey<$TransactionsTable, List> - _transactionsRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.transactions, - aliasName: $_aliasNameGenerator( - db.expenseCategories.id, db.transactions.expenseCategoryId)); + _transactionsRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.transactions, + aliasName: $_aliasNameGenerator( + db.expenseCategories.id, + db.transactions.expenseCategoryId, + ), + ); $$TransactionsTableProcessedTableManager get transactionsRefs { - final manager = $$TransactionsTableTableManager($_db, $_db.transactions) - .filter( - (f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$TransactionsTableTableManager( + $_db, + $_db.transactions, + ).filter((f) => f.expenseCategoryId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_transactionsRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -4309,72 +5126,87 @@ class $$ExpenseCategoriesTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); Expression budgetItemsRefs( - Expression Function($$BudgetItemsTableFilterComposer f) f) { + Expression Function($$BudgetItemsTableFilterComposer f) f, + ) { final $$BudgetItemsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgetItems, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetItemsTableFilterComposer( - $db: $db, - $table: $db.budgetItems, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgetItems, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetItemsTableFilterComposer( + $db: $db, + $table: $db.budgetItems, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableFilterComposer f) - f) { + Expression Function($$TransactionTemplatesTableFilterComposer f) f, + ) { final $$TransactionTemplatesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableFilterComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableFilterComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableFilterComposer f) f) { + Expression Function($$TransactionsTableFilterComposer f) f, + ) { final $$TransactionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableFilterComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableFilterComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -4389,10 +5221,14 @@ class $$ExpenseCategoriesTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); } class $$ExpenseCategoriesTableAnnotationComposer @@ -4411,243 +5247,306 @@ class $$ExpenseCategoriesTableAnnotationComposer $composableBuilder(column: $table.name, builder: (column) => column); Expression budgetItemsRefs( - Expression Function($$BudgetItemsTableAnnotationComposer a) f) { + Expression Function($$BudgetItemsTableAnnotationComposer a) f, + ) { final $$BudgetItemsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.budgetItems, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetItemsTableAnnotationComposer( - $db: $db, - $table: $db.budgetItems, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.budgetItems, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetItemsTableAnnotationComposer( + $db: $db, + $table: $db.budgetItems, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionTemplatesRefs( - Expression Function($$TransactionTemplatesTableAnnotationComposer a) - f) { + Expression Function($$TransactionTemplatesTableAnnotationComposer a) f, + ) { final $$TransactionTemplatesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableAnnotationComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableAnnotationComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } Expression transactionsRefs( - Expression Function($$TransactionsTableAnnotationComposer a) f) { + Expression Function($$TransactionsTableAnnotationComposer a) f, + ) { final $$TransactionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.transactions, - getReferencedColumn: (t) => t.expenseCategoryId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionsTableAnnotationComposer( - $db: $db, - $table: $db.transactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.transactions, + getReferencedColumn: (t) => t.expenseCategoryId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionsTableAnnotationComposer( + $db: $db, + $table: $db.transactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$ExpenseCategoriesTableTableManager extends RootTableManager< - _$OkaneDatabase, - $ExpenseCategoriesTable, - ExpenseCategory, - $$ExpenseCategoriesTableFilterComposer, - $$ExpenseCategoriesTableOrderingComposer, - $$ExpenseCategoriesTableAnnotationComposer, - $$ExpenseCategoriesTableCreateCompanionBuilder, - $$ExpenseCategoriesTableUpdateCompanionBuilder, - (ExpenseCategory, $$ExpenseCategoriesTableReferences), - ExpenseCategory, - PrefetchHooks Function( - {bool budgetItemsRefs, - bool transactionTemplatesRefs, - bool transactionsRefs})> { +class $$ExpenseCategoriesTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $ExpenseCategoriesTable, + ExpenseCategory, + $$ExpenseCategoriesTableFilterComposer, + $$ExpenseCategoriesTableOrderingComposer, + $$ExpenseCategoriesTableAnnotationComposer, + $$ExpenseCategoriesTableCreateCompanionBuilder, + $$ExpenseCategoriesTableUpdateCompanionBuilder, + (ExpenseCategory, $$ExpenseCategoriesTableReferences), + ExpenseCategory, + PrefetchHooks Function({ + bool budgetItemsRefs, + bool transactionTemplatesRefs, + bool transactionsRefs, + }) + > { $$ExpenseCategoriesTableTableManager( - _$OkaneDatabase db, $ExpenseCategoriesTable table) - : super(TableManagerState( + _$OkaneDatabase db, + $ExpenseCategoriesTable table, + ) : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$ExpenseCategoriesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ExpenseCategoriesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ExpenseCategoriesTableAnnotationComposer( - $db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - }) => - ExpenseCategoriesCompanion( - id: id, - name: name, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required String name, - }) => - ExpenseCategoriesCompanion.insert( - id: id, - name: name, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$ExpenseCategoriesTableReferences(db, table, e) - )) - .toList(), - prefetchHooksCallback: ( - {budgetItemsRefs = false, - transactionTemplatesRefs = false, - transactionsRefs = false}) { + createFilteringComposer: + () => $$ExpenseCategoriesTableFilterComposer( + $db: db, + $table: table, + ), + createOrderingComposer: + () => $$ExpenseCategoriesTableOrderingComposer( + $db: db, + $table: table, + ), + createComputedFieldComposer: + () => $$ExpenseCategoriesTableAnnotationComposer( + $db: db, + $table: table, + ), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value name = const Value.absent(), + }) => ExpenseCategoriesCompanion(id: id, name: name), + createCompanionCallback: + ({Value id = const Value.absent(), required String name}) => + ExpenseCategoriesCompanion.insert(id: id, name: name), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$ExpenseCategoriesTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + budgetItemsRefs = false, + transactionTemplatesRefs = false, + transactionsRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ if (budgetItemsRefs) db.budgetItems, if (transactionTemplatesRefs) db.transactionTemplates, - if (transactionsRefs) db.transactions + if (transactionsRefs) db.transactions, ], addJoins: null, getPrefetchedDataCallback: (items) async { return [ if (budgetItemsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$ExpenseCategoriesTableReferences - ._budgetItemsRefsTable(db), - managerFromTypedResult: (p0) => - $$ExpenseCategoriesTableReferences(db, table, p0) - .budgetItemsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.expenseCategoryId == item.id), - typedResults: items), + await $_getPrefetchedData< + ExpenseCategory, + $ExpenseCategoriesTable, + BudgetItem + >( + currentTable: table, + referencedTable: $$ExpenseCategoriesTableReferences + ._budgetItemsRefsTable(db), + managerFromTypedResult: + (p0) => + $$ExpenseCategoriesTableReferences( + db, + table, + p0, + ).budgetItemsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.expenseCategoryId == item.id, + ), + typedResults: items, + ), if (transactionTemplatesRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$ExpenseCategoriesTableReferences - ._transactionTemplatesRefsTable(db), - managerFromTypedResult: (p0) => - $$ExpenseCategoriesTableReferences(db, table, p0) - .transactionTemplatesRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.expenseCategoryId == item.id), - typedResults: items), + await $_getPrefetchedData< + ExpenseCategory, + $ExpenseCategoriesTable, + TransactionTemplate + >( + currentTable: table, + referencedTable: $$ExpenseCategoriesTableReferences + ._transactionTemplatesRefsTable(db), + managerFromTypedResult: + (p0) => + $$ExpenseCategoriesTableReferences( + db, + table, + p0, + ).transactionTemplatesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.expenseCategoryId == item.id, + ), + typedResults: items, + ), if (transactionsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$ExpenseCategoriesTableReferences - ._transactionsRefsTable(db), - managerFromTypedResult: (p0) => - $$ExpenseCategoriesTableReferences(db, table, p0) - .transactionsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.expenseCategoryId == item.id), - typedResults: items) + await $_getPrefetchedData< + ExpenseCategory, + $ExpenseCategoriesTable, + Transaction + >( + currentTable: table, + referencedTable: $$ExpenseCategoriesTableReferences + ._transactionsRefsTable(db), + managerFromTypedResult: + (p0) => + $$ExpenseCategoriesTableReferences( + db, + table, + p0, + ).transactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.expenseCategoryId == item.id, + ), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$ExpenseCategoriesTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $ExpenseCategoriesTable, - ExpenseCategory, - $$ExpenseCategoriesTableFilterComposer, - $$ExpenseCategoriesTableOrderingComposer, - $$ExpenseCategoriesTableAnnotationComposer, - $$ExpenseCategoriesTableCreateCompanionBuilder, - $$ExpenseCategoriesTableUpdateCompanionBuilder, - (ExpenseCategory, $$ExpenseCategoriesTableReferences), - ExpenseCategory, - PrefetchHooks Function( - {bool budgetItemsRefs, +typedef $$ExpenseCategoriesTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $ExpenseCategoriesTable, + ExpenseCategory, + $$ExpenseCategoriesTableFilterComposer, + $$ExpenseCategoriesTableOrderingComposer, + $$ExpenseCategoriesTableAnnotationComposer, + $$ExpenseCategoriesTableCreateCompanionBuilder, + $$ExpenseCategoriesTableUpdateCompanionBuilder, + (ExpenseCategory, $$ExpenseCategoriesTableReferences), + ExpenseCategory, + PrefetchHooks Function({ + bool budgetItemsRefs, bool transactionTemplatesRefs, - bool transactionsRefs})>; -typedef $$BudgetItemsTableCreateCompanionBuilder = BudgetItemsCompanion - Function({ - Value id, - required double amount, - required int expenseCategoryId, - required int budgetId, -}); -typedef $$BudgetItemsTableUpdateCompanionBuilder = BudgetItemsCompanion - Function({ - Value id, - Value amount, - Value expenseCategoryId, - Value budgetId, -}); + bool transactionsRefs, + }) + >; +typedef $$BudgetItemsTableCreateCompanionBuilder = + BudgetItemsCompanion Function({ + Value id, + required double amount, + required int expenseCategoryId, + required int budgetId, + }); +typedef $$BudgetItemsTableUpdateCompanionBuilder = + BudgetItemsCompanion Function({ + Value id, + Value amount, + Value expenseCategoryId, + Value budgetId, + }); final class $$BudgetItemsTableReferences extends BaseReferences<_$OkaneDatabase, $BudgetItemsTable, BudgetItem> { $$BudgetItemsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $ExpenseCategoriesTable _expenseCategoryIdTable(_$OkaneDatabase db) => - db.expenseCategories.createAlias($_aliasNameGenerator( - db.budgetItems.expenseCategoryId, db.expenseCategories.id)); + db.expenseCategories.createAlias( + $_aliasNameGenerator( + db.budgetItems.expenseCategoryId, + db.expenseCategories.id, + ), + ); $$ExpenseCategoriesTableProcessedTableManager get expenseCategoryId { final $_column = $_itemColumn('expense_category_id')!; - final manager = - $$ExpenseCategoriesTableTableManager($_db, $_db.expenseCategories) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$ExpenseCategoriesTableTableManager( + $_db, + $_db.expenseCategories, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_expenseCategoryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $BudgetsTable _budgetIdTable(_$OkaneDatabase db) => db.budgets.createAlias( - $_aliasNameGenerator(db.budgetItems.budgetId, db.budgets.id)); + $_aliasNameGenerator(db.budgetItems.budgetId, db.budgets.id), + ); $$BudgetsTableProcessedTableManager get budgetId { final $_column = $_itemColumn('budget_id')!; - final manager = $$BudgetsTableTableManager($_db, $_db.budgets) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$BudgetsTableTableManager( + $_db, + $_db.budgets, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_budgetIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } } @@ -4661,48 +5560,58 @@ class $$BudgetItemsTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnFilters(column)); + column: $table.amount, + builder: (column) => ColumnFilters(column), + ); $$ExpenseCategoriesTableFilterComposer get expenseCategoryId { final $$ExpenseCategoriesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableFilterComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableFilterComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BudgetsTableFilterComposer get budgetId { final $$BudgetsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.budgetId, - referencedTable: $db.budgets, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetsTableFilterComposer( - $db: $db, - $table: $db.budgets, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.budgetId, + referencedTable: $db.budgets, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetsTableFilterComposer( + $db: $db, + $table: $db.budgets, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -4717,48 +5626,58 @@ class $$BudgetItemsTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnOrderings(column)); + column: $table.amount, + builder: (column) => ColumnOrderings(column), + ); $$ExpenseCategoriesTableOrderingComposer get expenseCategoryId { final $$ExpenseCategoriesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableOrderingComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableOrderingComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BudgetsTableOrderingComposer get budgetId { final $$BudgetsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.budgetId, - referencedTable: $db.budgets, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetsTableOrderingComposer( - $db: $db, - $table: $db.budgets, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.budgetId, + referencedTable: $db.budgets, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetsTableOrderingComposer( + $db: $db, + $table: $db.budgets, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -4781,135 +5700,161 @@ class $$BudgetItemsTableAnnotationComposer $$ExpenseCategoriesTableAnnotationComposer get expenseCategoryId { final $$ExpenseCategoriesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableAnnotationComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableAnnotationComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BudgetsTableAnnotationComposer get budgetId { final $$BudgetsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.budgetId, - referencedTable: $db.budgets, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BudgetsTableAnnotationComposer( - $db: $db, - $table: $db.budgets, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.budgetId, + referencedTable: $db.budgets, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BudgetsTableAnnotationComposer( + $db: $db, + $table: $db.budgets, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } -class $$BudgetItemsTableTableManager extends RootTableManager< - _$OkaneDatabase, - $BudgetItemsTable, - BudgetItem, - $$BudgetItemsTableFilterComposer, - $$BudgetItemsTableOrderingComposer, - $$BudgetItemsTableAnnotationComposer, - $$BudgetItemsTableCreateCompanionBuilder, - $$BudgetItemsTableUpdateCompanionBuilder, - (BudgetItem, $$BudgetItemsTableReferences), - BudgetItem, - PrefetchHooks Function({bool expenseCategoryId, bool budgetId})> { +class $$BudgetItemsTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $BudgetItemsTable, + BudgetItem, + $$BudgetItemsTableFilterComposer, + $$BudgetItemsTableOrderingComposer, + $$BudgetItemsTableAnnotationComposer, + $$BudgetItemsTableCreateCompanionBuilder, + $$BudgetItemsTableUpdateCompanionBuilder, + (BudgetItem, $$BudgetItemsTableReferences), + BudgetItem, + PrefetchHooks Function({bool expenseCategoryId, bool budgetId}) + > { $$BudgetItemsTableTableManager(_$OkaneDatabase db, $BudgetItemsTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$BudgetItemsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$BudgetItemsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$BudgetItemsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value amount = const Value.absent(), - Value expenseCategoryId = const Value.absent(), - Value budgetId = const Value.absent(), - }) => - BudgetItemsCompanion( - id: id, - amount: amount, - expenseCategoryId: expenseCategoryId, - budgetId: budgetId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required double amount, - required int expenseCategoryId, - required int budgetId, - }) => - BudgetItemsCompanion.insert( - id: id, - amount: amount, - expenseCategoryId: expenseCategoryId, - budgetId: budgetId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$BudgetItemsTableReferences(db, table, e) - )) - .toList(), - prefetchHooksCallback: ( - {expenseCategoryId = false, budgetId = false}) { + createFilteringComposer: + () => $$BudgetItemsTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$BudgetItemsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => + $$BudgetItemsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value amount = const Value.absent(), + Value expenseCategoryId = const Value.absent(), + Value budgetId = const Value.absent(), + }) => BudgetItemsCompanion( + id: id, + amount: amount, + expenseCategoryId: expenseCategoryId, + budgetId: budgetId, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required double amount, + required int expenseCategoryId, + required int budgetId, + }) => BudgetItemsCompanion.insert( + id: id, + amount: amount, + expenseCategoryId: expenseCategoryId, + budgetId: budgetId, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$BudgetItemsTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + expenseCategoryId = false, + budgetId = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (expenseCategoryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.expenseCategoryId, - referencedTable: $$BudgetItemsTableReferences - ._expenseCategoryIdTable(db), - referencedColumn: $$BudgetItemsTableReferences - ._expenseCategoryIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.expenseCategoryId, + referencedTable: $$BudgetItemsTableReferences + ._expenseCategoryIdTable(db), + referencedColumn: + $$BudgetItemsTableReferences + ._expenseCategoryIdTable(db) + .id, + ) + as T; } if (budgetId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.budgetId, - referencedTable: - $$BudgetItemsTableReferences._budgetIdTable(db), - referencedColumn: - $$BudgetItemsTableReferences._budgetIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.budgetId, + referencedTable: $$BudgetItemsTableReferences + ._budgetIdTable(db), + referencedColumn: + $$BudgetItemsTableReferences + ._budgetIdTable(db) + .id, + ) + as T; } return state; @@ -4919,29 +5864,28 @@ class $$BudgetItemsTableTableManager extends RootTableManager< }, ); }, - )); + ), + ); } -typedef $$BudgetItemsTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $BudgetItemsTable, - BudgetItem, - $$BudgetItemsTableFilterComposer, - $$BudgetItemsTableOrderingComposer, - $$BudgetItemsTableAnnotationComposer, - $$BudgetItemsTableCreateCompanionBuilder, - $$BudgetItemsTableUpdateCompanionBuilder, - (BudgetItem, $$BudgetItemsTableReferences), - BudgetItem, - PrefetchHooks Function({bool expenseCategoryId, bool budgetId})>; -typedef $$LoansTableCreateCompanionBuilder = LoansCompanion Function({ - Value id, - required int beneficiaryId, -}); -typedef $$LoansTableUpdateCompanionBuilder = LoansCompanion Function({ - Value id, - Value beneficiaryId, -}); +typedef $$BudgetItemsTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $BudgetItemsTable, + BudgetItem, + $$BudgetItemsTableFilterComposer, + $$BudgetItemsTableOrderingComposer, + $$BudgetItemsTableAnnotationComposer, + $$BudgetItemsTableCreateCompanionBuilder, + $$BudgetItemsTableUpdateCompanionBuilder, + (BudgetItem, $$BudgetItemsTableReferences), + BudgetItem, + PrefetchHooks Function({bool expenseCategoryId, bool budgetId}) + >; +typedef $$LoansTableCreateCompanionBuilder = + LoansCompanion Function({Value id, required int beneficiaryId}); +typedef $$LoansTableUpdateCompanionBuilder = + LoansCompanion Function({Value id, Value beneficiaryId}); final class $$LoansTableReferences extends BaseReferences<_$OkaneDatabase, $LoansTable, Loan> { @@ -4949,32 +5893,39 @@ final class $$LoansTableReferences static $BeneficiariesTable _beneficiaryIdTable(_$OkaneDatabase db) => db.beneficiaries.createAlias( - $_aliasNameGenerator(db.loans.beneficiaryId, db.beneficiaries.id)); + $_aliasNameGenerator(db.loans.beneficiaryId, db.beneficiaries.id), + ); $$BeneficiariesTableProcessedTableManager get beneficiaryId { final $_column = $_itemColumn('beneficiary_id')!; - final manager = $$BeneficiariesTableTableManager($_db, $_db.beneficiaries) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$BeneficiariesTableTableManager( + $_db, + $_db.beneficiaries, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_beneficiaryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static MultiTypedResultKey<$LoanChangesTable, List> - _loanChangesRefsTable(_$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.loanChanges, - aliasName: - $_aliasNameGenerator(db.loans.id, db.loanChanges.loanId)); + _loanChangesRefsTable(_$OkaneDatabase db) => MultiTypedResultKey.fromTable( + db.loanChanges, + aliasName: $_aliasNameGenerator(db.loans.id, db.loanChanges.loanId), + ); $$LoanChangesTableProcessedTableManager get loanChangesRefs { - final manager = $$LoanChangesTableTableManager($_db, $_db.loanChanges) - .filter((f) => f.loanId.id.sqlEquals($_itemColumn('id')!)); + final manager = $$LoanChangesTableTableManager( + $_db, + $_db.loanChanges, + ).filter((f) => f.loanId.id.sqlEquals($_itemColumn('id')!)); final cache = $_typedResult.readTableOrNull(_loanChangesRefsTable($_db)); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -4988,46 +5939,55 @@ class $$LoansTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); $$BeneficiariesTableFilterComposer get beneficiaryId { final $$BeneficiariesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableFilterComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableFilterComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression loanChangesRefs( - Expression Function($$LoanChangesTableFilterComposer f) f) { + Expression Function($$LoanChangesTableFilterComposer f) f, + ) { final $$LoanChangesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.loanChanges, - getReferencedColumn: (t) => t.loanId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoanChangesTableFilterComposer( - $db: $db, - $table: $db.loanChanges, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.loanChanges, + getReferencedColumn: (t) => t.loanId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoanChangesTableFilterComposer( + $db: $db, + $table: $db.loanChanges, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -5042,25 +6002,30 @@ class $$LoansTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); $$BeneficiariesTableOrderingComposer get beneficiaryId { final $$BeneficiariesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableOrderingComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableOrderingComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -5079,115 +6044,134 @@ class $$LoansTableAnnotationComposer $$BeneficiariesTableAnnotationComposer get beneficiaryId { final $$BeneficiariesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableAnnotationComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableAnnotationComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression loanChangesRefs( - Expression Function($$LoanChangesTableAnnotationComposer a) f) { + Expression Function($$LoanChangesTableAnnotationComposer a) f, + ) { final $$LoanChangesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.loanChanges, - getReferencedColumn: (t) => t.loanId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoanChangesTableAnnotationComposer( - $db: $db, - $table: $db.loanChanges, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.loanChanges, + getReferencedColumn: (t) => t.loanId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoanChangesTableAnnotationComposer( + $db: $db, + $table: $db.loanChanges, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$LoansTableTableManager extends RootTableManager< - _$OkaneDatabase, - $LoansTable, - Loan, - $$LoansTableFilterComposer, - $$LoansTableOrderingComposer, - $$LoansTableAnnotationComposer, - $$LoansTableCreateCompanionBuilder, - $$LoansTableUpdateCompanionBuilder, - (Loan, $$LoansTableReferences), - Loan, - PrefetchHooks Function({bool beneficiaryId, bool loanChangesRefs})> { +class $$LoansTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $LoansTable, + Loan, + $$LoansTableFilterComposer, + $$LoansTableOrderingComposer, + $$LoansTableAnnotationComposer, + $$LoansTableCreateCompanionBuilder, + $$LoansTableUpdateCompanionBuilder, + (Loan, $$LoansTableReferences), + Loan, + PrefetchHooks Function({bool beneficiaryId, bool loanChangesRefs}) + > { $$LoansTableTableManager(_$OkaneDatabase db, $LoansTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$LoansTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$LoansTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$LoansTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value beneficiaryId = const Value.absent(), - }) => - LoansCompanion( - id: id, - beneficiaryId: beneficiaryId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required int beneficiaryId, - }) => - LoansCompanion.insert( - id: id, - beneficiaryId: beneficiaryId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => - (e.readTable(table), $$LoansTableReferences(db, table, e))) - .toList(), - prefetchHooksCallback: ( - {beneficiaryId = false, loanChangesRefs = false}) { + createFilteringComposer: + () => $$LoansTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$LoansTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => $$LoansTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value beneficiaryId = const Value.absent(), + }) => LoansCompanion(id: id, beneficiaryId: beneficiaryId), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required int beneficiaryId, + }) => LoansCompanion.insert(id: id, beneficiaryId: beneficiaryId), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$LoansTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + beneficiaryId = false, + loanChangesRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [if (loanChangesRefs) db.loanChanges], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (beneficiaryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.beneficiaryId, - referencedTable: - $$LoansTableReferences._beneficiaryIdTable(db), - referencedColumn: - $$LoansTableReferences._beneficiaryIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.beneficiaryId, + referencedTable: $$LoansTableReferences + ._beneficiaryIdTable(db), + referencedColumn: + $$LoansTableReferences + ._beneficiaryIdTable(db) + .id, + ) + as T; } return state; @@ -5196,66 +6180,78 @@ class $$LoansTableTableManager extends RootTableManager< return [ if (loanChangesRefs) await $_getPrefetchedData( - currentTable: table, - referencedTable: - $$LoansTableReferences._loanChangesRefsTable(db), - managerFromTypedResult: (p0) => - $$LoansTableReferences(db, table, p0) - .loanChangesRefs, - referencedItemsForCurrentItem: (item, - referencedItems) => - referencedItems.where((e) => e.loanId == item.id), - typedResults: items) + currentTable: table, + referencedTable: $$LoansTableReferences + ._loanChangesRefsTable(db), + managerFromTypedResult: + (p0) => + $$LoansTableReferences( + db, + table, + p0, + ).loanChangesRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => + referencedItems.where((e) => e.loanId == item.id), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$LoansTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $LoansTable, - Loan, - $$LoansTableFilterComposer, - $$LoansTableOrderingComposer, - $$LoansTableAnnotationComposer, - $$LoansTableCreateCompanionBuilder, - $$LoansTableUpdateCompanionBuilder, - (Loan, $$LoansTableReferences), - Loan, - PrefetchHooks Function({bool beneficiaryId, bool loanChangesRefs})>; -typedef $$LoanChangesTableCreateCompanionBuilder = LoanChangesCompanion - Function({ - Value id, - required int loanId, - required double amount, - required DateTime date, -}); -typedef $$LoanChangesTableUpdateCompanionBuilder = LoanChangesCompanion - Function({ - Value id, - Value loanId, - Value amount, - Value date, -}); +typedef $$LoansTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $LoansTable, + Loan, + $$LoansTableFilterComposer, + $$LoansTableOrderingComposer, + $$LoansTableAnnotationComposer, + $$LoansTableCreateCompanionBuilder, + $$LoansTableUpdateCompanionBuilder, + (Loan, $$LoansTableReferences), + Loan, + PrefetchHooks Function({bool beneficiaryId, bool loanChangesRefs}) + >; +typedef $$LoanChangesTableCreateCompanionBuilder = + LoanChangesCompanion Function({ + Value id, + required int loanId, + required double amount, + required DateTime date, + }); +typedef $$LoanChangesTableUpdateCompanionBuilder = + LoanChangesCompanion Function({ + Value id, + Value loanId, + Value amount, + Value date, + }); final class $$LoanChangesTableReferences extends BaseReferences<_$OkaneDatabase, $LoanChangesTable, LoanChange> { $$LoanChangesTableReferences(super.$_db, super.$_table, super.$_typedResult); - static $LoansTable _loanIdTable(_$OkaneDatabase db) => db.loans - .createAlias($_aliasNameGenerator(db.loanChanges.loanId, db.loans.id)); + static $LoansTable _loanIdTable(_$OkaneDatabase db) => db.loans.createAlias( + $_aliasNameGenerator(db.loanChanges.loanId, db.loans.id), + ); $$LoansTableProcessedTableManager get loanId { final $_column = $_itemColumn('loan_id')!; - final manager = $$LoansTableTableManager($_db, $_db.loans) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$LoansTableTableManager( + $_db, + $_db.loans, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_loanIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } } @@ -5269,31 +6265,40 @@ class $$LoanChangesTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnFilters(column)); + column: $table.amount, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get date => $composableBuilder( - column: $table.date, builder: (column) => ColumnFilters(column)); + column: $table.date, + builder: (column) => ColumnFilters(column), + ); $$LoansTableFilterComposer get loanId { final $$LoansTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.loanId, - referencedTable: $db.loans, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoansTableFilterComposer( - $db: $db, - $table: $db.loans, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.loanId, + referencedTable: $db.loans, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoansTableFilterComposer( + $db: $db, + $table: $db.loans, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -5308,31 +6313,40 @@ class $$LoanChangesTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnOrderings(column)); + column: $table.amount, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get date => $composableBuilder( - column: $table.date, builder: (column) => ColumnOrderings(column)); + column: $table.date, + builder: (column) => ColumnOrderings(column), + ); $$LoansTableOrderingComposer get loanId { final $$LoansTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.loanId, - referencedTable: $db.loans, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoansTableOrderingComposer( - $db: $db, - $table: $db.loans, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.loanId, + referencedTable: $db.loans, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoansTableOrderingComposer( + $db: $db, + $table: $db.loans, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -5357,103 +6371,121 @@ class $$LoanChangesTableAnnotationComposer $$LoansTableAnnotationComposer get loanId { final $$LoansTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.loanId, - referencedTable: $db.loans, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$LoansTableAnnotationComposer( - $db: $db, - $table: $db.loans, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.loanId, + referencedTable: $db.loans, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$LoansTableAnnotationComposer( + $db: $db, + $table: $db.loans, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } -class $$LoanChangesTableTableManager extends RootTableManager< - _$OkaneDatabase, - $LoanChangesTable, - LoanChange, - $$LoanChangesTableFilterComposer, - $$LoanChangesTableOrderingComposer, - $$LoanChangesTableAnnotationComposer, - $$LoanChangesTableCreateCompanionBuilder, - $$LoanChangesTableUpdateCompanionBuilder, - (LoanChange, $$LoanChangesTableReferences), - LoanChange, - PrefetchHooks Function({bool loanId})> { +class $$LoanChangesTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $LoanChangesTable, + LoanChange, + $$LoanChangesTableFilterComposer, + $$LoanChangesTableOrderingComposer, + $$LoanChangesTableAnnotationComposer, + $$LoanChangesTableCreateCompanionBuilder, + $$LoanChangesTableUpdateCompanionBuilder, + (LoanChange, $$LoanChangesTableReferences), + LoanChange, + PrefetchHooks Function({bool loanId}) + > { $$LoanChangesTableTableManager(_$OkaneDatabase db, $LoanChangesTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$LoanChangesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$LoanChangesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$LoanChangesTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value loanId = const Value.absent(), - Value amount = const Value.absent(), - Value date = const Value.absent(), - }) => - LoanChangesCompanion( - id: id, - loanId: loanId, - amount: amount, - date: date, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required int loanId, - required double amount, - required DateTime date, - }) => - LoanChangesCompanion.insert( - id: id, - loanId: loanId, - amount: amount, - date: date, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$LoanChangesTableReferences(db, table, e) - )) - .toList(), + createFilteringComposer: + () => $$LoanChangesTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$LoanChangesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => + $$LoanChangesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value loanId = const Value.absent(), + Value amount = const Value.absent(), + Value date = const Value.absent(), + }) => LoanChangesCompanion( + id: id, + loanId: loanId, + amount: amount, + date: date, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required int loanId, + required double amount, + required DateTime date, + }) => LoanChangesCompanion.insert( + id: id, + loanId: loanId, + amount: amount, + date: date, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$LoanChangesTableReferences(db, table, e), + ), + ) + .toList(), prefetchHooksCallback: ({loanId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (loanId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.loanId, - referencedTable: - $$LoanChangesTableReferences._loanIdTable(db), - referencedColumn: - $$LoanChangesTableReferences._loanIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.loanId, + referencedTable: $$LoanChangesTableReferences + ._loanIdTable(db), + referencedColumn: + $$LoanChangesTableReferences + ._loanIdTable(db) + .id, + ) + as T; } return state; @@ -5463,110 +6495,147 @@ class $$LoanChangesTableTableManager extends RootTableManager< }, ); }, - )); + ), + ); } -typedef $$LoanChangesTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $LoanChangesTable, - LoanChange, - $$LoanChangesTableFilterComposer, - $$LoanChangesTableOrderingComposer, - $$LoanChangesTableAnnotationComposer, - $$LoanChangesTableCreateCompanionBuilder, - $$LoanChangesTableUpdateCompanionBuilder, - (LoanChange, $$LoanChangesTableReferences), - LoanChange, - PrefetchHooks Function({bool loanId})>; -typedef $$TransactionTemplatesTableCreateCompanionBuilder - = TransactionTemplatesCompanion Function({ - Value id, - required String name, - required double amount, - required bool recurring, - Value expenseCategoryId, - required int beneficiaryId, - required int accountId, -}); -typedef $$TransactionTemplatesTableUpdateCompanionBuilder - = TransactionTemplatesCompanion Function({ - Value id, - Value name, - Value amount, - Value recurring, - Value expenseCategoryId, - Value beneficiaryId, - Value accountId, -}); +typedef $$LoanChangesTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $LoanChangesTable, + LoanChange, + $$LoanChangesTableFilterComposer, + $$LoanChangesTableOrderingComposer, + $$LoanChangesTableAnnotationComposer, + $$LoanChangesTableCreateCompanionBuilder, + $$LoanChangesTableUpdateCompanionBuilder, + (LoanChange, $$LoanChangesTableReferences), + LoanChange, + PrefetchHooks Function({bool loanId}) + >; +typedef $$TransactionTemplatesTableCreateCompanionBuilder = + TransactionTemplatesCompanion Function({ + Value id, + required String name, + required double amount, + required bool recurring, + Value expenseCategoryId, + required int beneficiaryId, + required int accountId, + }); +typedef $$TransactionTemplatesTableUpdateCompanionBuilder = + TransactionTemplatesCompanion Function({ + Value id, + Value name, + Value amount, + Value recurring, + Value expenseCategoryId, + Value beneficiaryId, + Value accountId, + }); -final class $$TransactionTemplatesTableReferences extends BaseReferences< - _$OkaneDatabase, $TransactionTemplatesTable, TransactionTemplate> { +final class $$TransactionTemplatesTableReferences + extends + BaseReferences< + _$OkaneDatabase, + $TransactionTemplatesTable, + TransactionTemplate + > { $$TransactionTemplatesTableReferences( - super.$_db, super.$_table, super.$_typedResult); + super.$_db, + super.$_table, + super.$_typedResult, + ); static $ExpenseCategoriesTable _expenseCategoryIdTable(_$OkaneDatabase db) => - db.expenseCategories.createAlias($_aliasNameGenerator( - db.transactionTemplates.expenseCategoryId, db.expenseCategories.id)); + db.expenseCategories.createAlias( + $_aliasNameGenerator( + db.transactionTemplates.expenseCategoryId, + db.expenseCategories.id, + ), + ); $$ExpenseCategoriesTableProcessedTableManager? get expenseCategoryId { final $_column = $_itemColumn('expense_category_id'); if ($_column == null) return null; - final manager = - $$ExpenseCategoriesTableTableManager($_db, $_db.expenseCategories) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$ExpenseCategoriesTableTableManager( + $_db, + $_db.expenseCategories, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_expenseCategoryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $BeneficiariesTable _beneficiaryIdTable(_$OkaneDatabase db) => - db.beneficiaries.createAlias($_aliasNameGenerator( - db.transactionTemplates.beneficiaryId, db.beneficiaries.id)); + db.beneficiaries.createAlias( + $_aliasNameGenerator( + db.transactionTemplates.beneficiaryId, + db.beneficiaries.id, + ), + ); $$BeneficiariesTableProcessedTableManager get beneficiaryId { final $_column = $_itemColumn('beneficiary_id')!; - final manager = $$BeneficiariesTableTableManager($_db, $_db.beneficiaries) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$BeneficiariesTableTableManager( + $_db, + $_db.beneficiaries, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_beneficiaryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $AccountsTable _accountIdTable(_$OkaneDatabase db) => - db.accounts.createAlias($_aliasNameGenerator( - db.transactionTemplates.accountId, db.accounts.id)); + db.accounts.createAlias( + $_aliasNameGenerator(db.transactionTemplates.accountId, db.accounts.id), + ); $$AccountsTableProcessedTableManager get accountId { final $_column = $_itemColumn('account_id')!; - final manager = $$AccountsTableTableManager($_db, $_db.accounts) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$AccountsTableTableManager( + $_db, + $_db.accounts, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_accountIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } - static MultiTypedResultKey<$RecurringTransactionsTable, - List> _recurringTransactionsRefsTable( - _$OkaneDatabase db) => - MultiTypedResultKey.fromTable(db.recurringTransactions, - aliasName: $_aliasNameGenerator( - db.transactionTemplates.id, db.recurringTransactions.templateId)); + static MultiTypedResultKey< + $RecurringTransactionsTable, + List + > + _recurringTransactionsRefsTable(_$OkaneDatabase db) => + MultiTypedResultKey.fromTable( + db.recurringTransactions, + aliasName: $_aliasNameGenerator( + db.transactionTemplates.id, + db.recurringTransactions.templateId, + ), + ); $$RecurringTransactionsTableProcessedTableManager - get recurringTransactionsRefs { + get recurringTransactionsRefs { final manager = $$RecurringTransactionsTableTableManager( - $_db, $_db.recurringTransactions) - .filter((f) => f.templateId.id.sqlEquals($_itemColumn('id')!)); + $_db, + $_db.recurringTransactions, + ).filter((f) => f.templateId.id.sqlEquals($_itemColumn('id')!)); - final cache = - $_typedResult.readTableOrNull(_recurringTransactionsRefsTable($_db)); + final cache = $_typedResult.readTableOrNull( + _recurringTransactionsRefsTable($_db), + ); return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache)); + manager.$state.copyWith(prefetchedData: cache), + ); } } @@ -5580,97 +6649,117 @@ class $$TransactionTemplatesTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnFilters(column)); + column: $table.name, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnFilters(column)); + column: $table.amount, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get recurring => $composableBuilder( - column: $table.recurring, builder: (column) => ColumnFilters(column)); + column: $table.recurring, + builder: (column) => ColumnFilters(column), + ); $$ExpenseCategoriesTableFilterComposer get expenseCategoryId { final $$ExpenseCategoriesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableFilterComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableFilterComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableFilterComposer get beneficiaryId { final $$BeneficiariesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableFilterComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableFilterComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableFilterComposer get accountId { final $$AccountsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableFilterComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableFilterComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression recurringTransactionsRefs( - Expression Function($$RecurringTransactionsTableFilterComposer f) - f) { + Expression Function($$RecurringTransactionsTableFilterComposer f) f, + ) { final $$RecurringTransactionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.recurringTransactions, - getReferencedColumn: (t) => t.templateId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$RecurringTransactionsTableFilterComposer( - $db: $db, - $table: $db.recurringTransactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.recurringTransactions, + getReferencedColumn: (t) => t.templateId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$RecurringTransactionsTableFilterComposer( + $db: $db, + $table: $db.recurringTransactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } @@ -5685,74 +6774,91 @@ class $$TransactionTemplatesTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get name => $composableBuilder( - column: $table.name, builder: (column) => ColumnOrderings(column)); + column: $table.name, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnOrderings(column)); + column: $table.amount, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get recurring => $composableBuilder( - column: $table.recurring, builder: (column) => ColumnOrderings(column)); + column: $table.recurring, + builder: (column) => ColumnOrderings(column), + ); $$ExpenseCategoriesTableOrderingComposer get expenseCategoryId { final $$ExpenseCategoriesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableOrderingComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableOrderingComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableOrderingComposer get beneficiaryId { final $$BeneficiariesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableOrderingComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableOrderingComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableOrderingComposer get accountId { final $$AccountsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableOrderingComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableOrderingComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -5781,214 +6887,258 @@ class $$TransactionTemplatesTableAnnotationComposer $$ExpenseCategoriesTableAnnotationComposer get expenseCategoryId { final $$ExpenseCategoriesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableAnnotationComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableAnnotationComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableAnnotationComposer get beneficiaryId { final $$BeneficiariesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableAnnotationComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableAnnotationComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableAnnotationComposer get accountId { final $$AccountsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableAnnotationComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableAnnotationComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } Expression recurringTransactionsRefs( - Expression Function($$RecurringTransactionsTableAnnotationComposer a) - f) { + Expression Function($$RecurringTransactionsTableAnnotationComposer a) f, + ) { final $$RecurringTransactionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.recurringTransactions, - getReferencedColumn: (t) => t.templateId, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$RecurringTransactionsTableAnnotationComposer( - $db: $db, - $table: $db.recurringTransactions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.id, + referencedTable: $db.recurringTransactions, + getReferencedColumn: (t) => t.templateId, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$RecurringTransactionsTableAnnotationComposer( + $db: $db, + $table: $db.recurringTransactions, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return f(composer); } } -class $$TransactionTemplatesTableTableManager extends RootTableManager< - _$OkaneDatabase, - $TransactionTemplatesTable, - TransactionTemplate, - $$TransactionTemplatesTableFilterComposer, - $$TransactionTemplatesTableOrderingComposer, - $$TransactionTemplatesTableAnnotationComposer, - $$TransactionTemplatesTableCreateCompanionBuilder, - $$TransactionTemplatesTableUpdateCompanionBuilder, - (TransactionTemplate, $$TransactionTemplatesTableReferences), - TransactionTemplate, - PrefetchHooks Function( - {bool expenseCategoryId, - bool beneficiaryId, - bool accountId, - bool recurringTransactionsRefs})> { +class $$TransactionTemplatesTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $TransactionTemplatesTable, + TransactionTemplate, + $$TransactionTemplatesTableFilterComposer, + $$TransactionTemplatesTableOrderingComposer, + $$TransactionTemplatesTableAnnotationComposer, + $$TransactionTemplatesTableCreateCompanionBuilder, + $$TransactionTemplatesTableUpdateCompanionBuilder, + (TransactionTemplate, $$TransactionTemplatesTableReferences), + TransactionTemplate, + PrefetchHooks Function({ + bool expenseCategoryId, + bool beneficiaryId, + bool accountId, + bool recurringTransactionsRefs, + }) + > { $$TransactionTemplatesTableTableManager( - _$OkaneDatabase db, $TransactionTemplatesTable table) - : super(TableManagerState( + _$OkaneDatabase db, + $TransactionTemplatesTable table, + ) : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$TransactionTemplatesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$TransactionTemplatesTableOrderingComposer( - $db: db, $table: table), - createComputedFieldComposer: () => - $$TransactionTemplatesTableAnnotationComposer( - $db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value amount = const Value.absent(), - Value recurring = const Value.absent(), - Value expenseCategoryId = const Value.absent(), - Value beneficiaryId = const Value.absent(), - Value accountId = const Value.absent(), - }) => - TransactionTemplatesCompanion( - id: id, - name: name, - amount: amount, - recurring: recurring, - expenseCategoryId: expenseCategoryId, - beneficiaryId: beneficiaryId, - accountId: accountId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required String name, - required double amount, - required bool recurring, - Value expenseCategoryId = const Value.absent(), - required int beneficiaryId, - required int accountId, - }) => - TransactionTemplatesCompanion.insert( - id: id, - name: name, - amount: amount, - recurring: recurring, - expenseCategoryId: expenseCategoryId, - beneficiaryId: beneficiaryId, - accountId: accountId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$TransactionTemplatesTableReferences(db, table, e) - )) - .toList(), - prefetchHooksCallback: ( - {expenseCategoryId = false, - beneficiaryId = false, - accountId = false, - recurringTransactionsRefs = false}) { + createFilteringComposer: + () => $$TransactionTemplatesTableFilterComposer( + $db: db, + $table: table, + ), + createOrderingComposer: + () => $$TransactionTemplatesTableOrderingComposer( + $db: db, + $table: table, + ), + createComputedFieldComposer: + () => $$TransactionTemplatesTableAnnotationComposer( + $db: db, + $table: table, + ), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value name = const Value.absent(), + Value amount = const Value.absent(), + Value recurring = const Value.absent(), + Value expenseCategoryId = const Value.absent(), + Value beneficiaryId = const Value.absent(), + Value accountId = const Value.absent(), + }) => TransactionTemplatesCompanion( + id: id, + name: name, + amount: amount, + recurring: recurring, + expenseCategoryId: expenseCategoryId, + beneficiaryId: beneficiaryId, + accountId: accountId, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required String name, + required double amount, + required bool recurring, + Value expenseCategoryId = const Value.absent(), + required int beneficiaryId, + required int accountId, + }) => TransactionTemplatesCompanion.insert( + id: id, + name: name, + amount: amount, + recurring: recurring, + expenseCategoryId: expenseCategoryId, + beneficiaryId: beneficiaryId, + accountId: accountId, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$TransactionTemplatesTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + expenseCategoryId = false, + beneficiaryId = false, + accountId = false, + recurringTransactionsRefs = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [ - if (recurringTransactionsRefs) db.recurringTransactions + if (recurringTransactionsRefs) db.recurringTransactions, ], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (expenseCategoryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.expenseCategoryId, - referencedTable: $$TransactionTemplatesTableReferences - ._expenseCategoryIdTable(db), - referencedColumn: $$TransactionTemplatesTableReferences - ._expenseCategoryIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.expenseCategoryId, + referencedTable: + $$TransactionTemplatesTableReferences + ._expenseCategoryIdTable(db), + referencedColumn: + $$TransactionTemplatesTableReferences + ._expenseCategoryIdTable(db) + .id, + ) + as T; } if (beneficiaryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.beneficiaryId, - referencedTable: $$TransactionTemplatesTableReferences - ._beneficiaryIdTable(db), - referencedColumn: $$TransactionTemplatesTableReferences - ._beneficiaryIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.beneficiaryId, + referencedTable: + $$TransactionTemplatesTableReferences + ._beneficiaryIdTable(db), + referencedColumn: + $$TransactionTemplatesTableReferences + ._beneficiaryIdTable(db) + .id, + ) + as T; } if (accountId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.accountId, - referencedTable: $$TransactionTemplatesTableReferences - ._accountIdTable(db), - referencedColumn: $$TransactionTemplatesTableReferences - ._accountIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.accountId, + referencedTable: + $$TransactionTemplatesTableReferences + ._accountIdTable(db), + referencedColumn: + $$TransactionTemplatesTableReferences + ._accountIdTable(db) + .id, + ) + as T; } return state; @@ -5996,93 +7146,126 @@ class $$TransactionTemplatesTableTableManager extends RootTableManager< getPrefetchedDataCallback: (items) async { return [ if (recurringTransactionsRefs) - await $_getPrefetchedData( - currentTable: table, - referencedTable: $$TransactionTemplatesTableReferences - ._recurringTransactionsRefsTable(db), - managerFromTypedResult: (p0) => - $$TransactionTemplatesTableReferences(db, table, p0) - .recurringTransactionsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems - .where((e) => e.templateId == item.id), - typedResults: items) + await $_getPrefetchedData< + TransactionTemplate, + $TransactionTemplatesTable, + RecurringTransaction + >( + currentTable: table, + referencedTable: $$TransactionTemplatesTableReferences + ._recurringTransactionsRefsTable(db), + managerFromTypedResult: + (p0) => + $$TransactionTemplatesTableReferences( + db, + table, + p0, + ).recurringTransactionsRefs, + referencedItemsForCurrentItem: + (item, referencedItems) => referencedItems.where( + (e) => e.templateId == item.id, + ), + typedResults: items, + ), ]; }, ); }, - )); + ), + ); } -typedef $$TransactionTemplatesTableProcessedTableManager - = ProcessedTableManager< - _$OkaneDatabase, - $TransactionTemplatesTable, - TransactionTemplate, - $$TransactionTemplatesTableFilterComposer, - $$TransactionTemplatesTableOrderingComposer, - $$TransactionTemplatesTableAnnotationComposer, - $$TransactionTemplatesTableCreateCompanionBuilder, - $$TransactionTemplatesTableUpdateCompanionBuilder, - (TransactionTemplate, $$TransactionTemplatesTableReferences), - TransactionTemplate, - PrefetchHooks Function( - {bool expenseCategoryId, - bool beneficiaryId, - bool accountId, - bool recurringTransactionsRefs})>; -typedef $$RecurringTransactionsTableCreateCompanionBuilder - = RecurringTransactionsCompanion Function({ - Value id, - required int days, - Value lastExecution, - required int templateId, - required int accountId, -}); -typedef $$RecurringTransactionsTableUpdateCompanionBuilder - = RecurringTransactionsCompanion Function({ - Value id, - Value days, - Value lastExecution, - Value templateId, - Value accountId, -}); +typedef $$TransactionTemplatesTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $TransactionTemplatesTable, + TransactionTemplate, + $$TransactionTemplatesTableFilterComposer, + $$TransactionTemplatesTableOrderingComposer, + $$TransactionTemplatesTableAnnotationComposer, + $$TransactionTemplatesTableCreateCompanionBuilder, + $$TransactionTemplatesTableUpdateCompanionBuilder, + (TransactionTemplate, $$TransactionTemplatesTableReferences), + TransactionTemplate, + PrefetchHooks Function({ + bool expenseCategoryId, + bool beneficiaryId, + bool accountId, + bool recurringTransactionsRefs, + }) + >; +typedef $$RecurringTransactionsTableCreateCompanionBuilder = + RecurringTransactionsCompanion Function({ + Value id, + required int days, + Value lastExecution, + required int templateId, + required int accountId, + }); +typedef $$RecurringTransactionsTableUpdateCompanionBuilder = + RecurringTransactionsCompanion Function({ + Value id, + Value days, + Value lastExecution, + Value templateId, + Value accountId, + }); -final class $$RecurringTransactionsTableReferences extends BaseReferences< - _$OkaneDatabase, $RecurringTransactionsTable, RecurringTransaction> { +final class $$RecurringTransactionsTableReferences + extends + BaseReferences< + _$OkaneDatabase, + $RecurringTransactionsTable, + RecurringTransaction + > { $$RecurringTransactionsTableReferences( - super.$_db, super.$_table, super.$_typedResult); + super.$_db, + super.$_table, + super.$_typedResult, + ); static $TransactionTemplatesTable _templateIdTable(_$OkaneDatabase db) => - db.transactionTemplates.createAlias($_aliasNameGenerator( - db.recurringTransactions.templateId, db.transactionTemplates.id)); + db.transactionTemplates.createAlias( + $_aliasNameGenerator( + db.recurringTransactions.templateId, + db.transactionTemplates.id, + ), + ); $$TransactionTemplatesTableProcessedTableManager get templateId { final $_column = $_itemColumn('template_id')!; - final manager = - $$TransactionTemplatesTableTableManager($_db, $_db.transactionTemplates) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$TransactionTemplatesTableTableManager( + $_db, + $_db.transactionTemplates, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_templateIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $AccountsTable _accountIdTable(_$OkaneDatabase db) => - db.accounts.createAlias($_aliasNameGenerator( - db.recurringTransactions.accountId, db.accounts.id)); + db.accounts.createAlias( + $_aliasNameGenerator( + db.recurringTransactions.accountId, + db.accounts.id, + ), + ); $$AccountsTableProcessedTableManager get accountId { final $_column = $_itemColumn('account_id')!; - final manager = $$AccountsTableTableManager($_db, $_db.accounts) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$AccountsTableTableManager( + $_db, + $_db.accounts, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_accountIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } } @@ -6096,51 +7279,63 @@ class $$RecurringTransactionsTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get days => $composableBuilder( - column: $table.days, builder: (column) => ColumnFilters(column)); + column: $table.days, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get lastExecution => $composableBuilder( - column: $table.lastExecution, builder: (column) => ColumnFilters(column)); + column: $table.lastExecution, + builder: (column) => ColumnFilters(column), + ); $$TransactionTemplatesTableFilterComposer get templateId { final $$TransactionTemplatesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.templateId, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableFilterComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.templateId, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableFilterComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableFilterComposer get accountId { final $$AccountsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableFilterComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableFilterComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -6155,53 +7350,64 @@ class $$RecurringTransactionsTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get days => $composableBuilder( - column: $table.days, builder: (column) => ColumnOrderings(column)); + column: $table.days, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get lastExecution => $composableBuilder( - column: $table.lastExecution, - builder: (column) => ColumnOrderings(column)); + column: $table.lastExecution, + builder: (column) => ColumnOrderings(column), + ); $$TransactionTemplatesTableOrderingComposer get templateId { final $$TransactionTemplatesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.templateId, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableOrderingComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.templateId, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableOrderingComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableOrderingComposer get accountId { final $$AccountsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableOrderingComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableOrderingComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -6222,148 +7428,181 @@ class $$RecurringTransactionsTableAnnotationComposer $composableBuilder(column: $table.days, builder: (column) => column); GeneratedColumn get lastExecution => $composableBuilder( - column: $table.lastExecution, builder: (column) => column); + column: $table.lastExecution, + builder: (column) => column, + ); $$TransactionTemplatesTableAnnotationComposer get templateId { final $$TransactionTemplatesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.templateId, - referencedTable: $db.transactionTemplates, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$TransactionTemplatesTableAnnotationComposer( - $db: $db, - $table: $db.transactionTemplates, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.templateId, + referencedTable: $db.transactionTemplates, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$TransactionTemplatesTableAnnotationComposer( + $db: $db, + $table: $db.transactionTemplates, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableAnnotationComposer get accountId { final $$AccountsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableAnnotationComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableAnnotationComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } -class $$RecurringTransactionsTableTableManager extends RootTableManager< - _$OkaneDatabase, - $RecurringTransactionsTable, - RecurringTransaction, - $$RecurringTransactionsTableFilterComposer, - $$RecurringTransactionsTableOrderingComposer, - $$RecurringTransactionsTableAnnotationComposer, - $$RecurringTransactionsTableCreateCompanionBuilder, - $$RecurringTransactionsTableUpdateCompanionBuilder, - (RecurringTransaction, $$RecurringTransactionsTableReferences), - RecurringTransaction, - PrefetchHooks Function({bool templateId, bool accountId})> { +class $$RecurringTransactionsTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $RecurringTransactionsTable, + RecurringTransaction, + $$RecurringTransactionsTableFilterComposer, + $$RecurringTransactionsTableOrderingComposer, + $$RecurringTransactionsTableAnnotationComposer, + $$RecurringTransactionsTableCreateCompanionBuilder, + $$RecurringTransactionsTableUpdateCompanionBuilder, + (RecurringTransaction, $$RecurringTransactionsTableReferences), + RecurringTransaction, + PrefetchHooks Function({bool templateId, bool accountId}) + > { $$RecurringTransactionsTableTableManager( - _$OkaneDatabase db, $RecurringTransactionsTable table) - : super(TableManagerState( + _$OkaneDatabase db, + $RecurringTransactionsTable table, + ) : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$RecurringTransactionsTableFilterComposer( - $db: db, $table: table), - createOrderingComposer: () => - $$RecurringTransactionsTableOrderingComposer( - $db: db, $table: table), - createComputedFieldComposer: () => - $$RecurringTransactionsTableAnnotationComposer( - $db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value days = const Value.absent(), - Value lastExecution = const Value.absent(), - Value templateId = const Value.absent(), - Value accountId = const Value.absent(), - }) => - RecurringTransactionsCompanion( - id: id, - days: days, - lastExecution: lastExecution, - templateId: templateId, - accountId: accountId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required int days, - Value lastExecution = const Value.absent(), - required int templateId, - required int accountId, - }) => - RecurringTransactionsCompanion.insert( - id: id, - days: days, - lastExecution: lastExecution, - templateId: templateId, - accountId: accountId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$RecurringTransactionsTableReferences(db, table, e) - )) - .toList(), + createFilteringComposer: + () => $$RecurringTransactionsTableFilterComposer( + $db: db, + $table: table, + ), + createOrderingComposer: + () => $$RecurringTransactionsTableOrderingComposer( + $db: db, + $table: table, + ), + createComputedFieldComposer: + () => $$RecurringTransactionsTableAnnotationComposer( + $db: db, + $table: table, + ), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value days = const Value.absent(), + Value lastExecution = const Value.absent(), + Value templateId = const Value.absent(), + Value accountId = const Value.absent(), + }) => RecurringTransactionsCompanion( + id: id, + days: days, + lastExecution: lastExecution, + templateId: templateId, + accountId: accountId, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required int days, + Value lastExecution = const Value.absent(), + required int templateId, + required int accountId, + }) => RecurringTransactionsCompanion.insert( + id: id, + days: days, + lastExecution: lastExecution, + templateId: templateId, + accountId: accountId, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$RecurringTransactionsTableReferences(db, table, e), + ), + ) + .toList(), prefetchHooksCallback: ({templateId = false, accountId = false}) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (templateId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.templateId, - referencedTable: $$RecurringTransactionsTableReferences - ._templateIdTable(db), - referencedColumn: $$RecurringTransactionsTableReferences - ._templateIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.templateId, + referencedTable: + $$RecurringTransactionsTableReferences + ._templateIdTable(db), + referencedColumn: + $$RecurringTransactionsTableReferences + ._templateIdTable(db) + .id, + ) + as T; } if (accountId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.accountId, - referencedTable: $$RecurringTransactionsTableReferences - ._accountIdTable(db), - referencedColumn: $$RecurringTransactionsTableReferences - ._accountIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.accountId, + referencedTable: + $$RecurringTransactionsTableReferences + ._accountIdTable(db), + referencedColumn: + $$RecurringTransactionsTableReferences + ._accountIdTable(db) + .id, + ) + as T; } return state; @@ -6373,89 +7612,108 @@ class $$RecurringTransactionsTableTableManager extends RootTableManager< }, ); }, - )); + ), + ); } -typedef $$RecurringTransactionsTableProcessedTableManager - = ProcessedTableManager< - _$OkaneDatabase, - $RecurringTransactionsTable, - RecurringTransaction, - $$RecurringTransactionsTableFilterComposer, - $$RecurringTransactionsTableOrderingComposer, - $$RecurringTransactionsTableAnnotationComposer, - $$RecurringTransactionsTableCreateCompanionBuilder, - $$RecurringTransactionsTableUpdateCompanionBuilder, - (RecurringTransaction, $$RecurringTransactionsTableReferences), - RecurringTransaction, - PrefetchHooks Function({bool templateId, bool accountId})>; -typedef $$TransactionsTableCreateCompanionBuilder = TransactionsCompanion - Function({ - Value id, - required double amount, - required DateTime date, - Value expenseCategoryId, - required int accountId, - required int beneficiaryId, -}); -typedef $$TransactionsTableUpdateCompanionBuilder = TransactionsCompanion - Function({ - Value id, - Value amount, - Value date, - Value expenseCategoryId, - Value accountId, - Value beneficiaryId, -}); +typedef $$RecurringTransactionsTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $RecurringTransactionsTable, + RecurringTransaction, + $$RecurringTransactionsTableFilterComposer, + $$RecurringTransactionsTableOrderingComposer, + $$RecurringTransactionsTableAnnotationComposer, + $$RecurringTransactionsTableCreateCompanionBuilder, + $$RecurringTransactionsTableUpdateCompanionBuilder, + (RecurringTransaction, $$RecurringTransactionsTableReferences), + RecurringTransaction, + PrefetchHooks Function({bool templateId, bool accountId}) + >; +typedef $$TransactionsTableCreateCompanionBuilder = + TransactionsCompanion Function({ + Value id, + required double amount, + required DateTime date, + Value expenseCategoryId, + required int accountId, + required int beneficiaryId, + }); +typedef $$TransactionsTableUpdateCompanionBuilder = + TransactionsCompanion Function({ + Value id, + Value amount, + Value date, + Value expenseCategoryId, + Value accountId, + Value beneficiaryId, + }); final class $$TransactionsTableReferences extends BaseReferences<_$OkaneDatabase, $TransactionsTable, Transaction> { $$TransactionsTableReferences(super.$_db, super.$_table, super.$_typedResult); static $ExpenseCategoriesTable _expenseCategoryIdTable(_$OkaneDatabase db) => - db.expenseCategories.createAlias($_aliasNameGenerator( - db.transactions.expenseCategoryId, db.expenseCategories.id)); + db.expenseCategories.createAlias( + $_aliasNameGenerator( + db.transactions.expenseCategoryId, + db.expenseCategories.id, + ), + ); $$ExpenseCategoriesTableProcessedTableManager? get expenseCategoryId { final $_column = $_itemColumn('expense_category_id'); if ($_column == null) return null; - final manager = - $$ExpenseCategoriesTableTableManager($_db, $_db.expenseCategories) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$ExpenseCategoriesTableTableManager( + $_db, + $_db.expenseCategories, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_expenseCategoryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $AccountsTable _accountIdTable(_$OkaneDatabase db) => db.accounts.createAlias( - $_aliasNameGenerator(db.transactions.accountId, db.accounts.id)); + $_aliasNameGenerator(db.transactions.accountId, db.accounts.id), + ); $$AccountsTableProcessedTableManager get accountId { final $_column = $_itemColumn('account_id')!; - final manager = $$AccountsTableTableManager($_db, $_db.accounts) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$AccountsTableTableManager( + $_db, + $_db.accounts, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_accountIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } static $BeneficiariesTable _beneficiaryIdTable(_$OkaneDatabase db) => - db.beneficiaries.createAlias($_aliasNameGenerator( - db.transactions.beneficiaryId, db.beneficiaries.id)); + db.beneficiaries.createAlias( + $_aliasNameGenerator( + db.transactions.beneficiaryId, + db.beneficiaries.id, + ), + ); $$BeneficiariesTableProcessedTableManager get beneficiaryId { final $_column = $_itemColumn('beneficiary_id')!; - final manager = $$BeneficiariesTableTableManager($_db, $_db.beneficiaries) - .filter((f) => f.id.sqlEquals($_column)); + final manager = $$BeneficiariesTableTableManager( + $_db, + $_db.beneficiaries, + ).filter((f) => f.id.sqlEquals($_column)); final item = $_typedResult.readTableOrNull(_beneficiaryIdTable($_db)); if (item == null) return manager; return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item])); + manager.$state.copyWith(prefetchedData: [item]), + ); } } @@ -6469,71 +7727,86 @@ class $$TransactionsTableFilterComposer super.$removeJoinBuilderFromRootComposer, }); ColumnFilters get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnFilters(column)); + column: $table.id, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnFilters(column)); + column: $table.amount, + builder: (column) => ColumnFilters(column), + ); ColumnFilters get date => $composableBuilder( - column: $table.date, builder: (column) => ColumnFilters(column)); + column: $table.date, + builder: (column) => ColumnFilters(column), + ); $$ExpenseCategoriesTableFilterComposer get expenseCategoryId { final $$ExpenseCategoriesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableFilterComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableFilterComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableFilterComposer get accountId { final $$AccountsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableFilterComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableFilterComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableFilterComposer get beneficiaryId { final $$BeneficiariesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableFilterComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableFilterComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -6548,71 +7821,86 @@ class $$TransactionsTableOrderingComposer super.$removeJoinBuilderFromRootComposer, }); ColumnOrderings get id => $composableBuilder( - column: $table.id, builder: (column) => ColumnOrderings(column)); + column: $table.id, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get amount => $composableBuilder( - column: $table.amount, builder: (column) => ColumnOrderings(column)); + column: $table.amount, + builder: (column) => ColumnOrderings(column), + ); ColumnOrderings get date => $composableBuilder( - column: $table.date, builder: (column) => ColumnOrderings(column)); + column: $table.date, + builder: (column) => ColumnOrderings(column), + ); $$ExpenseCategoriesTableOrderingComposer get expenseCategoryId { final $$ExpenseCategoriesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableOrderingComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableOrderingComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableOrderingComposer get accountId { final $$AccountsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableOrderingComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableOrderingComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableOrderingComposer get beneficiaryId { final $$BeneficiariesTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableOrderingComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableOrderingComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } @@ -6638,177 +7926,211 @@ class $$TransactionsTableAnnotationComposer $$ExpenseCategoriesTableAnnotationComposer get expenseCategoryId { final $$ExpenseCategoriesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.expenseCategoryId, - referencedTable: $db.expenseCategories, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$ExpenseCategoriesTableAnnotationComposer( - $db: $db, - $table: $db.expenseCategories, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.expenseCategoryId, + referencedTable: $db.expenseCategories, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$ExpenseCategoriesTableAnnotationComposer( + $db: $db, + $table: $db.expenseCategories, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$AccountsTableAnnotationComposer get accountId { final $$AccountsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.accountId, - referencedTable: $db.accounts, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$AccountsTableAnnotationComposer( - $db: $db, - $table: $db.accounts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.accountId, + referencedTable: $db.accounts, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$AccountsTableAnnotationComposer( + $db: $db, + $table: $db.accounts, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } $$BeneficiariesTableAnnotationComposer get beneficiaryId { final $$BeneficiariesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.beneficiaryId, - referencedTable: $db.beneficiaries, - getReferencedColumn: (t) => t.id, - builder: (joinBuilder, - {$addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer}) => - $$BeneficiariesTableAnnotationComposer( - $db: $db, - $table: $db.beneficiaries, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - )); + composer: this, + getCurrentColumn: (t) => t.beneficiaryId, + referencedTable: $db.beneficiaries, + getReferencedColumn: (t) => t.id, + builder: + ( + joinBuilder, { + $addJoinBuilderToRootComposer, + $removeJoinBuilderFromRootComposer, + }) => $$BeneficiariesTableAnnotationComposer( + $db: $db, + $table: $db.beneficiaries, + $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, + joinBuilder: joinBuilder, + $removeJoinBuilderFromRootComposer: + $removeJoinBuilderFromRootComposer, + ), + ); return composer; } } -class $$TransactionsTableTableManager extends RootTableManager< - _$OkaneDatabase, - $TransactionsTable, - Transaction, - $$TransactionsTableFilterComposer, - $$TransactionsTableOrderingComposer, - $$TransactionsTableAnnotationComposer, - $$TransactionsTableCreateCompanionBuilder, - $$TransactionsTableUpdateCompanionBuilder, - (Transaction, $$TransactionsTableReferences), - Transaction, - PrefetchHooks Function( - {bool expenseCategoryId, bool accountId, bool beneficiaryId})> { +class $$TransactionsTableTableManager + extends + RootTableManager< + _$OkaneDatabase, + $TransactionsTable, + Transaction, + $$TransactionsTableFilterComposer, + $$TransactionsTableOrderingComposer, + $$TransactionsTableAnnotationComposer, + $$TransactionsTableCreateCompanionBuilder, + $$TransactionsTableUpdateCompanionBuilder, + (Transaction, $$TransactionsTableReferences), + Transaction, + PrefetchHooks Function({ + bool expenseCategoryId, + bool accountId, + bool beneficiaryId, + }) + > { $$TransactionsTableTableManager(_$OkaneDatabase db, $TransactionsTable table) - : super(TableManagerState( + : super( + TableManagerState( db: db, table: table, - createFilteringComposer: () => - $$TransactionsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$TransactionsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$TransactionsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: ({ - Value id = const Value.absent(), - Value amount = const Value.absent(), - Value date = const Value.absent(), - Value expenseCategoryId = const Value.absent(), - Value accountId = const Value.absent(), - Value beneficiaryId = const Value.absent(), - }) => - TransactionsCompanion( - id: id, - amount: amount, - date: date, - expenseCategoryId: expenseCategoryId, - accountId: accountId, - beneficiaryId: beneficiaryId, - ), - createCompanionCallback: ({ - Value id = const Value.absent(), - required double amount, - required DateTime date, - Value expenseCategoryId = const Value.absent(), - required int accountId, - required int beneficiaryId, - }) => - TransactionsCompanion.insert( - id: id, - amount: amount, - date: date, - expenseCategoryId: expenseCategoryId, - accountId: accountId, - beneficiaryId: beneficiaryId, - ), - withReferenceMapper: (p0) => p0 - .map((e) => ( - e.readTable(table), - $$TransactionsTableReferences(db, table, e) - )) - .toList(), - prefetchHooksCallback: ( - {expenseCategoryId = false, - accountId = false, - beneficiaryId = false}) { + createFilteringComposer: + () => $$TransactionsTableFilterComposer($db: db, $table: table), + createOrderingComposer: + () => $$TransactionsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: + () => + $$TransactionsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: + ({ + Value id = const Value.absent(), + Value amount = const Value.absent(), + Value date = const Value.absent(), + Value expenseCategoryId = const Value.absent(), + Value accountId = const Value.absent(), + Value beneficiaryId = const Value.absent(), + }) => TransactionsCompanion( + id: id, + amount: amount, + date: date, + expenseCategoryId: expenseCategoryId, + accountId: accountId, + beneficiaryId: beneficiaryId, + ), + createCompanionCallback: + ({ + Value id = const Value.absent(), + required double amount, + required DateTime date, + Value expenseCategoryId = const Value.absent(), + required int accountId, + required int beneficiaryId, + }) => TransactionsCompanion.insert( + id: id, + amount: amount, + date: date, + expenseCategoryId: expenseCategoryId, + accountId: accountId, + beneficiaryId: beneficiaryId, + ), + withReferenceMapper: + (p0) => + p0 + .map( + (e) => ( + e.readTable(table), + $$TransactionsTableReferences(db, table, e), + ), + ) + .toList(), + prefetchHooksCallback: ({ + expenseCategoryId = false, + accountId = false, + beneficiaryId = false, + }) { return PrefetchHooks( db: db, explicitlyWatchedTables: [], addJoins: < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic>>(state) { + T extends TableManagerState< + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic, + dynamic + > + >(state) { if (expenseCategoryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.expenseCategoryId, - referencedTable: $$TransactionsTableReferences - ._expenseCategoryIdTable(db), - referencedColumn: $$TransactionsTableReferences - ._expenseCategoryIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.expenseCategoryId, + referencedTable: $$TransactionsTableReferences + ._expenseCategoryIdTable(db), + referencedColumn: + $$TransactionsTableReferences + ._expenseCategoryIdTable(db) + .id, + ) + as T; } if (accountId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.accountId, - referencedTable: - $$TransactionsTableReferences._accountIdTable(db), - referencedColumn: - $$TransactionsTableReferences._accountIdTable(db).id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.accountId, + referencedTable: $$TransactionsTableReferences + ._accountIdTable(db), + referencedColumn: + $$TransactionsTableReferences + ._accountIdTable(db) + .id, + ) + as T; } if (beneficiaryId) { - state = state.withJoin( - currentTable: table, - currentColumn: table.beneficiaryId, - referencedTable: - $$TransactionsTableReferences._beneficiaryIdTable(db), - referencedColumn: $$TransactionsTableReferences - ._beneficiaryIdTable(db) - .id, - ) as T; + state = + state.withJoin( + currentTable: table, + currentColumn: table.beneficiaryId, + referencedTable: $$TransactionsTableReferences + ._beneficiaryIdTable(db), + referencedColumn: + $$TransactionsTableReferences + ._beneficiaryIdTable(db) + .id, + ) + as T; } return state; @@ -6818,22 +8140,28 @@ class $$TransactionsTableTableManager extends RootTableManager< }, ); }, - )); + ), + ); } -typedef $$TransactionsTableProcessedTableManager = ProcessedTableManager< - _$OkaneDatabase, - $TransactionsTable, - Transaction, - $$TransactionsTableFilterComposer, - $$TransactionsTableOrderingComposer, - $$TransactionsTableAnnotationComposer, - $$TransactionsTableCreateCompanionBuilder, - $$TransactionsTableUpdateCompanionBuilder, - (Transaction, $$TransactionsTableReferences), - Transaction, - PrefetchHooks Function( - {bool expenseCategoryId, bool accountId, bool beneficiaryId})>; +typedef $$TransactionsTableProcessedTableManager = + ProcessedTableManager< + _$OkaneDatabase, + $TransactionsTable, + Transaction, + $$TransactionsTableFilterComposer, + $$TransactionsTableOrderingComposer, + $$TransactionsTableAnnotationComposer, + $$TransactionsTableCreateCompanionBuilder, + $$TransactionsTableUpdateCompanionBuilder, + (Transaction, $$TransactionsTableReferences), + Transaction, + PrefetchHooks Function({ + bool expenseCategoryId, + bool accountId, + bool beneficiaryId, + }) + >; class $OkaneDatabaseManager { final _$OkaneDatabase _db; diff --git a/lib/ui/pages/transaction_details.dart b/lib/ui/pages/transaction_details.dart index 99994b2..a675e39 100644 --- a/lib/ui/pages/transaction_details.dart +++ b/lib/ui/pages/transaction_details.dart @@ -135,7 +135,7 @@ class TransactionDetailsPage extends StatelessWidget { GetIt.I .get() .activeAccount! - .name!, + .name, ), ), ], diff --git a/lib/ui/state/core.dart b/lib/ui/state/core.dart index e33673c..5d5ab47 100644 --- a/lib/ui/state/core.dart +++ b/lib/ui/state/core.dart @@ -95,6 +95,7 @@ class CoreCubit extends Cubit { _budgetsStreamSubscription = db.budgetsDao .budgetsStream(activeAccount!) .listen((budgets) async { + print("BUDGETS: $budgets"); emit(state.copyWith(budgets: budgets)); }); _loanStreamSubscription?.cancel(); @@ -133,7 +134,7 @@ class CoreCubit extends Cubit { expenseCategories: await db.expenseCategoriesDao.getExpenseCategories( account, ), - budgets: await db.budgetsDao.getBudgets(account), + //budgets: await db.budgetsDao.getBudgets(account), loans: await db.loansDao.getLoans(account), ), ); diff --git a/lib/ui/state/core.freezed.dart b/lib/ui/state/core.freezed.dart index 4176ec4..457d1c9 100644 --- a/lib/ui/state/core.freezed.dart +++ b/lib/ui/state/core.freezed.dart @@ -12,7 +12,8 @@ part of 'core.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$CoreState { @@ -45,22 +46,23 @@ abstract class $CoreStateCopyWith<$Res> { factory $CoreStateCopyWith(CoreState value, $Res Function(CoreState) then) = _$CoreStateCopyWithImpl<$Res, CoreState>; @useResult - $Res call( - {OkanePage activePage, - int? activeAccountIndex, - TransactionDto? activeTransaction, - List accounts, - List recurringTransactions, - List transactions, - List transactionTemplates, - List beneficiaries, - List expenseCategories, - List budgets, - List budgetItems, - BudgetsDto? activeBudget, - List loans, - LoanDto? activeLoan, - bool isDeletingAccount}); + $Res call({ + OkanePage activePage, + int? activeAccountIndex, + TransactionDto? activeTransaction, + List accounts, + List recurringTransactions, + List transactions, + List transactionTemplates, + List beneficiaries, + List expenseCategories, + List budgets, + List budgetItems, + BudgetsDto? activeBudget, + List loans, + LoanDto? activeLoan, + bool isDeletingAccount, + }); } /// @nodoc @@ -92,68 +94,86 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> Object? activeLoan = freezed, Object? isDeletingAccount = null, }) { - return _then(_value.copyWith( - activePage: null == activePage - ? _value.activePage - : activePage // ignore: cast_nullable_to_non_nullable - as OkanePage, - activeAccountIndex: freezed == activeAccountIndex - ? _value.activeAccountIndex - : activeAccountIndex // ignore: cast_nullable_to_non_nullable - as int?, - activeTransaction: freezed == activeTransaction - ? _value.activeTransaction - : activeTransaction // ignore: cast_nullable_to_non_nullable - as TransactionDto?, - accounts: null == accounts - ? _value.accounts - : accounts // ignore: cast_nullable_to_non_nullable - as List, - recurringTransactions: null == recurringTransactions - ? _value.recurringTransactions - : recurringTransactions // ignore: cast_nullable_to_non_nullable - as List, - transactions: null == transactions - ? _value.transactions - : transactions // ignore: cast_nullable_to_non_nullable - as List, - transactionTemplates: null == transactionTemplates - ? _value.transactionTemplates - : transactionTemplates // ignore: cast_nullable_to_non_nullable - as List, - beneficiaries: null == beneficiaries - ? _value.beneficiaries - : beneficiaries // ignore: cast_nullable_to_non_nullable - as List, - expenseCategories: null == expenseCategories - ? _value.expenseCategories - : expenseCategories // ignore: cast_nullable_to_non_nullable - as List, - budgets: null == budgets - ? _value.budgets - : budgets // ignore: cast_nullable_to_non_nullable - as List, - budgetItems: null == budgetItems - ? _value.budgetItems - : budgetItems // ignore: cast_nullable_to_non_nullable - as List, - activeBudget: freezed == activeBudget - ? _value.activeBudget - : activeBudget // ignore: cast_nullable_to_non_nullable - as BudgetsDto?, - loans: null == loans - ? _value.loans - : loans // ignore: cast_nullable_to_non_nullable - as List, - activeLoan: freezed == activeLoan - ? _value.activeLoan - : activeLoan // ignore: cast_nullable_to_non_nullable - as LoanDto?, - isDeletingAccount: null == isDeletingAccount - ? _value.isDeletingAccount - : isDeletingAccount // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + activePage: + null == activePage + ? _value.activePage + : activePage // ignore: cast_nullable_to_non_nullable + as OkanePage, + activeAccountIndex: + freezed == activeAccountIndex + ? _value.activeAccountIndex + : activeAccountIndex // ignore: cast_nullable_to_non_nullable + as int?, + activeTransaction: + freezed == activeTransaction + ? _value.activeTransaction + : activeTransaction // ignore: cast_nullable_to_non_nullable + as TransactionDto?, + accounts: + null == accounts + ? _value.accounts + : accounts // ignore: cast_nullable_to_non_nullable + as List, + recurringTransactions: + null == recurringTransactions + ? _value.recurringTransactions + : recurringTransactions // ignore: cast_nullable_to_non_nullable + as List, + transactions: + null == transactions + ? _value.transactions + : transactions // ignore: cast_nullable_to_non_nullable + as List, + transactionTemplates: + null == transactionTemplates + ? _value.transactionTemplates + : transactionTemplates // ignore: cast_nullable_to_non_nullable + as List, + beneficiaries: + null == beneficiaries + ? _value.beneficiaries + : beneficiaries // ignore: cast_nullable_to_non_nullable + as List, + expenseCategories: + null == expenseCategories + ? _value.expenseCategories + : expenseCategories // ignore: cast_nullable_to_non_nullable + as List, + budgets: + null == budgets + ? _value.budgets + : budgets // ignore: cast_nullable_to_non_nullable + as List, + budgetItems: + null == budgetItems + ? _value.budgetItems + : budgetItems // ignore: cast_nullable_to_non_nullable + as List, + activeBudget: + freezed == activeBudget + ? _value.activeBudget + : activeBudget // ignore: cast_nullable_to_non_nullable + as BudgetsDto?, + loans: + null == loans + ? _value.loans + : loans // ignore: cast_nullable_to_non_nullable + as List, + activeLoan: + freezed == activeLoan + ? _value.activeLoan + : activeLoan // ignore: cast_nullable_to_non_nullable + as LoanDto?, + isDeletingAccount: + null == isDeletingAccount + ? _value.isDeletingAccount + : isDeletingAccount // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } @@ -161,26 +181,28 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> abstract class _$$CoreStateImplCopyWith<$Res> implements $CoreStateCopyWith<$Res> { factory _$$CoreStateImplCopyWith( - _$CoreStateImpl value, $Res Function(_$CoreStateImpl) then) = - __$$CoreStateImplCopyWithImpl<$Res>; + _$CoreStateImpl value, + $Res Function(_$CoreStateImpl) then, + ) = __$$CoreStateImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {OkanePage activePage, - int? activeAccountIndex, - TransactionDto? activeTransaction, - List accounts, - List recurringTransactions, - List transactions, - List transactionTemplates, - List beneficiaries, - List expenseCategories, - List budgets, - List budgetItems, - BudgetsDto? activeBudget, - List loans, - LoanDto? activeLoan, - bool isDeletingAccount}); + $Res call({ + OkanePage activePage, + int? activeAccountIndex, + TransactionDto? activeTransaction, + List accounts, + List recurringTransactions, + List transactions, + List transactionTemplates, + List beneficiaries, + List expenseCategories, + List budgets, + List budgetItems, + BudgetsDto? activeBudget, + List loans, + LoanDto? activeLoan, + bool isDeletingAccount, + }); } /// @nodoc @@ -188,8 +210,9 @@ class __$$CoreStateImplCopyWithImpl<$Res> extends _$CoreStateCopyWithImpl<$Res, _$CoreStateImpl> implements _$$CoreStateImplCopyWith<$Res> { __$$CoreStateImplCopyWithImpl( - _$CoreStateImpl _value, $Res Function(_$CoreStateImpl) _then) - : super(_value, _then); + _$CoreStateImpl _value, + $Res Function(_$CoreStateImpl) _then, + ) : super(_value, _then); @pragma('vm:prefer-inline') @override @@ -210,99 +233,116 @@ class __$$CoreStateImplCopyWithImpl<$Res> Object? activeLoan = freezed, Object? isDeletingAccount = null, }) { - return _then(_$CoreStateImpl( - activePage: null == activePage - ? _value.activePage - : activePage // ignore: cast_nullable_to_non_nullable - as OkanePage, - activeAccountIndex: freezed == activeAccountIndex - ? _value.activeAccountIndex - : activeAccountIndex // ignore: cast_nullable_to_non_nullable - as int?, - activeTransaction: freezed == activeTransaction - ? _value.activeTransaction - : activeTransaction // ignore: cast_nullable_to_non_nullable - as TransactionDto?, - accounts: null == accounts - ? _value._accounts - : accounts // ignore: cast_nullable_to_non_nullable - as List, - recurringTransactions: null == recurringTransactions - ? _value._recurringTransactions - : recurringTransactions // ignore: cast_nullable_to_non_nullable - as List, - transactions: null == transactions - ? _value._transactions - : transactions // ignore: cast_nullable_to_non_nullable - as List, - transactionTemplates: null == transactionTemplates - ? _value._transactionTemplates - : transactionTemplates // ignore: cast_nullable_to_non_nullable - as List, - beneficiaries: null == beneficiaries - ? _value._beneficiaries - : beneficiaries // ignore: cast_nullable_to_non_nullable - as List, - expenseCategories: null == expenseCategories - ? _value._expenseCategories - : expenseCategories // ignore: cast_nullable_to_non_nullable - as List, - budgets: null == budgets - ? _value._budgets - : budgets // ignore: cast_nullable_to_non_nullable - as List, - budgetItems: null == budgetItems - ? _value._budgetItems - : budgetItems // ignore: cast_nullable_to_non_nullable - as List, - activeBudget: freezed == activeBudget - ? _value.activeBudget - : activeBudget // ignore: cast_nullable_to_non_nullable - as BudgetsDto?, - loans: null == loans - ? _value._loans - : loans // ignore: cast_nullable_to_non_nullable - as List, - activeLoan: freezed == activeLoan - ? _value.activeLoan - : activeLoan // ignore: cast_nullable_to_non_nullable - as LoanDto?, - isDeletingAccount: null == isDeletingAccount - ? _value.isDeletingAccount - : isDeletingAccount // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$CoreStateImpl( + activePage: + null == activePage + ? _value.activePage + : activePage // ignore: cast_nullable_to_non_nullable + as OkanePage, + activeAccountIndex: + freezed == activeAccountIndex + ? _value.activeAccountIndex + : activeAccountIndex // ignore: cast_nullable_to_non_nullable + as int?, + activeTransaction: + freezed == activeTransaction + ? _value.activeTransaction + : activeTransaction // ignore: cast_nullable_to_non_nullable + as TransactionDto?, + accounts: + null == accounts + ? _value._accounts + : accounts // ignore: cast_nullable_to_non_nullable + as List, + recurringTransactions: + null == recurringTransactions + ? _value._recurringTransactions + : recurringTransactions // ignore: cast_nullable_to_non_nullable + as List, + transactions: + null == transactions + ? _value._transactions + : transactions // ignore: cast_nullable_to_non_nullable + as List, + transactionTemplates: + null == transactionTemplates + ? _value._transactionTemplates + : transactionTemplates // ignore: cast_nullable_to_non_nullable + as List, + beneficiaries: + null == beneficiaries + ? _value._beneficiaries + : beneficiaries // ignore: cast_nullable_to_non_nullable + as List, + expenseCategories: + null == expenseCategories + ? _value._expenseCategories + : expenseCategories // ignore: cast_nullable_to_non_nullable + as List, + budgets: + null == budgets + ? _value._budgets + : budgets // ignore: cast_nullable_to_non_nullable + as List, + budgetItems: + null == budgetItems + ? _value._budgetItems + : budgetItems // ignore: cast_nullable_to_non_nullable + as List, + activeBudget: + freezed == activeBudget + ? _value.activeBudget + : activeBudget // ignore: cast_nullable_to_non_nullable + as BudgetsDto?, + loans: + null == loans + ? _value._loans + : loans // ignore: cast_nullable_to_non_nullable + as List, + activeLoan: + freezed == activeLoan + ? _value.activeLoan + : activeLoan // ignore: cast_nullable_to_non_nullable + as LoanDto?, + isDeletingAccount: + null == isDeletingAccount + ? _value.isDeletingAccount + : isDeletingAccount // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } /// @nodoc class _$CoreStateImpl implements _CoreState { - const _$CoreStateImpl( - {this.activePage = OkanePage.accounts, - this.activeAccountIndex, - this.activeTransaction = null, - final List accounts = const [], - final List recurringTransactions = const [], - final List transactions = const [], - final List transactionTemplates = const [], - final List beneficiaries = const [], - final List expenseCategories = const [], - final List budgets = const [], - final List budgetItems = const [], - this.activeBudget = null, - final List loans = const [], - this.activeLoan = null, - this.isDeletingAccount = false}) - : _accounts = accounts, - _recurringTransactions = recurringTransactions, - _transactions = transactions, - _transactionTemplates = transactionTemplates, - _beneficiaries = beneficiaries, - _expenseCategories = expenseCategories, - _budgets = budgets, - _budgetItems = budgetItems, - _loans = loans; + const _$CoreStateImpl({ + this.activePage = OkanePage.accounts, + this.activeAccountIndex, + this.activeTransaction = null, + final List accounts = const [], + final List recurringTransactions = const [], + final List transactions = const [], + final List transactionTemplates = const [], + final List beneficiaries = const [], + final List expenseCategories = const [], + final List budgets = const [], + final List budgetItems = const [], + this.activeBudget = null, + final List loans = const [], + this.activeLoan = null, + this.isDeletingAccount = false, + }) : _accounts = accounts, + _recurringTransactions = recurringTransactions, + _transactions = transactions, + _transactionTemplates = transactionTemplates, + _beneficiaries = beneficiaries, + _expenseCategories = expenseCategories, + _budgets = budgets, + _budgetItems = budgetItems, + _loans = loans; @override @JsonKey() @@ -423,19 +463,31 @@ class _$CoreStateImpl implements _CoreState { (identical(other.activeTransaction, activeTransaction) || other.activeTransaction == activeTransaction) && const DeepCollectionEquality().equals(other._accounts, _accounts) && - const DeepCollectionEquality() - .equals(other._recurringTransactions, _recurringTransactions) && - const DeepCollectionEquality() - .equals(other._transactions, _transactions) && - const DeepCollectionEquality() - .equals(other._transactionTemplates, _transactionTemplates) && - const DeepCollectionEquality() - .equals(other._beneficiaries, _beneficiaries) && - const DeepCollectionEquality() - .equals(other._expenseCategories, _expenseCategories) && + const DeepCollectionEquality().equals( + other._recurringTransactions, + _recurringTransactions, + ) && + const DeepCollectionEquality().equals( + other._transactions, + _transactions, + ) && + const DeepCollectionEquality().equals( + other._transactionTemplates, + _transactionTemplates, + ) && + const DeepCollectionEquality().equals( + other._beneficiaries, + _beneficiaries, + ) && + const DeepCollectionEquality().equals( + other._expenseCategories, + _expenseCategories, + ) && const DeepCollectionEquality().equals(other._budgets, _budgets) && - const DeepCollectionEquality() - .equals(other._budgetItems, _budgetItems) && + const DeepCollectionEquality().equals( + other._budgetItems, + _budgetItems, + ) && (identical(other.activeBudget, activeBudget) || other.activeBudget == activeBudget) && const DeepCollectionEquality().equals(other._loans, _loans) && @@ -447,22 +499,23 @@ class _$CoreStateImpl implements _CoreState { @override int get hashCode => Object.hash( - runtimeType, - activePage, - activeAccountIndex, - activeTransaction, - const DeepCollectionEquality().hash(_accounts), - const DeepCollectionEquality().hash(_recurringTransactions), - const DeepCollectionEquality().hash(_transactions), - const DeepCollectionEquality().hash(_transactionTemplates), - const DeepCollectionEquality().hash(_beneficiaries), - const DeepCollectionEquality().hash(_expenseCategories), - const DeepCollectionEquality().hash(_budgets), - const DeepCollectionEquality().hash(_budgetItems), - activeBudget, - const DeepCollectionEquality().hash(_loans), - activeLoan, - isDeletingAccount); + runtimeType, + activePage, + activeAccountIndex, + activeTransaction, + const DeepCollectionEquality().hash(_accounts), + const DeepCollectionEquality().hash(_recurringTransactions), + const DeepCollectionEquality().hash(_transactions), + const DeepCollectionEquality().hash(_transactionTemplates), + const DeepCollectionEquality().hash(_beneficiaries), + const DeepCollectionEquality().hash(_expenseCategories), + const DeepCollectionEquality().hash(_budgets), + const DeepCollectionEquality().hash(_budgetItems), + activeBudget, + const DeepCollectionEquality().hash(_loans), + activeLoan, + isDeletingAccount, + ); @JsonKey(ignore: true) @override @@ -472,22 +525,23 @@ class _$CoreStateImpl implements _CoreState { } abstract class _CoreState implements CoreState { - const factory _CoreState( - {final OkanePage activePage, - final int? activeAccountIndex, - final TransactionDto? activeTransaction, - final List accounts, - final List recurringTransactions, - final List transactions, - final List transactionTemplates, - final List beneficiaries, - final List expenseCategories, - final List budgets, - final List budgetItems, - final BudgetsDto? activeBudget, - final List loans, - final LoanDto? activeLoan, - final bool isDeletingAccount}) = _$CoreStateImpl; + const factory _CoreState({ + final OkanePage activePage, + final int? activeAccountIndex, + final TransactionDto? activeTransaction, + final List accounts, + final List recurringTransactions, + final List transactions, + final List transactionTemplates, + final List beneficiaries, + final List expenseCategories, + final List budgets, + final List budgetItems, + final BudgetsDto? activeBudget, + final List loans, + final LoanDto? activeLoan, + final bool isDeletingAccount, + }) = _$CoreStateImpl; @override OkanePage get activePage; diff --git a/lib/ui/widgets/account_indicator.dart b/lib/ui/widgets/account_indicator.dart index e60af9f..6a2ba1a 100644 --- a/lib/ui/widgets/account_indicator.dart +++ b/lib/ui/widgets/account_indicator.dart @@ -65,7 +65,7 @@ class AccountSwitcher extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - bloc.activeAccount!.name!, + bloc.activeAccount!.name, style: Theme.of(context).textTheme.titleLarge, ), Icon(Icons.arrow_drop_down),