Update models
This commit is contained in:
parent
f0ab06657f
commit
77ffd4e78f
|
|
@ -87,6 +87,7 @@ class EntityAction extends EnumClass {
|
|||
static const EntityAction invoiceTask = _$invoiceTask;
|
||||
static const EntityAction invoiceExpense = _$invoiceExpense;
|
||||
static const EntityAction invoiceProject = _$invoiceProject;
|
||||
static const EntityAction sendInvite = _$sendInvite;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ abstract class UserEntity extends Object
|
|||
userCompany: userCompany,
|
||||
oauthProvider: '',
|
||||
isTwoFactorEnabled: false,
|
||||
hasPassword: false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -147,6 +148,9 @@ abstract class UserEntity extends Object
|
|||
@BuiltValueField(wireName: 'google_2fa_secret')
|
||||
bool get isTwoFactorEnabled;
|
||||
|
||||
@BuiltValueField(wireName: 'has_password')
|
||||
String get hasPassword;
|
||||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: 'company_user')
|
||||
UserCompanyEntity get userCompany;
|
||||
|
|
@ -240,6 +244,10 @@ abstract class UserEntity extends Object
|
|||
}
|
||||
|
||||
if (userCompany.isAdmin || userCompany.isOwner) {
|
||||
if (!isEmailVerified) {
|
||||
//actions.add(EntityAction.);
|
||||
}
|
||||
|
||||
actions.add(EntityAction.remove);
|
||||
}
|
||||
|
||||
|
|
@ -259,9 +267,12 @@ abstract class UserEntity extends Object
|
|||
bool get isConnectedToGoogle =>
|
||||
oauthProvider == UserEntity.OAUTH_PROVIDER_GOOGLE;
|
||||
|
||||
bool get isEmailVerified => emailVerifiedAt != null;
|
||||
|
||||
// ignore: unused_element
|
||||
static void _initializeBuilder(UserEntityBuilder builder) =>
|
||||
builder..isTwoFactorEnabled = false;
|
||||
static void _initializeBuilder(UserEntityBuilder builder) => builder
|
||||
..isTwoFactorEnabled = false
|
||||
..hasPassword = false;
|
||||
|
||||
static Serializer<UserEntity> get serializer => _$userEntitySerializer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue