import { gql } from '@apollo/client'

// Мутация для подтверждения V2 заявки на расходники фулфилмента логистикой
export const LOGISTICS_CONFIRM_CONSUMABLE_SUPPLY = gql`
  mutation LogisticsConfirmConsumableSupply($id: ID!) {
    logisticsConfirmConsumableSupply(id: $id) {
      success
      message
      order {
        id
        status
        fulfillmentCenter {
          id
          name
          fullName
        }
        supplier {
          id
          name
          fullName
        }
        logisticsPartner {
          id
          name
          fullName
        }
        items {
          id
          requestedQuantity
          unitPrice
          totalPrice
          product {
            id
            name
            article
          }
        }
        createdAt
        updatedAt
      }
    }
  }
`

// Мутация для отклонения V2 заявки на расходники фулфилмента логистикой
export const LOGISTICS_REJECT_CONSUMABLE_SUPPLY = gql`
  mutation LogisticsRejectConsumableSupply($id: ID!, $reason: String) {
    logisticsRejectConsumableSupply(id: $id, reason: $reason) {
      success
      message
      order {
        id
        status
        logisticsNotes
        fulfillmentCenter {
          id
          name
          fullName
        }
        supplier {
          id
          name
          fullName
        }
        logisticsPartner {
          id
          name
          fullName
        }
        createdAt
        updatedAt
      }
    }
  }
`