diff --git a/lib/data/models/bank_account_model.dart b/lib/data/models/bank_account_model.dart index 857771aa6..a12932d6f 100644 --- a/lib/data/models/bank_account_model.dart +++ b/lib/data/models/bank_account_model.dart @@ -56,6 +56,7 @@ abstract class BankAccountEntity extends Object factory BankAccountEntity({String id, AppState state}) { return _$BankAccountEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, isDeleted: false, createdAt: 0, diff --git a/lib/data/models/bank_account_model.g.dart b/lib/data/models/bank_account_model.g.dart index f063ae82b..f614ee8da 100644 --- a/lib/data/models/bank_account_model.g.dart +++ b/lib/data/models/bank_account_model.g.dart @@ -177,6 +177,13 @@ class _$BankAccountEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -244,6 +251,10 @@ class _$BankAccountEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -473,6 +484,8 @@ class _$BankAccountEntity extends BankAccountEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$BankAccountEntity( @@ -493,6 +506,7 @@ class _$BankAccountEntity extends BankAccountEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'BankAccountEntity', 'name'); @@ -539,6 +553,7 @@ class _$BankAccountEntity extends BankAccountEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -557,19 +572,23 @@ class _$BankAccountEntity extends BankAccountEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - status.hashCode), - type.hashCode), - provider.hashCode), - balance.hashCode), - currency.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc( + $jc(0, + name.hashCode), + status.hashCode), + type.hashCode), + provider.hashCode), + balance.hashCode), + currency.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -589,6 +608,7 @@ class _$BankAccountEntity extends BankAccountEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -652,6 +672,11 @@ class BankAccountEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -674,6 +699,7 @@ class BankAccountEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -717,6 +743,7 @@ class BankAccountEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'BankAccountEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/client_model.dart b/lib/data/models/client_model.dart index dd6cd52be..1c00b8b12 100644 --- a/lib/data/models/client_model.dart +++ b/lib/data/models/client_model.dart @@ -115,6 +115,7 @@ abstract class ClientEntity extends Object }) { return _$ClientEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, settings: SettingsEntity(), name: '', @@ -178,6 +179,7 @@ abstract class ClientEntity extends Object ClientEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..idNumber = '' ..documents.clear() ..isChanged = false @@ -776,6 +778,7 @@ abstract class ClientContactEntity extends Object factory ClientContactEntity() { return _$ClientContactEntity._( id: BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, firstName: '', lastName: '', diff --git a/lib/data/models/client_model.g.dart b/lib/data/models/client_model.g.dart index 57597421f..12555254d 100644 --- a/lib/data/models/client_model.g.dart +++ b/lib/data/models/client_model.g.dart @@ -283,6 +283,13 @@ class _$ClientEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -501,6 +508,10 @@ class _$ClientEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -609,6 +620,13 @@ class _$ClientContactEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -708,6 +726,10 @@ class _$ClientContactEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -1002,6 +1024,8 @@ class _$ClientEntity extends ClientEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$ClientEntity([void Function(ClientEntityBuilder) updates]) => @@ -1056,6 +1080,7 @@ class _$ClientEntity extends ClientEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(groupId, 'ClientEntity', 'groupId'); @@ -1190,6 +1215,7 @@ class _$ClientEntity extends ClientEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1214,25 +1240,25 @@ 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($jc($jc($jc($jc(0, groupId.hashCode), name.hashCode), displayName.hashCode), balance.hashCode), creditBalance.hashCode), paidToDate.hashCode), clientHash.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), phone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), industryId.hashCode), sizeId.hashCode), vatNumber.hashCode), idNumber.hashCode), number.hashCode), shippingAddress1.hashCode), shippingAddress2.hashCode), shippingCity.hashCode), shippingState.hashCode), shippingPostalCode.hashCode), shippingCountryId.hashCode), settings.hashCode), - lastLogin.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - contacts.hashCode), - activities.hashCode), - ledger.hashCode), - gatewayTokens.hashCode), - documents.hashCode), - systemLogs.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.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(0, groupId.hashCode), name.hashCode), displayName.hashCode), balance.hashCode), creditBalance.hashCode), paidToDate.hashCode), clientHash.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), phone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), industryId.hashCode), sizeId.hashCode), vatNumber.hashCode), idNumber.hashCode), number.hashCode), shippingAddress1.hashCode), shippingAddress2.hashCode), shippingCity.hashCode), shippingState.hashCode), shippingPostalCode.hashCode), shippingCountryId.hashCode), settings.hashCode), lastLogin.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + contacts.hashCode), + activities.hashCode), + ledger.hashCode), + gatewayTokens.hashCode), + documents.hashCode), + systemLogs.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1287,6 +1313,7 @@ class _$ClientEntity extends ClientEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1508,6 +1535,11 @@ class ClientEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1567,6 +1599,7 @@ class ClientEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1647,6 +1680,7 @@ class ClientEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'ClientEntity', 'id')); } catch (_) { String _$failedField; @@ -1721,6 +1755,8 @@ class _$ClientContactEntity extends ClientContactEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$ClientContactEntity( @@ -1749,6 +1785,7 @@ class _$ClientContactEntity extends ClientContactEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -1821,6 +1858,7 @@ class _$ClientContactEntity extends ClientContactEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1845,25 +1883,25 @@ class _$ClientContactEntity extends ClientContactEntity { $jc( $jc( $jc( - $jc($jc($jc($jc(0, firstName.hashCode), lastName.hashCode), email.hashCode), - password.hashCode), - phone.hashCode), - contactKey.hashCode), - isPrimary.hashCode), - sendEmail.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - lastLogin.hashCode), - link.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc(0, firstName.hashCode), lastName.hashCode), email.hashCode), password.hashCode), + phone.hashCode), + contactKey.hashCode), + isPrimary.hashCode), + sendEmail.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + lastLogin.hashCode), + link.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1891,6 +1929,7 @@ class _$ClientContactEntity extends ClientContactEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1986,6 +2025,11 @@ class ClientContactEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -2016,6 +2060,7 @@ class ClientContactEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -2067,6 +2112,7 @@ class ClientContactEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'ClientContactEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/company_gateway_model.dart b/lib/data/models/company_gateway_model.dart index e7dd54649..951eeeaf0 100644 --- a/lib/data/models/company_gateway_model.dart +++ b/lib/data/models/company_gateway_model.dart @@ -65,6 +65,7 @@ abstract class CompanyGatewayEntity extends Object factory CompanyGatewayEntity({String id, AppState state}) { return _$CompanyGatewayEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, isDeleted: false, gatewayId: '', diff --git a/lib/data/models/company_gateway_model.g.dart b/lib/data/models/company_gateway_model.g.dart index 039f66a95..a36d3ef14 100644 --- a/lib/data/models/company_gateway_model.g.dart +++ b/lib/data/models/company_gateway_model.g.dart @@ -244,6 +244,13 @@ class _$CompanyGatewayEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -380,6 +387,10 @@ class _$CompanyGatewayEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -771,6 +782,8 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$CompanyGatewayEntity( @@ -807,6 +820,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -899,6 +913,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -923,25 +938,25 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, gatewayId.hashCode), acceptedCreditCards.hashCode), requireShippingAddress.hashCode), requireBillingAddress.hashCode), requireClientName.hashCode), requirePostalCode.hashCode), requireClientPhone.hashCode), requireContactName.hashCode), requireContactEmail.hashCode), requireCvv.hashCode), - updateDetails.hashCode), - feesAndLimitsMap.hashCode), - systemLogs.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - config.hashCode), - tokenBilling.hashCode), - isTestMode.hashCode), - label.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, gatewayId.hashCode), acceptedCreditCards.hashCode), requireShippingAddress.hashCode), requireBillingAddress.hashCode), requireClientName.hashCode), requirePostalCode.hashCode), requireClientPhone.hashCode), requireContactName.hashCode), requireContactEmail.hashCode), requireCvv.hashCode), updateDetails.hashCode), + feesAndLimitsMap.hashCode), + systemLogs.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + config.hashCode), + tokenBilling.hashCode), + isTestMode.hashCode), + label.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -977,6 +992,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1119,6 +1135,11 @@ class CompanyGatewayEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1157,6 +1178,7 @@ class CompanyGatewayEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1216,6 +1238,7 @@ class CompanyGatewayEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'CompanyGatewayEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/company_model.g.dart b/lib/data/models/company_model.g.dart index 39366ef59..b90e1f0ac 100644 --- a/lib/data/models/company_model.g.dart +++ b/lib/data/models/company_model.g.dart @@ -387,6 +387,13 @@ class _$CompanyEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(EntityType))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -858,6 +865,10 @@ class _$CompanyEntitySerializer implements StructuredSerializer { result.entityType = serializers.deserialize(value, specifiedType: const FullType(EntityType)) as EntityType; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -1718,6 +1729,8 @@ class _$CompanyEntity extends CompanyEntity { @override final EntityType entityType; @override + final String idempotencyKey; + @override final String id; factory _$CompanyEntity([void Function(CompanyEntityBuilder) updates]) => @@ -1822,6 +1835,7 @@ class _$CompanyEntity extends CompanyEntity { this.createdUserId, this.assignedUserId, this.entityType, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(enableCustomSurchargeTaxes1, @@ -2111,6 +2125,7 @@ class _$CompanyEntity extends CompanyEntity { createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && entityType == other.entityType && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -2135,25 +2150,25 @@ 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($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), - autoStartTasks.hashCode), - showTasksTable.hashCode), - showTaskEndDate.hashCode), - settings.hashCode), - enabledModules.hashCode), - calculateExpenseTaxByAmount.hashCode), - stopOnUnpaidRecurring.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), - entityType.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($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), + autoStartTasks.hashCode), + showTasksTable.hashCode), + showTaskEndDate.hashCode), + settings.hashCode), + enabledModules.hashCode), + calculateExpenseTaxByAmount.hashCode), + stopOnUnpaidRecurring.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + entityType.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -2258,6 +2273,7 @@ class _$CompanyEntity extends CompanyEntity { ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) ..add('entityType', entityType) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -2767,6 +2783,11 @@ class CompanyEntityBuilder EntityType get entityType => _$this._entityType; set entityType(EntityType entityType) => _$this._entityType = entityType; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -2876,6 +2897,7 @@ class CompanyEntityBuilder _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; _entityType = $v.entityType; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -3011,6 +3033,7 @@ class CompanyEntityBuilder createdUserId: createdUserId, assignedUserId: assignedUserId, entityType: entityType, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'CompanyEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/design_model.dart b/lib/data/models/design_model.dart index 68c9be422..a70e01feb 100644 --- a/lib/data/models/design_model.dart +++ b/lib/data/models/design_model.dart @@ -95,6 +95,7 @@ abstract class DesignEntity extends Object return _$DesignEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, createdAt: 0, updatedAt: 0, archivedAt: 0, @@ -136,6 +137,7 @@ abstract class DesignEntity extends Object DesignEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..isChanged = false ..isDeleted = false); diff --git a/lib/data/models/design_model.g.dart b/lib/data/models/design_model.g.dart index b3d4439a4..9b69fdb52 100644 --- a/lib/data/models/design_model.g.dart +++ b/lib/data/models/design_model.g.dart @@ -224,6 +224,13 @@ class _$DesignEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -283,6 +290,10 @@ class _$DesignEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -628,6 +639,8 @@ class _$DesignEntity extends DesignEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$DesignEntity([void Function(DesignEntityBuilder) updates]) => @@ -645,6 +658,7 @@ class _$DesignEntity extends DesignEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'DesignEntity', 'name'); @@ -682,6 +696,7 @@ class _$DesignEntity extends DesignEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -698,17 +713,19 @@ class _$DesignEntity extends DesignEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - design.hashCode), - isCustom.hashCode), - isFree.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc($jc(0, name.hashCode), + design.hashCode), + isCustom.hashCode), + isFree.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -726,6 +743,7 @@ class _$DesignEntity extends DesignEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -782,6 +800,11 @@ class DesignEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -804,6 +827,7 @@ class DesignEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -844,6 +868,7 @@ class DesignEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'DesignEntity', 'id')); } catch (_) { diff --git a/lib/data/models/document_model.dart b/lib/data/models/document_model.dart index de9198a51..e10cb0725 100644 --- a/lib/data/models/document_model.dart +++ b/lib/data/models/document_model.dart @@ -58,6 +58,7 @@ abstract class DocumentEntity extends Object factory DocumentEntity({String id}) { return _$DocumentEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, name: '', url: '', @@ -119,6 +120,7 @@ abstract class DocumentEntity extends Object DocumentEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..isChanged = false ..isDeleted = false); diff --git a/lib/data/models/document_model.g.dart b/lib/data/models/document_model.g.dart index ef9448b88..b19792413 100644 --- a/lib/data/models/document_model.g.dart +++ b/lib/data/models/document_model.g.dart @@ -180,6 +180,13 @@ class _$DocumentEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -259,6 +266,10 @@ class _$DocumentEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -490,6 +501,8 @@ class _$DocumentEntity extends DocumentEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$DocumentEntity([void Function(DocumentEntityBuilder) updates]) => @@ -512,6 +525,7 @@ class _$DocumentEntity extends DocumentEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'DocumentEntity', 'name'); @@ -561,6 +575,7 @@ class _$DocumentEntity extends DocumentEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -583,23 +598,25 @@ class _$DocumentEntity extends DocumentEntity { $jc( $jc( $jc( - $jc(0, - name.hashCode), - hash.hashCode), - type.hashCode), - url.hashCode), - width.hashCode), - height.hashCode), - size.hashCode), - preview.hashCode), - isDefault.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc(0, + name.hashCode), + hash.hashCode), + type.hashCode), + url.hashCode), + width.hashCode), + height.hashCode), + size.hashCode), + preview.hashCode), + isDefault.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -622,6 +639,7 @@ class _$DocumentEntity extends DocumentEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -697,6 +715,11 @@ class DocumentEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -722,6 +745,7 @@ class DocumentEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -771,6 +795,7 @@ class DocumentEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'DocumentEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/entities.dart b/lib/data/models/entities.dart index 13fc9efd2..5c8c079f4 100644 --- a/lib/data/models/entities.dart +++ b/lib/data/models/entities.dart @@ -345,6 +345,8 @@ abstract class BaseEntity implements SelectableEntity { static String get nextId => '${--counter}'; + static String get nextIdempotencyKey => getRandomString(); + @nullable bool get isChanged; @@ -373,6 +375,10 @@ abstract class BaseEntity implements SelectableEntity { @BuiltValueField(wireName: 'entity_type') EntityType get entityType; + @nullable + @BuiltValueField(wireName: 'idempotency_key') + String get idempotencyKey; + String get entityKey => '__${entityType}__${id}__'; bool get isNew => (id ?? '').isEmpty || (int.tryParse(id) ?? 0) < 0; diff --git a/lib/data/models/expense_category_model.dart b/lib/data/models/expense_category_model.dart index 10491d846..fbd48a439 100644 --- a/lib/data/models/expense_category_model.dart +++ b/lib/data/models/expense_category_model.dart @@ -58,6 +58,7 @@ abstract class ExpenseCategoryEntity extends Object factory ExpenseCategoryEntity({String id, AppState state}) { return _$ExpenseCategoryEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, name: '', color: '', diff --git a/lib/data/models/expense_category_model.g.dart b/lib/data/models/expense_category_model.g.dart index 6b284bcd8..3e0bd29e6 100644 --- a/lib/data/models/expense_category_model.g.dart +++ b/lib/data/models/expense_category_model.g.dart @@ -172,6 +172,13 @@ class _$ExpenseCategoryEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -223,6 +230,10 @@ class _$ExpenseCategoryEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -446,6 +457,8 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$ExpenseCategoryEntity( @@ -462,6 +475,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -499,6 +513,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -512,14 +527,18 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { $jc( $jc( $jc( - $jc($jc($jc(0, name.hashCode), color.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc( + $jc($jc(0, name.hashCode), + color.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -535,6 +554,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -582,6 +602,11 @@ class ExpenseCategoryEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -602,6 +627,7 @@ class ExpenseCategoryEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -637,6 +663,7 @@ class ExpenseCategoryEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'ExpenseCategoryEntity', 'id')); replace(_$result); diff --git a/lib/data/models/expense_model.dart b/lib/data/models/expense_model.dart index 980828ed6..e05a60c37 100644 --- a/lib/data/models/expense_model.dart +++ b/lib/data/models/expense_model.dart @@ -111,6 +111,7 @@ abstract class ExpenseEntity extends Object final company = state?.company; return _$ExpenseEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, entityType: entityType ?? EntityType.expense, number: '', isChanged: false, @@ -177,6 +178,7 @@ abstract class ExpenseEntity extends Object ExpenseEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..number = '' ..isChanged = false ..isDeleted = false diff --git a/lib/data/models/expense_model.g.dart b/lib/data/models/expense_model.g.dart index ba1d8426b..ac1273b6f 100644 --- a/lib/data/models/expense_model.g.dart +++ b/lib/data/models/expense_model.g.dart @@ -343,6 +343,13 @@ class _$ExpenseEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(EntityType))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -570,6 +577,10 @@ class _$ExpenseEntitySerializer implements StructuredSerializer { result.entityType = serializers.deserialize(value, specifiedType: const FullType(EntityType)) as EntityType; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -969,6 +980,8 @@ class _$ExpenseEntity extends ExpenseEntity { @override final EntityType entityType; @override + final String idempotencyKey; + @override final String id; factory _$ExpenseEntity([void Function(ExpenseEntityBuilder) updates]) => @@ -1027,6 +1040,7 @@ class _$ExpenseEntity extends ExpenseEntity { this.createdUserId, this.assignedUserId, this.entityType, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -1165,6 +1179,7 @@ class _$ExpenseEntity extends ExpenseEntity { createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && entityType == other.entityType && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1189,25 +1204,25 @@ class _$ExpenseEntity extends ExpenseEntity { $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, privateNotes.hashCode), publicNotes.hashCode), shouldBeInvoiced.hashCode), invoiceDocuments.hashCode), transactionId.hashCode), transactionReference.hashCode), bankId.hashCode), currencyId.hashCode), categoryId.hashCode), amount.hashCode), date.hashCode), paymentDate.hashCode), exchangeRate.hashCode), invoiceCurrencyId.hashCode), paymentTypeId.hashCode), taxName1.hashCode), taxName2.hashCode), taxRate1.hashCode), taxRate2.hashCode), taxName3.hashCode), taxRate3.hashCode), clientId.hashCode), invoiceId.hashCode), vendorId.hashCode), projectId.hashCode), statusId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), taxAmount1.hashCode), taxAmount2.hashCode), taxAmount3.hashCode), - usesInclusiveTaxes.hashCode), - calculateTaxByAmount.hashCode), - documents.hashCode), - number.hashCode), - recurringId.hashCode), - frequencyId.hashCode), - lastSentDate.hashCode), - nextSendDate.hashCode), - remainingCycles.hashCode), - recurringDates.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), - entityType.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(0, privateNotes.hashCode), publicNotes.hashCode), shouldBeInvoiced.hashCode), invoiceDocuments.hashCode), transactionId.hashCode), transactionReference.hashCode), bankId.hashCode), currencyId.hashCode), categoryId.hashCode), amount.hashCode), date.hashCode), paymentDate.hashCode), exchangeRate.hashCode), invoiceCurrencyId.hashCode), paymentTypeId.hashCode), taxName1.hashCode), taxName2.hashCode), taxRate1.hashCode), taxRate2.hashCode), taxName3.hashCode), taxRate3.hashCode), clientId.hashCode), invoiceId.hashCode), vendorId.hashCode), projectId.hashCode), statusId.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), taxAmount1.hashCode), taxAmount2.hashCode), taxAmount3.hashCode), usesInclusiveTaxes.hashCode), + calculateTaxByAmount.hashCode), + documents.hashCode), + number.hashCode), + recurringId.hashCode), + frequencyId.hashCode), + lastSentDate.hashCode), + nextSendDate.hashCode), + remainingCycles.hashCode), + recurringDates.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + entityType.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1266,6 +1281,7 @@ class _$ExpenseEntity extends ExpenseEntity { ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) ..add('entityType', entityType) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1498,6 +1514,11 @@ class ExpenseEntityBuilder EntityType get entityType => _$this._entityType; set entityType(EntityType entityType) => _$this._entityType = entityType; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1561,6 +1582,7 @@ class ExpenseEntityBuilder _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; _entityType = $v.entityType; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1643,6 +1665,7 @@ class ExpenseEntityBuilder createdUserId: createdUserId, assignedUserId: assignedUserId, entityType: entityType, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'ExpenseEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/gateway_token_model.dart b/lib/data/models/gateway_token_model.dart index 5b74de970..a020bc8c7 100644 --- a/lib/data/models/gateway_token_model.dart +++ b/lib/data/models/gateway_token_model.dart @@ -60,6 +60,7 @@ abstract class GatewayTokenEntity extends Object factory GatewayTokenEntity({String id}) { return _$GatewayTokenEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, token: '', customerReference: '', diff --git a/lib/data/models/gateway_token_model.g.dart b/lib/data/models/gateway_token_model.g.dart index 902e8ff7a..aa91c5f22 100644 --- a/lib/data/models/gateway_token_model.g.dart +++ b/lib/data/models/gateway_token_model.g.dart @@ -181,6 +181,13 @@ class _$GatewayTokenEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -249,6 +256,10 @@ class _$GatewayTokenEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -570,6 +581,8 @@ class _$GatewayTokenEntity extends GatewayTokenEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$GatewayTokenEntity( @@ -590,6 +603,7 @@ class _$GatewayTokenEntity extends GatewayTokenEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(token, 'GatewayTokenEntity', 'token'); @@ -637,6 +651,7 @@ class _$GatewayTokenEntity extends GatewayTokenEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -656,20 +671,24 @@ class _$GatewayTokenEntity extends GatewayTokenEntity { $jc( $jc( $jc( - $jc(0, token.hashCode), - customerReference + $jc( + $jc(0, + token.hashCode), + customerReference + .hashCode), + companyGatewayId .hashCode), - companyGatewayId.hashCode), - gatewayTypeId.hashCode), - isDefault.hashCode), - meta.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + gatewayTypeId.hashCode), + isDefault.hashCode), + meta.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -689,6 +708,7 @@ class _$GatewayTokenEntity extends GatewayTokenEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -756,6 +776,11 @@ class GatewayTokenEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -778,6 +803,7 @@ class GatewayTokenEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -822,6 +848,7 @@ class GatewayTokenEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'GatewayTokenEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/group_model.dart b/lib/data/models/group_model.dart index 587ce1be7..bc9270125 100644 --- a/lib/data/models/group_model.dart +++ b/lib/data/models/group_model.dart @@ -56,6 +56,7 @@ abstract class GroupEntity extends Object factory GroupEntity({String id, AppState state}) { return _$GroupEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, name: '', settings: SettingsEntity(), diff --git a/lib/data/models/group_model.g.dart b/lib/data/models/group_model.g.dart index b584bfa57..85499b50c 100644 --- a/lib/data/models/group_model.g.dart +++ b/lib/data/models/group_model.g.dart @@ -159,6 +159,13 @@ class _$GroupEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -215,6 +222,10 @@ class _$GroupEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -429,6 +440,8 @@ class _$GroupEntity extends GroupEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$GroupEntity([void Function(GroupEntityBuilder) updates]) => @@ -445,6 +458,7 @@ class _$GroupEntity extends GroupEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'GroupEntity', 'name'); @@ -481,6 +495,7 @@ class _$GroupEntity extends GroupEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -496,16 +511,18 @@ class _$GroupEntity extends GroupEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - settings.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc($jc(0, name.hashCode), + settings.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -522,6 +539,7 @@ class _$GroupEntity extends GroupEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -575,6 +593,11 @@ class GroupEntityBuilder implements Builder { set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -596,6 +619,7 @@ class GroupEntityBuilder implements Builder { _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -633,6 +657,7 @@ class GroupEntityBuilder implements Builder { isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'GroupEntity', 'id')); } catch (_) { diff --git a/lib/data/models/invoice_model.dart b/lib/data/models/invoice_model.dart index e8a4c7f4f..9375ad80d 100644 --- a/lib/data/models/invoice_model.dart +++ b/lib/data/models/invoice_model.dart @@ -152,6 +152,7 @@ abstract class InvoiceEntity extends Object } return _$InvoiceEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, entityType: entityType ?? EntityType.invoice, isChanged: false, amount: 0, @@ -287,6 +288,7 @@ abstract class InvoiceEntity extends Object return rebuild( (b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..isChanged = false ..isDeleted = false ..statusId = kInvoiceStatusDraft @@ -1726,6 +1728,7 @@ abstract class InvitationEntity extends Object }) { return _$InvitationEntity._( id: BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, clientContactId: clientContactId ?? '', vendorContactId: vendorContactId ?? '', diff --git a/lib/data/models/invoice_model.g.dart b/lib/data/models/invoice_model.g.dart index 1a9561785..f56452156 100644 --- a/lib/data/models/invoice_model.g.dart +++ b/lib/data/models/invoice_model.g.dart @@ -417,6 +417,13 @@ class _$InvoiceEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(EntityType))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -726,6 +733,10 @@ class _$InvoiceEntitySerializer implements StructuredSerializer { result.entityType = serializers.deserialize(value, specifiedType: const FullType(EntityType)) as EntityType; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -1011,6 +1022,13 @@ class _$InvitationEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(EntityType))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -1090,6 +1108,10 @@ class _$InvitationEntitySerializer result.entityType = serializers.deserialize(value, specifiedType: const FullType(EntityType)) as EntityType; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -1549,6 +1571,8 @@ class _$InvoiceEntity extends InvoiceEntity { @override final EntityType entityType; @override + final String idempotencyKey; + @override final String id; factory _$InvoiceEntity([void Function(InvoiceEntityBuilder) updates]) => @@ -1626,6 +1650,7 @@ class _$InvoiceEntity extends InvoiceEntity { this.createdUserId, this.assignedUserId, this.entityType, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(amount, 'InvoiceEntity', 'amount'); @@ -1809,6 +1834,7 @@ class _$InvoiceEntity extends InvoiceEntity { createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && entityType == other.entityType && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1833,25 +1859,25 @@ 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($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), paidToDate.hashCode), clientId.hashCode), projectId.hashCode), expenseId.hashCode), vendorId.hashCode), subscriptionId.hashCode), statusId.hashCode), number.hashCode), discount.hashCode), poNumber.hashCode), date.hashCode), dueDate.hashCode), publicNotes.hashCode), privateNotes.hashCode), terms.hashCode), footer.hashCode), designId.hashCode), usesInclusiveTaxes.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), taxRate2.hashCode), taxName3.hashCode), taxRate3.hashCode), isAmountDiscount.hashCode), partial.hashCode), taxAmount.hashCode), partialDueDate.hashCode), autoBill.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), customSurcharge1.hashCode), customSurcharge2.hashCode), customSurcharge3.hashCode), customSurcharge4.hashCode), customTaxes1.hashCode), customTaxes2.hashCode), customTaxes3.hashCode), customTaxes4.hashCode), exchangeRate.hashCode), reminder1Sent.hashCode), reminder2Sent.hashCode), reminder3Sent.hashCode), reminderLastSent.hashCode), frequencyId.hashCode), lastSentDate.hashCode), nextSendDate.hashCode), - remainingCycles.hashCode), - dueDateDays.hashCode), - invoiceId.hashCode), - recurringId.hashCode), - autoBillEnabled.hashCode), - filename.hashCode), - recurringDates.hashCode), - lineItems.hashCode), - invitations.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), - entityType.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(0, amount.hashCode), balance.hashCode), paidToDate.hashCode), clientId.hashCode), projectId.hashCode), expenseId.hashCode), vendorId.hashCode), subscriptionId.hashCode), statusId.hashCode), number.hashCode), discount.hashCode), poNumber.hashCode), date.hashCode), dueDate.hashCode), publicNotes.hashCode), privateNotes.hashCode), terms.hashCode), footer.hashCode), designId.hashCode), usesInclusiveTaxes.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), taxRate2.hashCode), taxName3.hashCode), taxRate3.hashCode), isAmountDiscount.hashCode), partial.hashCode), taxAmount.hashCode), partialDueDate.hashCode), autoBill.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), customSurcharge1.hashCode), customSurcharge2.hashCode), customSurcharge3.hashCode), customSurcharge4.hashCode), customTaxes1.hashCode), customTaxes2.hashCode), customTaxes3.hashCode), customTaxes4.hashCode), exchangeRate.hashCode), reminder1Sent.hashCode), reminder2Sent.hashCode), reminder3Sent.hashCode), reminderLastSent.hashCode), frequencyId.hashCode), lastSentDate.hashCode), nextSendDate.hashCode), remainingCycles.hashCode), + dueDateDays.hashCode), + invoiceId.hashCode), + recurringId.hashCode), + autoBillEnabled.hashCode), + filename.hashCode), + recurringDates.hashCode), + lineItems.hashCode), + invitations.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + entityType.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1929,6 +1955,7 @@ class _$InvoiceEntity extends InvoiceEntity { ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) ..add('entityType', entityType) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -2248,6 +2275,11 @@ class InvoiceEntityBuilder EntityType get entityType => _$this._entityType; set entityType(EntityType entityType) => _$this._entityType = entityType; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -2330,6 +2362,7 @@ class InvoiceEntityBuilder _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; _entityType = $v.entityType; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -2433,6 +2466,7 @@ class InvoiceEntityBuilder createdUserId: createdUserId, assignedUserId: assignedUserId, entityType: entityType, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'InvoiceEntity', 'id')); } catch (_) { String _$failedField; @@ -2861,6 +2895,8 @@ class _$InvitationEntity extends InvitationEntity { @override final EntityType entityType; @override + final String idempotencyKey; + @override final String id; factory _$InvitationEntity( @@ -2884,6 +2920,7 @@ class _$InvitationEntity extends InvitationEntity { this.createdUserId, this.assignedUserId, this.entityType, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(key, 'InvitationEntity', 'key'); @@ -2931,6 +2968,7 @@ class _$InvitationEntity extends InvitationEntity { createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && entityType == other.entityType && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -2948,18 +2986,20 @@ class _$InvitationEntity extends InvitationEntity { $jc( $jc( $jc( - $jc($jc(0, key.hashCode), - link.hashCode), - clientContactId.hashCode), - vendorContactId.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), - entityType.hashCode), + $jc( + $jc($jc(0, key.hashCode), + link.hashCode), + clientContactId.hashCode), + vendorContactId.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + entityType.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -2982,6 +3022,7 @@ class _$InvitationEntity extends InvitationEntity { ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) ..add('entityType', entityType) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -3059,6 +3100,11 @@ class InvitationEntityBuilder EntityType get entityType => _$this._entityType; set entityType(EntityType entityType) => _$this._entityType = entityType; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -3086,6 +3132,7 @@ class InvitationEntityBuilder _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; _entityType = $v.entityType; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -3132,6 +3179,7 @@ class InvitationEntityBuilder createdUserId: createdUserId, assignedUserId: assignedUserId, entityType: entityType, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'InvitationEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/payment_model.dart b/lib/data/models/payment_model.dart index c78d8cd4a..857848411 100644 --- a/lib/data/models/payment_model.dart +++ b/lib/data/models/payment_model.dart @@ -80,6 +80,7 @@ abstract class PaymentEntity extends Object return _$PaymentEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, amount: 0.0, transactionReference: '', diff --git a/lib/data/models/payment_model.g.dart b/lib/data/models/payment_model.g.dart index abb5176cb..d9d167e60 100644 --- a/lib/data/models/payment_model.g.dart +++ b/lib/data/models/payment_model.g.dart @@ -262,6 +262,13 @@ class _$PaymentEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -427,6 +434,10 @@ class _$PaymentEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -787,6 +798,8 @@ class _$PaymentEntity extends PaymentEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$PaymentEntity([void Function(PaymentEntityBuilder) updates]) => @@ -829,6 +842,7 @@ class _$PaymentEntity extends PaymentEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(amount, 'PaymentEntity', 'amount'); @@ -933,6 +947,7 @@ class _$PaymentEntity extends PaymentEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -957,25 +972,25 @@ class _$PaymentEntity extends PaymentEntity { $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), applied.hashCode), refunded.hashCode), number.hashCode), clientId.hashCode), statusId.hashCode), transactionReference.hashCode), date.hashCode), typeId.hashCode), privateNotes.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), exchangeRate.hashCode), exchangeCurrencyId.hashCode), isManual.hashCode), projectId.hashCode), - vendorId.hashCode), - invitationId.hashCode), - clientContactId.hashCode), - companyGatewayId.hashCode), - currencyId.hashCode), - isApplying.hashCode), - sendEmail.hashCode), - gatewayRefund.hashCode), - paymentables.hashCode), - invoices.hashCode), - credits.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, amount.hashCode), applied.hashCode), refunded.hashCode), number.hashCode), clientId.hashCode), statusId.hashCode), transactionReference.hashCode), date.hashCode), typeId.hashCode), privateNotes.hashCode), customValue1.hashCode), customValue2.hashCode), customValue3.hashCode), customValue4.hashCode), exchangeRate.hashCode), exchangeCurrencyId.hashCode), isManual.hashCode), projectId.hashCode), vendorId.hashCode), + invitationId.hashCode), + clientContactId.hashCode), + companyGatewayId.hashCode), + currencyId.hashCode), + isApplying.hashCode), + sendEmail.hashCode), + gatewayRefund.hashCode), + paymentables.hashCode), + invoices.hashCode), + credits.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1018,6 +1033,7 @@ class _$PaymentEntity extends PaymentEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1184,6 +1200,11 @@ class PaymentEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1229,6 +1250,7 @@ class PaymentEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1297,6 +1319,7 @@ class PaymentEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'PaymentEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/payment_term_model.dart b/lib/data/models/payment_term_model.dart index 1533c9440..789ebb639 100644 --- a/lib/data/models/payment_term_model.dart +++ b/lib/data/models/payment_term_model.dart @@ -57,6 +57,7 @@ abstract class PaymentTermEntity extends Object factory PaymentTermEntity({String id, AppState state}) { return _$PaymentTermEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, isDeleted: false, archivedAt: 0, diff --git a/lib/data/models/payment_term_model.g.dart b/lib/data/models/payment_term_model.g.dart index db2b00447..87efcef86 100644 --- a/lib/data/models/payment_term_model.g.dart +++ b/lib/data/models/payment_term_model.g.dart @@ -165,6 +165,13 @@ class _$PaymentTermEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -216,6 +223,10 @@ class _$PaymentTermEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -437,6 +448,8 @@ class _$PaymentTermEntity extends PaymentTermEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$PaymentTermEntity( @@ -453,6 +466,7 @@ class _$PaymentTermEntity extends PaymentTermEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'PaymentTermEntity', 'name'); @@ -488,6 +502,7 @@ class _$PaymentTermEntity extends PaymentTermEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -502,15 +517,17 @@ class _$PaymentTermEntity extends PaymentTermEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - numDays.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc($jc(0, name.hashCode), + numDays.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -526,6 +543,7 @@ class _$PaymentTermEntity extends PaymentTermEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -573,6 +591,11 @@ class PaymentTermEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -591,6 +614,7 @@ class PaymentTermEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -626,6 +650,7 @@ class PaymentTermEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'PaymentTermEntity', 'id')); replace(_$result); diff --git a/lib/data/models/product_model.dart b/lib/data/models/product_model.dart index 3499adfcb..ea1cfc873 100644 --- a/lib/data/models/product_model.dart +++ b/lib/data/models/product_model.dart @@ -75,6 +75,7 @@ abstract class ProductEntity extends Object factory ProductEntity({String id, AppState state}) { return _$ProductEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, productKey: '', notes: '', @@ -112,6 +113,7 @@ abstract class ProductEntity extends Object ProductEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..documents.clear() ..isChanged = false ..isDeleted = false); diff --git a/lib/data/models/product_model.g.dart b/lib/data/models/product_model.g.dart index 105cc4e76..d23dad9f4 100644 --- a/lib/data/models/product_model.g.dart +++ b/lib/data/models/product_model.g.dart @@ -216,6 +216,13 @@ class _$ProductEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -337,6 +344,10 @@ class _$ProductEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -587,6 +598,8 @@ class _$ProductEntity extends ProductEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$ProductEntity([void Function(ProductEntityBuilder) updates]) => @@ -619,6 +632,7 @@ class _$ProductEntity extends ProductEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -702,6 +716,7 @@ class _$ProductEntity extends ProductEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -726,25 +741,25 @@ class _$ProductEntity extends ProductEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc(0, productKey.hashCode), notes.hashCode), cost.hashCode), price.hashCode), quantity.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), - taxRate2.hashCode), - taxName3.hashCode), - taxRate3.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - stockQuantity.hashCode), - stockNotificationThreshold.hashCode), - stockNotification.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, productKey.hashCode), notes.hashCode), cost.hashCode), price.hashCode), quantity.hashCode), taxName1.hashCode), taxRate1.hashCode), taxName2.hashCode), taxRate2.hashCode), + taxName3.hashCode), + taxRate3.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + stockQuantity.hashCode), + stockNotificationThreshold.hashCode), + stockNotification.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -777,6 +792,7 @@ class _$ProductEntity extends ProductEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -896,6 +912,11 @@ class ProductEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -933,6 +954,7 @@ class ProductEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -992,6 +1014,7 @@ class ProductEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'ProductEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/project_model.dart b/lib/data/models/project_model.dart index 2335a6f5d..11d740b39 100644 --- a/lib/data/models/project_model.dart +++ b/lib/data/models/project_model.dart @@ -79,6 +79,7 @@ abstract class ProjectEntity extends Object }) { return _$ProjectEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, number: '', isChanged: false, name: '', @@ -111,6 +112,7 @@ abstract class ProjectEntity extends Object ProjectEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..number = '' ..documents.clear() ..isChanged = false diff --git a/lib/data/models/project_model.g.dart b/lib/data/models/project_model.g.dart index 430c3221e..94242bfae 100644 --- a/lib/data/models/project_model.g.dart +++ b/lib/data/models/project_model.g.dart @@ -201,6 +201,13 @@ class _$ProjectEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -302,6 +309,10 @@ class _$ProjectEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -542,6 +553,8 @@ class _$ProjectEntity extends ProjectEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$ProjectEntity([void Function(ProjectEntityBuilder) updates]) => @@ -569,6 +582,7 @@ class _$ProjectEntity extends ProjectEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'ProjectEntity', 'name'); @@ -636,6 +650,7 @@ class _$ProjectEntity extends ProjectEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -660,25 +675,25 @@ class _$ProjectEntity extends ProjectEntity { $jc( $jc( $jc( - $jc($jc($jc($jc(0, name.hashCode), color.hashCode), clientId.hashCode), - taskRate.hashCode), - dueDate.hashCode), - privateNotes.hashCode), - publicNotes.hashCode), - budgetedHours.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - number.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc(0, name.hashCode), color.hashCode), clientId.hashCode), taskRate.hashCode), + dueDate.hashCode), + privateNotes.hashCode), + publicNotes.hashCode), + budgetedHours.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + number.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -706,6 +721,7 @@ class _$ProjectEntity extends ProjectEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -804,6 +820,11 @@ class ProjectEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -836,6 +857,7 @@ class ProjectEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -889,6 +911,7 @@ class ProjectEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'ProjectEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/subscription_model.dart b/lib/data/models/subscription_model.dart index 2b6671d7b..78d585721 100644 --- a/lib/data/models/subscription_model.dart +++ b/lib/data/models/subscription_model.dart @@ -63,6 +63,7 @@ abstract class SubscriptionEntity extends Object factory SubscriptionEntity({String id, AppState state}) { return _$SubscriptionEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, name: '', isChanged: false, isDeleted: false, diff --git a/lib/data/models/subscription_model.g.dart b/lib/data/models/subscription_model.g.dart index 95b918dc6..12c2758d7 100644 --- a/lib/data/models/subscription_model.g.dart +++ b/lib/data/models/subscription_model.g.dart @@ -222,6 +222,13 @@ class _$SubscriptionEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -346,6 +353,10 @@ class _$SubscriptionEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -679,6 +690,8 @@ class _$SubscriptionEntity extends SubscriptionEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$SubscriptionEntity( @@ -713,6 +726,7 @@ class _$SubscriptionEntity extends SubscriptionEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'SubscriptionEntity', 'name'); @@ -802,6 +816,7 @@ class _$SubscriptionEntity extends SubscriptionEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -826,25 +841,25 @@ class _$SubscriptionEntity extends SubscriptionEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), groupId.hashCode), productIds.hashCode), recurringProductIds.hashCode), frequencyId.hashCode), autoBill.hashCode), promoCode.hashCode), promoDiscount.hashCode), price.hashCode), - isAmountDiscount.hashCode), - allowCancellation.hashCode), - perSeatEnabled.hashCode), - maxSeatsLimit.hashCode), - trialEnabled.hashCode), - trialDuration.hashCode), - allowQueryOverrides.hashCode), - allowPlanChanges.hashCode), - refundPeriod.hashCode), - webhookConfiguration.hashCode), - purchasePage.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), groupId.hashCode), productIds.hashCode), recurringProductIds.hashCode), frequencyId.hashCode), autoBill.hashCode), promoCode.hashCode), promoDiscount.hashCode), price.hashCode), isAmountDiscount.hashCode), + allowCancellation.hashCode), + perSeatEnabled.hashCode), + maxSeatsLimit.hashCode), + trialEnabled.hashCode), + trialDuration.hashCode), + allowQueryOverrides.hashCode), + allowPlanChanges.hashCode), + refundPeriod.hashCode), + webhookConfiguration.hashCode), + purchasePage.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -878,6 +893,7 @@ class _$SubscriptionEntity extends SubscriptionEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1007,6 +1023,11 @@ class SubscriptionEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1043,6 +1064,7 @@ class SubscriptionEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1101,6 +1123,7 @@ class SubscriptionEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'SubscriptionEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/task_model.dart b/lib/data/models/task_model.dart index 5ca3c7f14..828abd60e 100644 --- a/lib/data/models/task_model.dart +++ b/lib/data/models/task_model.dart @@ -260,6 +260,7 @@ abstract class TaskEntity extends Object return _$TaskEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, number: '', isChanged: false, description: '', @@ -295,6 +296,7 @@ abstract class TaskEntity extends Object TaskEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..number = '' ..isChanged = false ..isDeleted = false diff --git a/lib/data/models/task_model.g.dart b/lib/data/models/task_model.g.dart index 7fadaae22..b2ae318c1 100644 --- a/lib/data/models/task_model.g.dart +++ b/lib/data/models/task_model.g.dart @@ -253,6 +253,13 @@ class _$TaskEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -357,6 +364,10 @@ class _$TaskEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -680,6 +691,8 @@ class _$TaskEntity extends TaskEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$TaskEntity([void Function(TaskEntityBuilder) updates]) => @@ -708,6 +721,7 @@ class _$TaskEntity extends TaskEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -769,6 +783,7 @@ class _$TaskEntity extends TaskEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -793,25 +808,25 @@ class _$TaskEntity extends TaskEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc(0, description.hashCode), number.hashCode), duration.hashCode), invoiceId.hashCode), - clientId.hashCode), - rate.hashCode), - projectId.hashCode), - timeLog.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - statusId.hashCode), - statusOrder.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc(0, description.hashCode), number.hashCode), duration.hashCode), invoiceId.hashCode), clientId.hashCode), + rate.hashCode), + projectId.hashCode), + timeLog.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + statusId.hashCode), + statusOrder.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -840,6 +855,7 @@ class _$TaskEntity extends TaskEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -940,6 +956,11 @@ class TaskEntityBuilder implements Builder { set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -971,6 +992,7 @@ class TaskEntityBuilder implements Builder { _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1025,6 +1047,7 @@ class TaskEntityBuilder implements Builder { isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'TaskEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/task_status_model.dart b/lib/data/models/task_status_model.dart index f6655aa01..46777f62e 100644 --- a/lib/data/models/task_status_model.dart +++ b/lib/data/models/task_status_model.dart @@ -61,6 +61,7 @@ abstract class TaskStatusEntity extends Object factory TaskStatusEntity({String id, AppState state}) { return _$TaskStatusEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, name: '', color: '', createdUserId: '', diff --git a/lib/data/models/task_status_model.g.dart b/lib/data/models/task_status_model.g.dart index fd7df0a13..1de981731 100644 --- a/lib/data/models/task_status_model.g.dart +++ b/lib/data/models/task_status_model.g.dart @@ -172,6 +172,13 @@ class _$TaskStatusEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -227,6 +234,10 @@ class _$TaskStatusEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -448,6 +459,8 @@ class _$TaskStatusEntity extends TaskStatusEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$TaskStatusEntity( @@ -465,6 +478,7 @@ class _$TaskStatusEntity extends TaskStatusEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'TaskStatusEntity', 'name'); @@ -500,6 +514,7 @@ class _$TaskStatusEntity extends TaskStatusEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -515,16 +530,18 @@ class _$TaskStatusEntity extends TaskStatusEntity { $jc( $jc( $jc( - $jc($jc(0, name.hashCode), - color.hashCode), - statusOrder.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc($jc(0, name.hashCode), + color.hashCode), + statusOrder.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -541,6 +558,7 @@ class _$TaskStatusEntity extends TaskStatusEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -592,6 +610,11 @@ class TaskStatusEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -613,6 +636,7 @@ class TaskStatusEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -649,6 +673,7 @@ class TaskStatusEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'TaskStatusEntity', 'id')); replace(_$result); diff --git a/lib/data/models/tax_rate_model.dart b/lib/data/models/tax_rate_model.dart index b39947075..9347aa66b 100644 --- a/lib/data/models/tax_rate_model.dart +++ b/lib/data/models/tax_rate_model.dart @@ -59,6 +59,7 @@ abstract class TaxRateEntity extends Object factory TaxRateEntity({String id, String name, double rate, AppState state}) { return _$TaxRateEntity._( id: BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, name: name ?? '', rate: rate ?? 0.0, diff --git a/lib/data/models/tax_rate_model.g.dart b/lib/data/models/tax_rate_model.g.dart index 93037cabf..025aff820 100644 --- a/lib/data/models/tax_rate_model.g.dart +++ b/lib/data/models/tax_rate_model.g.dart @@ -163,6 +163,13 @@ class _$TaxRateEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -214,6 +221,10 @@ class _$TaxRateEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -430,6 +441,8 @@ class _$TaxRateEntity extends TaxRateEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$TaxRateEntity([void Function(TaxRateEntityBuilder) updates]) => @@ -445,6 +458,7 @@ class _$TaxRateEntity extends TaxRateEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'TaxRateEntity', 'name'); @@ -478,6 +492,7 @@ class _$TaxRateEntity extends TaxRateEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -491,14 +506,18 @@ class _$TaxRateEntity extends TaxRateEntity { $jc( $jc( $jc( - $jc($jc($jc(0, name.hashCode), rate.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc( + $jc($jc(0, name.hashCode), + rate.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -514,6 +533,7 @@ class _$TaxRateEntity extends TaxRateEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -561,6 +581,11 @@ class TaxRateEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -579,6 +604,7 @@ class TaxRateEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -614,6 +640,7 @@ class TaxRateEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'TaxRateEntity', 'id')); replace(_$result); diff --git a/lib/data/models/token_model.dart b/lib/data/models/token_model.dart index 7297a749d..f74c18265 100644 --- a/lib/data/models/token_model.dart +++ b/lib/data/models/token_model.dart @@ -60,6 +60,7 @@ abstract class TokenEntity extends Object factory TokenEntity({String id, AppState state}) { return _$TokenEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, name: '', token: '', diff --git a/lib/data/models/token_model.g.dart b/lib/data/models/token_model.g.dart index e4d78c101..564069637 100644 --- a/lib/data/models/token_model.g.dart +++ b/lib/data/models/token_model.g.dart @@ -158,6 +158,13 @@ class _$TokenEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -212,6 +219,10 @@ class _$TokenEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -426,6 +437,8 @@ class _$TokenEntity extends TokenEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$TokenEntity([void Function(TokenEntityBuilder) updates]) => @@ -442,6 +455,7 @@ class _$TokenEntity extends TokenEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(isSystem, 'TokenEntity', 'isSystem'); @@ -477,6 +491,7 @@ class _$TokenEntity extends TokenEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -492,16 +507,18 @@ class _$TokenEntity extends TokenEntity { $jc( $jc( $jc( - $jc($jc(0, isSystem.hashCode), - token.hashCode), - name.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc($jc(0, isSystem.hashCode), + token.hashCode), + name.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -518,6 +535,7 @@ class _$TokenEntity extends TokenEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -568,6 +586,11 @@ class TokenEntityBuilder implements Builder { set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -587,6 +610,7 @@ class TokenEntityBuilder implements Builder { _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -624,6 +648,7 @@ class TokenEntityBuilder implements Builder { isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'TokenEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/transaction_model.dart b/lib/data/models/transaction_model.dart index 19a5e9635..47491cfc1 100644 --- a/lib/data/models/transaction_model.dart +++ b/lib/data/models/transaction_model.dart @@ -71,6 +71,7 @@ abstract class TransactionEntity extends Object factory TransactionEntity({String id, AppState state}) { return _$TransactionEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, isDeleted: false, createdAt: 0, diff --git a/lib/data/models/transaction_model.g.dart b/lib/data/models/transaction_model.g.dart index c197623e0..b1fad357e 100644 --- a/lib/data/models/transaction_model.g.dart +++ b/lib/data/models/transaction_model.g.dart @@ -201,6 +201,13 @@ class _$TransactionEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -296,6 +303,10 @@ class _$TransactionEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -590,6 +601,8 @@ class _$TransactionEntity extends TransactionEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$TransactionEntity( @@ -617,6 +630,7 @@ class _$TransactionEntity extends TransactionEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -685,6 +699,7 @@ class _$TransactionEntity extends TransactionEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -709,25 +724,25 @@ class _$TransactionEntity extends TransactionEntity { $jc( $jc( $jc( - $jc($jc($jc(0, amount.hashCode), currencyId.hashCode), - category.hashCode), - baseType.hashCode), - date.hashCode), - bankAccountId.hashCode), - description.hashCode), - statusId.hashCode), - categoryId.hashCode), - invoiceIds.hashCode), - expenseId.hashCode), - vendorId.hashCode), - transactionId.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc(0, amount.hashCode), currencyId.hashCode), category.hashCode), + baseType.hashCode), + date.hashCode), + bankAccountId.hashCode), + description.hashCode), + statusId.hashCode), + categoryId.hashCode), + invoiceIds.hashCode), + expenseId.hashCode), + vendorId.hashCode), + transactionId.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -754,6 +769,7 @@ class _$TransactionEntity extends TransactionEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -846,6 +862,11 @@ class TransactionEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -877,6 +898,7 @@ class TransactionEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -927,6 +949,7 @@ class TransactionEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'TransactionEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/user_model.dart b/lib/data/models/user_model.dart index 5b9b4961a..079833f9e 100644 --- a/lib/data/models/user_model.dart +++ b/lib/data/models/user_model.dart @@ -118,6 +118,7 @@ abstract class UserEntity extends Object {String id, AppState state, UserCompanyEntity userCompany}) { return _$UserEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, createdUserId: '', createdAt: 0, diff --git a/lib/data/models/user_model.g.dart b/lib/data/models/user_model.g.dart index b800127e2..d83a8a6b6 100644 --- a/lib/data/models/user_model.g.dart +++ b/lib/data/models/user_model.g.dart @@ -354,6 +354,13 @@ class _$UserEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -461,6 +468,10 @@ class _$UserEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -986,6 +997,8 @@ class _$UserEntity extends UserEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$UserEntity([void Function(UserEntityBuilder) updates]) => @@ -1015,6 +1028,7 @@ class _$UserEntity extends UserEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(firstName, 'UserEntity', 'firstName'); @@ -1081,6 +1095,7 @@ class _$UserEntity extends UserEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1105,25 +1120,25 @@ class _$UserEntity extends UserEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc(0, firstName.hashCode), lastName.hashCode), email.hashCode), phone.hashCode), password.hashCode), - emailVerifiedAt.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - isTwoFactorEnabled.hashCode), - hasPassword.hashCode), - lastEmailAddress.hashCode), - oauthUserToken.hashCode), - userCompany.hashCode), - oauthProvider.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc(0, firstName.hashCode), lastName.hashCode), email.hashCode), phone.hashCode), password.hashCode), emailVerifiedAt.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + isTwoFactorEnabled.hashCode), + hasPassword.hashCode), + lastEmailAddress.hashCode), + oauthUserToken.hashCode), + userCompany.hashCode), + oauthProvider.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1153,6 +1168,7 @@ class _$UserEntity extends UserEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1262,6 +1278,11 @@ class UserEntityBuilder implements Builder { set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1296,6 +1317,7 @@ class UserEntityBuilder implements Builder { _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1352,6 +1374,7 @@ class UserEntityBuilder implements Builder { isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'UserEntity', 'id')); } catch (_) { String _$failedField; diff --git a/lib/data/models/vendor_model.dart b/lib/data/models/vendor_model.dart index 249011dad..fc355430a 100644 --- a/lib/data/models/vendor_model.dart +++ b/lib/data/models/vendor_model.dart @@ -85,6 +85,7 @@ abstract class VendorEntity extends Object factory VendorEntity({String id, AppState state, UserEntity user}) { return _$VendorEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, number: '', isChanged: false, name: '', @@ -129,6 +130,7 @@ abstract class VendorEntity extends Object VendorEntity get clone => rebuild((b) => b ..id = BaseEntity.nextId + ..idempotencyKey = BaseEntity.nextIdempotencyKey ..number = '' ..documents.clear() ..isChanged = false @@ -488,6 +490,7 @@ abstract class VendorContactEntity extends Object factory VendorContactEntity() { return _$VendorContactEntity._( id: BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, firstName: '', lastName: '', diff --git a/lib/data/models/vendor_model.g.dart b/lib/data/models/vendor_model.g.dart index d688ed946..f673a3aec 100644 --- a/lib/data/models/vendor_model.g.dart +++ b/lib/data/models/vendor_model.g.dart @@ -220,6 +220,13 @@ class _$VendorEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -356,6 +363,10 @@ class _$VendorEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -452,6 +463,13 @@ class _$VendorContactEntitySerializer ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -535,6 +553,10 @@ class _$VendorContactEntitySerializer result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -791,6 +813,8 @@ class _$VendorEntity extends VendorEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$VendorEntity([void Function(VendorEntityBuilder) updates]) => @@ -826,6 +850,7 @@ class _$VendorEntity extends VendorEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(name, 'VendorEntity', 'name'); @@ -911,6 +936,7 @@ class _$VendorEntity extends VendorEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -935,25 +961,25 @@ class _$VendorEntity extends VendorEntity { $jc( $jc( $jc( - $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), phone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), - number.hashCode), - vatNumber.hashCode), - idNumber.hashCode), - currencyId.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - contacts.hashCode), - activities.hashCode), - documents.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc(0, name.hashCode), address1.hashCode), address2.hashCode), city.hashCode), state.hashCode), postalCode.hashCode), countryId.hashCode), phone.hashCode), privateNotes.hashCode), publicNotes.hashCode), website.hashCode), number.hashCode), + vatNumber.hashCode), + idNumber.hashCode), + currencyId.hashCode), + customValue1.hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + contacts.hashCode), + activities.hashCode), + documents.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -989,6 +1015,7 @@ class _$VendorEntity extends VendorEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1122,6 +1149,11 @@ class VendorEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1162,6 +1194,7 @@ class VendorEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1224,6 +1257,7 @@ class VendorEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'VendorEntity', 'id')); } catch (_) { String _$failedField; @@ -1281,6 +1315,8 @@ class _$VendorContactEntity extends VendorContactEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$VendorContactEntity( @@ -1305,6 +1341,7 @@ class _$VendorContactEntity extends VendorContactEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull( @@ -1365,6 +1402,7 @@ class _$VendorContactEntity extends VendorContactEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -1389,28 +1427,31 @@ class _$VendorContactEntity extends VendorContactEntity { $jc( $jc( $jc( - 0, - firstName + $jc( + 0, + firstName + .hashCode), + lastName .hashCode), - lastName + email .hashCode), - email + isPrimary .hashCode), - isPrimary - .hashCode), - phone.hashCode), - customValue1.hashCode), - customValue2.hashCode), - customValue3.hashCode), - customValue4.hashCode), - link.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + phone.hashCode), + customValue1 + .hashCode), + customValue2.hashCode), + customValue3.hashCode), + customValue4.hashCode), + link.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -1434,6 +1475,7 @@ class _$VendorContactEntity extends VendorContactEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -1513,6 +1555,11 @@ class VendorContactEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -1541,6 +1588,7 @@ class VendorContactEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -1588,6 +1636,7 @@ class VendorContactEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull(id, 'VendorContactEntity', 'id')); replace(_$result); return _$result; diff --git a/lib/data/models/webhook_model.dart b/lib/data/models/webhook_model.dart index ce8b8998d..2c7e079fc 100644 --- a/lib/data/models/webhook_model.dart +++ b/lib/data/models/webhook_model.dart @@ -56,6 +56,7 @@ abstract class WebhookEntity extends Object factory WebhookEntity({String id, AppState state}) { return _$WebhookEntity._( id: id ?? BaseEntity.nextId, + idempotencyKey: BaseEntity.nextIdempotencyKey, isChanged: false, eventId: '', format: 'JSON', diff --git a/lib/data/models/webhook_model.g.dart b/lib/data/models/webhook_model.g.dart index c2b420ec5..5c0c5c12b 100644 --- a/lib/data/models/webhook_model.g.dart +++ b/lib/data/models/webhook_model.g.dart @@ -175,6 +175,13 @@ class _$WebhookEntitySerializer implements StructuredSerializer { ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.idempotencyKey; + if (value != null) { + result + ..add('idempotency_key') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } return result; } @@ -239,6 +246,10 @@ class _$WebhookEntitySerializer implements StructuredSerializer { result.assignedUserId = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; + case 'idempotency_key': + result.idempotencyKey = serializers.deserialize(value, + specifiedType: const FullType(String)) as String; + break; case 'id': result.id = serializers.deserialize(value, specifiedType: const FullType(String)) as String; @@ -461,6 +472,8 @@ class _$WebhookEntity extends WebhookEntity { @override final String assignedUserId; @override + final String idempotencyKey; + @override final String id; factory _$WebhookEntity([void Function(WebhookEntityBuilder) updates]) => @@ -479,6 +492,7 @@ class _$WebhookEntity extends WebhookEntity { this.isDeleted, this.createdUserId, this.assignedUserId, + this.idempotencyKey, this.id}) : super._() { BuiltValueNullFieldError.checkNotNull(eventId, 'WebhookEntity', 'eventId'); @@ -520,6 +534,7 @@ class _$WebhookEntity extends WebhookEntity { isDeleted == other.isDeleted && createdUserId == other.createdUserId && assignedUserId == other.assignedUserId && + idempotencyKey == other.idempotencyKey && id == other.id; } @@ -537,18 +552,22 @@ class _$WebhookEntity extends WebhookEntity { $jc( $jc( $jc( - $jc($jc(0, eventId.hashCode), - targetUrl.hashCode), - format.hashCode), - restMethod.hashCode), - headers.hashCode), - isChanged.hashCode), - createdAt.hashCode), - updatedAt.hashCode), - archivedAt.hashCode), - isDeleted.hashCode), - createdUserId.hashCode), - assignedUserId.hashCode), + $jc( + $jc( + $jc(0, + eventId.hashCode), + targetUrl.hashCode), + format.hashCode), + restMethod.hashCode), + headers.hashCode), + isChanged.hashCode), + createdAt.hashCode), + updatedAt.hashCode), + archivedAt.hashCode), + isDeleted.hashCode), + createdUserId.hashCode), + assignedUserId.hashCode), + idempotencyKey.hashCode), id.hashCode)); } @@ -567,6 +586,7 @@ class _$WebhookEntity extends WebhookEntity { ..add('isDeleted', isDeleted) ..add('createdUserId', createdUserId) ..add('assignedUserId', assignedUserId) + ..add('idempotencyKey', idempotencyKey) ..add('id', id)) .toString(); } @@ -627,6 +647,11 @@ class WebhookEntityBuilder set assignedUserId(String assignedUserId) => _$this._assignedUserId = assignedUserId; + String _idempotencyKey; + String get idempotencyKey => _$this._idempotencyKey; + set idempotencyKey(String idempotencyKey) => + _$this._idempotencyKey = idempotencyKey; + String _id; String get id => _$this._id; set id(String id) => _$this._id = id; @@ -650,6 +675,7 @@ class WebhookEntityBuilder _isDeleted = $v.isDeleted; _createdUserId = $v.createdUserId; _assignedUserId = $v.assignedUserId; + _idempotencyKey = $v.idempotencyKey; _id = $v.id; _$v = null; } @@ -692,6 +718,7 @@ class WebhookEntityBuilder isDeleted: isDeleted, createdUserId: createdUserId, assignedUserId: assignedUserId, + idempotencyKey: idempotencyKey, id: BuiltValueNullFieldError.checkNotNull( id, 'WebhookEntity', 'id')); } catch (_) { diff --git a/lib/utils/strings.dart b/lib/utils/strings.dart index 905d1abc3..de48a7c71 100644 --- a/lib/utils/strings.dart +++ b/lib/utils/strings.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter_redux/flutter_redux.dart'; import 'package:invoiceninja_flutter/main_app.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; @@ -232,3 +234,11 @@ String trimUrl(String url) { return url; } + +// https://stackoverflow.com/a/61929967/497368 +String getRandomString([int length = 32]) { + const _chars = + 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890'; + return String.fromCharCodes(Iterable.generate( + length, (_) => _chars.codeUnitAt(Random().nextInt(_chars.length)))); +} diff --git a/stubs/data/models/stub_model b/stubs/data/models/stub_model index 37432ce81..829d6079d 100644 --- a/stubs/data/models/stub_model +++ b/stubs/data/models/stub_model @@ -51,6 +51,7 @@ abstract class StubEntity extends Object with BaseEntity implements Built