import {
  OrderModelFragment
} from '../../../types/ShopifyGraphQLAdminAPI';

export const OmittedOrderPropsKeys = [
  '__typename',
  'billingAddress',
  'cartDiscountAmountSet',
  'currentCartDiscountAmountSet',
  'currentSubtotalPriceSet',
  'currentTaxLines',
  'currentTotalDiscountsSet',
  'currentTotalDutiesSet',
  'currentTotalPriceSet',
  'currentTotalTaxSet',
  'customAttributes',
  'customer',
  'customerJourneySummary',
  'displayAddress',
  'disputes',
  'fulfillments',
  'lineItems',
  'netPaymentSet',
  'originalTotalDutiesSet',
  'originalTotalPriceSet',
  'paymentCollectionDetails',
  'physicalLocation',
  'publication',
  'refundDiscrepancySet',
  'risks',
  'shippingAddress',
  'shippingLine',
  'subtotalPriceSet',
  'taxLines',
  'totalCapturableSet',
  'totalDiscountsSet',
  'totalOutstandingSet',
  'totalPriceSet',
  'totalReceivedSet',
  'totalRefundedSet',
  'totalRefundedShippingSet',
  'totalShippingPriceSet',
  'totalTaxSet',
  'totalTipReceivedSet',
  'transactions'
] as const;
export type OmittedOrderPropsKey = typeof OmittedOrderPropsKeys[number];
export type PickableOrderPropsKey = Exclude<keyof OrderModelFragment, OmittedOrderPropsKey>;
const PickableOrderPropsKeysRecord: Record<PickableOrderPropsKey, undefined> = {
  'canMarkAsPaid': undefined,
  'canNotifyCustomer': undefined,
  'cancelReason': undefined,
  'cancelledAt': undefined,
  'capturable': undefined,
  'clientIp': undefined,
  'closed': undefined,
  'closedAt': undefined,
  'confirmed': undefined,
  'createdAt': undefined,
  'currencyCode': undefined,
  'currentSubtotalLineItemsQuantity': undefined,
  'currentTotalWeight': undefined,
  'customerAcceptsMarketing': undefined,
  'customerLocale': undefined,
  'discountCode': undefined,
  'displayFinancialStatus': undefined,
  'displayFulfillmentStatus': undefined,
  'edited': undefined,
  'email': undefined,
  'fulfillable': undefined,
  'fullyPaid': undefined,
  'hasTimelineComment': undefined,
  'id': undefined,
  'legacyResourceId': undefined,
  'merchantEditable': undefined,
  'merchantEditableErrors': undefined,
  'name': undefined,
  'note': undefined,
  'paymentGatewayNames': undefined,
  'phone': undefined,
  'presentmentCurrencyCode': undefined,
  'processedAt': undefined,
  'refundable': undefined,
  'requiresShipping': undefined,
  'restockable': undefined,
  'riskLevel': undefined,
  'subtotalLineItemsQuantity': undefined,
  'tags': undefined,
  'taxesIncluded': undefined,
  'test': undefined,
  'totalWeight': undefined,
  'unpaid': undefined,
  'updatedAt': undefined,
};

// Given that the above Record type doesn't throw any typescript errors, this is a safe type assertion.
export const PickableOrderPropsKeys = Object.keys(PickableOrderPropsKeysRecord) as readonly PickableOrderPropsKey[];

export const NewOrderPropKeys = [
  'cartDiscountAmount',
  'currentCartDiscountAmount',
  'currentSubtotalPrice',
  'currentTotalDiscounts',
  'currentTotalDuties',
  'currentTotalPrice',
  'currentTotalTax',
  'netPayment',
  'originalTotalDuties',
  'originalTotalPrice',
  'refundDiscrepancy',
  'subtotalPrice',
  'totalCapturable',
  'totalDiscounts',
  'totalOutstanding',
  'totalPrice',
  'totalReceived',
  'totalRefunded',
  'totalRefundedShipping',
  'totalShippingPrice',
  'totalTax',
  'totalTipReceived',
  'lineItems_json',
  'currentTaxLines_json',
  'customAttributes_json',
  'customer_json',
  'customerJourneySummary_json',
  'disputes_json',
  'fulfillments_json',
  'paymentCollectionDetails_json',
  'risks_json',
  'shippingLine_json',
  'taxLines_json',
  'transactions_json',
  'physicalLocationId',
  'publicationId',
  'billingAddressId',
  'billingAddressPhone',
  'billingAddressFirstName',
  'billingAddressLastName',
  'billingAddressAddress1',
  'billingAddressAddress2',
  'billingAddressCity',
  'billingAddressCompany',
  'billingAddressCountry',
  'billingAddressCountryCodeV2',
  'billingAddressLatitude',
  'billingAddressLongitude',
  'billingAddressProvince',
  'billingAddressProvinceCode',
  'billingAddressZip',
  'displayAddressId',
  'displayAddressPhone',
  'displayAddressFirstName',
  'displayAddressLastName',
  'displayAddressAddress1',
  'displayAddressAddress2',
  'displayAddressCity',
  'displayAddressCompany',
  'displayAddressCountry',
  'displayAddressCountryCodeV2',
  'displayAddressLatitude',
  'displayAddressLongitude',
  'displayAddressProvince',
  'displayAddressProvinceCode',
  'displayAddressZip',
  'shippingAddressId',
  'shippingAddressPhone',
  'shippingAddressFirstName',
  'shippingAddressLastName',
  'shippingAddressAddress1',
  'shippingAddressAddress2',
  'shippingAddressCity',
  'shippingAddressCompany',
  'shippingAddressCountry',
  'shippingAddressCountryCodeV2',
  'shippingAddressLatitude',
  'shippingAddressLongitude',
  'shippingAddressProvince',
  'shippingAddressProvinceCode',
  'shippingAddressZip',
] as const;
export type NewOrderPropKey = typeof NewOrderPropKeys[number];
export const OrderPropsKeys = [
  ...PickableOrderPropsKeys,
  ...NewOrderPropKeys
] as const;
export type OrderPropsKeys = typeof OrderPropsKeys;
export type OrderPropsKey = typeof OrderPropsKeys[number];