import { gql } from 'graphql-tag'

// V2 мутации для поставщиков - работа с заявками на расходники фулфилмента
export const SUPPLIER_APPROVE_CONSUMABLE_SUPPLY = gql`
  mutation SupplierApproveConsumableSupply($id: ID!) {
    supplierApproveConsumableSupply(id: $id) {
      success
      message
      order {
        id
        status
        supplierApprovedAt
        fulfillmentCenter {
          id
          name
          fullName
        }
        supplier {
          id
          name
          fullName
        }
        items {
          id
          productId
          requestedQuantity
          unitPrice
          totalPrice
          product {
            id
            name
            article
          }
        }
      }
    }
  }
`

export const SUPPLIER_REJECT_CONSUMABLE_SUPPLY = gql`
  mutation SupplierRejectConsumableSupply($id: ID!, $reason: String) {
    supplierRejectConsumableSupply(id: $id, reason: $reason) {
      success
      message
      order {
        id
        status
        supplierNotes
        fulfillmentCenter {
          id
          name
          fullName
        }
        supplier {
          id
          name
          fullName
        }
      }
    }
  }
`

export const SUPPLIER_SHIP_CONSUMABLE_SUPPLY = gql`
  mutation SupplierShipConsumableSupply($id: ID!) {
    supplierShipConsumableSupply(id: $id) {
      success
      message
      order {
        id
        status
        shippedAt
        fulfillmentCenter {
          id
          name
          fullName
        }
        supplier {
          id
          name
          fullName
        }
        logisticsPartner {
          id
          name
          fullName
        }
      }
    }
  }
`