Input$PurchaseDeliveryNoteInput.fromJson constructor
Input$PurchaseDeliveryNoteInput.fromJson(
- Map<String, dynamic> data
)
Implementation
factory Input$PurchaseDeliveryNoteInput.fromJson(Map<String, dynamic> data) {
final result$data = <String, dynamic>{};
if (data.containsKey('number')) {
final l$number = data['number'];
result$data['number'] = (l$number as String?);
}
if (data.containsKey('date')) {
final l$date = data['date'];
result$data['date'] = l$date == null ? null : dateTimeFromJson(l$date);
}
if (data.containsKey('note')) {
final l$note = data['note'];
result$data['note'] = (l$note as String?);
}
if (data.containsKey('details')) {
final l$details = data['details'];
result$data['details'] = (l$details as List<dynamic>?)
?.map(
(e) => Input$KeyValueInput.fromJson((e as Map<String, dynamic>)))
.toList();
}
final l$products = data['products'];
result$data['products'] = (l$products as List<dynamic>)
.map((e) => Input$InvoicingProductsBundleInput.fromJson(
(e as Map<String, dynamic>)))
.toList();
if (data.containsKey('status')) {
final l$status = data['status'];
result$data['status'] = l$status == null
? null
: fromJson$Enum$GenericInvoicingStatusEnum((l$status as String));
}
if (data.containsKey('address')) {
final l$address = data['address'];
result$data['address'] = l$address == null
? null
: Input$InvoicingAddressInput.fromJson(
(l$address as Map<String, dynamic>));
}
if (data.containsKey('taxes')) {
final l$taxes = data['taxes'];
result$data['taxes'] = (l$taxes as List<dynamic>?)
?.map((e) => Input$taxRankInput.fromJson((e as Map<String, dynamic>)))
.toList();
}
if (data.containsKey('installments')) {
final l$installments = data['installments'];
result$data['installments'] = (l$installments as List<dynamic>?)
?.map((e) =>
Input$InstallmentInput.fromJson((e as Map<String, dynamic>)))
.toList();
}
if (data.containsKey('discount')) {
final l$discount = data['discount'];
result$data['discount'] = l$discount == null
? null
: Input$DiscountDtoInput.fromJson(
(l$discount as Map<String, dynamic>));
}
if (data.containsKey('logistic')) {
final l$logistic = data['logistic'];
result$data['logistic'] = (l$logistic as String?);
}
if (data.containsKey('project')) {
final l$project = data['project'];
result$data['project'] = (l$project as String?);
}
final l$target = data['target'];
result$data['target'] =
Input$TargetACIInput.fromJson((l$target as Map<String, dynamic>));
final l$company = data['company'];
result$data['company'] = (l$company as String);
if (data.containsKey('totalPrice')) {
final l$totalPrice = data['totalPrice'];
result$data['totalPrice'] = l$totalPrice == null
? null
: Input$TotalPriceInput.fromJson(
(l$totalPrice as Map<String, dynamic>));
}
if (data.containsKey('toPay')) {
final l$toPay = data['toPay'];
result$data['toPay'] = (l$toPay as String?);
}
if (data.containsKey('totalTax')) {
final l$totalTax = data['totalTax'];
result$data['totalTax'] = (l$totalTax as String?);
}
if (data.containsKey('totalReductions')) {
final l$totalReductions = data['totalReductions'];
result$data['totalReductions'] = (l$totalReductions as String?);
}
final l$currency = data['currency'];
result$data['currency'] = (l$currency as String);
if (data.containsKey('bank')) {
final l$bank = data['bank'];
result$data['bank'] = (l$bank as String?);
}
if (data.containsKey('supplier')) {
final l$supplier = data['supplier'];
result$data['supplier'] = l$supplier == null
? null
: Input$PurchaseSupplierInput.fromJson(
(l$supplier as Map<String, dynamic>));
}
if (data.containsKey('origin')) {
final l$origin = data['origin'];
result$data['origin'] = l$origin == null
? null
: Input$PurchaseDeliveryNoteOriginInput.fromJson(
(l$origin as Map<String, dynamic>));
}
if (data.containsKey('warehouse')) {
final l$warehouse = data['warehouse'];
result$data['warehouse'] = (l$warehouse as String?);
}
return Input$PurchaseDeliveryNoteInput._(result$data);
}