import 'package:hmg_patient_app/core/model/packages_offers/responses/PackagesCustomerResponseModel.dart';

import 'PackagesCartItemsResponseModel.dart';

class PackagesOrderResponseModel {
  String? _customOrderNumber;
  int? _storeId;
  dynamic _pickUpInStore;
  String? _paymentMethodSystemName;
  String? _customerCurrencyCode;
  double? _currencyRate;
  int? _customerTaxDisplayTypeId;
  dynamic _vatNumber;
  double? _orderSubtotalInclTax;
  double? _orderSubtotalExclTax;
  double? _orderSubTotalDiscountInclTax;
  double? _orderSubTotalDiscountExclTax;
  double? _orderShippingInclTax;
  double? _orderShippingExclTax;
  double? _paymentMethodAdditionalFeeInclTax;
  double? _paymentMethodAdditionalFeeExclTax;
  String? _taxRates;
  double? _orderTax;
  double? _orderDiscount;
  double? _orderTotal;
  double? _refundedAmount;
  dynamic _rewardPointsWereAdded;
  String? _checkoutAttributeDescription;
  int? _customerLanguageId;
  int? _affiliateId;
  String? _customerIp;
  dynamic _authorizationTransactionId;
  dynamic _authorizationTransactionCode;
  dynamic _authorizationTransactionResult;
  dynamic _captureTransactionId;
  dynamic _captureTransactionResult;
  dynamic _subscriptionTransactionId;
  dynamic _paidDateUtc;
  dynamic _shippingMethod;
  dynamic _shippingRateComputationMethodSystemName;
  String? _customValuesXml;
  dynamic _paymentOption;
  bool? _deleted;
  String? _createdOnUtc;
  PackagesCustomerResponseModel? _customer;
  int? _customerId;
  dynamic _billingAddress;
  dynamic _shippingAddress;
  List<PackagesCartItemsResponseModel>? _orderItems;
  String? _orderStatus;
  String? _paymentStatus;
  String? _shippingStatus;
  String? _customerTaxDisplayType;
  int? _id;

  String get customOrderNumber => _customOrderNumber!;

  int get storeId => _storeId!;

  dynamic get pickUpInStore => _pickUpInStore;

  String get paymentMethodSystemName => _paymentMethodSystemName!;

  String get customerCurrencyCode => _customerCurrencyCode!;

  double get currencyRate => _currencyRate!;

  int get customerTaxDisplayTypeId => _customerTaxDisplayTypeId!;

  dynamic get vatNumber => _vatNumber;

  double get orderSubtotalInclTax => _orderSubtotalInclTax!;

  double get orderSubtotalExclTax => _orderSubtotalExclTax!;

  double get orderSubTotalDiscountInclTax => _orderSubTotalDiscountInclTax!;

  double get orderSubTotalDiscountExclTax => _orderSubTotalDiscountExclTax!;

  double get orderShippingInclTax => _orderShippingInclTax!;

  double get orderShippingExclTax => _orderShippingExclTax!;

  double get paymentMethodAdditionalFeeInclTax => _paymentMethodAdditionalFeeInclTax!;

  double get paymentMethodAdditionalFeeExclTax => _paymentMethodAdditionalFeeExclTax!;

  String get taxRates => _taxRates!;

  double get orderTax => _orderTax!;

  double get orderDiscount => _orderDiscount!;

  double get orderTotal => _orderTotal!;

  double get refundedAmount => _refundedAmount!;

  dynamic get rewardPointsWereAdded => _rewardPointsWereAdded;

  String get checkoutAttributeDescription => _checkoutAttributeDescription!;

  int get customerLanguageId => _customerLanguageId!;

  int get affiliateId => _affiliateId!;

  String get customerIp => _customerIp!;

  dynamic get authorizationTransactionId => _authorizationTransactionId;

  dynamic get authorizationTransactionCode => _authorizationTransactionCode;

  dynamic get authorizationTransactionResult => _authorizationTransactionResult;

