Fix models for all entities

This commit is contained in:
Anmol Gupta 2018-06-22 13:04:47 +05:30
parent 846b912e5f
commit 0c7af878d6
16 changed files with 1132 additions and 1235 deletions

View File

@ -43,145 +43,148 @@ abstract class ClientEntity extends Object with BaseEntity implements Built<Clie
factory ClientEntity() {
return _$ClientEntity._(
id: --ClientEntity.counter,
name: '',
displayName: '',
balance: 0.0,
paidToDate: 0.0,
address1: '',
address2: '',
city: '',
state: '',
postalCode: '',
countryId: 0,
workPhone: '',
privateNotes: '',
publicNotes: '',
website: '',
industryId: 0,
sizeId: 0,
paymentTerms: 0,
vatNumber: '',
idNumber: '',
languageId: 0,
currencyId: 0,
invoiceNumberCounter: 0,
quoteNumberCounter: 0,
taskRate: 0.0,
shippingAddress1: '',
shippingAddress2: '',
shippingCity: '',
shippingState: '',
shippingPostalCode: '',
shippingCountryId: 0,
showTasksInPortal: false,
sendReminders: false,
creditNumberCounter: 0,
customValue1: '',
customValue2: '',
contacts: BuiltList<ContactEntity>(),
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
@BuiltValueField(wireName: 'name')
String get name;
@nullable
@BuiltValueField(wireName: 'display_name')
String get displayName;
@nullable
double get balance;
@nullable
@BuiltValueField(wireName: 'paid_to_date')
double get paidToDate;
@nullable
String get address1;
@nullable
String get address2;
@nullable
String get city;
@nullable
String get state;
@nullable
@BuiltValueField(wireName: 'postal_code')
String get postalCode;
@nullable
@BuiltValueField(wireName: 'country_id')
int get countryId;
@nullable
@BuiltValueField(wireName: 'work_phone')
String get workPhone;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'public_notes')
String get publicNotes;
@nullable
String get website;
@nullable
@BuiltValueField(wireName: 'industry_id')
int get industryId;
@nullable
@BuiltValueField(wireName: 'size_id')
int get sizeId;
@nullable
@BuiltValueField(wireName: 'payment_terms')
int get paymentTerms;
@nullable
@BuiltValueField(wireName: 'vat_number')
String get vatNumber;
@nullable
@BuiltValueField(wireName: 'id_number')
String get idNumber;
@nullable
@BuiltValueField(wireName: 'language_id')
int get languageId;
@nullable
@BuiltValueField(wireName: 'currency_id')
int get currencyId;
@nullable
@BuiltValueField(wireName: 'invoice_number_counter')
int get invoiceNumberCounter;
@nullable
@BuiltValueField(wireName: 'quote_number_counter')
int get quoteNumberCounter;
@nullable
@BuiltValueField(wireName: 'task_rate')
double get taskRate;
@nullable
@BuiltValueField(wireName: 'shipping_address1')
String get shippingAddress1;
@nullable
@BuiltValueField(wireName: 'shipping_address2')
String get shippingAddress2;
@nullable
@BuiltValueField(wireName: 'shipping_city')
String get shippingCity;
@nullable
@BuiltValueField(wireName: 'shipping_state')
String get shippingState;
@nullable
@BuiltValueField(wireName: 'shipping_postal_code')
String get shippingPostalCode;
@nullable
@BuiltValueField(wireName: 'shipping_country_id')
int get shippingCountryId;
@nullable
@BuiltValueField(wireName: 'show_tasks_in_portal')
bool get showTasksInPortal;
@nullable
@BuiltValueField(wireName: 'send_reminders')
bool get sendReminders;
@nullable
@BuiltValueField(wireName: 'credit_number_counter')
int get creditNumberCounter;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;
@nullable
BuiltList<ContactEntity> get contacts;
//String get last_login;
@ -298,37 +301,41 @@ abstract class ContactEntity extends Object with BaseEntity implements Built<Con
static int counter = 0;
factory ContactEntity() {
return _$ContactEntity._(
id: --ContactEntity.counter
id: --ContactEntity.counter,
firstName: '',
lastName: '',
email: '',
phone: '',
contactKey: '',
isPrimary: false,
customValue1: '',
customValue2: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
@BuiltValueField(wireName: 'first_name')
String get firstName;
@nullable
@BuiltValueField(wireName: 'last_name')
String get lastName;
@nullable
String get email;
@nullable
String get phone;
@nullable
@BuiltValueField(wireName: 'contact_key')
String get contactKey;
@nullable
@BuiltValueField(wireName: 'is_primary')
bool get isPrimary;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;

View File

@ -117,224 +117,114 @@ class _$ClientEntitySerializer implements StructuredSerializer<ClientEntity> {
@override
Iterable serialize(Serializers serializers, ClientEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.name != null) {
result
..add('name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
}
if (object.displayName != null) {
result
..add('display_name')
..add(serializers.serialize(object.displayName,
specifiedType: const FullType(String)));
}
if (object.balance != null) {
result
..add('balance')
..add(serializers.serialize(object.balance,
specifiedType: const FullType(double)));
}
if (object.paidToDate != null) {
result
..add('paid_to_date')
..add(serializers.serialize(object.paidToDate,
specifiedType: const FullType(double)));
}
if (object.address1 != null) {
result
..add('address1')
..add(serializers.serialize(object.address1,
specifiedType: const FullType(String)));
}
if (object.address2 != null) {
result
..add('address2')
..add(serializers.serialize(object.address2,
specifiedType: const FullType(String)));
}
if (object.city != null) {
result
..add('city')
..add(serializers.serialize(object.city,
specifiedType: const FullType(String)));
}
if (object.state != null) {
result
..add('state')
..add(serializers.serialize(object.state,
specifiedType: const FullType(String)));
}
if (object.postalCode != null) {
result
..add('postal_code')
..add(serializers.serialize(object.postalCode,
specifiedType: const FullType(String)));
}
if (object.countryId != null) {
result
..add('country_id')
..add(serializers.serialize(object.countryId,
specifiedType: const FullType(int)));
}
if (object.workPhone != null) {
result
..add('work_phone')
..add(serializers.serialize(object.workPhone,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.publicNotes != null) {
result
..add('public_notes')
..add(serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)));
}
if (object.website != null) {
result
..add('website')
..add(serializers.serialize(object.website,
specifiedType: const FullType(String)));
}
if (object.industryId != null) {
result
..add('industry_id')
..add(serializers.serialize(object.industryId,
specifiedType: const FullType(int)));
}
if (object.sizeId != null) {
result
..add('size_id')
..add(serializers.serialize(object.sizeId,
specifiedType: const FullType(int)));
}
if (object.paymentTerms != null) {
result
..add('payment_terms')
..add(serializers.serialize(object.paymentTerms,
specifiedType: const FullType(int)));
}
if (object.vatNumber != null) {
result
..add('vat_number')
..add(serializers.serialize(object.vatNumber,
specifiedType: const FullType(String)));
}
if (object.idNumber != null) {
result
..add('id_number')
..add(serializers.serialize(object.idNumber,
specifiedType: const FullType(String)));
}
if (object.languageId != null) {
result
..add('language_id')
..add(serializers.serialize(object.languageId,
specifiedType: const FullType(int)));
}
if (object.currencyId != null) {
result
..add('currency_id')
..add(serializers.serialize(object.currencyId,
specifiedType: const FullType(int)));
}
if (object.invoiceNumberCounter != null) {
result
..add('invoice_number_counter')
..add(serializers.serialize(object.invoiceNumberCounter,
specifiedType: const FullType(int)));
}
if (object.quoteNumberCounter != null) {
result
..add('quote_number_counter')
..add(serializers.serialize(object.quoteNumberCounter,
specifiedType: const FullType(int)));
}
if (object.taskRate != null) {
result
..add('task_rate')
..add(serializers.serialize(object.taskRate,
specifiedType: const FullType(double)));
}
if (object.shippingAddress1 != null) {
result
..add('shipping_address1')
..add(serializers.serialize(object.shippingAddress1,
specifiedType: const FullType(String)));
}
if (object.shippingAddress2 != null) {
result
..add('shipping_address2')
..add(serializers.serialize(object.shippingAddress2,
specifiedType: const FullType(String)));
}
if (object.shippingCity != null) {
result
..add('shipping_city')
..add(serializers.serialize(object.shippingCity,
specifiedType: const FullType(String)));
}
if (object.shippingState != null) {
result
..add('shipping_state')
..add(serializers.serialize(object.shippingState,
specifiedType: const FullType(String)));
}
if (object.shippingPostalCode != null) {
result
..add('shipping_postal_code')
..add(serializers.serialize(object.shippingPostalCode,
specifiedType: const FullType(String)));
}
if (object.shippingCountryId != null) {
result
..add('shipping_country_id')
..add(serializers.serialize(object.shippingCountryId,
specifiedType: const FullType(int)));
}
if (object.showTasksInPortal != null) {
result
..add('show_tasks_in_portal')
..add(serializers.serialize(object.showTasksInPortal,
specifiedType: const FullType(bool)));
}
if (object.sendReminders != null) {
result
..add('send_reminders')
..add(serializers.serialize(object.sendReminders,
specifiedType: const FullType(bool)));
}
if (object.creditNumberCounter != null) {
result
..add('credit_number_counter')
..add(serializers.serialize(object.creditNumberCounter,
specifiedType: const FullType(int)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
if (object.contacts != null) {
result
..add('contacts')
..add(serializers.serialize(object.contacts,
specifiedType: const FullType(
BuiltList, const [const FullType(ContactEntity)])));
}
final result = <Object>[
'name',
serializers.serialize(object.name, specifiedType: const FullType(String)),
'display_name',
serializers.serialize(object.displayName,
specifiedType: const FullType(String)),
'balance',
serializers.serialize(object.balance,
specifiedType: const FullType(double)),
'paid_to_date',
serializers.serialize(object.paidToDate,
specifiedType: const FullType(double)),
'address1',
serializers.serialize(object.address1,
specifiedType: const FullType(String)),
'address2',
serializers.serialize(object.address2,
specifiedType: const FullType(String)),
'city',
serializers.serialize(object.city, specifiedType: const FullType(String)),
'state',
serializers.serialize(object.state,
specifiedType: const FullType(String)),
'postal_code',
serializers.serialize(object.postalCode,
specifiedType: const FullType(String)),
'country_id',
serializers.serialize(object.countryId,
specifiedType: const FullType(int)),
'work_phone',
serializers.serialize(object.workPhone,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'public_notes',
serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)),
'website',
serializers.serialize(object.website,
specifiedType: const FullType(String)),
'industry_id',
serializers.serialize(object.industryId,
specifiedType: const FullType(int)),
'size_id',
serializers.serialize(object.sizeId, specifiedType: const FullType(int)),
'payment_terms',
serializers.serialize(object.paymentTerms,
specifiedType: const FullType(int)),
'vat_number',
serializers.serialize(object.vatNumber,
specifiedType: const FullType(String)),
'id_number',
serializers.serialize(object.idNumber,
specifiedType: const FullType(String)),
'language_id',
serializers.serialize(object.languageId,
specifiedType: const FullType(int)),
'currency_id',
serializers.serialize(object.currencyId,
specifiedType: const FullType(int)),
'invoice_number_counter',
serializers.serialize(object.invoiceNumberCounter,
specifiedType: const FullType(int)),
'quote_number_counter',
serializers.serialize(object.quoteNumberCounter,
specifiedType: const FullType(int)),
'task_rate',
serializers.serialize(object.taskRate,
specifiedType: const FullType(double)),
'shipping_address1',
serializers.serialize(object.shippingAddress1,
specifiedType: const FullType(String)),
'shipping_address2',
serializers.serialize(object.shippingAddress2,
specifiedType: const FullType(String)),
'shipping_city',
serializers.serialize(object.shippingCity,
specifiedType: const FullType(String)),
'shipping_state',
serializers.serialize(object.shippingState,
specifiedType: const FullType(String)),
'shipping_postal_code',
serializers.serialize(object.shippingPostalCode,
specifiedType: const FullType(String)),
'shipping_country_id',
serializers.serialize(object.shippingCountryId,
specifiedType: const FullType(int)),
'show_tasks_in_portal',
serializers.serialize(object.showTasksInPortal,
specifiedType: const FullType(bool)),
'send_reminders',
serializers.serialize(object.sendReminders,
specifiedType: const FullType(bool)),
'credit_number_counter',
serializers.serialize(object.creditNumberCounter,
specifiedType: const FullType(int)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
'contacts',
serializers.serialize(object.contacts,
specifiedType:
const FullType(BuiltList, const [const FullType(ContactEntity)])),
];
if (object.id != null) {
result
..add('id')
@ -552,55 +442,32 @@ class _$ContactEntitySerializer implements StructuredSerializer<ContactEntity> {
@override
Iterable serialize(Serializers serializers, ContactEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.firstName != null) {
result
..add('first_name')
..add(serializers.serialize(object.firstName,
specifiedType: const FullType(String)));
}
if (object.lastName != null) {
result
..add('last_name')
..add(serializers.serialize(object.lastName,
specifiedType: const FullType(String)));
}
if (object.email != null) {
result
..add('email')
..add(serializers.serialize(object.email,
specifiedType: const FullType(String)));
}
if (object.phone != null) {
result
..add('phone')
..add(serializers.serialize(object.phone,
specifiedType: const FullType(String)));
}
if (object.contactKey != null) {
result
..add('contact_key')
..add(serializers.serialize(object.contactKey,
specifiedType: const FullType(String)));
}
if (object.isPrimary != null) {
result
..add('is_primary')
..add(serializers.serialize(object.isPrimary,
specifiedType: const FullType(bool)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
final result = <Object>[
'first_name',
serializers.serialize(object.firstName,
specifiedType: const FullType(String)),
'last_name',
serializers.serialize(object.lastName,
specifiedType: const FullType(String)),
'email',
serializers.serialize(object.email,
specifiedType: const FullType(String)),
'phone',
serializers.serialize(object.phone,
specifiedType: const FullType(String)),
'contact_key',
serializers.serialize(object.contactKey,
specifiedType: const FullType(String)),
'is_primary',
serializers.serialize(object.isPrimary,
specifiedType: const FullType(bool)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -1002,7 +869,81 @@ class _$ClientEntity extends ClientEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (name == null)
throw new BuiltValueNullFieldError('ClientEntity', 'name');
if (displayName == null)
throw new BuiltValueNullFieldError('ClientEntity', 'displayName');
if (balance == null)
throw new BuiltValueNullFieldError('ClientEntity', 'balance');
if (paidToDate == null)
throw new BuiltValueNullFieldError('ClientEntity', 'paidToDate');
if (address1 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'address1');
if (address2 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'address2');
if (city == null)
throw new BuiltValueNullFieldError('ClientEntity', 'city');
if (state == null)
throw new BuiltValueNullFieldError('ClientEntity', 'state');
if (postalCode == null)
throw new BuiltValueNullFieldError('ClientEntity', 'postalCode');
if (countryId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'countryId');
if (workPhone == null)
throw new BuiltValueNullFieldError('ClientEntity', 'workPhone');
if (privateNotes == null)
throw new BuiltValueNullFieldError('ClientEntity', 'privateNotes');
if (publicNotes == null)
throw new BuiltValueNullFieldError('ClientEntity', 'publicNotes');
if (website == null)
throw new BuiltValueNullFieldError('ClientEntity', 'website');
if (industryId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'industryId');
if (sizeId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'sizeId');
if (paymentTerms == null)
throw new BuiltValueNullFieldError('ClientEntity', 'paymentTerms');
if (vatNumber == null)
throw new BuiltValueNullFieldError('ClientEntity', 'vatNumber');
if (idNumber == null)
throw new BuiltValueNullFieldError('ClientEntity', 'idNumber');
if (languageId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'languageId');
if (currencyId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'currencyId');
if (invoiceNumberCounter == null)
throw new BuiltValueNullFieldError(
'ClientEntity', 'invoiceNumberCounter');
if (quoteNumberCounter == null)
throw new BuiltValueNullFieldError('ClientEntity', 'quoteNumberCounter');
if (taskRate == null)
throw new BuiltValueNullFieldError('ClientEntity', 'taskRate');
if (shippingAddress1 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingAddress1');
if (shippingAddress2 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingAddress2');
if (shippingCity == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingCity');
if (shippingState == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingState');
if (shippingPostalCode == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingPostalCode');
if (shippingCountryId == null)
throw new BuiltValueNullFieldError('ClientEntity', 'shippingCountryId');
if (showTasksInPortal == null)
throw new BuiltValueNullFieldError('ClientEntity', 'showTasksInPortal');
if (sendReminders == null)
throw new BuiltValueNullFieldError('ClientEntity', 'sendReminders');
if (creditNumberCounter == null)
throw new BuiltValueNullFieldError('ClientEntity', 'creditNumberCounter');
if (customValue1 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('ClientEntity', 'customValue2');
if (contacts == null)
throw new BuiltValueNullFieldError('ClientEntity', 'contacts');
}
@override
ClientEntity rebuild(void updates(ClientEntityBuilder b)) =>
@ -1423,7 +1364,7 @@ class ClientEntityBuilder
creditNumberCounter: creditNumberCounter,
customValue1: customValue1,
customValue2: customValue2,
contacts: _contacts?.build(),
contacts: contacts.build(),
id: id,
updatedAt: updatedAt,
archivedAt: archivedAt,
@ -1432,7 +1373,7 @@ class ClientEntityBuilder
String _$failedField;
try {
_$failedField = 'contacts';
_contacts?.build();
contacts.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
'ClientEntity', _$failedField, e.toString());
@ -1486,7 +1427,24 @@ class _$ContactEntity extends ContactEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (firstName == null)
throw new BuiltValueNullFieldError('ContactEntity', 'firstName');
if (lastName == null)
throw new BuiltValueNullFieldError('ContactEntity', 'lastName');
if (email == null)
throw new BuiltValueNullFieldError('ContactEntity', 'email');
if (phone == null)
throw new BuiltValueNullFieldError('ContactEntity', 'phone');
if (contactKey == null)
throw new BuiltValueNullFieldError('ContactEntity', 'contactKey');
if (isPrimary == null)
throw new BuiltValueNullFieldError('ContactEntity', 'isPrimary');
if (customValue1 == null)
throw new BuiltValueNullFieldError('ContactEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('ContactEntity', 'customValue2');
}
@override
ContactEntity rebuild(void updates(ContactEntityBuilder b)) =>

View File

@ -44,32 +44,35 @@ abstract class CreditEntity extends Object with BaseEntity implements Built<Cred
factory CreditEntity() {
return _$CreditEntity._(
id: --CreditEntity.counter,
amount: 0.0,
balance: 0.0,
creditDate: '',
creditNumber: '',
privateNotes: '',
publicNotes: '',
clientId: 0,
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
double get amount;
@nullable
double get balance;
@nullable
@BuiltValueField(wireName: 'credit_date')
String get creditDate;
@nullable
@BuiltValueField(wireName: 'credit_number')
String get creditNumber;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'public_notes')
String get publicNotes;
@nullable
@BuiltValueField(wireName: 'client_id')
int get clientId;

View File

@ -115,49 +115,29 @@ class _$CreditEntitySerializer implements StructuredSerializer<CreditEntity> {
@override
Iterable serialize(Serializers serializers, CreditEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.amount != null) {
result
..add('amount')
..add(serializers.serialize(object.amount,
specifiedType: const FullType(double)));
}
if (object.balance != null) {
result
..add('balance')
..add(serializers.serialize(object.balance,
specifiedType: const FullType(double)));
}
if (object.creditDate != null) {
result
..add('credit_date')
..add(serializers.serialize(object.creditDate,
specifiedType: const FullType(String)));
}
if (object.creditNumber != null) {
result
..add('credit_number')
..add(serializers.serialize(object.creditNumber,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.publicNotes != null) {
result
..add('public_notes')
..add(serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)));
}
if (object.clientId != null) {
result
..add('client_id')
..add(serializers.serialize(object.clientId,
specifiedType: const FullType(int)));
}
final result = <Object>[
'amount',
serializers.serialize(object.amount,
specifiedType: const FullType(double)),
'balance',
serializers.serialize(object.balance,
specifiedType: const FullType(double)),
'credit_date',
serializers.serialize(object.creditDate,
specifiedType: const FullType(String)),
'credit_number',
serializers.serialize(object.creditNumber,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'public_notes',
serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)),
'client_id',
serializers.serialize(object.clientId,
specifiedType: const FullType(int)),
];
if (object.id != null) {
result
..add('id')
@ -468,7 +448,22 @@ class _$CreditEntity extends CreditEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (amount == null)
throw new BuiltValueNullFieldError('CreditEntity', 'amount');
if (balance == null)
throw new BuiltValueNullFieldError('CreditEntity', 'balance');
if (creditDate == null)
throw new BuiltValueNullFieldError('CreditEntity', 'creditDate');
if (creditNumber == null)
throw new BuiltValueNullFieldError('CreditEntity', 'creditNumber');
if (privateNotes == null)
throw new BuiltValueNullFieldError('CreditEntity', 'privateNotes');
if (publicNotes == null)
throw new BuiltValueNullFieldError('CreditEntity', 'publicNotes');
if (clientId == null)
throw new BuiltValueNullFieldError('CreditEntity', 'clientId');
}
@override
CreditEntity rebuild(void updates(CreditEntityBuilder b)) =>

View File

@ -58,169 +58,172 @@ abstract class InvoiceEntity extends Object with BaseEntity
factory InvoiceEntity() {
return _$InvoiceEntity._(
id: --InvoiceEntity.counter,
amount: 0.0,
balance: 0.0,
clientId: 0,
invoiceStatusId: 0,
invoiceNumber: '',
discount: 0.0,
poNumber: '',
invoiceDate: '',
dueDate: '',
terms: '',
publicNotes: '',
privateNotes: '',
invoiceTypeId: 0,
isRecurring: false,
frequencyId: 0,
startDate: '',
endDate: '',
lastSentDate: '',
recurringInvoiceId: 0,
taxName1: '',
taxRate1: 0.0,
taxName2: '',
taxRate2: 0.0,
isAmountDiscount: false,
invoiceFooter: '',
partial: 0.0,
partialDueDate: '',
hasTasks: false,
autoBill: false,
customValue1: 0.0,
customValue2: 0.0,
customTaxes1: false,
customTaxes2: false,
hasExpenses: false,
quoteInvoiceId: 0,
customTextValue1: '',
customTextValue2: '',
isQuote: false,
isPublic: false,
filename: '',
invoiceItems: BuiltList<InvoiceItemEntity>(),
invitations: BuiltList<InvitationEntity>(),
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
double get amount;
@nullable
double get balance;
@nullable
@BuiltValueField(wireName: 'client_id')
int get clientId;
@nullable
@BuiltValueField(wireName: 'invoice_status_id')
int get invoiceStatusId;
@nullable
@BuiltValueField(wireName: 'invoice_number')
String get invoiceNumber;
@nullable
double get discount;
@nullable
@BuiltValueField(wireName: 'po_number')
String get poNumber;
@nullable
@BuiltValueField(wireName: 'invoice_date')
String get invoiceDate;
@nullable
@BuiltValueField(wireName: 'due_date')
String get dueDate;
@nullable
String get terms;
@nullable
@BuiltValueField(wireName: 'public_notes')
String get publicNotes;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'invoice_type_id')
int get invoiceTypeId;
@nullable
@BuiltValueField(wireName: 'is_recurring')
bool get isRecurring;
@nullable
@BuiltValueField(wireName: 'frequency_id')
int get frequencyId;
@nullable
@BuiltValueField(wireName: 'start_date')
String get startDate;
@nullable
@BuiltValueField(wireName: 'end_date')
String get endDate;
@nullable
@BuiltValueField(wireName: 'last_sent_date')
String get lastSentDate;
@nullable
@BuiltValueField(wireName: 'recurring_invoice_id')
int get recurringInvoiceId;
@nullable
@BuiltValueField(wireName: 'tax_name1')
String get taxName1;
@nullable
@BuiltValueField(wireName: 'tax_rate1')
double get taxRate1;
@nullable
@BuiltValueField(wireName: 'tax_name2')
String get taxName2;
@nullable
@BuiltValueField(wireName: 'tax_rate2')
double get taxRate2;
@nullable
@BuiltValueField(wireName: 'is_amount_discount')
bool get isAmountDiscount;
@nullable
@BuiltValueField(wireName: 'invoice_footer')
String get invoiceFooter;
@nullable
double get partial;
@nullable
@BuiltValueField(wireName: 'partial_due_date')
String get partialDueDate;
@nullable
@BuiltValueField(wireName: 'has_tasks')
bool get hasTasks;
@nullable
@BuiltValueField(wireName: 'auto_bill')
bool get autoBill;
@nullable
@BuiltValueField(wireName: 'custom_value1')
double get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
double get customValue2;
@nullable
@BuiltValueField(wireName: 'custom_taxes1')
bool get customTaxes1;
@nullable
@BuiltValueField(wireName: 'custom_taxes2')
bool get customTaxes2;
@nullable
@BuiltValueField(wireName: 'has_expenses')
bool get hasExpenses;
@nullable
@BuiltValueField(wireName: 'quote_invoice_id')
int get quoteInvoiceId;
@nullable
@BuiltValueField(wireName: 'custom_text_value1')
String get customTextValue1;
@nullable
@BuiltValueField(wireName: 'custom_text_value2')
String get customTextValue2;
@nullable
@BuiltValueField(wireName: 'is_quote')
bool get isQuote;
@nullable
@BuiltValueField(wireName: 'is_public')
bool get isPublic;
@nullable
String get filename;
@nullable
@BuiltValueField(wireName: 'invoice_items')
BuiltList<InvoiceItemEntity> get invoiceItems;
@nullable
BuiltList<InvitationEntity> get invitations;
//String get last_login;
@ -267,52 +270,55 @@ abstract class InvoiceItemEntity extends Object with BaseEntity implements Built
factory InvoiceItemEntity() {
return _$InvoiceItemEntity._(
id: --InvoiceItemEntity.counter,
qty: 1.0,
productKey: '',
notes: '',
cost: 0.0,
qty: 0.0,
taxName1: '',
taxRate1: 0.0,
taxName2: '',
taxRate2: 0.0,
invoiceItemTypeId: 0,
customValue1: '',
customValue2: '',
discount: 0.0,
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
@BuiltValueField(wireName: 'product_key')
String get productKey;
@nullable
String get notes;
@nullable
double get cost;
@nullable
double get qty;
@nullable
@BuiltValueField(wireName: 'tax_name1')
String get taxName1;
@nullable
@BuiltValueField(wireName: 'tax_rate1')
double get taxRate1;
@nullable
@BuiltValueField(wireName: 'tax_name2')
String get taxName2;
@nullable
@BuiltValueField(wireName: 'tax_rate2')
double get taxRate2;
@nullable
@BuiltValueField(wireName: 'invoice_item_type_id')
int get invoiceItemTypeId;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;
@nullable
double get discount;
double get total => qty * cost;
@ -323,17 +329,28 @@ abstract class InvoiceItemEntity extends Object with BaseEntity implements Built
abstract class InvitationEntity extends Object with BaseEntity implements Built<InvitationEntity, InvitationEntityBuilder> {
@nullable
static int counter = 0;
factory InvitationEntity() {
return _$InvitationEntity._(
id: --InvitationEntity.counter,
key: '',
link: '',
sentDate: '',
viewedDate: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
String get key;
@nullable
String get link;
@nullable
@BuiltValueField(wireName: 'sent_date')
String get sentDate;
@nullable
@BuiltValueField(wireName: 'viewed_date')
String get viewedDate;
@ -341,6 +358,5 @@ abstract class InvitationEntity extends Object with BaseEntity implements Built<
String get downloadLink => link.replaceFirst('/view/', '/download/');
InvitationEntity._();
factory InvitationEntity([updates(InvitationEntityBuilder b)]) = _$InvitationEntity;
static Serializer<InvitationEntity> get serializer => _$invitationEntitySerializer;
}

View File

@ -125,261 +125,136 @@ class _$InvoiceEntitySerializer implements StructuredSerializer<InvoiceEntity> {
@override
Iterable serialize(Serializers serializers, InvoiceEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.amount != null) {
result
..add('amount')
..add(serializers.serialize(object.amount,
specifiedType: const FullType(double)));
}
if (object.balance != null) {
result
..add('balance')
..add(serializers.serialize(object.balance,
specifiedType: const FullType(double)));
}
if (object.clientId != null) {
result
..add('client_id')
..add(serializers.serialize(object.clientId,
specifiedType: const FullType(int)));
}
if (object.invoiceStatusId != null) {
result
..add('invoice_status_id')
..add(serializers.serialize(object.invoiceStatusId,
specifiedType: const FullType(int)));
}
if (object.invoiceNumber != null) {
result
..add('invoice_number')
..add(serializers.serialize(object.invoiceNumber,
specifiedType: const FullType(String)));
}
if (object.discount != null) {
result
..add('discount')
..add(serializers.serialize(object.discount,
specifiedType: const FullType(double)));
}
if (object.poNumber != null) {
result
..add('po_number')
..add(serializers.serialize(object.poNumber,
specifiedType: const FullType(String)));
}
if (object.invoiceDate != null) {
result
..add('invoice_date')
..add(serializers.serialize(object.invoiceDate,
specifiedType: const FullType(String)));
}
if (object.dueDate != null) {
result
..add('due_date')
..add(serializers.serialize(object.dueDate,
specifiedType: const FullType(String)));
}
if (object.terms != null) {
result
..add('terms')
..add(serializers.serialize(object.terms,
specifiedType: const FullType(String)));
}
if (object.publicNotes != null) {
result
..add('public_notes')
..add(serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.invoiceTypeId != null) {
result
..add('invoice_type_id')
..add(serializers.serialize(object.invoiceTypeId,
specifiedType: const FullType(int)));
}
if (object.isRecurring != null) {
result
..add('is_recurring')
..add(serializers.serialize(object.isRecurring,
specifiedType: const FullType(bool)));
}
if (object.frequencyId != null) {
result
..add('frequency_id')
..add(serializers.serialize(object.frequencyId,
specifiedType: const FullType(int)));
}
if (object.startDate != null) {
result
..add('start_date')
..add(serializers.serialize(object.startDate,
specifiedType: const FullType(String)));
}
if (object.endDate != null) {
result
..add('end_date')
..add(serializers.serialize(object.endDate,
specifiedType: const FullType(String)));
}
if (object.lastSentDate != null) {
result
..add('last_sent_date')
..add(serializers.serialize(object.lastSentDate,
specifiedType: const FullType(String)));
}
if (object.recurringInvoiceId != null) {
result
..add('recurring_invoice_id')
..add(serializers.serialize(object.recurringInvoiceId,
specifiedType: const FullType(int)));
}
if (object.taxName1 != null) {
result
..add('tax_name1')
..add(serializers.serialize(object.taxName1,
specifiedType: const FullType(String)));
}
if (object.taxRate1 != null) {
result
..add('tax_rate1')
..add(serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)));
}
if (object.taxName2 != null) {
result
..add('tax_name2')
..add(serializers.serialize(object.taxName2,
specifiedType: const FullType(String)));
}
if (object.taxRate2 != null) {
result
..add('tax_rate2')
..add(serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)));
}
if (object.isAmountDiscount != null) {
result
..add('is_amount_discount')
..add(serializers.serialize(object.isAmountDiscount,
specifiedType: const FullType(bool)));
}
if (object.invoiceFooter != null) {
result
..add('invoice_footer')
..add(serializers.serialize(object.invoiceFooter,
specifiedType: const FullType(String)));
}
if (object.partial != null) {
result
..add('partial')
..add(serializers.serialize(object.partial,
specifiedType: const FullType(double)));
}
if (object.partialDueDate != null) {
result
..add('partial_due_date')
..add(serializers.serialize(object.partialDueDate,
specifiedType: const FullType(String)));
}
if (object.hasTasks != null) {
result
..add('has_tasks')
..add(serializers.serialize(object.hasTasks,
specifiedType: const FullType(bool)));
}
if (object.autoBill != null) {
result
..add('auto_bill')
..add(serializers.serialize(object.autoBill,
specifiedType: const FullType(bool)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(double)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(double)));
}
if (object.customTaxes1 != null) {
result
..add('custom_taxes1')
..add(serializers.serialize(object.customTaxes1,
specifiedType: const FullType(bool)));
}
if (object.customTaxes2 != null) {
result
..add('custom_taxes2')
..add(serializers.serialize(object.customTaxes2,
specifiedType: const FullType(bool)));
}
if (object.hasExpenses != null) {
result
..add('has_expenses')
..add(serializers.serialize(object.hasExpenses,
specifiedType: const FullType(bool)));
}
if (object.quoteInvoiceId != null) {
result
..add('quote_invoice_id')
..add(serializers.serialize(object.quoteInvoiceId,
specifiedType: const FullType(int)));
}
if (object.customTextValue1 != null) {
result
..add('custom_text_value1')
..add(serializers.serialize(object.customTextValue1,
specifiedType: const FullType(String)));
}
if (object.customTextValue2 != null) {
result
..add('custom_text_value2')
..add(serializers.serialize(object.customTextValue2,
specifiedType: const FullType(String)));
}
if (object.isQuote != null) {
result
..add('is_quote')
..add(serializers.serialize(object.isQuote,
specifiedType: const FullType(bool)));
}
if (object.isPublic != null) {
result
..add('is_public')
..add(serializers.serialize(object.isPublic,
specifiedType: const FullType(bool)));
}
if (object.filename != null) {
result
..add('filename')
..add(serializers.serialize(object.filename,
specifiedType: const FullType(String)));
}
if (object.invoiceItems != null) {
result
..add('invoice_items')
..add(serializers.serialize(object.invoiceItems,
specifiedType: const FullType(
BuiltList, const [const FullType(InvoiceItemEntity)])));
}
if (object.invitations != null) {
result
..add('invitations')
..add(serializers.serialize(object.invitations,
specifiedType: const FullType(
BuiltList, const [const FullType(InvitationEntity)])));
}
final result = <Object>[
'amount',
serializers.serialize(object.amount,
specifiedType: const FullType(double)),
'balance',
serializers.serialize(object.balance,
specifiedType: const FullType(double)),
'client_id',
serializers.serialize(object.clientId,
specifiedType: const FullType(int)),
'invoice_status_id',
serializers.serialize(object.invoiceStatusId,
specifiedType: const FullType(int)),
'invoice_number',
serializers.serialize(object.invoiceNumber,
specifiedType: const FullType(String)),
'discount',
serializers.serialize(object.discount,
specifiedType: const FullType(double)),
'po_number',
serializers.serialize(object.poNumber,
specifiedType: const FullType(String)),
'invoice_date',
serializers.serialize(object.invoiceDate,
specifiedType: const FullType(String)),
'due_date',
serializers.serialize(object.dueDate,
specifiedType: const FullType(String)),
'terms',
serializers.serialize(object.terms,
specifiedType: const FullType(String)),
'public_notes',
serializers.serialize(object.publicNotes,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'invoice_type_id',
serializers.serialize(object.invoiceTypeId,
specifiedType: const FullType(int)),
'is_recurring',
serializers.serialize(object.isRecurring,
specifiedType: const FullType(bool)),
'frequency_id',
serializers.serialize(object.frequencyId,
specifiedType: const FullType(int)),
'start_date',
serializers.serialize(object.startDate,
specifiedType: const FullType(String)),
'end_date',
serializers.serialize(object.endDate,
specifiedType: const FullType(String)),
'last_sent_date',
serializers.serialize(object.lastSentDate,
specifiedType: const FullType(String)),
'recurring_invoice_id',
serializers.serialize(object.recurringInvoiceId,
specifiedType: const FullType(int)),
'tax_name1',
serializers.serialize(object.taxName1,
specifiedType: const FullType(String)),
'tax_rate1',
serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)),
'tax_name2',
serializers.serialize(object.taxName2,
specifiedType: const FullType(String)),
'tax_rate2',
serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)),
'is_amount_discount',
serializers.serialize(object.isAmountDiscount,
specifiedType: const FullType(bool)),
'invoice_footer',
serializers.serialize(object.invoiceFooter,
specifiedType: const FullType(String)),
'partial',
serializers.serialize(object.partial,
specifiedType: const FullType(double)),
'partial_due_date',
serializers.serialize(object.partialDueDate,
specifiedType: const FullType(String)),
'has_tasks',
serializers.serialize(object.hasTasks,
specifiedType: const FullType(bool)),
'auto_bill',
serializers.serialize(object.autoBill,
specifiedType: const FullType(bool)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(double)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(double)),
'custom_taxes1',
serializers.serialize(object.customTaxes1,
specifiedType: const FullType(bool)),
'custom_taxes2',
serializers.serialize(object.customTaxes2,
specifiedType: const FullType(bool)),
'has_expenses',
serializers.serialize(object.hasExpenses,
specifiedType: const FullType(bool)),
'quote_invoice_id',
serializers.serialize(object.quoteInvoiceId,
specifiedType: const FullType(int)),
'custom_text_value1',
serializers.serialize(object.customTextValue1,
specifiedType: const FullType(String)),
'custom_text_value2',
serializers.serialize(object.customTextValue2,
specifiedType: const FullType(String)),
'is_quote',
serializers.serialize(object.isQuote,
specifiedType: const FullType(bool)),
'is_public',
serializers.serialize(object.isPublic,
specifiedType: const FullType(bool)),
'filename',
serializers.serialize(object.filename,
specifiedType: const FullType(String)),
'invoice_items',
serializers.serialize(object.invoiceItems,
specifiedType: const FullType(
BuiltList, const [const FullType(InvoiceItemEntity)])),
'invitations',
serializers.serialize(object.invitations,
specifiedType: const FullType(
BuiltList, const [const FullType(InvitationEntity)])),
];
if (object.id != null) {
result
..add('id')
@ -624,79 +499,42 @@ class _$InvoiceItemEntitySerializer
@override
Iterable serialize(Serializers serializers, InvoiceItemEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.productKey != null) {
result
..add('product_key')
..add(serializers.serialize(object.productKey,
specifiedType: const FullType(String)));
}
if (object.notes != null) {
result
..add('notes')
..add(serializers.serialize(object.notes,
specifiedType: const FullType(String)));
}
if (object.cost != null) {
result
..add('cost')
..add(serializers.serialize(object.cost,
specifiedType: const FullType(double)));
}
if (object.qty != null) {
result
..add('qty')
..add(serializers.serialize(object.qty,
specifiedType: const FullType(double)));
}
if (object.taxName1 != null) {
result
..add('tax_name1')
..add(serializers.serialize(object.taxName1,
specifiedType: const FullType(String)));
}
if (object.taxRate1 != null) {
result
..add('tax_rate1')
..add(serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)));
}
if (object.taxName2 != null) {
result
..add('tax_name2')
..add(serializers.serialize(object.taxName2,
specifiedType: const FullType(String)));
}
if (object.taxRate2 != null) {
result
..add('tax_rate2')
..add(serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)));
}
if (object.invoiceItemTypeId != null) {
result
..add('invoice_item_type_id')
..add(serializers.serialize(object.invoiceItemTypeId,
specifiedType: const FullType(int)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
if (object.discount != null) {
result
..add('discount')
..add(serializers.serialize(object.discount,
specifiedType: const FullType(double)));
}
final result = <Object>[
'product_key',
serializers.serialize(object.productKey,
specifiedType: const FullType(String)),
'notes',
serializers.serialize(object.notes,
specifiedType: const FullType(String)),
'cost',
serializers.serialize(object.cost, specifiedType: const FullType(double)),
'qty',
serializers.serialize(object.qty, specifiedType: const FullType(double)),
'tax_name1',
serializers.serialize(object.taxName1,
specifiedType: const FullType(String)),
'tax_rate1',
serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)),
'tax_name2',
serializers.serialize(object.taxName2,
specifiedType: const FullType(String)),
'tax_rate2',
serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)),
'invoice_item_type_id',
serializers.serialize(object.invoiceItemTypeId,
specifiedType: const FullType(int)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
'discount',
serializers.serialize(object.discount,
specifiedType: const FullType(double)),
];
if (object.id != null) {
result
..add('id')
@ -817,31 +655,18 @@ class _$InvitationEntitySerializer
@override
Iterable serialize(Serializers serializers, InvitationEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.key != null) {
result
..add('key')
..add(serializers.serialize(object.key,
specifiedType: const FullType(String)));
}
if (object.link != null) {
result
..add('link')
..add(serializers.serialize(object.link,
specifiedType: const FullType(String)));
}
if (object.sentDate != null) {
result
..add('sent_date')
..add(serializers.serialize(object.sentDate,
specifiedType: const FullType(String)));
}
if (object.viewedDate != null) {
result
..add('viewed_date')
..add(serializers.serialize(object.viewedDate,
specifiedType: const FullType(String)));
}
final result = <Object>[
'key',
serializers.serialize(object.key, specifiedType: const FullType(String)),
'link',
serializers.serialize(object.link, specifiedType: const FullType(String)),
'sent_date',
serializers.serialize(object.sentDate,
specifiedType: const FullType(String)),
'viewed_date',
serializers.serialize(object.viewedDate,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -1245,7 +1070,92 @@ class _$InvoiceEntity extends InvoiceEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (amount == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'amount');
if (balance == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'balance');
if (clientId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'clientId');
if (invoiceStatusId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceStatusId');
if (invoiceNumber == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceNumber');
if (discount == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'discount');
if (poNumber == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'poNumber');
if (invoiceDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceDate');
if (dueDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'dueDate');
if (terms == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'terms');
if (publicNotes == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'publicNotes');
if (privateNotes == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'privateNotes');
if (invoiceTypeId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceTypeId');
if (isRecurring == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'isRecurring');
if (frequencyId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'frequencyId');
if (startDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'startDate');
if (endDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'endDate');
if (lastSentDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'lastSentDate');
if (recurringInvoiceId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'recurringInvoiceId');
if (taxName1 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'taxName1');
if (taxRate1 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'taxRate1');
if (taxName2 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'taxName2');
if (taxRate2 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'taxRate2');
if (isAmountDiscount == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'isAmountDiscount');
if (invoiceFooter == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceFooter');
if (partial == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'partial');
if (partialDueDate == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'partialDueDate');
if (hasTasks == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'hasTasks');
if (autoBill == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'autoBill');
if (customValue1 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customValue2');
if (customTaxes1 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customTaxes1');
if (customTaxes2 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customTaxes2');
if (hasExpenses == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'hasExpenses');
if (quoteInvoiceId == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'quoteInvoiceId');
if (customTextValue1 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customTextValue1');
if (customTextValue2 == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'customTextValue2');
if (isQuote == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'isQuote');
if (isPublic == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'isPublic');
if (filename == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'filename');
if (invoiceItems == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invoiceItems');
if (invitations == null)
throw new BuiltValueNullFieldError('InvoiceEntity', 'invitations');
}
@override
InvoiceEntity rebuild(void updates(InvoiceEntityBuilder b)) =>
@ -1714,8 +1624,8 @@ class InvoiceEntityBuilder
isQuote: isQuote,
isPublic: isPublic,
filename: filename,
invoiceItems: _invoiceItems?.build(),
invitations: _invitations?.build(),
invoiceItems: invoiceItems.build(),
invitations: invitations.build(),
id: id,
updatedAt: updatedAt,
archivedAt: archivedAt,
@ -1724,9 +1634,9 @@ class InvoiceEntityBuilder
String _$failedField;
try {
_$failedField = 'invoiceItems';
_invoiceItems?.build();
invoiceItems.build();
_$failedField = 'invitations';
_invitations?.build();
invitations.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
'InvoiceEntity', _$failedField, e.toString());
@ -1792,7 +1702,33 @@ class _$InvoiceItemEntity extends InvoiceItemEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (productKey == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'productKey');
if (notes == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'notes');
if (cost == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'cost');
if (qty == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'qty');
if (taxName1 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'taxName1');
if (taxRate1 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'taxRate1');
if (taxName2 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'taxName2');
if (taxRate2 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'taxRate2');
if (invoiceItemTypeId == null)
throw new BuiltValueNullFieldError(
'InvoiceItemEntity', 'invoiceItemTypeId');
if (customValue1 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'customValue2');
if (discount == null)
throw new BuiltValueNullFieldError('InvoiceItemEntity', 'discount');
}
@override
InvoiceItemEntity rebuild(void updates(InvoiceItemEntityBuilder b)) =>
@ -2045,7 +1981,16 @@ class _$InvitationEntity extends InvitationEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (key == null)
throw new BuiltValueNullFieldError('InvitationEntity', 'key');
if (link == null)
throw new BuiltValueNullFieldError('InvitationEntity', 'link');
if (sentDate == null)
throw new BuiltValueNullFieldError('InvitationEntity', 'sentDate');
if (viewedDate == null)
throw new BuiltValueNullFieldError('InvitationEntity', 'viewedDate');
}
@override
InvitationEntity rebuild(void updates(InvitationEntityBuilder b)) =>

View File

@ -46,41 +46,45 @@ abstract class PaymentEntity extends Object with BaseEntity implements Built<Pay
factory PaymentEntity() {
return _$PaymentEntity._(
id: --PaymentEntity.counter,
amount: 0.0,
transactionReference: '',
paymentDate: '',
paymentTypeId: 0,
invoiceId: 0,
invoice_number: '',
privateNotes: '',
exchangeRate: 0.0,
exchangeCurrencyId: 0,
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
double get amount;
@nullable
@BuiltValueField(wireName: 'transaction_reference')
String get transactionReference;
@nullable
@BuiltValueField(wireName: 'payment_date')
String get paymentDate;
@nullable
@BuiltValueField(wireName: 'payment_type_id')
int get paymentTypeId;
@nullable
@BuiltValueField(wireName: 'invoice_id')
int get invoiceId;
@nullable
@BuiltValueField(wireName: 'invoice_number')
String get invoice_number;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'exchange_rate')
double get exchangeRate;
@nullable
@BuiltValueField(wireName: 'exchange_currency_id')
int get exchangeCurrencyId;

View File

@ -121,61 +121,35 @@ class _$PaymentEntitySerializer implements StructuredSerializer<PaymentEntity> {
@override
Iterable serialize(Serializers serializers, PaymentEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.amount != null) {
result
..add('amount')
..add(serializers.serialize(object.amount,
specifiedType: const FullType(double)));
}
if (object.transactionReference != null) {
result
..add('transaction_reference')
..add(serializers.serialize(object.transactionReference,
specifiedType: const FullType(String)));
}
if (object.paymentDate != null) {
result
..add('payment_date')
..add(serializers.serialize(object.paymentDate,
specifiedType: const FullType(String)));
}
if (object.paymentTypeId != null) {
result
..add('payment_type_id')
..add(serializers.serialize(object.paymentTypeId,
specifiedType: const FullType(int)));
}
if (object.invoiceId != null) {
result
..add('invoice_id')
..add(serializers.serialize(object.invoiceId,
specifiedType: const FullType(int)));
}
if (object.invoice_number != null) {
result
..add('invoice_number')
..add(serializers.serialize(object.invoice_number,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.exchangeRate != null) {
result
..add('exchange_rate')
..add(serializers.serialize(object.exchangeRate,
specifiedType: const FullType(double)));
}
if (object.exchangeCurrencyId != null) {
result
..add('exchange_currency_id')
..add(serializers.serialize(object.exchangeCurrencyId,
specifiedType: const FullType(int)));
}
final result = <Object>[
'amount',
serializers.serialize(object.amount,
specifiedType: const FullType(double)),
'transaction_reference',
serializers.serialize(object.transactionReference,
specifiedType: const FullType(String)),
'payment_date',
serializers.serialize(object.paymentDate,
specifiedType: const FullType(String)),
'payment_type_id',
serializers.serialize(object.paymentTypeId,
specifiedType: const FullType(int)),
'invoice_id',
serializers.serialize(object.invoiceId,
specifiedType: const FullType(int)),
'invoice_number',
serializers.serialize(object.invoice_number,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'exchange_rate',
serializers.serialize(object.exchangeRate,
specifiedType: const FullType(double)),
'exchange_currency_id',
serializers.serialize(object.exchangeCurrencyId,
specifiedType: const FullType(int)),
];
if (object.id != null) {
result
..add('id')
@ -500,7 +474,27 @@ class _$PaymentEntity extends PaymentEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (amount == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'amount');
if (transactionReference == null)
throw new BuiltValueNullFieldError(
'PaymentEntity', 'transactionReference');
if (paymentDate == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'paymentDate');
if (paymentTypeId == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'paymentTypeId');
if (invoiceId == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'invoiceId');
if (invoice_number == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'invoice_number');
if (privateNotes == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'privateNotes');
if (exchangeRate == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'exchangeRate');
if (exchangeCurrencyId == null)
throw new BuiltValueNullFieldError('PaymentEntity', 'exchangeCurrencyId');
}
@override
PaymentEntity rebuild(void updates(PaymentEntityBuilder b)) =>

View File

@ -37,41 +37,44 @@ abstract class ProductEntity extends Object with BaseEntity implements Built<Pro
static int counter = 0;
factory ProductEntity() {
return _$ProductEntity._(
id: --ProductEntity.counter
id: --ProductEntity.counter,
productKey: '',
notes: '',
cost: 0.0,
taxName1: '',
taxRate1: 0.0,
taxName2: '',
taxRate2: 0.0,
customValue1: '',
customValue2: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
@BuiltValueField(wireName: 'product_key')
String get productKey;
@nullable
String get notes;
@nullable
double get cost;
@nullable
@BuiltValueField(wireName: 'tax_name1')
String get taxName1;
@nullable
@BuiltValueField(wireName: 'tax_rate1')
double get taxRate1;
@nullable
@BuiltValueField(wireName: 'tax_name2')
String get taxName2;
@nullable
@BuiltValueField(wireName: 'tax_rate2')
double get taxRate2;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;

View File

@ -121,61 +121,34 @@ class _$ProductEntitySerializer implements StructuredSerializer<ProductEntity> {
@override
Iterable serialize(Serializers serializers, ProductEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.productKey != null) {
result
..add('product_key')
..add(serializers.serialize(object.productKey,
specifiedType: const FullType(String)));
}
if (object.notes != null) {
result
..add('notes')
..add(serializers.serialize(object.notes,
specifiedType: const FullType(String)));
}
if (object.cost != null) {
result
..add('cost')
..add(serializers.serialize(object.cost,
specifiedType: const FullType(double)));
}
if (object.taxName1 != null) {
result
..add('tax_name1')
..add(serializers.serialize(object.taxName1,
specifiedType: const FullType(String)));
}
if (object.taxRate1 != null) {
result
..add('tax_rate1')
..add(serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)));
}
if (object.taxName2 != null) {
result
..add('tax_name2')
..add(serializers.serialize(object.taxName2,
specifiedType: const FullType(String)));
}
if (object.taxRate2 != null) {
result
..add('tax_rate2')
..add(serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
final result = <Object>[
'product_key',
serializers.serialize(object.productKey,
specifiedType: const FullType(String)),
'notes',
serializers.serialize(object.notes,
specifiedType: const FullType(String)),
'cost',
serializers.serialize(object.cost, specifiedType: const FullType(double)),
'tax_name1',
serializers.serialize(object.taxName1,
specifiedType: const FullType(String)),
'tax_rate1',
serializers.serialize(object.taxRate1,
specifiedType: const FullType(double)),
'tax_name2',
serializers.serialize(object.taxName2,
specifiedType: const FullType(String)),
'tax_rate2',
serializers.serialize(object.taxRate2,
specifiedType: const FullType(double)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -500,7 +473,26 @@ class _$ProductEntity extends ProductEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (productKey == null)
throw new BuiltValueNullFieldError('ProductEntity', 'productKey');
if (notes == null)
throw new BuiltValueNullFieldError('ProductEntity', 'notes');
if (cost == null)
throw new BuiltValueNullFieldError('ProductEntity', 'cost');
if (taxName1 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'taxName1');
if (taxRate1 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'taxRate1');
if (taxName2 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'taxName2');
if (taxRate2 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'taxRate2');
if (customValue1 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('ProductEntity', 'customValue2');
}
@override
ProductEntity rebuild(void updates(ProductEntityBuilder b)) =>

View File

@ -43,45 +43,49 @@ abstract class ProjectEntity extends Object with BaseEntity implements Built<Pro
static int counter = 0;
factory ProjectEntity() {
return _$ProjectEntity._(
id: --ProjectEntity.counter
id: --ProjectEntity.counter,
name: '',
clientId: 0,
taskRate: 0.0,
dueDate: '',
privateNotes: '',
budgetedHours: 0.0,
customValue1: '',
customValue2: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
String get name;
@nullable
@BuiltValueField(wireName: 'client_id')
int get clientId;
@nullable
@BuiltValueField(wireName: 'task_rate')
double get taskRate;
@nullable
@BuiltValueField(wireName: 'due_date')
String get dueDate;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'budgeted_hours')
double get budgetedHours;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;
int compareTo(ProjectEntity project, String sortField, bool sortAscending) {
int response = 0;
ProjectEntity projectA = sortAscending ? this : project;
ProjectEntity projectB = sortAscending ? project: this;
ProjectEntity projectB = sortAscending ? project: this;
switch (sortField) {
case ProjectFields.taskRate:

View File

@ -121,55 +121,31 @@ class _$ProjectEntitySerializer implements StructuredSerializer<ProjectEntity> {
@override
Iterable serialize(Serializers serializers, ProjectEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.name != null) {
result
..add('name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
}
if (object.clientId != null) {
result
..add('client_id')
..add(serializers.serialize(object.clientId,
specifiedType: const FullType(int)));
}
if (object.taskRate != null) {
result
..add('task_rate')
..add(serializers.serialize(object.taskRate,
specifiedType: const FullType(double)));
}
if (object.dueDate != null) {
result
..add('due_date')
..add(serializers.serialize(object.dueDate,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.budgetedHours != null) {
result
..add('budgeted_hours')
..add(serializers.serialize(object.budgetedHours,
specifiedType: const FullType(double)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
final result = <Object>[
'name',
serializers.serialize(object.name, specifiedType: const FullType(String)),
'client_id',
serializers.serialize(object.clientId,
specifiedType: const FullType(int)),
'task_rate',
serializers.serialize(object.taskRate,
specifiedType: const FullType(double)),
'due_date',
serializers.serialize(object.dueDate,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'budgeted_hours',
serializers.serialize(object.budgetedHours,
specifiedType: const FullType(double)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -487,7 +463,24 @@ class _$ProjectEntity extends ProjectEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (name == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'name');
if (clientId == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'clientId');
if (taskRate == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'taskRate');
if (dueDate == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'dueDate');
if (privateNotes == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'privateNotes');
if (budgetedHours == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'budgetedHours');
if (customValue1 == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('ProjectEntity', 'customValue2');
}
@override
ProjectEntity rebuild(void updates(ProjectEntityBuilder b)) =>

View File

@ -44,41 +44,45 @@ abstract class TaskEntity extends Object with BaseEntity implements Built<TaskEn
static int counter = 0;
factory TaskEntity() {
return _$TaskEntity._(
id: --TaskEntity.counter
id: --TaskEntity.counter,
description: '',
duration: 0,
invoiceId: 0,
clientId: 0,
projectId: 0,
timeLog: '',
isRunning: false,
customValue1: '',
customValue2: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
String get description;
@nullable
int get duration;
@nullable
@BuiltValueField(wireName: 'invoice_id')
int get invoiceId;
@nullable
@BuiltValueField(wireName: 'client_id')
int get clientId;
@nullable
@BuiltValueField(wireName: 'project_id')
int get projectId;
@nullable
@BuiltValueField(wireName: 'time_log')
String get timeLog;
@nullable
@BuiltValueField(wireName: 'is_running')
bool get isRunning;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;

View File

@ -113,61 +113,35 @@ class _$TaskEntitySerializer implements StructuredSerializer<TaskEntity> {
@override
Iterable serialize(Serializers serializers, TaskEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.description != null) {
result
..add('description')
..add(serializers.serialize(object.description,
specifiedType: const FullType(String)));
}
if (object.duration != null) {
result
..add('duration')
..add(serializers.serialize(object.duration,
specifiedType: const FullType(int)));
}
if (object.invoiceId != null) {
result
..add('invoice_id')
..add(serializers.serialize(object.invoiceId,
specifiedType: const FullType(int)));
}
if (object.clientId != null) {
result
..add('client_id')
..add(serializers.serialize(object.clientId,
specifiedType: const FullType(int)));
}
if (object.projectId != null) {
result
..add('project_id')
..add(serializers.serialize(object.projectId,
specifiedType: const FullType(int)));
}
if (object.timeLog != null) {
result
..add('time_log')
..add(serializers.serialize(object.timeLog,
specifiedType: const FullType(String)));
}
if (object.isRunning != null) {
result
..add('is_running')
..add(serializers.serialize(object.isRunning,
specifiedType: const FullType(bool)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
final result = <Object>[
'description',
serializers.serialize(object.description,
specifiedType: const FullType(String)),
'duration',
serializers.serialize(object.duration,
specifiedType: const FullType(int)),
'invoice_id',
serializers.serialize(object.invoiceId,
specifiedType: const FullType(int)),
'client_id',
serializers.serialize(object.clientId,
specifiedType: const FullType(int)),
'project_id',
serializers.serialize(object.projectId,
specifiedType: const FullType(int)),
'time_log',
serializers.serialize(object.timeLog,
specifiedType: const FullType(String)),
'is_running',
serializers.serialize(object.isRunning,
specifiedType: const FullType(bool)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -490,7 +464,26 @@ class _$TaskEntity extends TaskEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (description == null)
throw new BuiltValueNullFieldError('TaskEntity', 'description');
if (duration == null)
throw new BuiltValueNullFieldError('TaskEntity', 'duration');
if (invoiceId == null)
throw new BuiltValueNullFieldError('TaskEntity', 'invoiceId');
if (clientId == null)
throw new BuiltValueNullFieldError('TaskEntity', 'clientId');
if (projectId == null)
throw new BuiltValueNullFieldError('TaskEntity', 'projectId');
if (timeLog == null)
throw new BuiltValueNullFieldError('TaskEntity', 'timeLog');
if (isRunning == null)
throw new BuiltValueNullFieldError('TaskEntity', 'isRunning');
if (customValue1 == null)
throw new BuiltValueNullFieldError('TaskEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('TaskEntity', 'customValue2');
}
@override
TaskEntity rebuild(void updates(TaskEntityBuilder b)) =>

View File

@ -54,76 +54,80 @@ abstract class VendorEntity extends Object with BaseEntity implements Built<Vend
static int counter = 0;
factory VendorEntity() {
return _$VendorEntity._(
id: --VendorEntity.counter
id: --VendorEntity.counter,
name: '',
balance: 0.0,
paidToDate: 0.0,
address1: '',
address2: '',
city: '',
state: '',
postalCode: '',
countryId: 0,
workPhone: '',
privateNotes: '',
lastLogin: '',
website: '',
vatNumber: '',
idNumber: '',
currencyId: 0,
customValue1: '',
customValue2: '',
vendorContacts: BuiltList<VendorContactEntity>(),
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
String get name;
@nullable
double get balance;
@nullable
@BuiltValueField(wireName: 'paid_to_date')
double get paidToDate;
@nullable
String get address1;
@nullable
String get address2;
@nullable
String get city;
@nullable
String get state;
@nullable
@BuiltValueField(wireName: 'postal_code')
String get postalCode;
@nullable
@BuiltValueField(wireName: 'country_id')
int get countryId;
@nullable
@BuiltValueField(wireName: 'work_phone')
String get workPhone;
@nullable
@BuiltValueField(wireName: 'private_notes')
String get privateNotes;
@nullable
@BuiltValueField(wireName: 'last_login')
String get lastLogin;
@nullable
String get website;
@nullable
@BuiltValueField(wireName: 'vat_number')
String get vatNumber;
@nullable
@BuiltValueField(wireName: 'id_number')
String get idNumber;
@nullable
@BuiltValueField(wireName: 'currency_id')
int get currencyId;
@nullable
@BuiltValueField(wireName: 'custom_value1')
String get customValue1;
@nullable
@BuiltValueField(wireName: 'custom_value2')
String get customValue2;
@nullable
@BuiltValueField(wireName: 'vendor_contacts')
BuiltList<VendorContactEntity> get vendorContacts;
@ -158,26 +162,30 @@ abstract class VendorContactEntity extends Object with BaseEntity implements Bui
static int counter = 0;
factory VendorContactEntity() {
return _$VendorContactEntity._(
id: --VendorContactEntity.counter
id: --VendorContactEntity.counter,
firstName: '',
lastName: '',
email: '',
isPrimary: false,
phone: '',
updatedAt: 0,
archivedAt: 0,
isDeleted: false,
);
}
@nullable
@BuiltValueField(wireName: 'first_name')
String get firstName;
@nullable
@BuiltValueField(wireName: 'last_name')
String get lastName;
@nullable
String get email;
@nullable
@BuiltValueField(wireName: 'is_primary')
bool get isPrimary;
@nullable
String get phone;
VendorContactEntity._();

View File

@ -117,122 +117,64 @@ class _$VendorEntitySerializer implements StructuredSerializer<VendorEntity> {
@override
Iterable serialize(Serializers serializers, VendorEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.name != null) {
result
..add('name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
}
if (object.balance != null) {
result
..add('balance')
..add(serializers.serialize(object.balance,
specifiedType: const FullType(double)));
}
if (object.paidToDate != null) {
result
..add('paid_to_date')
..add(serializers.serialize(object.paidToDate,
specifiedType: const FullType(double)));
}
if (object.address1 != null) {
result
..add('address1')
..add(serializers.serialize(object.address1,
specifiedType: const FullType(String)));
}
if (object.address2 != null) {
result
..add('address2')
..add(serializers.serialize(object.address2,
specifiedType: const FullType(String)));
}
if (object.city != null) {
result
..add('city')
..add(serializers.serialize(object.city,
specifiedType: const FullType(String)));
}
if (object.state != null) {
result
..add('state')
..add(serializers.serialize(object.state,
specifiedType: const FullType(String)));
}
if (object.postalCode != null) {
result
..add('postal_code')
..add(serializers.serialize(object.postalCode,
specifiedType: const FullType(String)));
}
if (object.countryId != null) {
result
..add('country_id')
..add(serializers.serialize(object.countryId,
specifiedType: const FullType(int)));
}
if (object.workPhone != null) {
result
..add('work_phone')
..add(serializers.serialize(object.workPhone,
specifiedType: const FullType(String)));
}
if (object.privateNotes != null) {
result
..add('private_notes')
..add(serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)));
}
if (object.lastLogin != null) {
result
..add('last_login')
..add(serializers.serialize(object.lastLogin,
specifiedType: const FullType(String)));
}
if (object.website != null) {
result
..add('website')
..add(serializers.serialize(object.website,
specifiedType: const FullType(String)));
}
if (object.vatNumber != null) {
result
..add('vat_number')
..add(serializers.serialize(object.vatNumber,
specifiedType: const FullType(String)));
}
if (object.idNumber != null) {
result
..add('id_number')
..add(serializers.serialize(object.idNumber,
specifiedType: const FullType(String)));
}
if (object.currencyId != null) {
result
..add('currency_id')
..add(serializers.serialize(object.currencyId,
specifiedType: const FullType(int)));
}
if (object.customValue1 != null) {
result
..add('custom_value1')
..add(serializers.serialize(object.customValue1,
specifiedType: const FullType(String)));
}
if (object.customValue2 != null) {
result
..add('custom_value2')
..add(serializers.serialize(object.customValue2,
specifiedType: const FullType(String)));
}
if (object.vendorContacts != null) {
result
..add('vendor_contacts')
..add(serializers.serialize(object.vendorContacts,
specifiedType: const FullType(
BuiltList, const [const FullType(VendorContactEntity)])));
}
final result = <Object>[
'name',
serializers.serialize(object.name, specifiedType: const FullType(String)),
'balance',
serializers.serialize(object.balance,
specifiedType: const FullType(double)),
'paid_to_date',
serializers.serialize(object.paidToDate,
specifiedType: const FullType(double)),
'address1',
serializers.serialize(object.address1,
specifiedType: const FullType(String)),
'address2',
serializers.serialize(object.address2,
specifiedType: const FullType(String)),
'city',
serializers.serialize(object.city, specifiedType: const FullType(String)),
'state',
serializers.serialize(object.state,
specifiedType: const FullType(String)),
'postal_code',
serializers.serialize(object.postalCode,
specifiedType: const FullType(String)),
'country_id',
serializers.serialize(object.countryId,
specifiedType: const FullType(int)),
'work_phone',
serializers.serialize(object.workPhone,
specifiedType: const FullType(String)),
'private_notes',
serializers.serialize(object.privateNotes,
specifiedType: const FullType(String)),
'last_login',
serializers.serialize(object.lastLogin,
specifiedType: const FullType(String)),
'website',
serializers.serialize(object.website,
specifiedType: const FullType(String)),
'vat_number',
serializers.serialize(object.vatNumber,
specifiedType: const FullType(String)),
'id_number',
serializers.serialize(object.idNumber,
specifiedType: const FullType(String)),
'currency_id',
serializers.serialize(object.currencyId,
specifiedType: const FullType(int)),
'custom_value1',
serializers.serialize(object.customValue1,
specifiedType: const FullType(String)),
'custom_value2',
serializers.serialize(object.customValue2,
specifiedType: const FullType(String)),
'vendor_contacts',
serializers.serialize(object.vendorContacts,
specifiedType: const FullType(
BuiltList, const [const FullType(VendorContactEntity)])),
];
if (object.id != null) {
result
..add('id')
@ -386,37 +328,23 @@ class _$VendorContactEntitySerializer
@override
Iterable serialize(Serializers serializers, VendorContactEntity object,
{FullType specifiedType: FullType.unspecified}) {
final result = <Object>[];
if (object.firstName != null) {
result
..add('first_name')
..add(serializers.serialize(object.firstName,
specifiedType: const FullType(String)));
}
if (object.lastName != null) {
result
..add('last_name')
..add(serializers.serialize(object.lastName,
specifiedType: const FullType(String)));
}
if (object.email != null) {
result
..add('email')
..add(serializers.serialize(object.email,
specifiedType: const FullType(String)));
}
if (object.isPrimary != null) {
result
..add('is_primary')
..add(serializers.serialize(object.isPrimary,
specifiedType: const FullType(bool)));
}
if (object.phone != null) {
result
..add('phone')
..add(serializers.serialize(object.phone,
specifiedType: const FullType(String)));
}
final result = <Object>[
'first_name',
serializers.serialize(object.firstName,
specifiedType: const FullType(String)),
'last_name',
serializers.serialize(object.lastName,
specifiedType: const FullType(String)),
'email',
serializers.serialize(object.email,
specifiedType: const FullType(String)),
'is_primary',
serializers.serialize(object.isPrimary,
specifiedType: const FullType(bool)),
'phone',
serializers.serialize(object.phone,
specifiedType: const FullType(String)),
];
if (object.id != null) {
result
..add('id')
@ -755,7 +683,46 @@ class _$VendorEntity extends VendorEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (name == null)
throw new BuiltValueNullFieldError('VendorEntity', 'name');
if (balance == null)
throw new BuiltValueNullFieldError('VendorEntity', 'balance');
if (paidToDate == null)
throw new BuiltValueNullFieldError('VendorEntity', 'paidToDate');
if (address1 == null)
throw new BuiltValueNullFieldError('VendorEntity', 'address1');
if (address2 == null)
throw new BuiltValueNullFieldError('VendorEntity', 'address2');
if (city == null)
throw new BuiltValueNullFieldError('VendorEntity', 'city');
if (state == null)
throw new BuiltValueNullFieldError('VendorEntity', 'state');
if (postalCode == null)
throw new BuiltValueNullFieldError('VendorEntity', 'postalCode');
if (countryId == null)
throw new BuiltValueNullFieldError('VendorEntity', 'countryId');
if (workPhone == null)
throw new BuiltValueNullFieldError('VendorEntity', 'workPhone');
if (privateNotes == null)
throw new BuiltValueNullFieldError('VendorEntity', 'privateNotes');
if (lastLogin == null)
throw new BuiltValueNullFieldError('VendorEntity', 'lastLogin');
if (website == null)
throw new BuiltValueNullFieldError('VendorEntity', 'website');
if (vatNumber == null)
throw new BuiltValueNullFieldError('VendorEntity', 'vatNumber');
if (idNumber == null)
throw new BuiltValueNullFieldError('VendorEntity', 'idNumber');
if (currencyId == null)
throw new BuiltValueNullFieldError('VendorEntity', 'currencyId');
if (customValue1 == null)
throw new BuiltValueNullFieldError('VendorEntity', 'customValue1');
if (customValue2 == null)
throw new BuiltValueNullFieldError('VendorEntity', 'customValue2');
if (vendorContacts == null)
throw new BuiltValueNullFieldError('VendorEntity', 'vendorContacts');
}
@override
VendorEntity rebuild(void updates(VendorEntityBuilder b)) =>
@ -1030,7 +997,7 @@ class VendorEntityBuilder
currencyId: currencyId,
customValue1: customValue1,
customValue2: customValue2,
vendorContacts: _vendorContacts?.build(),
vendorContacts: vendorContacts.build(),
id: id,
updatedAt: updatedAt,
archivedAt: archivedAt,
@ -1039,7 +1006,7 @@ class VendorEntityBuilder
String _$failedField;
try {
_$failedField = 'vendorContacts';
_vendorContacts?.build();
vendorContacts.build();
} catch (e) {
throw new BuiltValueNestedFieldError(
'VendorEntity', _$failedField, e.toString());
@ -1084,7 +1051,18 @@ class _$VendorContactEntity extends VendorContactEntity {
this.updatedAt,
this.archivedAt,
this.isDeleted})
: super._();
: super._() {
if (firstName == null)
throw new BuiltValueNullFieldError('VendorContactEntity', 'firstName');
if (lastName == null)
throw new BuiltValueNullFieldError('VendorContactEntity', 'lastName');
if (email == null)
throw new BuiltValueNullFieldError('VendorContactEntity', 'email');
if (isPrimary == null)
throw new BuiltValueNullFieldError('VendorContactEntity', 'isPrimary');
if (phone == null)
throw new BuiltValueNullFieldError('VendorContactEntity', 'phone');
}
@override
VendorContactEntity rebuild(void updates(VendorContactEntityBuilder b)) =>