Transactions

This commit is contained in:
Hillel Coren 2022-09-13 16:43:16 +03:00
parent c7939d1bc9
commit 905e9b7c22
36 changed files with 304 additions and 57 deletions

View File

@ -145,6 +145,7 @@ abstract class CompanyEntity extends Object
clientRegistrationFields: BuiltList<RegistrationFieldEntity>(),
purchaseOrders: BuiltList<InvoiceEntity>(),
bankAccounts: BuiltList<BankAccountEntity>(),
transactions: BuiltList<TransactionEntity>(),
);
}
@ -328,6 +329,8 @@ abstract class CompanyEntity extends Object
@BuiltValueField(wireName: 'bank_integrations')
BuiltList<BankAccountEntity> get bankAccounts;
BuiltList<TransactionEntity> get transactions;
BuiltList<TaskEntity> get tasks;
BuiltList<ProjectEntity> get projects;
@ -596,6 +599,7 @@ abstract class CompanyEntity extends Object
..quotes.clear()
..purchaseOrders.clear()
..bankAccounts.clear()
..transactions.clear()
..credits.clear()
..tasks.clear()
..projects.clear()
@ -678,7 +682,8 @@ abstract class CompanyEntity extends Object
..recurringExpenses.replace(BuiltList<ExpenseEntity>())
..clientRegistrationFields.replace(BuiltList<RegistrationFieldEntity>())
..purchaseOrders.replace(BuiltList<InvoiceEntity>())
..bankAccounts.replace(BuiltList<BankAccountEntity>());
..bankAccounts.replace(BuiltList<BankAccountEntity>())
..transactions.replace(BuiltList<BankAccountEntity>());
static Serializer<CompanyEntity> get serializer => _$companyEntitySerializer;
}

View File

