Login
This commit is contained in:
parent
67fce0cf85
commit
31b6d137bd
|
|
@ -99,99 +99,161 @@ abstract class CompanyEntity
|
||||||
@BuiltValueField(wireName: 'default_url')
|
@BuiltValueField(wireName: 'default_url')
|
||||||
String get appUrl;
|
String get appUrl;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'currency_id')
|
@BuiltValueField(wireName: 'currency_id')
|
||||||
String get companyCurrencyId;
|
String get companyCurrencyId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'timezone_id')
|
@BuiltValueField(wireName: 'timezone_id')
|
||||||
String get timezoneId;
|
String get timezoneId;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'country_id')
|
@BuiltValueField(wireName: 'country_id')
|
||||||
String get countryId;
|
String get countryId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'date_format_id')
|
@BuiltValueField(wireName: 'date_format_id')
|
||||||
String get dateFormatId;
|
String get dateFormatId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'datetime_format_id')
|
@BuiltValueField(wireName: 'datetime_format_id')
|
||||||
String get datetimeFormatId;
|
String get datetimeFormatId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_terms')
|
@BuiltValueField(wireName: 'invoice_terms')
|
||||||
String get defaultInvoiceTerms;
|
String get defaultInvoiceTerms;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_taxes')
|
@BuiltValueField(wireName: 'invoice_taxes')
|
||||||
bool get enableInvoiceTaxes;
|
bool get enableInvoiceTaxes;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_item_taxes')
|
@BuiltValueField(wireName: 'invoice_item_taxes')
|
||||||
bool get enableInvoiceItemTaxes;
|
bool get enableInvoiceItemTaxes;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_design_id')
|
@BuiltValueField(wireName: 'invoice_design_id')
|
||||||
String get defaultInvoiceDesignId;
|
String get defaultInvoiceDesignId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'quote_design_id')
|
@BuiltValueField(wireName: 'quote_design_id')
|
||||||
String get defaultQuoteDesignId;
|
String get defaultQuoteDesignId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'language_id')
|
@BuiltValueField(wireName: 'language_id')
|
||||||
String get languageId;
|
String get languageId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_footer')
|
@BuiltValueField(wireName: 'invoice_footer')
|
||||||
String get defaultInvoiceFooter;
|
String get defaultInvoiceFooter;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'show_item_taxes')
|
@BuiltValueField(wireName: 'show_item_taxes')
|
||||||
bool get showInvoiceItemTaxes;
|
bool get showInvoiceItemTaxes;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'military_time')
|
@BuiltValueField(wireName: 'military_time')
|
||||||
bool get enableMilitaryTime;
|
bool get enableMilitaryTime;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'tax_name1')
|
@BuiltValueField(wireName: 'tax_name1')
|
||||||
String get defaultTaxName1;
|
String get defaultTaxName1;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'tax_rate1')
|
@BuiltValueField(wireName: 'tax_rate1')
|
||||||
double get defaultTaxRate1;
|
double get defaultTaxRate1;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'tax_name2')
|
@BuiltValueField(wireName: 'tax_name2')
|
||||||
String get defaultTaxName2;
|
String get defaultTaxName2;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'tax_rate2')
|
@BuiltValueField(wireName: 'tax_rate2')
|
||||||
double get defaultTaxRate2;
|
double get defaultTaxRate2;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'quote_terms')
|
@BuiltValueField(wireName: 'quote_terms')
|
||||||
String get defaultQuoteTerms;
|
String get defaultQuoteTerms;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'show_currency_code')
|
@BuiltValueField(wireName: 'show_currency_code')
|
||||||
bool get showCurrencyCode;
|
bool get showCurrencyCode;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'enable_second_tax_rate')
|
@BuiltValueField(wireName: 'enable_second_tax_rate')
|
||||||
bool get enableSecondTaxRate;
|
bool get enableSecondTaxRate;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'start_of_week')
|
@BuiltValueField(wireName: 'start_of_week')
|
||||||
int get startOfWeek;
|
int get startOfWeek;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'financial_year_start')
|
@BuiltValueField(wireName: 'financial_year_start')
|
||||||
int get financialYearStart;
|
int get financialYearStart;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'enabled_modules')
|
@BuiltValueField(wireName: 'enabled_modules')
|
||||||
int get enabledModules;
|
int get enabledModules;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'payment_terms')
|
@BuiltValueField(wireName: 'payment_terms')
|
||||||
int get defaultPaymentTerms;
|
int get defaultPaymentTerms;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'payment_type_id')
|
@BuiltValueField(wireName: 'payment_type_id')
|
||||||
String get defaultPaymentTypeId;
|
String get defaultPaymentTypeId;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'task_rate')
|
@BuiltValueField(wireName: 'task_rate')
|
||||||
double get defaultTaskRate;
|
double get defaultTaskRate;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'inclusive_taxes')
|
@BuiltValueField(wireName: 'inclusive_taxes')
|
||||||
bool get enableInclusiveTaxes;
|
bool get enableInclusiveTaxes;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'convert_products')
|
@BuiltValueField(wireName: 'convert_products')
|
||||||
bool get convertProductExchangeRate;
|
bool get convertProductExchangeRate;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'custom_invoice_taxes1')
|
@BuiltValueField(wireName: 'custom_invoice_taxes1')
|
||||||
bool get enableCustomInvoiceTaxes1;
|
bool get enableCustomInvoiceTaxes1;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'custom_invoice_taxes2')
|
@BuiltValueField(wireName: 'custom_invoice_taxes2')
|
||||||
bool get enableCustomInvoiceTaxes2;
|
bool get enableCustomInvoiceTaxes2;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'tax_rates')
|
@BuiltValueField(wireName: 'tax_rates')
|
||||||
BuiltList<TaxRateEntity> get taxRates;
|
BuiltList<TaxRateEntity> get taxRates;
|
||||||
|
|
||||||
|
|
@ -205,58 +267,96 @@ abstract class CompanyEntity
|
||||||
@BuiltValueField(wireName: 'expense_categories')
|
@BuiltValueField(wireName: 'expense_categories')
|
||||||
BuiltList<ExpenseCategoryEntity> get expenseCategories;
|
BuiltList<ExpenseCategoryEntity> get expenseCategories;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
BuiltMap<String, ExpenseCategoryEntity> get expenseCategoryMap;
|
BuiltMap<String, ExpenseCategoryEntity> get expenseCategoryMap;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'users')
|
@BuiltValueField(wireName: 'users')
|
||||||
BuiltList<UserEntity> get users;
|
BuiltList<UserEntity> get users;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
BuiltMap<String, UserEntity> get userMap;
|
BuiltMap<String, UserEntity> get userMap;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'custom_fields')
|
@BuiltValueField(wireName: 'custom_fields')
|
||||||
BuiltMap<String, String> get customFields;
|
BuiltMap<String, String> get customFields;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'custom_payment_terms')
|
@BuiltValueField(wireName: 'custom_payment_terms')
|
||||||
BuiltList<PaymentTermEntity> get customPaymentTerms;
|
BuiltList<PaymentTermEntity> get customPaymentTerms;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'invoice_fields')
|
@BuiltValueField(wireName: 'invoice_fields')
|
||||||
String get invoiceFields;
|
String get invoiceFields;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_footer')
|
@BuiltValueField(wireName: 'email_footer')
|
||||||
String get emailFooter;
|
String get emailFooter;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_invoice')
|
@BuiltValueField(wireName: 'email_subject_invoice')
|
||||||
String get emailSubjectInvoice;
|
String get emailSubjectInvoice;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_quote')
|
@BuiltValueField(wireName: 'email_subject_quote')
|
||||||
String get emailSubjectQuote;
|
String get emailSubjectQuote;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_payment')
|
@BuiltValueField(wireName: 'email_subject_payment')
|
||||||
String get emailSubjectPayment;
|
String get emailSubjectPayment;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_invoice')
|
@BuiltValueField(wireName: 'email_template_invoice')
|
||||||
String get emailBodyInvoice;
|
String get emailBodyInvoice;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_quote')
|
@BuiltValueField(wireName: 'email_template_quote')
|
||||||
String get emailBodyQuote;
|
String get emailBodyQuote;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_payment')
|
@BuiltValueField(wireName: 'email_template_payment')
|
||||||
String get emailBodyPayment;
|
String get emailBodyPayment;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_reminder1')
|
@BuiltValueField(wireName: 'email_subject_reminder1')
|
||||||
String get emailSubjectReminder1;
|
String get emailSubjectReminder1;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_reminder2')
|
@BuiltValueField(wireName: 'email_subject_reminder2')
|
||||||
String get emailSubjectReminder2;
|
String get emailSubjectReminder2;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_subject_reminder3')
|
@BuiltValueField(wireName: 'email_subject_reminder3')
|
||||||
String get emailSubjectReminder3;
|
String get emailSubjectReminder3;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_reminder1')
|
@BuiltValueField(wireName: 'email_template_reminder1')
|
||||||
String get emailBodyReminder1;
|
String get emailBodyReminder1;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_reminder2')
|
@BuiltValueField(wireName: 'email_template_reminder2')
|
||||||
String get emailBodyReminder2;
|
String get emailBodyReminder2;
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'email_template_reminder3')
|
@BuiltValueField(wireName: 'email_template_reminder3')
|
||||||
String get emailBodyReminder3;
|
String get emailBodyReminder3;
|
||||||
|
|
||||||
|
|
@ -425,7 +525,7 @@ abstract class UserEntity implements Built<UserEntity, UserEntityBuilder> {
|
||||||
firstName: '',
|
firstName: '',
|
||||||
lastName: '',
|
lastName: '',
|
||||||
email: '',
|
email: '',
|
||||||
id: 0,
|
id: '',
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
permissionsMap: BuiltMap<String, bool>(),
|
permissionsMap: BuiltMap<String, bool>(),
|
||||||
);
|
);
|
||||||
|
|
@ -433,7 +533,7 @@ abstract class UserEntity implements Built<UserEntity, UserEntityBuilder> {
|
||||||
|
|
||||||
UserEntity._();
|
UserEntity._();
|
||||||
|
|
||||||
int get id;
|
String get id;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'first_name')
|
@BuiltValueField(wireName: 'first_name')
|
||||||
String get firstName;
|
String get firstName;
|
||||||
|
|
@ -445,6 +545,8 @@ abstract class UserEntity implements Built<UserEntity, UserEntityBuilder> {
|
||||||
|
|
||||||
String get fullName => (firstName + ' ' + lastName).trim();
|
String get fullName => (firstName + ' ' + lastName).trim();
|
||||||
|
|
||||||
|
// TODO remove this
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'is_admin')
|
@BuiltValueField(wireName: 'is_admin')
|
||||||
bool get isAdmin;
|
bool get isAdmin;
|
||||||
|
|
||||||
|
|
@ -483,7 +585,6 @@ abstract class UserCompanyEntity
|
||||||
implements Built<UserCompanyEntity, UserCompanyEntityBuilder> {
|
implements Built<UserCompanyEntity, UserCompanyEntityBuilder> {
|
||||||
factory UserCompanyEntity() {
|
factory UserCompanyEntity() {
|
||||||
return _$UserCompanyEntity._(
|
return _$UserCompanyEntity._(
|
||||||
isAdmin: false,
|
|
||||||
company: CompanyEntity(),
|
company: CompanyEntity(),
|
||||||
user: UserEntity(),
|
user: UserEntity(),
|
||||||
token: TokenEntity(),
|
token: TokenEntity(),
|
||||||
|
|
@ -492,8 +593,6 @@ abstract class UserCompanyEntity
|
||||||
|
|
||||||
UserCompanyEntity._();
|
UserCompanyEntity._();
|
||||||
|
|
||||||
bool get isAdmin;
|
|
||||||
|
|
||||||
CompanyEntity get company;
|
CompanyEntity get company;
|
||||||
|
|
||||||
UserEntity get user;
|
UserEntity get user;
|
||||||
|
|
|
||||||
|
|
@ -32,158 +32,15 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
||||||
'company_key',
|
'company_key',
|
||||||
serializers.serialize(object.companyKey,
|
serializers.serialize(object.companyKey,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
'invoice_terms',
|
'country_id',
|
||||||
serializers.serialize(object.defaultInvoiceTerms,
|
serializers.serialize(object.countryId,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
'invoice_taxes',
|
|
||||||
serializers.serialize(object.enableInvoiceTaxes,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'invoice_item_taxes',
|
|
||||||
serializers.serialize(object.enableInvoiceItemTaxes,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'invoice_design_id',
|
|
||||||
serializers.serialize(object.defaultInvoiceDesignId,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'quote_design_id',
|
|
||||||
serializers.serialize(object.defaultQuoteDesignId,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'language_id',
|
|
||||||
serializers.serialize(object.languageId,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'invoice_footer',
|
|
||||||
serializers.serialize(object.defaultInvoiceFooter,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'show_item_taxes',
|
|
||||||
serializers.serialize(object.showInvoiceItemTaxes,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'military_time',
|
|
||||||
serializers.serialize(object.enableMilitaryTime,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'tax_name1',
|
|
||||||
serializers.serialize(object.defaultTaxName1,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'tax_rate1',
|
|
||||||
serializers.serialize(object.defaultTaxRate1,
|
|
||||||
specifiedType: const FullType(double)),
|
|
||||||
'tax_name2',
|
|
||||||
serializers.serialize(object.defaultTaxName2,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'tax_rate2',
|
|
||||||
serializers.serialize(object.defaultTaxRate2,
|
|
||||||
specifiedType: const FullType(double)),
|
|
||||||
'quote_terms',
|
|
||||||
serializers.serialize(object.defaultQuoteTerms,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'show_currency_code',
|
|
||||||
serializers.serialize(object.showCurrencyCode,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'enable_second_tax_rate',
|
|
||||||
serializers.serialize(object.enableSecondTaxRate,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'start_of_week',
|
|
||||||
serializers.serialize(object.startOfWeek,
|
|
||||||
specifiedType: const FullType(int)),
|
|
||||||
'financial_year_start',
|
|
||||||
serializers.serialize(object.financialYearStart,
|
|
||||||
specifiedType: const FullType(int)),
|
|
||||||
'enabled_modules',
|
|
||||||
serializers.serialize(object.enabledModules,
|
|
||||||
specifiedType: const FullType(int)),
|
|
||||||
'payment_terms',
|
|
||||||
serializers.serialize(object.defaultPaymentTerms,
|
|
||||||
specifiedType: const FullType(int)),
|
|
||||||
'payment_type_id',
|
|
||||||
serializers.serialize(object.defaultPaymentTypeId,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'task_rate',
|
|
||||||
serializers.serialize(object.defaultTaskRate,
|
|
||||||
specifiedType: const FullType(double)),
|
|
||||||
'inclusive_taxes',
|
|
||||||
serializers.serialize(object.enableInclusiveTaxes,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'convert_products',
|
|
||||||
serializers.serialize(object.convertProductExchangeRate,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'custom_invoice_taxes1',
|
|
||||||
serializers.serialize(object.enableCustomInvoiceTaxes1,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'custom_invoice_taxes2',
|
|
||||||
serializers.serialize(object.enableCustomInvoiceTaxes2,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'tax_rates',
|
|
||||||
serializers.serialize(object.taxRates,
|
|
||||||
specifiedType:
|
|
||||||
const FullType(BuiltList, const [const FullType(TaxRateEntity)])),
|
|
||||||
'taskStatusMap',
|
'taskStatusMap',
|
||||||
serializers.serialize(object.taskStatusMap,
|
serializers.serialize(object.taskStatusMap,
|
||||||
specifiedType: const FullType(BuiltMap, const [
|
specifiedType: const FullType(BuiltMap, const [
|
||||||
const FullType(String),
|
const FullType(String),
|
||||||
const FullType(TaskStatusEntity)
|
const FullType(TaskStatusEntity)
|
||||||
])),
|
])),
|
||||||
'expenseCategoryMap',
|
|
||||||
serializers.serialize(object.expenseCategoryMap,
|
|
||||||
specifiedType: const FullType(BuiltMap, const [
|
|
||||||
const FullType(String),
|
|
||||||
const FullType(ExpenseCategoryEntity)
|
|
||||||
])),
|
|
||||||
'users',
|
|
||||||
serializers.serialize(object.users,
|
|
||||||
specifiedType:
|
|
||||||
const FullType(BuiltList, const [const FullType(UserEntity)])),
|
|
||||||
'userMap',
|
|
||||||
serializers.serialize(object.userMap,
|
|
||||||
specifiedType: const FullType(BuiltMap,
|
|
||||||
const [const FullType(String), const FullType(UserEntity)])),
|
|
||||||
'custom_fields',
|
|
||||||
serializers.serialize(object.customFields,
|
|
||||||
specifiedType: const FullType(BuiltMap,
|
|
||||||
const [const FullType(String), const FullType(String)])),
|
|
||||||
'custom_payment_terms',
|
|
||||||
serializers.serialize(object.customPaymentTerms,
|
|
||||||
specifiedType: const FullType(
|
|
||||||
BuiltList, const [const FullType(PaymentTermEntity)])),
|
|
||||||
'invoice_fields',
|
|
||||||
serializers.serialize(object.invoiceFields,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_footer',
|
|
||||||
serializers.serialize(object.emailFooter,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_invoice',
|
|
||||||
serializers.serialize(object.emailSubjectInvoice,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_quote',
|
|
||||||
serializers.serialize(object.emailSubjectQuote,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_payment',
|
|
||||||
serializers.serialize(object.emailSubjectPayment,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_invoice',
|
|
||||||
serializers.serialize(object.emailBodyInvoice,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_quote',
|
|
||||||
serializers.serialize(object.emailBodyQuote,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_payment',
|
|
||||||
serializers.serialize(object.emailBodyPayment,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_reminder1',
|
|
||||||
serializers.serialize(object.emailSubjectReminder1,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_reminder2',
|
|
||||||
serializers.serialize(object.emailSubjectReminder2,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_subject_reminder3',
|
|
||||||
serializers.serialize(object.emailSubjectReminder3,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_reminder1',
|
|
||||||
serializers.serialize(object.emailBodyReminder1,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_reminder2',
|
|
||||||
serializers.serialize(object.emailBodyReminder2,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
'email_template_reminder3',
|
|
||||||
serializers.serialize(object.emailBodyReminder3,
|
|
||||||
specifiedType: const FullType(String)),
|
|
||||||
];
|
];
|
||||||
if (object.plan != null) {
|
if (object.plan != null) {
|
||||||
result
|
result
|
||||||
|
|
@ -215,12 +72,6 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
||||||
..add(serializers.serialize(object.timezoneId,
|
..add(serializers.serialize(object.timezoneId,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
if (object.countryId != null) {
|
|
||||||
result
|
|
||||||
..add('country_id')
|
|
||||||
..add(serializers.serialize(object.countryId,
|
|
||||||
specifiedType: const FullType(String)));
|
|
||||||
}
|
|
||||||
if (object.dateFormatId != null) {
|
if (object.dateFormatId != null) {
|
||||||
result
|
result
|
||||||
..add('date_format_id')
|
..add('date_format_id')
|
||||||
|
|
@ -233,6 +84,169 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
||||||
..add(serializers.serialize(object.datetimeFormatId,
|
..add(serializers.serialize(object.datetimeFormatId,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
|
if (object.defaultInvoiceTerms != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_terms')
|
||||||
|
..add(serializers.serialize(object.defaultInvoiceTerms,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.enableInvoiceTaxes != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_taxes')
|
||||||
|
..add(serializers.serialize(object.enableInvoiceTaxes,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.enableInvoiceItemTaxes != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_item_taxes')
|
||||||
|
..add(serializers.serialize(object.enableInvoiceItemTaxes,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.defaultInvoiceDesignId != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_design_id')
|
||||||
|
..add(serializers.serialize(object.defaultInvoiceDesignId,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.defaultQuoteDesignId != null) {
|
||||||
|
result
|
||||||
|
..add('quote_design_id')
|
||||||
|
..add(serializers.serialize(object.defaultQuoteDesignId,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.languageId != null) {
|
||||||
|
result
|
||||||
|
..add('language_id')
|
||||||
|
..add(serializers.serialize(object.languageId,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.defaultInvoiceFooter != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_footer')
|
||||||
|
..add(serializers.serialize(object.defaultInvoiceFooter,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.showInvoiceItemTaxes != null) {
|
||||||
|
result
|
||||||
|
..add('show_item_taxes')
|
||||||
|
..add(serializers.serialize(object.showInvoiceItemTaxes,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.enableMilitaryTime != null) {
|
||||||
|
result
|
||||||
|
..add('military_time')
|
||||||
|
..add(serializers.serialize(object.enableMilitaryTime,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.defaultTaxName1 != null) {
|
||||||
|
result
|
||||||
|
..add('tax_name1')
|
||||||
|
..add(serializers.serialize(object.defaultTaxName1,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.defaultTaxRate1 != null) {
|
||||||
|
result
|
||||||
|
..add('tax_rate1')
|
||||||
|
..add(serializers.serialize(object.defaultTaxRate1,
|
||||||
|
specifiedType: const FullType(double)));
|
||||||
|
}
|
||||||
|
if (object.defaultTaxName2 != null) {
|
||||||
|
result
|
||||||
|
..add('tax_name2')
|
||||||
|
..add(serializers.serialize(object.defaultTaxName2,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.defaultTaxRate2 != null) {
|
||||||
|
result
|
||||||
|
..add('tax_rate2')
|
||||||
|
..add(serializers.serialize(object.defaultTaxRate2,
|
||||||
|
specifiedType: const FullType(double)));
|
||||||
|
}
|
||||||
|
if (object.defaultQuoteTerms != null) {
|
||||||
|
result
|
||||||
|
..add('quote_terms')
|
||||||
|
..add(serializers.serialize(object.defaultQuoteTerms,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.showCurrencyCode != null) {
|
||||||
|
result
|
||||||
|
..add('show_currency_code')
|
||||||
|
..add(serializers.serialize(object.showCurrencyCode,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.enableSecondTaxRate != null) {
|
||||||
|
result
|
||||||
|
..add('enable_second_tax_rate')
|
||||||
|
..add(serializers.serialize(object.enableSecondTaxRate,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.startOfWeek != null) {
|
||||||
|
result
|
||||||
|
..add('start_of_week')
|
||||||
|
..add(serializers.serialize(object.startOfWeek,
|
||||||
|
specifiedType: const FullType(int)));
|
||||||
|
}
|
||||||
|
if (object.financialYearStart != null) {
|
||||||
|
result
|
||||||
|
..add('financial_year_start')
|
||||||
|
..add(serializers.serialize(object.financialYearStart,
|
||||||
|
specifiedType: const FullType(int)));
|
||||||
|
}
|
||||||
|
if (object.enabledModules != null) {
|
||||||
|
result
|
||||||
|
..add('enabled_modules')
|
||||||
|
..add(serializers.serialize(object.enabledModules,
|
||||||
|
specifiedType: const FullType(int)));
|
||||||
|
}
|
||||||
|
if (object.defaultPaymentTerms != null) {
|
||||||
|
result
|
||||||
|
..add('payment_terms')
|
||||||
|
..add(serializers.serialize(object.defaultPaymentTerms,
|
||||||
|
specifiedType: const FullType(int)));
|
||||||
|
}
|
||||||
|
if (object.defaultPaymentTypeId != null) {
|
||||||
|
result
|
||||||
|
..add('payment_type_id')
|
||||||
|
..add(serializers.serialize(object.defaultPaymentTypeId,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.defaultTaskRate != null) {
|
||||||
|
result
|
||||||
|
..add('task_rate')
|
||||||
|
..add(serializers.serialize(object.defaultTaskRate,
|
||||||
|
specifiedType: const FullType(double)));
|
||||||
|
}
|
||||||
|
if (object.enableInclusiveTaxes != null) {
|
||||||
|
result
|
||||||
|
..add('inclusive_taxes')
|
||||||
|
..add(serializers.serialize(object.enableInclusiveTaxes,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.convertProductExchangeRate != null) {
|
||||||
|
result
|
||||||
|
..add('convert_products')
|
||||||
|
..add(serializers.serialize(object.convertProductExchangeRate,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.enableCustomInvoiceTaxes1 != null) {
|
||||||
|
result
|
||||||
|
..add('custom_invoice_taxes1')
|
||||||
|
..add(serializers.serialize(object.enableCustomInvoiceTaxes1,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.enableCustomInvoiceTaxes2 != null) {
|
||||||
|
result
|
||||||
|
..add('custom_invoice_taxes2')
|
||||||
|
..add(serializers.serialize(object.enableCustomInvoiceTaxes2,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
|
if (object.taxRates != null) {
|
||||||
|
result
|
||||||
|
..add('tax_rates')
|
||||||
|
..add(serializers.serialize(object.taxRates,
|
||||||
|
specifiedType: const FullType(
|
||||||
|
BuiltList, const [const FullType(TaxRateEntity)])));
|
||||||
|
}
|
||||||
if (object.taskStatuses != null) {
|
if (object.taskStatuses != null) {
|
||||||
result
|
result
|
||||||
..add('task_statuses')
|
..add('task_statuses')
|
||||||
|
|
@ -247,6 +261,127 @@ class _$CompanyEntitySerializer implements StructuredSerializer<CompanyEntity> {
|
||||||
specifiedType: const FullType(
|
specifiedType: const FullType(
|
||||||
BuiltList, const [const FullType(ExpenseCategoryEntity)])));
|
BuiltList, const [const FullType(ExpenseCategoryEntity)])));
|
||||||
}
|
}
|
||||||
|
if (object.expenseCategoryMap != null) {
|
||||||
|
result
|
||||||
|
..add('expenseCategoryMap')
|
||||||
|
..add(serializers.serialize(object.expenseCategoryMap,
|
||||||
|
specifiedType: const FullType(BuiltMap, const [
|
||||||
|
const FullType(String),
|
||||||
|
const FullType(ExpenseCategoryEntity)
|
||||||
|
])));
|
||||||
|
}
|
||||||
|
if (object.users != null) {
|
||||||
|
result
|
||||||
|
..add('users')
|
||||||
|
..add(serializers.serialize(object.users,
|
||||||
|
specifiedType:
|
||||||
|
const FullType(BuiltList, const [const FullType(UserEntity)])));
|
||||||
|
}
|
||||||
|
if (object.userMap != null) {
|
||||||
|
result
|
||||||
|
..add('userMap')
|
||||||
|
..add(serializers.serialize(object.userMap,
|
||||||
|
specifiedType: const FullType(BuiltMap,
|
||||||
|
const [const FullType(String), const FullType(UserEntity)])));
|
||||||
|
}
|
||||||
|
if (object.customFields != null) {
|
||||||
|
result
|
||||||
|
..add('custom_fields')
|
||||||
|
..add(serializers.serialize(object.customFields,
|
||||||
|
specifiedType: const FullType(BuiltMap,
|
||||||
|
const [const FullType(String), const FullType(String)])));
|
||||||
|
}
|
||||||
|
if (object.customPaymentTerms != null) {
|
||||||
|
result
|
||||||
|
..add('custom_payment_terms')
|
||||||
|
..add(serializers.serialize(object.customPaymentTerms,
|
||||||
|
specifiedType: const FullType(
|
||||||
|
BuiltList, const [const FullType(PaymentTermEntity)])));
|
||||||
|
}
|
||||||
|
if (object.invoiceFields != null) {
|
||||||
|
result
|
||||||
|
..add('invoice_fields')
|
||||||
|
..add(serializers.serialize(object.invoiceFields,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailFooter != null) {
|
||||||
|
result
|
||||||
|
..add('email_footer')
|
||||||
|
..add(serializers.serialize(object.emailFooter,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectInvoice != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_invoice')
|
||||||
|
..add(serializers.serialize(object.emailSubjectInvoice,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectQuote != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_quote')
|
||||||
|
..add(serializers.serialize(object.emailSubjectQuote,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectPayment != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_payment')
|
||||||
|
..add(serializers.serialize(object.emailSubjectPayment,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyInvoice != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_invoice')
|
||||||
|
..add(serializers.serialize(object.emailBodyInvoice,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyQuote != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_quote')
|
||||||
|
..add(serializers.serialize(object.emailBodyQuote,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyPayment != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_payment')
|
||||||
|
..add(serializers.serialize(object.emailBodyPayment,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectReminder1 != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_reminder1')
|
||||||
|
..add(serializers.serialize(object.emailSubjectReminder1,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectReminder2 != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_reminder2')
|
||||||
|
..add(serializers.serialize(object.emailSubjectReminder2,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailSubjectReminder3 != null) {
|
||||||
|
result
|
||||||
|
..add('email_subject_reminder3')
|
||||||
|
..add(serializers.serialize(object.emailSubjectReminder3,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyReminder1 != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_reminder1')
|
||||||
|
..add(serializers.serialize(object.emailBodyReminder1,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyReminder2 != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_reminder2')
|
||||||
|
..add(serializers.serialize(object.emailBodyReminder2,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
|
if (object.emailBodyReminder3 != null) {
|
||||||
|
result
|
||||||
|
..add('email_template_reminder3')
|
||||||
|
..add(serializers.serialize(object.emailBodyReminder3,
|
||||||
|
specifiedType: const FullType(String)));
|
||||||
|
}
|
||||||
if (object.fillProducts != null) {
|
if (object.fillProducts != null) {
|
||||||
result
|
result
|
||||||
..add('fill_products')
|
..add('fill_products')
|
||||||
|
|
@ -723,7 +858,7 @@ class _$UserEntitySerializer implements StructuredSerializer<UserEntity> {
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
{FullType specifiedType = FullType.unspecified}) {
|
||||||
final result = <Object>[
|
final result = <Object>[
|
||||||
'id',
|
'id',
|
||||||
serializers.serialize(object.id, specifiedType: const FullType(int)),
|
serializers.serialize(object.id, specifiedType: const FullType(String)),
|
||||||
'first_name',
|
'first_name',
|
||||||
serializers.serialize(object.firstName,
|
serializers.serialize(object.firstName,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
|
|
@ -733,15 +868,17 @@ class _$UserEntitySerializer implements StructuredSerializer<UserEntity> {
|
||||||
'email',
|
'email',
|
||||||
serializers.serialize(object.email,
|
serializers.serialize(object.email,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
'is_admin',
|
|
||||||
serializers.serialize(object.isAdmin,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'permissions',
|
'permissions',
|
||||||
serializers.serialize(object.permissionsMap,
|
serializers.serialize(object.permissionsMap,
|
||||||
specifiedType: const FullType(
|
specifiedType: const FullType(
|
||||||
BuiltMap, const [const FullType(String), const FullType(bool)])),
|
BuiltMap, const [const FullType(String), const FullType(bool)])),
|
||||||
];
|
];
|
||||||
|
if (object.isAdmin != null) {
|
||||||
|
result
|
||||||
|
..add('is_admin')
|
||||||
|
..add(serializers.serialize(object.isAdmin,
|
||||||
|
specifiedType: const FullType(bool)));
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -758,7 +895,7 @@ class _$UserEntitySerializer implements StructuredSerializer<UserEntity> {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'id':
|
case 'id':
|
||||||
result.id = serializers.deserialize(value,
|
result.id = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(int)) as int;
|
specifiedType: const FullType(String)) as String;
|
||||||
break;
|
break;
|
||||||
case 'first_name':
|
case 'first_name':
|
||||||
result.firstName = serializers.deserialize(value,
|
result.firstName = serializers.deserialize(value,
|
||||||
|
|
@ -801,9 +938,6 @@ class _$UserCompanyEntitySerializer
|
||||||
Iterable<Object> serialize(Serializers serializers, UserCompanyEntity object,
|
Iterable<Object> serialize(Serializers serializers, UserCompanyEntity object,
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
{FullType specifiedType = FullType.unspecified}) {
|
||||||
final result = <Object>[
|
final result = <Object>[
|
||||||
'isAdmin',
|
|
||||||
serializers.serialize(object.isAdmin,
|
|
||||||
specifiedType: const FullType(bool)),
|
|
||||||
'company',
|
'company',
|
||||||
serializers.serialize(object.company,
|
serializers.serialize(object.company,
|
||||||
specifiedType: const FullType(CompanyEntity)),
|
specifiedType: const FullType(CompanyEntity)),
|
||||||
|
|
@ -830,10 +964,6 @@ class _$UserCompanyEntitySerializer
|
||||||
iterator.moveNext();
|
iterator.moveNext();
|
||||||
final dynamic value = iterator.current;
|
final dynamic value = iterator.current;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'isAdmin':
|
|
||||||
result.isAdmin = serializers.deserialize(value,
|
|
||||||
specifiedType: const FullType(bool)) as bool;
|
|
||||||
break;
|
|
||||||
case 'company':
|
case 'company':
|
||||||
result.company.replace(serializers.deserialize(value,
|
result.company.replace(serializers.deserialize(value,
|
||||||
specifiedType: const FullType(CompanyEntity)) as CompanyEntity);
|
specifiedType: const FullType(CompanyEntity)) as CompanyEntity);
|
||||||
|
|
@ -1104,165 +1234,12 @@ class _$CompanyEntity extends CompanyEntity {
|
||||||
if (companyKey == null) {
|
if (companyKey == null) {
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'companyKey');
|
throw new BuiltValueNullFieldError('CompanyEntity', 'companyKey');
|
||||||
}
|
}
|
||||||
if (defaultInvoiceTerms == null) {
|
if (countryId == null) {
|
||||||
throw new BuiltValueNullFieldError(
|
throw new BuiltValueNullFieldError('CompanyEntity', 'countryId');
|
||||||
'CompanyEntity', 'defaultInvoiceTerms');
|
|
||||||
}
|
|
||||||
if (enableInvoiceTaxes == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'enableInvoiceTaxes');
|
|
||||||
}
|
|
||||||
if (enableInvoiceItemTaxes == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'enableInvoiceItemTaxes');
|
|
||||||
}
|
|
||||||
if (defaultInvoiceDesignId == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'defaultInvoiceDesignId');
|
|
||||||
}
|
|
||||||
if (defaultQuoteDesignId == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'defaultQuoteDesignId');
|
|
||||||
}
|
|
||||||
if (languageId == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'languageId');
|
|
||||||
}
|
|
||||||
if (defaultInvoiceFooter == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'defaultInvoiceFooter');
|
|
||||||
}
|
|
||||||
if (showInvoiceItemTaxes == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'showInvoiceItemTaxes');
|
|
||||||
}
|
|
||||||
if (enableMilitaryTime == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'enableMilitaryTime');
|
|
||||||
}
|
|
||||||
if (defaultTaxName1 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultTaxName1');
|
|
||||||
}
|
|
||||||
if (defaultTaxRate1 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultTaxRate1');
|
|
||||||
}
|
|
||||||
if (defaultTaxName2 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultTaxName2');
|
|
||||||
}
|
|
||||||
if (defaultTaxRate2 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultTaxRate2');
|
|
||||||
}
|
|
||||||
if (defaultQuoteTerms == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultQuoteTerms');
|
|
||||||
}
|
|
||||||
if (showCurrencyCode == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'showCurrencyCode');
|
|
||||||
}
|
|
||||||
if (enableSecondTaxRate == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'enableSecondTaxRate');
|
|
||||||
}
|
|
||||||
if (startOfWeek == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'startOfWeek');
|
|
||||||
}
|
|
||||||
if (financialYearStart == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'financialYearStart');
|
|
||||||
}
|
|
||||||
if (enabledModules == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'enabledModules');
|
|
||||||
}
|
|
||||||
if (defaultPaymentTerms == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'defaultPaymentTerms');
|
|
||||||
}
|
|
||||||
if (defaultPaymentTypeId == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'defaultPaymentTypeId');
|
|
||||||
}
|
|
||||||
if (defaultTaskRate == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'defaultTaskRate');
|
|
||||||
}
|
|
||||||
if (enableInclusiveTaxes == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'enableInclusiveTaxes');
|
|
||||||
}
|
|
||||||
if (convertProductExchangeRate == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'convertProductExchangeRate');
|
|
||||||
}
|
|
||||||
if (enableCustomInvoiceTaxes1 == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'enableCustomInvoiceTaxes1');
|
|
||||||
}
|
|
||||||
if (enableCustomInvoiceTaxes2 == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'enableCustomInvoiceTaxes2');
|
|
||||||
}
|
|
||||||
if (taxRates == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'taxRates');
|
|
||||||
}
|
}
|
||||||
if (taskStatusMap == null) {
|
if (taskStatusMap == null) {
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'taskStatusMap');
|
throw new BuiltValueNullFieldError('CompanyEntity', 'taskStatusMap');
|
||||||
}
|
}
|
||||||
if (expenseCategoryMap == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'expenseCategoryMap');
|
|
||||||
}
|
|
||||||
if (users == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'users');
|
|
||||||
}
|
|
||||||
if (userMap == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'userMap');
|
|
||||||
}
|
|
||||||
if (customFields == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'customFields');
|
|
||||||
}
|
|
||||||
if (customPaymentTerms == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'customPaymentTerms');
|
|
||||||
}
|
|
||||||
if (invoiceFields == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'invoiceFields');
|
|
||||||
}
|
|
||||||
if (emailFooter == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailFooter');
|
|
||||||
}
|
|
||||||
if (emailSubjectInvoice == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'emailSubjectInvoice');
|
|
||||||
}
|
|
||||||
if (emailSubjectQuote == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailSubjectQuote');
|
|
||||||
}
|
|
||||||
if (emailSubjectPayment == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'emailSubjectPayment');
|
|
||||||
}
|
|
||||||
if (emailBodyInvoice == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyInvoice');
|
|
||||||
}
|
|
||||||
if (emailBodyQuote == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyQuote');
|
|
||||||
}
|
|
||||||
if (emailBodyPayment == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyPayment');
|
|
||||||
}
|
|
||||||
if (emailSubjectReminder1 == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'emailSubjectReminder1');
|
|
||||||
}
|
|
||||||
if (emailSubjectReminder2 == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'emailSubjectReminder2');
|
|
||||||
}
|
|
||||||
if (emailSubjectReminder3 == null) {
|
|
||||||
throw new BuiltValueNullFieldError(
|
|
||||||
'CompanyEntity', 'emailSubjectReminder3');
|
|
||||||
}
|
|
||||||
if (emailBodyReminder1 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyReminder1');
|
|
||||||
}
|
|
||||||
if (emailBodyReminder2 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyReminder2');
|
|
||||||
}
|
|
||||||
if (emailBodyReminder3 == null) {
|
|
||||||
throw new BuiltValueNullFieldError('CompanyEntity', 'emailBodyReminder3');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -1905,15 +1882,15 @@ class CompanyEntityBuilder
|
||||||
convertProductExchangeRate: convertProductExchangeRate,
|
convertProductExchangeRate: convertProductExchangeRate,
|
||||||
enableCustomInvoiceTaxes1: enableCustomInvoiceTaxes1,
|
enableCustomInvoiceTaxes1: enableCustomInvoiceTaxes1,
|
||||||
enableCustomInvoiceTaxes2: enableCustomInvoiceTaxes2,
|
enableCustomInvoiceTaxes2: enableCustomInvoiceTaxes2,
|
||||||
taxRates: taxRates.build(),
|
taxRates: _taxRates?.build(),
|
||||||
taskStatuses: _taskStatuses?.build(),
|
taskStatuses: _taskStatuses?.build(),
|
||||||
taskStatusMap: taskStatusMap.build(),
|
taskStatusMap: taskStatusMap.build(),
|
||||||
expenseCategories: _expenseCategories?.build(),
|
expenseCategories: _expenseCategories?.build(),
|
||||||
expenseCategoryMap: expenseCategoryMap.build(),
|
expenseCategoryMap: _expenseCategoryMap?.build(),
|
||||||
users: users.build(),
|
users: _users?.build(),
|
||||||
userMap: userMap.build(),
|
userMap: _userMap?.build(),
|
||||||
customFields: customFields.build(),
|
customFields: _customFields?.build(),
|
||||||
customPaymentTerms: customPaymentTerms.build(),
|
customPaymentTerms: _customPaymentTerms?.build(),
|
||||||
invoiceFields: invoiceFields,
|
invoiceFields: invoiceFields,
|
||||||
emailFooter: emailFooter,
|
emailFooter: emailFooter,
|
||||||
emailSubjectInvoice: emailSubjectInvoice,
|
emailSubjectInvoice: emailSubjectInvoice,
|
||||||
|
|
@ -1937,7 +1914,7 @@ class CompanyEntityBuilder
|
||||||
String _$failedField;
|
String _$failedField;
|
||||||
try {
|
try {
|
||||||
_$failedField = 'taxRates';
|
_$failedField = 'taxRates';
|
||||||
taxRates.build();
|
_taxRates?.build();
|
||||||
_$failedField = 'taskStatuses';
|
_$failedField = 'taskStatuses';
|
||||||
_taskStatuses?.build();
|
_taskStatuses?.build();
|
||||||
_$failedField = 'taskStatusMap';
|
_$failedField = 'taskStatusMap';
|
||||||
|
|
@ -1945,15 +1922,15 @@ class CompanyEntityBuilder
|
||||||
_$failedField = 'expenseCategories';
|
_$failedField = 'expenseCategories';
|
||||||
_expenseCategories?.build();
|
_expenseCategories?.build();
|
||||||
_$failedField = 'expenseCategoryMap';
|
_$failedField = 'expenseCategoryMap';
|
||||||
expenseCategoryMap.build();
|
_expenseCategoryMap?.build();
|
||||||
_$failedField = 'users';
|
_$failedField = 'users';
|
||||||
users.build();
|
_users?.build();
|
||||||
_$failedField = 'userMap';
|
_$failedField = 'userMap';
|
||||||
userMap.build();
|
_userMap?.build();
|
||||||
_$failedField = 'customFields';
|
_$failedField = 'customFields';
|
||||||
customFields.build();
|
_customFields?.build();
|
||||||
_$failedField = 'customPaymentTerms';
|
_$failedField = 'customPaymentTerms';
|
||||||
customPaymentTerms.build();
|
_customPaymentTerms?.build();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new BuiltValueNestedFieldError(
|
throw new BuiltValueNestedFieldError(
|
||||||
'CompanyEntity', _$failedField, e.toString());
|
'CompanyEntity', _$failedField, e.toString());
|
||||||
|
|
@ -2199,7 +2176,7 @@ class TaxRateEntityBuilder
|
||||||
|
|
||||||
class _$UserEntity extends UserEntity {
|
class _$UserEntity extends UserEntity {
|
||||||
@override
|
@override
|
||||||
final int id;
|
final String id;
|
||||||
@override
|
@override
|
||||||
final String firstName;
|
final String firstName;
|
||||||
@override
|
@override
|
||||||
|
|
@ -2234,9 +2211,6 @@ class _$UserEntity extends UserEntity {
|
||||||
if (email == null) {
|
if (email == null) {
|
||||||
throw new BuiltValueNullFieldError('UserEntity', 'email');
|
throw new BuiltValueNullFieldError('UserEntity', 'email');
|
||||||
}
|
}
|
||||||
if (isAdmin == null) {
|
|
||||||
throw new BuiltValueNullFieldError('UserEntity', 'isAdmin');
|
|
||||||
}
|
|
||||||
if (permissionsMap == null) {
|
if (permissionsMap == null) {
|
||||||
throw new BuiltValueNullFieldError('UserEntity', 'permissionsMap');
|
throw new BuiltValueNullFieldError('UserEntity', 'permissionsMap');
|
||||||
}
|
}
|
||||||
|
|
@ -2289,9 +2263,9 @@ class _$UserEntity extends UserEntity {
|
||||||
class UserEntityBuilder implements Builder<UserEntity, UserEntityBuilder> {
|
class UserEntityBuilder implements Builder<UserEntity, UserEntityBuilder> {
|
||||||
_$UserEntity _$v;
|
_$UserEntity _$v;
|
||||||
|
|
||||||
int _id;
|
String _id;
|
||||||
int get id => _$this._id;
|
String get id => _$this._id;
|
||||||
set id(int id) => _$this._id = id;
|
set id(String id) => _$this._id = id;
|
||||||
|
|
||||||
String _firstName;
|
String _firstName;
|
||||||
String get firstName => _$this._firstName;
|
String get firstName => _$this._firstName;
|
||||||
|
|
@ -2372,8 +2346,6 @@ class UserEntityBuilder implements Builder<UserEntity, UserEntityBuilder> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _$UserCompanyEntity extends UserCompanyEntity {
|
class _$UserCompanyEntity extends UserCompanyEntity {
|
||||||
@override
|
|
||||||
final bool isAdmin;
|
|
||||||
@override
|
@override
|
||||||
final CompanyEntity company;
|
final CompanyEntity company;
|
||||||
@override
|
@override
|
||||||
|
|
@ -2385,11 +2357,7 @@ class _$UserCompanyEntity extends UserCompanyEntity {
|
||||||
[void Function(UserCompanyEntityBuilder) updates]) =>
|
[void Function(UserCompanyEntityBuilder) updates]) =>
|
||||||
(new UserCompanyEntityBuilder()..update(updates)).build();
|
(new UserCompanyEntityBuilder()..update(updates)).build();
|
||||||
|
|
||||||
_$UserCompanyEntity._({this.isAdmin, this.company, this.user, this.token})
|
_$UserCompanyEntity._({this.company, this.user, this.token}) : super._() {
|
||||||
: super._() {
|
|
||||||
if (isAdmin == null) {
|
|
||||||
throw new BuiltValueNullFieldError('UserCompanyEntity', 'isAdmin');
|
|
||||||
}
|
|
||||||
if (company == null) {
|
if (company == null) {
|
||||||
throw new BuiltValueNullFieldError('UserCompanyEntity', 'company');
|
throw new BuiltValueNullFieldError('UserCompanyEntity', 'company');
|
||||||
}
|
}
|
||||||
|
|
@ -2413,7 +2381,6 @@ class _$UserCompanyEntity extends UserCompanyEntity {
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (identical(other, this)) return true;
|
if (identical(other, this)) return true;
|
||||||
return other is UserCompanyEntity &&
|
return other is UserCompanyEntity &&
|
||||||
isAdmin == other.isAdmin &&
|
|
||||||
company == other.company &&
|
company == other.company &&
|
||||||
user == other.user &&
|
user == other.user &&
|
||||||
token == other.token;
|
token == other.token;
|
||||||
|
|
@ -2421,15 +2388,13 @@ class _$UserCompanyEntity extends UserCompanyEntity {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return $jf($jc(
|
return $jf(
|
||||||
$jc($jc($jc(0, isAdmin.hashCode), company.hashCode), user.hashCode),
|
$jc($jc($jc(0, company.hashCode), user.hashCode), token.hashCode));
|
||||||
token.hashCode));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return (newBuiltValueToStringHelper('UserCompanyEntity')
|
return (newBuiltValueToStringHelper('UserCompanyEntity')
|
||||||
..add('isAdmin', isAdmin)
|
|
||||||
..add('company', company)
|
..add('company', company)
|
||||||
..add('user', user)
|
..add('user', user)
|
||||||
..add('token', token))
|
..add('token', token))
|
||||||
|
|
@ -2441,10 +2406,6 @@ class UserCompanyEntityBuilder
|
||||||
implements Builder<UserCompanyEntity, UserCompanyEntityBuilder> {
|
implements Builder<UserCompanyEntity, UserCompanyEntityBuilder> {
|
||||||
_$UserCompanyEntity _$v;
|
_$UserCompanyEntity _$v;
|
||||||
|
|
||||||
bool _isAdmin;
|
|
||||||
bool get isAdmin => _$this._isAdmin;
|
|
||||||
set isAdmin(bool isAdmin) => _$this._isAdmin = isAdmin;
|
|
||||||
|
|
||||||
CompanyEntityBuilder _company;
|
CompanyEntityBuilder _company;
|
||||||
CompanyEntityBuilder get company =>
|
CompanyEntityBuilder get company =>
|
||||||
_$this._company ??= new CompanyEntityBuilder();
|
_$this._company ??= new CompanyEntityBuilder();
|
||||||
|
|
@ -2462,7 +2423,6 @@ class UserCompanyEntityBuilder
|
||||||
|
|
||||||
UserCompanyEntityBuilder get _$this {
|
UserCompanyEntityBuilder get _$this {
|
||||||
if (_$v != null) {
|
if (_$v != null) {
|
||||||
_isAdmin = _$v.isAdmin;
|
|
||||||
_company = _$v.company?.toBuilder();
|
_company = _$v.company?.toBuilder();
|
||||||
_user = _$v.user?.toBuilder();
|
_user = _$v.user?.toBuilder();
|
||||||
_token = _$v.token?.toBuilder();
|
_token = _$v.token?.toBuilder();
|
||||||
|
|
@ -2490,7 +2450,6 @@ class UserCompanyEntityBuilder
|
||||||
try {
|
try {
|
||||||
_$result = _$v ??
|
_$result = _$v ??
|
||||||
new _$UserCompanyEntity._(
|
new _$UserCompanyEntity._(
|
||||||
isAdmin: isAdmin,
|
|
||||||
company: company.build(),
|
company: company.build(),
|
||||||
user: user.build(),
|
user: user.build(),
|
||||||
token: token.build());
|
token: token.build());
|
||||||
|
|
|
||||||
|
|
@ -218,25 +218,11 @@ abstract class LoginResponse
|
||||||
LoginResponse._();
|
LoginResponse._();
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'data')
|
@BuiltValueField(wireName: 'data')
|
||||||
LoginResponseData get data;
|
|
||||||
|
|
||||||
static Serializer<LoginResponse> get serializer => _$loginResponseSerializer;
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class LoginResponseData
|
|
||||||
implements Built<LoginResponseData, LoginResponseDataBuilder> {
|
|
||||||
factory LoginResponseData([void updates(LoginResponseDataBuilder b)]) =
|
|
||||||
_$LoginResponseData;
|
|
||||||
|
|
||||||
LoginResponseData._();
|
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'company_users')
|
|
||||||
BuiltList<UserCompanyEntity> get userCompanies;
|
BuiltList<UserCompanyEntity> get userCompanies;
|
||||||
|
|
||||||
StaticData get static;
|
StaticData get static;
|
||||||
|
|
||||||
static Serializer<LoginResponseData> get serializer =>
|
static Serializer<LoginResponse> get serializer => _$loginResponseSerializer;
|
||||||
_$loginResponseDataSerializer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class StaticData implements Built<StaticData, StaticDataBuilder> {
|
abstract class StaticData implements Built<StaticData, StaticDataBuilder> {
|
||||||
|
|
|
||||||
|
|
@ -196,8 +196,6 @@ Serializer<ErrorMessage> _$errorMessageSerializer =
|
||||||
new _$ErrorMessageSerializer();
|
new _$ErrorMessageSerializer();
|
||||||
Serializer<LoginResponse> _$loginResponseSerializer =
|
Serializer<LoginResponse> _$loginResponseSerializer =
|
||||||
new _$LoginResponseSerializer();
|
new _$LoginResponseSerializer();
|
||||||
Serializer<LoginResponseData> _$loginResponseDataSerializer =
|
|
||||||
new _$LoginResponseDataSerializer();
|
|
||||||
Serializer<StaticData> _$staticDataSerializer = new _$StaticDataSerializer();
|
Serializer<StaticData> _$staticDataSerializer = new _$StaticDataSerializer();
|
||||||
Serializer<DashboardResponse> _$dashboardResponseSerializer =
|
Serializer<DashboardResponse> _$dashboardResponseSerializer =
|
||||||
new _$DashboardResponseSerializer();
|
new _$DashboardResponseSerializer();
|
||||||
|
|
@ -326,8 +324,12 @@ class _$LoginResponseSerializer implements StructuredSerializer<LoginResponse> {
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
{FullType specifiedType = FullType.unspecified}) {
|
||||||
final result = <Object>[
|
final result = <Object>[
|
||||||
'data',
|
'data',
|
||||||
serializers.serialize(object.data,
|
serializers.serialize(object.userCompanies,
|
||||||
specifiedType: const FullType(LoginResponseData)),
|
specifiedType: const FullType(
|
||||||
|
BuiltList, const [const FullType(UserCompanyEntity)])),
|
||||||
|
'static',
|
||||||
|
serializers.serialize(object.static,
|
||||||
|
specifiedType: const FullType(StaticData)),
|
||||||
];
|
];
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -346,53 +348,6 @@ class _$LoginResponseSerializer implements StructuredSerializer<LoginResponse> {
|
||||||
final dynamic value = iterator.current;
|
final dynamic value = iterator.current;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'data':
|
case 'data':
|
||||||
result.data.replace(serializers.deserialize(value,
|
|
||||||
specifiedType: const FullType(LoginResponseData))
|
|
||||||
as LoginResponseData);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _$LoginResponseDataSerializer
|
|
||||||
implements StructuredSerializer<LoginResponseData> {
|
|
||||||
@override
|
|
||||||
final Iterable<Type> types = const [LoginResponseData, _$LoginResponseData];
|
|
||||||
@override
|
|
||||||
final String wireName = 'LoginResponseData';
|
|
||||||
|
|
||||||
@override
|
|
||||||
Iterable<Object> serialize(Serializers serializers, LoginResponseData object,
|
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
|
||||||
final result = <Object>[
|
|
||||||
'company_users',
|
|
||||||
serializers.serialize(object.userCompanies,
|
|
||||||
specifiedType: const FullType(
|
|
||||||
BuiltList, const [const FullType(UserCompanyEntity)])),
|
|
||||||
'static',
|
|
||||||
serializers.serialize(object.static,
|
|
||||||
specifiedType: const FullType(StaticData)),
|
|
||||||
];
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
LoginResponseData deserialize(
|
|
||||||
Serializers serializers, Iterable<Object> serialized,
|
|
||||||
{FullType specifiedType = FullType.unspecified}) {
|
|
||||||
final result = new LoginResponseDataBuilder();
|
|
||||||
|
|
||||||
final iterator = serialized.iterator;
|
|
||||||
while (iterator.moveNext()) {
|
|
||||||
final key = iterator.current as String;
|
|
||||||
iterator.moveNext();
|
|
||||||
final dynamic value = iterator.current;
|
|
||||||
switch (key) {
|
|
||||||
case 'company_users':
|
|
||||||
result.userCompanies.replace(serializers.deserialize(value,
|
result.userCompanies.replace(serializers.deserialize(value,
|
||||||
specifiedType: const FullType(
|
specifiedType: const FullType(
|
||||||
BuiltList, const [const FullType(UserCompanyEntity)]))
|
BuiltList, const [const FullType(UserCompanyEntity)]))
|
||||||
|
|
@ -868,14 +823,19 @@ class ErrorMessageBuilder
|
||||||
|
|
||||||
class _$LoginResponse extends LoginResponse {
|
class _$LoginResponse extends LoginResponse {
|
||||||
@override
|
@override
|
||||||
final LoginResponseData data;
|
final BuiltList<UserCompanyEntity> userCompanies;
|
||||||
|
@override
|
||||||
|
final StaticData static;
|
||||||
|
|
||||||
factory _$LoginResponse([void Function(LoginResponseBuilder) updates]) =>
|
factory _$LoginResponse([void Function(LoginResponseBuilder) updates]) =>
|
||||||
(new LoginResponseBuilder()..update(updates)).build();
|
(new LoginResponseBuilder()..update(updates)).build();
|
||||||
|
|
||||||
_$LoginResponse._({this.data}) : super._() {
|
_$LoginResponse._({this.userCompanies, this.static}) : super._() {
|
||||||
if (data == null) {
|
if (userCompanies == null) {
|
||||||
throw new BuiltValueNullFieldError('LoginResponse', 'data');
|
throw new BuiltValueNullFieldError('LoginResponse', 'userCompanies');
|
||||||
|
}
|
||||||
|
if (static == null) {
|
||||||
|
throw new BuiltValueNullFieldError('LoginResponse', 'static');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -889,17 +849,21 @@ class _$LoginResponse extends LoginResponse {
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (identical(other, this)) return true;
|
if (identical(other, this)) return true;
|
||||||
return other is LoginResponse && data == other.data;
|
return other is LoginResponse &&
|
||||||
|
userCompanies == other.userCompanies &&
|
||||||
|
static == other.static;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return $jf($jc(0, data.hashCode));
|
return $jf($jc($jc(0, userCompanies.hashCode), static.hashCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return (newBuiltValueToStringHelper('LoginResponse')..add('data', data))
|
return (newBuiltValueToStringHelper('LoginResponse')
|
||||||
|
..add('userCompanies', userCompanies)
|
||||||
|
..add('static', static))
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -908,16 +872,22 @@ class LoginResponseBuilder
|
||||||
implements Builder<LoginResponse, LoginResponseBuilder> {
|
implements Builder<LoginResponse, LoginResponseBuilder> {
|
||||||
_$LoginResponse _$v;
|
_$LoginResponse _$v;
|
||||||
|
|
||||||
LoginResponseDataBuilder _data;
|
ListBuilder<UserCompanyEntity> _userCompanies;
|
||||||
LoginResponseDataBuilder get data =>
|
ListBuilder<UserCompanyEntity> get userCompanies =>
|
||||||
_$this._data ??= new LoginResponseDataBuilder();
|
_$this._userCompanies ??= new ListBuilder<UserCompanyEntity>();
|
||||||
set data(LoginResponseDataBuilder data) => _$this._data = data;
|
set userCompanies(ListBuilder<UserCompanyEntity> userCompanies) =>
|
||||||
|
_$this._userCompanies = userCompanies;
|
||||||
|
|
||||||
|
StaticDataBuilder _static;
|
||||||
|
StaticDataBuilder get static => _$this._static ??= new StaticDataBuilder();
|
||||||
|
set static(StaticDataBuilder static) => _$this._static = static;
|
||||||
|
|
||||||
LoginResponseBuilder();
|
LoginResponseBuilder();
|
||||||
|
|
||||||
LoginResponseBuilder get _$this {
|
LoginResponseBuilder get _$this {
|
||||||
if (_$v != null) {
|
if (_$v != null) {
|
||||||
_data = _$v.data?.toBuilder();
|
_userCompanies = _$v.userCompanies?.toBuilder();
|
||||||
|
_static = _$v.static?.toBuilder();
|
||||||
_$v = null;
|
_$v = null;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -939,117 +909,9 @@ class LoginResponseBuilder
|
||||||
@override
|
@override
|
||||||
_$LoginResponse build() {
|
_$LoginResponse build() {
|
||||||
_$LoginResponse _$result;
|
_$LoginResponse _$result;
|
||||||
try {
|
|
||||||
_$result = _$v ?? new _$LoginResponse._(data: data.build());
|
|
||||||
} catch (_) {
|
|
||||||
String _$failedField;
|
|
||||||
try {
|
|
||||||
_$failedField = 'data';
|
|
||||||
data.build();
|
|
||||||
} catch (e) {
|
|
||||||
throw new BuiltValueNestedFieldError(
|
|
||||||
'LoginResponse', _$failedField, e.toString());
|
|
||||||
}
|
|
||||||
rethrow;
|
|
||||||
}
|
|
||||||
replace(_$result);
|
|
||||||
return _$result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _$LoginResponseData extends LoginResponseData {
|
|
||||||
@override
|
|
||||||
final BuiltList<UserCompanyEntity> userCompanies;
|
|
||||||
@override
|
|
||||||
final StaticData static;
|
|
||||||
|
|
||||||
factory _$LoginResponseData(
|
|
||||||
[void Function(LoginResponseDataBuilder) updates]) =>
|
|
||||||
(new LoginResponseDataBuilder()..update(updates)).build();
|
|
||||||
|
|
||||||
_$LoginResponseData._({this.userCompanies, this.static}) : super._() {
|
|
||||||
if (userCompanies == null) {
|
|
||||||
throw new BuiltValueNullFieldError('LoginResponseData', 'userCompanies');
|
|
||||||
}
|
|
||||||
if (static == null) {
|
|
||||||
throw new BuiltValueNullFieldError('LoginResponseData', 'static');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
LoginResponseData rebuild(void Function(LoginResponseDataBuilder) updates) =>
|
|
||||||
(toBuilder()..update(updates)).build();
|
|
||||||
|
|
||||||
@override
|
|
||||||
LoginResponseDataBuilder toBuilder() =>
|
|
||||||
new LoginResponseDataBuilder()..replace(this);
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
if (identical(other, this)) return true;
|
|
||||||
return other is LoginResponseData &&
|
|
||||||
userCompanies == other.userCompanies &&
|
|
||||||
static == other.static;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode {
|
|
||||||
return $jf($jc($jc(0, userCompanies.hashCode), static.hashCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return (newBuiltValueToStringHelper('LoginResponseData')
|
|
||||||
..add('userCompanies', userCompanies)
|
|
||||||
..add('static', static))
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class LoginResponseDataBuilder
|
|
||||||
implements Builder<LoginResponseData, LoginResponseDataBuilder> {
|
|
||||||
_$LoginResponseData _$v;
|
|
||||||
|
|
||||||
ListBuilder<UserCompanyEntity> _userCompanies;
|
|
||||||
ListBuilder<UserCompanyEntity> get userCompanies =>
|
|
||||||
_$this._userCompanies ??= new ListBuilder<UserCompanyEntity>();
|
|
||||||
set userCompanies(ListBuilder<UserCompanyEntity> userCompanies) =>
|
|
||||||
_$this._userCompanies = userCompanies;
|
|
||||||
|
|
||||||
StaticDataBuilder _static;
|
|
||||||
StaticDataBuilder get static => _$this._static ??= new StaticDataBuilder();
|
|
||||||
set static(StaticDataBuilder static) => _$this._static = static;
|
|
||||||
|
|
||||||
LoginResponseDataBuilder();
|
|
||||||
|
|
||||||
LoginResponseDataBuilder get _$this {
|
|
||||||
if (_$v != null) {
|
|
||||||
_userCompanies = _$v.userCompanies?.toBuilder();
|
|
||||||
_static = _$v.static?.toBuilder();
|
|
||||||
_$v = null;
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void replace(LoginResponseData other) {
|
|
||||||
if (other == null) {
|
|
||||||
throw new ArgumentError.notNull('other');
|
|
||||||
}
|
|
||||||
_$v = other as _$LoginResponseData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void update(void Function(LoginResponseDataBuilder) updates) {
|
|
||||||
if (updates != null) updates(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
_$LoginResponseData build() {
|
|
||||||
_$LoginResponseData _$result;
|
|
||||||
try {
|
try {
|
||||||
_$result = _$v ??
|
_$result = _$v ??
|
||||||
new _$LoginResponseData._(
|
new _$LoginResponse._(
|
||||||
userCompanies: userCompanies.build(), static: static.build());
|
userCompanies: userCompanies.build(), static: static.build());
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
String _$failedField;
|
String _$failedField;
|
||||||
|
|
@ -1060,7 +922,7 @@ class LoginResponseDataBuilder
|
||||||
static.build();
|
static.build();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new BuiltValueNestedFieldError(
|
throw new BuiltValueNestedFieldError(
|
||||||
'LoginResponseData', _$failedField, e.toString());
|
'LoginResponse', _$failedField, e.toString());
|
||||||
}
|
}
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ Serializers _$serializers = (new Serializers().toBuilder()
|
||||||
..add(LanguageListResponse.serializer)
|
..add(LanguageListResponse.serializer)
|
||||||
..add(ListUIState.serializer)
|
..add(ListUIState.serializer)
|
||||||
..add(LoginResponse.serializer)
|
..add(LoginResponse.serializer)
|
||||||
..add(LoginResponseData.serializer)
|
|
||||||
..add(PaymentEntity.serializer)
|
..add(PaymentEntity.serializer)
|
||||||
..add(PaymentItemResponse.serializer)
|
..add(PaymentItemResponse.serializer)
|
||||||
..add(PaymentListResponse.serializer)
|
..add(PaymentListResponse.serializer)
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ abstract class CountryEntity extends Object
|
||||||
name: '',
|
name: '',
|
||||||
iso2: '',
|
iso2: '',
|
||||||
iso3: '',
|
iso3: '',
|
||||||
swapPostalCodeInt: 0,
|
swapPostalCode: false,
|
||||||
swapCurrencySymbolInt: 0,
|
swapCurrencySymbol: false,
|
||||||
thousandSeparator: '',
|
thousandSeparator: '',
|
||||||
decimalSeparator: '',
|
decimalSeparator: '',
|
||||||
);
|
);
|
||||||
|
|
@ -70,14 +70,10 @@ abstract class CountryEntity extends Object
|
||||||
String get name;
|
String get name;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'swap_postal_code')
|
@BuiltValueField(wireName: 'swap_postal_code')
|
||||||
int get swapPostalCodeInt;
|
bool get swapPostalCode;
|
||||||
|
|
||||||
bool get swapPostalCode => swapCurrencySymbolInt == 1;
|
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'swap_currency_symbol')
|
@BuiltValueField(wireName: 'swap_currency_symbol')
|
||||||
int get swapCurrencySymbolInt;
|
bool get swapCurrencySymbol;
|
||||||
|
|
||||||
bool get swapCurrencySymbol => swapCurrencySymbolInt == 1;
|
|
||||||
|
|
||||||
// TODO remove once fixed in the app
|
// TODO remove once fixed in the app
|
||||||
@nullable
|
@nullable
|
||||||
|
|
|
||||||
|
|
@ -121,11 +121,11 @@ class _$CountryEntitySerializer implements StructuredSerializer<CountryEntity> {
|
||||||
'name',
|
'name',
|
||||||
serializers.serialize(object.name, specifiedType: const FullType(String)),
|
serializers.serialize(object.name, specifiedType: const FullType(String)),
|
||||||
'swap_postal_code',
|
'swap_postal_code',
|
||||||
serializers.serialize(object.swapPostalCodeInt,
|
serializers.serialize(object.swapPostalCode,
|
||||||
specifiedType: const FullType(int)),
|
specifiedType: const FullType(bool)),
|
||||||
'swap_currency_symbol',
|
'swap_currency_symbol',
|
||||||
serializers.serialize(object.swapCurrencySymbolInt,
|
serializers.serialize(object.swapCurrencySymbol,
|
||||||
specifiedType: const FullType(int)),
|
specifiedType: const FullType(bool)),
|
||||||
'iso_3166_2',
|
'iso_3166_2',
|
||||||
serializers.serialize(object.iso2, specifiedType: const FullType(String)),
|
serializers.serialize(object.iso2, specifiedType: const FullType(String)),
|
||||||
'iso_3166_3',
|
'iso_3166_3',
|
||||||
|
|
@ -169,12 +169,12 @@ class _$CountryEntitySerializer implements StructuredSerializer<CountryEntity> {
|
||||||
specifiedType: const FullType(String)) as String;
|
specifiedType: const FullType(String)) as String;
|
||||||
break;
|
break;
|
||||||
case 'swap_postal_code':
|
case 'swap_postal_code':
|
||||||
result.swapPostalCodeInt = serializers.deserialize(value,
|
result.swapPostalCode = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(int)) as int;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
break;
|
break;
|
||||||
case 'swap_currency_symbol':
|
case 'swap_currency_symbol':
|
||||||
result.swapCurrencySymbolInt = serializers.deserialize(value,
|
result.swapCurrencySymbol = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(int)) as int;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
break;
|
break;
|
||||||
case 'thousand_separator':
|
case 'thousand_separator':
|
||||||
result.thousandSeparator = serializers.deserialize(value,
|
result.thousandSeparator = serializers.deserialize(value,
|
||||||
|
|
@ -396,9 +396,9 @@ class _$CountryEntity extends CountryEntity {
|
||||||
@override
|
@override
|
||||||
final String name;
|
final String name;
|
||||||
@override
|
@override
|
||||||
final int swapPostalCodeInt;
|
final bool swapPostalCode;
|
||||||
@override
|
@override
|
||||||
final int swapCurrencySymbolInt;
|
final bool swapCurrencySymbol;
|
||||||
@override
|
@override
|
||||||
final String thousandSeparator;
|
final String thousandSeparator;
|
||||||
@override
|
@override
|
||||||
|
|
@ -415,8 +415,8 @@ class _$CountryEntity extends CountryEntity {
|
||||||
|
|
||||||
_$CountryEntity._(
|
_$CountryEntity._(
|
||||||
{this.name,
|
{this.name,
|
||||||
this.swapPostalCodeInt,
|
this.swapPostalCode,
|
||||||
this.swapCurrencySymbolInt,
|
this.swapCurrencySymbol,
|
||||||
this.thousandSeparator,
|
this.thousandSeparator,
|
||||||
this.decimalSeparator,
|
this.decimalSeparator,
|
||||||
this.iso2,
|
this.iso2,
|
||||||
|
|
@ -426,12 +426,11 @@ class _$CountryEntity extends CountryEntity {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
throw new BuiltValueNullFieldError('CountryEntity', 'name');
|
throw new BuiltValueNullFieldError('CountryEntity', 'name');
|
||||||
}
|
}
|
||||||
if (swapPostalCodeInt == null) {
|
if (swapPostalCode == null) {
|
||||||
throw new BuiltValueNullFieldError('CountryEntity', 'swapPostalCodeInt');
|
throw new BuiltValueNullFieldError('CountryEntity', 'swapPostalCode');
|
||||||
}
|
}
|
||||||
if (swapCurrencySymbolInt == null) {
|
if (swapCurrencySymbol == null) {
|
||||||
throw new BuiltValueNullFieldError(
|
throw new BuiltValueNullFieldError('CountryEntity', 'swapCurrencySymbol');
|
||||||
'CountryEntity', 'swapCurrencySymbolInt');
|
|
||||||
}
|
}
|
||||||
if (iso2 == null) {
|
if (iso2 == null) {
|
||||||
throw new BuiltValueNullFieldError('CountryEntity', 'iso2');
|
throw new BuiltValueNullFieldError('CountryEntity', 'iso2');
|
||||||
|
|
@ -453,8 +452,8 @@ class _$CountryEntity extends CountryEntity {
|
||||||
if (identical(other, this)) return true;
|
if (identical(other, this)) return true;
|
||||||
return other is CountryEntity &&
|
return other is CountryEntity &&
|
||||||
name == other.name &&
|
name == other.name &&
|
||||||
swapPostalCodeInt == other.swapPostalCodeInt &&
|
swapPostalCode == other.swapPostalCode &&
|
||||||
swapCurrencySymbolInt == other.swapCurrencySymbolInt &&
|
swapCurrencySymbol == other.swapCurrencySymbol &&
|
||||||
thousandSeparator == other.thousandSeparator &&
|
thousandSeparator == other.thousandSeparator &&
|
||||||
decimalSeparator == other.decimalSeparator &&
|
decimalSeparator == other.decimalSeparator &&
|
||||||
iso2 == other.iso2 &&
|
iso2 == other.iso2 &&
|
||||||
|
|
@ -469,10 +468,8 @@ class _$CountryEntity extends CountryEntity {
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc($jc($jc(0, name.hashCode), swapPostalCode.hashCode),
|
||||||
$jc($jc(0, name.hashCode),
|
swapCurrencySymbol.hashCode),
|
||||||
swapPostalCodeInt.hashCode),
|
|
||||||
swapCurrencySymbolInt.hashCode),
|
|
||||||
thousandSeparator.hashCode),
|
thousandSeparator.hashCode),
|
||||||
decimalSeparator.hashCode),
|
decimalSeparator.hashCode),
|
||||||
iso2.hashCode),
|
iso2.hashCode),
|
||||||
|
|
@ -484,8 +481,8 @@ class _$CountryEntity extends CountryEntity {
|
||||||
String toString() {
|
String toString() {
|
||||||
return (newBuiltValueToStringHelper('CountryEntity')
|
return (newBuiltValueToStringHelper('CountryEntity')
|
||||||
..add('name', name)
|
..add('name', name)
|
||||||
..add('swapPostalCodeInt', swapPostalCodeInt)
|
..add('swapPostalCode', swapPostalCode)
|
||||||
..add('swapCurrencySymbolInt', swapCurrencySymbolInt)
|
..add('swapCurrencySymbol', swapCurrencySymbol)
|
||||||
..add('thousandSeparator', thousandSeparator)
|
..add('thousandSeparator', thousandSeparator)
|
||||||
..add('decimalSeparator', decimalSeparator)
|
..add('decimalSeparator', decimalSeparator)
|
||||||
..add('iso2', iso2)
|
..add('iso2', iso2)
|
||||||
|
|
@ -503,15 +500,15 @@ class CountryEntityBuilder
|
||||||
String get name => _$this._name;
|
String get name => _$this._name;
|
||||||
set name(String name) => _$this._name = name;
|
set name(String name) => _$this._name = name;
|
||||||
|
|
||||||
int _swapPostalCodeInt;
|
bool _swapPostalCode;
|
||||||
int get swapPostalCodeInt => _$this._swapPostalCodeInt;
|
bool get swapPostalCode => _$this._swapPostalCode;
|
||||||
set swapPostalCodeInt(int swapPostalCodeInt) =>
|
set swapPostalCode(bool swapPostalCode) =>
|
||||||
_$this._swapPostalCodeInt = swapPostalCodeInt;
|
_$this._swapPostalCode = swapPostalCode;
|
||||||
|
|
||||||
int _swapCurrencySymbolInt;
|
bool _swapCurrencySymbol;
|
||||||
int get swapCurrencySymbolInt => _$this._swapCurrencySymbolInt;
|
bool get swapCurrencySymbol => _$this._swapCurrencySymbol;
|
||||||
set swapCurrencySymbolInt(int swapCurrencySymbolInt) =>
|
set swapCurrencySymbol(bool swapCurrencySymbol) =>
|
||||||
_$this._swapCurrencySymbolInt = swapCurrencySymbolInt;
|
_$this._swapCurrencySymbol = swapCurrencySymbol;
|
||||||
|
|
||||||
String _thousandSeparator;
|
String _thousandSeparator;
|
||||||
String get thousandSeparator => _$this._thousandSeparator;
|
String get thousandSeparator => _$this._thousandSeparator;
|
||||||
|
|
@ -540,8 +537,8 @@ class CountryEntityBuilder
|
||||||
CountryEntityBuilder get _$this {
|
CountryEntityBuilder get _$this {
|
||||||
if (_$v != null) {
|
if (_$v != null) {
|
||||||
_name = _$v.name;
|
_name = _$v.name;
|
||||||
_swapPostalCodeInt = _$v.swapPostalCodeInt;
|
_swapPostalCode = _$v.swapPostalCode;
|
||||||
_swapCurrencySymbolInt = _$v.swapCurrencySymbolInt;
|
_swapCurrencySymbol = _$v.swapCurrencySymbol;
|
||||||
_thousandSeparator = _$v.thousandSeparator;
|
_thousandSeparator = _$v.thousandSeparator;
|
||||||
_decimalSeparator = _$v.decimalSeparator;
|
_decimalSeparator = _$v.decimalSeparator;
|
||||||
_iso2 = _$v.iso2;
|
_iso2 = _$v.iso2;
|
||||||
|
|
@ -570,8 +567,8 @@ class CountryEntityBuilder
|
||||||
final _$result = _$v ??
|
final _$result = _$v ??
|
||||||
new _$CountryEntity._(
|
new _$CountryEntity._(
|
||||||
name: name,
|
name: name,
|
||||||
swapPostalCodeInt: swapPostalCodeInt,
|
swapPostalCode: swapPostalCode,
|
||||||
swapCurrencySymbolInt: swapCurrencySymbolInt,
|
swapCurrencySymbol: swapCurrencySymbol,
|
||||||
thousandSeparator: thousandSeparator,
|
thousandSeparator: thousandSeparator,
|
||||||
decimalSeparator: decimalSeparator,
|
decimalSeparator: decimalSeparator,
|
||||||
iso2: iso2,
|
iso2: iso2,
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ abstract class CurrencyEntity extends Object
|
||||||
thousandSeparator: '',
|
thousandSeparator: '',
|
||||||
decimalSeparator: '',
|
decimalSeparator: '',
|
||||||
code: '',
|
code: '',
|
||||||
swapCurrencySymbolInt: 0,
|
|
||||||
exchangeRate: 0.0,
|
exchangeRate: 0.0,
|
||||||
|
swapCurrencySymbol: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
CurrencyEntity._();
|
CurrencyEntity._();
|
||||||
|
|
@ -73,9 +73,7 @@ abstract class CurrencyEntity extends Object
|
||||||
String get code;
|
String get code;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'swap_currency_symbol')
|
@BuiltValueField(wireName: 'swap_currency_symbol')
|
||||||
int get swapCurrencySymbolInt;
|
bool get swapCurrencySymbol;
|
||||||
|
|
||||||
bool get swapCurrencySymbol => swapCurrencySymbolInt == 1;
|
|
||||||
|
|
||||||
// TODO remove once fixed in the app
|
// TODO remove once fixed in the app
|
||||||
@nullable
|
@nullable
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ class _$CurrencyEntitySerializer
|
||||||
'code',
|
'code',
|
||||||
serializers.serialize(object.code, specifiedType: const FullType(String)),
|
serializers.serialize(object.code, specifiedType: const FullType(String)),
|
||||||
'swap_currency_symbol',
|
'swap_currency_symbol',
|
||||||
serializers.serialize(object.swapCurrencySymbolInt,
|
serializers.serialize(object.swapCurrencySymbol,
|
||||||
specifiedType: const FullType(int)),
|
specifiedType: const FullType(bool)),
|
||||||
];
|
];
|
||||||
if (object.exchangeRate != null) {
|
if (object.exchangeRate != null) {
|
||||||
result
|
result
|
||||||
|
|
@ -191,8 +191,8 @@ class _$CurrencyEntitySerializer
|
||||||
specifiedType: const FullType(String)) as String;
|
specifiedType: const FullType(String)) as String;
|
||||||
break;
|
break;
|
||||||
case 'swap_currency_symbol':
|
case 'swap_currency_symbol':
|
||||||
result.swapCurrencySymbolInt = serializers.deserialize(value,
|
result.swapCurrencySymbol = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(int)) as int;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
break;
|
break;
|
||||||
case 'exchange_rate':
|
case 'exchange_rate':
|
||||||
result.exchangeRate = serializers.deserialize(value,
|
result.exchangeRate = serializers.deserialize(value,
|
||||||
|
|
@ -413,7 +413,7 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
@override
|
@override
|
||||||
final String code;
|
final String code;
|
||||||
@override
|
@override
|
||||||
final int swapCurrencySymbolInt;
|
final bool swapCurrencySymbol;
|
||||||
@override
|
@override
|
||||||
final double exchangeRate;
|
final double exchangeRate;
|
||||||
@override
|
@override
|
||||||
|
|
@ -429,7 +429,7 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
this.thousandSeparator,
|
this.thousandSeparator,
|
||||||
this.decimalSeparator,
|
this.decimalSeparator,
|
||||||
this.code,
|
this.code,
|
||||||
this.swapCurrencySymbolInt,
|
this.swapCurrencySymbol,
|
||||||
this.exchangeRate,
|
this.exchangeRate,
|
||||||
this.id})
|
this.id})
|
||||||
: super._() {
|
: super._() {
|
||||||
|
|
@ -451,9 +451,9 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
throw new BuiltValueNullFieldError('CurrencyEntity', 'code');
|
throw new BuiltValueNullFieldError('CurrencyEntity', 'code');
|
||||||
}
|
}
|
||||||
if (swapCurrencySymbolInt == null) {
|
if (swapCurrencySymbol == null) {
|
||||||
throw new BuiltValueNullFieldError(
|
throw new BuiltValueNullFieldError(
|
||||||
'CurrencyEntity', 'swapCurrencySymbolInt');
|
'CurrencyEntity', 'swapCurrencySymbol');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -475,7 +475,7 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
thousandSeparator == other.thousandSeparator &&
|
thousandSeparator == other.thousandSeparator &&
|
||||||
decimalSeparator == other.decimalSeparator &&
|
decimalSeparator == other.decimalSeparator &&
|
||||||
code == other.code &&
|
code == other.code &&
|
||||||
swapCurrencySymbolInt == other.swapCurrencySymbolInt &&
|
swapCurrencySymbol == other.swapCurrencySymbol &&
|
||||||
exchangeRate == other.exchangeRate &&
|
exchangeRate == other.exchangeRate &&
|
||||||
id == other.id;
|
id == other.id;
|
||||||
}
|
}
|
||||||
|
|
@ -493,7 +493,7 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
thousandSeparator.hashCode),
|
thousandSeparator.hashCode),
|
||||||
decimalSeparator.hashCode),
|
decimalSeparator.hashCode),
|
||||||
code.hashCode),
|
code.hashCode),
|
||||||
swapCurrencySymbolInt.hashCode),
|
swapCurrencySymbol.hashCode),
|
||||||
exchangeRate.hashCode),
|
exchangeRate.hashCode),
|
||||||
id.hashCode));
|
id.hashCode));
|
||||||
}
|
}
|
||||||
|
|
@ -507,7 +507,7 @@ class _$CurrencyEntity extends CurrencyEntity {
|
||||||
..add('thousandSeparator', thousandSeparator)
|
..add('thousandSeparator', thousandSeparator)
|
||||||
..add('decimalSeparator', decimalSeparator)
|
..add('decimalSeparator', decimalSeparator)
|
||||||
..add('code', code)
|
..add('code', code)
|
||||||
..add('swapCurrencySymbolInt', swapCurrencySymbolInt)
|
..add('swapCurrencySymbol', swapCurrencySymbol)
|
||||||
..add('exchangeRate', exchangeRate)
|
..add('exchangeRate', exchangeRate)
|
||||||
..add('id', id))
|
..add('id', id))
|
||||||
.toString();
|
.toString();
|
||||||
|
|
@ -544,10 +544,10 @@ class CurrencyEntityBuilder
|
||||||
String get code => _$this._code;
|
String get code => _$this._code;
|
||||||
set code(String code) => _$this._code = code;
|
set code(String code) => _$this._code = code;
|
||||||
|
|
||||||
int _swapCurrencySymbolInt;
|
bool _swapCurrencySymbol;
|
||||||
int get swapCurrencySymbolInt => _$this._swapCurrencySymbolInt;
|
bool get swapCurrencySymbol => _$this._swapCurrencySymbol;
|
||||||
set swapCurrencySymbolInt(int swapCurrencySymbolInt) =>
|
set swapCurrencySymbol(bool swapCurrencySymbol) =>
|
||||||
_$this._swapCurrencySymbolInt = swapCurrencySymbolInt;
|
_$this._swapCurrencySymbol = swapCurrencySymbol;
|
||||||
|
|
||||||
double _exchangeRate;
|
double _exchangeRate;
|
||||||
double get exchangeRate => _$this._exchangeRate;
|
double get exchangeRate => _$this._exchangeRate;
|
||||||
|
|
@ -567,7 +567,7 @@ class CurrencyEntityBuilder
|
||||||
_thousandSeparator = _$v.thousandSeparator;
|
_thousandSeparator = _$v.thousandSeparator;
|
||||||
_decimalSeparator = _$v.decimalSeparator;
|
_decimalSeparator = _$v.decimalSeparator;
|
||||||
_code = _$v.code;
|
_code = _$v.code;
|
||||||
_swapCurrencySymbolInt = _$v.swapCurrencySymbolInt;
|
_swapCurrencySymbol = _$v.swapCurrencySymbol;
|
||||||
_exchangeRate = _$v.exchangeRate;
|
_exchangeRate = _$v.exchangeRate;
|
||||||
_id = _$v.id;
|
_id = _$v.id;
|
||||||
_$v = null;
|
_$v = null;
|
||||||
|
|
@ -598,7 +598,7 @@ class CurrencyEntityBuilder
|
||||||
thousandSeparator: thousandSeparator,
|
thousandSeparator: thousandSeparator,
|
||||||
decimalSeparator: decimalSeparator,
|
decimalSeparator: decimalSeparator,
|
||||||
code: code,
|
code: code,
|
||||||
swapCurrencySymbolInt: swapCurrencySymbolInt,
|
swapCurrencySymbol: swapCurrencySymbol,
|
||||||
exchangeRate: exchangeRate,
|
exchangeRate: exchangeRate,
|
||||||
id: id);
|
id: id);
|
||||||
replace(_$result);
|
replace(_$result);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class AuthRepository {
|
||||||
|
|
||||||
final WebClient webClient;
|
final WebClient webClient;
|
||||||
|
|
||||||
Future<LoginResponseData> signUp({
|
Future<LoginResponse> signUp({
|
||||||
String firstName,
|
String firstName,
|
||||||
String lastName,
|
String lastName,
|
||||||
String email,
|
String email,
|
||||||
|
|
@ -37,7 +37,7 @@ class AuthRepository {
|
||||||
return sendRequest(url: url, data: credentials);
|
return sendRequest(url: url, data: credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LoginResponseData> login(
|
Future<LoginResponse> login(
|
||||||
{String email,
|
{String email,
|
||||||
String password,
|
String password,
|
||||||
String url,
|
String url,
|
||||||
|
|
@ -57,7 +57,7 @@ class AuthRepository {
|
||||||
return sendRequest(url: url, data: credentials);
|
return sendRequest(url: url, data: credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LoginResponseData> oauthLogin(
|
Future<LoginResponse> oauthLogin(
|
||||||
{String token, String url, String secret, String platform}) async {
|
{String token, String url, String secret, String platform}) async {
|
||||||
final credentials = {
|
final credentials = {
|
||||||
'token_name': 'invoice-ninja-$platform-app',
|
'token_name': 'invoice-ninja-$platform-app',
|
||||||
|
|
@ -70,7 +70,7 @@ class AuthRepository {
|
||||||
return sendRequest(url: url, data: credentials);
|
return sendRequest(url: url, data: credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LoginResponseData> refresh(
|
Future<LoginResponse> refresh(
|
||||||
{String url, String token, String platform}) async {
|
{String url, String token, String platform}) async {
|
||||||
final credentials = {
|
final credentials = {
|
||||||
'token_name': 'invoice-ninja-$platform-app',
|
'token_name': 'invoice-ninja-$platform-app',
|
||||||
|
|
@ -81,7 +81,7 @@ class AuthRepository {
|
||||||
return sendRequest(url: url, data: credentials, token: token);
|
return sendRequest(url: url, data: credentials, token: token);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<LoginResponseData> sendRequest(
|
Future<LoginResponse> sendRequest(
|
||||||
{String url, dynamic data, String token}) async {
|
{String url, dynamic data, String token}) async {
|
||||||
/*
|
/*
|
||||||
url +=
|
url +=
|
||||||
|
|
@ -96,6 +96,6 @@ class AuthRepository {
|
||||||
final LoginResponse loginResponse =
|
final LoginResponse loginResponse =
|
||||||
serializers.deserializeWith(LoginResponse.serializer, response);
|
serializers.deserializeWith(LoginResponse.serializer, response);
|
||||||
|
|
||||||
return loginResponse.data;
|
return loginResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,9 +176,6 @@ String _parseError(int code, String response) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isVersionSupported(String version) {
|
bool _isVersionSupported(String version) {
|
||||||
// TODO remove this
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (version == null || version.isEmpty) {
|
if (version == null || version.isEmpty) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class LoadAccountSuccess {
|
||||||
{this.loginResponse, this.completer, this.loadCompanies = true});
|
{this.loginResponse, this.completer, this.loadCompanies = true});
|
||||||
|
|
||||||
final Completer completer;
|
final Completer completer;
|
||||||
final LoginResponseData loginResponse;
|
final LoginResponse loginResponse;
|
||||||
final bool loadCompanies;
|
final bool loadCompanies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -317,12 +317,12 @@ Middleware<AppState> _createAccountLoaded() {
|
||||||
return (Store<AppState> store, dynamic dynamicAction,
|
return (Store<AppState> store, dynamic dynamicAction,
|
||||||
NextDispatcher next) async {
|
NextDispatcher next) async {
|
||||||
final action = dynamicAction as LoadAccountSuccess;
|
final action = dynamicAction as LoadAccountSuccess;
|
||||||
final data = action.loginResponse;
|
final response = action.loginResponse;
|
||||||
store.dispatch(LoadStaticSuccess(data: data.static));
|
store.dispatch(LoadStaticSuccess(data: response.static));
|
||||||
|
|
||||||
if (action.loadCompanies) {
|
if (action.loadCompanies) {
|
||||||
for (int i = 0; i < data.userCompanies.length; i++) {
|
for (int i = 0; i < response.userCompanies.length; i++) {
|
||||||
final UserCompanyEntity userCompany = data.userCompanies[i];
|
final UserCompanyEntity userCompany = response.userCompanies[i];
|
||||||
|
|
||||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
prefs.setString(getCompanyTokenKey(i), userCompany.token.token);
|
prefs.setString(getCompanyTokenKey(i), userCompany.token.token);
|
||||||
|
|
@ -331,7 +331,7 @@ Middleware<AppState> _createAccountLoaded() {
|
||||||
store.dispatch(LoadCompanySuccess(userCompany));
|
store.dispatch(LoadCompanySuccess(userCompany));
|
||||||
}
|
}
|
||||||
|
|
||||||
store.dispatch(SelectCompany(1, data.userCompanies[0]));
|
store.dispatch(SelectCompany(1, response.userCompanies[0]));
|
||||||
store.dispatch(UserLoginSuccess());
|
store.dispatch(UserLoginSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue