import { gql } from '@apollo/client'

export const SUBSCRIBE_TOPOlogy_CHANGES = gql`
  subscription SubscribeTopologyChanges($id: ID!) {
    topologyChanged(id: $id) {
      id
      region
      entity
      nodes {
        id
        type
        label
        position {
          x
          y
        }
      }
      edges {
        id
        source
        target
        type
      }
      lastUpdated
    }
  }
`

export const SUBSCRIBE_COMPLIANCE_CHANGES = gql`
  subscription SubscribeComplianceChanges($country: String) {
    complianceChanged(country: $country) {
      country
      region
      frameworks
      status
      requirements
      lastAuditDate
    }
  }
`

export const SUBSCRIBE_MILESTONE_CHANGES = gql`
  subscription SubscribeMilestoneChanges($region: String) {
    milestoneChanged(region: $region) {
      id
      title
      region
      entity
      priority
      startDate
      endDate
      status
      dependencies
      cost
      description
    }
  }
`

export const SUBSCRIBE_COST_CHANGES = gql`
  subscription SubscribeCostChanges($region: String) {
    costChanged(region: $region) {
      region
      entity
      category
      monthly
      annual
      breakdown {
        compute
        storage
        network
        licenses
        personnel
      }
      currency
      lastUpdated
    }
  }
`
