import { pick } from 'lodash';
/**
 * created_at and updated_at are useful when calculating desync by values since
 * line items have neither
 */
const OrderSummaryKeys = [
    'id',
    'name',
    'created_at',
    'updated_at',
    'admin_graphql_api_id',
];
export function getOrderSummary(order) {
    return pick(order, OrderSummaryKeys);
}
export const OmittedLineItemKeys = [
    // Can't be derived from GQL (at least no direct way to do so)
    'fulfillable_quantity',
    'origin_location',
    'fulfillment_service',
    'fulfillment_status',
    // Omitted since we're updating the type from REST number to GQL string
    'id',
    'price_set',
    'total_discount_set',
    'duties',
    'discount_allocations',
    'tax_lines',
    // Not including these since they're not available on the GraphQL LineItem
    'tip_payment_gateway',
    'tip_payment_method', 'admin_graphql_api_id'
];
const RemainingLineItemKeysRecord = {
    gift_card: undefined,
    grams: undefined,
    name: undefined,
    price: undefined,
    product_id: undefined,
    properties: undefined,
    quantity: undefined,
    requires_shipping: undefined,
    sku: undefined,
    taxable: undefined,
    title: undefined,
    total_discount: undefined,
    variant_id: undefined,
    variant_title: undefined,
    vendor: undefined,
};
const RemainingLineItemKeys = Object.keys(RemainingLineItemKeysRecord);
const NewLineItemKeys = [
    'order_id',
    'order',
    'tax_lines_json',
    'id',
    'variant',
    'duties_json',
    'discount_allocations_json',
    'total_grams',
    // price * quantity
    'total_item_price'
];
export const LineItemKeys = [
    ...RemainingLineItemKeys,
    ...NewLineItemKeys
];
/**
 * Most of these are nullable if the related product / variant DNE
 * Will be present in the REST object but if being converted
 */
const NullablePropKeys = [
    'grams',
    'name',
    'price',
    'product_id',
    'sku',
    'title',
    'variant_id',
    'variant_title',
    'variant',
    'total_grams',
    'total_item_price',
    // Optional prop
    'vendor'
];
export const LineItemTypeName = 'line_items';
//# sourceMappingURL=LineItem.js.map