Credits
This commit is contained in:
parent
a0c82744df
commit
5a8354bd57
|
|
@ -268,7 +268,7 @@ class _$ClientEntitySerializer implements StructuredSerializer<ClientEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -466,7 +466,7 @@ class _$ClientEntitySerializer implements StructuredSerializer<ClientEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -578,7 +578,7 @@ class _$ContactEntitySerializer implements StructuredSerializer<ContactEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -683,7 +683,7 @@ class _$ContactEntitySerializer implements StructuredSerializer<ContactEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -971,7 +971,7 @@ class _$ClientEntity extends ClientEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1466,9 +1466,9 @@ class ClientEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
@ -1656,7 +1656,7 @@ class _$ContactEntity extends ContactEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1917,9 +1917,9 @@ class ContactEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class _$CompanyGatewayEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -316,7 +316,7 @@ class _$CompanyGatewayEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -684,7 +684,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -959,9 +959,9 @@ class CompanyGatewayEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -532,7 +532,7 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -2721,7 +2721,7 @@ class _$CompanyEntity extends CompanyEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -3365,9 +3365,9 @@ class CompanyEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ class _$DocumentEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -349,7 +349,7 @@ class _$DocumentEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -600,7 +600,7 @@ class _$DocumentEntity extends DocumentEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -871,9 +871,9 @@ class DocumentEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ abstract class BaseEntity implements SelectableEntity {
|
|||
|
||||
@nullable
|
||||
@BuiltValueField(wireName: 'entity_type')
|
||||
String get subEntityType;
|
||||
EntityType get subEntityType;
|
||||
|
||||
String get entityKey => '__${entityType}__${id}__';
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class _$ExpenseEntitySerializer implements StructuredSerializer<ExpenseEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -436,7 +436,7 @@ class _$ExpenseEntitySerializer implements StructuredSerializer<ExpenseEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -513,7 +513,7 @@ class _$ExpenseCategoryEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -570,7 +570,7 @@ class _$ExpenseCategoryEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -895,7 +895,7 @@ class _$ExpenseEntity extends ExpenseEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1299,9 +1299,9 @@ class ExpenseEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
@ -1431,7 +1431,7 @@ class _$ExpenseCategoryEntity extends ExpenseCategoryEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1558,9 +1558,9 @@ class ExpenseCategoryEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ class _$GatewayTokenEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -248,7 +248,7 @@ class _$GatewayTokenEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -477,7 +477,7 @@ class _$GatewayTokenEntity extends GatewayTokenEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -643,9 +643,9 @@ class GatewayTokenEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class _$GroupEntitySerializer implements StructuredSerializer<GroupEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -221,7 +221,7 @@ class _$GroupEntitySerializer implements StructuredSerializer<GroupEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -439,7 +439,7 @@ class _$GroupEntity extends GroupEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -575,9 +575,9 @@ class GroupEntityBuilder implements Builder<GroupEntity, GroupEntityBuilder> {
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -74,11 +74,16 @@ class InvoiceFields {
|
|||
abstract class InvoiceEntity extends Object
|
||||
with BaseEntity, SelectableEntity, CalculateInvoiceTotal, BelongsToClient
|
||||
implements Built<InvoiceEntity, InvoiceEntityBuilder> {
|
||||
factory InvoiceEntity(
|
||||
{String id, bool isQuote = false, AppState state, ClientEntity client}) {
|
||||
factory InvoiceEntity({
|
||||
String id,
|
||||
AppState state,
|
||||
ClientEntity client,
|
||||
EntityType entityType,
|
||||
}) {
|
||||
final company = state?.company;
|
||||
return _$InvoiceEntity._(
|
||||
id: id ?? BaseEntity.nextId,
|
||||
subEntityType: entityType ?? EntityType.invoice,
|
||||
isChanged: false,
|
||||
amount: 0.0,
|
||||
balance: 0.0,
|
||||
|
|
@ -153,8 +158,8 @@ abstract class InvoiceEntity extends Object
|
|||
|
||||
@override
|
||||
EntityType get entityType {
|
||||
if ((subEntityType ?? '').isNotEmpty) {
|
||||
return EntityType.valueOf(subEntityType);
|
||||
if (subEntityType != null) {
|
||||
return subEntityType;
|
||||
} else {
|
||||
return EntityType.invoice;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ class _$InvoiceEntitySerializer implements StructuredSerializer<InvoiceEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -558,7 +558,7 @@ class _$InvoiceEntitySerializer implements StructuredSerializer<InvoiceEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -823,7 +823,7 @@ class _$InvitationEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -896,7 +896,7 @@ class _$InvitationEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -1200,7 +1200,7 @@ class _$InvoiceEntity extends InvoiceEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1746,9 +1746,9 @@ class InvoiceEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
@ -2297,7 +2297,7 @@ class _$InvitationEntity extends InvitationEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -2471,9 +2471,9 @@ class InvitationEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class EntityAction extends EnumClass {
|
|||
static const EntityAction newClient = _$newClient;
|
||||
static const EntityAction newInvoice = _$newInvoice;
|
||||
static const EntityAction newQuote = _$newQuote;
|
||||
static const EntityAction newCredit = _$newCredit;
|
||||
static const EntityAction newExpense = _$newExpense;
|
||||
static const EntityAction newProject = _$newProject;
|
||||
static const EntityAction newTask = _$newTask;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const EntityAction _$markPaid = const EntityAction._('markPaid');
|
|||
const EntityAction _$newClient = const EntityAction._('newClient');
|
||||
const EntityAction _$newInvoice = const EntityAction._('newInvoice');
|
||||
const EntityAction _$newQuote = const EntityAction._('newQuote');
|
||||
const EntityAction _$newCredit = const EntityAction._('newCredit');
|
||||
const EntityAction _$newExpense = const EntityAction._('newExpense');
|
||||
const EntityAction _$newProject = const EntityAction._('newProject');
|
||||
const EntityAction _$newTask = const EntityAction._('newTask');
|
||||
|
|
@ -76,6 +77,8 @@ EntityAction _$valueOf(String name) {
|
|||
return _$newInvoice;
|
||||
case 'newQuote':
|
||||
return _$newQuote;
|
||||
case 'newCredit':
|
||||
return _$newCredit;
|
||||
case 'newExpense':
|
||||
return _$newExpense;
|
||||
case 'newProject':
|
||||
|
|
@ -130,6 +133,7 @@ final BuiltSet<EntityAction> _$values =
|
|||
_$newClient,
|
||||
_$newInvoice,
|
||||
_$newQuote,
|
||||
_$newCredit,
|
||||
_$newExpense,
|
||||
_$newProject,
|
||||
_$newTask,
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class _$PaymentEntitySerializer implements StructuredSerializer<PaymentEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -418,7 +418,7 @@ class _$PaymentEntitySerializer implements StructuredSerializer<PaymentEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -771,7 +771,7 @@ class _$PaymentEntity extends PaymentEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1098,9 +1098,9 @@ class PaymentEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ class _$ProductEntitySerializer implements StructuredSerializer<ProductEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -348,7 +348,7 @@ class _$ProductEntitySerializer implements StructuredSerializer<ProductEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -600,7 +600,7 @@ class _$ProductEntity extends ProductEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -892,9 +892,9 @@ class ProductEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class _$ProjectEntitySerializer implements StructuredSerializer<ProjectEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -287,7 +287,7 @@ class _$ProjectEntitySerializer implements StructuredSerializer<ProjectEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -525,7 +525,7 @@ class _$ProjectEntity extends ProjectEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -767,9 +767,9 @@ class ProjectEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ class _$QuoteEntitySerializer implements StructuredSerializer<QuoteEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -536,7 +536,7 @@ class _$QuoteEntitySerializer implements StructuredSerializer<QuoteEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -620,7 +620,7 @@ class _$InvitationEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -693,7 +693,7 @@ class _$InvitationEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -995,7 +995,7 @@ class _$QuoteEntity extends QuoteEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1568,9 +1568,9 @@ class QuoteEntityBuilder implements Builder<QuoteEntity, QuoteEntityBuilder> {
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
@ -1755,7 +1755,7 @@ class _$InvitationEntity extends InvitationEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1929,9 +1929,9 @@ class InvitationEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ class _$TaskEntitySerializer implements StructuredSerializer<TaskEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -382,7 +382,7 @@ class _$TaskEntitySerializer implements StructuredSerializer<TaskEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -766,7 +766,7 @@ class _$TaskEntity extends TaskEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1016,9 +1016,9 @@ class TaskEntityBuilder implements Builder<TaskEntity, TaskEntityBuilder> {
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class _$TaxRateEntitySerializer implements StructuredSerializer<TaxRateEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -230,7 +230,7 @@ class _$TaxRateEntitySerializer implements StructuredSerializer<TaxRateEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -452,7 +452,7 @@ class _$TaxRateEntity extends TaxRateEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -588,9 +588,9 @@ class TaxRateEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ class _$UserEntitySerializer implements StructuredSerializer<UserEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -336,7 +336,7 @@ class _$UserEntitySerializer implements StructuredSerializer<UserEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -664,7 +664,7 @@ class _$UserEntity extends UserEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -877,9 +877,9 @@ class UserEntityBuilder implements Builder<UserEntity, UserEntityBuilder> {
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class _$VendorEntitySerializer implements StructuredSerializer<VendorEntity> {
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -341,7 +341,7 @@ class _$VendorEntitySerializer implements StructuredSerializer<VendorEntity> {
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -431,7 +431,7 @@ class _$VendorContactEntitySerializer
|
|||
result
|
||||
..add('entity_type')
|
||||
..add(serializers.serialize(object.subEntityType,
|
||||
specifiedType: const FullType(String)));
|
||||
specifiedType: const FullType(EntityType)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
|
|
@ -504,7 +504,7 @@ class _$VendorContactEntitySerializer
|
|||
break;
|
||||
case 'entity_type':
|
||||
result.subEntityType = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
specifiedType: const FullType(EntityType)) as EntityType;
|
||||
break;
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
|
|
@ -758,7 +758,7 @@ class _$VendorEntity extends VendorEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1071,9 +1071,9 @@ class VendorEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
@ -1204,7 +1204,7 @@ class _$VendorContactEntity extends VendorContactEntity {
|
|||
@override
|
||||
final String assignedUserId;
|
||||
@override
|
||||
final String subEntityType;
|
||||
final EntityType subEntityType;
|
||||
@override
|
||||
final String id;
|
||||
|
||||
|
|
@ -1381,9 +1381,9 @@ class VendorContactEntityBuilder
|
|||
set assignedUserId(String assignedUserId) =>
|
||||
_$this._assignedUserId = assignedUserId;
|
||||
|
||||
String _subEntityType;
|
||||
String get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(String subEntityType) =>
|
||||
EntityType _subEntityType;
|
||||
EntityType get subEntityType => _$this._subEntityType;
|
||||
set subEntityType(EntityType subEntityType) =>
|
||||
_$this._subEntityType = subEntityType;
|
||||
|
||||
String _id;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import 'package:invoiceninja_flutter/redux/vendor/vendor_actions.dart';
|
|||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/dialogs.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
||||
// STARTER: import - do not remove comment
|
||||
import 'package:invoiceninja_flutter/redux/credit/credit_actions.dart';
|
||||
|
||||
|
|
@ -506,7 +507,7 @@ void createEntityByType(
|
|||
force: force,
|
||||
quote: InvoiceEntity(
|
||||
state: state,
|
||||
isQuote: true,
|
||||
entityType: EntityType.quote,
|
||||
)));
|
||||
break;
|
||||
case EntityType.vendor:
|
||||
|
|
@ -558,7 +559,10 @@ void createEntityByType(
|
|||
store.dispatch(EditCredit(
|
||||
navigator: navigator,
|
||||
force: force,
|
||||
credit: InvoiceEntity(state: state),
|
||||
credit: InvoiceEntity(
|
||||
state: state,
|
||||
entityType: EntityType.credit,
|
||||
),
|
||||
));
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,7 +324,26 @@ void handleClientAction(
|
|||
}
|
||||
createEntity(
|
||||
context: context,
|
||||
entity: InvoiceEntity(state: state, client: client, isQuote: true));
|
||||
entity: InvoiceEntity(
|
||||
state: state,
|
||||
client: client,
|
||||
entityType: EntityType.quote,
|
||||
));
|
||||
break;
|
||||
case EntityAction.newCredit:
|
||||
if (isNotMobile(context)) {
|
||||
filterEntitiesByType(
|
||||
context: context,
|
||||
entityType: EntityType.credit,
|
||||
filterEntity: client);
|
||||
}
|
||||
createEntity(
|
||||
context: context,
|
||||
entity: InvoiceEntity(
|
||||
state: state,
|
||||
client: client,
|
||||
entityType: EntityType.credit,
|
||||
));
|
||||
break;
|
||||
case EntityAction.newExpense:
|
||||
if (isNotMobile(context)) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ class UserViewVM {
|
|||
if (longPress && user.isActive) {
|
||||
createEntity(
|
||||
context: context,
|
||||
entity: InvoiceEntity(state: state, isQuote: true));
|
||||
entity: InvoiceEntity(
|
||||
state: state, entityType: EntityType.quote));
|
||||
} else {
|
||||
viewEntitiesByType(
|
||||
context: context,
|
||||
|
|
@ -99,6 +100,19 @@ class UserViewVM {
|
|||
filterEntity: user);
|
||||
}
|
||||
break;
|
||||
case EntityType.credit:
|
||||
if (longPress && user.isActive) {
|
||||
createEntity(
|
||||
context: context,
|
||||
entity: InvoiceEntity(
|
||||
state: state, entityType: EntityType.credit));
|
||||
} else {
|
||||
viewEntitiesByType(
|
||||
context: context,
|
||||
entityType: EntityType.credit,
|
||||
filterEntity: user);
|
||||
}
|
||||
break;
|
||||
case EntityType.payment:
|
||||
if (longPress && user.isActive) {
|
||||
createEntity(
|
||||
|
|
|
|||
Loading…
Reference in New Issue