  dynamic get captureTransactionId => _captureTransactionId;

  dynamic get captureTransactionResult => _captureTransactionResult;

  dynamic get subscriptionTransactionId => _subscriptionTransactionId;

  dynamic get paidDateUtc => _paidDateUtc;

  dynamic get shippingMethod => _shippingMethod;

  dynamic get shippingRateComputationMethodSystemName => _shippingRateComputationMethodSystemName;

  String get customValuesXml => _customValuesXml!;

  dynamic get paymentOption => _paymentOption;

  bool get deleted => _deleted!;

  String get createdOnUtc => _createdOnUtc!;

  PackagesCustomerResponseModel get customer => _customer!;

  int get customerId => _customerId!;

  dynamic get billingAddress => _billingAddress;

  dynamic get shippingAddress => _shippingAddress;

  List<PackagesCartItemsResponseModel> get orderItems => _orderItems!;

  String get orderStatus => _orderStatus!;

  String get paymentStatus => _paymentStatus!;

  String get shippingStatus => _shippingStatus!;

  String get customerTaxDisplayType => _customerTaxDisplayType!;

  int get id => _id!;

  OrderResponseModel(
      {String? customOrderNumber,
      int? storeId,
      dynamic pickUpInStore,
      String? paymentMethodSystemName,
      String? customerCurrencyCode,
      double? currencyRate,
      int? customerTaxDisplayTypeId,
      dynamic vatNumber,
      double? orderSubtotalInclTax,
      double? orderSubtotalExclTax,
      double? orderSubTotalDiscountInclTax,
      double? orderSubTotalDiscountExclTax,
      double? orderShippingInclTax,
      double? orderShippingExclTax,
      double? paymentMethodAdditionalFeeInclTax,
      double? paymentMethodAdditionalFeeExclTax,
      String? taxRates,
      double? orderTax,
      double? orderDiscount,
      double? orderTotal,
      double? refundedAmount,
      dynamic rewardPointsWereAdded,
      String? checkoutAttributeDescription,
      int? customerLanguageId,
       int? affiliateId,
      String? customerIp,
      dynamic authorizationTransactionId,
      dynamic authorizationTransactionCode,
      dynamic authorizationTransactionResult,
      dynamic captureTransactionId,
      dynamic captureTransactionResult,
      dynamic subscriptionTransactionId,
      dynamic paidDateUtc,
      dynamic shippingMethod,
      dynamic shippingRateComputationMethodSystemName,
      String? customValuesXml,
      dynamic paymentOption,
      bool? deleted,
      String? createdOnUtc,
      PackagesCustomerResponseModel? customer,
      int? customerId,
      dynamic billingAddress,
      dynamic shippingAddress,
      List<PackagesCartItemsResponseModel>? orderItems,
      String? orderStatus,
      String? paymentStatus,
      String? shippingStatus,
      String? customerTaxDisplayType,
      int? id}) {
    _customOrderNumber = customOrderNumber!;
    _storeId = storeId!;
    _pickUpInStore = pickUpInStore;
    _paymentMethodSystemName = paymentMethodSystemName!;
    _customerCurrencyCode = customerCurrencyCode!;
    _currencyRate = currencyRate!;
    _customerTaxDisplayTypeId = customerTaxDisplayTypeId!;
    _vatNumber = vatNumber;
    _orderSubtotalInclTax = orderSubtotalInclTax!;
    _orderSubtotalExclTax = orderSubtotalExclTax!;
    _orderSubTotalDiscountInclTax = orderSubTotalDiscountInclTax!;
    _orderSubTotalDiscountExclTax = orderSubTotalDiscountExclTax!;
    _orderShippingInclTax = orderShippingInclTax!;
    _orderShippingExclTax = orderShippingExclTax!;
    _paymentMethodAdditionalFeeInclTax = paymentMethodAdditionalFeeInclTax!;
    _paymentMethodAdditionalFeeExclTax = paymentMethodAdditionalFeeExclTax!;
    _taxRates = taxRates!;
    _orderTax = orderTax!;
    _orderDiscount = orderDiscount!;
    _orderTotal = orderTotal!;
    _refundedAmount = refundedAmount!;
    _rewardPointsWereAdded = rewardPointsWereAdded;
    _checkoutAttributeDescription = checkoutAttributeDescription!;
    _customerLanguageId = customerLanguageId!;
     _affiliateId = affiliateId!;
    _customerIp = customerIp!;
    _authorizationTransactionId = authorizationTransactionId;
    _authorizationTransactionCode = authorizationTransactionCode;
    _authorizationTransactionResult = authorizationTransactionResult;
    _captureTransactionId = captureTransactionId;
    _captureTransactionResult = captureTransactionResult;
    _subscriptionTransactionId = subscriptionTransactionId;
    _paidDateUtc = paidDateUtc;
    _shippingMethod = shippingMethod;
    _shippingRateComputationMethodSystemName = shippingRateComputationMethodSystemName;
    _customValuesXml = customValuesXml!;
    _paymentOption = paymentOption;
    _deleted = deleted!;
    _createdOnUtc = createdOnUtc!;
    _customer = customer!;
    _customerId = customerId!;
    _billingAddress = billingAddress;
    _shippingAddress = shippingAddress;
    _orderItems = orderItems!;
    _orderStatus = orderStatus!;
    _paymentStatus = paymentStatus!;
    _shippingStatus = shippingStatus!;
    _customerTaxDisplayType = customerTaxDisplayType!;
    _id = id!;
  }

  PackagesOrderResponseModel.fromJson(dynamic json) {
    _customOrderNumber = json["custom_order_number"];
    _storeId = json["store_id"];
    _pickUpInStore = json["pick_up_in_store"];
    _paymentMethodSystemName = json["payment_method_system_name"];
    _customerCurrencyCode = json["customer_currency_code"];
    _currencyRate = json["currency_rate"];
    _customerTaxDisplayTypeId = json["customer_tax_display_type_id"]!;
    _vatNumber = json["vat_number"];
    _orderSubtotalInclTax = json["order_subtotal_incl_tax"];
    _orderSubtotalExclTax = json["order_subtotal_excl_tax"];
    _orderSubTotalDiscountInclTax = json["order_sub_total_discount_incl_tax"];
    _orderSubTotalDiscountExclTax = json["order_sub_total_discount_excl_tax"];
    _orderShippingInclTax = json["order_shipping_incl_tax"];
    _orderShippingExclTax = json["order_shipping_excl_tax"];
    _paymentMethodAdditionalFeeInclTax = json["payment_method_additional_fee_incl_tax"];
    _paymentMethodAdditionalFeeExclTax = json["payment_method_additional_fee_excl_tax"];
    _taxRates = json["tax_rates"];
    _orderTax = json["order_tax"];
    _orderDiscount = json["order_discount"];
    _orderTotal = json["order_total"];
    _refundedAmount = json["refunded_amount"];
    _rewardPointsWereAdded = json["reward_points_were_added"];
    _checkoutAttributeDescription = json["checkout_attribute_description"];
    _customerLanguageId = json["customer_language_id"];
    _affiliateId = json["affiliate_id"];
    _customerIp = json["customer_ip"];
    _authorizationTransactionId = json["authorization_transaction_id"];
    _authorizationTransactionCode = json["authorization_transaction_code"];
    _authorizationTransactionResult = json["authorization_transaction_result"];
    _captureTransactionId = json["capture_transaction_id"];
    _captureTransactionResult = json["capture_transaction_result"];
    _subscriptionTransactionId = json["subscription_transaction_id"];
    _paidDateUtc = json["paid_date_utc"];
    _shippingMethod = json["shipping_method"];
    _shippingRateComputationMethodSystemName = json["shipping_rate_computation_method_system_name"];
    _customValuesXml = json["custom_values_xml"];
    _paymentOption = json["payment_option"];
    _deleted = json["deleted"];
    _createdOnUtc = json["created_on_utc"];
    _customer = (json["customer"] != null ? PackagesCustomerResponseModel.fromJson(json["customer"]) : null)!;
    _customerId = json["customer_id"];
    _billingAddress = json["billing_address"];
    _shippingAddress = json["shipping_address"];
    if (json["order_items"] != null) {
      _orderItems = [];
      json["order_items"].forEach((v) {
        _orderItems!.add(PackagesCartItemsResponseModel.fromJson(v));
      })!;
    }
    _orderStatus = json["order_status"];
    _paymentStatus = json["payment_status"];
    _shippingStatus = json["shipping_status"];
    _customerTaxDisplayType = json["customer_tax_display_type"];
    _id = json["id"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["custom_order_number"] = _customOrderNumber;
    map["store_id"] = _storeId;
    map["pick_up_in_store"] = _pickUpInStore;
    map["payment_method_system_name"] = _paymentMethodSystemName;
    map["customer_currency_code"] = _customerCurrencyCode;
    map["currency_rate"] = _currencyRate;
    map["customer_tax_display_type_id"] = _customerTaxDisplayTypeId;
    map["vat_number"] = _vatNumber;
    map["order_subtotal_incl_tax"] = _orderSubtotalInclTax;
    map["order_subtotal_excl_tax"] = _orderSubtotalExclTax;
    map["order_sub_total_discount_incl_tax"] = _orderSubTotalDiscountInclTax;
    map["order_sub_total_discount_excl_tax"] = _orderSubTotalDiscountExclTax;
    map["order_shipping_incl_tax"] = _orderShippingInclTax;
    map["order_shipping_excl_tax"] = _orderShippingExclTax;
    map["payment_method_additional_fee_incl_tax"] = _paymentMethodAdditionalFeeInclTax;
    map["payment_method_additional_fee_excl_tax"] = _paymentMethodAdditionalFeeExclTax;
    map["tax_rates"] = _taxRates;
    map["order_tax"] = _orderTax;
    map["order_discount"] = _orderDiscount;
    map["order_total"] = _orderTotal;
    map["refunded_amount"] = _refundedAmount;
    map["reward_points_were_added"] = _rewardPointsWereAdded;
    map["checkout_attribute_description"] = _checkoutAttributeDescription;
    map["customer_language_id"] = _customerLanguageId;
    map["affiliate_id"] = _affiliateId;
    map["customer_ip"] = _customerIp;
    map["authorization_transaction_id"] = _authorizationTransactionId;
    map["authorization_transaction_code"] = _authorizationTransactionCode;
    map["authorization_transaction_result"] = _authorizationTransactionResult;
    map["capture_transaction_id"] = _captureTransactionId;
    map["capture_transaction_result"] = _captureTransactionResult;
    map["subscription_transaction_id"] = _subscriptionTransactionId;
    map["paid_date_utc"] = _paidDateUtc;
    map["shipping_method"] = _shippingMethod;
    map["shipping_rate_computation_method_system_name"] = _shippingRateComputationMethodSystemName;
    map["custom_values_xml"] = _customValuesXml;
    map["payment_option"] = _paymentOption;
    map["deleted"] = _deleted;
    map["created_on_utc"] = _createdOnUtc;
    if (_customer != null) {
      map["customer"] = _customer!.toJson();
    }
    map["customer_id"] = _customerId;
    map["billing_address"] = _billingAddress;
    map["shipping_address"] = _shippingAddress;
    if (_orderItems != null) {
      map["order_items"] = _orderItems!.map((v) => v.toJson()).toList();
    }
    map["order_status"] = _orderStatus;
    map["payment_status"] = _paymentStatus;
    map["shipping_status"] = _shippingStatus;
    map["customer_tax_display_type"] = _customerTaxDisplayType;
    map["id"] = _id;
    return map;
  }
}
