import { gql } from "graphql-request";
export const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
export const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
export const USER_QUERY_NAMESPACE = "sq:user-info-query";
export const USER_FORM_CONTEXT_NAMESPACE = "sq:user-form-context";
export const FINANCE_NETWORK_SETTINGS_NAMESPACE = "sq:finance-network-settings";
export const COUNTRIES_NAMESPACE = "sq:countries:list";
export const SORTED_COUNTRIES_NAMESPACE = "sq:countries:sorted";
export const COUNTRIES_QUERY_NAMESPACE = "sq:countries:query";
export const CURRENCIES_NAMESPACE = "sq:currencies:list";
export const CURRENCIES_QUERY_NAMESPACE = "sq:currencies:query";
export const GET_USER = gql `
  query getUserTaxInfo {
    user: viewer {
      ... on User {
        id
        firstName
        lastName
        email
        countryCode
        customFields
        rewards(limit: 1000) {
          data {
            statuses
            partnerFundsTransfer {
              id
              status
              dateScheduled
              dateCreated
              dateTransferred
            }
          }
        }
        managedIdentity {
          uid
          email
          emailVerified
        }
        impactConnection {
          connected
          user {
            firstName
            lastName
          }
          publisher {
            id
            brandedSignup
            countryCode
            currency
            billingAddress
            billingCity
            billingState
            billingCountryCode
            billingPostalCode
            phoneNumberCountryCode
            phoneNumber
            taxInformation {
              indirectTaxId
              indirectTaxCountryCode
              indirectTaxRegion
              additionalTaxId
              withholdingTaxId
              withholdingTaxCountryCode
            }
            requiredTaxDocumentType
            currentTaxDocument {
              status
              type
              dateCreated
            }
            withdrawalSettings {
              paymentMethod
              paypalEmailAddress
              bankCountry
              bankAccountNumber
              paymentSchedulingType
              paymentThreshold
              paymentDay
            }
            payoutsAccount {
              hold
              holdReasons
              balance
            }
          }
        }
      }
    }
  }
`;
export const GET_COUNTRIES = gql `
  query getCountries {
    impactPayoutCountries(limit: 1000) {
      data {
        countryCode
        displayName
      }
    }
  }
`;
export const GET_CURRENCIES = gql `
  query currencies($locale: RSLocale) {
    currencies(limit: 300) {
      data {
        displayName(locale: $locale)
        currencyCode
      }
    }
  }
`;
export const GET_FINANCE_NETWORK_SETTINGS = gql `
  query impactFinanceNetworkSettings(
    $filter: ImpactFinanceNetworkSettingsFilterInput
  ) {
    impactFinanceNetworkSettings(filter: $filter, limit: 1000) {
      data {
        countryCode
        currency
        defaultFinancePaymentMethodId
        thresholdOptions
        withdrawalSettingId
        internationalEftFee
        foreignFxFee
        defaultFxFee
      }
      totalCount
    }
  }
`;
export const FORM_STEPS = 4;
