import { gql } from '@apollo/client'

// Фрагменты для оптимизации GraphQL запросов
export const USER_FRAGMENT = gql`
  fragment UserInfo on User {
    id
    phone
    avatar
    managerName
    createdAt
  }
`

export const ORGANIZATION_FRAGMENT = gql`
  fragment OrganizationInfo on Organization {
    id
    inn
    name
    fullName
    type
    address
    apiKeys {
      id
      marketplace
      isActive
    }
  }
`

export const EMPLOYEE_FRAGMENT = gql`
  fragment EmployeeInfo on Employee {
    id
    firstName
    lastName
    position
    phone
    email
    salary
    hireDate
    avatar
    createdAt
    updatedAt
  }
`

export const PRODUCT_FRAGMENT = gql`
  fragment ProductInfo on Product {
    id
    name
    article
    description
    price
    quantity
    unit
    category
    imageUrl
    createdAt
    updatedAt
  }
`

export const SUPPLY_FRAGMENT = gql`
  fragment SupplyInfo on Supply {
    id
    status
    volume
    weight
    totalSum
    createdAt
    updatedAt
  }
`
