Use new is_hosted field

This commit is contained in:
Hillel Coren 2022-05-17 10:16:45 +03:00
parent 98cc32edfb
commit cd5beec862
7 changed files with 83 additions and 33 deletions

View File

@ -22,6 +22,7 @@ abstract class AccountEntity
reportErrors: reportErrors, reportErrors: reportErrors,
debugEnabled: false, debugEnabled: false,
isDocker: false, isDocker: false,
isHosted: false,
isSchedulerRunning: false, isSchedulerRunning: false,
disableAutoUpdate: false, disableAutoUpdate: false,
isMigrated: false, isMigrated: false,
@ -73,6 +74,9 @@ abstract class AccountEntity
@BuiltValueField(wireName: 'is_migrated') @BuiltValueField(wireName: 'is_migrated')
bool get isMigrated; bool get isMigrated;
@BuiltValueField(wireName: 'is_hosted')
bool get isHosted;
@BuiltValueField(wireName: 'is_scheduler_running') @BuiltValueField(wireName: 'is_scheduler_running')
bool get isSchedulerRunning; bool get isSchedulerRunning;
@ -107,6 +111,7 @@ abstract class AccountEntity
..isSchedulerRunning = false ..isSchedulerRunning = false
..disableAutoUpdate = false ..disableAutoUpdate = false
..isMigrated = false ..isMigrated = false
..isHosted = false
..trialPlan = '' ..trialPlan = ''
..trialStarted = '' ..trialStarted = ''
..defaultCompanyId = '' ..defaultCompanyId = ''

View File