@ -235,6 +235,10 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
serializers.serialize(object.bankAccounts,
specifiedType: const FullType(
BuiltList, const [const FullType(BankAccountEntity)])),
'transactions',
serializers.serialize(object.transactions,
specifiedType: const FullType(
BuiltList, const [const FullType(TransactionEntity)])),
'tasks',
serializers.serialize(object.tasks,
specifiedType:
@ -675,6 +679,12 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
BuiltList, const [const FullType(BankAccountEntity)]))
as BuiltList<Object>);
break;
case 'transactions':
result.transactions.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltList, const [const FullType(TransactionEntity)]))
as BuiltList<Object>);
break;
case 'tasks':
result.tasks.replace(serializers.deserialize(value,
specifiedType: const FullType(
@ -1632,6 +1642,8 @@ class _$CompanyEntity extends CompanyEntity {
@override
final BuiltList<BankAccountEntity> bankAccounts;
@override
final BuiltList<TransactionEntity> transactions;
@override
final BuiltList<TaskEntity> tasks;
@override
final BuiltList<ProjectEntity> projects;
@ -1772,6 +1784,7 @@ class _$CompanyEntity extends CompanyEntity {
this.credits,
this.purchaseOrders,
this.bankAccounts,
this.transactions,
this.tasks,
this.projects,
this.expenses,
@ -1924,6 +1937,8 @@ class _$CompanyEntity extends CompanyEntity {
purchaseOrders, 'CompanyEntity', 'purchaseOrders');
BuiltValueNullFieldError.checkNotNull(
bankAccounts, 'CompanyEntity', 'bankAccounts');
BuiltValueNullFieldError.checkNotNull(
transactions, 'CompanyEntity', 'transactions');
BuiltValueNullFieldError.checkNotNull(tasks, 'CompanyEntity', 'tasks');
BuiltValueNullFieldError.checkNotNull(
projects, 'CompanyEntity', 'projects');
@ -2058,6 +2073,7 @@ class _$CompanyEntity extends CompanyEntity {
credits == other.credits &&
purchaseOrders == other.purchaseOrders &&
bankAccounts == other.bankAccounts &&
transactions == other.transactions &&
tasks == other.tasks &&
projects == other.projects &&
expenses == other.expenses &&
@ -2119,7 +2135,7 @@ class _$CompanyEntity extends CompanyEntity {
$jc(
$jc(
$jc(
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, enableCustomSurchargeTaxes1.hashCode), enableCustomSurchargeTaxes2.hashCode), enableCustomSurchargeTaxes3.hashCode), enableCustomSurchargeTaxes4.hashCode), sizeId.hashCode), industryId.hashCode), subdomain.hashCode), portalMode.hashCode), portalDomain.hashCode), updateProducts.hashCode), convertProductExchangeRate.hashCode), convertRateToClient.hashCode), fillProducts.hashCode), enableProductCost.hashCode), enableProductQuantity.hashCode), enableProductDiscount.hashCode), defaultTaskIsDateBased.hashCode), defaultQuantity.hashCode), showProductDetails.hashCode), clientCanRegister.hashCode), isLarge.hashCode), isDisabled.hashCode), enableShopApi.hashCode), companyKey.hashCode), firstDayOfWeek.hashCode), firstMonthOfYear.hashCode), numberOfInvoiceTaxRates.hashCode), numberOfItemTaxRates.hashCode), numberOfExpenseTaxRates.hashCode), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.hashCode), useQuoteTermsOnConversion.hashCode), enableApplyingPayments.hashCode), trackInventory.hashCode), stockNotificationThreshold.hashCode), stockNotification.hashCode), groups.hashCode), activities.hashCode), taxRates.hashCode), taskStatuses.hashCode), taskStatusMap.hashCode), companyGateways.hashCode), expenseCategories.hashCode), users.hashCode), clients.hashCode), products.hashCode), invoices.hashCode), recurringInvoices.hashCode), recurringExpenses.hashCode), payments.hashCode), quotes.hashCode), credits.hashCode), purchaseOrders.hashCode), bankAccounts.hashCode), tasks.hashCode), projects.hashCode), expenses.hashCode), vendors.hashCode), designs.hashCode), documents.hashCode), tokens.hashCode), webhooks.hashCode), subscriptions.hashCode), paymentTerms.hashCode), systemLogs.hashCode), clientRegistrationFields.hashCode), customFields.hashCode), slackWebhookUrl.hashCode), googleAnalyticsKey.hashCode), markExpensesInvoiceable.hashCode), markExpensesPaid.hashCode), invoiceExpenseDocuments.hashCode), invoiceTaskDocuments.hashCode),
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, enableCustomSurchargeTaxes1.hashCode), enableCustomSurchargeTaxes2.hashCode), enableCustomSurchargeTaxes3.hashCode), enableCustomSurchargeTaxes4.hashCode), sizeId.hashCode), industryId.hashCode), subdomain.hashCode), portalMode.hashCode), portalDomain.hashCode), updateProducts.hashCode), convertProductExchangeRate.hashCode), convertRateToClient.hashCode), fillProducts.hashCode), enableProductCost.hashCode), enableProductQuantity.hashCode), enableProductDiscount.hashCode), defaultTaskIsDateBased.hashCode), defaultQuantity.hashCode), showProductDetails.hashCode), clientCanRegister.hashCode), isLarge.hashCode), isDisabled.hashCode), enableShopApi.hashCode), companyKey.hashCode), firstDayOfWeek.hashCode), firstMonthOfYear.hashCode), numberOfInvoiceTaxRates.hashCode), numberOfItemTaxRates.hashCode), numberOfExpenseTaxRates.hashCode), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.hashCode), useQuoteTermsOnConversion.hashCode), enableApplyingPayments.hashCode), trackInventory.hashCode), stockNotificationThreshold.hashCode), stockNotification.hashCode), groups.hashCode), activities.hashCode), taxRates.hashCode), taskStatuses.hashCode), taskStatusMap.hashCode), companyGateways.hashCode), expenseCategories.hashCode), users.hashCode), clients.hashCode), products.hashCode), invoices.hashCode), recurringInvoices.hashCode), recurringExpenses.hashCode), payments.hashCode), quotes.hashCode), credits.hashCode), purchaseOrders.hashCode), bankAccounts.hashCode), transactions.hashCode), tasks.hashCode), projects.hashCode), expenses.hashCode), vendors.hashCode), designs.hashCode), documents.hashCode), tokens.hashCode), webhooks.hashCode), subscriptions.hashCode), paymentTerms.hashCode), systemLogs.hashCode), clientRegistrationFields.hashCode), customFields.hashCode), slackWebhookUrl.hashCode), googleAnalyticsKey.hashCode), markExpensesInvoiceable.hashCode), markExpensesPaid.hashCode), invoiceExpenseDocuments.hashCode), invoiceTaskDocuments.hashCode),
invoiceTaskTimelog.hashCode),
invoiceTaskDatelog.hashCode),
invoiceTaskProject.hashCode),
@ -2204,6 +2220,7 @@ class _$CompanyEntity extends CompanyEntity {
..add('credits', credits)
..add('purchaseOrders', purchaseOrders)
..add('bankAccounts', bankAccounts)
..add('transactions', transactions)
..add('tasks', tasks)
..add('projects', projects)
..add('expenses', expenses)
@ -2554,6 +2571,12 @@ class CompanyEntityBuilder
set bankAccounts(ListBuilder<BankAccountEntity> bankAccounts) =>
_$this._bankAccounts = bankAccounts;
ListBuilder<TransactionEntity> _transactions;
ListBuilder<TransactionEntity> get transactions =>
_$this._transactions ??= new ListBuilder<TransactionEntity>();
set transactions(ListBuilder<TransactionEntity> transactions) =>
_$this._transactions = transactions;
ListBuilder<TaskEntity> _tasks;
ListBuilder<TaskEntity> get tasks =>
_$this._tasks ??= new ListBuilder<TaskEntity>();
@ -2815,6 +2838,7 @@ class CompanyEntityBuilder
_credits = $v.credits.toBuilder();
_purchaseOrders = $v.purchaseOrders.toBuilder();
_bankAccounts = $v.bankAccounts.toBuilder();
_transactions = $v.transactions.toBuilder();
_tasks = $v.tasks.toBuilder();
_projects = $v.projects.toBuilder();
_expenses = $v.expenses.toBuilder();
@ -2949,6 +2973,7 @@ class CompanyEntityBuilder
credits: credits.build(),
purchaseOrders: purchaseOrders.build(),
bankAccounts: bankAccounts.build(),
transactions: transactions.build(),
tasks: tasks.build(),
projects: projects.build(),
expenses: expenses.build(),
@ -3026,6 +3051,8 @@ class CompanyEntityBuilder
purchaseOrders.build();
_$failedField = 'bankAccounts';
bankAccounts.build();
_$failedField = 'transactions';
transactions.build();
_$failedField = 'tasks';
tasks.build();
_$failedField = 'projects';

View File

@ -42,6 +42,8 @@ class EntityType extends EnumClass {
static const EntityType invoiceItem = _$invoiceItem;
static const EntityType design = _$design;
// STARTER: entity type - do not remove comment
static const EntityType transaction = _$transaction;
static const EntityType bankAccount = _$bankAccount;
static const EntityType recurringExpense = _$recurringExpense;

View File

@ -30,6 +30,7 @@ const EntityType _$gateway = const EntityType._('gateway');
const EntityType _$gatewayToken = const EntityType._('gatewayToken');
const EntityType _$invoiceItem = const EntityType._('invoiceItem');
const EntityType _$design = const EntityType._('design');
const EntityType _$transaction = const EntityType._('transaction');
const EntityType _$bankAccount = const EntityType._('bankAccount');
const EntityType _$recurringExpense = const EntityType._('recurringExpense');
const EntityType _$recurringQuote = const EntityType._('recurringQuote');
@ -102,6 +103,8 @@ EntityType _$typeValueOf(String name) {
return _$invoiceItem;
case 'design':
return _$design;
case 'transaction':
return _$transaction;
case 'bankAccount':
return _$bankAccount;
case 'recurringExpense':
@ -175,6 +178,7 @@ final BuiltSet<EntityType> _$typeValues =
_$gatewayToken,
_$invoiceItem,
_$design,
_$transaction,
_$bankAccount,
_$recurringExpense,
_$recurringQuote,

View File

@ -40,6 +40,7 @@ export 'package:invoiceninja_flutter/data/models/task_status_model.dart';
export 'package:invoiceninja_flutter/data/models/user_model.dart';
export 'package:invoiceninja_flutter/data/models/vendor_model.dart';
export 'package:invoiceninja_flutter/data/models/bank_account_model.dart';
export 'package:invoiceninja_flutter/data/models/transaction_model.dart';
// STARTER: export - do not remove comment
part 'models.g.dart';

View File

@ -48,9 +48,9 @@ import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
import 'package:invoiceninja_flutter/redux/user/user_state.dart';
import 'package:invoiceninja_flutter/redux/vendor/vendor_state.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_state.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_state.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_state.dart';
// STARTER: import - do not remove comment
part 'serializers.g.dart';
@ -115,6 +115,10 @@ part 'serializers.g.dart';
TaxRateItemResponse,
TaxRateListResponse,
// STARTER: serializers - do not remove comment
TransactionEntity,
TransactionListResponse,
TransactionItemResponse,
BankAccountEntity,
BankAccountListResponse,
BankAccountItemResponse,

View File

@ -193,6 +193,11 @@ Serializers _$serializers = (new Serializers().toBuilder()
..add(TokenListResponse.serializer)
..add(TokenState.serializer)
..add(TokenUIState.serializer)
..add(TransactionEntity.serializer)
..add(TransactionItemResponse.serializer)
..add(TransactionListResponse.serializer)
..add(TransactionState.serializer)
..add(TransactionUIState.serializer)
..add(UIState.serializer)
..add(UserCompanyEntity.serializer)
..add(UserCompanyItemResponse.serializer)
@ -420,6 +425,9 @@ Serializers _$serializers = (new Serializers().toBuilder()
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(BankAccountEntity)]),
() => new ListBuilder<BankAccountEntity>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TransactionEntity)]),
() => new ListBuilder<TransactionEntity>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TaskEntity)]),
() => new ListBuilder<TaskEntity>())
@ -551,6 +559,9 @@ Serializers _$serializers = (new Serializers().toBuilder()
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TokenEntity)]),
() => new ListBuilder<TokenEntity>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(TransactionEntity)]),
() => new ListBuilder<TransactionEntity>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(UserCompanyEntity)]),
() => new ListBuilder<UserCompanyEntity>())
@ -891,6 +902,15 @@ Serializers _$serializers = (new Serializers().toBuilder()
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(String)]),
() => new ListBuilder<String>())
..addBuilderFactory(
const FullType(BuiltMap, const [
const FullType(String),
const FullType(TransactionEntity)
]),
() => new MapBuilder<String, TransactionEntity>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(String)]),
() => new ListBuilder<String>())
..addBuilderFactory(
const FullType(BuiltMap,
const [const FullType(String), const FullType(UserEntity)]),

View File

@ -57,6 +57,8 @@ import 'package:invoiceninja_flutter/utils/web_stub.dart'
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_middleware.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_middleware.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_middleware.dart';
@ -100,6 +102,7 @@ void main({bool isTesting = false}) async {
..addAll(createStoreSettingsMiddleware())
..addAll(createStoreReportsMiddleware())
// STARTER: middleware - do not remove comment
..addAll(createStoreTransactionsMiddleware())
..addAll(createStoreBankAccountsMiddleware())
..addAll(createStorePurchaseOrdersMiddleware())
..addAll(createStoreRecurringExpensesMiddleware())

View File

@ -95,6 +95,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/ui/transaction/transaction_screen.dart';
import 'package:invoiceninja_flutter/ui/transaction/edit/transaction_edit_vm.dart';
import 'package:invoiceninja_flutter/ui/transaction/view/transaction_view_vm.dart';
import 'package:invoiceninja_flutter/ui/transaction/transaction_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/bank_account/bank_account_screen.dart';
import 'package:invoiceninja_flutter/ui/bank_account/view/bank_account_view_vm.dart';
import 'package:invoiceninja_flutter/ui/bank_account/bank_account_screen_vm.dart';
@ -507,6 +512,13 @@ class InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
QuoteEmailScreen.route: (context) => QuoteEmailScreen(),
QuotePdfScreen.route: (context) => QuotePdfScreen(),
// STARTER: routes - do not remove comment
TransactionScreen.route: (context) =>
TransactionScreenBuilder(),
TransactionViewScreen.route: (context) =>
TransactionViewScreen(),
TransactionEditScreen.route: (context) =>
TransactionEditScreen(),
BankAccountScreen.route: (context) =>
BankAccountScreenBuilder(),
BankAccountViewScreen.route: (context) =>

View File

@ -65,6 +65,8 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_actions.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_actions.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_actions.dart';
@ -388,6 +390,10 @@ void viewEntitiesByType({
action = ViewGroupList();
break;
// STARTER: view list - do not remove comment
case EntityType.transaction:
action = ViewTransactionList();
break;
case EntityType.bankAccount:
action = ViewBankAccountList();
break;
@ -606,6 +612,13 @@ void viewEntityById({
));
break;
// STARTER: view - do not remove comment
case EntityType.transaction:
store.dispatch(ViewTransaction(
transactionId: entityId,
force: force,
));
break;
case EntityType.bankAccount:
store.dispatch(ViewBankAccount(
bankAccountId: entityId,
@ -845,6 +858,13 @@ void createEntityByType({
));
break;
// STARTER: create type - do not remove comment
case EntityType.transaction:
store.dispatch(EditTransaction(
force: force,
transaction: TransactionEntity(state: state),
));
break;
case EntityType.purchaseOrder:
store.dispatch(EditPurchaseOrder(
force: force,
@ -1060,6 +1080,14 @@ void createEntity({
));
break;
// STARTER: create - do not remove comment
case EntityType.transaction:
store.dispatch(EditTransaction(
transaction: entity,
force: force,
completer: completer,
));
break;
case EntityType.purchaseOrder:
store.dispatch(EditPurchaseOrder(
purchaseOrder: entity,
@ -1253,6 +1281,11 @@ void editEntity({
));
break;
// STARTER: edit - do not remove comment
case EntityType.transaction:
store.dispatch(
EditTransaction(transaction: entity, completer: completer));
break;
case EntityType.purchaseOrder:
store.dispatch(
EditPurchaseOrder(purchaseOrder: entity, completer: completer));
@ -1428,6 +1461,10 @@ void handleEntitiesActions(List<BaseEntity> entities, EntityAction action,
handleDocumentAction(context, entities, action);
break;
// STARTER: actions - do not remove comment
case EntityType.transaction:
handleTransactionAction(context, entities, action);
break;
case EntityType.bankAccount:
handleBankAccountAction(context, entities, action);
break;

View File

@ -32,6 +32,8 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_actions.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_actions.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_actions.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_actions.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_actions.dart';
@ -104,6 +106,10 @@ final lastErrorReducer = combineReducers<String>([
return '${action.error}';
}),
// STARTER: errors - do not remove comment
TypedReducer<String, LoadTransactionsFailure>((state, action) {
return '${action.error}';
}),
TypedReducer<String, LoadBankAccountsFailure>((state, action) {
return '${action.error}';
}),

View File

@ -88,6 +88,10 @@ import 'package:invoiceninja_flutter/utils/colors.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_state.dart';
import 'package:invoiceninja_flutter/ui/transaction/edit/transaction_edit_vm.dart';
import 'package:invoiceninja_flutter/redux/transaction/transaction_selectors.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_state.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_state.dart';
import 'package:invoiceninja_flutter/ui/purchase_order/edit/purchase_order_edit_vm.dart';
@ -293,6 +297,9 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
case EntityType.invoice:
return invoiceState.map;
// STARTER: states switch map - do not remove comment
case EntityType.transaction:
return transactionState.map;
case EntityType.bankAccount:
return bankAccountState.map;
@ -379,6 +386,9 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
case EntityType.invoice:
return invoiceState.list;
// STARTER: states switch list - do not remove comment
case EntityType.transaction:
return transactionState.list;
case EntityType.bankAccount:
return bankAccountState.list;
@ -454,6 +464,9 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
case EntityType.invoice:
return invoiceUIState;
// STARTER: states switch - do not remove comment
case EntityType.transaction:
return transactionUIState;
case EntityType.bankAccount:
return bankAccountUIState;
@ -530,6 +543,11 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
ListUIState get invoiceListState => uiState.invoiceUIState.listUIState;
// STARTER: state getters - do not remove comment
TransactionState get transactionState => userCompanyState.transactionState;
ListUIState get transactionListState =>
uiState.transactionUIState.listUIState;
TransactionUIState get transactionUIState => uiState.transactionUIState;
BankAccountState get bankAccountState => userCompanyState.bankAccountState;
ListUIState get bankAccountListState =>
uiState.bankAccountUIState.listUIState;
@ -711,6 +729,10 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
case CreditEditScreen.route:
return hasCreditChanges(creditUIState.editing, creditState.map);
// STARTER: has changes - do not remove comment
case TransactionEditScreen.route:
return hasTransactionChanges(
transactionUIState.editing, transactionState.map);
case PurchaseOrderEditScreen.route:
return hasPurchaseOrderChanges(
purchaseOrderUIState.editing, purchaseOrderState.map);

View File

@ -36,6 +36,8 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_reducer.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_reducer.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_reducer.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_reducer.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_reducer.dart';
@ -56,6 +58,8 @@ UserCompanyState companyReducer(UserCompanyState state, dynamic action) {
..vendorState.replace(vendorsReducer(state.vendorState, action))
..taskState.replace(tasksReducer(state.taskState, action))
// STARTER: reducer - do not remove comment
..transactionState
.replace(transactionsReducer(state.transactionState, action))
..bankAccountState
.replace(bankAccountsReducer(state.bankAccountState, action))
..purchaseOrderState

View File

@ -32,6 +32,8 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_state.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_state.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_state.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_state.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_state.dart';
@ -55,6 +57,8 @@ abstract class UserCompanyState
paymentState: PaymentState(),
quoteState: QuoteState(),
// STARTER: constructor - do not remove comment
transactionState: TransactionState(),
bankAccountState: BankAccountState(),
purchaseOrderState: PurchaseOrderState(),
@ -108,6 +112,8 @@ abstract class UserCompanyState
QuoteState get quoteState;
// STARTER: fields - do not remove comment
TransactionState get transactionState;
BankAccountState get bankAccountState;
PurchaseOrderState get purchaseOrderState;

View File

@ -55,6 +55,9 @@ class _$UserCompanyStateSerializer
'quoteState',
serializers.serialize(object.quoteState,
specifiedType: const FullType(QuoteState)),
'transactionState',
serializers.serialize(object.transactionState,
specifiedType: const FullType(TransactionState)),
'bankAccountState',
serializers.serialize(object.bankAccountState,
specifiedType: const FullType(BankAccountState)),
@ -176,6 +179,11 @@ class _$UserCompanyStateSerializer
result.quoteState.replace(serializers.deserialize(value,
specifiedType: const FullType(QuoteState)) as QuoteState);
break;
case 'transactionState':
result.transactionState.replace(serializers.deserialize(value,
specifiedType: const FullType(TransactionState))
as TransactionState);
break;
case 'bankAccountState':
result.bankAccountState.replace(serializers.deserialize(value,
specifiedType: const FullType(BankAccountState))
@ -433,6 +441,8 @@ class _$UserCompanyState extends UserCompanyState {
@override
final QuoteState quoteState;
@override
final TransactionState transactionState;
@override
final BankAccountState bankAccountState;
@override
final PurchaseOrderState purchaseOrderState;
@ -482,6 +492,7 @@ class _$UserCompanyState extends UserCompanyState {
this.projectState,
this.paymentState,
this.quoteState,
this.transactionState,
this.bankAccountState,
this.purchaseOrderState,
this.recurringExpenseState,
@ -521,6 +532,8 @@ class _$UserCompanyState extends UserCompanyState {
paymentState, 'UserCompanyState', 'paymentState');
BuiltValueNullFieldError.checkNotNull(
quoteState, 'UserCompanyState', 'quoteState');
BuiltValueNullFieldError.checkNotNull(
transactionState, 'UserCompanyState', 'transactionState');
BuiltValueNullFieldError.checkNotNull(
bankAccountState, 'UserCompanyState', 'bankAccountState');
BuiltValueNullFieldError.checkNotNull(
@ -579,6 +592,7 @@ class _$UserCompanyState extends UserCompanyState {
projectState == other.projectState &&
paymentState == other.paymentState &&
quoteState == other.quoteState &&
transactionState == other.transactionState &&
bankAccountState == other.bankAccountState &&
purchaseOrderState == other.purchaseOrderState &&
recurringExpenseState == other.recurringExpenseState &&
@ -618,10 +632,10 @@ class _$UserCompanyState extends UserCompanyState {
$jc(
$jc(
$jc(
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, lastUpdated.hashCode), userCompany.hashCode), documentState.hashCode), productState.hashCode), clientState.hashCode), invoiceState.hashCode), expenseState.hashCode), vendorState.hashCode), taskState.hashCode),
projectState.hashCode),
paymentState.hashCode),
quoteState.hashCode),
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, lastUpdated.hashCode), userCompany.hashCode), documentState.hashCode), productState.hashCode), clientState.hashCode), invoiceState.hashCode), expenseState.hashCode), vendorState.hashCode), taskState.hashCode), projectState.hashCode),
paymentState.hashCode),
quoteState.hashCode),
transactionState.hashCode),
bankAccountState.hashCode),
purchaseOrderState.hashCode),
recurringExpenseState.hashCode),
@ -655,6 +669,7 @@ class _$UserCompanyState extends UserCompanyState {
..add('projectState', projectState)
..add('paymentState', paymentState)
..add('quoteState', quoteState)
..add('transactionState', transactionState)
..add('bankAccountState', bankAccountState)
..add('purchaseOrderState', purchaseOrderState)
..add('recurringExpenseState', recurringExpenseState)
@ -748,6 +763,12 @@ class UserCompanyStateBuilder
set quoteState(QuoteStateBuilder quoteState) =>
_$this._quoteState = quoteState;
TransactionStateBuilder _transactionState;
TransactionStateBuilder get transactionState =>
_$this._transactionState ??= new TransactionStateBuilder();
set transactionState(TransactionStateBuilder transactionState) =>
_$this._transactionState = transactionState;
BankAccountStateBuilder _bankAccountState;
BankAccountStateBuilder get bankAccountState =>
_$this._bankAccountState ??= new BankAccountStateBuilder();
@ -862,6 +883,7 @@ class UserCompanyStateBuilder
_projectState = $v.projectState.toBuilder();
_paymentState = $v.paymentState.toBuilder();
_quoteState = $v.quoteState.toBuilder();
_transactionState = $v.transactionState.toBuilder();
_bankAccountState = $v.bankAccountState.toBuilder();
_purchaseOrderState = $v.purchaseOrderState.toBuilder();
_recurringExpenseState = $v.recurringExpenseState.toBuilder();
@ -913,6 +935,7 @@ class UserCompanyStateBuilder
projectState: projectState.build(),
paymentState: paymentState.build(),
quoteState: quoteState.build(),
transactionState: transactionState.build(),
bankAccountState: bankAccountState.build(),
purchaseOrderState: purchaseOrderState.build(),
recurringExpenseState: recurringExpenseState.build(),
@ -954,6 +977,8 @@ class UserCompanyStateBuilder
paymentState.build();
_$failedField = 'quoteState';
quoteState.build();
_$failedField = 'transactionState';
transactionState.build();
_$failedField = 'bankAccountState';
bankAccountState.build();
_$failedField = 'purchaseOrderState';

View File

@ -40,6 +40,8 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_actions.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_actions.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_actions.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_actions.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_actions.dart';
@ -551,6 +553,17 @@ Reducer<BuiltList<HistoryRecord>> historyReducer = combineReducers([
_addToHistory(historyList,
HistoryRecord(id: action.group.id, entityType: EntityType.group))),
// STARTER: history - do not remove comment
TypedReducer<BuiltList<HistoryRecord>, ViewTransaction>(
(historyList, action) => _addToHistory(
historyList,
HistoryRecord(
id: action.transactionId, entityType: EntityType.transaction))),
TypedReducer<BuiltList<HistoryRecord>, EditTransaction>(
(historyList, action) => _addToHistory(
historyList,
HistoryRecord(
id: action.transaction.id, entityType: EntityType.transaction))),
TypedReducer<BuiltList<HistoryRecord>, ViewBankAccount>(
(historyList, action) => _addToHistory(
historyList,

View File

@ -51,6 +51,8 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_reducer.dart';
import 'package:invoiceninja_flutter/redux/webhook/webhook_reducer.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_reducer.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_reducer.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_reducer.dart';
@ -80,6 +82,8 @@ UIState uiReducer(UIState state, dynamic action) {
.replace(dashboardUIReducer(state.dashboardUIState, action))
..reportsUIState.replace(reportsUIReducer(state.reportsUIState, action))
// STARTER: reducer - do not remove comment
..transactionUIState
.replace(transactionUIReducer(state.transactionUIState, action))
..bankAccountUIState
.replace(bankAccountUIReducer(state.bankAccountUIState, action))
..purchaseOrderUIState

View File

@ -38,6 +38,8 @@ import 'package:invoiceninja_flutter/ui/auth/login_vm.dart';
import 'package:invoiceninja_flutter/utils/strings.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/transaction/transaction_state.dart';
import 'package:invoiceninja_flutter/redux/bank_account/bank_account_state.dart';
import 'package:invoiceninja_flutter/redux/purchase_order/purchase_order_state.dart';
@ -89,6 +91,9 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
paymentUIState: PaymentUIState(sortFields[EntityType.payment]),
quoteUIState: QuoteUIState(sortFields[EntityType.quote]),
// STARTER: constructor - do not remove comment
transactionUIState:
TransactionUIState(sortFields[EntityType.transaction]),
bankAccountUIState:
BankAccountUIState(sortFields[EntityType.bankAccount]),
@ -142,6 +147,8 @@ abstract class UIState implements Built<UIState, UIStateBuilder> {
InvoiceUIState get invoiceUIState;
// STARTER: properties - do not remove comment
TransactionUIState get transactionUIState;
BankAccountUIState get bankAccountUIState;
PurchaseOrderUIState get purchaseOrderUIState;

View File

@ -53,6 +53,9 @@ class _$UIStateSerializer implements StructuredSerializer<UIState> {
'invoiceUIState',
serializers.serialize(object.invoiceUIState,
specifiedType: const FullType(InvoiceUIState)),
'transactionUIState',
serializers.serialize(object.transactionUIState,
specifiedType: const FullType(TransactionUIState)),
'bankAccountUIState',
serializers.serialize(object.bankAccountUIState,
specifiedType: const FullType(BankAccountUIState)),
@ -215,6 +218,11 @@ class _$UIStateSerializer implements StructuredSerializer<UIState> {
result.invoiceUIState.replace(serializers.deserialize(value,
specifiedType: const FullType(InvoiceUIState)) as InvoiceUIState);
break;
case 'transactionUIState':
result.transactionUIState.replace(serializers.deserialize(value,
specifiedType: const FullType(TransactionUIState))
as TransactionUIState);
break;
case 'bankAccountUIState':
result.bankAccountUIState.replace(serializers.deserialize(value,
specifiedType: const FullType(BankAccountUIState))
@ -361,6 +369,8 @@ class _$UIState extends UIState {
@override
final InvoiceUIState invoiceUIState;
@override
final TransactionUIState transactionUIState;
@override
final BankAccountUIState bankAccountUIState;
@override
final PurchaseOrderUIState purchaseOrderUIState;
@ -428,6 +438,7 @@ class _$UIState extends UIState {
this.productUIState,
this.clientUIState,
this.invoiceUIState,
this.transactionUIState,
this.bankAccountUIState,
this.purchaseOrderUIState,
this.recurringExpenseUIState,
@ -476,6 +487,8 @@ class _$UIState extends UIState {
clientUIState, 'UIState', 'clientUIState');
BuiltValueNullFieldError.checkNotNull(
invoiceUIState, 'UIState', 'invoiceUIState');
BuiltValueNullFieldError.checkNotNull(
transactionUIState, 'UIState', 'transactionUIState');
BuiltValueNullFieldError.checkNotNull(
bankAccountUIState, 'UIState', 'bankAccountUIState');
BuiltValueNullFieldError.checkNotNull(
@ -552,6 +565,7 @@ class _$UIState extends UIState {
productUIState == other.productUIState &&
clientUIState == other.clientUIState &&
invoiceUIState == other.invoiceUIState &&
transactionUIState == other.transactionUIState &&
bankAccountUIState == other.bankAccountUIState &&
purchaseOrderUIState == other.purchaseOrderUIState &&
recurringExpenseUIState == other.recurringExpenseUIState &&
@ -600,7 +614,7 @@ class _$UIState extends UIState {
$jc(
$jc(
$jc(
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, selectedCompanyIndex.hashCode), currentRoute.hashCode), previousRoute.hashCode), loadingEntityType.hashCode), previewStack.hashCode), filterStack.hashCode), filter.hashCode), filterClearedAt.hashCode), lastActivityAt.hashCode), dashboardUIState.hashCode), productUIState.hashCode), clientUIState.hashCode), invoiceUIState.hashCode), bankAccountUIState.hashCode), purchaseOrderUIState.hashCode), recurringExpenseUIState.hashCode), subscriptionUIState.hashCode), taskStatusUIState.hashCode), expenseCategoryUIState.hashCode),
$jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, selectedCompanyIndex.hashCode), currentRoute.hashCode), previousRoute.hashCode), loadingEntityType.hashCode), previewStack.hashCode), filterStack.hashCode), filter.hashCode), filterClearedAt.hashCode), lastActivityAt.hashCode), dashboardUIState.hashCode), productUIState.hashCode), clientUIState.hashCode), invoiceUIState.hashCode), transactionUIState.hashCode), bankAccountUIState.hashCode), purchaseOrderUIState.hashCode), recurringExpenseUIState.hashCode), subscriptionUIState.hashCode), taskStatusUIState.hashCode), expenseCategoryUIState.hashCode),
recurringInvoiceUIState.hashCode),
webhookUIState.hashCode),
tokenUIState.hashCode),
@ -638,6 +652,7 @@ class _$UIState extends UIState {
..add('productUIState', productUIState)
..add('clientUIState', clientUIState)
..add('invoiceUIState', invoiceUIState)
..add('transactionUIState', transactionUIState)
..add('bankAccountUIState', bankAccountUIState)
..add('purchaseOrderUIState', purchaseOrderUIState)
..add('recurringExpenseUIState', recurringExpenseUIState)
@ -739,6 +754,12 @@ class UIStateBuilder implements Builder<UIState, UIStateBuilder> {
set invoiceUIState(InvoiceUIStateBuilder invoiceUIState) =>
_$this._invoiceUIState = invoiceUIState;
TransactionUIStateBuilder _transactionUIState;
TransactionUIStateBuilder get transactionUIState =>
_$this._transactionUIState ??= new TransactionUIStateBuilder();
set transactionUIState(TransactionUIStateBuilder transactionUIState) =>
_$this._transactionUIState = transactionUIState;
BankAccountUIStateBuilder _bankAccountUIState;
BankAccountUIStateBuilder get bankAccountUIState =>
_$this._bankAccountUIState ??= new BankAccountUIStateBuilder();
@ -913,6 +934,7 @@ class UIStateBuilder implements Builder<UIState, UIStateBuilder> {
_productUIState = $v.productUIState.toBuilder();
_clientUIState = $v.clientUIState.toBuilder();
_invoiceUIState = $v.invoiceUIState.toBuilder();
_transactionUIState = $v.transactionUIState.toBuilder();
_bankAccountUIState = $v.bankAccountUIState.toBuilder();
_purchaseOrderUIState = $v.purchaseOrderUIState.toBuilder();
_recurringExpenseUIState = $v.recurringExpenseUIState.toBuilder();
@ -978,6 +1000,7 @@ class UIStateBuilder implements Builder<UIState, UIStateBuilder> {
productUIState: productUIState.build(),
clientUIState: clientUIState.build(),
invoiceUIState: invoiceUIState.build(),
transactionUIState: transactionUIState.build(),
bankAccountUIState: bankAccountUIState.build(),
purchaseOrderUIState: purchaseOrderUIState.build(),
recurringExpenseUIState: recurringExpenseUIState.build(),
@ -1019,6 +1042,8 @@ class UIStateBuilder implements Builder<UIState, UIStateBuilder> {
clientUIState.build();
_$failedField = 'invoiceUIState';
invoiceUIState.build();
_$failedField = 'transactionUIState';
transactionUIState.build();
_$failedField = 'bankAccountUIState';
bankAccountUIState.build();
_$failedField = 'purchaseOrderUIState';

View File

@ -613,6 +613,13 @@ class _MenuDrawerState extends State<MenuDrawer> {
iconTooltip: localization.newExpense,
),
// STARTER: menu - do not remove comment
DrawerTile(
company: company,
entityType: EntityType.transaction,
icon: getEntityIcon(EntityType.transaction),
title: localization.transactions,
),
DrawerTile(
company: company,
entityType: EntityType.recurringExpense,

View File

@ -16,6 +16,18 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'transaction': 'Transaction',
'transactions': 'Transactions',
'new_transaction': 'New Transaction',
'edit_transaction': 'Edit Transaction',
'created_transaction': 'Successfully created transaction',
'updated_transaction': 'Successfully updated transaction',
'archived_transaction': 'Successfully archived transaction',
'deleted_transaction': 'Successfully deleted transaction',
'removed_transaction': 'Successfully removed transaction',
'restored_transaction': 'Successfully restored transaction',
'search_transaction': 'Search Transaction',
'bank_account': 'Bank Account',
'bank_accounts': 'Bank Accounts',
'archived_bank_account': 'Successfully archived bank account',
@ -87232,6 +87244,36 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues['en']['search_bank_account'];
// STARTER: lang field - do not remove comment
String get transaction =>
_localizedValues[localeCode]['transaction'] ??
_localizedValues['en']['transaction'];
String get transactions =>
_localizedValues[localeCode]['transactions'] ??
_localizedValues['en']['transactions'];
String get newTransaction =>
_localizedValues[localeCode]['new_transaction'] ??
_localizedValues['en']['new_transaction'];
String get createdTransaction =>
_localizedValues[localeCode]['created_transaction'] ??
_localizedValues['en']['created_transaction'];
String get updatedTransaction =>
_localizedValues[localeCode]['updated_transaction'] ??
_localizedValues['en']['updated_transaction'];
String get archivedTransaction =>
_localizedValues[localeCode]['archived_transaction'] ??
_localizedValues['en']['archived_transaction'];
String get deletedTransaction =>
_localizedValues[localeCode]['deleted_transaction'] ??
_localizedValues['en']['deleted_transaction'];
String get restoredTransaction =>
_localizedValues[localeCode]['restored_transaction'] ??
_localizedValues['en']['restored_transaction'];
String get editTransaction =>
_localizedValues[localeCode]['edit_transaction'] ??
_localizedValues['en']['edit_transaction'];
String get searchTransaction =>
_localizedValues[localeCode]['search_transaction'] ??
_localizedValues['en']['search_transaction'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);

View File

@ -188,7 +188,7 @@ else
echo "app_state: import"
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_state.dart';import 'package:${package}\/ui\/${module_snake}\/edit\/${module_snake}_edit_vm.dart';import 'package:${package}\/redux\/${module_snake}\/${module_snake}_selectors.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/app/app_state.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/app/app_state.dart
echo "app_state: list"
comment="STARTER: states switch list - do not remove comment"
@ -295,10 +295,6 @@ else
comment="STARTER: sort default - do not remove comment"
code="return ${module_camel}A.${element}.compareTo(${module_camel}B.${element});${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" "./lib/data/models/${module_snake}_model.dart"
comment="STARTER: display name - do not remove comment"
code="return ${element};${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" "./lib/data/models/${module_snake}_model.dart"
fi
if [ "$idx" -eq 1 ]; then
@ -312,7 +308,7 @@ else
echo "main: import"
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_middleware.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/main.dart
sed -i -e "s/$code/$code${lineBreak}$comment/g" ./lib/main.dart
comment="STARTER: middleware - do not remove comment"
code="..addAll(createStore${Modules}Middleware())${lineBreak}"
@ -323,7 +319,7 @@ else
code="${code}import 'package:${package}\/ui\/${module_snake}\/edit\/${module_snake}_edit_vm.dart';${lineBreak}"
code="${code}import 'package:${package}\/ui\/${module_snake}\/view\/${module_snake}_view_vm.dart';${lineBreak}"
code="${code}import 'package:${package}\/ui\/${module_snake}\/${module_snake}_screen_vm.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/main_app.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/main_app.dart
comment="STARTER: routes - do not remove comment"
code="${Module}Screen.route: (context) => ${Module}ScreenBuilder(),${lineBreak}"
@ -336,9 +332,8 @@ else
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/data/models/models.dart
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/data\/models\/${module_snake}_model.dart';${lineBreak}"
code="${code}import 'package:${package}\/redux\/${module_snake}\/${module_snake}_state.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/data/models/serializers.dart
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_state.dart';${lineBreak}"
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/data/models/serializers.dart
comment="STARTER: serializers - do not remove comment"
code="${Module}Entity,${lineBreak}${Module}ListResponse,${lineBreak}${Module}ItemResponse,${lineBreak}"
@ -346,7 +341,7 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_state.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/company/company_state.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/company/company_state.dart
comment="STARTER: fields - do not remove comment"
code="${Module}State get ${module_camel}State;${lineBreak}"
@ -358,7 +353,7 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_reducer.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/company/company_reducer.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/company/company_reducer.dart
comment="STARTER: reducer - do not remove comment"
code="..${module_camel}State.replace(${modules_camel}Reducer(state.${module_camel}State, action))${lineBreak}"
@ -375,7 +370,7 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_state.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/ui/ui_state.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/ui/ui_state.dart
comment="STARTER: properties - do not remove comment"
code="${Module}UIState get ${module_camel}UIState;${lineBreak}"
@ -387,7 +382,7 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_reducer.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/ui/ui_reducer.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/ui/ui_reducer.dart
comment="STARTER: reducer - do not remove comment"
code="..${module_camel}UIState.replace(${module_camel}UIReducer(state.${module_camel}UIState, action))${lineBreak}"
@ -395,7 +390,7 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_actions.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/app/app_reducer.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/app/app_reducer.dart
comment="STARTER: errors - do not remove comment"
code="TypedReducer<String, Load${Modules}Failure>((state, action) { return '\${action.error}'; }),${lineBreak}"
@ -407,11 +402,11 @@ else
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_actions.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/ui/pref_reducer.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/ui/pref_reducer.dart
comment="STARTER: import - do not remove comment"
code="import 'package:${package}\/redux\/${module_snake}\/${module_snake}_actions.dart';${lineBreak}"
sed -i -e "s/$comment/$comment${lineBreak}$code/g" ./lib/redux/app/app_actions.dart
sed -i -e "s/$comment/$code${lineBreak}$comment/g" ./lib/redux/app/app_actions.dart
comment="STARTER: view list - do not remove comment"
code="case EntityType.${module_camel}: action = View${Module}List(); break;${lineBreak}"

View File

@ -73,10 +73,6 @@ abstract class StubEntity extends Object with BaseEntity implements Built<StubEn
@override
EntityType get entityType => EntityType.stub;
String get displayName {
// STARTER: display name - do not remove comment
}
@override
List<EntityAction> getActions(
@ -121,8 +117,7 @@ abstract class StubEntity extends Object with BaseEntity implements Built<StubEn
bool matchesFilter(String filter) {
return matchesStrings(
haystacks: [
name,
type,
//
],
needle: filter,
);
@ -132,8 +127,7 @@ abstract class StubEntity extends Object with BaseEntity implements Built<StubEn
String matchesFilterValue(String filter) {
return matchesStringsValue(
haystacks: [
name,
type,
//
],
needle: filter,
);

View File

@ -2,7 +2,6 @@ import 'dart:convert';
import 'dart:core';
import 'package:built_collection/built_collection.dart';
import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/data/models/serializers.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';

View File

@ -3,8 +3,6 @@ import 'package:flutter/widgets.dart';
import 'package:redux/redux.dart';
import 'package:invoiceninja_flutter/main_app.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:invoiceninja_flutter/redux/app/app_middleware.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
import 'package:invoiceninja_flutter/ui/stub/stub_screen.dart';

View File

@ -7,7 +7,6 @@ import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
import 'package:invoiceninja_flutter/redux/stub/stub_actions.dart';
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
import 'package:invoiceninja_flutter/redux/stub/stub_state.dart';
import 'package:invoiceninja_flutter/data/models/entities.dart';
EntityUIState stubUIReducer(StubUIState state, dynamic action) {
return state.rebuild((b) => b

View File

@ -1,4 +1,3 @@
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/redux/static/static_state.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:memoize/memoize.dart';
@ -84,7 +83,7 @@ List<String> filteredStubsSelector(
list.sort((stubAId, stubBId) {
final stubA = stubMap[stubAId];
final stubB = stubMap[stubBId];
return stubAA.compareTo(stubB, stubListState.sortField,
return stubA.compareTo(stubB, stubListState.sortField,
stubListState.sortAscending);
});

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:built_collection/built_collection.dart';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart';
import 'package:invoiceninja_flutter/ui/app/form_card.dart';

View File

@ -1,17 +1,14 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:redux/redux.dart';
import 'package:invoiceninja_flutter/utils/completers.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart';
import 'package:invoiceninja_flutter/ui/stub/view/stub_view_vm.dart';
import 'package:invoiceninja_flutter/redux/stub/stub_actions.dart';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/ui/stub/edit/stub_edit.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';

View File

@ -1,10 +1,8 @@
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/ui/app/entity_state_label.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/dismissible_entity.dart';

View File

@ -1,13 +1,10 @@
import 'dart:async';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/ui/app/entities/entity_actions_dialog.dart';
import 'package:invoiceninja_flutter/ui/app/tables/entity_list.dart';
import 'package:invoiceninja_flutter/ui/stub/stub_list_item.dart';
import 'package:invoiceninja_flutter/ui/stub/stub_presenter.dart';
import 'package:redux/redux.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:built_collection/built_collection.dart';
@ -88,8 +85,10 @@ class StubListVM {
state: state,
userCompany: state.userCompany,
listState: state.stubListState,
stubList: memoizedFilteredStubList(state.stubState.map,
state.stubState.list, state.stubListState),
stubList: memoizedFilteredStubList(state.getUISelection(EntityType.stub),
state.stubState.map,
state.stubState.list,
state.stubListState),
stubMap: state.stubState.map,
isLoading: state.isLoading,
filter: state.stubUIState.listUIState.filter,

View File

@ -27,7 +27,6 @@ class StubScreen extends StatelessWidget {
Widget build(BuildContext context) {
final store = StoreProvider.of<AppState>(context);
final state = store.state;
final company = state.company;
final userCompany = state.userCompany;
final localization = AppLocalization.of(context);

View File

@ -1,5 +1,4 @@
import 'package:built_collection/built_collection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_redux/flutter_redux.dart';

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/ui/app/scrollable_listview.dart';
import 'package:invoiceninja_flutter/ui/stub/view/stub_view_vm.dart';

View File

@ -1,13 +1,11 @@
import 'dart:async';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/utils/completers.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:redux/redux.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/redux/stub/stub_actions.dart';
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/stub/view/stub_view.dart';
import 'package:invoiceninja_flutter/redux/app/app_state.dart';