Tax model

This commit is contained in:
Hillel Coren 2023-04-18 22:19:03 +03:00
parent 7a6b9a717f
commit 5a17c60302
4 changed files with 51 additions and 2 deletions

View File

@ -247,6 +247,7 @@ abstract class InvoiceEntity extends Object
dueDateDays: 'terms', dueDateDays: 'terms',
saveDefaultTerms: false, saveDefaultTerms: false,
saveDefaultFooter: false, saveDefaultFooter: false,
taxData: '',
); );
} }
@ -594,6 +595,9 @@ abstract class InvoiceEntity extends Object
@BuiltValueField(wireName: 'auto_bill_enabled') @BuiltValueField(wireName: 'auto_bill_enabled')
bool get autoBillEnabled; bool get autoBillEnabled;
@BuiltValueField(wireName: 'tax_data')
String get taxData;
@nullable @nullable
String get filename; String get filename;
@ -1516,7 +1520,8 @@ abstract class InvoiceEntity extends Object
..saveDefaultTerms = false ..saveDefaultTerms = false
..saveDefaultFooter = false ..saveDefaultFooter = false
..autoBillEnabled = false ..autoBillEnabled = false
..subscriptionId = ''; ..subscriptionId = ''
..taxData = '';
static Serializer<InvoiceEntity> get serializer => _$invoiceEntitySerializer; static Serializer<InvoiceEntity> get serializer => _$invoiceEntitySerializer;
} }

View File

@ -263,6 +263,9 @@ class _$InvoiceEntitySerializer implements StructuredSerializer<InvoiceEntity> {
'auto_bill_enabled', 'auto_bill_enabled',
serializers.serialize(object.autoBillEnabled, serializers.serialize(object.autoBillEnabled,
specifiedType: const FullType(bool)), specifiedType: const FullType(bool)),
'tax_data',
serializers.serialize(object.taxData,
specifiedType: const FullType(String)),
'line_items', 'line_items',
serializers.serialize(object.lineItems, serializers.serialize(object.lineItems,
specifiedType: const FullType( specifiedType: const FullType(
@ -667,6 +670,10 @@ class _$InvoiceEntitySerializer implements StructuredSerializer<InvoiceEntity> {
result.autoBillEnabled = serializers.deserialize(value, result.autoBillEnabled = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
break; break;
case 'tax_data':
result.taxData = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case 'filename': case 'filename':
result.filename = serializers.deserialize(value, result.filename = serializers.deserialize(value,
specifiedType: const FullType(String)) as String; specifiedType: const FullType(String)) as String;
@ -1544,6 +1551,8 @@ class _$InvoiceEntity extends InvoiceEntity {
@override @override
final bool autoBillEnabled; final bool autoBillEnabled;
@override @override
final String taxData;
@override
final String filename; final String filename;
@override @override
final BuiltList<InvoiceScheduleEntity> recurringDates; final BuiltList<InvoiceScheduleEntity> recurringDates;
@ -1641,6 +1650,7 @@ class _$InvoiceEntity extends InvoiceEntity {
this.invoiceId, this.invoiceId,
this.recurringId, this.recurringId,
this.autoBillEnabled, this.autoBillEnabled,
this.taxData,
this.filename, this.filename,
this.recurringDates, this.recurringDates,
this.lineItems, this.lineItems,
@ -1744,6 +1754,7 @@ class _$InvoiceEntity extends InvoiceEntity {
nextSendDate, r'InvoiceEntity', 'nextSendDate'); nextSendDate, r'InvoiceEntity', 'nextSendDate');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
autoBillEnabled, r'InvoiceEntity', 'autoBillEnabled'); autoBillEnabled, r'InvoiceEntity', 'autoBillEnabled');
BuiltValueNullFieldError.checkNotNull(taxData, r'InvoiceEntity', 'taxData');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
lineItems, r'InvoiceEntity', 'lineItems'); lineItems, r'InvoiceEntity', 'lineItems');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -1833,6 +1844,7 @@ class _$InvoiceEntity extends InvoiceEntity {
invoiceId == other.invoiceId && invoiceId == other.invoiceId &&
recurringId == other.recurringId && recurringId == other.recurringId &&
autoBillEnabled == other.autoBillEnabled && autoBillEnabled == other.autoBillEnabled &&
taxData == other.taxData &&
filename == other.filename && filename == other.filename &&
recurringDates == other.recurringDates && recurringDates == other.recurringDates &&
lineItems == other.lineItems && lineItems == other.lineItems &&
@ -1913,6 +1925,7 @@ class _$InvoiceEntity extends InvoiceEntity {
_$hash = $jc(_$hash, invoiceId.hashCode); _$hash = $jc(_$hash, invoiceId.hashCode);
_$hash = $jc(_$hash, recurringId.hashCode); _$hash = $jc(_$hash, recurringId.hashCode);
_$hash = $jc(_$hash, autoBillEnabled.hashCode); _$hash = $jc(_$hash, autoBillEnabled.hashCode);
_$hash = $jc(_$hash, taxData.hashCode);
_$hash = $jc(_$hash, filename.hashCode); _$hash = $jc(_$hash, filename.hashCode);
_$hash = $jc(_$hash, recurringDates.hashCode); _$hash = $jc(_$hash, recurringDates.hashCode);
_$hash = $jc(_$hash, lineItems.hashCode); _$hash = $jc(_$hash, lineItems.hashCode);
@ -1993,6 +2006,7 @@ class _$InvoiceEntity extends InvoiceEntity {
..add('invoiceId', invoiceId) ..add('invoiceId', invoiceId)
..add('recurringId', recurringId) ..add('recurringId', recurringId)
..add('autoBillEnabled', autoBillEnabled) ..add('autoBillEnabled', autoBillEnabled)
..add('taxData', taxData)
..add('filename', filename) ..add('filename', filename)
..add('recurringDates', recurringDates) ..add('recurringDates', recurringDates)
..add('lineItems', lineItems) ..add('lineItems', lineItems)
@ -2262,6 +2276,10 @@ class InvoiceEntityBuilder
set autoBillEnabled(bool autoBillEnabled) => set autoBillEnabled(bool autoBillEnabled) =>
_$this._autoBillEnabled = autoBillEnabled; _$this._autoBillEnabled = autoBillEnabled;
String _taxData;
String get taxData => _$this._taxData;
set taxData(String taxData) => _$this._taxData = taxData;
String _filename; String _filename;
String get filename => _$this._filename; String get filename => _$this._filename;
set filename(String filename) => _$this._filename = filename; set filename(String filename) => _$this._filename = filename;
@ -2412,6 +2430,7 @@ class InvoiceEntityBuilder
_invoiceId = $v.invoiceId; _invoiceId = $v.invoiceId;
_recurringId = $v.recurringId; _recurringId = $v.recurringId;
_autoBillEnabled = $v.autoBillEnabled; _autoBillEnabled = $v.autoBillEnabled;
_taxData = $v.taxData;
_filename = $v.filename; _filename = $v.filename;
_recurringDates = $v.recurringDates?.toBuilder(); _recurringDates = $v.recurringDates?.toBuilder();
_lineItems = $v.lineItems.toBuilder(); _lineItems = $v.lineItems.toBuilder();
@ -2519,6 +2538,7 @@ class InvoiceEntityBuilder
invoiceId: invoiceId, invoiceId: invoiceId,
recurringId: recurringId, recurringId: recurringId,
autoBillEnabled: BuiltValueNullFieldError.checkNotNull(autoBillEnabled, r'InvoiceEntity', 'autoBillEnabled'), autoBillEnabled: BuiltValueNullFieldError.checkNotNull(autoBillEnabled, r'InvoiceEntity', 'autoBillEnabled'),
taxData: BuiltValueNullFieldError.checkNotNull(taxData, r'InvoiceEntity', 'taxData'),
filename: filename, filename: filename,
recurringDates: _recurringDates?.build(), recurringDates: _recurringDates?.build(),
lineItems: lineItems.build(), lineItems: lineItems.build(),

View File

@ -102,6 +102,7 @@ abstract class ProductEntity extends Object
stockNotification: true, stockNotification: true,
imageUrl: '', imageUrl: '',
maxQuantity: 0, maxQuantity: 0,
taxId: 0,
documents: BuiltList<DocumentEntity>(), documents: BuiltList<DocumentEntity>(),
); );
} }
@ -179,6 +180,9 @@ abstract class ProductEntity extends Object
@BuiltValueField(wireName: 'max_quantity') @BuiltValueField(wireName: 'max_quantity')
int get maxQuantity; int get maxQuantity;
@BuiltValueField(wireName: 'tax_id')
int get taxId;
BuiltList<DocumentEntity> get documents; BuiltList<DocumentEntity> get documents;
@override @override
@ -362,7 +366,8 @@ abstract class ProductEntity extends Object
..stockNotification = true ..stockNotification = true
..stockNotificationThreshold = 0 ..stockNotificationThreshold = 0
..imageUrl = '' ..imageUrl = ''
..maxQuantity = 0; ..maxQuantity = 0
..taxId = 0;
static Serializer<ProductEntity> get serializer => _$productEntitySerializer; static Serializer<ProductEntity> get serializer => _$productEntitySerializer;
} }

View File

@ -177,6 +177,8 @@ class _$ProductEntitySerializer implements StructuredSerializer<ProductEntity> {
'max_quantity', 'max_quantity',
serializers.serialize(object.maxQuantity, serializers.serialize(object.maxQuantity,
specifiedType: const FullType(int)), specifiedType: const FullType(int)),
'tax_id',
serializers.serialize(object.taxId, specifiedType: const FullType(int)),
'documents', 'documents',
serializers.serialize(object.documents, serializers.serialize(object.documents,
specifiedType: const FullType( specifiedType: const FullType(
@ -317,6 +319,10 @@ class _$ProductEntitySerializer implements StructuredSerializer<ProductEntity> {
result.maxQuantity = serializers.deserialize(value, result.maxQuantity = serializers.deserialize(value,
specifiedType: const FullType(int)) as int; specifiedType: const FullType(int)) as int;
break; break;
case 'tax_id':
result.taxId = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case 'documents': case 'documents':
result.documents.replace(serializers.deserialize(value, result.documents.replace(serializers.deserialize(value,
specifiedType: const FullType( specifiedType: const FullType(
@ -601,6 +607,8 @@ class _$ProductEntity extends ProductEntity {
@override @override
final int maxQuantity; final int maxQuantity;
@override @override
final int taxId;
@override
final BuiltList<DocumentEntity> documents; final BuiltList<DocumentEntity> documents;
@override @override
final bool isChanged; final bool isChanged;
@ -643,6 +651,7 @@ class _$ProductEntity extends ProductEntity {
this.stockNotification, this.stockNotification,
this.imageUrl, this.imageUrl,
this.maxQuantity, this.maxQuantity,
this.taxId,
this.documents, this.documents,
this.isChanged, this.isChanged,
this.createdAt, this.createdAt,
@ -690,6 +699,7 @@ class _$ProductEntity extends ProductEntity {
imageUrl, r'ProductEntity', 'imageUrl'); imageUrl, r'ProductEntity', 'imageUrl');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
maxQuantity, r'ProductEntity', 'maxQuantity'); maxQuantity, r'ProductEntity', 'maxQuantity');
BuiltValueNullFieldError.checkNotNull(taxId, r'ProductEntity', 'taxId');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
documents, r'ProductEntity', 'documents'); documents, r'ProductEntity', 'documents');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -732,6 +742,7 @@ class _$ProductEntity extends ProductEntity {
stockNotification == other.stockNotification && stockNotification == other.stockNotification &&
imageUrl == other.imageUrl && imageUrl == other.imageUrl &&
maxQuantity == other.maxQuantity && maxQuantity == other.maxQuantity &&
taxId == other.taxId &&
documents == other.documents && documents == other.documents &&
isChanged == other.isChanged && isChanged == other.isChanged &&
createdAt == other.createdAt && createdAt == other.createdAt &&
@ -768,6 +779,7 @@ class _$ProductEntity extends ProductEntity {
_$hash = $jc(_$hash, stockNotification.hashCode); _$hash = $jc(_$hash, stockNotification.hashCode);
_$hash = $jc(_$hash, imageUrl.hashCode); _$hash = $jc(_$hash, imageUrl.hashCode);
_$hash = $jc(_$hash, maxQuantity.hashCode); _$hash = $jc(_$hash, maxQuantity.hashCode);
_$hash = $jc(_$hash, taxId.hashCode);
_$hash = $jc(_$hash, documents.hashCode); _$hash = $jc(_$hash, documents.hashCode);
_$hash = $jc(_$hash, isChanged.hashCode); _$hash = $jc(_$hash, isChanged.hashCode);
_$hash = $jc(_$hash, createdAt.hashCode); _$hash = $jc(_$hash, createdAt.hashCode);
@ -804,6 +816,7 @@ class _$ProductEntity extends ProductEntity {
..add('stockNotification', stockNotification) ..add('stockNotification', stockNotification)
..add('imageUrl', imageUrl) ..add('imageUrl', imageUrl)
..add('maxQuantity', maxQuantity) ..add('maxQuantity', maxQuantity)
..add('taxId', taxId)
..add('documents', documents) ..add('documents', documents)
..add('isChanged', isChanged) ..add('isChanged', isChanged)
..add('createdAt', createdAt) ..add('createdAt', createdAt)
@ -903,6 +916,10 @@ class ProductEntityBuilder
int get maxQuantity => _$this._maxQuantity; int get maxQuantity => _$this._maxQuantity;
set maxQuantity(int maxQuantity) => _$this._maxQuantity = maxQuantity; set maxQuantity(int maxQuantity) => _$this._maxQuantity = maxQuantity;
int _taxId;
int get taxId => _$this._taxId;
set taxId(int taxId) => _$this._taxId = taxId;
ListBuilder<DocumentEntity> _documents; ListBuilder<DocumentEntity> _documents;
ListBuilder<DocumentEntity> get documents => ListBuilder<DocumentEntity> get documents =>
_$this._documents ??= new ListBuilder<DocumentEntity>(); _$this._documents ??= new ListBuilder<DocumentEntity>();
@ -970,6 +987,7 @@ class ProductEntityBuilder
_stockNotification = $v.stockNotification; _stockNotification = $v.stockNotification;
_imageUrl = $v.imageUrl; _imageUrl = $v.imageUrl;
_maxQuantity = $v.maxQuantity; _maxQuantity = $v.maxQuantity;
_taxId = $v.taxId;
_documents = $v.documents.toBuilder(); _documents = $v.documents.toBuilder();
_isChanged = $v.isChanged; _isChanged = $v.isChanged;
_createdAt = $v.createdAt; _createdAt = $v.createdAt;
@ -1032,6 +1050,7 @@ class ProductEntityBuilder
stockNotification: BuiltValueNullFieldError.checkNotNull(stockNotification, r'ProductEntity', 'stockNotification'), stockNotification: BuiltValueNullFieldError.checkNotNull(stockNotification, r'ProductEntity', 'stockNotification'),
imageUrl: BuiltValueNullFieldError.checkNotNull(imageUrl, r'ProductEntity', 'imageUrl'), imageUrl: BuiltValueNullFieldError.checkNotNull(imageUrl, r'ProductEntity', 'imageUrl'),
maxQuantity: BuiltValueNullFieldError.checkNotNull(maxQuantity, r'ProductEntity', 'maxQuantity'), maxQuantity: BuiltValueNullFieldError.checkNotNull(maxQuantity, r'ProductEntity', 'maxQuantity'),
taxId: BuiltValueNullFieldError.checkNotNull(taxId, r'ProductEntity', 'taxId'),
documents: documents.build(), documents: documents.build(),
isChanged: isChanged, isChanged: isChanged,
createdAt: BuiltValueNullFieldError.checkNotNull(createdAt, r'ProductEntity', 'createdAt'), createdAt: BuiltValueNullFieldError.checkNotNull(createdAt, r'ProductEntity', 'createdAt'),