@ -53,6 +53,9 @@ class _$AccountEntitySerializer implements StructuredSerializer<AccountEntity> {
'is_migrated', 'is_migrated',
serializers.serialize(object.isMigrated, serializers.serialize(object.isMigrated,
specifiedType: const FullType(bool)), specifiedType: const FullType(bool)),
'is_hosted',
serializers.serialize(object.isHosted,
specifiedType: const FullType(bool)),
'is_scheduler_running', 'is_scheduler_running',
serializers.serialize(object.isSchedulerRunning, serializers.serialize(object.isSchedulerRunning,
specifiedType: const FullType(bool)), specifiedType: const FullType(bool)),
@ -133,6 +136,10 @@ class _$AccountEntitySerializer implements StructuredSerializer<AccountEntity> {
result.isMigrated = serializers.deserialize(value, result.isMigrated = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
break; break;
case 'is_hosted':
result.isHosted = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case 'is_scheduler_running': case 'is_scheduler_running':
result.isSchedulerRunning = serializers.deserialize(value, result.isSchedulerRunning = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
@ -186,6 +193,8 @@ class _$AccountEntity extends AccountEntity {
@override @override
final bool isMigrated; final bool isMigrated;
@override @override
final bool isHosted;
@override
final bool isSchedulerRunning; final bool isSchedulerRunning;
@override @override
final bool disableAutoUpdate; final bool disableAutoUpdate;
@ -212,6 +221,7 @@ class _$AccountEntity extends AccountEntity {
this.debugEnabled, this.debugEnabled,
this.isDocker, this.isDocker,
this.isMigrated, this.isMigrated,
this.isHosted,
this.isSchedulerRunning, this.isSchedulerRunning,
this.disableAutoUpdate, this.disableAutoUpdate,
this.defaultCompanyId, this.defaultCompanyId,
@ -240,6 +250,8 @@ class _$AccountEntity extends AccountEntity {
isDocker, 'AccountEntity', 'isDocker'); isDocker, 'AccountEntity', 'isDocker');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
isMigrated, 'AccountEntity', 'isMigrated'); isMigrated, 'AccountEntity', 'isMigrated');
BuiltValueNullFieldError.checkNotNull(
isHosted, 'AccountEntity', 'isHosted');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning'); isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -275,6 +287,7 @@ class _$AccountEntity extends AccountEntity {
debugEnabled == other.debugEnabled && debugEnabled == other.debugEnabled &&
isDocker == other.isDocker && isDocker == other.isDocker &&
isMigrated == other.isMigrated && isMigrated == other.isMigrated &&
isHosted == other.isHosted &&
isSchedulerRunning == other.isSchedulerRunning && isSchedulerRunning == other.isSchedulerRunning &&
disableAutoUpdate == other.disableAutoUpdate && disableAutoUpdate == other.disableAutoUpdate &&
defaultCompanyId == other.defaultCompanyId && defaultCompanyId == other.defaultCompanyId &&
@ -302,23 +315,26 @@ class _$AccountEntity extends AccountEntity {
$jc( $jc(
$jc( $jc(
$jc( $jc(
0, $jc(
id 0,
id
.hashCode),
trialPlan
.hashCode), .hashCode),
trialPlan trialStarted
.hashCode), .hashCode),
trialStarted defaultUrl
.hashCode), .hashCode),
defaultUrl reportErrors
.hashCode), .hashCode),
reportErrors.hashCode), plan.hashCode),
plan.hashCode), planExpires.hashCode),
planExpires.hashCode), latestVersion.hashCode),
latestVersion.hashCode), currentVersion.hashCode),
currentVersion.hashCode), debugEnabled.hashCode),
debugEnabled.hashCode), isDocker.hashCode),
isDocker.hashCode), isMigrated.hashCode),
isMigrated.hashCode), isHosted.hashCode),
isSchedulerRunning.hashCode), isSchedulerRunning.hashCode),
disableAutoUpdate.hashCode), disableAutoUpdate.hashCode),
defaultCompanyId.hashCode), defaultCompanyId.hashCode),
@ -341,6 +357,7 @@ class _$AccountEntity extends AccountEntity {
..add('debugEnabled', debugEnabled) ..add('debugEnabled', debugEnabled)
..add('isDocker', isDocker) ..add('isDocker', isDocker)
..add('isMigrated', isMigrated) ..add('isMigrated', isMigrated)
..add('isHosted', isHosted)
..add('isSchedulerRunning', isSchedulerRunning) ..add('isSchedulerRunning', isSchedulerRunning)
..add('disableAutoUpdate', disableAutoUpdate) ..add('disableAutoUpdate', disableAutoUpdate)
..add('defaultCompanyId', defaultCompanyId) ..add('defaultCompanyId', defaultCompanyId)
@ -404,6 +421,10 @@ class AccountEntityBuilder
bool get isMigrated => _$this._isMigrated; bool get isMigrated => _$this._isMigrated;
set isMigrated(bool isMigrated) => _$this._isMigrated = isMigrated; set isMigrated(bool isMigrated) => _$this._isMigrated = isMigrated;
bool _isHosted;
bool get isHosted => _$this._isHosted;
set isHosted(bool isHosted) => _$this._isHosted = isHosted;
bool _isSchedulerRunning; bool _isSchedulerRunning;
bool get isSchedulerRunning => _$this._isSchedulerRunning; bool get isSchedulerRunning => _$this._isSchedulerRunning;
set isSchedulerRunning(bool isSchedulerRunning) => set isSchedulerRunning(bool isSchedulerRunning) =>
@ -448,6 +469,7 @@ class AccountEntityBuilder
_debugEnabled = $v.debugEnabled; _debugEnabled = $v.debugEnabled;
_isDocker = $v.isDocker; _isDocker = $v.isDocker;
_isMigrated = $v.isMigrated; _isMigrated = $v.isMigrated;
_isHosted = $v.isHosted;
_isSchedulerRunning = $v.isSchedulerRunning; _isSchedulerRunning = $v.isSchedulerRunning;
_disableAutoUpdate = $v.disableAutoUpdate; _disableAutoUpdate = $v.disableAutoUpdate;
_defaultCompanyId = $v.defaultCompanyId; _defaultCompanyId = $v.defaultCompanyId;
@ -494,6 +516,7 @@ class AccountEntityBuilder
debugEnabled: BuiltValueNullFieldError.checkNotNull(debugEnabled, 'AccountEntity', 'debugEnabled'), debugEnabled: BuiltValueNullFieldError.checkNotNull(debugEnabled, 'AccountEntity', 'debugEnabled'),
isDocker: BuiltValueNullFieldError.checkNotNull(isDocker, 'AccountEntity', 'isDocker'), isDocker: BuiltValueNullFieldError.checkNotNull(isDocker, 'AccountEntity', 'isDocker'),
isMigrated: BuiltValueNullFieldError.checkNotNull(isMigrated, 'AccountEntity', 'isMigrated'), isMigrated: BuiltValueNullFieldError.checkNotNull(isMigrated, 'AccountEntity', 'isMigrated'),
isHosted: BuiltValueNullFieldError.checkNotNull(isHosted, 'AccountEntity', 'isHosted'),
isSchedulerRunning: BuiltValueNullFieldError.checkNotNull(isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning'), isSchedulerRunning: BuiltValueNullFieldError.checkNotNull(isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning'),
disableAutoUpdate: BuiltValueNullFieldError.checkNotNull(disableAutoUpdate, 'AccountEntity', 'disableAutoUpdate'), disableAutoUpdate: BuiltValueNullFieldError.checkNotNull(disableAutoUpdate, 'AccountEntity', 'disableAutoUpdate'),
defaultCompanyId: BuiltValueNullFieldError.checkNotNull(defaultCompanyId, 'AccountEntity', 'defaultCompanyId'), defaultCompanyId: BuiltValueNullFieldError.checkNotNull(defaultCompanyId, 'AccountEntity', 'defaultCompanyId'),

View File

@ -103,6 +103,7 @@ abstract class CompanyEntity extends Object
markdownEmailEnabled: true, markdownEmailEnabled: true,
useCommaAsDecimalPlace: false, useCommaAsDecimalPlace: false,
reportIncludeDrafts: false, reportIncludeDrafts: false,
stopOnUnpaidRecurring: false,
groups: BuiltList<GroupEntity>(), groups: BuiltList<GroupEntity>(),
taxRates: BuiltList<TaxRateEntity>(), taxRates: BuiltList<TaxRateEntity>(),
taskStatuses: BuiltList<TaskStatusEntity>(), taskStatuses: BuiltList<TaskStatusEntity>(),
@ -363,6 +364,9 @@ abstract class CompanyEntity extends Object
@BuiltValueField(wireName: 'calculate_expense_tax_by_amount') @BuiltValueField(wireName: 'calculate_expense_tax_by_amount')
bool get calculateExpenseTaxByAmount; bool get calculateExpenseTaxByAmount;
@BuiltValueField(wireName: 'stop_on_unpaid_recurring ')
bool get stopOnUnpaidRecurring;
String get displayName => settings.name ?? ''; String get displayName => settings.name ?? '';
@override @override
@ -598,6 +602,7 @@ abstract class CompanyEntity extends Object
..useCommaAsDecimalPlace = false ..useCommaAsDecimalPlace = false
..reportIncludeDrafts = false ..reportIncludeDrafts = false
..convertRateToClient = true ..convertRateToClient = true
..stopOnUnpaidRecurring = false
..systemLogs.replace(BuiltList<SystemLogEntity>()) ..systemLogs.replace(BuiltList<SystemLogEntity>())
..subscriptions.replace(BuiltList<SubscriptionEntity>()) ..subscriptions.replace(BuiltList<SubscriptionEntity>())
..recurringExpenses.replace(BuiltList<ExpenseEntity>()) ..recurringExpenses.replace(BuiltList<ExpenseEntity>())

View File

@ -301,6 +301,9 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
'calculate_expense_tax_by_amount', 'calculate_expense_tax_by_amount',
serializers.serialize(object.calculateExpenseTaxByAmount, serializers.serialize(object.calculateExpenseTaxByAmount,
specifiedType: const FullType(bool)), specifiedType: const FullType(bool)),
'stop_on_unpaid_recurring ',
serializers.serialize(object.stopOnUnpaidRecurring,
specifiedType: const FullType(bool)),
'created_at', 'created_at',
serializers.serialize(object.createdAt, serializers.serialize(object.createdAt,
specifiedType: const FullType(int)), specifiedType: const FullType(int)),
@ -738,6 +741,10 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
result.calculateExpenseTaxByAmount = serializers.deserialize(value, result.calculateExpenseTaxByAmount = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
break; break;
case 'stop_on_unpaid_recurring ':
result.stopOnUnpaidRecurring = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case 'isChanged': case 'isChanged':
result.isChanged = serializers.deserialize(value, result.isChanged = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
@ -1513,6 +1520,8 @@ class _$CompanyEntity extends CompanyEntity {
@override @override
final bool calculateExpenseTaxByAmount; final bool calculateExpenseTaxByAmount;
@override @override
final bool stopOnUnpaidRecurring;
@override
final bool isChanged; final bool isChanged;
@override @override
final int createdAt; final int createdAt;
@ -1614,6 +1623,7 @@ class _$CompanyEntity extends CompanyEntity {
this.settings, this.settings,
this.enabledModules, this.enabledModules,
this.calculateExpenseTaxByAmount, this.calculateExpenseTaxByAmount,
this.stopOnUnpaidRecurring,
this.isChanged, this.isChanged,
this.createdAt, this.createdAt,
this.updatedAt, this.updatedAt,
@ -1771,6 +1781,8 @@ class _$CompanyEntity extends CompanyEntity {
enabledModules, 'CompanyEntity', 'enabledModules'); enabledModules, 'CompanyEntity', 'enabledModules');
BuiltValueNullFieldError.checkNotNull(calculateExpenseTaxByAmount, BuiltValueNullFieldError.checkNotNull(calculateExpenseTaxByAmount,
'CompanyEntity', 'calculateExpenseTaxByAmount'); 'CompanyEntity', 'calculateExpenseTaxByAmount');
BuiltValueNullFieldError.checkNotNull(
stopOnUnpaidRecurring, 'CompanyEntity', 'stopOnUnpaidRecurring');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
createdAt, 'CompanyEntity', 'createdAt'); createdAt, 'CompanyEntity', 'createdAt');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -1870,6 +1882,7 @@ class _$CompanyEntity extends CompanyEntity {
settings == other.settings && settings == other.settings &&
enabledModules == other.enabledModules && enabledModules == other.enabledModules &&
calculateExpenseTaxByAmount == other.calculateExpenseTaxByAmount && calculateExpenseTaxByAmount == other.calculateExpenseTaxByAmount &&
stopOnUnpaidRecurring == other.stopOnUnpaidRecurring &&
isChanged == other.isChanged && isChanged == other.isChanged &&
createdAt == other.createdAt && createdAt == other.createdAt &&
updatedAt == other.updatedAt && updatedAt == other.updatedAt &&
@ -1902,17 +1915,17 @@ 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(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), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.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), 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), $jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($jc($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), expenseInclusiveTaxes.hashCode), sessionTimeout.hashCode), passwordTimeout.hashCode), oauthPasswordRequired.hashCode), markdownEnabled.hashCode), markdownEmailEnabled.hashCode), useCommaAsDecimalPlace.hashCode), reportIncludeDrafts.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), 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),
invoiceExpenseDocuments.hashCode), invoiceTaskDocuments.hashCode),
invoiceTaskDocuments.hashCode), invoiceTaskTimelog.hashCode),
invoiceTaskTimelog.hashCode), invoiceTaskDatelog.hashCode),
invoiceTaskDatelog.hashCode), autoStartTasks.hashCode),
autoStartTasks.hashCode), showTasksTable.hashCode),
showTasksTable.hashCode), showTaskEndDate.hashCode),
showTaskEndDate.hashCode), settings.hashCode),
settings.hashCode), enabledModules.hashCode),
enabledModules.hashCode), calculateExpenseTaxByAmount.hashCode),
calculateExpenseTaxByAmount.hashCode), stopOnUnpaidRecurring.hashCode),
isChanged.hashCode), isChanged.hashCode),
createdAt.hashCode), createdAt.hashCode),
updatedAt.hashCode), updatedAt.hashCode),
@ -2006,6 +2019,7 @@ class _$CompanyEntity extends CompanyEntity {
..add('settings', settings) ..add('settings', settings)
..add('enabledModules', enabledModules) ..add('enabledModules', enabledModules)
..add('calculateExpenseTaxByAmount', calculateExpenseTaxByAmount) ..add('calculateExpenseTaxByAmount', calculateExpenseTaxByAmount)
..add('stopOnUnpaidRecurring', stopOnUnpaidRecurring)
..add('isChanged', isChanged) ..add('isChanged', isChanged)
..add('createdAt', createdAt) ..add('createdAt', createdAt)
..add('updatedAt', updatedAt) ..add('updatedAt', updatedAt)
@ -2431,6 +2445,11 @@ class CompanyEntityBuilder
set calculateExpenseTaxByAmount(bool calculateExpenseTaxByAmount) => set calculateExpenseTaxByAmount(bool calculateExpenseTaxByAmount) =>
_$this._calculateExpenseTaxByAmount = calculateExpenseTaxByAmount; _$this._calculateExpenseTaxByAmount = calculateExpenseTaxByAmount;
bool _stopOnUnpaidRecurring;
bool get stopOnUnpaidRecurring => _$this._stopOnUnpaidRecurring;
set stopOnUnpaidRecurring(bool stopOnUnpaidRecurring) =>
_$this._stopOnUnpaidRecurring = stopOnUnpaidRecurring;
bool _isChanged; bool _isChanged;
bool get isChanged => _$this._isChanged; bool get isChanged => _$this._isChanged;
set isChanged(bool isChanged) => _$this._isChanged = isChanged; set isChanged(bool isChanged) => _$this._isChanged = isChanged;
@ -2555,6 +2574,7 @@ class CompanyEntityBuilder
_settings = $v.settings.toBuilder(); _settings = $v.settings.toBuilder();
_enabledModules = $v.enabledModules; _enabledModules = $v.enabledModules;
_calculateExpenseTaxByAmount = $v.calculateExpenseTaxByAmount; _calculateExpenseTaxByAmount = $v.calculateExpenseTaxByAmount;
_stopOnUnpaidRecurring = $v.stopOnUnpaidRecurring;
_isChanged = $v.isChanged; _isChanged = $v.isChanged;
_createdAt = $v.createdAt; _createdAt = $v.createdAt;
_updatedAt = $v.updatedAt; _updatedAt = $v.updatedAt;
@ -2679,6 +2699,7 @@ class CompanyEntityBuilder
settings: settings.build(), settings: settings.build(),
enabledModules: BuiltValueNullFieldError.checkNotNull(enabledModules, 'CompanyEntity', 'enabledModules'), enabledModules: BuiltValueNullFieldError.checkNotNull(enabledModules, 'CompanyEntity', 'enabledModules'),
calculateExpenseTaxByAmount: BuiltValueNullFieldError.checkNotNull(calculateExpenseTaxByAmount, 'CompanyEntity', 'calculateExpenseTaxByAmount'), calculateExpenseTaxByAmount: BuiltValueNullFieldError.checkNotNull(calculateExpenseTaxByAmount, 'CompanyEntity', 'calculateExpenseTaxByAmount'),
stopOnUnpaidRecurring: BuiltValueNullFieldError.checkNotNull(stopOnUnpaidRecurring, 'CompanyEntity', 'stopOnUnpaidRecurring'),
isChanged: isChanged, isChanged: isChanged,
createdAt: BuiltValueNullFieldError.checkNotNull(createdAt, 'CompanyEntity', 'createdAt'), createdAt: BuiltValueNullFieldError.checkNotNull(createdAt, 'CompanyEntity', 'createdAt'),
updatedAt: BuiltValueNullFieldError.checkNotNull(updatedAt, 'CompanyEntity', 'updatedAt'), updatedAt: BuiltValueNullFieldError.checkNotNull(updatedAt, 'CompanyEntity', 'updatedAt'),

View File

@ -752,25 +752,21 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
bool get reportErrors => account?.reportErrors ?? false; bool get reportErrors => account?.reportErrors ?? false;
bool get isHosted => authState.isHosted ?? false; bool get isHosted => account == null ? authState.isHosted : account.isHosted;
bool get isSelfHosted => authState.isSelfHost ?? false; bool get isSelfHosted => !isHosted;
bool get isDemo => cleanApiUrl(authState.url) == kAppDemoUrl; bool get isDemo => cleanApiUrl(authState.url) == kAppDemoUrl;
bool get isStaging => cleanApiUrl(authState.url) == kAppStagingUrl; bool get isStaging => cleanApiUrl(authState.url) == kAppStagingUrl;
bool get isProduction => cleanApiUrl(authState.url) == kAppProductionUrl;
bool get isWhiteLabeled => account.plan == kPlanWhiteLabel; bool get isWhiteLabeled => account.plan == kPlanWhiteLabel;
bool get isProPlan => isEnterprisePlan || account.plan == kPlanPro; bool get isProPlan => isEnterprisePlan || account.plan == kPlanPro;
bool get isTrial => isHosted && account.isTrial; bool get isTrial => isHosted && account.isTrial;
bool get isEnterprisePlan => !isProduction || account.plan == kPlanEnterprise; bool get isEnterprisePlan => isSelfHosted || account.plan == kPlanEnterprise;
//bool get isEnterprisePlan => isSelfHosted || account.plan == kPlanEnterprise;
bool get isPaidAccount => isSelfHosted bool get isPaidAccount => isSelfHosted
? isWhiteLabeled ? isWhiteLabeled

View File

@ -999,7 +999,7 @@ class __PdfPreviewState extends State<_PdfPreview> {
if (widget.invoice.isOld) { if (widget.invoice.isOld) {
url += '&entity_id=${widget.invoice.id}'; url += '&entity_id=${widget.invoice.id}';
} }
if (state.isProduction) { if (state.isHosted) {
url = url.replaceFirst('//', '//preview.'); url = url.replaceFirst('//', '//preview.');
} }

View File

@ -55,7 +55,7 @@ class InvoiceEditPDFState extends State<InvoiceEditPDF> {
if (viewModel.invoice.isOld) { if (viewModel.invoice.isOld) {
url += '&entity_id=${viewModel.invoice.id}'; url += '&entity_id=${viewModel.invoice.id}';
} }
if (viewModel.state.isProduction) { if (viewModel.state.isHosted) {
url = url.replaceFirst('//', '//preview.'); url = url.replaceFirst('//', '//preview.');
} }