diff --git a/lib/data/models/client_model.dart b/lib/data/models/client_model.dart index 045f8c568..72ab2d314 100644 --- a/lib/data/models/client_model.dart +++ b/lib/data/models/client_model.dart @@ -57,6 +57,7 @@ abstract class ClientEntity extends Object factory ClientEntity({String id}) { return _$ClientEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, name: '', displayName: '', balance: 0.0, @@ -459,6 +460,7 @@ abstract class ContactEntity extends Object factory ContactEntity() { return _$ContactEntity._( id: BaseEntity.nextId, + isChanged: false, firstName: '', lastName: '', email: '', diff --git a/lib/data/models/client_model.g.dart b/lib/data/models/client_model.g.dart index a37c395da..9c6162817 100644 --- a/lib/data/models/client_model.g.dart +++ b/lib/data/models/client_model.g.dart @@ -900,6 +900,8 @@ class _$ClientEntity extends ClientEntity { @override final BuiltList activities; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -954,6 +956,7 @@ class _$ClientEntity extends ClientEntity { this.customValue2, this.contacts, this.activities, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1073,6 +1076,9 @@ class _$ClientEntity extends ClientEntity { if (activities == null) { throw new BuiltValueNullFieldError('ClientEntity', 'activities'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ClientEntity', 'isChanged'); + } } @override @@ -1124,6 +1130,7 @@ class _$ClientEntity extends ClientEntity { customValue2 == other.customValue2 && contacts == other.contacts && activities == other.activities && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1152,20 +1159,20 @@ class _$ClientEntity extends ClientEntity { $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, lastUpdatedActivities.hashCode), name.hashCode), displayName.hashCode), balance.hashCode), paidToDate.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), workPhone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), industryId.hashCode), sizeId.hashCode), paymentTerms.hashCode), vatNumber.hashCode), idNumber.hashCode), languageId.hashCode), currencyId.hashCode), invoiceNumberCounter.hashCode), quoteNumberCounter.hashCode), taskRate.hashCode), - shippingAddress1.hashCode), - shippingAddress2.hashCode), - shippingCity.hashCode), - shippingState.hashCode), - shippingPostalCode.hashCode), - shippingCountryId.hashCode), - showTasksInPortal.hashCode), - sendReminders.hashCode), - creditNumberCounter.hashCode), - customValue1.hashCode), - customValue2.hashCode), - contacts.hashCode), - activities.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(0, lastUpdatedActivities.hashCode), name.hashCode), displayName.hashCode), balance.hashCode), paidToDate.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), workPhone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), industryId.hashCode), sizeId.hashCode), paymentTerms.hashCode), vatNumber.hashCode), idNumber.hashCode), languageId.hashCode), currencyId.hashCode), invoiceNumberCounter.hashCode), quoteNumberCounter.hashCode), taskRate.hashCode), shippingAddress1.hashCode), + shippingAddress2.hashCode), + shippingCity.hashCode), + shippingState.hashCode), + shippingPostalCode.hashCode), + shippingCountryId.hashCode), + showTasksInPortal.hashCode), + sendReminders.hashCode), + creditNumberCounter.hashCode), + customValue1.hashCode), + customValue2.hashCode), + contacts.hashCode), + activities.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -1215,6 +1222,7 @@ class _$ClientEntity extends ClientEntity { ..add('customValue2', customValue2) ..add('contacts', contacts) ..add('activities', activities) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1396,6 +1404,10 @@ class ClientEntityBuilder set activities(ListBuilder activities) => _$this._activities = activities; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1462,6 +1474,7 @@ class ClientEntityBuilder _customValue2 = _$v.customValue2; _contacts = _$v.contacts?.toBuilder(); _activities = _$v.activities?.toBuilder(); + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1530,6 +1543,7 @@ class ClientEntityBuilder customValue2: customValue2, contacts: contacts.build(), activities: activities.build(), + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, @@ -1576,6 +1590,8 @@ class _$ContactEntity extends ContactEntity { @override final String customValue2; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -1602,6 +1618,7 @@ class _$ContactEntity extends ContactEntity { this.sendInvoice, this.customValue1, this.customValue2, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1636,6 +1653,9 @@ class _$ContactEntity extends ContactEntity { if (customValue2 == null) { throw new BuiltValueNullFieldError('ContactEntity', 'customValue2'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ContactEntity', 'isChanged'); + } } @override @@ -1659,6 +1679,7 @@ class _$ContactEntity extends ContactEntity { sendInvoice == other.sendInvoice && customValue1 == other.customValue1 && customValue2 == other.customValue2 && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1685,19 +1706,21 @@ class _$ContactEntity extends ContactEntity { $jc( $jc( $jc( - 0, - firstName + $jc( + 0, + firstName + .hashCode), + lastName .hashCode), - lastName - .hashCode), - email.hashCode), - password.hashCode), - phone.hashCode), - contactKey.hashCode), - isPrimary.hashCode), - sendInvoice.hashCode), - customValue1.hashCode), - customValue2.hashCode), + email.hashCode), + password.hashCode), + phone.hashCode), + contactKey.hashCode), + isPrimary.hashCode), + sendInvoice.hashCode), + customValue1.hashCode), + customValue2.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -1719,6 +1742,7 @@ class _$ContactEntity extends ContactEntity { ..add('sendInvoice', sendInvoice) ..add('customValue1', customValue1) ..add('customValue2', customValue2) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1773,6 +1797,10 @@ class ContactEntityBuilder String get customValue2 => _$this._customValue2; set customValue2(String customValue2) => _$this._customValue2 = customValue2; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1811,6 +1839,7 @@ class ContactEntityBuilder _sendInvoice = _$v.sendInvoice; _customValue1 = _$v.customValue1; _customValue2 = _$v.customValue2; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1849,6 +1878,7 @@ class ContactEntityBuilder sendInvoice: sendInvoice, customValue1: customValue1, customValue2: customValue2, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/credit_model.dart b/lib/data/models/credit_model.dart index e9426736a..6f4de21e2 100644 --- a/lib/data/models/credit_model.dart +++ b/lib/data/models/credit_model.dart @@ -53,6 +53,7 @@ abstract class CreditEntity extends Object factory CreditEntity() { return _$CreditEntity._( id: BaseEntity.nextId, + isChanged: false, amount: 0.0, balance: 0.0, creditDate: '', diff --git a/lib/data/models/credit_model.g.dart b/lib/data/models/credit_model.g.dart index 5f6a49bd4..23af4cf6d 100644 --- a/lib/data/models/credit_model.g.dart +++ b/lib/data/models/credit_model.g.dart @@ -446,6 +446,8 @@ class _$CreditEntity extends CreditEntity { @override final int clientId; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -469,6 +471,7 @@ class _$CreditEntity extends CreditEntity { this.privateNotes, this.publicNotes, this.clientId, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -497,6 +500,9 @@ class _$CreditEntity extends CreditEntity { if (clientId == null) { throw new BuiltValueNullFieldError('CreditEntity', 'clientId'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('CreditEntity', 'isChanged'); + } } @override @@ -517,6 +523,7 @@ class _$CreditEntity extends CreditEntity { privateNotes == other.privateNotes && publicNotes == other.publicNotes && clientId == other.clientId && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -538,13 +545,15 @@ class _$CreditEntity extends CreditEntity { $jc( $jc( $jc( - $jc($jc(0, amount.hashCode), - balance.hashCode), - creditDate.hashCode), - creditNumber.hashCode), - privateNotes.hashCode), - publicNotes.hashCode), - clientId.hashCode), + $jc( + $jc($jc(0, amount.hashCode), + balance.hashCode), + creditDate.hashCode), + creditNumber.hashCode), + privateNotes.hashCode), + publicNotes.hashCode), + clientId.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -563,6 +572,7 @@ class _$CreditEntity extends CreditEntity { ..add('privateNotes', privateNotes) ..add('publicNotes', publicNotes) ..add('clientId', clientId) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -605,6 +615,10 @@ class CreditEntityBuilder int get clientId => _$this._clientId; set clientId(int clientId) => _$this._clientId = clientId; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -640,6 +654,7 @@ class CreditEntityBuilder _privateNotes = _$v.privateNotes; _publicNotes = _$v.publicNotes; _clientId = _$v.clientId; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -675,6 +690,7 @@ class CreditEntityBuilder privateNotes: privateNotes, publicNotes: publicNotes, clientId: clientId, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/document_model.dart b/lib/data/models/document_model.dart index 058f5718f..6336a56cb 100644 --- a/lib/data/models/document_model.dart +++ b/lib/data/models/document_model.dart @@ -48,6 +48,7 @@ abstract class DocumentEntity extends Object factory DocumentEntity({String id}) { return _$DocumentEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, name: '', path: '', type: '', diff --git a/lib/data/models/document_model.g.dart b/lib/data/models/document_model.g.dart index 7a9a34db3..2e921537d 100644 --- a/lib/data/models/document_model.g.dart +++ b/lib/data/models/document_model.g.dart @@ -484,6 +484,8 @@ class _$DocumentEntity extends DocumentEntity { @override final bool isDefault; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -510,6 +512,7 @@ class _$DocumentEntity extends DocumentEntity { this.invoiceId, this.expenseId, this.isDefault, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -541,6 +544,9 @@ class _$DocumentEntity extends DocumentEntity { if (isDefault == null) { throw new BuiltValueNullFieldError('DocumentEntity', 'isDefault'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('DocumentEntity', 'isChanged'); + } } @override @@ -565,6 +571,7 @@ class _$DocumentEntity extends DocumentEntity { invoiceId == other.invoiceId && expenseId == other.expenseId && isDefault == other.isDefault && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -590,17 +597,19 @@ class _$DocumentEntity extends DocumentEntity { $jc( $jc( $jc( - $jc(0, - name.hashCode), - type.hashCode), - path.hashCode), - width.hashCode), - height.hashCode), - size.hashCode), - preview.hashCode), - invoiceId.hashCode), - expenseId.hashCode), - isDefault.hashCode), + $jc( + $jc(0, + name.hashCode), + type.hashCode), + path.hashCode), + width.hashCode), + height.hashCode), + size.hashCode), + preview.hashCode), + invoiceId.hashCode), + expenseId.hashCode), + isDefault.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -622,6 +631,7 @@ class _$DocumentEntity extends DocumentEntity { ..add('invoiceId', invoiceId) ..add('expenseId', expenseId) ..add('isDefault', isDefault) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -676,6 +686,10 @@ class DocumentEntityBuilder bool get isDefault => _$this._isDefault; set isDefault(bool isDefault) => _$this._isDefault = isDefault; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -714,6 +728,7 @@ class DocumentEntityBuilder _invoiceId = _$v.invoiceId; _expenseId = _$v.expenseId; _isDefault = _$v.isDefault; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -752,6 +767,7 @@ class DocumentEntityBuilder invoiceId: invoiceId, expenseId: expenseId, isDefault: isDefault, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/entities.dart b/lib/data/models/entities.dart index 7fc2ff91f..8d95e6635 100644 --- a/lib/data/models/entities.dart +++ b/lib/data/models/entities.dart @@ -115,6 +115,9 @@ abstract class BaseEntity implements SelectableEntity { static String get nextId => '${--counter}'; + @BuiltValueField(serialize: false) + bool get isChanged; + @nullable @BuiltValueField(wireName: 'created_at') int get createdAt; diff --git a/lib/data/models/expense_model.dart b/lib/data/models/expense_model.dart index 06c10ba68..aea5c767d 100644 --- a/lib/data/models/expense_model.dart +++ b/lib/data/models/expense_model.dart @@ -75,6 +75,7 @@ abstract class ExpenseEntity extends Object ClientEntity client}) { return _$ExpenseEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, privateNotes: '', publicNotes: '', shouldBeInvoiced: false, @@ -383,6 +384,7 @@ abstract class ExpenseCategoryEntity extends Object factory ExpenseCategoryEntity() { return _$ExpenseCategoryEntity._( id: BaseEntity.nextId, + isChanged: false, name: '', isDeleted: false, ); diff --git a/lib/data/models/expense_model.g.dart b/lib/data/models/expense_model.g.dart index 877fe8290..a5e43de21 100644 --- a/lib/data/models/expense_model.g.dart +++ b/lib/data/models/expense_model.g.dart @@ -779,6 +779,8 @@ class _$ExpenseEntity extends ExpenseEntity { @override final String customValue2; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -819,6 +821,7 @@ class _$ExpenseEntity extends ExpenseEntity { this.vendorId, this.customValue1, this.customValue2, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -887,6 +890,9 @@ class _$ExpenseEntity extends ExpenseEntity { if (customValue2 == null) { throw new BuiltValueNullFieldError('ExpenseEntity', 'customValue2'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ExpenseEntity', 'isChanged'); + } } @override @@ -924,6 +930,7 @@ class _$ExpenseEntity extends ExpenseEntity { vendorId == other.vendorId && customValue1 == other.customValue1 && customValue2 == other.customValue2 && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -952,20 +959,20 @@ class _$ExpenseEntity extends ExpenseEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, privateNotes.hashCode), publicNotes.hashCode), shouldBeInvoiced.hashCode), invoiceDocuments.hashCode), transactionId.hashCode), transactionReference.hashCode), bankId.hashCode), expenseCurrencyId.hashCode), categoryId.hashCode), amount.hashCode), expenseDate.hashCode), - paymentDate.hashCode), - exchangeRate.hashCode), - invoiceCurrencyId.hashCode), - paymentTypeId.hashCode), - taxName1.hashCode), - taxName2.hashCode), - taxRate1.hashCode), - taxRate2.hashCode), - clientId.hashCode), - invoiceId.hashCode), - vendorId.hashCode), - customValue1.hashCode), - customValue2.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, privateNotes.hashCode), publicNotes.hashCode), shouldBeInvoiced.hashCode), invoiceDocuments.hashCode), transactionId.hashCode), transactionReference.hashCode), bankId.hashCode), expenseCurrencyId.hashCode), categoryId.hashCode), amount.hashCode), expenseDate.hashCode), paymentDate.hashCode), + exchangeRate.hashCode), + invoiceCurrencyId.hashCode), + paymentTypeId.hashCode), + taxName1.hashCode), + taxName2.hashCode), + taxRate1.hashCode), + taxRate2.hashCode), + clientId.hashCode), + invoiceId.hashCode), + vendorId.hashCode), + customValue1.hashCode), + customValue2.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -1001,6 +1008,7 @@ class _$ExpenseEntity extends ExpenseEntity { ..add('vendorId', vendorId) ..add('customValue1', customValue1) ..add('customValue2', customValue2) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1118,6 +1126,10 @@ class ExpenseEntityBuilder String get customValue2 => _$this._customValue2; set customValue2(String customValue2) => _$this._customValue2 = customValue2; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1170,6 +1182,7 @@ class ExpenseEntityBuilder _vendorId = _$v.vendorId; _customValue1 = _$v.customValue1; _customValue2 = _$v.customValue2; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1222,6 +1235,7 @@ class ExpenseEntityBuilder vendorId: vendorId, customValue1: customValue1, customValue2: customValue2, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, @@ -1237,6 +1251,8 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { @override final String name; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -1255,6 +1271,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { _$ExpenseCategoryEntity._( {this.name, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1265,6 +1282,9 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { if (name == null) { throw new BuiltValueNullFieldError('ExpenseCategoryEntity', 'name'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ExpenseCategoryEntity', 'isChanged'); + } } @override @@ -1281,6 +1301,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { if (identical(other, this)) return true; return other is ExpenseCategoryEntity && name == other.name && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1295,7 +1316,9 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { $jc( $jc( $jc( - $jc($jc($jc(0, name.hashCode), createdAt.hashCode), + $jc( + $jc($jc($jc(0, name.hashCode), isChanged.hashCode), + createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), isDeleted.hashCode), @@ -1307,6 +1330,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { String toString() { return (newBuiltValueToStringHelper('ExpenseCategoryEntity') ..add('name', name) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1325,6 +1349,10 @@ class ExpenseCategoryEntityBuilder String get name => _$this._name; set name(String name) => _$this._name = name; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1354,6 +1382,7 @@ class ExpenseCategoryEntityBuilder ExpenseCategoryEntityBuilder get _$this { if (_$v != null) { _name = _$v.name; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1383,6 +1412,7 @@ class ExpenseCategoryEntityBuilder final _$result = _$v ?? new _$ExpenseCategoryEntity._( name: name, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/invoice_model.dart b/lib/data/models/invoice_model.dart index 443c2f05d..abf69a19e 100644 --- a/lib/data/models/invoice_model.dart +++ b/lib/data/models/invoice_model.dart @@ -90,6 +90,7 @@ abstract class InvoiceEntity extends Object {String id, bool isQuote = false, CompanyEntity company}) { return _$InvoiceEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, amount: 0.0, balance: 0.0, clientId: '', @@ -533,6 +534,7 @@ abstract class InvoiceItemEntity extends Object factory InvoiceItemEntity() { return _$InvoiceItemEntity._( id: BaseEntity.nextId, + isChanged: false, productKey: '', notes: '', cost: 0.0, @@ -664,6 +666,7 @@ abstract class InvitationEntity extends Object factory InvitationEntity() { return _$InvitationEntity._( id: BaseEntity.nextId, + isChanged: false, key: '', link: '', sentDate: '', diff --git a/lib/data/models/invoice_model.g.dart b/lib/data/models/invoice_model.g.dart index dcff78197..6ec692b77 100644 --- a/lib/data/models/invoice_model.g.dart +++ b/lib/data/models/invoice_model.g.dart @@ -1108,6 +1108,8 @@ class _$InvoiceEntity extends InvoiceEntity { @override final String designId; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -1167,6 +1169,7 @@ class _$InvoiceEntity extends InvoiceEntity { this.invoiceItems, this.invitations, this.designId, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1300,6 +1303,9 @@ class _$InvoiceEntity extends InvoiceEntity { if (invitations == null) { throw new BuiltValueNullFieldError('InvoiceEntity', 'invitations'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('InvoiceEntity', 'isChanged'); + } } @override @@ -1356,6 +1362,7 @@ class _$InvoiceEntity extends InvoiceEntity { invoiceItems == other.invoiceItems && invitations == other.invitations && designId == other.designId && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1384,20 +1391,20 @@ class _$InvoiceEntity extends InvoiceEntity { $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, amount.hashCode), balance.hashCode), isQuote.hashCode), clientId.hashCode), invoiceStatusId.hashCode), invoiceNumber.hashCode), discount.hashCode), poNumber.hashCode), invoiceDate.hashCode), dueDate.hashCode), terms.hashCode), publicNotes.hashCode), privateNotes.hashCode), invoiceTypeId.hashCode), isRecurring.hashCode), frequencyId.hashCode), startDate.hashCode), endDate.hashCode), lastSentDate.hashCode), recurringInvoiceId.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), taxRate2.hashCode), isAmountDiscount.hashCode), invoiceFooter.hashCode), partial.hashCode), partialDueDate.hashCode), hasTasks.hashCode), autoBill.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customTaxes1.hashCode), - customTaxes2.hashCode), - hasExpenses.hashCode), - quoteInvoiceId.hashCode), - customTextValue1.hashCode), - customTextValue2.hashCode), - isPublic.hashCode), - filename.hashCode), - invoiceItems.hashCode), - invitations.hashCode), - designId.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(0, amount.hashCode), balance.hashCode), isQuote.hashCode), clientId.hashCode), invoiceStatusId.hashCode), invoiceNumber.hashCode), discount.hashCode), poNumber.hashCode), invoiceDate.hashCode), dueDate.hashCode), terms.hashCode), publicNotes.hashCode), privateNotes.hashCode), invoiceTypeId.hashCode), isRecurring.hashCode), frequencyId.hashCode), startDate.hashCode), endDate.hashCode), lastSentDate.hashCode), recurringInvoiceId.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), taxRate2.hashCode), isAmountDiscount.hashCode), invoiceFooter.hashCode), partial.hashCode), partialDueDate.hashCode), hasTasks.hashCode), autoBill.hashCode), customValue1.hashCode), + customValue2.hashCode), + customTaxes1.hashCode), + customTaxes2.hashCode), + hasExpenses.hashCode), + quoteInvoiceId.hashCode), + customTextValue1.hashCode), + customTextValue2.hashCode), + isPublic.hashCode), + filename.hashCode), + invoiceItems.hashCode), + invitations.hashCode), + designId.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -1452,6 +1459,7 @@ class _$InvoiceEntity extends InvoiceEntity { ..add('invoiceItems', invoiceItems) ..add('invitations', invitations) ..add('designId', designId) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1651,6 +1659,10 @@ class InvoiceEntityBuilder String get designId => _$this._designId; set designId(String designId) => _$this._designId = designId; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1722,6 +1734,7 @@ class InvoiceEntityBuilder _invoiceItems = _$v.invoiceItems?.toBuilder(); _invitations = _$v.invitations?.toBuilder(); _designId = _$v.designId; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1795,6 +1808,7 @@ class InvoiceEntityBuilder invoiceItems: invoiceItems.build(), invitations: invitations.build(), designId: designId, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, @@ -1849,6 +1863,8 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { @override final String expenseId; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -1880,6 +1896,7 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { this.discount, this.taskId, this.expenseId, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1924,6 +1941,9 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { if (discount == null) { throw new BuiltValueNullFieldError('InvoiceItemEntity', 'discount'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('InvoiceItemEntity', 'isChanged'); + } } @override @@ -1952,6 +1972,7 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { discount == other.discount && taskId == other.taskId && expenseId == other.expenseId && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1980,20 +2001,20 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { $jc( $jc( $jc( - $jc($jc(0, productKey.hashCode), - notes.hashCode), - cost.hashCode), - qty.hashCode), - taxName1.hashCode), - taxRate1.hashCode), - taxName2.hashCode), - taxRate2.hashCode), - invoiceItemTypeId.hashCode), - customValue1.hashCode), - customValue2.hashCode), - discount.hashCode), - taskId.hashCode), - expenseId.hashCode), + $jc($jc($jc(0, productKey.hashCode), notes.hashCode), + cost.hashCode), + qty.hashCode), + taxName1.hashCode), + taxRate1.hashCode), + taxName2.hashCode), + taxRate2.hashCode), + invoiceItemTypeId.hashCode), + customValue1.hashCode), + customValue2.hashCode), + discount.hashCode), + taskId.hashCode), + expenseId.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -2019,6 +2040,7 @@ class _$InvoiceItemEntity extends InvoiceItemEntity { ..add('discount', discount) ..add('taskId', taskId) ..add('expenseId', expenseId) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -2090,6 +2112,10 @@ class InvoiceItemEntityBuilder String get expenseId => _$this._expenseId; set expenseId(String expenseId) => _$this._expenseId = expenseId; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -2132,6 +2158,7 @@ class InvoiceItemEntityBuilder _discount = _$v.discount; _taskId = _$v.taskId; _expenseId = _$v.expenseId; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -2174,6 +2201,7 @@ class InvoiceItemEntityBuilder discount: discount, taskId: taskId, expenseId: expenseId, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, @@ -2195,6 +2223,8 @@ class _$InvitationEntity extends InvitationEntity { @override final String viewedDate; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -2216,6 +2246,7 @@ class _$InvitationEntity extends InvitationEntity { this.link, this.sentDate, this.viewedDate, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -2235,6 +2266,9 @@ class _$InvitationEntity extends InvitationEntity { if (viewedDate == null) { throw new BuiltValueNullFieldError('InvitationEntity', 'viewedDate'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('InvitationEntity', 'isChanged'); + } } @override @@ -2253,6 +2287,7 @@ class _$InvitationEntity extends InvitationEntity { link == other.link && sentDate == other.sentDate && viewedDate == other.viewedDate && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -2270,9 +2305,13 @@ class _$InvitationEntity extends InvitationEntity { $jc( $jc( $jc( - $jc($jc($jc(0, key.hashCode), link.hashCode), - sentDate.hashCode), - viewedDate.hashCode), + $jc( + $jc( + $jc($jc(0, key.hashCode), + link.hashCode), + sentDate.hashCode), + viewedDate.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -2288,6 +2327,7 @@ class _$InvitationEntity extends InvitationEntity { ..add('link', link) ..add('sentDate', sentDate) ..add('viewedDate', viewedDate) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -2318,6 +2358,10 @@ class InvitationEntityBuilder String get viewedDate => _$this._viewedDate; set viewedDate(String viewedDate) => _$this._viewedDate = viewedDate; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -2350,6 +2394,7 @@ class InvitationEntityBuilder _link = _$v.link; _sentDate = _$v.sentDate; _viewedDate = _$v.viewedDate; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -2382,6 +2427,7 @@ class InvitationEntityBuilder link: link, sentDate: sentDate, viewedDate: viewedDate, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/payment_model.dart b/lib/data/models/payment_model.dart index 15109214a..f4bcabaed 100644 --- a/lib/data/models/payment_model.dart +++ b/lib/data/models/payment_model.dart @@ -57,6 +57,7 @@ abstract class PaymentEntity extends Object factory PaymentEntity({String id, CompanyEntity company}) { return _$PaymentEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, amount: 0.0, transactionReference: '', paymentDate: convertDateTimeToSqlDate(), diff --git a/lib/data/models/payment_model.g.dart b/lib/data/models/payment_model.g.dart index c1988b780..a64def308 100644 --- a/lib/data/models/payment_model.g.dart +++ b/lib/data/models/payment_model.g.dart @@ -503,6 +503,8 @@ class _$PaymentEntity extends PaymentEntity { @override final String exchangeCurrencyId; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -531,6 +533,7 @@ class _$PaymentEntity extends PaymentEntity { this.privateNotes, this.exchangeRate, this.exchangeCurrencyId, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -572,6 +575,9 @@ class _$PaymentEntity extends PaymentEntity { if (exchangeCurrencyId == null) { throw new BuiltValueNullFieldError('PaymentEntity', 'exchangeCurrencyId'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('PaymentEntity', 'isChanged'); + } } @override @@ -597,6 +603,7 @@ class _$PaymentEntity extends PaymentEntity { privateNotes == other.privateNotes && exchangeRate == other.exchangeRate && exchangeCurrencyId == other.exchangeCurrencyId && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -625,24 +632,27 @@ class _$PaymentEntity extends PaymentEntity { $jc( $jc( $jc( - 0, - amount + $jc( + 0, + amount + .hashCode), + refunded .hashCode), - refunded + paymentStatusId .hashCode), - paymentStatusId + transactionReference .hashCode), - transactionReference + paymentDate .hashCode), - paymentDate + paymentTypeId .hashCode), - paymentTypeId.hashCode), - invoiceId.hashCode), - clientId.hashCode), - invoiceNumber.hashCode), - privateNotes.hashCode), - exchangeRate.hashCode), - exchangeCurrencyId.hashCode), + invoiceId.hashCode), + clientId.hashCode), + invoiceNumber.hashCode), + privateNotes.hashCode), + exchangeRate.hashCode), + exchangeCurrencyId.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -666,6 +676,7 @@ class _$PaymentEntity extends PaymentEntity { ..add('privateNotes', privateNotes) ..add('exchangeRate', exchangeRate) ..add('exchangeCurrencyId', exchangeCurrencyId) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -733,6 +744,10 @@ class PaymentEntityBuilder set exchangeCurrencyId(String exchangeCurrencyId) => _$this._exchangeCurrencyId = exchangeCurrencyId; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -773,6 +788,7 @@ class PaymentEntityBuilder _privateNotes = _$v.privateNotes; _exchangeRate = _$v.exchangeRate; _exchangeCurrencyId = _$v.exchangeCurrencyId; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -813,6 +829,7 @@ class PaymentEntityBuilder privateNotes: privateNotes, exchangeRate: exchangeRate, exchangeCurrencyId: exchangeCurrencyId, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/product_model.dart b/lib/data/models/product_model.dart index 1681abd0e..70fb34fac 100644 --- a/lib/data/models/product_model.dart +++ b/lib/data/models/product_model.dart @@ -50,6 +50,7 @@ abstract class ProductEntity extends Object factory ProductEntity({String id}) { return _$ProductEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, productKey: '', notes: '', cost: 0, diff --git a/lib/data/models/product_model.g.dart b/lib/data/models/product_model.g.dart index c7d58cf10..a5fe91344 100644 --- a/lib/data/models/product_model.g.dart +++ b/lib/data/models/product_model.g.dart @@ -481,6 +481,8 @@ class _$ProductEntity extends ProductEntity { @override final String customValue2; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -507,6 +509,7 @@ class _$ProductEntity extends ProductEntity { this.taxRate2, this.customValue1, this.customValue2, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -544,6 +547,9 @@ class _$ProductEntity extends ProductEntity { if (customValue2 == null) { throw new BuiltValueNullFieldError('ProductEntity', 'customValue2'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ProductEntity', 'isChanged'); + } } @override @@ -567,6 +573,7 @@ class _$ProductEntity extends ProductEntity { taxRate2 == other.taxRate2 && customValue1 == other.customValue1 && customValue2 == other.customValue2 && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -593,18 +600,21 @@ class _$ProductEntity extends ProductEntity { $jc( $jc( $jc( - 0, - productKey + $jc( + 0, + productKey + .hashCode), + notes .hashCode), - notes.hashCode), - cost.hashCode), - quantity.hashCode), - taxName1.hashCode), - taxRate1.hashCode), - taxName2.hashCode), - taxRate2.hashCode), - customValue1.hashCode), - customValue2.hashCode), + cost.hashCode), + quantity.hashCode), + taxName1.hashCode), + taxRate1.hashCode), + taxName2.hashCode), + taxRate2.hashCode), + customValue1.hashCode), + customValue2.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -626,6 +636,7 @@ class _$ProductEntity extends ProductEntity { ..add('taxRate2', taxRate2) ..add('customValue1', customValue1) ..add('customValue2', customValue2) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -680,6 +691,10 @@ class ProductEntityBuilder String get customValue2 => _$this._customValue2; set customValue2(String customValue2) => _$this._customValue2 = customValue2; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -718,6 +733,7 @@ class ProductEntityBuilder _taxRate2 = _$v.taxRate2; _customValue1 = _$v.customValue1; _customValue2 = _$v.customValue2; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -756,6 +772,7 @@ class ProductEntityBuilder taxRate2: taxRate2, customValue1: customValue1, customValue2: customValue2, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/project_model.dart b/lib/data/models/project_model.dart index a6ff21fcb..3a9731415 100644 --- a/lib/data/models/project_model.dart +++ b/lib/data/models/project_model.dart @@ -54,6 +54,7 @@ abstract class ProjectEntity extends Object factory ProjectEntity({String id}) { return _$ProjectEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, name: '', clientId: '', taskRate: 0.0, diff --git a/lib/data/models/project_model.g.dart b/lib/data/models/project_model.g.dart index c22a2a77a..03f45c09f 100644 --- a/lib/data/models/project_model.g.dart +++ b/lib/data/models/project_model.g.dart @@ -463,6 +463,8 @@ class _$ProjectEntity extends ProjectEntity { @override final String customValue2; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -487,6 +489,7 @@ class _$ProjectEntity extends ProjectEntity { this.budgetedHours, this.customValue1, this.customValue2, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -518,6 +521,9 @@ class _$ProjectEntity extends ProjectEntity { if (customValue2 == null) { throw new BuiltValueNullFieldError('ProjectEntity', 'customValue2'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('ProjectEntity', 'isChanged'); + } } @override @@ -539,6 +545,7 @@ class _$ProjectEntity extends ProjectEntity { budgetedHours == other.budgetedHours && customValue1 == other.customValue1 && customValue2 == other.customValue2 && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -561,14 +568,18 @@ class _$ProjectEntity extends ProjectEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - clientId.hashCode), - taskRate.hashCode), - dueDate.hashCode), - privateNotes.hashCode), - budgetedHours.hashCode), - customValue1.hashCode), - customValue2.hashCode), + $jc( + $jc( + $jc(0, + name.hashCode), + clientId.hashCode), + taskRate.hashCode), + dueDate.hashCode), + privateNotes.hashCode), + budgetedHours.hashCode), + customValue1.hashCode), + customValue2.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -588,6 +599,7 @@ class _$ProjectEntity extends ProjectEntity { ..add('budgetedHours', budgetedHours) ..add('customValue1', customValue1) ..add('customValue2', customValue2) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -635,6 +647,10 @@ class ProjectEntityBuilder String get customValue2 => _$this._customValue2; set customValue2(String customValue2) => _$this._customValue2 = customValue2; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -671,6 +687,7 @@ class ProjectEntityBuilder _budgetedHours = _$v.budgetedHours; _customValue1 = _$v.customValue1; _customValue2 = _$v.customValue2; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -707,6 +724,7 @@ class ProjectEntityBuilder budgetedHours: budgetedHours, customValue1: customValue1, customValue2: customValue2, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/task_model.dart b/lib/data/models/task_model.dart index 1b5c9e693..ed87fc29e 100644 --- a/lib/data/models/task_model.dart +++ b/lib/data/models/task_model.dart @@ -130,6 +130,7 @@ abstract class TaskEntity extends Object factory TaskEntity({String id, bool isRunning = false}) { return _$TaskEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, description: '', duration: 0, invoiceId: null, diff --git a/lib/data/models/task_model.g.dart b/lib/data/models/task_model.g.dart index a220d1f3f..4851f36e9 100644 --- a/lib/data/models/task_model.g.dart +++ b/lib/data/models/task_model.g.dart @@ -686,6 +686,8 @@ class _$TaskEntity extends TaskEntity { @override final int taskStatusSortOrder; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -713,6 +715,7 @@ class _$TaskEntity extends TaskEntity { this.customValue2, this.taskStatusId, this.taskStatusSortOrder, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -738,6 +741,9 @@ class _$TaskEntity extends TaskEntity { if (customValue2 == null) { throw new BuiltValueNullFieldError('TaskEntity', 'customValue2'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('TaskEntity', 'isChanged'); + } } @override @@ -762,6 +768,7 @@ class _$TaskEntity extends TaskEntity { customValue2 == other.customValue2 && taskStatusId == other.taskStatusId && taskStatusSortOrder == other.taskStatusSortOrder && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -789,21 +796,24 @@ class _$TaskEntity extends TaskEntity { $jc( $jc( $jc( - 0, - description + $jc( + 0, + description + .hashCode), + duration .hashCode), - duration + invoiceId .hashCode), - invoiceId + clientId .hashCode), - clientId.hashCode), - projectId.hashCode), - timeLog.hashCode), - isRunning.hashCode), - customValue1.hashCode), - customValue2.hashCode), - taskStatusId.hashCode), - taskStatusSortOrder.hashCode), + projectId.hashCode), + timeLog.hashCode), + isRunning.hashCode), + customValue1.hashCode), + customValue2.hashCode), + taskStatusId.hashCode), + taskStatusSortOrder.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -826,6 +836,7 @@ class _$TaskEntity extends TaskEntity { ..add('customValue2', customValue2) ..add('taskStatusId', taskStatusId) ..add('taskStatusSortOrder', taskStatusSortOrder) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -884,6 +895,10 @@ class TaskEntityBuilder implements Builder { set taskStatusSortOrder(int taskStatusSortOrder) => _$this._taskStatusSortOrder = taskStatusSortOrder; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -923,6 +938,7 @@ class TaskEntityBuilder implements Builder { _customValue2 = _$v.customValue2; _taskStatusId = _$v.taskStatusId; _taskStatusSortOrder = _$v.taskStatusSortOrder; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -962,6 +978,7 @@ class TaskEntityBuilder implements Builder { customValue2: customValue2, taskStatusId: taskStatusId, taskStatusSortOrder: taskStatusSortOrder, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/data/models/vendor_model.dart b/lib/data/models/vendor_model.dart index 37759a585..d9f5b3574 100644 --- a/lib/data/models/vendor_model.dart +++ b/lib/data/models/vendor_model.dart @@ -64,6 +64,7 @@ abstract class VendorEntity extends Object factory VendorEntity({String id}) { return _$VendorEntity._( id: id ?? BaseEntity.nextId, + isChanged: false, name: '', balance: 0.0, paidToDate: 0.0, @@ -282,6 +283,7 @@ abstract class VendorContactEntity extends Object factory VendorContactEntity() { return _$VendorContactEntity._( id: BaseEntity.nextId, + isChanged: false, firstName: '', lastName: '', email: '', diff --git a/lib/data/models/vendor_model.g.dart b/lib/data/models/vendor_model.g.dart index 6101a7474..96c115aac 100644 --- a/lib/data/models/vendor_model.g.dart +++ b/lib/data/models/vendor_model.g.dart @@ -690,6 +690,8 @@ class _$VendorEntity extends VendorEntity { @override final BuiltList contacts; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -725,6 +727,7 @@ class _$VendorEntity extends VendorEntity { this.customValue1, this.customValue2, this.contacts, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -789,6 +792,9 @@ class _$VendorEntity extends VendorEntity { if (contacts == null) { throw new BuiltValueNullFieldError('VendorEntity', 'contacts'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('VendorEntity', 'isChanged'); + } } @override @@ -821,6 +827,7 @@ class _$VendorEntity extends VendorEntity { customValue1 == other.customValue1 && customValue2 == other.customValue2 && contacts == other.contacts && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -849,20 +856,20 @@ class _$VendorEntity extends VendorEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), balance.hashCode), paidToDate.hashCode), address1.hashCode), address2.hashCode), city.hashCode), - state.hashCode), - postalCode.hashCode), - countryId.hashCode), - workPhone.hashCode), - privateNotes.hashCode), - lastLogin.hashCode), - website.hashCode), - vatNumber.hashCode), - idNumber.hashCode), - currencyId.hashCode), - customValue1.hashCode), - customValue2.hashCode), - contacts.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), balance.hashCode), paidToDate.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), + postalCode.hashCode), + countryId.hashCode), + workPhone.hashCode), + privateNotes.hashCode), + lastLogin.hashCode), + website.hashCode), + vatNumber.hashCode), + idNumber.hashCode), + currencyId.hashCode), + customValue1.hashCode), + customValue2.hashCode), + contacts.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -893,6 +900,7 @@ class _$VendorEntity extends VendorEntity { ..add('customValue1', customValue1) ..add('customValue2', customValue2) ..add('contacts', contacts) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -985,6 +993,10 @@ class VendorEntityBuilder set contacts(ListBuilder contacts) => _$this._contacts = contacts; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1032,6 +1044,7 @@ class VendorEntityBuilder _customValue1 = _$v.customValue1; _customValue2 = _$v.customValue2; _contacts = _$v.contacts?.toBuilder(); + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1081,6 +1094,7 @@ class VendorEntityBuilder customValue1: customValue1, customValue2: customValue2, contacts: contacts.build(), + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, @@ -1115,6 +1129,8 @@ class _$VendorContactEntity extends VendorContactEntity { @override final String phone; @override + final bool isChanged; + @override final int createdAt; @override final int updatedAt; @@ -1137,6 +1153,7 @@ class _$VendorContactEntity extends VendorContactEntity { this.email, this.isPrimary, this.phone, + this.isChanged, this.createdAt, this.updatedAt, this.archivedAt, @@ -1159,6 +1176,9 @@ class _$VendorContactEntity extends VendorContactEntity { if (phone == null) { throw new BuiltValueNullFieldError('VendorContactEntity', 'phone'); } + if (isChanged == null) { + throw new BuiltValueNullFieldError('VendorContactEntity', 'isChanged'); + } } @override @@ -1179,6 +1199,7 @@ class _$VendorContactEntity extends VendorContactEntity { email == other.email && isPrimary == other.isPrimary && phone == other.phone && + isChanged == other.isChanged && createdAt == other.createdAt && updatedAt == other.updatedAt && archivedAt == other.archivedAt && @@ -1198,11 +1219,13 @@ class _$VendorContactEntity extends VendorContactEntity { $jc( $jc( $jc( - $jc($jc(0, firstName.hashCode), - lastName.hashCode), - email.hashCode), - isPrimary.hashCode), - phone.hashCode), + $jc( + $jc($jc(0, firstName.hashCode), + lastName.hashCode), + email.hashCode), + isPrimary.hashCode), + phone.hashCode), + isChanged.hashCode), createdAt.hashCode), updatedAt.hashCode), archivedAt.hashCode), @@ -1219,6 +1242,7 @@ class _$VendorContactEntity extends VendorContactEntity { ..add('email', email) ..add('isPrimary', isPrimary) ..add('phone', phone) + ..add('isChanged', isChanged) ..add('createdAt', createdAt) ..add('updatedAt', updatedAt) ..add('archivedAt', archivedAt) @@ -1253,6 +1277,10 @@ class VendorContactEntityBuilder String get phone => _$this._phone; set phone(String phone) => _$this._phone = phone; + bool _isChanged; + bool get isChanged => _$this._isChanged; + set isChanged(bool isChanged) => _$this._isChanged = isChanged; + int _createdAt; int get createdAt => _$this._createdAt; set createdAt(int createdAt) => _$this._createdAt = createdAt; @@ -1286,6 +1314,7 @@ class VendorContactEntityBuilder _email = _$v.email; _isPrimary = _$v.isPrimary; _phone = _$v.phone; + _isChanged = _$v.isChanged; _createdAt = _$v.createdAt; _updatedAt = _$v.updatedAt; _archivedAt = _$v.archivedAt; @@ -1319,6 +1348,7 @@ class VendorContactEntityBuilder email: email, isPrimary: isPrimary, phone: phone, + isChanged: isChanged, createdAt: createdAt, updatedAt: updatedAt, archivedAt: archivedAt, diff --git a/lib/redux/client/client_reducer.dart b/lib/redux/client/client_reducer.dart index 3eef62cd0..529dfd67a 100644 --- a/lib/redux/client/client_reducer.dart +++ b/lib/redux/client/client_reducer.dart @@ -68,7 +68,7 @@ final editingReducer = combineReducers([ return action.client; }), TypedReducer((client, action) { - return action.client; + return action.client.rebuild((b) => b..isChanged = true); }), TypedReducer((client, action) { return client diff --git a/lib/redux/client/client_selectors.dart b/lib/redux/client/client_selectors.dart index 068a582cb..f4edec594 100644 --- a/lib/redux/client/client_selectors.dart +++ b/lib/redux/client/client_selectors.dart @@ -56,4 +56,4 @@ List filteredClientsSelector(BuiltMap clientMap, bool hasClientChanges( ClientEntity client, BuiltMap clientMap) => - client.isNew || client != clientMap[client.id]; + client.isNew ? client.isChanged : client != clientMap[client.id]; diff --git a/lib/redux/document/document_reducer.dart b/lib/redux/document/document_reducer.dart index 31c406be8..3434abfb1 100644 --- a/lib/redux/document/document_reducer.dart +++ b/lib/redux/document/document_reducer.dart @@ -26,7 +26,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((document, action) { + return action.document.rebuild((b) => b..isChanged = true); + }), TypedReducer(_clearEditing), ]); diff --git a/lib/redux/expense/expense_reducer.dart b/lib/redux/expense/expense_reducer.dart index 80a079bb1..0d934ee93 100644 --- a/lib/redux/expense/expense_reducer.dart +++ b/lib/redux/expense/expense_reducer.dart @@ -28,7 +28,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((expense, action) { + return action.expense.rebuild((b) => b..isChanged = true); + }), TypedReducer(_clearEditing), ]); diff --git a/lib/redux/expense/expense_selectors.dart b/lib/redux/expense/expense_selectors.dart index 337e052df..4ca380f7a 100644 --- a/lib/redux/expense/expense_selectors.dart +++ b/lib/redux/expense/expense_selectors.dart @@ -208,4 +208,4 @@ List clientExpenseList( bool hasExpenseChanges( ExpenseEntity expense, BuiltMap expenseMap) => - expense.isNew || expense != expenseMap[expense.id]; + expense.isNew ? expense.isChanged : expense != expenseMap[expense.id]; diff --git a/lib/redux/invoice/invoice_reducer.dart b/lib/redux/invoice/invoice_reducer.dart index 296bac9a1..aa6e9eb5b 100644 --- a/lib/redux/invoice/invoice_reducer.dart +++ b/lib/redux/invoice/invoice_reducer.dart @@ -48,7 +48,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((invoice, action) { + return action.invoice.rebuild((b) => b..isChanged = true); + }), TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), diff --git a/lib/redux/invoice/invoice_selectors.dart b/lib/redux/invoice/invoice_selectors.dart index a847736c1..ea62e4988 100644 --- a/lib/redux/invoice/invoice_selectors.dart +++ b/lib/redux/invoice/invoice_selectors.dart @@ -132,4 +132,4 @@ String invoiceStatsForClient( bool hasInvoiceChanges( InvoiceEntity invoice, BuiltMap invoiceMap) => - invoice.isNew || invoice != invoiceMap[invoice.id]; + invoice.isNew ? invoice.isChanged : invoice != invoiceMap[invoice.id]; diff --git a/lib/redux/payment/payment_reducer.dart b/lib/redux/payment/payment_reducer.dart index ac094239f..3300bb386 100644 --- a/lib/redux/payment/payment_reducer.dart +++ b/lib/redux/payment/payment_reducer.dart @@ -28,7 +28,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((payment, action) { + return action.payment.rebuild((b) => b..isChanged = true); + }), TypedReducer(_clearEditing), ]); diff --git a/lib/redux/payment/payment_selectors.dart b/lib/redux/payment/payment_selectors.dart index 366a566f1..cfefdea07 100644 --- a/lib/redux/payment/payment_selectors.dart +++ b/lib/redux/payment/payment_selectors.dart @@ -143,4 +143,4 @@ String invoiceStatsForClient( bool hasPaymentChanges( PaymentEntity payment, BuiltMap paymentMap) => - payment.isNew || payment != paymentMap[payment.id]; + payment.isNew ? payment.isChanged : payment != paymentMap[payment.id]; diff --git a/lib/redux/product/product_reducer.dart b/lib/redux/product/product_reducer.dart index b6c9a4860..d5e7707af 100644 --- a/lib/redux/product/product_reducer.dart +++ b/lib/redux/product/product_reducer.dart @@ -26,7 +26,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((product, action) { + return action.product.rebuild((b) => b..isChanged = true); + }), TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), diff --git a/lib/redux/product/product_selectors.dart b/lib/redux/product/product_selectors.dart index 0daf23508..355124024 100644 --- a/lib/redux/product/product_selectors.dart +++ b/lib/redux/product/product_selectors.dart @@ -74,4 +74,4 @@ List filteredProductsSelector( bool hasProductChanges( ProductEntity product, BuiltMap productMap) => - product.isNew || product != productMap[product.id]; + product.isNew ? product.isChanged : product != productMap[product.id]; diff --git a/lib/redux/project/project_reducer.dart b/lib/redux/project/project_reducer.dart index ed34ae687..27692d3a6 100644 --- a/lib/redux/project/project_reducer.dart +++ b/lib/redux/project/project_reducer.dart @@ -43,7 +43,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((project, action) { + return action.project.rebuild((b) => b..isChanged = true); + }), TypedReducer(_updateEditing), TypedReducer(_clearEditing), ]); diff --git a/lib/redux/project/project_selectors.dart b/lib/redux/project/project_selectors.dart index cac4dbefb..e66690251 100644 --- a/lib/redux/project/project_selectors.dart +++ b/lib/redux/project/project_selectors.dart @@ -170,4 +170,4 @@ String projectStatsForClient( bool hasProjectChanges( ProjectEntity project, BuiltMap projectMap) => - project.isNew || project != projectMap[project.id]; + project.isNew ? project.isChanged : project != projectMap[project.id]; diff --git a/lib/redux/quote/quote_reducer.dart b/lib/redux/quote/quote_reducer.dart index 2d2cf689b..4ba844d45 100644 --- a/lib/redux/quote/quote_reducer.dart +++ b/lib/redux/quote/quote_reducer.dart @@ -46,7 +46,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((quote, action) { + return action.quote.rebuild((b) => b..isChanged = true); + }), TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), diff --git a/lib/redux/quote/quote_selectors.dart b/lib/redux/quote/quote_selectors.dart index 2e8dd922b..1f56043f3 100644 --- a/lib/redux/quote/quote_selectors.dart +++ b/lib/redux/quote/quote_selectors.dart @@ -100,4 +100,4 @@ String quoteStatsForClient( bool hasQuoteChanges( InvoiceEntity quote, BuiltMap quoteMap) => - quote.isNew || quote != quoteMap[quote.id]; + quote.isNew ? quote.isChanged : quote != quoteMap[quote.id]; diff --git a/lib/redux/task/task_reducer.dart b/lib/redux/task/task_reducer.dart index 1436ca19f..67c6302b0 100644 --- a/lib/redux/task/task_reducer.dart +++ b/lib/redux/task/task_reducer.dart @@ -37,7 +37,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((task, action) { + return action.task.rebuild((b) => b..isChanged = true); + }), TypedReducer(_addTaskTime), TypedReducer(_removeTaskTime), TypedReducer(_updateTaskTime), diff --git a/lib/redux/task/task_selectors.dart b/lib/redux/task/task_selectors.dart index 2685dd13f..2d86d7313 100644 --- a/lib/redux/task/task_selectors.dart +++ b/lib/redux/task/task_selectors.dart @@ -227,4 +227,4 @@ String taskStatsForProject( } bool hasTaskChanges(TaskEntity task, BuiltMap taskMap) => - task.isNew || task != taskMap[task.id]; + task.isNew ? task.isChanged : task != taskMap[task.id]; diff --git a/lib/redux/vendor/vendor_reducer.dart b/lib/redux/vendor/vendor_reducer.dart index 6423bcccc..10c1c32f0 100644 --- a/lib/redux/vendor/vendor_reducer.dart +++ b/lib/redux/vendor/vendor_reducer.dart @@ -56,7 +56,9 @@ final editingReducer = combineReducers([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((vendor, action) { + return action.vendor.rebuild((b) => b..isChanged = true); + }), TypedReducer(_addContact), TypedReducer(_removeContact), TypedReducer(_updateContact), diff --git a/lib/redux/vendor/vendor_selectors.dart b/lib/redux/vendor/vendor_selectors.dart index 12ff2d59f..1d7ae8fa8 100644 --- a/lib/redux/vendor/vendor_selectors.dart +++ b/lib/redux/vendor/vendor_selectors.dart @@ -84,4 +84,4 @@ double calculateVendorBalance(String vendorId, String currencyId, bool hasVendorChanges( VendorEntity vendor, BuiltMap vendorMap) => - vendor.isNew || vendor != vendorMap[vendor.id]; + vendor.isNew ? vendor.isChanged : vendor != vendorMap[vendor.id]; diff --git a/stubs/data/models/stub_model b/stubs/data/models/stub_model index 496680a43..9968118f2 100644 --- a/stubs/data/models/stub_model +++ b/stubs/data/models/stub_model @@ -42,7 +42,8 @@ abstract class StubEntity extends Object with BaseEntity implements Built([ TypedReducer(_updateEditing), TypedReducer(_updateEditing), TypedReducer(_updateEditing), - TypedReducer(_updateEditing), + TypedReducer((stub, action) { + return action.stub.rebuild((b) => b..isChanged = true); + }), TypedReducer(_clearEditing), ]);