Add is_migrated
This commit is contained in:
parent
269832f663
commit
09b07f2a1f
|
|
@ -20,6 +20,7 @@ abstract class AccountEntity
|
||||||
isDocker: false,
|
isDocker: false,
|
||||||
isSchedulerRunning: false,
|
isSchedulerRunning: false,
|
||||||
disableAutoUpdate: false,
|
disableAutoUpdate: false,
|
||||||
|
isMigrated: false,
|
||||||
defaultCompanyId: '',
|
defaultCompanyId: '',
|
||||||
trialPlan: '',
|
trialPlan: '',
|
||||||
trialStarted: '',
|
trialStarted: '',
|
||||||
|
|
@ -63,6 +64,9 @@ abstract class AccountEntity
|
||||||
@BuiltValueField(wireName: 'is_docker')
|
@BuiltValueField(wireName: 'is_docker')
|
||||||
bool get isDocker;
|
bool get isDocker;
|
||||||
|
|
||||||
|
@BuiltValueField(wireName: 'is_migrated')
|
||||||
|
bool get isMigrated;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'is_scheduler_running')
|
@BuiltValueField(wireName: 'is_scheduler_running')
|
||||||
bool get isSchedulerRunning;
|
bool get isSchedulerRunning;
|
||||||
|
|
||||||
|
|
@ -88,6 +92,7 @@ abstract class AccountEntity
|
||||||
..isDocker = false
|
..isDocker = false
|
||||||
..isSchedulerRunning = false
|
..isSchedulerRunning = false
|
||||||
..disableAutoUpdate = false
|
..disableAutoUpdate = false
|
||||||
|
..isMigrated = false
|
||||||
..trialPlan = ''
|
..trialPlan = ''
|
||||||
..trialStarted = ''
|
..trialStarted = ''
|
||||||
..defaultCompanyId = '';
|
..defaultCompanyId = '';
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ class _$AccountEntitySerializer implements StructuredSerializer<AccountEntity> {
|
||||||
'is_docker',
|
'is_docker',
|
||||||
serializers.serialize(object.isDocker,
|
serializers.serialize(object.isDocker,
|
||||||
specifiedType: const FullType(bool)),
|
specifiedType: const FullType(bool)),
|
||||||
|
'is_migrated',
|
||||||
|
serializers.serialize(object.isMigrated,
|
||||||
|
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)),
|
||||||
|
|
@ -120,6 +123,10 @@ class _$AccountEntitySerializer implements StructuredSerializer<AccountEntity> {
|
||||||
result.isDocker = serializers.deserialize(value,
|
result.isDocker = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(bool)) as bool;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
break;
|
break;
|
||||||
|
case 'is_migrated':
|
||||||
|
result.isMigrated = 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;
|
||||||
|
|
@ -163,6 +170,8 @@ class _$AccountEntity extends AccountEntity {
|
||||||
@override
|
@override
|
||||||
final bool isDocker;
|
final bool isDocker;
|
||||||
@override
|
@override
|
||||||
|
final bool isMigrated;
|
||||||
|
@override
|
||||||
final bool isSchedulerRunning;
|
final bool isSchedulerRunning;
|
||||||
@override
|
@override
|
||||||
final bool disableAutoUpdate;
|
final bool disableAutoUpdate;
|
||||||
|
|
@ -184,6 +193,7 @@ class _$AccountEntity extends AccountEntity {
|
||||||
this.currentVersion,
|
this.currentVersion,
|
||||||
this.debugEnabled,
|
this.debugEnabled,
|
||||||
this.isDocker,
|
this.isDocker,
|
||||||
|
this.isMigrated,
|
||||||
this.isSchedulerRunning,
|
this.isSchedulerRunning,
|
||||||
this.disableAutoUpdate,
|
this.disableAutoUpdate,
|
||||||
this.defaultCompanyId})
|
this.defaultCompanyId})
|
||||||
|
|
@ -208,6 +218,8 @@ class _$AccountEntity extends AccountEntity {
|
||||||
debugEnabled, 'AccountEntity', 'debugEnabled');
|
debugEnabled, 'AccountEntity', 'debugEnabled');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
isDocker, 'AccountEntity', 'isDocker');
|
isDocker, 'AccountEntity', 'isDocker');
|
||||||
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
isMigrated, 'AccountEntity', 'isMigrated');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning');
|
isSchedulerRunning, 'AccountEntity', 'isSchedulerRunning');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
|
@ -238,6 +250,7 @@ class _$AccountEntity extends AccountEntity {
|
||||||
currentVersion == other.currentVersion &&
|
currentVersion == other.currentVersion &&
|
||||||
debugEnabled == other.debugEnabled &&
|
debugEnabled == other.debugEnabled &&
|
||||||
isDocker == other.isDocker &&
|
isDocker == other.isDocker &&
|
||||||
|
isMigrated == other.isMigrated &&
|
||||||
isSchedulerRunning == other.isSchedulerRunning &&
|
isSchedulerRunning == other.isSchedulerRunning &&
|
||||||
disableAutoUpdate == other.disableAutoUpdate &&
|
disableAutoUpdate == other.disableAutoUpdate &&
|
||||||
defaultCompanyId == other.defaultCompanyId;
|
defaultCompanyId == other.defaultCompanyId;
|
||||||
|
|
@ -256,6 +269,7 @@ class _$AccountEntity extends AccountEntity {
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc($jc(0, id.hashCode),
|
$jc($jc(0, id.hashCode),
|
||||||
|
|
@ -269,6 +283,7 @@ class _$AccountEntity extends AccountEntity {
|
||||||
currentVersion.hashCode),
|
currentVersion.hashCode),
|
||||||
debugEnabled.hashCode),
|
debugEnabled.hashCode),
|
||||||
isDocker.hashCode),
|
isDocker.hashCode),
|
||||||
|
isMigrated.hashCode),
|
||||||
isSchedulerRunning.hashCode),
|
isSchedulerRunning.hashCode),
|
||||||
disableAutoUpdate.hashCode),
|
disableAutoUpdate.hashCode),
|
||||||
defaultCompanyId.hashCode));
|
defaultCompanyId.hashCode));
|
||||||
|
|
@ -288,6 +303,7 @@ class _$AccountEntity extends AccountEntity {
|
||||||
..add('currentVersion', currentVersion)
|
..add('currentVersion', currentVersion)
|
||||||
..add('debugEnabled', debugEnabled)
|
..add('debugEnabled', debugEnabled)
|
||||||
..add('isDocker', isDocker)
|
..add('isDocker', isDocker)
|
||||||
|
..add('isMigrated', isMigrated)
|
||||||
..add('isSchedulerRunning', isSchedulerRunning)
|
..add('isSchedulerRunning', isSchedulerRunning)
|
||||||
..add('disableAutoUpdate', disableAutoUpdate)
|
..add('disableAutoUpdate', disableAutoUpdate)
|
||||||
..add('defaultCompanyId', defaultCompanyId))
|
..add('defaultCompanyId', defaultCompanyId))
|
||||||
|
|
@ -345,6 +361,10 @@ class AccountEntityBuilder
|
||||||
bool get isDocker => _$this._isDocker;
|
bool get isDocker => _$this._isDocker;
|
||||||
set isDocker(bool isDocker) => _$this._isDocker = isDocker;
|
set isDocker(bool isDocker) => _$this._isDocker = isDocker;
|
||||||
|
|
||||||
|
bool _isMigrated;
|
||||||
|
bool get isMigrated => _$this._isMigrated;
|
||||||
|
set isMigrated(bool isMigrated) => _$this._isMigrated = isMigrated;
|
||||||
|
|
||||||
bool _isSchedulerRunning;
|
bool _isSchedulerRunning;
|
||||||
bool get isSchedulerRunning => _$this._isSchedulerRunning;
|
bool get isSchedulerRunning => _$this._isSchedulerRunning;
|
||||||
set isSchedulerRunning(bool isSchedulerRunning) =>
|
set isSchedulerRunning(bool isSchedulerRunning) =>
|
||||||
|
|
@ -378,6 +398,7 @@ class AccountEntityBuilder
|
||||||
_currentVersion = $v.currentVersion;
|
_currentVersion = $v.currentVersion;
|
||||||
_debugEnabled = $v.debugEnabled;
|
_debugEnabled = $v.debugEnabled;
|
||||||
_isDocker = $v.isDocker;
|
_isDocker = $v.isDocker;
|
||||||
|
_isMigrated = $v.isMigrated;
|
||||||
_isSchedulerRunning = $v.isSchedulerRunning;
|
_isSchedulerRunning = $v.isSchedulerRunning;
|
||||||
_disableAutoUpdate = $v.disableAutoUpdate;
|
_disableAutoUpdate = $v.disableAutoUpdate;
|
||||||
_defaultCompanyId = $v.defaultCompanyId;
|
_defaultCompanyId = $v.defaultCompanyId;
|
||||||
|
|
@ -421,6 +442,7 @@ class AccountEntityBuilder
|
||||||
currentVersion, 'AccountEntity', 'currentVersion'),
|
currentVersion, 'AccountEntity', 'currentVersion'),
|
||||||
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'),
|
||||||
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'));
|
||||||
|
|
|
||||||
|
|
@ -436,8 +436,6 @@ abstract class CompanyEntity extends Object
|
||||||
|
|
||||||
bool get hasTaxes => hasInvoiceTaxes || hasItemTaxes;
|
bool get hasTaxes => hasInvoiceTaxes || hasItemTaxes;
|
||||||
|
|
||||||
bool get isMigrated => companyKey.length == 32;
|
|
||||||
|
|
||||||
bool get isSmall => !isLarge;
|
bool get isSmall => !isLarge;
|
||||||
|
|
||||||
bool get hasCustomSurcharge =>
|
bool get hasCustomSurcharge =>
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ class _AccountOverview extends StatelessWidget {
|
||||||
String secondLabel;
|
String secondLabel;
|
||||||
|
|
||||||
if (state.isHosted && (account.plan.isEmpty || account.isTrial)) {
|
if (state.isHosted && (account.plan.isEmpty || account.isTrial)) {
|
||||||
final clientLimit = viewModel.company.isMigrated ? 100 : 50;
|
final clientLimit = viewModel.state.account.isMigrated ? 100 : 50;
|
||||||
secondLabel = localization.clients;
|
secondLabel = localization.clients;
|
||||||
secondValue = '${viewModel.state.clientState.list.length} / $clientLimit';
|
secondValue = '${viewModel.state.clientState.list.length} / $clientLimit';
|
||||||
} else if (account.planExpires.isNotEmpty) {
|
} else if (account.planExpires.isNotEmpty) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue