-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi, thank you for this grate package!
I have 1 client who has on one of his customers set TaxExemptionReasonId.
The problem comes when the Customer is been parsing from JSON. The field
taxExemptionReasonId is int?, while for some reason from the QB server is
coming as a String => "5". This leads to a crash.
It is sad that in QB documentation is also mentioned as numeric field : https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/customer#the-customer-object
I had a workaround locally on my machine over your package to handle this issue, but will be nice
if could be handled on the package side. Probably will have to report this type issue to Intuit as well?
In Customer.toJson I have changed the parsing of the field as :
taxExemptionReasonId: (json['TaxExemptionReasonId'] is String) ?
int.tryParse(json['TaxExemptionReasonId'] as String)
: json['TaxExemptionReasonId'] as int?,
Using v0.0.5
Thanks in advance!