Added market place specific feature
This commit is contained in:
@@ -195,6 +195,12 @@ class Invoice {
|
||||
final int? salesChannelId;
|
||||
final String? salesChannel;
|
||||
final String? marketplaceOrderId;
|
||||
final String? courierPartner;
|
||||
final String? trackingNumber;
|
||||
final String? dispatchStatus; // PENDING, PACKED, SHIPPED, IN_TRANSIT, DELIVERED, RTO
|
||||
final DateTime? shippedAt;
|
||||
final String? shippingAddress;
|
||||
final String? shippingPincode;
|
||||
final int? placeOfSupplyStateId;
|
||||
final String? placeOfSupply;
|
||||
final List<InvoiceItem> items;
|
||||
@@ -227,6 +233,12 @@ class Invoice {
|
||||
this.salesChannelId,
|
||||
this.salesChannel,
|
||||
this.marketplaceOrderId,
|
||||
this.courierPartner,
|
||||
this.trackingNumber,
|
||||
this.dispatchStatus,
|
||||
this.shippedAt,
|
||||
this.shippingAddress,
|
||||
this.shippingPincode,
|
||||
this.placeOfSupplyStateId,
|
||||
this.placeOfSupply,
|
||||
this.items = const [],
|
||||
@@ -267,6 +279,14 @@ class Invoice {
|
||||
salesChannelId: json['salesChannelId'] ?? json['sales_channel_id'],
|
||||
salesChannel: json['salesChannel'] ?? json['sales_channel'],
|
||||
marketplaceOrderId: json['marketplaceOrderId'] ?? json['marketplace_order_id'],
|
||||
courierPartner: json['courierPartner'] ?? json['courier_partner'],
|
||||
trackingNumber: json['trackingNumber'] ?? json['tracking_number'],
|
||||
dispatchStatus: json['dispatchStatus'] ?? json['dispatch_status'] ?? 'PENDING',
|
||||
shippedAt: json['shippedAt'] != null
|
||||
? DateTime.parse(json['shippedAt'])
|
||||
: (json['shipped_at'] != null ? DateTime.parse(json['shipped_at']) : null),
|
||||
shippingAddress: json['shippingAddress'] ?? json['shipping_address'],
|
||||
shippingPincode: json['shippingPincode'] ?? json['shipping_pincode'],
|
||||
placeOfSupplyStateId: json['placeOfSupplyStateId'] ?? json['place_of_supply_state_id'],
|
||||
placeOfSupply: json['placeOfSupply'] ?? json['place_of_supply'],
|
||||
items: json['items'] != null
|
||||
@@ -314,6 +334,14 @@ class Invoice {
|
||||
if (salesChannelId != null) data['salesChannelId'] = salesChannelId;
|
||||
if (salesChannel != null) data['salesChannel'] = salesChannel;
|
||||
if (marketplaceOrderId != null) data['marketplaceOrderId'] = marketplaceOrderId;
|
||||
if (courierPartner != null) data['courierPartner'] = courierPartner;
|
||||
if (trackingNumber != null) data['trackingNumber'] = trackingNumber;
|
||||
if (dispatchStatus != null) data['dispatchStatus'] = dispatchStatus;
|
||||
if (shippedAt != null) {
|
||||
data['shippedAt'] = shippedAt!.toIso8601String();
|
||||
}
|
||||
if (shippingAddress != null) data['shippingAddress'] = shippingAddress;
|
||||
if (shippingPincode != null) data['shippingPincode'] = shippingPincode;
|
||||
if (placeOfSupplyStateId != null) data['placeOfSupplyStateId'] = placeOfSupplyStateId;
|
||||
if (placeOfSupply != null) data['placeOfSupply'] = placeOfSupply;
|
||||
data['items'] = items.map((i) => i.toJson()).toList();
|
||||
|
||||
Reference in New Issue
Block a user