UNPKG

@accounter/gmail-listener

Version:

[DEPRECATED — superseded by @accounter/email-ingestion-gateway] A Gmail listener that listens for new emails, extracts financial documents, and sends them to the server

12,824 lines • 359 kB
// src/index.ts
import { timingSafeEqual } from "crypto";
import { createServer } from "http";

// src/environment.ts
import { config as dotenv } from "dotenv";
import zod from "zod";
dotenv({ path: [`.env`, `../../.env`] });
var AuthorizationModel = zod.object({
  GMAIL_LISTENER_API_KEY: zod.string()
});
var GmailModel = zod.object({
  GMAIL_CLIENT_ID: zod.string(),
  GMAIL_CLIENT_SECRET: zod.string(),
  GMAIL_REFRESH_TOKEN: zod.string(),
  GMAIL_LABEL_PATH: zod.string().optional(),
  GOOGLE_CLOUD_PROJECT_ID: zod.string(),
  GOOGLE_APPLICATION_CREDENTIALS: zod.string(),
  PUBSUB_TOPIC: zod.string().optional(),
  PUBSUB_SUBSCRIPTION: zod.string().optional()
});
var GeneralModel = zod.object({
  SERVER_URL: zod.url(),
  PORT: zod.coerce.number().optional().default(3e3)
});
var configs = {
  authorization: AuthorizationModel.safeParse(process.env),
  gmail: GmailModel.safeParse(process.env),
  general: GeneralModel.safeParse(process.env)
};
var environmentErrors = [];
for (const config of Object.values(configs)) {
  if (config.success === false) {
    environmentErrors.push(JSON.stringify(config.error.format(), null, 4));
  }
}
if (environmentErrors.length) {
  const fullError = environmentErrors.join(`
`);
  console.error("[env] Invalid environment variables:", fullError);
  process.exit(1);
}
function extractConfig(config) {
  if (!config.success) {
    throw new Error("Something went wrong.");
  }
  return config.data;
}
var authorization = extractConfig(configs.authorization);
var gmail = extractConfig(configs.gmail);
var general = extractConfig(configs.general);
var env = {
  authorization: {
    apiKey: authorization.GMAIL_LISTENER_API_KEY
  },
  gmail: {
    clientId: gmail.GMAIL_CLIENT_ID,
    clientSecret: gmail.GMAIL_CLIENT_SECRET,
    refreshToken: gmail.GMAIL_REFRESH_TOKEN,
    labelPath: gmail.GMAIL_LABEL_PATH?.replace(/\/$/, "") || "accounter/documents",
    // Default label if not specified
    cloudProjectId: gmail.GOOGLE_CLOUD_PROJECT_ID,
    appCredentials: gmail.GOOGLE_APPLICATION_CREDENTIALS,
    topicName: gmail.PUBSUB_TOPIC || "gmail-notifications",
    subscriptionName: gmail.PUBSUB_SUBSCRIPTION || "gmail-notifications-sub"
  },
  general: {
    serverUrl: general.SERVER_URL,
    port: general.PORT
  }
};

// src/gmail-service.ts
import { google as google2 } from "googleapis";
import inlineCss from "inline-css";
import { chromium } from "playwright";

// src/server-requests.ts
import { fetch as fetch2, FormData } from "@whatwg-node/fetch";

// src/gql/graphql.ts
var TypedDocumentString = class extends String {
  __apiType;
  value;
  __meta__;
  constructor(value, __meta__) {
    super(value);
    this.value = value;
    this.__meta__ = __meta__;
  }
  toString() {
    return this.value;
  }
};
var DepositTransactionFieldsFragmentDoc = new TypedDocumentString(`
    fragment DepositTransactionFields on Transaction {
  id
  eventDate
  chargeId
  amount {
    raw
    formatted
    currency
  }
  debitExchangeRates {
    aud
    cad
    eur
    gbp
    jpy
    sek
    usd
    date
  }
  eventExchangeRates {
    aud
    cad
    eur
    gbp
    jpy
    sek
    usd
    date
  }
}
    `, { "fragmentName": "DepositTransactionFields" });
var BusinessTripsRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripsRowFields on BusinessTrip {
  id
  name
  accountantApproval
}
    `, { "fragmentName": "BusinessTripsRowFields" });
var ClientIntegrationsSectionFragmentDoc = new TypedDocumentString(`
    fragment ClientIntegrationsSection on LtdFinancialEntity {
  id
  clientInfo {
    id
    integrations {
      id
      greenInvoiceInfo {
        businessId
        greenInvoiceId
      }
      hiveId
      linearId
      slackChannelKey
      notionId
      workflowyUrl
    }
  }
}
    `, { "fragmentName": "ClientIntegrationsSection" });
var BusinessHeaderFragmentDoc = new TypedDocumentString(`
    fragment BusinessHeader on Business {
  __typename
  id
  name
  createdAt
  isActive
  ... on LtdFinancialEntity {
    governmentId
    adminInfo {
      id
    }
    clientInfo {
      id
    }
  }
}
    `, { "fragmentName": "BusinessHeader" });
var BusinessContactSectionFragmentDoc = new TypedDocumentString(`
    fragment BusinessContactSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    name
    hebrewName
    country {
      id
      code
    }
    governmentId
    address
    city
    zipCode
    email
    phoneNumber
    website
    clientInfo {
      id
      emails
    }
  }
}
    `, { "fragmentName": "BusinessContactSection" });
var BusinessConfigurationSectionFragmentDoc = new TypedDocumentString(`
    fragment BusinessConfigurationSection on Business {
  __typename
  id
  pcn874RecordType
  irsCode
  isActive
  ownerId
  ... on LtdFinancialEntity {
    optionalVAT
    exemptDealer
    isReceiptEnough
    isDocumentsOptional
    sortCode {
      id
      key
      defaultIrsCode
    }
    taxCategory {
      id
    }
    suggestions {
      phrases
      emails
      tags {
        id
      }
      description
      emailListener {
        internalEmailLinks
        emailBody
        attachments
      }
    }
    clientInfo {
      id
    }
  }
}
    `, { "fragmentName": "BusinessConfigurationSection" });
var BusinessAdminSectionFragmentDoc = new TypedDocumentString(`
    fragment BusinessAdminSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    adminInfo {
      id
      registrationDate
      withholdingTaxAnnualIds {
        id
        year
      }
      withholdingTaxCompanyId
      socialSecurityEmployerIds {
        id
        year
      }
      socialSecurityDeductionsId
      taxAdvancesAnnualIds {
        id
        year
      }
      taxAdvancesRates {
        date
        rate
      }
    }
  }
}
    `, { "fragmentName": "BusinessAdminSection" });
var BusinessPageFragmentDoc = new TypedDocumentString(`
    fragment BusinessPage on Business {
  id
  ... on LtdFinancialEntity {
    clientInfo {
      id
    }
    adminInfo {
      id
    }
  }
  ...ClientIntegrationsSection
  ...BusinessHeader
  ...BusinessContactSection
  ...BusinessConfigurationSection
  ...BusinessAdminSection
}
    fragment BusinessAdminSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    adminInfo {
      id
      registrationDate
      withholdingTaxAnnualIds {
        id
        year
      }
      withholdingTaxCompanyId
      socialSecurityEmployerIds {
        id
        year
      }
      socialSecurityDeductionsId
      taxAdvancesAnnualIds {
        id
        year
      }
      taxAdvancesRates {
        date
        rate
      }
    }
  }
}
fragment BusinessHeader on Business {
  __typename
  id
  name
  createdAt
  isActive
  ... on LtdFinancialEntity {
    governmentId
    adminInfo {
      id
    }
    clientInfo {
      id
    }
  }
}
fragment ClientIntegrationsSection on LtdFinancialEntity {
  id
  clientInfo {
    id
    integrations {
      id
      greenInvoiceInfo {
        businessId
        greenInvoiceId
      }
      hiveId
      linearId
      slackChannelKey
      notionId
      workflowyUrl
    }
  }
}
fragment BusinessConfigurationSection on Business {
  __typename
  id
  pcn874RecordType
  irsCode
  isActive
  ownerId
  ... on LtdFinancialEntity {
    optionalVAT
    exemptDealer
    isReceiptEnough
    isDocumentsOptional
    sortCode {
      id
      key
      defaultIrsCode
    }
    taxCategory {
      id
    }
    suggestions {
      phrases
      emails
      tags {
        id
      }
      description
      emailListener {
        internalEmailLinks
        emailBody
        attachments
      }
    }
    clientInfo {
      id
    }
  }
}
fragment BusinessContactSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    name
    hebrewName
    country {
      id
      code
    }
    governmentId
    address
    city
    zipCode
    email
    phoneNumber
    website
    clientInfo {
      id
      emails
    }
  }
}`, { "fragmentName": "BusinessPage" });
var ChargeMatchesTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeMatchesTableFields on ChargeMatch {
  charge {
    id
    __typename
    minEventDate
    minDebitDate
    minDocumentsDate
    totalAmount {
      raw
      formatted
    }
    vat {
      raw
      formatted
    }
    counterparty {
      name
      id
    }
    userDescription
    tags {
      id
      name
      namePath
    }
    taxCategory {
      id
      name
    }
  }
  confidenceScore
}
    `, { "fragmentName": "ChargeMatchesTableFields" });
var ChargeMatchCardFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeMatchCardFields on Charge {
  __typename
  id
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    formatted
    currency
  }
  counterparty {
    id
    name
  }
  userDescription
  additionalDocuments {
    id
    documentType
    image
    file
  }
  transactions {
    id
    eventDate
    sourceDescription
    amount {
      raw
      formatted
    }
  }
  miscExpenses {
    id
    description
    amount {
      formatted
    }
  }
}
    `, { "fragmentName": "ChargeMatchCardFields" });
var DocumentsGalleryFieldsFragmentDoc = new TypedDocumentString(`
    fragment DocumentsGalleryFields on Charge {
  id
  additionalDocuments {
    id
    image
    ... on FinancialDocument {
      documentType
    }
  }
}
    `, { "fragmentName": "DocumentsGalleryFields" });
var TableDocumentsRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
    `, { "fragmentName": "TableDocumentsRowFields" });
var TableDocumentsFieldsFragmentDoc = new TypedDocumentString(`
    fragment TableDocumentsFields on Charge {
  id
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
}
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}`, { "fragmentName": "TableDocumentsFields" });
var LedgerRecordsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
    `, { "fragmentName": "LedgerRecordsTableFields" });
var ChargeLedgerRecordsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeLedgerRecordsTableFields on Charge {
  id
  ledger {
    __typename
    records {
      id
      ...LedgerRecordsTableFields
    }
    ... on Ledger @defer {
      validate {
        ... on LedgerValidation @defer {
          matches
          differences {
            id
            ...LedgerRecordsTableFields
          }
        }
      }
    }
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}`, { "fragmentName": "ChargeLedgerRecordsTableFields" });
var TransactionForTransactionsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
    `, { "fragmentName": "TransactionForTransactionsTableFields" });
var ChargeTableTransactionsFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeTableTransactionsFields on Charge {
  id
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
}
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`, { "fragmentName": "ChargeTableTransactionsFields" });
var ConversionChargeInfoFragmentDoc = new TypedDocumentString(`
    fragment ConversionChargeInfo on Charge {
  id
  __typename
  ... on ConversionCharge {
    eventRate {
      from
      to
      rate
    }
    officialRate {
      from
      to
      rate
    }
  }
}
    `, { "fragmentName": "ConversionChargeInfo" });
var CreditcardBankChargeInfoFragmentDoc = new TypedDocumentString(`
    fragment CreditcardBankChargeInfo on Charge {
  id
  __typename
  ... on CreditcardBankCharge {
    creditCardTransactions {
      id
      ...TransactionForTransactionsTableFields
    }
  }
}
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`, { "fragmentName": "CreditcardBankChargeInfo" });
var TableSalariesFieldsFragmentDoc = new TypedDocumentString(`
    fragment TableSalariesFields on Charge {
  id
  __typename
  ... on SalaryCharge {
    salaryRecords {
      directAmount {
        formatted
      }
      baseAmount {
        formatted
      }
      employee {
        id
        name
      }
      pensionFund {
        id
        name
      }
      pensionEmployeeAmount {
        formatted
      }
      pensionEmployerAmount {
        formatted
      }
      compensationsAmount {
        formatted
      }
      trainingFund {
        id
        name
      }
      trainingFundEmployeeAmount {
        formatted
      }
      trainingFundEmployerAmount {
        formatted
      }
      socialSecurityEmployeeAmount {
        formatted
      }
      socialSecurityEmployerAmount {
        formatted
      }
      incomeTaxAmount {
        formatted
      }
      healthInsuranceAmount {
        formatted
      }
    }
  }
}
    `, { "fragmentName": "TableSalariesFields" });
var BusinessTripAccountantApprovalFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
    `, { "fragmentName": "BusinessTripAccountantApprovalFields" });
var BusinessTripReportHeaderFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
    fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}`, { "fragmentName": "BusinessTripReportHeaderFields" });
var BusinessTripReportSummaryFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}
    `, { "fragmentName": "BusinessTripReportSummaryFields" });
var BusinessTripReportFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportFields on BusinessTrip {
  id
  ...BusinessTripReportHeaderFields
  ...BusinessTripReportSummaryFields
}
    fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}`, { "fragmentName": "BusinessTripReportFields" });
var ChargesTableErrorsFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargesTableErrorsFields on Charge {
  id
  errorsLedger: ledger {
    validate {
      errors
    }
  }
}
    `, { "fragmentName": "ChargesTableErrorsFields" });
var EditMiscExpenseFieldsFragmentDoc = new TypedDocumentString(`
    fragment EditMiscExpenseFields on MiscExpense {
  id
  amount {
    raw
    currency
  }
  description
  invoiceDate
  valueDate
  creditor {
    id
  }
  debtor {
    id
  }
}
    `, { "fragmentName": "EditMiscExpenseFields" });
var TableMiscExpensesFieldsFragmentDoc = new TypedDocumentString(`
    fragment TableMiscExpensesFields on Charge {
  id
  miscExpenses {
    id
    amount {
      formatted
    }
    description
    invoiceDate
    valueDate
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    chargeId
    ...EditMiscExpenseFields
  }
}
    fragment EditMiscExpenseFields on MiscExpense {
  id
  amount {
    raw
    currency
  }
  description
  invoiceDate
  valueDate
  creditor {
    id
  }
  debtor {
    id
  }
}`, { "fragmentName": "TableMiscExpensesFields" });
var ExchangeRatesInfoFragmentDoc = new TypedDocumentString(`
    fragment ExchangeRatesInfo on Charge {
  id
  __typename
  ... on FinancialCharge {
    exchangeRates {
      aud
      cad
      eur
      gbp
      ils
      jpy
      sek
      usd
      eth
      grt
      usdc
    }
  }
}
    `, { "fragmentName": "ExchangeRatesInfo" });
var ChargeExpansionFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeExpansionFields on Charge {
  id
  __typename
  metadata {
    transactionsCount
    documentsCount
    receiptsCount
    invoicesCount
    ledgerCount
    miscExpensesCount
    isLedgerLocked
    openDocuments
  }
  totalAmount {
    raw
  }
  ...DocumentsGalleryFields @defer
  ...TableDocumentsFields @defer
  ...ChargeLedgerRecordsTableFields @defer
  ...ChargeTableTransactionsFields @defer
  ...ConversionChargeInfo @defer
  ...CreditcardBankChargeInfo @defer
  ...TableSalariesFields @defer
  ... on BusinessTripCharge {
    businessTrip {
      id
      ...BusinessTripReportFields
    }
  }
  ...ChargesTableErrorsFields @defer
  ...TableMiscExpensesFields @defer
  ...ExchangeRatesInfo @defer
}
    fragment ChargesTableErrorsFields on Charge {
  id
  errorsLedger: ledger {
    validate {
      errors
    }
  }
}
fragment TableDocumentsFields on Charge {
  id
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
}
fragment ChargeLedgerRecordsTableFields on Charge {
  id
  ledger {
    __typename
    records {
      id
      ...LedgerRecordsTableFields
    }
    ... on Ledger @defer {
      validate {
        ... on LedgerValidation @defer {
          matches
          differences {
            id
            ...LedgerRecordsTableFields
          }
        }
      }
    }
  }
}
fragment ChargeTableTransactionsFields on Charge {
  id
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
}
fragment ConversionChargeInfo on Charge {
  id
  __typename
  ... on ConversionCharge {
    eventRate {
      from
      to
      rate
    }
    officialRate {
      from
      to
      rate
    }
  }
}
fragment CreditcardBankChargeInfo on Charge {
  id
  __typename
  ... on CreditcardBankCharge {
    creditCardTransactions {
      id
      ...TransactionForTransactionsTableFields
    }
  }
}
fragment ExchangeRatesInfo on Charge {
  id
  __typename
  ... on FinancialCharge {
    exchangeRates {
      aud
      cad
      eur
      gbp
      ils
      jpy
      sek
      usd
      eth
      grt
      usdc
    }
  }
}
fragment TableMiscExpensesFields on Charge {
  id
  miscExpenses {
    id
    amount {
      formatted
    }
    description
    invoiceDate
    valueDate
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    chargeId
    ...EditMiscExpenseFields
  }
}
fragment TableSalariesFields on Charge {
  id
  __typename
  ... on SalaryCharge {
    salaryRecords {
      directAmount {
        formatted
      }
      baseAmount {
        formatted
      }
      employee {
        id
        name
      }
      pensionFund {
        id
        name
      }
      pensionEmployeeAmount {
        formatted
      }
      pensionEmployerAmount {
        formatted
      }
      compensationsAmount {
        formatted
      }
      trainingFund {
        id
        name
      }
      trainingFundEmployeeAmount {
        formatted
      }
      trainingFundEmployerAmount {
        formatted
      }
      socialSecurityEmployeeAmount {
        formatted
      }
      socialSecurityEmployerAmount {
        formatted
      }
      incomeTaxAmount {
        formatted
      }
      healthInsuranceAmount {
        formatted
      }
    }
  }
}
fragment BusinessTripReportFields on BusinessTrip {
  id
  ...BusinessTripReportHeaderFields
  ...BusinessTripReportSummaryFields
}
fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}
fragment EditMiscExpenseFields on MiscExpense {
  id
  amount {
    raw
    currency
  }
  description
  invoiceDate
  valueDate
  creditor {
    id
  }
  debtor {
    id
  }
}
fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment DocumentsGalleryFields on Charge {
  id
  additionalDocuments {
    id
    image
    ... on FinancialDocument {
      documentType
    }
  }
}
fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`, { "fragmentName": "ChargeExpansionFields", "deferredFields": { "DocumentsGalleryFields": ["id", "additionalDocuments"], "TableDocumentsFields": ["id", "additionalDocuments"], "ChargeLedgerRecordsTableFields": ["id", "ledger"], "ChargeTableTransactionsFields": ["id", "transactions"], "ConversionChargeInfo": ["id", "__typename"], "CreditcardBankChargeInfo": ["id", "__typename"], "TableSalariesFields": ["id", "__typename"], "ChargesTableErrorsFields": ["id", "ledger"], "TableMiscExpensesFields": ["id", "miscExpenses"], "ExchangeRatesInfo": ["id", "__typename"] } });
var ChargeForCsvExportFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeForCsvExportFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    id
    name
  }
  userDescription
  tags {
    id
    name
  }
  taxCategory {
    id
    name
  }
  accountantApproval
  validationData {
    isValid
    missingInfo
  }
  missingInfoSuggestions {
    description
    tags {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    invoicesCount
    receiptsCount
    ledgerCount
    miscExpensesCount
    openDocuments
    invalidLedger
  }
  ledger {
    balance {
      isBalanced
    }
    validate {
      isValid
      errors
    }
  }
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
}
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`, { "fragmentName": "ChargeForCsvExportFields" });
var MonthlyIncomeExpenseChartInfoFragmentDoc = new TypedDocumentString(`
    fragment MonthlyIncomeExpenseChartInfo on IncomeExpenseChart {
  monthlyData {
    income {
      formatted
      raw
    }
    expense {
      formatted
      raw
    }
    balance {
      formatted
      raw
    }
    date
  }
}
    `, { "fragmentName": "MonthlyIncomeExpenseChartInfo" });
var BusinessTripReportCoreExpenseRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
    `, { "fragmentName": "BusinessTripReportCoreExpenseRowFields" });
var BusinessTripReportAccommodationsRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportAccommodationsRowFields" });
var BusinessTripReportAccommodationsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {
  id
  date
  ...BusinessTripReportAccommodationsRowFields
}
    fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportAccommodationsTableFields" });
var BusinessTripReportAccommodationsFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportAccommodationsFields on BusinessTrip {
  id
  accommodationExpenses {
    id
    ...BusinessTripReportAccommodationsTableFields
  }
}
    fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {
  id
  date
  ...BusinessTripReportAccommodationsRowFields
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportAccommodationsFields" });
var BusinessTripReportFlightsRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportFlightsRowFields" });
var BusinessTripReportFlightsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {
  id
  date
  ...BusinessTripReportFlightsRowFields
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}`, { "fragmentName": "BusinessTripReportFlightsTableFields" });
var BusinessTripReportAttendeeRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportAttendeeRowFields on BusinessTripAttendee {
  id
  name
  arrivalDate
  departureDate
  flights {
    id
    ...BusinessTripReportFlightsTableFields
  }
  accommodations {
    id
    ...BusinessTripReportAccommodationsTableFields
  }
}
    fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {
  id
  date
  ...BusinessTripReportAccommodationsRowFields
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}
fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {
  id
  date
  ...BusinessTripReportFlightsRowFields
}`, { "fragmentName": "BusinessTripReportAttendeeRowFields" });
var BusinessTripReportAttendeesFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportAttendeesFields on BusinessTrip {
  id
  attendees {
    id
    name
    ...BusinessTripReportAttendeeRowFields
  }
}
    fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {
  id
  date
  ...BusinessTripReportAccommodationsRowFields
}
fragment BusinessTripReportAttendeeRowFields on BusinessTripAttendee {
  id
  name
  arrivalDate
  departureDate
  flights {
    id
    ...BusinessTripReportFlightsTableFields
  }
  accommodations {
    id
    ...BusinessTripReportAccommodationsTableFields
  }
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}
fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {
  id
  date
  ...BusinessTripReportFlightsRowFields
}`, { "fragmentName": "BusinessTripReportAttendeesFields" });
var BusinessTripReportCarRentalRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportCarRentalRowFields on BusinessTripCarRentalExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  days
  isFuelExpense
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportCarRentalRowFields" });
var BusinessTripReportCarRentalFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportCarRentalFields on BusinessTrip {
  id
  carRentalExpenses {
    id
    date
    ...BusinessTripReportCarRentalRowFields
  }
}
    fragment BusinessTripReportCarRentalRowFields on BusinessTripCarRentalExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  days
  isFuelExpense
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportCarRentalFields" });
var BusinessTripReportFlightsFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportFlightsFields on BusinessTrip {
  id
  flightExpenses {
    id
    ...BusinessTripReportFlightsTableFields
  }
  attendees {
    id
    name
  }
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}
fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {
  id
  date
  ...BusinessTripReportFlightsRowFields
}`, { "fragmentName": "BusinessTripReportFlightsFields" });
var BusinessTripReportOtherRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportOtherRowFields on BusinessTripOtherExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  description
  deductibleExpense
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportOtherRowFields" });
var BusinessTripReportOtherFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportOtherFields on BusinessTrip {
  id
  otherExpenses {
    id
    date
    ...BusinessTripReportOtherRowFields
  }
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportOtherRowFields on BusinessTripOtherExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  description
  deductibleExpense
}`, { "fragmentName": "BusinessTripReportOtherFields" });
var BusinessTripReportTravelAndSubsistenceRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportTravelAndSubsistenceRowFields on BusinessTripTravelAndSubsistenceExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  expenseType
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}`, { "fragmentName": "BusinessTripReportTravelAndSubsistenceRowFields" });
var BusinessTripReportTravelAndSubsistenceFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripReportTravelAndSubsistenceFields on BusinessTrip {
  id
  travelAndSubsistenceExpenses {
    id
    date
    ...BusinessTripReportTravelAndSubsistenceRowFields
  }
}
    fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportTravelAndSubsistenceRowFields on BusinessTripTravelAndSubsistenceExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  expenseType
}`, { "fragmentName": "BusinessTripReportTravelAndSubsistenceFields" });
var TransactionsTableEventDateFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableEventDateFields on Transaction {
  id
  eventDate
}
    `, { "fragmentName": "TransactionsTableEventDateFields" });
var TransactionsTableDebitDateFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableDebitDateFields on Transaction {
  id
  effectiveDate
  sourceEffectiveDate
}
    `, { "fragmentName": "TransactionsTableDebitDateFields" });
var TransactionsTableAccountFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableAccountFields on Transaction {
  id
  account {
    id
    name
    type
  }
}
    `, { "fragmentName": "TransactionsTableAccountFields" });
var TransactionsTableDescriptionFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableDescriptionFields on Transaction {
  id
  sourceDescription
}
    `, { "fragmentName": "TransactionsTableDescriptionFields" });
var TransactionsTableSourceIdFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableSourceIDFields on Transaction {
  id
  referenceKey
}
    `, { "fragmentName": "TransactionsTableSourceIDFields" });
var TransactionsTableEntityFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionsTableEntityFields on Transaction {
  id
  counterparty {
    name
    id
  }
  sourceDescription
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
    `, { "fragmentName": "TransactionsTableEntityFields" });
var UncategorizedTransactionsTableAmountFieldsFragmentDoc = new TypedDocumentString(`
    fragment UncategorizedTransactionsTableAmountFields on UncategorizedTransaction {
  transaction {
    id
    amount {
      raw
      formatted
    }
    cryptoExchangeRate {
      rate
    }
  }
  categorizedAmount {
    raw
    formatted
  }
  errors
}
    `, { "fragmentName": "UncategorizedTransactionsTableAmountFields" });
var BusinessTripUncategorizedTransactionsFieldsFragmentDoc = new TypedDocumentString(`
    fragment BusinessTripUncategorizedTransactionsFields on BusinessTrip {
  id
  uncategorizedTransactions {
    transaction {
      id
      eventDate
      chargeId
      amount {
        raw
      }
      ...TransactionsTableEventDateFields
      ...TransactionsTableDebitDateFields
      ...TransactionsTableAccountFields
      ...TransactionsTableDescriptionFields
      ...TransactionsTableSourceIDFields
      ...TransactionsTableEntityFields
    }
    ...UncategorizedTransactionsTableAmountFields
  }
}
    fragment UncategorizedTransactionsTableAmountFields on UncategorizedTransaction {
  transaction {
    id
    amount {
      raw
      formatted
    }
    cryptoExchangeRate {
      rate
    }
  }
  categorizedAmount {
    raw
    formatted
  }
  errors
}
fragment TransactionsTableAccountFields on Transaction {
  id
  account {
    id
    name
    type
  }
}
fragment TransactionsTableEntityFields on Transaction {
  id
  counterparty {
    name
    id
  }
  sourceDescription
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
fragment TransactionsTableDebitDateFields on Transaction {
  id
  effectiveDate
  sourceEffectiveDate
}
fragment TransactionsTableDescriptionFields on Transaction {
  id
  sourceDescription
}
fragment TransactionsTableEventDateFields on Transaction {
  id
  eventDate
}
fragment TransactionsTableSourceIDFields on Transaction {
  id
  referenceKey
}`, { "fragmentName": "BusinessTripUncategorizedTransactionsFields" });
var DepreciationRecordRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment DepreciationRecordRowFields on DepreciationRecord {
  id
  amount {
    currency
    formatted
    raw
  }
  activationDate
  category {
    id
    name
    percentage
  }
  type
  charge {
    id
    totalAmount {
      currency
      formatted
      raw
    }
  }
}
    `, { "fragmentName": "DepreciationRecordRowFields" });
var EditTagFieldsFragmentDoc = new TypedDocumentString(`
    fragment EditTagFields on Tag {
  id
  name
  parent {
    id
    name
  }
}
    `, { "fragmentName": "EditTagFields" });
var IssueDocumentClientFieldsFragmentDoc = new TypedDocumentString(`
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
    `, { "fragmentName": "IssueDocumentClientFields" });
var NewDocumentDraftFragmentDoc = new TypedDocumentString(`
    fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}`, { "fragmentName": "NewDocumentDraft" });
var SimilarChargesTableFragmentDoc = new TypedDocumentString(`
    fragment SimilarChargesTable on Charge {
  id
  __typename
  counterparty {
    name
    id
  }
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    formatted
  }
  vat {
    raw
    formatted
  }
  userDescription
  tags {
    id
    name
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
  }
}
    `, { "fragmentName": "SimilarChargesTable" });
var NewFetchedDocumentFieldsFragmentDoc = new TypedDocumentString(`
    fragment NewFetchedDocumentFields on Document {
  id
  documentType
  charge {
    id
    userDescription
    counterparty {
      id
      name
    }
  }
}
    `, { "fragmentName": "NewFetchedDocumentFields" });
var ContractForContractsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ContractForContractsTableFields on Contract {
  id
  isActive
  client {
    id
    originalBusiness {
      id
      name
    }
  }
  purchaseOrders
  startDate
  endDate
  amount {
    raw
    formatted
  }
  billingCycle
  product
  plan
  operationsLimit
  msCloud
}
    `, { "fragmentName": "ContractForContractsTableFields" });
var CorporateTaxRulingReportRuleCellFieldsFragmentDoc = new TypedDocumentString(`
    fragment CorporateTaxRulingReportRuleCellFields on CorporateTaxRule {
  id
  rule
  percentage {
    formatted
  }
  isCompliant
}
    `, { "fragmentName": "CorporateTaxRulingReportRuleCellFields" });
var ReportSubCommentaryTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ReportSubCommentaryTableFields on ReportCommentarySubRecord {
  financialEntity {
    id
    name
  }
  amount {
    formatted
  }
  ledgerRecords {
    ...LedgerRecordsTableFields
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}`, { "fragmentName": "ReportSubCommentaryTableFields" });
var ReportCommentaryTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ReportCommentaryTableFields on ReportCommentary {
  records {
    sortCode {
      id
      key
      name
    }
    amount {
      formatted
    }
    records {
      ...ReportSubCommentaryTableFields
    }
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment ReportSubCommentaryTableFields on ReportCommentarySubRecord {
  financialEntity {
    id
    name
  }
  amount {
    formatted
  }
  ledgerRecords {
    ...LedgerRecordsTableFields
  }
}`, { "fragmentName": "ReportCommentaryTableFields" });
var TrialBalanceTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment TrialBalanceTableFields on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {
  businessTransactionsSum {
    business {
      id
      name
      sortCode {
        id
        key
        name
      }
    }
    credit {
      formatted
      raw
    }
    debit {
      formatted
      raw
    }
    total {
      formatted
      raw
    }
  }
}
    `, { "fragmentName": "TrialBalanceTableFields" });
var ChargesTableSuggestionsFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
    `, { "fragmentName": "ChargesTableSuggestionsFields" });
var ChargeForChargesTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}`, { "fragmentName": "ChargeForChargesTableFields", "deferredFields": { "ChargesTableSuggestionsFields": ["id", "missingInfoSuggestions"] } });
var VatReportBusinessTripsFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportBusinessTripsFields on VatReportResult {
  businessTrips {
    id
    ...ChargeForChargesTableFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`, { "fragmentName": "VatReportBusinessTripsFields" });
var VatReportAccountantApprovalFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}
    `, { "fragmentName": "VatReportAccountantApprovalFields" });
var VatReportExpensesRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportExpensesRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  chargeId
  amount {
    formatted
    raw
  }
  localAmount {
    formatted
    raw
  }
  localVat {
    formatted
    raw
  }
  foreignVatAfterDeduction {
    formatted
    raw
  }
  localVatAfterDeduction {
    formatted
    raw
  }
  roundedLocalVatAfterDeduction {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}
    fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}`, { "fragmentName": "VatReportExpensesRowFields" });
var VatReportExpensesFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportExpensesFields on VatReportResult {
  expenses {
    ...VatReportExpensesRowFields
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}
    fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}
fragment VatReportExpensesRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  chargeId
  amount {
    formatted
    raw
  }
  localAmount {
    formatted
    raw
  }
  localVat {
    formatted
    raw
  }
  foreignVatAfterDeduction {
    formatted
    raw
  }
  localVatAfterDeduction {
    formatted
    raw
  }
  roundedLocalVatAfterDeduction {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}`, { "fragmentName": "VatReportExpensesFields" });
var VatReportIncomeRowFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportIncomeRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  chargeId
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  taxReducedForeignAmount {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}
    fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}`, { "fragmentName": "VatReportIncomeRowFields" });
var VatReportIncomeFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportIncomeFields on VatReportResult {
  income {
    ...VatReportIncomeRowFields
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}
    fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}
fragment VatReportIncomeRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  chargeId
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  taxReducedForeignAmount {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}`, { "fragmentName": "VatReportIncomeFields" });
var VatReportMiscTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportMiscTableFields on VatReportResult {
  differentMonthDoc {
    id
    ...ChargeForChargesTableFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`, { "fragmentName": "VatReportMiscTableFields" });
var VatReportMissingInfoFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportMissingInfoFields on VatReportResult {
  missingInfo {
    id
    ...ChargeForChargesTableFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`, { "fragmentName": "VatReportMissingInfoFields" });
var VatReportSummaryFieldsFragmentDoc = new TypedDocumentString(`
    fragment VatReportSummaryFields on VatReportResult {
  expenses {
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
    isProperty
  }
  income {
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}
    `, { "fragmentName": "VatReportSummaryFields" });
var LedgerCsvFieldsFragmentDoc = new TypedDocumentString(`
    fragment LedgerCsvFields on YearlyLedgerReport {
  id
  year
  financialEntitiesInfo {
    entity {
      id
      name
      sortCode {
        id
        key
      }
    }
    openingBalance {
      raw
    }
    totalCredit {
      raw
    }
    totalDebit {
      raw
    }
    closingBalance {
      raw
    }
    records {
      id
      amount {
        raw
        formatted
      }
      invoiceDate
      valueDate
      description
      reference
      counterParty {
        id
        name
      }
      balance
    }
  }
}
    `, { "fragmentName": "LedgerCsvFields" });
var SalariesRecordEmployeeFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordEmployeeFields on Salary {
  month
  employee {
    id
    name
  }
}
    `, { "fragmentName": "SalariesRecordEmployeeFields" });
var SalariesRecordMainSalaryFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordMainSalaryFields on Salary {
  month
  employee {
    id
  }
  baseAmount {
    formatted
  }
  directAmount {
    formatted
  }
  globalAdditionalHoursAmount {
    formatted
  }
  bonus {
    formatted
    raw
  }
  gift {
    formatted
    raw
  }
  recovery {
    formatted
    raw
  }
  vacationTakeout {
    formatted
    raw
  }
}
    `, { "fragmentName": "SalariesRecordMainSalaryFields" });
var SalariesRecordFundsFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordFundsFields on Salary {
  month
  employee {
    id
  }
  pensionFund {
    id
    name
  }
  pensionEmployeeAmount {
    formatted
    raw
  }
  pensionEmployeePercentage
  pensionEmployerAmount {
    formatted
    raw
  }
  pensionEmployerPercentage
  compensationsAmount {
    formatted
    raw
  }
  compensationsPercentage
  trainingFund {
    id
    name
  }
  trainingFundEmployeeAmount {
    formatted
    raw
  }
  trainingFundEmployeePercentage
  trainingFundEmployerAmount {
    formatted
    raw
  }
  trainingFundEmployerPercentage
}
    `, { "fragmentName": "SalariesRecordFundsFields" });
var SalariesRecordInsurancesAndTaxesFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordInsurancesAndTaxesFields on Salary {
  month
  employee {
    id
  }
  healthInsuranceAmount {
    formatted
    raw
  }
  socialSecurityEmployeeAmount {
    formatted
    raw
  }
  socialSecurityEmployerAmount {
    formatted
    raw
  }
  incomeTaxAmount {
    formatted
    raw
  }
  notionalExpense {
    formatted
    raw
  }
}
    `, { "fragmentName": "SalariesRecordInsurancesAndTaxesFields" });
var SalariesRecordWorkFrameFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordWorkFrameFields on Salary {
  month
  employee {
    id
  }
  vacationDays {
    added
    taken
    balance
  }
  workDays
  sicknessDays {
    balance
  }
}
    `, { "fragmentName": "SalariesRecordWorkFrameFields" });
var SalariesRecordFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesRecordFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordEmployeeFields
  ...SalariesRecordMainSalaryFields
  ...SalariesRecordFundsFields
  ...SalariesRecordInsurancesAndTaxesFields
  ...SalariesRecordWorkFrameFields
}
    fragment SalariesRecordEmployeeFields on Salary {
  month
  employee {
    id
    name
  }
}
fragment SalariesRecordFundsFields on Salary {
  month
  employee {
    id
  }
  pensionFund {
    id
    name
  }
  pensionEmployeeAmount {
    formatted
    raw
  }
  pensionEmployeePercentage
  pensionEmployerAmount {
    formatted
    raw
  }
  pensionEmployerPercentage
  compensationsAmount {
    formatted
    raw
  }
  compensationsPercentage
  trainingFund {
    id
    name
  }
  trainingFundEmployeeAmount {
    formatted
    raw
  }
  trainingFundEmployeePercentage
  trainingFundEmployerAmount {
    formatted
    raw
  }
  trainingFundEmployerPercentage
}
fragment SalariesRecordInsurancesAndTaxesFields on Salary {
  month
  employee {
    id
  }
  healthInsuranceAmount {
    formatted
    raw
  }
  socialSecurityEmployeeAmount {
    formatted
    raw
  }
  socialSecurityEmployerAmount {
    formatted
    raw
  }
  incomeTaxAmount {
    formatted
    raw
  }
  notionalExpense {
    formatted
    raw
  }
}
fragment SalariesRecordMainSalaryFields on Salary {
  month
  employee {
    id
  }
  baseAmount {
    formatted
  }
  directAmount {
    formatted
  }
  globalAdditionalHoursAmount {
    formatted
  }
  bonus {
    formatted
    raw
  }
  gift {
    formatted
    raw
  }
  recovery {
    formatted
    raw
  }
  vacationTakeout {
    formatted
    raw
  }
}
fragment SalariesRecordWorkFrameFields on Salary {
  month
  employee {
    id
  }
  vacationDays {
    added
    taken
    balance
  }
  workDays
  sicknessDays {
    balance
  }
}`, { "fragmentName": "SalariesRecordFields" });
var SalariesMonthFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesMonthFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordFields
}
    fragment SalariesRecordEmployeeFields on Salary {
  month
  employee {
    id
    name
  }
}
fragment SalariesRecordFundsFields on Salary {
  month
  employee {
    id
  }
  pensionFund {
    id
    name
  }
  pensionEmployeeAmount {
    formatted
    raw
  }
  pensionEmployeePercentage
  pensionEmployerAmount {
    formatted
    raw
  }
  pensionEmployerPercentage
  compensationsAmount {
    formatted
    raw
  }
  compensationsPercentage
  trainingFund {
    id
    name
  }
  trainingFundEmployeeAmount {
    formatted
    raw
  }
  trainingFundEmployeePercentage
  trainingFundEmployerAmount {
    formatted
    raw
  }
  trainingFundEmployerPercentage
}
fragment SalariesRecordInsurancesAndTaxesFields on Salary {
  month
  employee {
    id
  }
  healthInsuranceAmount {
    formatted
    raw
  }
  socialSecurityEmployeeAmount {
    formatted
    raw
  }
  socialSecurityEmployerAmount {
    formatted
    raw
  }
  incomeTaxAmount {
    formatted
    raw
  }
  notionalExpense {
    formatted
    raw
  }
}
fragment SalariesRecordMainSalaryFields on Salary {
  month
  employee {
    id
  }
  baseAmount {
    formatted
  }
  directAmount {
    formatted
  }
  globalAdditionalHoursAmount {
    formatted
  }
  bonus {
    formatted
    raw
  }
  gift {
    formatted
    raw
  }
  recovery {
    formatted
    raw
  }
  vacationTakeout {
    formatted
    raw
  }
}
fragment SalariesRecordWorkFrameFields on Salary {
  month
  employee {
    id
  }
  vacationDays {
    added
    taken
    balance
  }
  workDays
  sicknessDays {
    balance
  }
}
fragment SalariesRecordFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordEmployeeFields
  ...SalariesRecordMainSalaryFields
  ...SalariesRecordFundsFields
  ...SalariesRecordInsurancesAndTaxesFields
  ...SalariesRecordWorkFrameFields
}`, { "fragmentName": "SalariesMonthFields" });
var SalariesTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment SalariesTableFields on Salary {
  month
  employee {
    id
  }
  ...SalariesMonthFields
}
    fragment SalariesRecordEmployeeFields on Salary {
  month
  employee {
    id
    name
  }
}
fragment SalariesRecordFundsFields on Salary {
  month
  employee {
    id
  }
  pensionFund {
    id
    name
  }
  pensionEmployeeAmount {
    formatted
    raw
  }
  pensionEmployeePercentage
  pensionEmployerAmount {
    formatted
    raw
  }
  pensionEmployerPercentage
  compensationsAmount {
    formatted
    raw
  }
  compensationsPercentage
  trainingFund {
    id
    name
  }
  trainingFundEmployeeAmount {
    formatted
    raw
  }
  trainingFundEmployeePercentage
  trainingFundEmployerAmount {
    formatted
    raw
  }
  trainingFundEmployerPercentage
}
fragment SalariesRecordInsurancesAndTaxesFields on Salary {
  month
  employee {
    id
  }
  healthInsuranceAmount {
    formatted
    raw
  }
  socialSecurityEmployeeAmount {
    formatted
    raw
  }
  socialSecurityEmployerAmount {
    formatted
    raw
  }
  incomeTaxAmount {
    formatted
    raw
  }
  notionalExpense {
    formatted
    raw
  }
}
fragment SalariesRecordMainSalaryFields on Salary {
  month
  employee {
    id
  }
  baseAmount {
    formatted
  }
  directAmount {
    formatted
  }
  globalAdditionalHoursAmount {
    formatted
  }
  bonus {
    formatted
    raw
  }
  gift {
    formatted
    raw
  }
  recovery {
    formatted
    raw
  }
  vacationTakeout {
    formatted
    raw
  }
}
fragment SalariesRecordWorkFrameFields on Salary {
  month
  employee {
    id
  }
  vacationDays {
    added
    taken
    balance
  }
  workDays
  sicknessDays {
    balance
  }
}
fragment SalariesMonthFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordFields
}
fragment SalariesRecordFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordEmployeeFields
  ...SalariesRecordMainSalaryFields
  ...SalariesRecordFundsFields
  ...SalariesRecordInsurancesAndTaxesFields
  ...SalariesRecordWorkFrameFields
}`, { "fragmentName": "SalariesTableFields" });
var AnnualRevenueReportRecordFragmentDoc = new TypedDocumentString(`
    fragment AnnualRevenueReportRecord on AnnualRevenueReportClientRecord {
  id
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  revenueOriginal {
    raw
    formatted
    currency
  }
  chargeId
  date
  description
  reference
}
    `, { "fragmentName": "AnnualRevenueReportRecord" });
var AnnualRevenueReportClientFragmentDoc = new TypedDocumentString(`
    fragment AnnualRevenueReportClient on AnnualRevenueReportCountryClient {
  id
  name
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  records {
    id
    date
    ...AnnualRevenueReportRecord
  }
}
    fragment AnnualRevenueReportRecord on AnnualRevenueReportClientRecord {
  id
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  revenueOriginal {
    raw
    formatted
    currency
  }
  chargeId
  date
  description
  reference
}`, { "fragmentName": "AnnualRevenueReportClient" });
var AnnualRevenueReportCountryFragmentDoc = new TypedDocumentString(`
    fragment AnnualRevenueReportCountry on AnnualRevenueReportCountry {
  id
  code
  name
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  clients {
    id
    revenueDefaultForeign {
      raw
    }
    ...AnnualRevenueReportClient
  }
}
    fragment AnnualRevenueReportClient on AnnualRevenueReportCountryClient {
  id
  name
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  records {
    id
    date
    ...AnnualRevenueReportRecord
  }
}
fragment AnnualRevenueReportRecord on AnnualRevenueReportClientRecord {
  id
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  revenueOriginal {
    raw
    formatted
    currency
  }
  chargeId
  date
  description
  reference
}`, { "fragmentName": "AnnualRevenueReportCountry" });
var DepreciationReportRecordCoreFragmentDoc = new TypedDocumentString(`
    fragment DepreciationReportRecordCore on DepreciationCoreRecord {
  id
  originalCost
  reportYearDelta
  totalDepreciableCosts
  reportYearClaimedDepreciation
  pastYearsAccumulatedDepreciation
  totalDepreciation
  netValue
}
    `, { "fragmentName": "DepreciationReportRecordCore" });
var Shaam6111DataContentHeaderBusinessFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContentHeaderBusiness on Business {
  id
  name
}
    `, { "fragmentName": "Shaam6111DataContentHeaderBusiness" });
var Shaam6111DataContentHeaderFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContentHeader on Shaam6111Data {
  id
  header {
    taxYear
    businessDescription
    taxFileNumber
    idNumber
    vatFileNumber
    withholdingTaxFileNumber
    businessType
    reportingMethod
    currencyType
    amountsInThousands
    accountingMethod
    accountingSystem
    softwareRegistrationNumber
    isPartnership
    partnershipCount
    partnershipProfitShare
    ifrsImplementationYear
    ifrsReportingOption
    includesProfitLoss
    includesTaxAdjustment
    includesBalanceSheet
    industryCode
    auditOpinionType
  }
}
    `, { "fragmentName": "Shaam6111DataContentHeader" });
var Shaam6111DataContentProfitLossFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContentProfitLoss on Shaam6111Data {
  id
  profitAndLoss {
    code
    amount
    label
  }
}
    `, { "fragmentName": "Shaam6111DataContentProfitLoss" });
var Shaam6111DataContentTaxAdjustmentFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContentTaxAdjustment on Shaam6111Data {
  id
  taxAdjustment {
    code
    amount
    label
  }
}
    `, { "fragmentName": "Shaam6111DataContentTaxAdjustment" });
var Shaam6111DataContentBalanceSheetFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContentBalanceSheet on Shaam6111Data {
  id
  balanceSheet {
    code
    amount
    label
  }
}
    `, { "fragmentName": "Shaam6111DataContentBalanceSheet" });
var Shaam6111DataContentFragmentDoc = new TypedDocumentString(`
    fragment Shaam6111DataContent on Shaam6111Data {
  id
  ...Shaam6111DataContentHeader
  ...Shaam6111DataContentProfitLoss
  ...Shaam6111DataContentTaxAdjustment
  ...Shaam6111DataContentBalanceSheet
}
    fragment Shaam6111DataContentBalanceSheet on Shaam6111Data {
  id
  balanceSheet {
    code
    amount
    label
  }
}
fragment Shaam6111DataContentHeader on Shaam6111Data {
  id
  header {
    taxYear
    businessDescription
    taxFileNumber
    idNumber
    vatFileNumber
    withholdingTaxFileNumber
    businessType
    reportingMethod
    currencyType
    amountsInThousands
    accountingMethod
    accountingSystem
    softwareRegistrationNumber
    isPartnership
    partnershipCount
    partnershipProfitShare
    ifrsImplementationYear
    ifrsReportingOption
    includesProfitLoss
    includesTaxAdjustment
    includesBalanceSheet
    industryCode
    auditOpinionType
  }
}
fragment Shaam6111DataContentProfitLoss on Shaam6111Data {
  id
  profitAndLoss {
    code
    amount
    label
  }
}
fragment Shaam6111DataContentTaxAdjustment on Shaam6111Data {
  id
  taxAdjustment {
    code
    amount
    label
  }
}`, { "fragmentName": "Shaam6111DataContent" });
var TransactionToDownloadForTransactionsTableFieldsFragmentDoc = new TypedDocumentString(`
    fragment TransactionToDownloadForTransactionsTableFields on Transaction {
  id
  account {
    id
    name
    type
  }
  amount {
    currency
    raw
  }
  counterparty {
    id
    name
  }
  effectiveDate
  eventDate
  referenceKey
  sourceDescription
}
    `, { "fragmentName": "TransactionToDownloadForTransactionsTableFields" });
var ListApiKeysDocument = new TypedDocumentString(`
    query ListApiKeys {
  listApiKeys {
    id
    name
    roleId
    lastUsedAt
    createdAt
  }
}
    `);
var ListBusinessUsersDocument = new TypedDocumentString(`
    query ListBusinessUsers {
  listBusinessUsers {
    id
    email
    name
    roleId
    createdAt
  }
}
    `);
var ListInvitationsDocument = new TypedDocumentString(`
    query ListInvitations {
  listInvitations {
    id
    email
    roleId
    expiresAt
  }
}
    `);
var SharedDepositTransactionsDocument = new TypedDocumentString(`
    query SharedDepositTransactions($depositId: UUID!) {
  deposit(id: $depositId) {
    id
    currency
    metadata {
      id
      transactions {
        id
        ...DepositTransactionFields
      }
    }
  }
}
    fragment DepositTransactionFields on Transaction {
  id
  eventDate
  chargeId
  amount {
    raw
    formatted
    currency
  }
  debitExchangeRates {
    aud
    cad
    eur
    gbp
    jpy
    sek
    usd
    date
  }
  eventExchangeRates {
    aud
    cad
    eur
    gbp
    jpy
    sek
    usd
    date
  }
}`);
var BusinessLedgerInfoDocument = new TypedDocumentString(`
    query BusinessLedgerInfo($filters: BusinessTransactionsFilter) {
  businessTransactionsFromLedgerRecords(filters: $filters) {
    ... on BusinessTransactionsFromLedgerRecordsSuccessfulResult {
      __typename
      businessTransactions {
        amount {
          formatted
          raw
        }
        business {
          id
          name
        }
        foreignAmount {
          formatted
          raw
          currency
        }
        invoiceDate
        reference
        details
        counterAccount {
          __typename
          id
          name
        }
        chargeId
      }
    }
    ... on CommonError {
      __typename
      message
    }
  }
}
    `);
var BusinessLedgerRecordsSummeryDocument = new TypedDocumentString(`
    query BusinessLedgerRecordsSummery($filters: BusinessTransactionsFilter) {
  businessTransactionsSumFromLedgerRecords(filters: $filters) {
    ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {
      __typename
      businessTransactionsSum {
        business {
          id
          name
        }
        credit {
          formatted
        }
        debit {
          formatted
        }
        total {
          formatted
          raw
        }
        foreignCurrenciesSum {
          currency
          credit {
            formatted
          }
          debit {
            formatted
          }
          total {
            formatted
            raw
          }
        }
      }
    }
    ... on CommonError {
      __typename
      message
    }
  }
}
    `);
var BusinessTripScreenDocument = new TypedDocumentString(`
    query BusinessTripScreen($businessTripId: UUID!) {
  businessTrip(id: $businessTripId) {
    id
    name
    dates {
      start
    }
  }
}
    `);
var BusinessTripsRowValidationDocument = new TypedDocumentString(`
    query BusinessTripsRowValidation($id: UUID!) {
  businessTrip(id: $id) {
    id
    uncategorizedTransactions {
      transaction {
        ... on Transaction @defer {
          id
        }
      }
    }
    summary {
      ... on BusinessTripSummary @defer {
        errors
      }
    }
  }
}
    `);
var EditableBusinessTripDocument = new TypedDocumentString(`
    query EditableBusinessTrip($businessTripId: UUID!) {
  businessTrip(id: $businessTripId) {
    id
    ...BusinessTripReportHeaderFields
    ...BusinessTripReportAttendeesFields
    ...BusinessTripUncategorizedTransactionsFields
    ...BusinessTripReportFlightsFields
    ...BusinessTripReportAccommodationsFields
    ...BusinessTripReportTravelAndSubsistenceFields
    ...BusinessTripReportCarRentalFields
    ...BusinessTripReportOtherFields
    ...BusinessTripReportSummaryFields
    ... on BusinessTrip {
      uncategorizedTransactions {
        transaction {
          id
        }
      }
    }
  }
}
    fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  country {
    id
    name
  }
  nightsCount
  attendeesStay {
    id
    attendee {
      id
      name
    }
    nightsCount
  }
}
fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {
  id
  date
  ...BusinessTripReportAccommodationsRowFields
}
fragment BusinessTripReportAccommodationsFields on BusinessTrip {
  id
  accommodationExpenses {
    id
    ...BusinessTripReportAccommodationsTableFields
  }
}
fragment BusinessTripReportAttendeeRowFields on BusinessTripAttendee {
  id
  name
  arrivalDate
  departureDate
  flights {
    id
    ...BusinessTripReportFlightsTableFields
  }
  accommodations {
    id
    ...BusinessTripReportAccommodationsTableFields
  }
}
fragment BusinessTripReportAttendeesFields on BusinessTrip {
  id
  attendees {
    id
    name
    ...BusinessTripReportAttendeeRowFields
  }
}
fragment BusinessTripReportCarRentalRowFields on BusinessTripCarRentalExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  days
  isFuelExpense
}
fragment BusinessTripReportCarRentalFields on BusinessTrip {
  id
  carRentalExpenses {
    id
    date
    ...BusinessTripReportCarRentalRowFields
  }
}
fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {
  id
  date
  valueDate
  amount {
    formatted
    raw
    currency
  }
  employee {
    id
    name
  }
  payedByEmployee
  charges {
    id
  }
}
fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {
  id
  payedByEmployee
  ...BusinessTripReportCoreExpenseRowFields
  path
  class
  attendees {
    id
    name
  }
}
fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {
  id
  date
  ...BusinessTripReportFlightsRowFields
}
fragment BusinessTripReportFlightsFields on BusinessTrip {
  id
  flightExpenses {
    id
    ...BusinessTripReportFlightsTableFields
  }
  attendees {
    id
    name
  }
}
fragment BusinessTripReportOtherRowFields on BusinessTripOtherExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  description
  deductibleExpense
}
fragment BusinessTripReportOtherFields on BusinessTrip {
  id
  otherExpenses {
    id
    date
    ...BusinessTripReportOtherRowFields
  }
}
fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}
fragment BusinessTripReportTravelAndSubsistenceRowFields on BusinessTripTravelAndSubsistenceExpense {
  id
  ...BusinessTripReportCoreExpenseRowFields
  payedByEmployee
  expenseType
}
fragment BusinessTripReportTravelAndSubsistenceFields on BusinessTrip {
  id
  travelAndSubsistenceExpenses {
    id
    date
    ...BusinessTripReportTravelAndSubsistenceRowFields
  }
}
fragment BusinessTripUncategorizedTransactionsFields on BusinessTrip {
  id
  uncategorizedTransactions {
    transaction {
      id
      eventDate
      chargeId
      amount {
        raw
      }
      ...TransactionsTableEventDateFields
      ...TransactionsTableDebitDateFields
      ...TransactionsTableAccountFields
      ...TransactionsTableDescriptionFields
      ...TransactionsTableSourceIDFields
      ...TransactionsTableEntityFields
    }
    ...UncategorizedTransactionsTableAmountFields
  }
}
fragment UncategorizedTransactionsTableAmountFields on UncategorizedTransaction {
  transaction {
    id
    amount {
      raw
      formatted
    }
    cryptoExchangeRate {
      rate
    }
  }
  categorizedAmount {
    raw
    formatted
  }
  errors
}
fragment TransactionsTableAccountFields on Transaction {
  id
  account {
    id
    name
    type
  }
}
fragment TransactionsTableEntityFields on Transaction {
  id
  counterparty {
    name
    id
  }
  sourceDescription
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
fragment TransactionsTableDebitDateFields on Transaction {
  id
  effectiveDate
  sourceEffectiveDate
}
fragment TransactionsTableDescriptionFields on Transaction {
  id
  sourceDescription
}
fragment TransactionsTableEventDateFields on Transaction {
  id
  eventDate
}
fragment TransactionsTableSourceIDFields on Transaction {
  id
  referenceKey
}`);
var BusinessTripsScreenDocument = new TypedDocumentString(`
    query BusinessTripsScreen {
  allBusinessTrips {
    id
    name
    dates {
      start
    }
    ...BusinessTripsRowFields
  }
}
    fragment BusinessTripsRowFields on BusinessTrip {
  id
  name
  accountantApproval
}`);
var AdminFinancialAccountsSectionDocument = new TypedDocumentString(`
    query AdminFinancialAccountsSection($adminId: UUID!) {
  financialAccountsByOwner(ownerId: $adminId) {
    id
    __typename
    name
    number
    type
    privateOrBusiness
    accountTaxCategories {
      id
      currency
      taxCategory {
        id
        name
      }
    }
    ... on BankFinancialAccount {
      bankNumber
      branchNumber
      iban
      swiftCode
      extendedBankNumber
      partyPreferredIndication
      partyAccountInvolvementCode
      accountDealDate
      accountUpdateDate
      metegDoarNet
      kodHarshaatPeilut
      accountClosingReasonCode
      accountAgreementOpeningDate
      serviceAuthorizationDesc
      branchTypeCode
      mymailEntitlementSwitch
      productLabel
    }
  }
}
    `);
var BusinessChargesSectionDocument = new TypedDocumentString(`
    query BusinessChargesSection($page: Int, $limit: Int, $filters: ChargeFilter) {
  allCharges(page: $page, limit: $limit, filters: $filters) {
    nodes {
      id
      ...ChargeForChargesTableFields
    }
    pageInfo {
      totalPages
    }
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var ClientContractsSectionDocument = new TypedDocumentString(`
    query ClientContractsSection($clientId: UUID!) {
  contractsByClient(clientId: $clientId) {
    id
    purchaseOrders
    startDate
    endDate
    amount {
      raw
      currency
    }
    billingCycle
    isActive
    product
    documentType
    remarks
    plan
    msCloud
    operationsLimit
  }
}
    `);
var ClientIntegrationsSectionGreenInvoiceDocument = new TypedDocumentString(`
    query ClientIntegrationsSectionGreenInvoice($clientId: UUID!) {
  greenInvoiceClient(clientId: $clientId) {
    businessId
    greenInvoiceId
    country {
      id
      name
    }
    emails
    name
    phone
    taxId
    address
    city
    zip
    fax
    mobile
  }
}
    `);
var ContractBasedDocumentDraftDocument = new TypedDocumentString(`
    query ContractBasedDocumentDraft($issueMonth: TimelessDate!, $contractId: UUID!) {
  periodicalDocumentDraftsByContracts(
    issueMonth: $issueMonth
    contractIds: [$contractId]
  ) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var BusinessLedgerSectionDocument = new TypedDocumentString(`
    query BusinessLedgerSection($businessId: UUID!) {
  ledgerRecordsByFinancialEntity(financialEntityId: $businessId) {
    id
    ...LedgerRecordsTableFields
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}`);
var BusinessTransactionsSectionDocument = new TypedDocumentString(`
    query BusinessTransactionsSection($businessId: UUID!) {
  transactionsByFinancialEntity(financialEntityID: $businessId) {
    id
    ...TransactionForTransactionsTableFields
    ...TransactionToDownloadForTransactionsTableFields
  }
}
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
fragment TransactionToDownloadForTransactionsTableFields on Transaction {
  id
  account {
    id
    name
    type
  }
  amount {
    currency
    raw
  }
  counterparty {
    id
    name
  }
  effectiveDate
  eventDate
  referenceKey
  sourceDescription
}`);
var AllBusinessesForScreenDocument = new TypedDocumentString(`
    query AllBusinessesForScreen {
  allBusinesses {
    nodes {
      __typename
      id
      name
      ... on LtdFinancialEntity {
        hebrewName
        governmentId
        country {
          id
          code
        }
        city
        zipCode
        createdAt
        updatedAt
        sortCode {
          id
          key
          name
        }
        taxCategory {
          id
          name
        }
        irsCode
        pcn874RecordType
        isClient
        isAdmin
        isActive
        suggestions {
          description
          tags {
            id
            name
          }
        }
      }
    }
  }
}
    `);
var BusinessesUsageDocument = new TypedDocumentString(`
    query BusinessesUsage($ids: [UUID!]!) {
  businessesUsage(ids: $ids) {
    id
    businessId
    totalTransactions
    totalDocuments
    totalMiscExpenses
    totalLedgerRecords
  }
}
    `);
var ChargeExtendedInfoForChargeMatchesDocument = new TypedDocumentString(`
    query ChargeExtendedInfoForChargeMatches($chargeId: UUID!) {
  charge(chargeId: $chargeId) {
    id
    transactions {
      id
      ...TransactionForTransactionsTableFields
    }
    additionalDocuments {
      id
      ...TableDocumentsRowFields
    }
  }
}
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`);
var ChargesAwaitingMatchQueueDocument = new TypedDocumentString(`
    query ChargesAwaitingMatchQueue($limit: Int, $offset: Int, $businessId: UUID, $fromDate: TimelessDate, $toDate: TimelessDate, $mode: ChargeMatchQueueMode, $sortBy: ChargeMatchQueueSortBy) {
  chargesAwaitingMatchQueue(
    limit: $limit
    offset: $offset
    businessId: $businessId
    fromDate: $fromDate
    toDate: $toDate
    mode: $mode
    sortBy: $sortBy
  ) {
    totalCount
    baseCharges {
      id
      baseCharge {
        ...ChargeMatchCardFields
      }
      suggestions {
        chargeId
        confidenceScore
        charge {
          ...ChargeMatchCardFields
        }
      }
    }
  }
}
    fragment ChargeMatchCardFields on Charge {
  __typename
  id
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    formatted
    currency
  }
  counterparty {
    id
    name
  }
  userDescription
  additionalDocuments {
    id
    documentType
    image
    file
  }
  transactions {
    id
    eventDate
    sourceDescription
    amount {
      raw
      formatted
    }
  }
  miscExpenses {
    id
    description
    amount {
      formatted
    }
  }
}`);
var ChargesLedgerValidationDocument = new TypedDocumentString(`
    query ChargesLedgerValidation($limit: Int, $filters: ChargeFilter) {
  chargesWithLedgerChanges(limit: $limit, filters: $filters) @stream {
    progress
    charge {
      id
      ...ChargeForChargesTableFields
    }
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var FetchChargeDocument = new TypedDocumentString(`
    query FetchCharge($chargeId: UUID!) {
  charge(chargeId: $chargeId) {
    id
    ...ChargeExpansionFields
  }
}
    fragment ChargesTableErrorsFields on Charge {
  id
  errorsLedger: ledger {
    validate {
      errors
    }
  }
}
fragment ChargeExpansionFields on Charge {
  id
  __typename
  metadata {
    transactionsCount
    documentsCount
    receiptsCount
    invoicesCount
    ledgerCount
    miscExpensesCount
    isLedgerLocked
    openDocuments
  }
  totalAmount {
    raw
  }
  ...DocumentsGalleryFields @defer
  ...TableDocumentsFields @defer
  ...ChargeLedgerRecordsTableFields @defer
  ...ChargeTableTransactionsFields @defer
  ...ConversionChargeInfo @defer
  ...CreditcardBankChargeInfo @defer
  ...TableSalariesFields @defer
  ... on BusinessTripCharge {
    businessTrip {
      id
      ...BusinessTripReportFields
    }
  }
  ...ChargesTableErrorsFields @defer
  ...TableMiscExpensesFields @defer
  ...ExchangeRatesInfo @defer
}
fragment TableDocumentsFields on Charge {
  id
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
}
fragment ChargeLedgerRecordsTableFields on Charge {
  id
  ledger {
    __typename
    records {
      id
      ...LedgerRecordsTableFields
    }
    ... on Ledger @defer {
      validate {
        ... on LedgerValidation @defer {
          matches
          differences {
            id
            ...LedgerRecordsTableFields
          }
        }
      }
    }
  }
}
fragment ChargeTableTransactionsFields on Charge {
  id
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
}
fragment ConversionChargeInfo on Charge {
  id
  __typename
  ... on ConversionCharge {
    eventRate {
      from
      to
      rate
    }
    officialRate {
      from
      to
      rate
    }
  }
}
fragment CreditcardBankChargeInfo on Charge {
  id
  __typename
  ... on CreditcardBankCharge {
    creditCardTransactions {
      id
      ...TransactionForTransactionsTableFields
    }
  }
}
fragment ExchangeRatesInfo on Charge {
  id
  __typename
  ... on FinancialCharge {
    exchangeRates {
      aud
      cad
      eur
      gbp
      ils
      jpy
      sek
      usd
      eth
      grt
      usdc
    }
  }
}
fragment TableMiscExpensesFields on Charge {
  id
  miscExpenses {
    id
    amount {
      formatted
    }
    description
    invoiceDate
    valueDate
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    chargeId
    ...EditMiscExpenseFields
  }
}
fragment TableSalariesFields on Charge {
  id
  __typename
  ... on SalaryCharge {
    salaryRecords {
      directAmount {
        formatted
      }
      baseAmount {
        formatted
      }
      employee {
        id
        name
      }
      pensionFund {
        id
        name
      }
      pensionEmployeeAmount {
        formatted
      }
      pensionEmployerAmount {
        formatted
      }
      compensationsAmount {
        formatted
      }
      trainingFund {
        id
        name
      }
      trainingFundEmployeeAmount {
        formatted
      }
      trainingFundEmployerAmount {
        formatted
      }
      socialSecurityEmployeeAmount {
        formatted
      }
      socialSecurityEmployerAmount {
        formatted
      }
      incomeTaxAmount {
        formatted
      }
      healthInsuranceAmount {
        formatted
      }
    }
  }
}
fragment BusinessTripReportFields on BusinessTrip {
  id
  ...BusinessTripReportHeaderFields
  ...BusinessTripReportSummaryFields
}
fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}
fragment EditMiscExpenseFields on MiscExpense {
  id
  amount {
    raw
    currency
  }
  description
  invoiceDate
  valueDate
  creditor {
    id
  }
  debtor {
    id
  }
}
fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment DocumentsGalleryFields on Charge {
  id
  additionalDocuments {
    id
    image
    ... on FinancialDocument {
      documentType
    }
  }
}
fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`);
var ChargesExtendedInfoBatchDocument = new TypedDocumentString(`
    query ChargesExtendedInfoBatch($chargeIDs: [UUID!]!) {
  chargesByIDs(chargeIDs: $chargeIDs) {
    id
    ...ChargeExpansionFields
  }
}
    fragment ChargesTableErrorsFields on Charge {
  id
  errorsLedger: ledger {
    validate {
      errors
    }
  }
}
fragment ChargeExpansionFields on Charge {
  id
  __typename
  metadata {
    transactionsCount
    documentsCount
    receiptsCount
    invoicesCount
    ledgerCount
    miscExpensesCount
    isLedgerLocked
    openDocuments
  }
  totalAmount {
    raw
  }
  ...DocumentsGalleryFields @defer
  ...TableDocumentsFields @defer
  ...ChargeLedgerRecordsTableFields @defer
  ...ChargeTableTransactionsFields @defer
  ...ConversionChargeInfo @defer
  ...CreditcardBankChargeInfo @defer
  ...TableSalariesFields @defer
  ... on BusinessTripCharge {
    businessTrip {
      id
      ...BusinessTripReportFields
    }
  }
  ...ChargesTableErrorsFields @defer
  ...TableMiscExpensesFields @defer
  ...ExchangeRatesInfo @defer
}
fragment TableDocumentsFields on Charge {
  id
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
}
fragment ChargeLedgerRecordsTableFields on Charge {
  id
  ledger {
    __typename
    records {
      id
      ...LedgerRecordsTableFields
    }
    ... on Ledger @defer {
      validate {
        ... on LedgerValidation @defer {
          matches
          differences {
            id
            ...LedgerRecordsTableFields
          }
        }
      }
    }
  }
}
fragment ChargeTableTransactionsFields on Charge {
  id
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
}
fragment ConversionChargeInfo on Charge {
  id
  __typename
  ... on ConversionCharge {
    eventRate {
      from
      to
      rate
    }
    officialRate {
      from
      to
      rate
    }
  }
}
fragment CreditcardBankChargeInfo on Charge {
  id
  __typename
  ... on CreditcardBankCharge {
    creditCardTransactions {
      id
      ...TransactionForTransactionsTableFields
    }
  }
}
fragment ExchangeRatesInfo on Charge {
  id
  __typename
  ... on FinancialCharge {
    exchangeRates {
      aud
      cad
      eur
      gbp
      ils
      jpy
      sek
      usd
      eth
      grt
      usdc
    }
  }
}
fragment TableMiscExpensesFields on Charge {
  id
  miscExpenses {
    id
    amount {
      formatted
    }
    description
    invoiceDate
    valueDate
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    chargeId
    ...EditMiscExpenseFields
  }
}
fragment TableSalariesFields on Charge {
  id
  __typename
  ... on SalaryCharge {
    salaryRecords {
      directAmount {
        formatted
      }
      baseAmount {
        formatted
      }
      employee {
        id
        name
      }
      pensionFund {
        id
        name
      }
      pensionEmployeeAmount {
        formatted
      }
      pensionEmployerAmount {
        formatted
      }
      compensationsAmount {
        formatted
      }
      trainingFund {
        id
        name
      }
      trainingFundEmployeeAmount {
        formatted
      }
      trainingFundEmployerAmount {
        formatted
      }
      socialSecurityEmployeeAmount {
        formatted
      }
      socialSecurityEmployerAmount {
        formatted
      }
      incomeTaxAmount {
        formatted
      }
      healthInsuranceAmount {
        formatted
      }
    }
  }
}
fragment BusinessTripReportFields on BusinessTrip {
  id
  ...BusinessTripReportHeaderFields
  ...BusinessTripReportSummaryFields
}
fragment BusinessTripAccountantApprovalFields on BusinessTrip {
  id
  accountantApproval
}
fragment BusinessTripReportHeaderFields on BusinessTrip {
  id
  name
  dates {
    start
    end
  }
  purpose
  destination {
    id
    name
  }
  ...BusinessTripAccountantApprovalFields
}
fragment BusinessTripReportSummaryFields on BusinessTrip {
  id
  ... on BusinessTrip @defer {
    summary {
      excessExpenditure {
        formatted
      }
      excessTax
      rows {
        type
        totalForeignCurrency {
          formatted
        }
        totalLocalCurrency {
          formatted
        }
        taxableForeignCurrency {
          formatted
        }
        taxableLocalCurrency {
          formatted
        }
        maxTaxableForeignCurrency {
          formatted
        }
        maxTaxableLocalCurrency {
          formatted
        }
        excessExpenditure {
          formatted
        }
      }
      errors
    }
  }
}
fragment EditMiscExpenseFields on MiscExpense {
  id
  amount {
    raw
    currency
  }
  description
  invoiceDate
  valueDate
  creditor {
    id
  }
  debtor {
    id
  }
}
fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment DocumentsGalleryFields on Charge {
  id
  additionalDocuments {
    id
    image
    ... on FinancialDocument {
      documentType
    }
  }
}
fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`);
var RefetchChargeForChargesTableDocument = new TypedDocumentString(`
    query RefetchChargeForChargesTable($chargeId: UUID!) {
  charge(chargeId: $chargeId) {
    id
    ...ChargeForChargesTableFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var ChargesForCsvExportDocument = new TypedDocumentString(`
    query ChargesForCsvExport($chargeIDs: [UUID!]!) {
  chargesByIDs(chargeIDs: $chargeIDs) {
    id
    ...ChargeForCsvExportFields
  }
}
    fragment ChargeForCsvExportFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    id
    name
  }
  userDescription
  tags {
    id
    name
  }
  taxCategory {
    id
    name
  }
  accountantApproval
  validationData {
    isValid
    missingInfo
  }
  missingInfoSuggestions {
    description
    tags {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    invoicesCount
    receiptsCount
    ledgerCount
    miscExpensesCount
    openDocuments
    invalidLedger
  }
  ledger {
    balance {
      isBalanced
    }
    validate {
      isValid
      errors
    }
  }
  transactions {
    id
    ...TransactionForTransactionsTableFields
  }
  additionalDocuments {
    id
    ...TableDocumentsRowFields
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
}
fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}
fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`);
var BankDepositInfoDocument = new TypedDocumentString(`
    query BankDepositInfo($chargeId: UUID!) {
  depositByCharge(chargeId: $chargeId) {
    id
    name
    metadata {
      id
      currentBalance {
        formatted
      }
      transactions {
        id
        chargeId
        ...TransactionForTransactionsTableFields
      }
    }
    isOpen
  }
}
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}`);
var ChargeMatchesDocument = new TypedDocumentString(`
    query ChargeMatches($chargeId: UUID!) {
  findChargeMatches(chargeId: $chargeId) {
    matches {
      chargeId
      ...ChargeMatchesTableFields
    }
  }
}
    fragment ChargeMatchesTableFields on ChargeMatch {
  charge {
    id
    __typename
    minEventDate
    minDebitDate
    minDocumentsDate
    totalAmount {
      raw
      formatted
    }
    vat {
      raw
      formatted
    }
    counterparty {
      name
      id
    }
    userDescription
    tags {
      id
      name
      namePath
    }
    taxCategory {
      id
      name
    }
  }
  confidenceScore
}`);
var IncomeChargesChartDocument = new TypedDocumentString(`
    query IncomeChargesChart($filters: ChargeFilter) {
  allCharges(filters: $filters) {
    nodes {
      id
      transactions {
        id
        eventDate
        effectiveDate
        amount {
          currency
          formatted
          raw
        }
        eventExchangeRates {
          aud
          cad
          eur
          gbp
          jpy
          sek
          usd
          date
        }
        debitExchangeRates {
          aud
          cad
          eur
          gbp
          jpy
          sek
          usd
          date
        }
      }
    }
  }
}
    `);
var MonthlyIncomeExpenseChartDocument = new TypedDocumentString(`
    query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {
  incomeExpenseChart(filters: $filters) {
    fromDate
    toDate
    currency
    ...MonthlyIncomeExpenseChartInfo
  }
}
    fragment MonthlyIncomeExpenseChartInfo on IncomeExpenseChart {
  monthlyData {
    income {
      formatted
      raw
    }
    expense {
      formatted
      raw
    }
    balance {
      formatted
      raw
    }
    date
  }
}`);
var ContractsEditModalDocument = new TypedDocumentString(`
    query ContractsEditModal($contractId: UUID!) {
  contractsById(id: $contractId) {
    id
    startDate
    endDate
    purchaseOrders
    amount {
      raw
      currency
    }
    product
    msCloud
    billingCycle
    plan
    isActive
    remarks
    documentType
    operationsLimit
  }
}
    `);
var UncategorizedTransactionsByBusinessTripDocument = new TypedDocumentString(`
    query UncategorizedTransactionsByBusinessTrip($businessTripId: UUID!) {
  businessTrip(id: $businessTripId) {
    id
    uncategorizedTransactions {
      transaction {
        id
        eventDate
        sourceDescription
        referenceKey
        counterparty {
          id
          name
        }
        amount {
          formatted
          raw
        }
      }
    }
  }
}
    `);
var ChargeDepreciationDocument = new TypedDocumentString(`
    query ChargeDepreciation($chargeId: UUID!) {
  depreciationRecordsByCharge(chargeId: $chargeId) {
    id
    ...DepreciationRecordRowFields
  }
}
    fragment DepreciationRecordRowFields on DepreciationRecord {
  id
  amount {
    currency
    formatted
    raw
  }
  activationDate
  category {
    id
    name
    percentage
  }
  type
  charge {
    id
    totalAmount {
      currency
      formatted
      raw
    }
  }
}`);
var RecentBusinessIssuedDocumentsDocument = new TypedDocumentString(`
    query RecentBusinessIssuedDocuments($businessId: UUID!, $limit: Int) {
  recentDocumentsByBusiness(businessId: $businessId, limit: $limit) {
    id
    ... on FinancialDocument {
      issuedDocumentInfo {
        id
        status
        externalId
      }
    }
    ...TableDocumentsRowFields
  }
}
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}`);
var RecentIssuedDocumentsOfSameTypeDocument = new TypedDocumentString(`
    query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {
  recentIssuedDocumentsByType(documentType: $documentType) {
    id
    ...TableDocumentsRowFields
  }
}
    fragment TableDocumentsRowFields on Document {
  id
  documentType
  image
  file
  description
  remarks
  charge {
    id
  }
  ... on FinancialDocument {
    amount {
      raw
      formatted
      currency
    }
    missingInfoSuggestions {
      amount {
        raw
        formatted
        currency
      }
      isIncome
      counterparty {
        id
        name
      }
      owner {
        id
        name
      }
    }
    date
    vat {
      raw
      formatted
      currency
    }
    serialNumber
    allocationNumber
    creditor {
      id
      name
    }
    debtor {
      id
      name
    }
    issuedDocumentInfo {
      id
      status
      originalDocument {
        income {
          description
        }
      }
    }
  }
}`);
var EditDocumentDocument = new TypedDocumentString(`
    query EditDocument($documentId: UUID!) {
  documentById(documentId: $documentId) {
    id
    image
    file
    documentType
    description
    remarks
    __typename
    ... on FinancialDocument {
      vat {
        raw
        currency
      }
      serialNumber
      date
      amount {
        raw
        currency
      }
      debtor {
        id
        name
      }
      creditor {
        id
        name
      }
      vatReportDateOverride
      noVatAmount
      allocationNumber
      exchangeRateOverride
    }
    ... on Unprocessed {
      vat {
        raw
        currency
      }
      serialNumber
      date
      amount {
        raw
        currency
      }
      debtor {
        id
        name
      }
      creditor {
        id
        name
      }
      vatReportDateOverride
      noVatAmount
      allocationNumber
      exchangeRateOverride
    }
    ... on OtherDocument {
      vat {
        raw
        currency
      }
      serialNumber
      date
      amount {
        raw
        currency
      }
      debtor {
        id
        name
      }
      creditor {
        id
        name
      }
      vatReportDateOverride
      noVatAmount
      allocationNumber
      exchangeRateOverride
    }
  }
}
    `);
var EditTransactionDocument = new TypedDocumentString(`
    query EditTransaction($transactionIDs: [UUID!]!) {
  transactionsByIDs(transactionIDs: $transactionIDs) {
    id
    counterparty {
      id
      name
    }
    effectiveDate
    isFee
    account {
      type
      id
    }
  }
}
    `);
var ClientInfoForDocumentIssuingDocument = new TypedDocumentString(`
    query ClientInfoForDocumentIssuing($businessId: UUID!) {
  client(businessId: $businessId) {
    id
    integrations {
      id
      greenInvoiceInfo {
        greenInvoiceId
        businessId
        name
      }
    }
    ...IssueDocumentClientFields
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}`);
var AllBusinessTripsDocument = new TypedDocumentString(`
    query AllBusinessTrips {
  allBusinessTrips {
    id
    name
  }
}
    `);
var AllDepreciationCategoriesDocument = new TypedDocumentString(`
    query AllDepreciationCategories {
  depreciationCategories {
    id
    name
    percentage
  }
}
    `);
var AllEmployeesByEmployerDocument = new TypedDocumentString(`
    query AllEmployeesByEmployer($employerId: UUID!) {
  employeesByEmployerId(employerId: $employerId) {
    id
    name
  }
}
    `);
var AllPensionFundsDocument = new TypedDocumentString(`
    query AllPensionFunds {
  allPensionFunds {
    id
    name
  }
}
    `);
var AllTrainingFundsDocument = new TypedDocumentString(`
    query AllTrainingFunds {
  allTrainingFunds {
    id
    name
  }
}
    `);
var AttendeesByBusinessTripDocument = new TypedDocumentString(`
    query AttendeesByBusinessTrip($businessTripId: UUID!) {
  businessTrip(id: $businessTripId) {
    id
    attendees {
      id
      name
    }
  }
}
    `);
var FetchMultipleBusinessesDocument = new TypedDocumentString(`
    query FetchMultipleBusinesses($businessIds: [UUID!]!) {
  businesses(ids: $businessIds) {
    id
    name
  }
}
    `);
var FetchMultipleChargesDocument = new TypedDocumentString(`
    query FetchMultipleCharges($chargeIds: [UUID!]!) {
  chargesByIDs(chargeIDs: $chargeIds) {
    id
    __typename
    metadata {
      transactionsCount
      invoicesCount
    }
    owner {
      id
      name
    }
    tags {
      id
      name
      namePath
    }
    decreasedVAT
    property
    isInvoicePaymentDifferentCurrency
    userDescription
    optionalVAT
    optionalDocuments
  }
}
    `);
var EditChargeDocument = new TypedDocumentString(`
    query EditCharge($chargeId: UUID!) {
  charge(chargeId: $chargeId) {
    id
    __typename
    counterparty {
      id
      name
    }
    owner {
      id
      name
    }
    property
    decreasedVAT
    isInvoicePaymentDifferentCurrency
    userDescription
    taxCategory {
      id
      name
    }
    tags {
      id
    }
    missingInfoSuggestions {
      ... on ChargeSuggestions {
        tags {
          id
        }
      }
    }
    optionalVAT
    optionalDocuments
    ... on BusinessTripCharge {
      businessTrip {
        id
        name
      }
    }
    yearsOfRelevance {
      year
      amount
    }
  }
}
    `);
var EditSalaryRecordDocument = new TypedDocumentString(`
    query EditSalaryRecord($month: TimelessDate!, $employeeIDs: [UUID!]!) {
  salaryRecordsByDates(
    fromDate: $month
    toDate: $month
    employeeIDs: $employeeIDs
  ) {
    month
    charge {
      id
    }
    directAmount {
      raw
    }
    baseAmount {
      raw
    }
    employee {
      id
      name
    }
    employer {
      id
      name
    }
    pensionFund {
      id
      name
    }
    pensionEmployeeAmount {
      raw
    }
    pensionEmployeePercentage
    pensionEmployerAmount {
      raw
    }
    pensionEmployerPercentage
    compensationsAmount {
      raw
    }
    compensationsPercentage
    trainingFund {
      id
      name
    }
    trainingFundEmployeeAmount {
      raw
    }
    trainingFundEmployeePercentage
    trainingFundEmployerAmount {
      raw
    }
    trainingFundEmployerPercentage
    socialSecurityEmployeeAmount {
      raw
    }
    socialSecurityEmployerAmount {
      raw
    }
    incomeTaxAmount {
      raw
    }
    healthInsuranceAmount {
      raw
    }
    globalAdditionalHoursAmount {
      raw
    }
    bonus {
      raw
    }
    gift {
      raw
    }
    travelAndSubsistence {
      raw
    }
    recovery {
      raw
    }
    notionalExpense {
      raw
    }
    vacationDays {
      added
      balance
    }
    vacationTakeout {
      raw
    }
    workDays
    sicknessDays {
      balance
    }
  }
}
    `);
var SortCodeToUpdateDocument = new TypedDocumentString(`
    query SortCodeToUpdate($key: Int!, $ownerId: String!) {
  sortCode(key: $key, ownerId: $ownerId) {
    id
    key
    name
    defaultIrsCode
  }
}
    `);
var TaxCategoryToUpdateDocument = new TypedDocumentString(`
    query TaxCategoryToUpdate($id: UUID!) {
  taxCategory(id: $id) {
    id
    ownerId
    name
    sortCode {
      id
      key
      name
    }
    irsCode
  }
}
    `);
var MiscExpenseTransactionFieldsDocument = new TypedDocumentString(`
    query MiscExpenseTransactionFields($transactionId: UUID!) {
  transactionsByIDs(transactionIDs: [$transactionId]) {
    id
    chargeId
    amount {
      raw
      currency
    }
    eventDate
    effectiveDate
    exactEffectiveDate
    counterparty {
      id
    }
  }
}
    `);
var NewDocumentDraftByChargeDocument = new TypedDocumentString(`
    query NewDocumentDraftByCharge($chargeId: UUID!) {
  newDocumentDraftByCharge(chargeId: $chargeId) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var NewDocumentDraftByDocumentDocument = new TypedDocumentString(`
    query NewDocumentDraftByDocument($documentId: UUID!) {
  newDocumentDraftByDocument(documentId: $documentId) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var SimilarChargesByBusinessDocument = new TypedDocumentString(`
    query SimilarChargesByBusiness($businessId: UUID!, $tagsDifferentThan: [String!], $descriptionDifferentThan: String) {
  similarChargesByBusiness(
    businessId: $businessId
    tagsDifferentThan: $tagsDifferentThan
    descriptionDifferentThan: $descriptionDifferentThan
  ) {
    id
    ...SimilarChargesTable
  }
}
    fragment SimilarChargesTable on Charge {
  id
  __typename
  counterparty {
    name
    id
  }
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    formatted
  }
  vat {
    raw
    formatted
  }
  userDescription
  tags {
    id
    name
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
  }
}`);
var SimilarChargesDocument = new TypedDocumentString(`
    query SimilarCharges($chargeId: UUID!, $withMissingTags: Boolean!, $withMissingDescription: Boolean!, $tagsDifferentThan: [String!], $descriptionDifferentThan: String) {
  similarCharges(
    chargeId: $chargeId
    withMissingTags: $withMissingTags
    withMissingDescription: $withMissingDescription
    tagsDifferentThan: $tagsDifferentThan
    descriptionDifferentThan: $descriptionDifferentThan
  ) {
    id
    ...SimilarChargesTable
  }
}
    fragment SimilarChargesTable on Charge {
  id
  __typename
  counterparty {
    name
    id
  }
  minEventDate
  minDebitDate
  minDocumentsDate
  totalAmount {
    raw
    formatted
  }
  vat {
    raw
    formatted
  }
  userDescription
  tags {
    id
    name
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
  }
}`);
var SimilarTransactionsDocument = new TypedDocumentString(`
    query SimilarTransactions($transactionId: UUID!, $withMissingInfo: Boolean!) {
  similarTransactions(
    transactionId: $transactionId
    withMissingInfo: $withMissingInfo
  ) {
    id
    account {
      id
      name
      type
    }
    amount {
      formatted
      raw
    }
    effectiveDate
    eventDate
    sourceDescription
  }
}
    `);
var UniformFormatDocument = new TypedDocumentString(`
    query UniformFormat($fromDate: TimelessDate!, $toDate: TimelessDate!) {
  uniformFormat(fromDate: $fromDate, toDate: $toDate) {
    bkmvdata
    ini
  }
}
    `);
var ContractBasedDocumentDraftsDocument = new TypedDocumentString(`
    query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {
  periodicalDocumentDraftsByContracts(
    issueMonth: $issueMonth
    contractIds: $contractIds
  ) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var AccountantApprovalsChargesTableDocument = new TypedDocumentString(`
    query AccountantApprovalsChargesTable($page: Int, $limit: Int, $filters: ChargeFilter) {
  allCharges(page: $page, limit: $limit, filters: $filters) {
    nodes {
      id
      accountantApproval
    }
  }
}
    `);
var CorporateTaxRulingComplianceReportDocument = new TypedDocumentString(`
    query CorporateTaxRulingComplianceReport($years: [Int!]!) {
  corporateTaxRulingComplianceReport(years: $years) {
    id
    year
    totalIncome {
      formatted
      raw
      currency
    }
    researchAndDevelopmentExpenses {
      formatted
      raw
      currency
    }
    rndRelativeToIncome {
      rule
      ...CorporateTaxRulingReportRuleCellFields
    }
    localDevelopmentExpenses {
      formatted
      raw
      currency
    }
    localDevelopmentRelativeToRnd {
      rule
      ...CorporateTaxRulingReportRuleCellFields
    }
    foreignDevelopmentExpenses {
      formatted
      raw
      currency
    }
    foreignDevelopmentRelativeToRnd {
      rule
      ...CorporateTaxRulingReportRuleCellFields
    }
    businessTripRndExpenses {
      formatted
      raw
      currency
    }
    ... on CorporateTaxRulingComplianceReport @defer {
      differences {
        id
        totalIncome {
          formatted
          raw
          currency
        }
        researchAndDevelopmentExpenses {
          formatted
          raw
          currency
        }
        rndRelativeToIncome {
          ...CorporateTaxRulingReportRuleCellFields
        }
        localDevelopmentExpenses {
          formatted
          raw
          currency
        }
        localDevelopmentRelativeToRnd {
          ...CorporateTaxRulingReportRuleCellFields
        }
        foreignDevelopmentExpenses {
          formatted
          raw
          currency
        }
        foreignDevelopmentRelativeToRnd {
          ...CorporateTaxRulingReportRuleCellFields
        }
        businessTripRndExpenses {
          formatted
          raw
          currency
        }
      }
    }
  }
}
    fragment CorporateTaxRulingReportRuleCellFields on CorporateTaxRule {
  id
  rule
  percentage {
    formatted
  }
  isCompliant
}`);
var AllDynamicReportsDocument = new TypedDocumentString(`
    query AllDynamicReports {
  allDynamicReports {
    id
    name
    isLocked
    updated
  }
}
    `);
var DynamicReportDocument = new TypedDocumentString(`
    query DynamicReport($filters: BusinessTransactionsFilter) {
  businessTransactionsSumFromLedgerRecords(filters: $filters) {
    __typename
    ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {
      businessTransactionsSum {
        business {
          id
          name
          sortCode {
            id
            key
            name
          }
        }
        credit {
          formatted
          raw
        }
        debit {
          formatted
          raw
        }
        total {
          formatted
          raw
        }
      }
    }
    ... on CommonError {
      __typename
    }
  }
}
    `);
var DynamicReportTemplateDocument = new TypedDocumentString(`
    query DynamicReportTemplate($name: String!) {
  dynamicReport(name: $name) {
    id
    name
    isLocked
    updated
    template {
      id
      parent
      text
      droppable
      data {
        nodeType
        isOpen
        hebrewText
        sortCode
      }
    }
  }
}
    `);
var ProfitAndLossReportDocument = new TypedDocumentString(`
    query ProfitAndLossReport($reportYear: Int!, $referenceYears: [Int!]!) {
  profitAndLossReport(reportYear: $reportYear, referenceYears: $referenceYears) {
    id
    report {
      id
      year
      revenue {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      costOfSales {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      grossProfit {
        formatted
      }
      researchAndDevelopmentExpenses {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      marketingExpenses {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      managementAndGeneralExpenses {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      operatingProfit {
        formatted
      }
      financialExpenses {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      otherIncome {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      profitBeforeTax {
        formatted
      }
      tax {
        formatted
      }
      netProfit {
        formatted
      }
    }
    reference {
      id
      year
      revenue {
        amount {
          formatted
        }
      }
      costOfSales {
        amount {
          formatted
        }
      }
      grossProfit {
        formatted
      }
      researchAndDevelopmentExpenses {
        amount {
          formatted
        }
      }
      marketingExpenses {
        amount {
          formatted
        }
      }
      managementAndGeneralExpenses {
        amount {
          formatted
        }
      }
      operatingProfit {
        formatted
      }
      financialExpenses {
        amount {
          formatted
        }
      }
      otherIncome {
        amount {
          formatted
        }
      }
      profitBeforeTax {
        formatted
      }
      tax {
        formatted
      }
      netProfit {
        formatted
      }
    }
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment ReportCommentaryTableFields on ReportCommentary {
  records {
    sortCode {
      id
      key
      name
    }
    amount {
      formatted
    }
    records {
      ...ReportSubCommentaryTableFields
    }
  }
}
fragment ReportSubCommentaryTableFields on ReportCommentarySubRecord {
  financialEntity {
    id
    name
  }
  amount {
    formatted
  }
  ledgerRecords {
    ...LedgerRecordsTableFields
  }
}`);
var TaxReportDocument = new TypedDocumentString(`
    query TaxReport($reportYear: Int!, $referenceYears: [Int!]!) {
  taxReport(reportYear: $reportYear, referenceYears: $referenceYears) {
    id
    report {
      id
      year
      profitBeforeTax {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      researchAndDevelopmentExpensesByRecords {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      researchAndDevelopmentExpensesForTax {
        formatted
      }
      fines {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      untaxableGifts {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      businessTripsExcessExpensesAmount {
        formatted
      }
      salaryExcessExpensesAmount {
        formatted
      }
      reserves {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      nontaxableLinkage {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      taxableIncome {
        formatted
      }
      taxRate
      specialTaxableIncome {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      specialTaxRate
      annualTaxExpense {
        formatted
      }
    }
    reference {
      id
      year
      profitBeforeTax {
        amount {
          formatted
        }
      }
      researchAndDevelopmentExpensesByRecords {
        amount {
          formatted
        }
      }
      researchAndDevelopmentExpensesForTax {
        formatted
      }
      fines {
        amount {
          formatted
        }
      }
      untaxableGifts {
        amount {
          formatted
        }
      }
      businessTripsExcessExpensesAmount {
        formatted
      }
      salaryExcessExpensesAmount {
        formatted
      }
      reserves {
        amount {
          formatted
        }
      }
      nontaxableLinkage {
        amount {
          formatted
        }
      }
      taxableIncome {
        formatted
      }
      taxRate
      specialTaxableIncome {
        amount {
          formatted
        }
        ...ReportCommentaryTableFields
      }
      specialTaxRate
      annualTaxExpense {
        formatted
      }
    }
  }
}
    fragment LedgerRecordsTableFields on LedgerRecord {
  id
  creditAccount1 {
    __typename
    id
    name
  }
  creditAccount2 {
    __typename
    id
    name
  }
  debitAccount1 {
    __typename
    id
    name
  }
  debitAccount2 {
    __typename
    id
    name
  }
  creditAmount1 {
    formatted
    currency
  }
  creditAmount2 {
    formatted
    currency
  }
  debitAmount1 {
    formatted
    currency
  }
  debitAmount2 {
    formatted
    currency
  }
  localCurrencyCreditAmount1 {
    formatted
    raw
  }
  localCurrencyCreditAmount2 {
    formatted
    raw
  }
  localCurrencyDebitAmount1 {
    formatted
    raw
  }
  localCurrencyDebitAmount2 {
    formatted
    raw
  }
  invoiceDate
  valueDate
  description
  reference
}
fragment ReportCommentaryTableFields on ReportCommentary {
  records {
    sortCode {
      id
      key
      name
    }
    amount {
      formatted
    }
    records {
      ...ReportSubCommentaryTableFields
    }
  }
}
fragment ReportSubCommentaryTableFields on ReportCommentarySubRecord {
  financialEntity {
    id
    name
  }
  amount {
    formatted
  }
  ledgerRecords {
    ...LedgerRecordsTableFields
  }
}`);
var TrialBalanceReportDocument = new TypedDocumentString(`
    query TrialBalanceReport($filters: BusinessTransactionsFilter) {
  businessTransactionsSumFromLedgerRecords(filters: $filters) {
    ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {
      __typename
      ...TrialBalanceTableFields
    }
    ... on CommonError {
      __typename
    }
  }
}
    fragment TrialBalanceTableFields on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {
  businessTransactionsSum {
    business {
      id
      name
      sortCode {
        id
        key
        name
      }
    }
    credit {
      formatted
      raw
    }
    debit {
      formatted
      raw
    }
    total {
      formatted
      raw
    }
  }
}`);
var ValidatePcn874ReportsDocument = new TypedDocumentString(`
    query ValidatePcn874Reports($businessId: UUID, $fromMonthDate: TimelessDate!, $toMonthDate: TimelessDate!) {
  pcnByDate(
    businessId: $businessId
    fromMonthDate: $fromMonthDate
    toMonthDate: $toMonthDate
  ) @stream {
    id
    business {
      id
      name
    }
    date
    content
    diffContent
  }
}
    `);
var VatMonthlyReportDocument = new TypedDocumentString(`
    query VatMonthlyReport($filters: VatReportFilter) {
  vatReport(filters: $filters) {
    ...VatReportSummaryFields
    ...VatReportIncomeFields
    ...VatReportExpensesFields
    ...VatReportMissingInfoFields
    ...VatReportMiscTableFields
    ...VatReportBusinessTripsFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}
fragment VatReportBusinessTripsFields on VatReportResult {
  businessTrips {
    id
    ...ChargeForChargesTableFields
  }
}
fragment VatReportAccountantApprovalFields on VatReportRecord {
  chargeId
  chargeAccountantStatus
}
fragment VatReportExpensesRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  chargeId
  amount {
    formatted
    raw
  }
  localAmount {
    formatted
    raw
  }
  localVat {
    formatted
    raw
  }
  foreignVatAfterDeduction {
    formatted
    raw
  }
  localVatAfterDeduction {
    formatted
    raw
  }
  roundedLocalVatAfterDeduction {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}
fragment VatReportExpensesFields on VatReportResult {
  expenses {
    ...VatReportExpensesRowFields
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}
fragment VatReportIncomeRowFields on VatReportRecord {
  ...VatReportAccountantApprovalFields
  chargeId
  business {
    id
    name
  }
  vatNumber
  image
  allocationNumber
  documentSerial
  documentDate
  chargeDate
  taxReducedForeignAmount {
    formatted
    raw
  }
  taxReducedLocalAmount {
    formatted
    raw
  }
  recordType
}
fragment VatReportIncomeFields on VatReportResult {
  income {
    ...VatReportIncomeRowFields
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}
fragment VatReportMiscTableFields on VatReportResult {
  differentMonthDoc {
    id
    ...ChargeForChargesTableFields
  }
}
fragment VatReportMissingInfoFields on VatReportResult {
  missingInfo {
    id
    ...ChargeForChargesTableFields
  }
}
fragment VatReportSummaryFields on VatReportResult {
  expenses {
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
    isProperty
  }
  income {
    roundedLocalVatAfterDeduction {
      raw
    }
    taxReducedLocalAmount {
      raw
    }
    recordType
  }
}`);
var GeneratePcnDocument = new TypedDocumentString(`
    query GeneratePCN($monthDate: TimelessDate!, $financialEntityId: UUID!) {
  pcnFile(monthDate: $monthDate, financialEntityId: $financialEntityId) {
    reportContent
    fileName
  }
}
    `);
var YearlyLedgerDocument = new TypedDocumentString(`
    query YearlyLedger($year: Int!) {
  yearlyLedgerReport(year: $year) {
    id
    year
    financialEntitiesInfo {
      entity {
        id
        name
        sortCode {
          id
          key
        }
      }
      openingBalance {
        raw
      }
      totalCredit {
        raw
      }
      totalDebit {
        raw
      }
      closingBalance {
        raw
      }
      records {
        id
        amount {
          raw
          formatted
        }
        invoiceDate
        valueDate
        description
        reference
        counterParty {
          id
          name
        }
        balance
      }
    }
    ...LedgerCsvFields
  }
}
    fragment LedgerCsvFields on YearlyLedgerReport {
  id
  year
  financialEntitiesInfo {
    entity {
      id
      name
      sortCode {
        id
        key
      }
    }
    openingBalance {
      raw
    }
    totalCredit {
      raw
    }
    totalDebit {
      raw
    }
    closingBalance {
      raw
    }
    records {
      id
      amount {
        raw
        formatted
      }
      invoiceDate
      valueDate
      description
      reference
      counterParty {
        id
        name
      }
      balance
    }
  }
}`);
var SalaryScreenRecordsDocument = new TypedDocumentString(`
    query SalaryScreenRecords($fromDate: TimelessDate!, $toDate: TimelessDate!, $employeeIDs: [UUID!]) {
  salaryRecordsByDates(
    fromDate: $fromDate
    toDate: $toDate
    employeeIDs: $employeeIDs
  ) {
    month
    employee {
      id
    }
    ...SalariesTableFields
  }
}
    fragment SalariesRecordEmployeeFields on Salary {
  month
  employee {
    id
    name
  }
}
fragment SalariesRecordFundsFields on Salary {
  month
  employee {
    id
  }
  pensionFund {
    id
    name
  }
  pensionEmployeeAmount {
    formatted
    raw
  }
  pensionEmployeePercentage
  pensionEmployerAmount {
    formatted
    raw
  }
  pensionEmployerPercentage
  compensationsAmount {
    formatted
    raw
  }
  compensationsPercentage
  trainingFund {
    id
    name
  }
  trainingFundEmployeeAmount {
    formatted
    raw
  }
  trainingFundEmployeePercentage
  trainingFundEmployerAmount {
    formatted
    raw
  }
  trainingFundEmployerPercentage
}
fragment SalariesRecordInsurancesAndTaxesFields on Salary {
  month
  employee {
    id
  }
  healthInsuranceAmount {
    formatted
    raw
  }
  socialSecurityEmployeeAmount {
    formatted
    raw
  }
  socialSecurityEmployerAmount {
    formatted
    raw
  }
  incomeTaxAmount {
    formatted
    raw
  }
  notionalExpense {
    formatted
    raw
  }
}
fragment SalariesRecordMainSalaryFields on Salary {
  month
  employee {
    id
  }
  baseAmount {
    formatted
  }
  directAmount {
    formatted
  }
  globalAdditionalHoursAmount {
    formatted
  }
  bonus {
    formatted
    raw
  }
  gift {
    formatted
    raw
  }
  recovery {
    formatted
    raw
  }
  vacationTakeout {
    formatted
    raw
  }
}
fragment SalariesRecordWorkFrameFields on Salary {
  month
  employee {
    id
  }
  vacationDays {
    added
    taken
    balance
  }
  workDays
  sicknessDays {
    balance
  }
}
fragment SalariesMonthFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordFields
}
fragment SalariesTableFields on Salary {
  month
  employee {
    id
  }
  ...SalariesMonthFields
}
fragment SalariesRecordFields on Salary {
  month
  employee {
    id
  }
  ...SalariesRecordEmployeeFields
  ...SalariesRecordMainSalaryFields
  ...SalariesRecordFundsFields
  ...SalariesRecordInsurancesAndTaxesFields
  ...SalariesRecordWorkFrameFields
}`);
var AllDepositsDocument = new TypedDocumentString(`
    query AllDeposits {
  allDeposits {
    id
    name
    currency
    openDate
    closeDate
    isOpen
    metadata {
      id
      currentBalance {
        raw
        formatted
      }
      totalDeposit {
        raw
        formatted
      }
      totalInterest {
        raw
        formatted
      }
    }
  }
}
    `);
var BusinessScreenDocument = new TypedDocumentString(`
    query BusinessScreen($businessId: UUID!) {
  business(id: $businessId) {
    id
    ...BusinessPage
  }
}
    fragment BusinessAdminSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    adminInfo {
      id
      registrationDate
      withholdingTaxAnnualIds {
        id
        year
      }
      withholdingTaxCompanyId
      socialSecurityEmployerIds {
        id
        year
      }
      socialSecurityDeductionsId
      taxAdvancesAnnualIds {
        id
        year
      }
      taxAdvancesRates {
        date
        rate
      }
    }
  }
}
fragment BusinessHeader on Business {
  __typename
  id
  name
  createdAt
  isActive
  ... on LtdFinancialEntity {
    governmentId
    adminInfo {
      id
    }
    clientInfo {
      id
    }
  }
}
fragment ClientIntegrationsSection on LtdFinancialEntity {
  id
  clientInfo {
    id
    integrations {
      id
      greenInvoiceInfo {
        businessId
        greenInvoiceId
      }
      hiveId
      linearId
      slackChannelKey
      notionId
      workflowyUrl
    }
  }
}
fragment BusinessConfigurationSection on Business {
  __typename
  id
  pcn874RecordType
  irsCode
  isActive
  ownerId
  ... on LtdFinancialEntity {
    optionalVAT
    exemptDealer
    isReceiptEnough
    isDocumentsOptional
    sortCode {
      id
      key
      defaultIrsCode
    }
    taxCategory {
      id
    }
    suggestions {
      phrases
      emails
      tags {
        id
      }
      description
      emailListener {
        internalEmailLinks
        emailBody
        attachments
      }
    }
    clientInfo {
      id
    }
  }
}
fragment BusinessContactSection on Business {
  __typename
  id
  ... on LtdFinancialEntity {
    name
    hebrewName
    country {
      id
      code
    }
    governmentId
    address
    city
    zipCode
    email
    phoneNumber
    website
    clientInfo {
      id
      emails
    }
  }
}
fragment BusinessPage on Business {
  id
  ... on LtdFinancialEntity {
    clientInfo {
      id
    }
    adminInfo {
      id
    }
  }
  ...ClientIntegrationsSection
  ...BusinessHeader
  ...BusinessContactSection
  ...BusinessConfigurationSection
  ...BusinessAdminSection
}`);
var ContractsScreenDocument = new TypedDocumentString(`
    query ContractsScreen($adminId: UUID!) {
  contractsByAdmin(adminId: $adminId) {
    id
    ...ContractForContractsTableFields
  }
}
    fragment ContractForContractsTableFields on Contract {
  id
  isActive
  client {
    id
    originalBusiness {
      id
      name
    }
  }
  purchaseOrders
  startDate
  endDate
  amount {
    raw
    formatted
  }
  billingCycle
  product
  plan
  operationsLimit
  msCloud
}`);
var AllChargesDocument = new TypedDocumentString(`
    query AllCharges($page: Int, $limit: Int, $filters: ChargeFilter) {
  allCharges(page: $page, limit: $limit, filters: $filters) {
    nodes {
      id
      ...ChargeForChargesTableFields
    }
    pageInfo {
      totalPages
    }
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var ChargeScreenDocument = new TypedDocumentString(`
    query ChargeScreen($chargeId: UUID!) {
  charge(chargeId: $chargeId) {
    id
    ...ChargeForChargesTableFields
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var MissingInfoChargesDocument = new TypedDocumentString(`
    query MissingInfoCharges($page: Int, $limit: Int) {
  chargesWithMissingRequiredInfo(page: $page, limit: $limit) {
    nodes {
      id
      ...ChargeForChargesTableFields
    }
    pageInfo {
      totalPages
    }
  }
}
    fragment ChargesTableSuggestionsFields on Charge {
  id
  missingInfoSuggestions {
    description
    tags {
      id
      name
      namePath
    }
  }
}
fragment ChargeForChargesTableFields on Charge {
  id
  __typename
  minEventDate
  minDebitDate
  minDocumentsDate
  maxDebitDate
  maxEventDate
  maxDocumentsDate
  totalAmount {
    raw
    currency
  }
  vat {
    raw
  }
  counterparty {
    name
    id
  }
  userDescription
  tags {
    id
    name
    namePath
  }
  taxCategory {
    id
    name
  }
  ... on BusinessTripCharge {
    businessTrip {
      id
      name
    }
  }
  metadata {
    transactionsCount
    documentsCount
    ledgerCount
    miscExpensesCount
    ... on ChargeMetadata @defer {
      invalidLedger
    }
  }
  accountantApproval
  ... on CreditcardBankCharge {
    validCreditCardAmount
  }
  ... on Charge {
    validationData {
      missingInfo
    }
  }
  ...ChargesTableSuggestionsFields @defer
}`);
var DocumentsScreenDocument = new TypedDocumentString(`
    query DocumentsScreen($filters: DocumentsFilters!) {
  documentsByFilters(filters: $filters) {
    id
    image
    file
    charge {
      id
      userDescription
      __typename
      vat {
        formatted
        __typename
      }
      transactions {
        id
        eventDate
        sourceDescription
        effectiveDate
        amount {
          formatted
          __typename
        }
      }
    }
    __typename
    ... on FinancialDocument {
      creditor {
        id
        name
      }
      debtor {
        id
        name
      }
      vat {
        raw
        formatted
        currency
      }
      serialNumber
      date
      amount {
        raw
        formatted
        currency
      }
    }
  }
}
    `);
var MonthlyDocumentDraftByClientDocument = new TypedDocumentString(`
    query MonthlyDocumentDraftByClient($clientId: UUID!, $issueMonth: TimelessDate!) {
  clientMonthlyChargeDraft(clientId: $clientId, issueMonth: $issueMonth) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var MonthlyDocumentsDraftsDocument = new TypedDocumentString(`
    query MonthlyDocumentsDrafts($issueMonth: TimelessDate!) {
  periodicalDocumentDrafts(issueMonth: $issueMonth) {
    ...NewDocumentDraft
  }
}
    fragment IssueDocumentClientFields on Client {
  id
  originalBusiness {
    id
    address
    city
    zipCode
    country {
      id
      code
    }
    governmentId
    name
    phoneNumber
  }
  emails
}
fragment NewDocumentDraft on DocumentDraft {
  description
  remarks
  footer
  type
  date
  dueDate
  language
  currency
  vatType
  discount {
    amount
    type
  }
  rounding
  signed
  maxPayments
  client {
    id
    originalBusiness {
      id
      name
    }
    integrations {
      id
    }
    emails
    ...IssueDocumentClientFields
  }
  income {
    currency
    currencyRate
    description
    itemId
    price
    quantity
    vatRate
    vatType
  }
  payment {
    currency
    currencyRate
    date
    price
    type
    bankName
    bankBranch
    bankAccount
    chequeNum
    accountId
    transactionId
    cardType
    cardNum
    numPayments
    firstPayment
  }
  linkedDocumentIds
  linkedPaymentId
}`);
var AllOpenContractsDocument = new TypedDocumentString(`
    query AllOpenContracts {
  allOpenContracts {
    id
    client {
      id
      originalBusiness {
        id
        name
      }
    }
    billingCycle
  }
}
    `);
var AnnualAuditStepsStatusDocument = new TypedDocumentString(`
    query AnnualAuditStepsStatus($ownerId: UUID!, $year: Int!) {
  annualAuditStepStatuses(ownerId: $ownerId, year: $year) {
    id
    stepId
    status
    notes
  }
}
    `);
var AccountantApprovalStatusDocument = new TypedDocumentString(`
    query AccountantApprovalStatus($fromDate: TimelessDate!, $toDate: TimelessDate!) {
  accountantApprovalStatus(from: $fromDate, to: $toDate) {
    totalCharges
    approvedCount
    pendingCount
    unapprovedCount
  }
}
    `);
var LedgerValidationStatusDocument = new TypedDocumentString(`
    query LedgerValidationStatus($limit: Int, $filters: ChargeFilter) {
  chargesWithLedgerChanges(limit: $limit, filters: $filters) {
    charge {
      id
    }
  }
}
    `);
var AnnualAuditOpeningBalanceStatusDocument = new TypedDocumentString(`
    query AnnualAuditOpeningBalanceStatus($ownerId: UUID!, $year: Int!) {
  annualAuditOpeningBalanceStatus(ownerId: $ownerId, year: $year) {
    id
    userType
    balanceChargeId
    derivedStatus
    errorMessage
  }
}
    `);
var AnnualFinancialChargesDocument = new TypedDocumentString(`
    query AnnualFinancialCharges($ownerId: UUID, $year: TimelessDate!) {
  annualFinancialCharges(ownerId: $ownerId, year: $year) {
    id
    revaluationCharge {
      id
    }
    taxExpensesCharge {
      id
    }
    depreciationCharge {
      id
    }
    recoveryReserveCharge {
      id
    }
    vacationReserveCharge {
      id
    }
    bankDepositsRevaluationCharge {
      id
    }
  }
}
    `);
var Step05PrevYearTemplateDocument = new TypedDocumentString(`
    query Step05PrevYearTemplate($ownerId: UUID!, $year: Int!) {
  annualAuditStepStatuses(ownerId: $ownerId, year: $year) {
    id
    stepId
    status
    evidence
  }
}
    `);
var AdminLedgerLockDateDocument = new TypedDocumentString(`
    query AdminLedgerLockDate($ownerId: UUID) {
  adminContext(ownerId: $ownerId) {
    id
    ledgerLock
  }
}
    `);
var Step09SaveTemplateStatusDocument = new TypedDocumentString(`
    query Step09SaveTemplateStatus($ownerId: UUID!, $year: Int!) {
  annualAuditStepStatuses(ownerId: $ownerId, year: $year) {
    id
    stepId
    status
    evidence
  }
}
    `);
var AnnualRevenueReportScreenDocument = new TypedDocumentString(`
    query AnnualRevenueReportScreen($filters: AnnualRevenueReportFilter!) {
  annualRevenueReport(filters: $filters) {
    id
    year
    countries {
      id
      name
      revenueLocal {
        raw
        currency
      }
      revenueDefaultForeign {
        raw
        currency
      }
      clients {
        id
        name
        revenueLocal {
          raw
        }
        revenueDefaultForeign {
          raw
        }
        records {
          id
          date
          description
          reference
          chargeId
          revenueLocal {
            raw
          }
          revenueDefaultForeign {
            raw
          }
        }
      }
      ...AnnualRevenueReportCountry
    }
  }
}
    fragment AnnualRevenueReportClient on AnnualRevenueReportCountryClient {
  id
  name
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  records {
    id
    date
    ...AnnualRevenueReportRecord
  }
}
fragment AnnualRevenueReportCountry on AnnualRevenueReportCountry {
  id
  code
  name
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  clients {
    id
    revenueDefaultForeign {
      raw
    }
    ...AnnualRevenueReportClient
  }
}
fragment AnnualRevenueReportRecord on AnnualRevenueReportClientRecord {
  id
  revenueLocal {
    raw
    formatted
    currency
  }
  revenueDefaultForeign {
    raw
    formatted
    currency
  }
  revenueOriginal {
    raw
    formatted
    currency
  }
  chargeId
  date
  description
  reference
}`);
var BalanceReportExtendedTransactionsDocument = new TypedDocumentString(`
    query BalanceReportExtendedTransactions($transactionIDs: [UUID!]!) {
  transactionsByIDs(transactionIDs: $transactionIDs) {
    id
    ...TransactionForTransactionsTableFields
    ...TransactionToDownloadForTransactionsTableFields
  }
}
    fragment TransactionForTransactionsTableFields on Transaction {
  id
  isFee
  chargeId
  eventDate
  effectiveDate
  sourceEffectiveDate
  amount {
    raw
    formatted
  }
  cryptoExchangeRate {
    rate
  }
  account {
    id
    name
    type
  }
  sourceDescription
  referenceKey
  counterparty {
    name
    id
  }
  missingInfoSuggestions {
    business {
      id
      name
    }
  }
}
fragment TransactionToDownloadForTransactionsTableFields on Transaction {
  id
  account {
    id
    name
    type
  }
  amount {
    currency
    raw
  }
  counterparty {
    id
    name
  }
  effectiveDate
  eventDate
  referenceKey
  sourceDescription
}`);
var BalanceReportScreenDocument = new TypedDocumentString(`
    query BalanceReportScreen($fromDate: TimelessDate!, $toDate: TimelessDate!, $ownerId: UUID) {
  transactionsForBalanceReport(
    fromDate: $fromDate
    toDate: $toDate
    ownerId: $ownerId
  ) {
    id
    amountUsd {
      formatted
      raw
    }
    amount {
      currency
      raw
    }
    date
    month
    year
    counterparty {
      id
    }
    account {
      id
      name
    }
    isFee
    description
    charge {
      id
      tags {
        id
        name
      }
    }
  }
}
    `);
var DepreciationReportScreenDocument = new TypedDocumentString(`
    query DepreciationReportScreen($filters: DepreciationReportFilter!) {
  depreciationReport(filters: $filters) {
    id
    year
    categories {
      id
      category {
        id
        name
        percentage
      }
      records {
        id
        chargeId
        description
        purchaseDate
        activationDate
        statutoryDepreciationRate
        claimedDepreciationRate
        ...DepreciationReportRecordCore
      }
      summary {
        id
        ...DepreciationReportRecordCore
      }
    }
    summary {
      id
      ...DepreciationReportRecordCore
    }
  }
}
    fragment DepreciationReportRecordCore on DepreciationCoreRecord {
  id
  originalCost
  reportYearDelta
  totalDepreciableCosts
  reportYearClaimedDepreciation
  pastYearsAccumulatedDepreciation
  totalDepreciation
  netValue
}`);
var Shaam6111ReportScreenDocument = new TypedDocumentString(`
    query Shaam6111ReportScreen($year: Int!, $businessId: UUID) {
  shaam6111(year: $year, businessId: $businessId) {
    id
    year
    data {
      id
      ...Shaam6111DataContent
    }
    business {
      id
      ...Shaam6111DataContentHeaderBusiness
    }
  }
}
    fragment Shaam6111DataContentBalanceSheet on Shaam6111Data {
  id
  balanceSheet {
    code
    amount
    label
  }
}
fragment Shaam6111DataContentHeader on Shaam6111Data {
  id
  header {
    taxYear
    businessDescription
    taxFileNumber
    idNumber
    vatFileNumber
    withholdingTaxFileNumber
    businessType
    reportingMethod
    currencyType
    amountsInThousands
    accountingMethod
    accountingSystem
    softwareRegistrationNumber
    isPartnership
    partnershipCount
    partnershipProfitShare
    ifrsImplementationYear
    ifrsReportingOption
    includesProfitLoss
    includesTaxAdjustment
    includesBalanceSheet
    industryCode
    auditOpinionType
  }
}
fragment Shaam6111DataContentHeaderBusiness on Business {
  id
  name
}
fragment Shaam6111DataContentProfitLoss on Shaam6111Data {
  id
  profitAndLoss {
    code
    amount
    label
  }
}
fragment Shaam6111DataContent on Shaam6111Data {
  id
  ...Shaam6111DataContentHeader
  ...Shaam6111DataContentProfitLoss
  ...Shaam6111DataContentTaxAdjustment
  ...Shaam6111DataContentBalanceSheet
}
fragment Shaam6111DataContentTaxAdjustment on Shaam6111Data {
  id
  taxAdjustment {
    code
    amount
    label
  }
}`);
var AllSortCodesForScreenDocument = new TypedDocumentString(`
    query AllSortCodesForScreen {
  allSortCodes {
    id
    ownerId
    key
    name
    defaultIrsCode
  }
}
    `);
var AllTagsScreenDocument = new TypedDocumentString(`
    query AllTagsScreen {
  allTags {
    id
    name
    namePath
    parent {
      id
    }
    ...EditTagFields
  }
}
    fragment EditTagFields on Tag {
  id
  name
  parent {
    id
    name
  }
}`);
var AllTaxCategoriesForScreenDocument = new TypedDocumentString(`
    query AllTaxCategoriesForScreen {
  taxCategories {
    id
    name
    sortCode {
      id
      key
      name
    }
  }
}
    `);
var AcceptInvitationDocument = new TypedDocumentString(`
    mutation AcceptInvitation($token: String!) {
  acceptInvitation(token: $token) {
    success
    businessId
    roleId
  }
}
    `);
var AddBusinessTripAccommodationsExpenseDocument = new TypedDocumentString(`
    mutation AddBusinessTripAccommodationsExpense($fields: AddBusinessTripAccommodationsExpenseInput!) {
  addBusinessTripAccommodationsExpense(fields: $fields)
}
    `);
var AddBusinessTripCarRentalExpenseDocument = new TypedDocumentString(`
    mutation AddBusinessTripCarRentalExpense($fields: AddBusinessTripCarRentalExpenseInput!) {
  addBusinessTripCarRentalExpense(fields: $fields)
}
    `);
var AddBusinessTripFlightsExpenseDocument = new TypedDocumentString(`
    mutation AddBusinessTripFlightsExpense($fields: AddBusinessTripFlightsExpenseInput!) {
  addBusinessTripFlightsExpense(fields: $fields)
}
    `);
var AddBusinessTripOtherExpenseDocument = new TypedDocumentString(`
    mutation AddBusinessTripOtherExpense($fields: AddBusinessTripOtherExpenseInput!) {
  addBusinessTripOtherExpense(fields: $fields)
}
    `);
var AddBusinessTripTravelAndSubsistenceExpenseDocument = new TypedDocumentString(`
    mutation AddBusinessTripTravelAndSubsistenceExpense($fields: AddBusinessTripTravelAndSubsistenceExpenseInput!) {
  addBusinessTripTravelAndSubsistenceExpense(fields: $fields)
}
    `);
var AddDepreciationRecordDocument = new TypedDocumentString(`
    mutation AddDepreciationRecord($fields: InsertDepreciationRecordInput!) {
  insertDepreciationRecord(input: $fields) {
    __typename
    ... on CommonError {
      message
    }
    ... on DepreciationRecord {
      id
    }
  }
}
    `);
var AddSortCodeDocument = new TypedDocumentString(`
    mutation AddSortCode($key: Int!, $name: String!, $defaultIrsCode: Int) {
  addSortCode(key: $key, name: $name, defaultIrsCode: $defaultIrsCode)
}
    `);
var AddTagDocument = new TypedDocumentString(`
    mutation AddTag($tagName: String!, $parentTag: UUID) {
  addTag(name: $tagName, parentId: $parentTag)
}
    `);
var AnnualAuditStepStatusDocument = new TypedDocumentString(`
    query AnnualAuditStepStatus($ownerId: UUID!, $year: Int!) {
  annualAuditStepStatuses(ownerId: $ownerId, year: $year) {
    id
    stepId
    status
  }
}
    `);
var AssignChargeToDepositDocument = new TypedDocumentString(`
    mutation AssignChargeToDeposit($chargeId: UUID!, $depositId: String!) {
  assignChargeToDeposit(chargeId: $chargeId, depositId: $depositId) {
    id
  }
}
    `);
var GenerateBalanceChargeDocument = new TypedDocumentString(`
    mutation GenerateBalanceCharge($description: String!, $balanceRecords: [InsertMiscExpenseInput!]!) {
  generateBalanceCharge(
    description: $description
    balanceRecords: $balanceRecords
  ) {
    id
  }
}
    `);
var BatchUpdateBusinessesDocument = new TypedDocumentString(`
    mutation BatchUpdateBusinesses($businessIds: [UUID!]!, $fields: BatchUpdateBusinessInput!) {
  batchUpdateBusinesses(businessIds: $businessIds, fields: $fields) {
    id
  }
}
    `);
var BatchUpdateChargesDocument = new TypedDocumentString(`
    mutation BatchUpdateCharges($chargeIds: [UUID!]!, $fields: UpdateChargeInput!) {
  batchUpdateCharges(chargeIds: $chargeIds, fields: $fields) {
    __typename
    ... on BatchUpdateChargesSuccessfulResult {
      charges {
        id
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var CategorizeBusinessTripExpenseDocument = new TypedDocumentString(`
    mutation CategorizeBusinessTripExpense($fields: CategorizeBusinessTripExpenseInput!) {
  categorizeBusinessTripExpense(fields: $fields)
}
    `);
var CategorizeIntoExistingBusinessTripExpenseDocument = new TypedDocumentString(`
    mutation CategorizeIntoExistingBusinessTripExpense($fields: CategorizeIntoExistingBusinessTripExpenseInput!) {
  categorizeIntoExistingBusinessTripExpense(fields: $fields)
}
    `);
var CloseDocumentDocument = new TypedDocumentString(`
    mutation CloseDocument($documentId: UUID!) {
  closeDocument(id: $documentId)
}
    `);
var CreateContractDocument = new TypedDocumentString(`
    mutation CreateContract($input: CreateContractInput!) {
  createContract(input: $input) {
    id
  }
}
    `);
var CreateDepositFromChargeDocument = new TypedDocumentString(`
    mutation CreateDepositFromCharge($chargeId: UUID!, $name: String!) {
  createDepositFromCharge(chargeId: $chargeId, name: $name) {
    id
    name
    currency
    isOpen
  }
}
    `);
var CreateDepositDocument = new TypedDocumentString(`
    mutation CreateDeposit($name: String!, $currency: Currency!, $openDate: TimelessDate!, $accountId: UUID) {
  createDeposit(
    name: $name
    currency: $currency
    openDate: $openDate
    accountId: $accountId
  ) {
    id
    currency
    isOpen
  }
}
    `);
var CreateFinancialAccountDocument = new TypedDocumentString(`
    mutation CreateFinancialAccount($input: CreateFinancialAccountInput!) {
  createFinancialAccount(input: $input) {
    id
  }
}
    `);
var CreateInvitationDocument = new TypedDocumentString(`
    mutation CreateInvitation($email: String!, $roleId: String!) {
  createInvitation(email: $email, roleId: $roleId) {
    id
    email
    roleId
    expiresAt
  }
}
    `);
var CreditShareholdersBusinessTripTravelAndSubsistenceDocument = new TypedDocumentString(`
    mutation CreditShareholdersBusinessTripTravelAndSubsistence($businessTripId: UUID!) {
  creditShareholdersBusinessTripTravelAndSubsistence(
    businessTripId: $businessTripId
  )
}
    `);
var FlagForeignFeeTransactionsDocument = new TypedDocumentString(`
    mutation FlagForeignFeeTransactions {
  flagForeignFeeTransactions {
    success
    errors
  }
}
    `);
var MergeChargesByTransactionReferenceDocument = new TypedDocumentString(`
    mutation MergeChargesByTransactionReference($dryRun: Boolean) {
  mergeChargesByTransactionReference(dryRun: $dryRun) {
    success
    errors
  }
}
    `);
var CalculateCreditcardTransactionsDebitDateDocument = new TypedDocumentString(`
    mutation CalculateCreditcardTransactionsDebitDate {
  calculateCreditcardTransactionsDebitDate
}
    `);
var DeleteBusinessTripAttendeeDocument = new TypedDocumentString(`
    mutation DeleteBusinessTripAttendee($fields: DeleteBusinessTripAttendeeInput!) {
  deleteBusinessTripAttendee(fields: $fields)
}
    `);
var DeleteBusinessTripExpenseDocument = new TypedDocumentString(`
    mutation DeleteBusinessTripExpense($businessTripExpenseId: UUID!) {
  deleteBusinessTripExpense(businessTripExpenseId: $businessTripExpenseId)
}
    `);
var DeleteBusinessDocument = new TypedDocumentString(`
    mutation DeleteBusiness($businessId: UUID!) {
  deleteBusiness(businessId: $businessId)
}
    `);
var DeleteChargeDocument = new TypedDocumentString(`
    mutation DeleteCharge($chargeId: UUID!) {
  deleteCharge(chargeId: $chargeId)
}
    `);
var DeleteContractDocument = new TypedDocumentString(`
    mutation DeleteContract($contractId: UUID!) {
  deleteContract(id: $contractId)
}
    `);
var DeleteDepreciationRecordDocument = new TypedDocumentString(`
    mutation DeleteDepreciationRecord($depreciationRecordId: UUID!) {
  deleteDepreciationRecord(depreciationRecordId: $depreciationRecordId)
}
    `);
var DeleteDocumentDocument = new TypedDocumentString(`
    mutation DeleteDocument($documentId: UUID!) {
  deleteDocument(documentId: $documentId)
}
    `);
var DeleteDynamicReportTemplateDocument = new TypedDocumentString(`
    mutation DeleteDynamicReportTemplate($name: String!) {
  deleteDynamicReportTemplate(name: $name)
}
    `);
var DeleteMiscExpenseDocument = new TypedDocumentString(`
    mutation DeleteMiscExpense($id: UUID!) {
  deleteMiscExpense(id: $id)
}
    `);
var DeleteProviderCredentialsDocument = new TypedDocumentString(`
    mutation DeleteProviderCredentials($provider: ProviderKey!) {
  deleteProviderCredentials(provider: $provider) {
    ... on ProviderCredentialDeleteResult {
      id
      provider
      success
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var DeleteTagDocument = new TypedDocumentString(`
    mutation DeleteTag($tagId: UUID!) {
  deleteTag(id: $tagId)
}
    `);
var FetchDeelDocumentsDocument = new TypedDocumentString(`
    mutation FetchDeelDocuments {
  fetchDeelDocuments {
    id
  }
}
    `);
var GenerateApiKeyDocument = new TypedDocumentString(`
    mutation GenerateApiKey($name: String!, $roleId: String!) {
  generateApiKey(name: $name, roleId: $roleId) {
    apiKey
    record {
      id
      name
      roleId
      lastUsedAt
      createdAt
    }
  }
}
    `);
var GenerateRevaluationChargeDocument = new TypedDocumentString(`
    mutation GenerateRevaluationCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateRevaluationCharge(ownerId: $ownerId, date: $date) {
    id
  }
}
    `);
var GenerateBankDepositsRevaluationChargeDocument = new TypedDocumentString(`
    mutation GenerateBankDepositsRevaluationCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateBankDepositsRevaluationCharge(ownerId: $ownerId, date: $date) {
    id
  }
}
    `);
var GenerateTaxExpensesChargeDocument = new TypedDocumentString(`
    mutation GenerateTaxExpensesCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateTaxExpensesCharge(ownerId: $ownerId, year: $date) {
    id
  }
}
    `);
var GenerateDepreciationChargeDocument = new TypedDocumentString(`
    mutation GenerateDepreciationCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateDepreciationCharge(ownerId: $ownerId, year: $date) {
    id
  }
}
    `);
var GenerateRecoveryReserveChargeDocument = new TypedDocumentString(`
    mutation GenerateRecoveryReserveCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateRecoveryReserveCharge(ownerId: $ownerId, year: $date) {
    id
  }
}
    `);
var GenerateVacationReserveChargeDocument = new TypedDocumentString(`
    mutation GenerateVacationReserveCharge($ownerId: UUID!, $date: TimelessDate!) {
  generateVacationReserveCharge(ownerId: $ownerId, year: $date) {
    id
  }
}
    `);
var AllAdminBusinessesDocument = new TypedDocumentString(`
    query AllAdminBusinesses {
  allAdminBusinesses {
    id
    name
    governmentId
  }
}
    `);
var AllClientsDocument = new TypedDocumentString(`
    query AllClients {
  allClients {
    id
    originalBusiness {
      id
      name
    }
  }
}
    `);
var AllBusinessesDocument = new TypedDocumentString(`
    query AllBusinesses {
  allBusinesses {
    nodes {
      id
      name
    }
  }
}
    `);
var AllCountriesDocument = new TypedDocumentString(`
    query AllCountries {
  allCountries {
    id
    name
    code
  }
}
    `);
var AllFinancialAccountsDocument = new TypedDocumentString(`
    query AllFinancialAccounts {
  allFinancialAccounts {
    id
    name
  }
}
    `);
var AllFinancialEntitiesDocument = new TypedDocumentString(`
    query AllFinancialEntities {
  allFinancialEntities {
    nodes {
      id
      name
    }
  }
}
    `);
var AllSortCodesDocument = new TypedDocumentString(`
    query AllSortCodes($ownerId: String!) {
  allSortCodesByBusiness(ownerId: $ownerId) {
    id
    key
    name
    defaultIrsCode
  }
}
    `);
var AllTagsDocument = new TypedDocumentString(`
    query AllTags {
  allTags {
    id
    name
    namePath
  }
}
    `);
var AllTaxCategoriesDocument = new TypedDocumentString(`
    query AllTaxCategories {
  taxCategories {
    id
    name
  }
}
    `);
var InsertBusinessTripAttendeeDocument = new TypedDocumentString(`
    mutation InsertBusinessTripAttendee($fields: InsertBusinessTripAttendeeInput!) {
  insertBusinessTripAttendee(fields: $fields)
}
    `);
var InsertBusinessTripDocument = new TypedDocumentString(`
    mutation InsertBusinessTrip($fields: InsertBusinessTripInput!) {
  insertBusinessTrip(fields: $fields)
}
    `);
var InsertBusinessDocument = new TypedDocumentString(`
    mutation InsertBusiness($fields: InsertNewBusinessInput!) {
  insertNewBusiness(fields: $fields) {
    __typename
    ... on LtdFinancialEntity {
      id
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var InsertClientDocument = new TypedDocumentString(`
    mutation InsertClient($fields: ClientInsertInput!) {
  insertClient(fields: $fields) {
    __typename
    ... on Client {
      id
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var InsertDocumentDocument = new TypedDocumentString(`
    mutation InsertDocument($record: InsertDocumentInput!) {
  insertDocument(record: $record) {
    __typename
    ... on InsertDocumentSuccessfulResult {
      document {
        id
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var InsertDynamicReportTemplateDocument = new TypedDocumentString(`
    mutation InsertDynamicReportTemplate($name: String!, $template: String!) {
  insertDynamicReportTemplate(name: $name, template: $template) {
    id
    name
  }
}
    `);
var InsertMiscExpenseDocument = new TypedDocumentString(`
    mutation InsertMiscExpense($chargeId: UUID!, $fields: InsertMiscExpenseInput!) {
  insertMiscExpense(chargeId: $chargeId, fields: $fields) {
    id
  }
}
    `);
var InsertMiscExpensesDocument = new TypedDocumentString(`
    mutation InsertMiscExpenses($chargeId: UUID!, $expenses: [InsertMiscExpenseInput!]!) {
  insertMiscExpenses(chargeId: $chargeId, expenses: $expenses) {
    id
  }
}
    `);
var InsertSalaryRecordDocument = new TypedDocumentString(`
    mutation InsertSalaryRecord($salaryRecords: [SalaryRecordInput!]!) {
  insertSalaryRecords(salaryRecords: $salaryRecords) {
    __typename
    ... on InsertSalaryRecordsSuccessfulResult {
      salaryRecords {
        month
        employee {
          id
        }
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var InsertTaxCategoryDocument = new TypedDocumentString(`
    mutation InsertTaxCategory($fields: InsertTaxCategoryInput!) {
  insertTaxCategory(fields: $fields) {
    id
    name
  }
}
    `);
var IssueGreenInvoiceDocumentDocument = new TypedDocumentString(`
    mutation IssueGreenInvoiceDocument($input: DocumentIssueInput!, $emailContent: String, $attachment: Boolean, $chargeId: UUID) {
  issueGreenInvoiceDocument(
    input: $input
    emailContent: $emailContent
    attachment: $attachment
    chargeId: $chargeId
  ) {
    id
  }
}
    `);
var IssueMonthlyDocumentsDocument = new TypedDocumentString(`
    mutation IssueMonthlyDocuments($generateDocumentsInfo: [DocumentIssueInput!]!) {
  issueGreenInvoiceDocuments(generateDocumentsInfo: $generateDocumentsInfo) {
    success
    errors
  }
}
    `);
var LedgerLockDocument = new TypedDocumentString(`
    mutation LedgerLock($date: TimelessDate!) {
  lockLedgerRecords(date: $date)
}
    `);
var LockDynamicReportTemplateDocument = new TypedDocumentString(`
    mutation LockDynamicReportTemplate($name: String!) {
  lockDynamicReportTemplate(name: $name) {
    id
    name
    isLocked
    updated
  }
}
    `);
var MergeBusinessesDocument = new TypedDocumentString(`
    mutation MergeBusinesses($targetBusinessId: UUID!, $businessIdsToMerge: [UUID!]!) {
  mergeBusinesses(
    targetBusinessId: $targetBusinessId
    businessIdsToMerge: $businessIdsToMerge
  ) {
    __typename
    id
  }
}
    `);
var MergeChargesDocument = new TypedDocumentString(`
    mutation MergeCharges($baseChargeID: UUID!, $chargeIdsToMerge: [UUID!]!, $fields: UpdateChargeInput) {
  mergeCharges(
    baseChargeID: $baseChargeID
    chargeIdsToMerge: $chargeIdsToMerge
    fields: $fields
  ) {
    __typename
    ... on MergeChargeSuccessfulResult {
      charge {
        id
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var PreviewDocumentDocument = new TypedDocumentString(`
    mutation PreviewDocument($input: DocumentIssueInput!) {
  previewDocument(input: $input)
}
    `);
var ProviderCredentialsDocument = new TypedDocumentString(`
    query ProviderCredentials {
  providerCredentials {
    id
    provider
    configuredAt
  }
}
    `);
var RegenerateLedgerDocument = new TypedDocumentString(`
    mutation RegenerateLedger($chargeId: UUID!) {
  regenerateLedgerRecords(chargeId: $chargeId) {
    __typename
    ... on Ledger {
      records {
        id
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var RelevantDepositsForChargeDocument = new TypedDocumentString(`
    query RelevantDepositsForCharge($chargeId: UUID!) {
  relevantDepositsForCharge(chargeId: $chargeId) {
    id
    deposits {
      id
      name
      currency
      isOpen
    }
    error
  }
}
    `);
var RemoveBusinessUserDocument = new TypedDocumentString(`
    mutation RemoveBusinessUser($userId: ID!) {
  removeBusinessUser(userId: $userId)
}
    `);
var RevokeApiKeyDocument = new TypedDocumentString(`
    mutation RevokeApiKey($id: ID!) {
  revokeApiKey(id: $id)
}
    `);
var RevokeInvitationDocument = new TypedDocumentString(`
    mutation RevokeInvitation($id: ID!) {
  revokeInvitation(id: $id)
}
    `);
var SetAnnualAuditStepStatusDocument = new TypedDocumentString(`
    mutation SetAnnualAuditStepStatus($input: SetAnnualAuditStepStatusInput!) {
  setAnnualAuditStepStatus(input: $input) {
    id
    ownerId
    year
    stepId
    status
    notes
    evidence
    updatedAt
    completedAt
  }
}
    `);
var SetAnnualAuditStep03StatusDocument = new TypedDocumentString(`
    mutation SetAnnualAuditStep03Status($input: SetAnnualAuditStep03StatusInput!) {
  setAnnualAuditStep03Status(input: $input) {
    id
    ownerId
    year
    stepId
    status
    notes
    updatedAt
    completedAt
  }
}
    `);
var SetAnnualAuditStep09StatusDocument = new TypedDocumentString(`
    mutation SetAnnualAuditStep09Status($input: SetAnnualAuditStep09StatusInput!) {
  setAnnualAuditStep09Status(input: $input) {
    id
    ownerId
    year
    stepId
    status
    notes
    evidence
    updatedAt
    completedAt
  }
}
    `);
var SetDeelCredentialsDocument = new TypedDocumentString(`
    mutation SetDeelCredentials($apiToken: String!) {
  setDeelCredentials(apiToken: $apiToken) {
    ... on ProviderCredentialResult {
      id
      provider
      configuredAt
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var SetGreenInvoiceCredentialsDocument = new TypedDocumentString(`
    mutation SetGreenInvoiceCredentials($id: String!, $secret: String!) {
  setGreenInvoiceCredentials(id: $id, secret: $secret) {
    ... on ProviderCredentialResult {
      id
      provider
      configuredAt
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var SyncGreenInvoiceDocumentsDocument = new TypedDocumentString(`
    mutation SyncGreenInvoiceDocuments($ownerId: UUID!) {
  syncGreenInvoiceDocuments(ownerId: $ownerId) {
    id
    ...NewFetchedDocumentFields
  }
}
    fragment NewFetchedDocumentFields on Document {
  id
  documentType
  charge {
    id
    userDescription
    counterparty {
      id
      name
    }
  }
}`);
var UnlockDynamicReportTemplateDocument = new TypedDocumentString(`
    mutation UnlockDynamicReportTemplate($name: String!) {
  unlockDynamicReportTemplate(name: $name) {
    id
    name
    isLocked
    updated
  }
}
    `);
var UpdateAdminBusinessDocument = new TypedDocumentString(`
    mutation UpdateAdminBusiness($adminBusinessId: UUID!, $fields: UpdateAdminBusinessInput!) {
  updateAdminBusiness(businessId: $adminBusinessId, fields: $fields) {
    id
  }
}
    `);
var UpdateBusinessTripAccommodationsExpenseDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripAccommodationsExpense($fields: UpdateBusinessTripAccommodationsExpenseInput!) {
  updateBusinessTripAccommodationsExpense(fields: $fields)
}
    `);
var UpdateBusinessTripAccountantApprovalDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripAccountantApproval($businessTripId: UUID!, $status: AccountantStatus!) {
  updateBusinessTripAccountantApproval(
    businessTripId: $businessTripId
    approvalStatus: $status
  )
}
    `);
var UpdateBusinessTripAttendeeDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripAttendee($fields: BusinessTripAttendeeUpdateInput!) {
  updateBusinessTripAttendee(fields: $fields)
}
    `);
var UpdateBusinessTripCarRentalExpenseDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripCarRentalExpense($fields: UpdateBusinessTripCarRentalExpenseInput!) {
  updateBusinessTripCarRentalExpense(fields: $fields)
}
    `);
var UpdateBusinessTripFlightsExpenseDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripFlightsExpense($fields: UpdateBusinessTripFlightsExpenseInput!) {
  updateBusinessTripFlightsExpense(fields: $fields)
}
    `);
var UpdateBusinessTripOtherExpenseDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripOtherExpense($fields: UpdateBusinessTripOtherExpenseInput!) {
  updateBusinessTripOtherExpense(fields: $fields)
}
    `);
var UpdateBusinessTripTravelAndSubsistenceExpenseDocument = new TypedDocumentString(`
    mutation UpdateBusinessTripTravelAndSubsistenceExpense($fields: UpdateBusinessTripTravelAndSubsistenceExpenseInput!) {
  updateBusinessTripTravelAndSubsistenceExpense(fields: $fields)
}
    `);
var UpdateBusinessDocument = new TypedDocumentString(`
    mutation UpdateBusiness($businessId: UUID!, $ownerId: UUID!, $fields: UpdateBusinessInput!) {
  updateBusiness(businessId: $businessId, ownerId: $ownerId, fields: $fields) {
    __typename
    ... on LtdFinancialEntity {
      id
      name
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateChargeAccountantApprovalDocument = new TypedDocumentString(`
    mutation UpdateChargeAccountantApproval($chargeId: UUID!, $status: AccountantStatus!) {
  updateChargeAccountantApproval(chargeId: $chargeId, approvalStatus: $status)
}
    `);
var UpdateChargeDocument = new TypedDocumentString(`
    mutation UpdateCharge($chargeId: UUID!, $fields: UpdateChargeInput!) {
  updateCharge(chargeId: $chargeId, fields: $fields) {
    __typename
    ... on UpdateChargeSuccessfulResult {
      charge {
        id
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateClientDocument = new TypedDocumentString(`
    mutation UpdateClient($businessId: UUID!, $fields: ClientUpdateInput!) {
  updateClient(businessId: $businessId, fields: $fields) {
    __typename
    ... on Client {
      id
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateContractDocument = new TypedDocumentString(`
    mutation UpdateContract($contractId: UUID!, $input: UpdateContractInput!) {
  updateContract(contractId: $contractId, input: $input) {
    id
  }
}
    `);
var UpdateDepositDocument = new TypedDocumentString(`
    mutation UpdateDeposit($id: UUID!, $name: String, $openDate: TimelessDate, $closeDate: TimelessDate) {
  updateDeposit(id: $id, name: $name, openDate: $openDate, closeDate: $closeDate) {
    id
    name
    openDate
    closeDate
    isOpen
  }
}
    `);
var UpdateDepreciationRecordDocument = new TypedDocumentString(`
    mutation UpdateDepreciationRecord($fields: UpdateDepreciationRecordInput!) {
  updateDepreciationRecord(input: $fields) {
    __typename
    ... on CommonError {
      message
    }
    ... on DepreciationRecord {
      id
    }
  }
}
    `);
var UpdateDocumentDocument = new TypedDocumentString(`
    mutation UpdateDocument($documentId: UUID!, $fields: UpdateDocumentFieldsInput!) {
  updateDocument(documentId: $documentId, fields: $fields) {
    __typename
    ... on CommonError {
      message
    }
    ... on UpdateDocumentSuccessfulResult {
      document {
        id
      }
    }
  }
}
    `);
var UpdateDynamicReportTemplateNameDocument = new TypedDocumentString(`
    mutation UpdateDynamicReportTemplateName($name: String!, $newName: String!) {
  updateDynamicReportTemplateName(name: $name, newName: $newName) {
    id
    name
  }
}
    `);
var UpdateDynamicReportTemplateDocument = new TypedDocumentString(`
    mutation UpdateDynamicReportTemplate($name: String!, $template: String!) {
  updateDynamicReportTemplate(name: $name, template: $template) {
    id
    name
  }
}
    `);
var UpdateFinancialAccountDocument = new TypedDocumentString(`
    mutation UpdateFinancialAccount($financialAccountId: UUID!, $fields: UpdateFinancialAccountInput!) {
  updateFinancialAccount(id: $financialAccountId, fields: $fields) {
    id
  }
}
    `);
var UpdateMiscExpenseDocument = new TypedDocumentString(`
    mutation UpdateMiscExpense($id: UUID!, $fields: UpdateMiscExpenseInput!) {
  updateMiscExpense(id: $id, fields: $fields) {
    id
  }
}
    `);
var UpdateOrInsertSalaryRecordsDocument = new TypedDocumentString(`
    mutation UpdateOrInsertSalaryRecords($salaryRecords: [SalaryRecordInput!]!) {
  insertOrUpdateSalaryRecords(salaryRecords: $salaryRecords) {
    __typename
    ... on InsertSalaryRecordsSuccessfulResult {
      salaryRecords {
        month
        employee {
          id
        }
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateSalaryRecordDocument = new TypedDocumentString(`
    mutation UpdateSalaryRecord($salaryRecord: SalaryRecordEditInput!) {
  updateSalaryRecord(salaryRecord: $salaryRecord) {
    __typename
    ... on UpdateSalaryRecordSuccessfulResult {
      salaryRecord {
        month
        employee {
          id
        }
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateSortCodeDocument = new TypedDocumentString(`
    mutation UpdateSortCode($key: Int!, $fields: UpdateSortCodeFieldsInput!) {
  updateSortCode(key: $key, fields: $fields)
}
    `);
var UpdateTagDocument = new TypedDocumentString(`
    mutation UpdateTag($tagId: UUID!, $fields: UpdateTagFieldsInput!) {
  updateTag(id: $tagId, fields: $fields)
}
    `);
var UpdateTaxCategoryDocument = new TypedDocumentString(`
    mutation UpdateTaxCategory($taxCategoryId: UUID!, $fields: UpdateTaxCategoryInput!) {
  updateTaxCategory(taxCategoryId: $taxCategoryId, fields: $fields) {
    __typename
    ... on TaxCategory {
      id
      name
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateTransactionDocument = new TypedDocumentString(`
    mutation UpdateTransaction($transactionId: UUID!, $fields: UpdateTransactionInput!) {
  updateTransaction(transactionId: $transactionId, fields: $fields) {
    __typename
    ... on Transaction {
      id
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UpdateTransactionsDocument = new TypedDocumentString(`
    mutation UpdateTransactions($transactionIds: [UUID!]!, $fields: UpdateTransactionInput!) {
  updateTransactions(transactionIds: $transactionIds, fields: $fields) {
    __typename
    ... on UpdatedTransactionsSuccessfulResult {
      transactions {
        ... on Transaction {
          id
        }
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UploadDocumentDocument = new TypedDocumentString(`
    mutation UploadDocument($file: FileScalar!, $chargeId: UUID) {
  uploadDocument(file: $file, chargeId: $chargeId) {
    __typename
    ... on UploadDocumentSuccessfulResult {
      document {
        id
        charge {
          id
        }
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var UploadDocumentsFromGoogleDriveDocument = new TypedDocumentString(`
    mutation UploadDocumentsFromGoogleDrive($sharedFolderUrl: String!, $chargeId: UUID, $isSensitive: Boolean) {
  batchUploadDocumentsFromGoogleDrive(
    sharedFolderUrl: $sharedFolderUrl
    chargeId: $chargeId
    isSensitive: $isSensitive
  ) {
    ... on CommonError {
      message
    }
    ... on UploadDocumentSuccessfulResult {
      document {
        id
        ...NewFetchedDocumentFields
      }
    }
  }
}
    fragment NewFetchedDocumentFields on Document {
  id
  documentType
  charge {
    id
    userDescription
    counterparty {
      id
      name
    }
  }
}`);
var UploadMultipleDocumentsDocument = new TypedDocumentString(`
    mutation UploadMultipleDocuments($documents: [FileScalar!]!, $chargeId: UUID, $isSensitive: Boolean) {
  batchUploadDocuments(
    documents: $documents
    chargeId: $chargeId
    isSensitive: $isSensitive
  ) {
    ... on CommonError {
      message
    }
    ... on UploadDocumentSuccessfulResult {
      document {
        id
        ...NewFetchedDocumentFields
      }
    }
  }
}
    fragment NewFetchedDocumentFields on Document {
  id
  documentType
  charge {
    id
    userDescription
    counterparty {
      id
      name
    }
  }
}`);
var UploadPayrollFileDocument = new TypedDocumentString(`
    mutation UploadPayrollFile($file: FileScalar!, $chargeId: UUID!) {
  insertSalaryRecordsFromFile(file: $file, chargeId: $chargeId)
}
    `);
var UserContextDocument = new TypedDocumentString(`
    query UserContext {
  userContext {
    memberships {
      businessId
      role
      businessName
    }
    activeReadScope
    defaultLocalCurrency
    defaultCryptoConversionFiatCurrency
    ledgerLock
    financialAccountsBusinessesIds
    locality
  }
}
    `);
var RequestIngestControlDocument = new TypedDocumentString(`
    mutation RequestIngestControl($input: IngestControlInput!) {
  requestIngestControl(input: $input) {
    __typename
    ... on IngestControlDecision {
      id
      tenantId
      decisionId
      auditId
      grant {
        id
        jti
        tenantId
        action
        expiresAt
      }
      businessEmailConfig {
        businessId
        internalEmailLinks
        emailBody
        attachments
      }
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var IngestEmailDocument = new TypedDocumentString(`
    mutation IngestEmail($input: IngestEmailInput!) {
  ingestEmail(input: $input) {
    __typename
    ... on IngestEmailSuccess {
      outcome
      ingestId
      existingIngestId
      auditId
      reasonCode
    }
    ... on CommonError {
      message
    }
  }
}
    `);
var BusinessEmailConfigDocument = new TypedDocumentString(`
    query BusinessEmailConfig($email: String!) {
  businessEmailConfig(email: $email) {
    businessId
    internalEmailLinks
    emailBody
    attachments
  }
}
    `);
var InsertEmailDocumentsDocument = new TypedDocumentString(`
    mutation InsertEmailDocuments($documents: [FileScalar!]!, $userDescription: String!, $messageId: String, $businessId: UUID) {
  insertEmailDocuments(
    documents: $documents
    userDescription: $userDescription
    messageId: $messageId
    businessId: $businessId
  )
}
    `);
var UploadPoalimIlsTransactionsDocument = new TypedDocumentString(`
    mutation UploadPoalimIlsTransactions($transactions: [PoalimIlsTransactionInput!]!) {
  uploadPoalimIlsTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadPoalimForeignTransactionsDocument = new TypedDocumentString(`
    mutation UploadPoalimForeignTransactions($transactions: [PoalimForeignTransactionInput!]!) {
  uploadPoalimForeignTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadPoalimSwiftTransactionsDocument = new TypedDocumentString(`
    mutation UploadPoalimSwiftTransactions($swifts: [PoalimSwiftTransactionInput!]!) {
  uploadPoalimSwiftTransactions(swifts: $swifts) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadIsracardTransactionsDocument = new TypedDocumentString(`
    mutation UploadIsracardTransactions($transactions: [IsracardTransactionInput!]!) {
  uploadIsracardTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadAmexTransactionsDocument = new TypedDocumentString(`
    mutation UploadAmexTransactions($transactions: [AmexTransactionInput!]!) {
  uploadAmexTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadCalTransactionsDocument = new TypedDocumentString(`
    mutation UploadCalTransactions($transactions: [CalTransactionInput!]!) {
  uploadCalTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadDiscountTransactionsDocument = new TypedDocumentString(`
    mutation UploadDiscountTransactions($transactions: [DiscountTransactionInput!]!) {
  uploadDiscountTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadMaxTransactionsDocument = new TypedDocumentString(`
    mutation UploadMaxTransactions($transactions: [MaxTransactionInput!]!) {
  uploadMaxTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadCurrencyRatesDocument = new TypedDocumentString(`
    mutation UploadCurrencyRates($rates: [CurrencyRateInput!]!) {
  uploadCurrencyRates(rates: $rates) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadOtsarHahayalIlsTransactionsDocument = new TypedDocumentString(`
    mutation UploadOtsarHahayalIlsTransactions($transactions: [OtsarHahayalIlsTransactionInput!]!) {
  uploadOtsarHahayalIlsTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadOtsarHahayalForeignTransactionsDocument = new TypedDocumentString(`
    mutation UploadOtsarHahayalForeignTransactions($transactions: [OtsarHahayalForeignTransactionInput!]!) {
  uploadOtsarHahayalForeignTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);
var UploadOtsarHahayalCreditCardTransactionsDocument = new TypedDocumentString(`
    mutation UploadOtsarHahayalCreditCardTransactions($transactions: [OtsarHahayalCreditCardTransactionInput!]!) {
  uploadOtsarHahayalCreditCardTransactions(transactions: $transactions) {
    inserted
    skipped
    insertedIds
    insertedTransactions {
      id
      date
      description
      amount
      account
    }
    changedTransactions {
      id
      changedFields {
        field
        oldValue
        newValue
      }
    }
  }
}
    `);

// src/gql/gql.ts
var documents = {
  "\n  query ListApiKeys {\n    listApiKeys {\n      id\n      name\n      roleId\n      lastUsedAt\n      createdAt\n    }\n  }\n": ListApiKeysDocument,
  "\n  query ListBusinessUsers {\n    listBusinessUsers {\n      id\n      email\n      name\n      roleId\n      createdAt\n    }\n  }\n": ListBusinessUsersDocument,
  "\n  query ListInvitations {\n    listInvitations {\n      id\n      email\n      roleId\n      expiresAt\n    }\n  }\n": ListInvitationsDocument,
  "\n  fragment DepositTransactionFields on Transaction {\n    id\n    eventDate\n    chargeId\n    amount {\n      raw\n      formatted\n      currency\n    }\n    debitExchangeRates {\n      aud\n      cad\n      eur\n      gbp\n      jpy\n      sek\n      usd\n      date\n    }\n    eventExchangeRates {\n      aud\n      cad\n      eur\n      gbp\n      jpy\n      sek\n      usd\n      date\n    }\n  }\n": DepositTransactionFieldsFragmentDoc,
  "\n  query SharedDepositTransactions($depositId: UUID!) {\n    deposit(id: $depositId) {\n      id\n      currency\n      metadata {\n        id\n        transactions {\n          id\n          ...DepositTransactionFields\n        }\n      }\n    }\n  }\n": SharedDepositTransactionsDocument,
  "\n  query BusinessLedgerInfo($filters: BusinessTransactionsFilter) {\n    businessTransactionsFromLedgerRecords(filters: $filters) {\n      ... on BusinessTransactionsFromLedgerRecordsSuccessfulResult {\n        __typename\n        businessTransactions {\n          amount {\n            formatted\n            raw\n          }\n          business {\n            id\n            name\n          }\n          foreignAmount {\n            formatted\n            raw\n            currency\n          }\n          invoiceDate\n          reference\n          details\n          counterAccount {\n            __typename\n            id\n            name\n          }\n          chargeId\n        }\n      }\n      ... on CommonError {\n        __typename\n        message\n      }\n    }\n  }\n": BusinessLedgerInfoDocument,
  "\n  query BusinessLedgerRecordsSummery($filters: BusinessTransactionsFilter) {\n    businessTransactionsSumFromLedgerRecords(filters: $filters) {\n      ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {\n        __typename\n        businessTransactionsSum {\n          business {\n            id\n            name\n          }\n          credit {\n            formatted\n          }\n          debit {\n            formatted\n          }\n          total {\n            formatted\n            raw\n          }\n          foreignCurrenciesSum {\n            currency\n            credit {\n              formatted\n            }\n            debit {\n              formatted\n            }\n            total {\n              formatted\n              raw\n            }\n          }\n        }\n      }\n      ... on CommonError {\n        __typename\n        message\n      }\n    }\n  }\n": BusinessLedgerRecordsSummeryDocument,
  "\n  query BusinessTripScreen($businessTripId: UUID!) {\n    businessTrip(id: $businessTripId) {\n      id\n      name\n      dates {\n        start\n      }\n    }\n  }\n": BusinessTripScreenDocument,
  "\n  fragment BusinessTripsRowFields on BusinessTrip {\n    id\n    name\n    accountantApproval\n  }\n": BusinessTripsRowFieldsFragmentDoc,
  "\n  query BusinessTripsRowValidation($id: UUID!) {\n    businessTrip(id: $id) {\n      id\n      uncategorizedTransactions {\n        transaction {\n          ... on Transaction @defer {\n            id\n          }\n        }\n      }\n      summary {\n        ... on BusinessTripSummary @defer {\n          errors\n        }\n      }\n    }\n  }\n": BusinessTripsRowValidationDocument,
  "\n  query EditableBusinessTrip($businessTripId: UUID!) {\n    businessTrip(id: $businessTripId) {\n      id\n      ...BusinessTripReportHeaderFields\n      ...BusinessTripReportAttendeesFields\n      ...BusinessTripUncategorizedTransactionsFields\n      ...BusinessTripReportFlightsFields\n      ...BusinessTripReportAccommodationsFields\n      ...BusinessTripReportTravelAndSubsistenceFields\n      ...BusinessTripReportCarRentalFields\n      ...BusinessTripReportOtherFields\n      ...BusinessTripReportSummaryFields\n      ... on BusinessTrip {\n        uncategorizedTransactions {\n          transaction {\n            id\n          }\n        }\n      }\n    }\n  }\n": EditableBusinessTripDocument,
  "\n  query BusinessTripsScreen {\n    allBusinessTrips {\n      id\n      name\n      dates {\n        start\n      }\n      ...BusinessTripsRowFields\n    }\n  }\n": BusinessTripsScreenDocument,
  "\n  fragment BusinessAdminSection on Business {\n    __typename\n    id\n    ... on LtdFinancialEntity {\n      adminInfo {\n        id\n        registrationDate\n        withholdingTaxAnnualIds {\n          id\n          year\n        }\n        withholdingTaxCompanyId\n        socialSecurityEmployerIds {\n          id\n          year\n        }\n        socialSecurityDeductionsId\n        taxAdvancesAnnualIds {\n          id\n          year\n        }\n        taxAdvancesRates {\n          date\n          rate\n        }\n      }\n    }\n  }\n": BusinessAdminSectionFragmentDoc,
  "\n  query AdminFinancialAccountsSection($adminId: UUID!) {\n    financialAccountsByOwner(ownerId: $adminId) {\n      id\n      __typename\n      name\n      number\n      type\n      privateOrBusiness\n      accountTaxCategories {\n        id\n        currency\n        taxCategory {\n          id\n          name\n        }\n      }\n      ... on BankFinancialAccount {\n        bankNumber\n        branchNumber\n        iban\n        swiftCode\n        extendedBankNumber\n        partyPreferredIndication\n        partyAccountInvolvementCode\n        accountDealDate\n        accountUpdateDate\n        metegDoarNet\n        kodHarshaatPeilut\n        accountClosingReasonCode\n        accountAgreementOpeningDate\n        serviceAuthorizationDesc\n        branchTypeCode\n        mymailEntitlementSwitch\n        productLabel\n      }\n    }\n  }\n": AdminFinancialAccountsSectionDocument,
  "\n  fragment BusinessHeader on Business {\n    __typename\n    id\n    name\n    createdAt\n    isActive\n    ... on LtdFinancialEntity {\n      governmentId\n      adminInfo {\n        id\n      }\n      clientInfo {\n        id\n      }\n    }\n  }\n": BusinessHeaderFragmentDoc,
  "\n  query BusinessChargesSection($page: Int, $limit: Int, $filters: ChargeFilter) {\n    allCharges(page: $page, limit: $limit, filters: $filters) {\n      nodes {\n        id\n        ...ChargeForChargesTableFields\n      }\n      pageInfo {\n        totalPages\n      }\n    }\n  }\n": BusinessChargesSectionDocument,
  "\n  query ClientContractsSection($clientId: UUID!) {\n    contractsByClient(clientId: $clientId) {\n      id\n      purchaseOrders\n      startDate\n      endDate\n      amount {\n        raw\n        currency\n      }\n      billingCycle\n      isActive\n      product\n      documentType\n      remarks\n      plan\n      msCloud\n      operationsLimit\n    }\n  }\n": ClientContractsSectionDocument,
  "\n  fragment ClientIntegrationsSection on LtdFinancialEntity {\n    id\n    clientInfo {\n      id\n      integrations {\n        id\n        greenInvoiceInfo {\n          businessId\n          greenInvoiceId\n        }\n        hiveId\n        linearId\n        slackChannelKey\n        notionId\n        workflowyUrl\n      }\n    }\n  }\n": ClientIntegrationsSectionFragmentDoc,
  "\n  query ClientIntegrationsSectionGreenInvoice($clientId: UUID!) {\n    greenInvoiceClient(clientId: $clientId) {\n      businessId\n      greenInvoiceId\n      country {\n        id\n        name\n      }\n      emails\n      name\n      phone\n      taxId\n      address\n      city\n      zip\n      fax\n      mobile\n    }\n  }\n": ClientIntegrationsSectionGreenInvoiceDocument,
  "\n  query ContractBasedDocumentDraft($issueMonth: TimelessDate!, $contractId: UUID!) {\n    periodicalDocumentDraftsByContracts(issueMonth: $issueMonth, contractIds: [$contractId]) {\n      ...NewDocumentDraft\n    }\n  }\n": ContractBasedDocumentDraftDocument,
  "\n  fragment BusinessConfigurationSection on Business {\n    __typename\n    id\n    pcn874RecordType\n    irsCode\n    isActive\n    ownerId\n    ... on LtdFinancialEntity {\n      optionalVAT\n      exemptDealer\n      isReceiptEnough\n      isDocumentsOptional\n      sortCode {\n        id\n        key\n        defaultIrsCode\n      }\n      taxCategory {\n        id\n      }\n      suggestions {\n        phrases\n        emails\n        tags {\n          id\n        }\n        description\n        emailListener {\n          internalEmailLinks\n          emailBody\n          attachments\n        }\n      }\n      clientInfo {\n        id\n      }\n    }\n  }\n": BusinessConfigurationSectionFragmentDoc,
  "\n  fragment BusinessContactSection on Business {\n    __typename\n    id\n    ... on LtdFinancialEntity {\n      name\n      hebrewName\n      country {\n        id\n        code\n      }\n      governmentId\n      address\n      city\n      zipCode\n      email\n      # localAddress\n      phoneNumber\n      website\n      clientInfo {\n        id\n        emails\n      }\n    }\n  }\n": BusinessContactSectionFragmentDoc,
  "\n  fragment BusinessPage on Business {\n    id\n    ... on LtdFinancialEntity {\n      clientInfo {\n        id\n      }\n      adminInfo {\n        id\n      }\n    }\n    ...ClientIntegrationsSection\n    ...BusinessHeader\n    ...BusinessContactSection\n    ...BusinessConfigurationSection\n    ...BusinessAdminSection\n  }\n": BusinessPageFragmentDoc,
  "\n  query BusinessLedgerSection($businessId: UUID!) {\n    ledgerRecordsByFinancialEntity(financialEntityId: $businessId) {\n      id\n      ...LedgerRecordsTableFields\n    }\n  }\n": BusinessLedgerSectionDocument,
  "\n  query BusinessTransactionsSection($businessId: UUID!) {\n    transactionsByFinancialEntity(financialEntityID: $businessId) {\n      id\n      ...TransactionForTransactionsTableFields\n      ...TransactionToDownloadForTransactionsTableFields\n    }\n  }\n": BusinessTransactionsSectionDocument,
  "\n  query AllBusinessesForScreen {\n    allBusinesses {\n      nodes {\n        __typename\n        id\n        name\n        ... on LtdFinancialEntity {\n          hebrewName\n          governmentId\n          country {\n            id\n            code\n          }\n          city\n          zipCode\n          createdAt\n          updatedAt\n          sortCode {\n            id\n            key\n            name\n          }\n          taxCategory {\n            id\n            name\n          }\n          irsCode\n          pcn874RecordType\n          isClient\n          isAdmin\n          isActive\n          suggestions {\n            description\n            tags {\n              id\n              name\n            }\n          }\n        }\n      }\n    }\n  }\n": AllBusinessesForScreenDocument,
  "\n  query BusinessesUsage($ids: [UUID!]!) {\n    businessesUsage(ids: $ids) {\n      id\n      businessId\n      totalTransactions\n      totalDocuments\n      totalMiscExpenses\n      totalLedgerRecords\n    }\n  }\n": BusinessesUsageDocument,
  "\n  fragment ChargeMatchesTableFields on ChargeMatch {\n    charge {\n      id\n      __typename\n      minEventDate\n      minDebitDate\n      minDocumentsDate\n      totalAmount {\n        raw\n        formatted\n      }\n      vat {\n        raw\n        formatted\n      }\n      counterparty {\n        name\n        id\n      }\n      userDescription\n      tags {\n        id\n        name\n        namePath\n      }\n      taxCategory {\n        id\n        name\n      }\n    }\n    confidenceScore\n  }\n": ChargeMatchesTableFieldsFragmentDoc,
  "\n  query ChargeExtendedInfoForChargeMatches($chargeId: UUID!) {\n    charge(chargeId: $chargeId) {\n      id\n      transactions {\n        id\n        ...TransactionForTransactionsTableFields\n      }\n      additionalDocuments {\n        id\n        ...TableDocumentsRowFields\n      }\n    }\n  }\n": ChargeExtendedInfoForChargeMatchesDocument,
  "\n  fragment ChargeMatchCardFields on Charge {\n    __typename\n    id\n    minEventDate\n    minDebitDate\n    minDocumentsDate\n    totalAmount {\n      raw\n      formatted\n      currency\n    }\n    counterparty {\n      id\n      name\n    }\n    userDescription\n    additionalDocuments {\n      id\n      documentType\n      image\n      file\n    }\n    transactions {\n      id\n      eventDate\n      sourceDescription\n      amount {\n        raw\n        formatted\n      }\n    }\n    miscExpenses {\n      id\n      description\n      amount {\n        formatted\n      }\n    }\n  }\n": ChargeMatchCardFieldsFragmentDoc,
  "\n  query ChargesAwaitingMatchQueue(\n    $limit: Int\n    $offset: Int\n    $businessId: UUID\n    $fromDate: TimelessDate\n    $toDate: TimelessDate\n    $mode: ChargeMatchQueueMode\n    $sortBy: ChargeMatchQueueSortBy\n  ) {\n    chargesAwaitingMatchQueue(\n      limit: $limit\n      offset: $offset\n      businessId: $businessId\n      fromDate: $fromDate\n      toDate: $toDate\n      mode: $mode\n      sortBy: $sortBy\n    ) {\n      totalCount\n      baseCharges {\n        id\n        baseCharge {\n          ...ChargeMatchCardFields\n        }\n        suggestions {\n          chargeId\n          confidenceScore\n          charge {\n            ...ChargeMatchCardFields\n          }\n        }\n      }\n    }\n  }\n": ChargesAwaitingMatchQueueDocument,
  "\n  query ChargesLedgerValidation($limit: Int, $filters: ChargeFilter) {\n    chargesWithLedgerChanges(limit: $limit, filters: $filters) @stream {\n      progress\n      charge {\n        id\n        ...ChargeForChargesTableFields\n      }\n    }\n  }\n": ChargesLedgerValidationDocument,
  "\n  fragment ChargesTableErrorsFields on Charge {\n    id\n    errorsLedger: ledger {\n      validate {\n        errors\n      }\n    }\n  }\n": ChargesTableErrorsFieldsFragmentDoc,
  "\n  query FetchCharge($chargeId: UUID!) {\n    charge(chargeId: $chargeId) {\n      id\n      ...ChargeExpansionFields\n    }\n  }\n": FetchChargeDocument,
  "\n  fragment ChargeExpansionFields on Charge {\n    id\n    __typename\n    metadata {\n      transactionsCount\n      documentsCount\n      receiptsCount\n      invoicesCount\n      ledgerCount\n      miscExpensesCount\n      isLedgerLocked\n      openDocuments\n    }\n    totalAmount {\n      raw\n    }\n    ...DocumentsGalleryFields @defer\n    ...TableDocumentsFields @defer\n    ...ChargeLedgerRecordsTableFields @defer\n    ...ChargeTableTransactionsFields @defer\n    ...ConversionChargeInfo @defer\n    ...CreditcardBankChargeInfo @defer\n    ...TableSalariesFields @defer\n    ... on BusinessTripCharge {\n      businessTrip {\n        id\n        ...BusinessTripReportFields\n      }\n    }\n    ...ChargesTableErrorsFields @defer\n    ...TableMiscExpensesFields @defer\n    ...ExchangeRatesInfo @defer\n  }\n": ChargeExpansionFieldsFragmentDoc,
  "\n  fragment TableDocumentsFields on Charge {\n    id\n    additionalDocuments {\n      id\n      ...TableDocumentsRowFields\n    }\n  }\n": TableDocumentsFieldsFragmentDoc,
  "\n  fragment ChargeLedgerRecordsTableFields on Charge {\n    id\n    ledger {\n      __typename\n      records {\n        id\n        ...LedgerRecordsTableFields\n      }\n      ... on Ledger @defer {\n        validate {\n          ... on LedgerValidation @defer {\n            matches\n            differences {\n              id\n              ...LedgerRecordsTableFields\n            }\n          }\n        }\n      }\n    }\n  }\n": ChargeLedgerRecordsTableFieldsFragmentDoc,
  "\n  fragment ChargeTableTransactionsFields on Charge {\n    id\n    transactions {\n      id\n      ...TransactionForTransactionsTableFields\n    }\n  }\n": ChargeTableTransactionsFieldsFragmentDoc,
  "\n  query ChargesExtendedInfoBatch($chargeIDs: [UUID!]!) {\n    chargesByIDs(chargeIDs: $chargeIDs) {\n      id\n      ...ChargeExpansionFields\n    }\n  }\n": ChargesExtendedInfoBatchDocument,
  "\n  query RefetchChargeForChargesTable($chargeId: UUID!) {\n    charge(chargeId: $chargeId) {\n      id\n      ...ChargeForChargesTableFields\n    }\n  }\n": RefetchChargeForChargesTableDocument,
  "\n  fragment ChargesTableSuggestionsFields on Charge {\n    id\n    missingInfoSuggestions {\n      description\n      tags {\n        id\n        name\n        namePath\n      }\n    }\n  }\n": ChargesTableSuggestionsFieldsFragmentDoc,
  "\n  fragment ChargeForChargesTableFields on Charge {\n    id\n    __typename\n    minEventDate\n    minDebitDate\n    minDocumentsDate\n    maxDebitDate\n    maxEventDate\n    maxDocumentsDate\n    totalAmount {\n      raw\n      currency\n    }\n    vat {\n      raw\n    }\n    counterparty {\n      name\n      id\n    }\n    userDescription\n    tags {\n      id\n      name\n      namePath\n    }\n    taxCategory {\n      id\n      name\n    }\n    ... on BusinessTripCharge {\n      businessTrip {\n        id\n        name\n      }\n    }\n    metadata {\n      transactionsCount\n      documentsCount\n      ledgerCount\n      miscExpensesCount\n      ... on ChargeMetadata @defer {\n        invalidLedger\n      }\n    }\n    accountantApproval\n    ... on CreditcardBankCharge {\n      validCreditCardAmount\n    }\n    ... on Charge {\n      validationData {\n        missingInfo\n      }\n    }\n    ...ChargesTableSuggestionsFields @defer\n  }\n": ChargeForChargesTableFieldsFragmentDoc,
  "\n  fragment ChargeForCsvExportFields on Charge {\n    id\n    __typename\n    minEventDate\n    minDebitDate\n    minDocumentsDate\n    totalAmount {\n      raw\n      currency\n    }\n    vat {\n      raw\n    }\n    counterparty {\n      id\n      name\n    }\n    userDescription\n    tags {\n      id\n      name\n    }\n    taxCategory {\n      id\n      name\n    }\n    accountantApproval\n    validationData {\n      isValid\n      missingInfo\n    }\n    missingInfoSuggestions {\n      description\n      tags {\n        id\n        name\n      }\n    }\n    metadata {\n      transactionsCount\n      documentsCount\n      invoicesCount\n      receiptsCount\n      ledgerCount\n      miscExpensesCount\n      openDocuments\n      invalidLedger\n    }\n    ledger {\n      balance {\n        isBalanced\n      }\n      validate {\n        isValid\n        errors\n      }\n    }\n    transactions {\n      id\n      ...TransactionForTransactionsTableFields\n    }\n    additionalDocuments {\n      id\n      ...TableDocumentsRowFields\n    }\n    ... on BusinessTripCharge {\n      businessTrip {\n        id\n        name\n      }\n    }\n    ... on CreditcardBankCharge {\n      validCreditCardAmount\n    }\n  }\n": ChargeForCsvExportFieldsFragmentDoc,
  "\n  query ChargesForCsvExport($chargeIDs: [UUID!]!) {\n    chargesByIDs(chargeIDs: $chargeIDs) {\n      id\n      ...ChargeForCsvExportFields\n    }\n  }\n": ChargesForCsvExportDocument,
  "\n  query BankDepositInfo($chargeId: UUID!) {\n    depositByCharge(chargeId: $chargeId) {\n      id\n      name\n      metadata {\n        id\n        currentBalance {\n          formatted\n        }\n        transactions {\n          id\n          chargeId\n          ...TransactionForTransactionsTableFields\n        }\n      }\n      isOpen\n    }\n  }\n": BankDepositInfoDocument,
  "\n  query ChargeMatches($chargeId: UUID!) {\n    findChargeMatches(chargeId: $chargeId) {\n      matches {\n        chargeId\n        ...ChargeMatchesTableFields\n      }\n    }\n  }\n": ChargeMatchesDocument,
  "\n  fragment ConversionChargeInfo on Charge {\n    id\n    __typename\n    ... on ConversionCharge {\n      eventRate {\n        from\n        to\n        rate\n      }\n      officialRate {\n        from\n        to\n        rate\n      }\n    }\n  }\n": ConversionChargeInfoFragmentDoc,
  "\n  fragment CreditcardBankChargeInfo on Charge {\n    id\n    __typename\n    ... on CreditcardBankCharge {\n      creditCardTransactions {\n        id\n        ...TransactionForTransactionsTableFields\n      }\n    }\n  }\n": CreditcardBankChargeInfoFragmentDoc,
  "\n  fragment ExchangeRatesInfo on Charge {\n    id\n    __typename\n    ... on FinancialCharge {\n      exchangeRates {\n        aud\n        cad\n        eur\n        gbp\n        ils\n        jpy\n        sek\n        usd\n        eth\n        grt\n        usdc\n      }\n    }\n  }\n": ExchangeRatesInfoFragmentDoc,
  "\n  fragment TableMiscExpensesFields on Charge {\n    id\n    miscExpenses {\n      id\n      amount {\n        formatted\n      }\n      description\n      invoiceDate\n      valueDate\n      creditor {\n        id\n        name\n      }\n      debtor {\n        id\n        name\n      }\n      chargeId\n      ...EditMiscExpenseFields\n    }\n  }\n": TableMiscExpensesFieldsFragmentDoc,
  "\n  fragment TableSalariesFields on Charge {\n    id\n    __typename\n    ... on SalaryCharge {\n      salaryRecords {\n        directAmount {\n          formatted\n        }\n        baseAmount {\n          formatted\n        }\n        employee {\n          id\n          name\n        }\n        pensionFund {\n          id\n          name\n        }\n        pensionEmployeeAmount {\n          formatted\n        }\n        pensionEmployerAmount {\n          formatted\n        }\n        compensationsAmount {\n          formatted\n        }\n        trainingFund {\n          id\n          name\n        }\n        trainingFundEmployeeAmount {\n          formatted\n        }\n        trainingFundEmployerAmount {\n          formatted\n        }\n        socialSecurityEmployeeAmount {\n          formatted\n        }\n        socialSecurityEmployerAmount {\n          formatted\n        }\n        incomeTaxAmount {\n          formatted\n        }\n        healthInsuranceAmount {\n          formatted\n        }\n      }\n    }\n  }\n": TableSalariesFieldsFragmentDoc,
  "\n  query IncomeChargesChart($filters: ChargeFilter) {\n    allCharges(filters: $filters) {\n      nodes {\n        id\n        transactions {\n          id\n          eventDate\n          effectiveDate\n          amount {\n            currency\n            formatted\n            raw\n          }\n          eventExchangeRates {\n            aud\n            cad\n            eur\n            gbp\n            jpy\n            sek\n            usd\n            date\n          }\n          debitExchangeRates {\n            aud\n            cad\n            eur\n            gbp\n            jpy\n            sek\n            usd\n            date\n          }\n        }\n      }\n    }\n  }\n": IncomeChargesChartDocument,
  "\n  fragment MonthlyIncomeExpenseChartInfo on IncomeExpenseChart {\n    monthlyData {\n      income {\n        formatted\n        raw\n      }\n      expense {\n        formatted\n        raw\n      }\n      balance {\n        formatted\n        raw\n      }\n      date\n    }\n  }\n": MonthlyIncomeExpenseChartInfoFragmentDoc,
  "\n  query MonthlyIncomeExpenseChart($filters: IncomeExpenseChartFilters!) {\n    incomeExpenseChart(filters: $filters) {\n      fromDate\n      toDate\n      currency\n      ...MonthlyIncomeExpenseChartInfo\n    }\n  }\n": MonthlyIncomeExpenseChartDocument,
  "\n  query ContractsEditModal($contractId: UUID!) {\n    contractsById(id: $contractId) {\n      id\n      startDate\n      endDate\n      purchaseOrders\n      amount {\n        raw\n        currency\n      }\n      product\n      msCloud\n      billingCycle\n      plan\n      isActive\n      remarks\n      documentType\n      operationsLimit\n    }\n  }\n": ContractsEditModalDocument,
  "\n  fragment BusinessTripReportFields on BusinessTrip {\n    id\n    ...BusinessTripReportHeaderFields\n    ...BusinessTripReportSummaryFields\n  }\n": BusinessTripReportFieldsFragmentDoc,
  "\n  fragment BusinessTripAccountantApprovalFields on BusinessTrip {\n    id\n    accountantApproval\n  }\n": BusinessTripAccountantApprovalFieldsFragmentDoc,
  "\n  query UncategorizedTransactionsByBusinessTrip($businessTripId: UUID!) {\n    businessTrip(id: $businessTripId) {\n      id\n      uncategorizedTransactions {\n        transaction {\n          id\n          eventDate\n          sourceDescription\n          referenceKey\n          counterparty {\n            id\n            name\n          }\n          amount {\n            formatted\n            raw\n          }\n        }\n      }\n    }\n  }\n": UncategorizedTransactionsByBusinessTripDocument,
  "\n  fragment BusinessTripReportAccommodationsRowFields on BusinessTripAccommodationExpense {\n    id\n    ...BusinessTripReportCoreExpenseRowFields\n    payedByEmployee\n    country {\n      id\n      name\n    }\n    nightsCount\n    attendeesStay {\n      id\n      attendee {\n        id\n        name\n      }\n      nightsCount\n    }\n  }\n": BusinessTripReportAccommodationsRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportAccommodationsTableFields on BusinessTripAccommodationExpense {\n    id\n    date\n    ...BusinessTripReportAccommodationsRowFields\n  }\n": BusinessTripReportAccommodationsTableFieldsFragmentDoc,
  "\n  fragment BusinessTripReportAccommodationsFields on BusinessTrip {\n    id\n    accommodationExpenses {\n      id\n      ...BusinessTripReportAccommodationsTableFields\n    }\n  }\n": BusinessTripReportAccommodationsFieldsFragmentDoc,
  "\n  fragment BusinessTripReportAttendeeRowFields on BusinessTripAttendee {\n    id\n    name\n    arrivalDate\n    departureDate\n    flights {\n      id\n      ...BusinessTripReportFlightsTableFields\n    }\n    accommodations {\n      id\n      ...BusinessTripReportAccommodationsTableFields\n    }\n  }\n": BusinessTripReportAttendeeRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportAttendeesFields on BusinessTrip {\n    id\n    attendees {\n      id\n      name\n      ...BusinessTripReportAttendeeRowFields\n    }\n  }\n": BusinessTripReportAttendeesFieldsFragmentDoc,
  "\n  fragment BusinessTripReportCarRentalRowFields on BusinessTripCarRentalExpense {\n    id\n    payedByEmployee\n    ...BusinessTripReportCoreExpenseRowFields\n    days\n    isFuelExpense\n  }\n": BusinessTripReportCarRentalRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportCarRentalFields on BusinessTrip {\n    id\n    carRentalExpenses {\n      id\n      date\n      ...BusinessTripReportCarRentalRowFields\n    }\n  }\n": BusinessTripReportCarRentalFieldsFragmentDoc,
  "\n  fragment BusinessTripReportCoreExpenseRowFields on BusinessTripExpense {\n    id\n    date\n    valueDate\n    amount {\n      formatted\n      raw\n      currency\n    }\n    employee {\n      id\n      name\n    }\n    payedByEmployee\n    charges {\n      id\n    }\n  }\n": BusinessTripReportCoreExpenseRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportFlightsRowFields on BusinessTripFlightExpense {\n    id\n    payedByEmployee\n    ...BusinessTripReportCoreExpenseRowFields\n    path\n    class\n    attendees {\n      id\n      name\n    }\n  }\n": BusinessTripReportFlightsRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportFlightsTableFields on BusinessTripFlightExpense {\n    id\n    date\n    ...BusinessTripReportFlightsRowFields\n  }\n": BusinessTripReportFlightsTableFieldsFragmentDoc,
  "\n  fragment BusinessTripReportFlightsFields on BusinessTrip {\n    id\n    flightExpenses {\n      id\n      ...BusinessTripReportFlightsTableFields\n    }\n    attendees {\n      id\n      name\n    }\n  }\n": BusinessTripReportFlightsFieldsFragmentDoc,
  "\n  fragment BusinessTripReportOtherRowFields on BusinessTripOtherExpense {\n    id\n    ...BusinessTripReportCoreExpenseRowFields\n    payedByEmployee\n    description\n    deductibleExpense\n  }\n": BusinessTripReportOtherRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportOtherFields on BusinessTrip {\n    id\n    otherExpenses {\n      id\n      date\n      ...BusinessTripReportOtherRowFields\n    }\n  }\n": BusinessTripReportOtherFieldsFragmentDoc,
  "\n  fragment BusinessTripReportHeaderFields on BusinessTrip {\n    id\n    name\n    dates {\n      start\n      end\n    }\n    purpose\n    destination {\n      id\n      name\n    }\n    ...BusinessTripAccountantApprovalFields\n  }\n": BusinessTripReportHeaderFieldsFragmentDoc,
  "\n  fragment BusinessTripReportSummaryFields on BusinessTrip {\n    id\n    ... on BusinessTrip @defer {\n      summary {\n        excessExpenditure {\n          formatted\n        }\n        excessTax\n        rows {\n          type\n          totalForeignCurrency {\n            formatted\n          }\n          totalLocalCurrency {\n            formatted\n          }\n          taxableForeignCurrency {\n            formatted\n          }\n          taxableLocalCurrency {\n            formatted\n          }\n          maxTaxableForeignCurrency {\n            formatted\n          }\n          maxTaxableLocalCurrency {\n            formatted\n          }\n          excessExpenditure {\n            formatted\n          }\n        }\n        errors\n      }\n    }\n  }\n": BusinessTripReportSummaryFieldsFragmentDoc,
  "\n  fragment BusinessTripReportTravelAndSubsistenceRowFields on BusinessTripTravelAndSubsistenceExpense {\n    id\n    ...BusinessTripReportCoreExpenseRowFields\n    payedByEmployee\n    expenseType\n  }\n": BusinessTripReportTravelAndSubsistenceRowFieldsFragmentDoc,
  "\n  fragment BusinessTripReportTravelAndSubsistenceFields on BusinessTrip {\n    id\n    travelAndSubsistenceExpenses {\n      id\n      date\n      ...BusinessTripReportTravelAndSubsistenceRowFields\n    }\n  }\n": BusinessTripReportTravelAndSubsistenceFieldsFragmentDoc,
  "\n  fragment BusinessTripUncategorizedTransactionsFields on BusinessTrip {\n    id\n    uncategorizedTransactions {\n      transaction {\n        id\n        eventDate\n        chargeId\n        amount {\n          raw\n        }\n        ...TransactionsTableEventDateFields\n        ...TransactionsTableDebitDateFields\n        ...TransactionsTableAccountFields\n        ...TransactionsTableDescriptionFields\n        ...TransactionsTableSourceIDFields\n        ...TransactionsTableEntityFields\n      }\n      ...UncategorizedTransactionsTableAmountFields\n    }\n  }\n": BusinessTripUncategorizedTransactionsFieldsFragmentDoc,
  "\n  fragment UncategorizedTransactionsTableAmountFields on UncategorizedTransaction {\n    transaction {\n      id\n      amount {\n        raw\n        formatted\n      }\n      cryptoExchangeRate {\n        rate\n      }\n    }\n    categorizedAmount {\n      raw\n      formatted\n    }\n    errors\n  }\n": UncategorizedTransactionsTableAmountFieldsFragmentDoc,
  "\n  fragment DepreciationRecordRowFields on DepreciationRecord {\n    id\n    amount {\n      currency\n      formatted\n      raw\n    }\n    activationDate\n    category {\n      id\n      name\n      percentage\n    }\n    type\n    charge {\n      id\n      totalAmount {\n        currency\n        formatted\n        raw\n      }\n    }\n  }\n": DepreciationRecordRowFieldsFragmentDoc,
  "\n  query ChargeDepreciation($chargeId: UUID!) {\n    depreciationRecordsByCharge(chargeId: $chargeId) {\n      id\n      ...DepreciationRecordRowFields\n    }\n  }\n": ChargeDepreciationDocument,
  "\n  query RecentBusinessIssuedDocuments($businessId: UUID!, $limit: Int) {\n    recentDocumentsByBusiness(businessId: $businessId, limit: $limit) {\n      id\n      ... on FinancialDocument {\n        issuedDocumentInfo {\n          id\n          status\n          externalId\n        }\n      }\n      ...TableDocumentsRowFields\n    }\n  }\n": RecentBusinessIssuedDocumentsDocument,
  "\n  query RecentIssuedDocumentsOfSameType($documentType: DocumentType!) {\n    recentIssuedDocumentsByType(documentType: $documentType) {\n      id\n      ...TableDocumentsRowFields\n    }\n  }\n": RecentIssuedDocumentsOfSameTypeDocument,
  "\n  query EditDocument($documentId: UUID!) {\n    documentById(documentId: $documentId) {\n      id\n      image\n      file\n      documentType\n      description\n      remarks\n      __typename\n      ... on FinancialDocument {\n        vat {\n          raw\n          currency\n        }\n        serialNumber\n        date\n        amount {\n          raw\n          currency\n        }\n        debtor {\n          id\n          name\n        }\n        creditor {\n          id\n          name\n        }\n        vatReportDateOverride\n        noVatAmount\n        allocationNumber\n        exchangeRateOverride\n      }\n      ... on Unprocessed {\n        vat {\n          raw\n          currency\n        }\n        serialNumber\n        date\n        amount {\n          raw\n          currency\n        }\n        debtor {\n          id\n          name\n        }\n        creditor {\n          id\n          name\n        }\n        vatReportDateOverride\n        noVatAmount\n        allocationNumber\n        exchangeRateOverride\n      }\n      ... on OtherDocument {\n        vat {\n          raw\n          currency\n        }\n        serialNumber\n        date\n        amount {\n          raw\n          currency\n        }\n        debtor {\n          id\n          name\n        }\n        creditor {\n          id\n          name\n        }\n        vatReportDateOverride\n        noVatAmount\n        allocationNumber\n        exchangeRateOverride\n      }\n    }\n  }\n": EditDocumentDocument,
  "\n  fragment EditMiscExpenseFields on MiscExpense {\n    id\n    amount {\n      raw\n      currency\n    }\n    description\n    invoiceDate\n    valueDate\n    creditor {\n      id\n    }\n    debtor {\n      id\n    }\n  }\n": EditMiscExpenseFieldsFragmentDoc,
  "\n  fragment EditTagFields on Tag {\n    id\n    name\n    parent {\n      id\n      name\n    }\n  }\n": EditTagFieldsFragmentDoc,
  "\n  query EditTransaction($transactionIDs: [UUID!]!) {\n    transactionsByIDs(transactionIDs: $transactionIDs) {\n      id\n      counterparty {\n        id\n        name\n      }\n      effectiveDate\n      isFee\n      account {\n        type\n        id\n      }\n    }\n  }\n": EditTransactionDocument,
  "\n  query ClientInfoForDocumentIssuing($businessId: UUID!) {\n    client(businessId: $businessId) {\n      id\n      integrations {\n        id\n        greenInvoiceInfo {\n          greenInvoiceId\n          businessId\n          name\n        }\n      }\n      ...IssueDocumentClientFields\n    }\n  }\n": ClientInfoForDocumentIssuingDocument,
  "\n  query AllBusinessTrips {\n    allBusinessTrips {\n      id\n      name\n    }\n  }\n": AllBusinessTripsDocument,
  "\n  query AllDepreciationCategories {\n    depreciationCategories {\n      id\n      name\n      percentage\n    }\n  }\n": AllDepreciationCategoriesDocument,
  "\n  query AllEmployeesByEmployer($employerId: UUID!) {\n    employeesByEmployerId(employerId: $employerId) {\n      id\n      name\n    }\n  }\n": AllEmployeesByEmployerDocument,
  "\n  query AllPensionFunds {\n    allPensionFunds {\n      id\n      name\n    }\n  }\n": AllPensionFundsDocument,
  "\n  query AllTrainingFunds {\n    allTrainingFunds {\n      id\n      name\n    }\n  }\n": AllTrainingFundsDocument,
  "\n  query AttendeesByBusinessTrip($businessTripId: UUID!) {\n    businessTrip(id: $businessTripId) {\n      id\n      attendees {\n        id\n        name\n      }\n    }\n  }\n": AttendeesByBusinessTripDocument,
  "\n  query FetchMultipleBusinesses($businessIds: [UUID!]!) {\n    businesses(ids: $businessIds) {\n      id\n      name\n    }\n  }\n": FetchMultipleBusinessesDocument,
  "\n  query FetchMultipleCharges($chargeIds: [UUID!]!) {\n    chargesByIDs(chargeIDs: $chargeIds) {\n      id\n      __typename\n      metadata {\n        transactionsCount\n        invoicesCount\n      }\n      owner {\n        id\n        name\n      }\n      tags {\n        id\n        name\n        namePath\n      }\n      decreasedVAT\n      property\n      isInvoicePaymentDifferentCurrency\n      userDescription\n      optionalVAT\n      optionalDocuments\n    }\n  }\n": FetchMultipleChargesDocument,
  "\n  query EditCharge($chargeId: UUID!) {\n    charge(chargeId: $chargeId) {\n      id\n      __typename\n      counterparty {\n        id\n        name\n      }\n      owner {\n        id\n        name\n      }\n      property\n      decreasedVAT\n      isInvoicePaymentDifferentCurrency\n      userDescription\n      taxCategory {\n        id\n        name\n      }\n      tags {\n        id\n      }\n      missingInfoSuggestions {\n        ... on ChargeSuggestions {\n          tags {\n            id\n          }\n        }\n      }\n      optionalVAT\n      optionalDocuments\n      ... on BusinessTripCharge {\n        businessTrip {\n          id\n          name\n        }\n      }\n      yearsOfRelevance {\n        year\n        amount\n      }\n    }\n  }\n": EditChargeDocument,
  "\n  query EditSalaryRecord($month: TimelessDate!, $employeeIDs: [UUID!]!) {\n    salaryRecordsByDates(fromDate: $month, toDate: $month, employeeIDs: $employeeIDs) {\n      month\n      charge {\n        id\n      }\n      directAmount {\n        raw\n      }\n      baseAmount {\n        raw\n      }\n      employee {\n        id\n        name\n      }\n      employer {\n        id\n        name\n      }\n      pensionFund {\n        id\n        name\n      }\n      pensionEmployeeAmount {\n        raw\n      }\n      pensionEmployeePercentage\n      pensionEmployerAmount {\n        raw\n      }\n      pensionEmployerPercentage\n      compensationsAmount {\n        raw\n      }\n      compensationsPercentage\n      trainingFund {\n        id\n        name\n      }\n      trainingFundEmployeeAmount {\n        raw\n      }\n      trainingFundEmployeePercentage\n      trainingFundEmployerAmount {\n        raw\n      }\n      trainingFundEmployerPercentage\n      socialSecurityEmployeeAmount {\n        raw\n      }\n      socialSecurityEmployerAmount {\n        raw\n      }\n      incomeTaxAmount {\n        raw\n      }\n      healthInsuranceAmount {\n        raw\n      }\n      globalAdditionalHoursAmount {\n        raw\n      }\n      bonus {\n        raw\n      }\n      gift {\n        raw\n      }\n      travelAndSubsistence {\n        raw\n      }\n      recovery {\n        raw\n      }\n      notionalExpense {\n        raw\n      }\n      vacationDays {\n        added\n        balance\n      }\n      vacationTakeout {\n        raw\n      }\n      workDays\n      sicknessDays {\n        balance\n      }\n    }\n  }\n": EditSalaryRecordDocument,
  "\n  query SortCodeToUpdate($key: Int!, $ownerId: String!) {\n    sortCode(key: $key, ownerId: $ownerId) {\n      id\n      key\n      name\n      defaultIrsCode\n    }\n  }\n": SortCodeToUpdateDocument,
  "\n  query TaxCategoryToUpdate($id: UUID!) {\n    taxCategory(id: $id) {\n      id\n      ownerId\n      name\n      sortCode {\n        id\n        key\n        name\n      }\n      irsCode\n    }\n  }\n": TaxCategoryToUpdateDocument,
  "\n  query MiscExpenseTransactionFields($transactionId: UUID!) {\n    transactionsByIDs(transactionIDs: [$transactionId]) {\n      id\n      chargeId\n      amount {\n        raw\n        currency\n      }\n      eventDate\n      effectiveDate\n      exactEffectiveDate\n      counterparty {\n        id\n      }\n    }\n  }\n": MiscExpenseTransactionFieldsDocument,
  "\n  fragment IssueDocumentClientFields on Client {\n    id\n    originalBusiness {\n      id\n      address\n      city\n      zipCode\n      country {\n        id\n        code\n      }\n      governmentId\n      name\n      phoneNumber\n    }\n    emails\n    # city\n    # zip\n    # fax\n    # mobile\n  }\n": IssueDocumentClientFieldsFragmentDoc,
  "\n  query NewDocumentDraftByCharge($chargeId: UUID!) {\n    newDocumentDraftByCharge(chargeId: $chargeId) {\n      ...NewDocumentDraft\n    }\n  }\n": NewDocumentDraftByChargeDocument,
  "\n  query NewDocumentDraftByDocument($documentId: UUID!) {\n    newDocumentDraftByDocument(documentId: $documentId) {\n      ...NewDocumentDraft\n    }\n  }\n": NewDocumentDraftByDocumentDocument,
  "\n  fragment NewDocumentDraft on DocumentDraft {\n    description\n    remarks\n    footer\n    type\n    date\n    dueDate\n    language\n    currency\n    vatType\n    discount {\n      amount\n      type\n    }\n    rounding\n    signed\n    maxPayments\n    client {\n      id\n      originalBusiness {\n        id\n        name\n      }\n      integrations {\n        id\n      }\n      emails\n      ...IssueDocumentClientFields\n    }\n    income {\n      currency\n      currencyRate\n      description\n      itemId\n      price\n      quantity\n      vatRate\n      vatType\n    }\n    payment {\n      currency\n      currencyRate\n      date\n      price\n      type\n      bankName\n      bankBranch\n      bankAccount\n      chequeNum\n      accountId\n      transactionId\n      cardType\n      cardNum\n      numPayments\n      firstPayment\n    }\n    linkedDocumentIds\n    linkedPaymentId\n  }\n": NewDocumentDraftFragmentDoc,
  "\n  query SimilarChargesByBusiness(\n    $businessId: UUID!\n    $tagsDifferentThan: [String!]\n    $descriptionDifferentThan: String\n  ) {\n    similarChargesByBusiness(\n      businessId: $businessId\n      tagsDifferentThan: $tagsDifferentThan\n      descriptionDifferentThan: $descriptionDifferentThan\n    ) {\n      id\n      ...SimilarChargesTable\n    }\n  }\n": SimilarChargesByBusinessDocument,
  "\n  query SimilarCharges(\n    $chargeId: UUID!\n    $withMissingTags: Boolean!\n    $withMissingDescription: Boolean!\n    $tagsDifferentThan: [String!]\n    $descriptionDifferentThan: String\n  ) {\n    similarCharges(\n      chargeId: $chargeId\n      withMissingTags: $withMissingTags\n      withMissingDescription: $withMissingDescription\n      tagsDifferentThan: $tagsDifferentThan\n      descriptionDifferentThan: $descriptionDifferentThan\n    ) {\n      id\n      ...SimilarChargesTable\n    }\n  }\n": SimilarChargesDocument,
  "\n  fragment SimilarChargesTable on Charge {\n    id\n    __typename\n    counterparty {\n      name\n      id\n    }\n    minEventDate\n    minDebitDate\n    minDocumentsDate\n    totalAmount {\n      raw\n      formatted\n    }\n    vat {\n      raw\n      formatted\n    }\n    userDescription\n    tags {\n      id\n      name\n    }\n    taxCategory {\n      id\n      name\n    }\n    ... on BusinessTripCharge {\n      businessTrip {\n        id\n        name\n      }\n    }\n    metadata {\n      transactionsCount\n      documentsCount\n      ledgerCount\n      miscExpensesCount\n    }\n  }\n": SimilarChargesTableFragmentDoc,
  "\n  query SimilarTransactions($transactionId: UUID!, $withMissingInfo: Boolean!) {\n    similarTransactions(transactionId: $transactionId, withMissingInfo: $withMissingInfo) {\n      id\n      account {\n        id\n        name\n        type\n      }\n      amount {\n        formatted\n        raw\n      }\n      effectiveDate\n      eventDate\n      sourceDescription\n    }\n  }\n": SimilarTransactionsDocument,
  "\n  query UniformFormat($fromDate: TimelessDate!, $toDate: TimelessDate!) {\n    uniformFormat(fromDate: $fromDate, toDate: $toDate) {\n      bkmvdata\n      ini\n    }\n  }\n": UniformFormatDocument,
  "\n  fragment NewFetchedDocumentFields on Document {\n    id\n    documentType\n    charge {\n      id\n      userDescription\n      counterparty {\n        id\n        name\n      }\n    }\n  }\n": NewFetchedDocumentFieldsFragmentDoc,
  "\n  fragment ContractForContractsTableFields on Contract {\n    id\n    isActive\n    client {\n      id\n      originalBusiness {\n        id\n        name\n      }\n    }\n    purchaseOrders\n    startDate\n    endDate\n    amount {\n      raw\n      formatted\n    }\n    billingCycle\n    product\n    plan\n    operationsLimit\n    msCloud\n    # documentType\n    # remarks\n  }\n": ContractForContractsTableFieldsFragmentDoc,
  "\n  query ContractBasedDocumentDrafts($issueMonth: TimelessDate!, $contractIds: [UUID!]!) {\n    periodicalDocumentDraftsByContracts(issueMonth: $issueMonth, contractIds: $contractIds) {\n      ...NewDocumentDraft\n    }\n  }\n": ContractBasedDocumentDraftsDocument,
  "\n  fragment TableDocumentsRowFields on Document {\n    id\n    documentType\n    image\n    file\n    description\n    remarks\n    charge {\n      id\n    }\n    ... on FinancialDocument {\n      amount {\n        raw\n        formatted\n        currency\n      }\n      missingInfoSuggestions {\n        amount {\n          raw\n          formatted\n          currency\n        }\n        isIncome\n        counterparty {\n          id\n          name\n        }\n        owner {\n          id\n          name\n        }\n      }\n      date\n      vat {\n        raw\n        formatted\n        currency\n      }\n      serialNumber\n      allocationNumber\n      creditor {\n        id\n        name\n      }\n      debtor {\n        id\n        name\n      }\n      issuedDocumentInfo {\n        id\n        status\n        originalDocument {\n          income {\n            description\n          }\n        }\n      }\n    }\n  }\n": TableDocumentsRowFieldsFragmentDoc,
  "\n  fragment DocumentsGalleryFields on Charge {\n    id\n    additionalDocuments {\n      id\n      image\n      ... on FinancialDocument {\n        documentType\n      }\n    }\n  }\n": DocumentsGalleryFieldsFragmentDoc,
  "\n  fragment LedgerRecordsTableFields on LedgerRecord {\n    id\n    creditAccount1 {\n      __typename\n      id\n      name\n    }\n    creditAccount2 {\n      __typename\n      id\n      name\n    }\n    debitAccount1 {\n      __typename\n      id\n      name\n    }\n    debitAccount2 {\n      __typename\n      id\n      name\n    }\n    creditAmount1 {\n      formatted\n      currency\n    }\n    creditAmount2 {\n      formatted\n      currency\n    }\n    debitAmount1 {\n      formatted\n      currency\n    }\n    debitAmount2 {\n      formatted\n      currency\n    }\n    localCurrencyCreditAmount1 {\n      formatted\n      raw\n    }\n    localCurrencyCreditAmount2 {\n      formatted\n      raw\n    }\n    localCurrencyDebitAmount1 {\n      formatted\n      raw\n    }\n    localCurrencyDebitAmount2 {\n      formatted\n      raw\n    }\n    invoiceDate\n    valueDate\n    description\n    reference\n  }\n": LedgerRecordsTableFieldsFragmentDoc,
  "\n  query AccountantApprovalsChargesTable($page: Int, $limit: Int, $filters: ChargeFilter) {\n    allCharges(page: $page, limit: $limit, filters: $filters) {\n      nodes {\n        id\n        accountantApproval\n      }\n    }\n  }\n": AccountantApprovalsChargesTableDocument,
  "\n  query CorporateTaxRulingComplianceReport($years: [Int!]!) {\n    corporateTaxRulingComplianceReport(years: $years) {\n      id\n      year\n      totalIncome {\n        formatted\n        raw\n        currency\n      }\n      researchAndDevelopmentExpenses {\n        formatted\n        raw\n        currency\n      }\n      rndRelativeToIncome {\n        rule\n        ...CorporateTaxRulingReportRuleCellFields\n      }\n      localDevelopmentExpenses {\n        formatted\n        raw\n        currency\n      }\n      localDevelopmentRelativeToRnd {\n        rule\n        ...CorporateTaxRulingReportRuleCellFields\n      }\n      foreignDevelopmentExpenses {\n        formatted\n        raw\n        currency\n      }\n      foreignDevelopmentRelativeToRnd {\n        rule\n        ...CorporateTaxRulingReportRuleCellFields\n      }\n      businessTripRndExpenses {\n        formatted\n        raw\n        currency\n      }\n      ... on CorporateTaxRulingComplianceReport @defer {\n        differences {\n          id\n          totalIncome {\n            formatted\n            raw\n            currency\n          }\n          researchAndDevelopmentExpenses {\n            formatted\n            raw\n            currency\n          }\n          rndRelativeToIncome {\n            ...CorporateTaxRulingReportRuleCellFields\n          }\n          localDevelopmentExpenses {\n            formatted\n            raw\n            currency\n          }\n          localDevelopmentRelativeToRnd {\n            ...CorporateTaxRulingReportRuleCellFields\n          }\n          foreignDevelopmentExpenses {\n            formatted\n            raw\n            currency\n          }\n          foreignDevelopmentRelativeToRnd {\n            ...CorporateTaxRulingReportRuleCellFields\n          }\n          businessTripRndExpenses {\n            formatted\n            raw\n            currency\n          }\n        }\n      }\n    }\n  }\n": CorporateTaxRulingComplianceReportDocument,
  "\n  fragment CorporateTaxRulingReportRuleCellFields on CorporateTaxRule {\n    id\n    rule\n    percentage {\n      formatted\n    }\n    isCompliant\n  }\n": CorporateTaxRulingReportRuleCellFieldsFragmentDoc,
  "\n  query AllDynamicReports {\n    allDynamicReports {\n      id\n      name\n      isLocked\n      updated\n    }\n  }\n": AllDynamicReportsDocument,
  "\n  query DynamicReport($filters: BusinessTransactionsFilter) {\n    businessTransactionsSumFromLedgerRecords(filters: $filters) {\n      __typename\n      ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {\n        businessTransactionsSum {\n          business {\n            id\n            name\n            sortCode {\n              id\n              key\n              name\n            }\n          }\n          credit {\n            formatted\n            raw\n          }\n          debit {\n            formatted\n            raw\n          }\n          total {\n            formatted\n            raw\n          }\n        }\n      }\n      ... on CommonError {\n        __typename\n      }\n    }\n  }\n": DynamicReportDocument,
  "\n  query DynamicReportTemplate($name: String!) {\n    dynamicReport(name: $name) {\n      id\n      name\n      isLocked\n      updated\n      template {\n        id\n        parent\n        text\n        droppable\n        data {\n          nodeType\n          isOpen\n          hebrewText\n          sortCode\n        }\n      }\n    }\n  }\n": DynamicReportTemplateDocument,
  "\n  query ProfitAndLossReport($reportYear: Int!, $referenceYears: [Int!]!) {\n    profitAndLossReport(reportYear: $reportYear, referenceYears: $referenceYears) {\n      id\n      report {\n        id\n        year\n        revenue {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        costOfSales {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        grossProfit {\n          formatted\n        }\n        researchAndDevelopmentExpenses {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        marketingExpenses {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        managementAndGeneralExpenses {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        operatingProfit {\n          formatted\n        }\n        financialExpenses {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        otherIncome {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        profitBeforeTax {\n          formatted\n        }\n        tax {\n          formatted\n        }\n        netProfit {\n          formatted\n        }\n      }\n      reference {\n        id\n        year\n        revenue {\n          amount {\n            formatted\n          }\n        }\n        costOfSales {\n          amount {\n            formatted\n          }\n        }\n        grossProfit {\n          formatted\n        }\n        researchAndDevelopmentExpenses {\n          amount {\n            formatted\n          }\n        }\n        marketingExpenses {\n          amount {\n            formatted\n          }\n        }\n        managementAndGeneralExpenses {\n          amount {\n            formatted\n          }\n        }\n        operatingProfit {\n          formatted\n        }\n        financialExpenses {\n          amount {\n            formatted\n          }\n        }\n        otherIncome {\n          amount {\n            formatted\n          }\n        }\n        profitBeforeTax {\n          formatted\n        }\n        tax {\n          formatted\n        }\n        netProfit {\n          formatted\n        }\n      }\n    }\n  }\n": ProfitAndLossReportDocument,
  "\n  fragment ReportCommentaryTableFields on ReportCommentary {\n    records {\n      sortCode {\n        id\n        key\n        name\n      }\n      amount {\n        formatted\n      }\n      records {\n        ...ReportSubCommentaryTableFields\n      }\n    }\n  }\n": ReportCommentaryTableFieldsFragmentDoc,
  "\n  fragment ReportSubCommentaryTableFields on ReportCommentarySubRecord {\n    financialEntity {\n      id\n      name\n    }\n    amount {\n      formatted\n    }\n    ledgerRecords {\n      ...LedgerRecordsTableFields\n    }\n  }\n": ReportSubCommentaryTableFieldsFragmentDoc,
  "\n  query TaxReport($reportYear: Int!, $referenceYears: [Int!]!) {\n    taxReport(reportYear: $reportYear, referenceYears: $referenceYears) {\n      id\n      report {\n        id\n        year\n        profitBeforeTax {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        researchAndDevelopmentExpensesByRecords {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        researchAndDevelopmentExpensesForTax {\n          formatted\n        }\n        fines {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        untaxableGifts {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        businessTripsExcessExpensesAmount {\n          formatted\n        }\n        salaryExcessExpensesAmount {\n          formatted\n        }\n        reserves {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        nontaxableLinkage {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        taxableIncome {\n          formatted\n        }\n        taxRate\n        specialTaxableIncome {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        specialTaxRate\n        annualTaxExpense {\n          formatted\n        }\n      }\n      reference {\n        id\n        year\n        profitBeforeTax {\n          amount {\n            formatted\n          }\n        }\n        researchAndDevelopmentExpensesByRecords {\n          amount {\n            formatted\n          }\n        }\n        researchAndDevelopmentExpensesForTax {\n          formatted\n        }\n        fines {\n          amount {\n            formatted\n          }\n        }\n        untaxableGifts {\n          amount {\n            formatted\n          }\n        }\n        businessTripsExcessExpensesAmount {\n          formatted\n        }\n        salaryExcessExpensesAmount {\n          formatted\n        }\n        reserves {\n          amount {\n            formatted\n          }\n        }\n        nontaxableLinkage {\n          amount {\n            formatted\n          }\n        }\n        taxableIncome {\n          formatted\n        }\n        taxRate\n        specialTaxableIncome {\n          amount {\n            formatted\n          }\n          ...ReportCommentaryTableFields\n        }\n        specialTaxRate\n        annualTaxExpense {\n          formatted\n        }\n      }\n    }\n  }\n": TaxReportDocument,
  "\n  query TrialBalanceReport($filters: BusinessTransactionsFilter) {\n    businessTransactionsSumFromLedgerRecords(filters: $filters) {\n      ... on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {\n        __typename\n        ...TrialBalanceTableFields\n      }\n      ... on CommonError {\n        __typename\n      }\n    }\n  }\n": TrialBalanceReportDocument,
  "\n  fragment TrialBalanceTableFields on BusinessTransactionsSumFromLedgerRecordsSuccessfulResult {\n    businessTransactionsSum {\n      business {\n        id\n        name\n        sortCode {\n          id\n          key\n          name\n        }\n      }\n      credit {\n        formatted\n        raw\n      }\n      debit {\n        formatted\n        raw\n      }\n      total {\n        formatted\n        raw\n      }\n    }\n  }\n": TrialBalanceTableFieldsFragmentDoc,
  "\n  query ValidatePcn874Reports(\n    $businessId: UUID\n    $fromMonthDate: TimelessDate!\n    $toMonthDate: TimelessDate!\n  ) {\n    pcnByDate(businessId: $businessId, fromMonthDate: $fromMonthDate, toMonthDate: $toMonthDate)\n      @stream {\n      id\n      business {\n        id\n        name\n      }\n      date\n      content\n      diffContent\n    }\n  }\n": ValidatePcn874ReportsDocument,
  "\n  fragment VatReportBusinessTripsFields on VatReportResult {\n    businessTrips {\n      id\n      ...ChargeForChargesTableFields\n    }\n  }\n": VatReportBusinessTripsFieldsFragmentDoc,
  "\n  fragment VatReportAccountantApprovalFields on VatReportRecord {\n    chargeId\n    chargeAccountantStatus\n  }\n": VatReportAccountantApprovalFieldsFragmentDoc,
  "\n  fragment VatReportExpensesRowFields on VatReportRecord {\n    ...VatReportAccountantApprovalFields\n    business {\n      id\n      name\n    }\n    vatNumber\n    image\n    allocationNumber\n    documentSerial\n    documentDate\n    chargeDate\n    chargeId\n    # chargeAccountantReviewed\n    amount {\n      formatted\n      raw\n    }\n    localAmount {\n      formatted\n      raw\n    }\n    localVat {\n      formatted\n      raw\n    }\n    foreignVatAfterDeduction {\n      formatted\n      raw\n    }\n    localVatAfterDeduction {\n      formatted\n      raw\n    }\n    roundedLocalVatAfterDeduction {\n      formatted\n      raw\n    }\n    taxReducedLocalAmount {\n      formatted\n      raw\n    }\n    recordType\n  }\n": VatReportExpensesRowFieldsFragmentDoc,
  "\n  fragment VatReportExpensesFields on VatReportResult {\n    expenses {\n      ...VatReportExpensesRowFields\n      roundedLocalVatAfterDeduction {\n        raw\n      }\n      taxReducedLocalAmount {\n        raw\n      }\n      recordType\n    }\n  }\n": VatReportExpensesFieldsFragmentDoc,
  "\n  fragment VatReportIncomeRowFields on VatReportRecord {\n    ...VatReportAccountantApprovalFields\n    chargeId\n    business {\n      id\n      name\n    }\n    vatNumber\n    image\n    allocationNumber\n    documentSerial\n    documentDate\n    chargeDate\n    taxReducedForeignAmount {\n      formatted\n      raw\n    }\n    taxReducedLocalAmount {\n      formatted\n      raw\n    }\n    recordType\n  }\n": VatReportIncomeRowFieldsFragmentDoc,
  "\n  fragment VatReportIncomeFields on VatReportResult {\n    income {\n      ...VatReportIncomeRowFields\n      taxReducedLocalAmount {\n        raw\n      }\n      recordType\n    }\n  }\n": VatReportIncomeFieldsFragmentDoc,
  "\n  query VatMonthlyReport($filters: VatReportFilter) {\n    vatReport(filters: $filters) {\n      ...VatReportSummaryFields\n      ...VatReportIncomeFields\n      ...VatReportExpensesFields\n      ...VatReportMissingInfoFields\n      ...VatReportMiscTableFields\n      ...VatReportBusinessTripsFields\n    }\n  }\n": VatMonthlyReportDocument,
  "\n  fragment VatReportMiscTableFields on VatReportResult {\n    differentMonthDoc {\n      id\n      ...ChargeForChargesTableFields\n    }\n  }\n": VatReportMiscTableFieldsFragmentDoc,
  "\n  fragment VatReportMissingInfoFields on VatReportResult {\n    missingInfo {\n      id\n      ...ChargeForChargesTableFields\n    }\n  }\n": VatReportMissingInfoFieldsFragmentDoc,
  "\n  query GeneratePCN($monthDate: TimelessDate!, $financialEntityId: UUID!) {\n    pcnFile(monthDate: $monthDate, financialEntityId: $financialEntityId) {\n      reportContent\n      fileName\n    }\n  }\n": GeneratePcnDocument,
  "\n  fragment VatReportSummaryFields on VatReportResult {\n    expenses {\n      roundedLocalVatAfterDeduction {\n        raw\n      }\n      taxReducedLocalAmount {\n        raw\n      }\n      recordType\n      isProperty\n    }\n    income {\n      roundedLocalVatAfterDeduction {\n        raw\n      }\n      taxReducedLocalAmount {\n        raw\n      }\n      recordType\n    }\n  }\n": VatReportSummaryFieldsFragmentDoc,
  "\n  fragment LedgerCsvFields on YearlyLedgerReport {\n    id\n    year\n    financialEntitiesInfo {\n      entity {\n        id\n        name\n        sortCode {\n          id\n          key\n        }\n      }\n      openingBalance {\n        raw\n      }\n      totalCredit {\n        raw\n      }\n      totalDebit {\n        raw\n      }\n      closingBalance {\n        raw\n      }\n      records {\n        id\n        amount {\n          raw\n          formatted\n        }\n        invoiceDate\n        valueDate\n        description\n        reference\n        counterParty {\n          id\n          name\n        }\n        balance\n      }\n    }\n  }\n": LedgerCsvFieldsFragmentDoc,
  "\n  query YearlyLedger($year: Int!) {\n    yearlyLedgerReport(year: $year) {\n      id\n      year\n      financialEntitiesInfo {\n        entity {\n          id\n          name\n          sortCode {\n            id\n            key\n          }\n        }\n        openingBalance {\n          raw\n        }\n        totalCredit {\n          raw\n        }\n        totalDebit {\n          raw\n        }\n        closingBalance {\n          raw\n        }\n        records {\n          id\n          amount {\n            raw\n            formatted\n          }\n          invoiceDate\n          valueDate\n          description\n          reference\n          counterParty {\n            id\n            name\n          }\n          balance\n        }\n      }\n      ...LedgerCsvFields\n    }\n  }\n": YearlyLedgerDocument,
  "\n  query SalaryScreenRecords(\n    $fromDate: TimelessDate!\n    $toDate: TimelessDate!\n    $employeeIDs: [UUID!]\n  ) {\n    salaryRecordsByDates(fromDate: $fromDate, toDate: $toDate, employeeIDs: $employeeIDs) {\n      month\n      employee {\n        id\n      }\n      ...SalariesTableFields\n    }\n  }\n": SalaryScreenRecordsDocument,
  "\n  fragment SalariesRecordEmployeeFields on Salary {\n    month\n    employee {\n      id\n      name\n    }\n  }\n": SalariesRecordEmployeeFieldsFragmentDoc,
  "\n  fragment SalariesRecordFundsFields on Salary {\n    month\n    employee {\n      id\n    }\n    pensionFund {\n      id\n      name\n    }\n    pensionEmployeeAmount {\n      formatted\n      raw\n    }\n    pensionEmployeePercentage\n    pensionEmployerAmount {\n      formatted\n      raw\n    }\n    pensionEmployerPercentage\n    compensationsAmount {\n      formatted\n      raw\n    }\n    compensationsPercentage\n    trainingFund {\n      id\n      name\n    }\n    trainingFundEmployeeAmount {\n      formatted\n      raw\n    }\n    trainingFundEmployeePercentage\n    trainingFundEmployerAmount {\n      formatted\n      raw\n    }\n    trainingFundEmployerPercentage\n  }\n": SalariesRecordFundsFieldsFragmentDoc,
  "\n  fragment SalariesRecordInsurancesAndTaxesFields on Salary {\n    month\n    employee {\n      id\n    }\n    healthInsuranceAmount {\n      formatted\n      raw\n    }\n    socialSecurityEmployeeAmount {\n      formatted\n      raw\n    }\n    socialSecurityEmployerAmount {\n      formatted\n      raw\n    }\n    incomeTaxAmount {\n      formatted\n      raw\n    }\n    notionalExpense {\n      formatted\n      raw\n    }\n  }\n": SalariesRecordInsurancesAndTaxesFieldsFragmentDoc,
  "\n  fragment SalariesRecordMainSalaryFields on Salary {\n    month\n    employee {\n      id\n    }\n    baseAmount {\n      formatted\n    }\n    directAmount {\n      formatted\n    }\n    globalAdditionalHoursAmount {\n      formatted\n    }\n    bonus {\n      formatted\n      raw\n    }\n    gift {\n      formatted\n      raw\n    }\n    recovery {\n      formatted\n      raw\n    }\n    vacationTakeout {\n      formatted\n      raw\n    }\n  }\n": SalariesRecordMainSalaryFieldsFragmentDoc,
  "\n  fragment SalariesRecordWorkFrameFields on Salary {\n    month\n    employee {\n      id\n    }\n    vacationDays {\n      added\n      taken\n      balance\n    }\n    workDays\n    sicknessDays {\n      balance\n    }\n  }\n": SalariesRecordWorkFrameFieldsFragmentDoc,
  "\n  fragment SalariesMonthFields on Salary {\n    month\n    employee {\n      id\n    }\n    ...SalariesRecordFields\n  }\n": SalariesMonthFieldsFragmentDoc,
  "\n  fragment SalariesTableFields on Salary {\n    month\n    employee {\n      id\n    }\n    ...SalariesMonthFields\n  }\n": SalariesTableFieldsFragmentDoc,
  "\n  fragment SalariesRecordFields on Salary {\n    month\n    employee {\n      id\n    }\n    ...SalariesRecordEmployeeFields\n    ...SalariesRecordMainSalaryFields\n    ...SalariesRecordFundsFields\n    ...SalariesRecordInsurancesAndTaxesFields\n    ...SalariesRecordWorkFrameFields\n  }\n": SalariesRecordFieldsFragmentDoc,
  "\n  query AllDeposits {\n    allDeposits {\n      id\n      name\n      currency\n      openDate\n      closeDate\n      isOpen\n      metadata {\n        id\n        currentBalance {\n          raw\n          formatted\n        }\n        totalDeposit {\n          raw\n          formatted\n        }\n        totalInterest {\n          raw\n          formatted\n        }\n        # transactions field exists but we don't need to pull ids here\n      }\n    }\n  }\n": AllDepositsDocument,
  "\n  query BusinessScreen($businessId: UUID!) {\n    business(id: $businessId) {\n      id\n      ...BusinessPage\n    }\n  }\n": BusinessScreenDocument,
  "\n  query ContractsScreen($adminId: UUID!) {\n    contractsByAdmin(adminId: $adminId) {\n      id\n      ...ContractForContractsTableFields\n    }\n  }\n": ContractsScreenDocument,
  "\n  query AllCharges($page: Int, $limit: Int, $filters: ChargeFilter) {\n    allCharges(page: $page, limit: $limit, filters: $filters) {\n      nodes {\n        id\n        ...ChargeForChargesTableFields\n      }\n      pageInfo {\n        totalPages\n      }\n    }\n  }\n": AllChargesDocument,
  "\n  query ChargeScreen($chargeId: UUID!) {\n    charge(chargeId: $chargeId) {\n      id\n      ...ChargeForChargesTableFields\n    }\n  }\n": ChargeScreenDocument,
  "\n  query MissingInfoCharges($page: Int, $limit: Int) {\n    chargesWithMissingRequiredInfo(page: $page, limit: $limit) {\n      nodes {\n        id\n        ...ChargeForChargesTableFields\n      }\n      pageInfo {\n        totalPages\n      }\n    }\n  }\n": MissingInfoChargesDocument,
  "\n  query DocumentsScreen($filters: DocumentsFilters!) {\n    documentsByFilters(filters: $filters) {\n      id\n      image\n      file\n      charge {\n        id\n        userDescription\n        __typename\n        vat {\n          formatted\n          __typename\n        }\n        transactions {\n          id\n          eventDate\n          sourceDescription\n          effectiveDate\n          amount {\n            formatted\n            __typename\n          }\n        }\n      }\n      __typename\n      ... on FinancialDocument {\n        creditor {\n          id\n          name\n        }\n        debtor {\n          id\n          name\n        }\n        vat {\n          raw\n          formatted\n          currency\n        }\n        serialNumber\n        date\n        amount {\n          raw\n          formatted\n          currency\n        }\n      }\n    }\n  }\n": DocumentsScreenDocument,
  "\n  query MonthlyDocumentDraftByClient($clientId: UUID!, $issueMonth: TimelessDate!) {\n    clientMonthlyChargeDraft(clientId: $clientId, issueMonth: $issueMonth) {\n      ...NewDocumentDraft\n    }\n  }\n": MonthlyDocumentDraftByClientDocument,
  "\n  query MonthlyDocumentsDrafts($issueMonth: TimelessDate!) {\n    periodicalDocumentDrafts(issueMonth: $issueMonth) {\n      ...NewDocumentDraft\n    }\n  }\n": MonthlyDocumentsDraftsDocument,
  "\n  query AllOpenContracts {\n    allOpenContracts {\n      id\n      client {\n        id\n        originalBusiness {\n          id\n          name\n        }\n      }\n      billingCycle\n    }\n  }\n": AllOpenContractsDocument,
  "\n  query AnnualAuditStepsStatus($ownerId: UUID!, $year: Int!) {\n    annualAuditStepStatuses(ownerId: $ownerId, year: $year) {\n      id\n      stepId\n      status\n      notes\n    }\n  }\n": AnnualAuditStepsStatusDocument,
  "\n  query AccountantApprovalStatus($fromDate: TimelessDate!, $toDate: TimelessDate!) {\n    accountantApprovalStatus(from: $fromDate, to: $toDate) {\n      totalCharges\n      approvedCount\n      pendingCount\n      unapprovedCount\n    }\n  }\n": AccountantApprovalStatusDocument,
  "\n  query LedgerValidationStatus($limit: Int, $filters: ChargeFilter) {\n    chargesWithLedgerChanges(limit: $limit, filters: $filters) {\n      charge {\n        id\n      }\n    }\n  }\n": LedgerValidationStatusDocument,
  "\n  query AnnualAuditOpeningBalanceStatus($ownerId: UUID!, $year: Int!) {\n    annualAuditOpeningBalanceStatus(ownerId: $ownerId, year: $year) {\n      id\n      userType\n      balanceChargeId\n      derivedStatus\n      errorMessage\n    }\n  }\n": AnnualAuditOpeningBalanceStatusDocument,
  "\n  query AnnualFinancialCharges($ownerId: UUID, $year: TimelessDate!) {\n    annualFinancialCharges(ownerId: $ownerId, year: $year) {\n      id\n      revaluationCharge {\n        id\n      }\n      taxExpensesCharge {\n        id\n      }\n      depreciationCharge {\n        id\n      }\n      recoveryReserveCharge {\n        id\n      }\n      vacationReserveCharge {\n        id\n      }\n      bankDepositsRevaluationCharge {\n        id\n      }\n    }\n  }\n": AnnualFinancialChargesDocument,
  "\n  query Step05PrevYearTemplate($ownerId: UUID!, $year: Int!) {\n    annualAuditStepStatuses(ownerId: $ownerId, year: $year) {\n      id\n      stepId\n      status\n      evidence\n    }\n  }\n": Step05PrevYearTemplateDocument,
  "\n  query AdminLedgerLockDate($ownerId: UUID) {\n    adminContext(ownerId: $ownerId) {\n      id\n      ledgerLock\n    }\n  }\n": AdminLedgerLockDateDocument,
  "\n  query Step09SaveTemplateStatus($ownerId: UUID!, $year: Int!) {\n    annualAuditStepStatuses(ownerId: $ownerId, year: $year) {\n      id\n      stepId\n      status\n      evidence\n    }\n  }\n": Step09SaveTemplateStatusDocument,
  "\n  fragment AnnualRevenueReportClient on AnnualRevenueReportCountryClient {\n    id\n    name\n    revenueLocal {\n      raw\n      formatted\n      currency\n    }\n    revenueDefaultForeign {\n      raw\n      formatted\n      currency\n    }\n    records {\n      id\n      date\n      ...AnnualRevenueReportRecord\n    }\n  }\n": AnnualRevenueReportClientFragmentDoc,
  "\n  fragment AnnualRevenueReportCountry on AnnualRevenueReportCountry {\n    id\n    code\n    name\n    revenueLocal {\n      raw\n      formatted\n      currency\n    }\n    revenueDefaultForeign {\n      raw\n      formatted\n      currency\n    }\n    clients {\n      id\n      revenueDefaultForeign {\n        raw\n      }\n      ...AnnualRevenueReportClient\n    }\n  }\n": AnnualRevenueReportCountryFragmentDoc,
  "\n  query AnnualRevenueReportScreen($filters: AnnualRevenueReportFilter!) {\n    annualRevenueReport(filters: $filters) {\n      id\n      year\n      countries {\n        id\n        name\n        revenueLocal {\n          raw\n          currency\n        }\n        revenueDefaultForeign {\n          raw\n          currency\n        }\n        clients {\n          id\n          name\n          revenueLocal {\n            raw\n          }\n          revenueDefaultForeign {\n            raw\n          }\n          records {\n            id\n            date\n            description\n            reference\n            chargeId\n            revenueLocal {\n              raw\n            }\n            revenueDefaultForeign {\n              raw\n            }\n          }\n        }\n        ...AnnualRevenueReportCountry\n      }\n    }\n  }\n": AnnualRevenueReportScreenDocument,
  "\n  fragment AnnualRevenueReportRecord on AnnualRevenueReportClientRecord {\n    id\n    revenueLocal {\n      raw\n      formatted\n      currency\n    }\n    revenueDefaultForeign {\n      raw\n      formatted\n      currency\n    }\n    revenueOriginal {\n      raw\n      formatted\n      currency\n    }\n    chargeId\n    date\n    description\n    reference\n  }\n": AnnualRevenueReportRecordFragmentDoc,
  "\n  query BalanceReportExtendedTransactions($transactionIDs: [UUID!]!) {\n    transactionsByIDs(transactionIDs: $transactionIDs) {\n      id\n      ...TransactionForTransactionsTableFields\n      ...TransactionToDownloadForTransactionsTableFields\n    }\n  }\n": BalanceReportExtendedTransactionsDocument,
  "\n  query BalanceReportScreen($fromDate: TimelessDate!, $toDate: TimelessDate!, $ownerId: UUID) {\n    transactionsForBalanceReport(fromDate: $fromDate, toDate: $toDate, ownerId: $ownerId) {\n      id\n      amountUsd {\n        formatted\n        raw\n      }\n      amount {\n        currency\n        raw\n      }\n      date\n      month\n      year\n      counterparty {\n        id\n      }\n      account {\n        id\n        name\n      }\n      isFee\n      description\n      charge {\n        id\n        tags {\n          id\n          name\n        }\n      }\n    }\n  }\n": BalanceReportScreenDocument,
  "\n  fragment DepreciationReportRecordCore on DepreciationCoreRecord {\n    id\n    originalCost\n    reportYearDelta\n    totalDepreciableCosts\n    reportYearClaimedDepreciation\n    pastYearsAccumulatedDepreciation\n    totalDepreciation\n    netValue\n  }\n": DepreciationReportRecordCoreFragmentDoc,
  "\n  query DepreciationReportScreen($filters: DepreciationReportFilter!) {\n    depreciationReport(filters: $filters) {\n      id\n      year\n      categories {\n        id\n        category {\n          id\n          name\n          percentage\n        }\n        records {\n          id\n          chargeId\n          description\n          purchaseDate\n          activationDate\n          statutoryDepreciationRate\n          claimedDepreciationRate\n          ...DepreciationReportRecordCore\n        }\n        summary {\n          id\n          ...DepreciationReportRecordCore\n        }\n      }\n      summary {\n        id\n        ...DepreciationReportRecordCore\n      }\n    }\n  }\n": DepreciationReportScreenDocument,
  "\n  fragment Shaam6111DataContentBalanceSheet on Shaam6111Data {\n    id\n    balanceSheet {\n      code\n      amount\n      label\n    }\n  }\n": Shaam6111DataContentBalanceSheetFragmentDoc,
  "\n  fragment Shaam6111DataContentHeader on Shaam6111Data {\n    id\n    header {\n      taxYear\n      businessDescription\n      taxFileNumber\n      idNumber\n      vatFileNumber\n      withholdingTaxFileNumber\n      businessType\n      reportingMethod\n      currencyType\n      amountsInThousands\n      accountingMethod\n      accountingSystem\n      softwareRegistrationNumber\n      isPartnership\n      partnershipCount\n      partnershipProfitShare\n      ifrsImplementationYear\n      ifrsReportingOption\n\n      includesProfitLoss\n      includesTaxAdjustment\n      includesBalanceSheet\n\n      industryCode\n      auditOpinionType\n    }\n  }\n": Shaam6111DataContentHeaderFragmentDoc,
  "\n  fragment Shaam6111DataContentHeaderBusiness on Business {\n    id\n    name\n  }\n": Shaam6111DataContentHeaderBusinessFragmentDoc,
  "\n  query Shaam6111ReportScreen($year: Int!, $businessId: UUID) {\n    shaam6111(year: $year, businessId: $businessId) {\n      id\n      year\n      data {\n        id\n        ...Shaam6111DataContent\n      }\n      business {\n        id\n        ...Shaam6111DataContentHeaderBusiness\n      }\n    }\n  }\n": Shaam6111ReportScreenDocument,
  "\n  fragment Shaam6111DataContentProfitLoss on Shaam6111Data {\n    id\n    profitAndLoss {\n      code\n      amount\n      label\n    }\n  }\n": Shaam6111DataContentProfitLossFragmentDoc,
  "\n  fragment Shaam6111DataContent on Shaam6111Data {\n    id\n    ...Shaam6111DataContentHeader\n    ...Shaam6111DataContentProfitLoss\n    ...Shaam6111DataContentTaxAdjustment\n    ...Shaam6111DataContentBalanceSheet\n  }\n": Shaam6111DataContentFragmentDoc,
  "\n  fragment Shaam6111DataContentTaxAdjustment on Shaam6111Data {\n    id\n    taxAdjustment {\n      code\n      amount\n      label\n    }\n  }\n": Shaam6111DataContentTaxAdjustmentFragmentDoc,
  "\n  query AllSortCodesForScreen {\n    allSortCodes {\n      id\n      ownerId\n      key\n      name\n      defaultIrsCode\n    }\n  }\n": AllSortCodesForScreenDocument,
  "\n  query AllTagsScreen {\n    allTags {\n      id\n      name\n      namePath\n      parent {\n        id\n      }\n      ...EditTagFields\n    }\n  }\n": AllTagsScreenDocument,
  "\n  query AllTaxCategoriesForScreen {\n    taxCategories {\n      id\n      name\n      sortCode {\n        id\n        key\n        name\n      }\n    }\n  }\n": AllTaxCategoriesForScreenDocument,
  "\n  fragment TransactionsTableAccountFields on Transaction {\n    id\n    account {\n      id\n      name\n      type\n    }\n  }\n": TransactionsTableAccountFieldsFragmentDoc,
  "\n  fragment TransactionsTableEntityFields on Transaction {\n    id\n    counterparty {\n      name\n      id\n    }\n    sourceDescription\n    missingInfoSuggestions {\n      business {\n        id\n        name\n      }\n    }\n  }\n": TransactionsTableEntityFieldsFragmentDoc,
  "\n  fragment TransactionsTableDebitDateFields on Transaction {\n    id\n    effectiveDate\n    sourceEffectiveDate\n  }\n": TransactionsTableDebitDateFieldsFragmentDoc,
  "\n  fragment TransactionsTableDescriptionFields on Transaction {\n    id\n    sourceDescription\n  }\n": TransactionsTableDescriptionFieldsFragmentDoc,
  "\n  fragment TransactionsTableEventDateFields on Transaction {\n    id\n    eventDate\n  }\n": TransactionsTableEventDateFieldsFragmentDoc,
  "\n  fragment TransactionsTableSourceIDFields on Transaction {\n    id\n    referenceKey\n  }\n": TransactionsTableSourceIdFieldsFragmentDoc,
  "\n  fragment TransactionForTransactionsTableFields on Transaction {\n    id\n    isFee\n    chargeId\n    eventDate\n    effectiveDate\n    sourceEffectiveDate\n    amount {\n      raw\n      formatted\n    }\n    cryptoExchangeRate {\n      rate\n    }\n    account {\n      id\n      name\n      type\n    }\n    sourceDescription\n    referenceKey\n    counterparty {\n      name\n      id\n    }\n    missingInfoSuggestions {\n      business {\n        id\n        name\n      }\n    }\n  }\n": TransactionForTransactionsTableFieldsFragmentDoc,
  "\n  fragment TransactionToDownloadForTransactionsTableFields on Transaction {\n    id\n    account {\n      id\n      name\n      type\n    }\n    amount {\n      currency\n      raw\n    }\n    counterparty {\n      id\n      name\n    }\n    effectiveDate\n    eventDate\n    referenceKey\n    sourceDescription\n  }\n": TransactionToDownloadForTransactionsTableFieldsFragmentDoc,
  "\n  mutation AcceptInvitation($token: String!) {\n    acceptInvitation(token: $token) {\n      success\n      businessId\n      roleId\n    }\n  }\n": AcceptInvitationDocument,
  "\n  mutation AddBusinessTripAccommodationsExpense(\n    $fields: AddBusinessTripAccommodationsExpenseInput!\n  ) {\n    addBusinessTripAccommodationsExpense(fields: $fields)\n  }\n": AddBusinessTripAccommodationsExpenseDocument,
  "\n  mutation AddBusinessTripCarRentalExpense($fields: AddBusinessTripCarRentalExpenseInput!) {\n    addBusinessTripCarRentalExpense(fields: $fields)\n  }\n": AddBusinessTripCarRentalExpenseDocument,
  "\n  mutation AddBusinessTripFlightsExpense($fields: AddBusinessTripFlightsExpenseInput!) {\n    addBusinessTripFlightsExpense(fields: $fields)\n  }\n": AddBusinessTripFlightsExpenseDocument,
  "\n  mutation AddBusinessTripOtherExpense($fields: AddBusinessTripOtherExpenseInput!) {\n    addBusinessTripOtherExpense(fields: $fields)\n  }\n": AddBusinessTripOtherExpenseDocument,
  "\n  mutation AddBusinessTripTravelAndSubsistenceExpense(\n    $fields: AddBusinessTripTravelAndSubsistenceExpenseInput!\n  ) {\n    addBusinessTripTravelAndSubsistenceExpense(fields: $fields)\n  }\n": AddBusinessTripTravelAndSubsistenceExpenseDocument,
  "\n  mutation AddDepreciationRecord($fields: InsertDepreciationRecordInput!) {\n    insertDepreciationRecord(input: $fields) {\n      __typename\n      ... on CommonError {\n        message\n      }\n      ... on DepreciationRecord {\n        id\n      }\n    }\n  }\n": AddDepreciationRecordDocument,
  "\n  mutation AddSortCode($key: Int!, $name: String!, $defaultIrsCode: Int) {\n    addSortCode(key: $key, name: $name, defaultIrsCode: $defaultIrsCode)\n  }\n": AddSortCodeDocument,
  "\n  mutation AddTag($tagName: String!, $parentTag: UUID) {\n    addTag(name: $tagName, parentId: $parentTag)\n  }\n": AddTagDocument,
  "\n  query AnnualAuditStepStatus($ownerId: UUID!, $year: Int!) {\n    annualAuditStepStatuses(ownerId: $ownerId, year: $year) {\n      id\n      stepId\n      status\n    }\n  }\n": AnnualAuditStepStatusDocument,
  "\n  mutation AssignChargeToDeposit($chargeId: UUID!, $depositId: String!) {\n    assignChargeToDeposit(chargeId: $chargeId, depositId: $depositId) {\n      id\n    }\n  }\n": AssignChargeToDepositDocument,
  "\n  mutation GenerateBalanceCharge(\n    $description: String!\n    $balanceRecords: [InsertMiscExpenseInput!]!\n  ) {\n    generateBalanceCharge(description: $description, balanceRecords: $balanceRecords) {\n      id\n    }\n  }\n": GenerateBalanceChargeDocument,
  "\n  mutation BatchUpdateBusinesses($businessIds: [UUID!]!, $fields: BatchUpdateBusinessInput!) {\n    batchUpdateBusinesses(businessIds: $businessIds, fields: $fields) {\n      id\n    }\n  }\n": BatchUpdateBusinessesDocument,
  "\n  mutation BatchUpdateCharges($chargeIds: [UUID!]!, $fields: UpdateChargeInput!) {\n    batchUpdateCharges(chargeIds: $chargeIds, fields: $fields) {\n      __typename\n      ... on BatchUpdateChargesSuccessfulResult {\n        charges {\n          id\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": BatchUpdateChargesDocument,
  "\n  mutation CategorizeBusinessTripExpense($fields: CategorizeBusinessTripExpenseInput!) {\n    categorizeBusinessTripExpense(fields: $fields)\n  }\n": CategorizeBusinessTripExpenseDocument,
  "\n  mutation CategorizeIntoExistingBusinessTripExpense(\n    $fields: CategorizeIntoExistingBusinessTripExpenseInput!\n  ) {\n    categorizeIntoExistingBusinessTripExpense(fields: $fields)\n  }\n": CategorizeIntoExistingBusinessTripExpenseDocument,
  "\n  mutation CloseDocument($documentId: UUID!) {\n    closeDocument(id: $documentId)\n  }\n": CloseDocumentDocument,
  "\n  mutation CreateContract($input: CreateContractInput!) {\n    createContract(input: $input) {\n      id\n    }\n  }\n": CreateContractDocument,
  "\n  mutation CreateDepositFromCharge($chargeId: UUID!, $name: String!) {\n    createDepositFromCharge(chargeId: $chargeId, name: $name) {\n      id\n      name\n      currency\n      isOpen\n    }\n  }\n": CreateDepositFromChargeDocument,
  "\n  mutation CreateDeposit(\n    $name: String!\n    $currency: Currency!\n    $openDate: TimelessDate!\n    $accountId: UUID\n  ) {\n    createDeposit(name: $name, currency: $currency, openDate: $openDate, accountId: $accountId) {\n      id\n      currency\n      isOpen\n    }\n  }\n": CreateDepositDocument,
  "\n  mutation CreateFinancialAccount($input: CreateFinancialAccountInput!) {\n    createFinancialAccount(input: $input) {\n      id\n    }\n  }\n": CreateFinancialAccountDocument,
  "\n  mutation CreateInvitation($email: String!, $roleId: String!) {\n    createInvitation(email: $email, roleId: $roleId) {\n      id\n      email\n      roleId\n      expiresAt\n    }\n  }\n": CreateInvitationDocument,
  "\n  mutation CreditShareholdersBusinessTripTravelAndSubsistence($businessTripId: UUID!) {\n    creditShareholdersBusinessTripTravelAndSubsistence(businessTripId: $businessTripId)\n  }\n": CreditShareholdersBusinessTripTravelAndSubsistenceDocument,
  "\n  mutation FlagForeignFeeTransactions {\n    flagForeignFeeTransactions {\n      success\n      errors\n    }\n  }\n": FlagForeignFeeTransactionsDocument,
  "\n  mutation MergeChargesByTransactionReference($dryRun: Boolean) {\n    mergeChargesByTransactionReference(dryRun: $dryRun) {\n      success\n      errors\n    }\n  }\n": MergeChargesByTransactionReferenceDocument,
  "\n  mutation CalculateCreditcardTransactionsDebitDate {\n    calculateCreditcardTransactionsDebitDate\n  }\n": CalculateCreditcardTransactionsDebitDateDocument,
  "\n  mutation DeleteBusinessTripAttendee($fields: DeleteBusinessTripAttendeeInput!) {\n    deleteBusinessTripAttendee(fields: $fields)\n  }\n": DeleteBusinessTripAttendeeDocument,
  "\n  mutation DeleteBusinessTripExpense($businessTripExpenseId: UUID!) {\n    deleteBusinessTripExpense(businessTripExpenseId: $businessTripExpenseId)\n  }\n": DeleteBusinessTripExpenseDocument,
  "\n  mutation DeleteBusiness($businessId: UUID!) {\n    deleteBusiness(businessId: $businessId)\n  }\n": DeleteBusinessDocument,
  "\n  mutation DeleteCharge($chargeId: UUID!) {\n    deleteCharge(chargeId: $chargeId)\n  }\n": DeleteChargeDocument,
  "\n  mutation DeleteContract($contractId: UUID!) {\n    deleteContract(id: $contractId)\n  }\n": DeleteContractDocument,
  "\n  mutation DeleteDepreciationRecord($depreciationRecordId: UUID!) {\n    deleteDepreciationRecord(depreciationRecordId: $depreciationRecordId)\n  }\n": DeleteDepreciationRecordDocument,
  "\n  mutation DeleteDocument($documentId: UUID!) {\n    deleteDocument(documentId: $documentId)\n  }\n": DeleteDocumentDocument,
  "\n  mutation DeleteDynamicReportTemplate($name: String!) {\n    deleteDynamicReportTemplate(name: $name)\n  }\n": DeleteDynamicReportTemplateDocument,
  "\n  mutation DeleteMiscExpense($id: UUID!) {\n    deleteMiscExpense(id: $id)\n  }\n": DeleteMiscExpenseDocument,
  "\n  mutation DeleteProviderCredentials($provider: ProviderKey!) {\n    deleteProviderCredentials(provider: $provider) {\n      ... on ProviderCredentialDeleteResult {\n        id\n        provider\n        success\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": DeleteProviderCredentialsDocument,
  "\n  mutation DeleteTag($tagId: UUID!) {\n    deleteTag(id: $tagId)\n  }\n": DeleteTagDocument,
  "\n  mutation FetchDeelDocuments {\n    fetchDeelDocuments {\n      id\n    }\n  }\n": FetchDeelDocumentsDocument,
  "\n  mutation GenerateApiKey($name: String!, $roleId: String!) {\n    generateApiKey(name: $name, roleId: $roleId) {\n      apiKey\n      record {\n        id\n        name\n        roleId\n        lastUsedAt\n        createdAt\n      }\n    }\n  }\n": GenerateApiKeyDocument,
  "\n  mutation GenerateRevaluationCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateRevaluationCharge(ownerId: $ownerId, date: $date) {\n      id\n    }\n  }\n": GenerateRevaluationChargeDocument,
  "\n  mutation GenerateBankDepositsRevaluationCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateBankDepositsRevaluationCharge(ownerId: $ownerId, date: $date) {\n      id\n    }\n  }\n": GenerateBankDepositsRevaluationChargeDocument,
  "\n  mutation GenerateTaxExpensesCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateTaxExpensesCharge(ownerId: $ownerId, year: $date) {\n      id\n    }\n  }\n": GenerateTaxExpensesChargeDocument,
  "\n  mutation GenerateDepreciationCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateDepreciationCharge(ownerId: $ownerId, year: $date) {\n      id\n    }\n  }\n": GenerateDepreciationChargeDocument,
  "\n  mutation GenerateRecoveryReserveCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateRecoveryReserveCharge(ownerId: $ownerId, year: $date) {\n      id\n    }\n  }\n": GenerateRecoveryReserveChargeDocument,
  "\n  mutation GenerateVacationReserveCharge($ownerId: UUID!, $date: TimelessDate!) {\n    generateVacationReserveCharge(ownerId: $ownerId, year: $date) {\n      id\n    }\n  }\n": GenerateVacationReserveChargeDocument,
  "\n  query AllAdminBusinesses {\n    allAdminBusinesses {\n      id\n      name\n      governmentId\n    }\n  }\n": AllAdminBusinessesDocument,
  "\n  query AllClients {\n    allClients {\n      id\n      originalBusiness {\n        id\n        name\n      }\n    }\n  }\n": AllClientsDocument,
  "\n  query AllBusinesses {\n    allBusinesses {\n      nodes {\n        id\n        name\n      }\n    }\n  }\n": AllBusinessesDocument,
  "\n  query AllCountries {\n    allCountries {\n      id\n      name\n      code\n    }\n  }\n": AllCountriesDocument,
  "\n  query AllFinancialAccounts {\n    allFinancialAccounts {\n      id\n      name\n    }\n  }\n": AllFinancialAccountsDocument,
  "\n  query AllFinancialEntities {\n    allFinancialEntities {\n      nodes {\n        id\n        name\n      }\n    }\n  }\n": AllFinancialEntitiesDocument,
  "\n  query AllSortCodes($ownerId: String!) {\n    allSortCodesByBusiness(ownerId: $ownerId) {\n      id\n      key\n      name\n      defaultIrsCode\n    }\n  }\n": AllSortCodesDocument,
  "\n  query AllTags {\n    allTags {\n      id\n      name\n      namePath\n    }\n  }\n": AllTagsDocument,
  "\n  query AllTaxCategories {\n    taxCategories {\n      id\n      name\n    }\n  }\n": AllTaxCategoriesDocument,
  "\n  mutation InsertBusinessTripAttendee($fields: InsertBusinessTripAttendeeInput!) {\n    insertBusinessTripAttendee(fields: $fields)\n  }\n": InsertBusinessTripAttendeeDocument,
  "\n  mutation InsertBusinessTrip($fields: InsertBusinessTripInput!) {\n    insertBusinessTrip(fields: $fields)\n  }\n": InsertBusinessTripDocument,
  "\n  mutation InsertBusiness($fields: InsertNewBusinessInput!) {\n    insertNewBusiness(fields: $fields) {\n      __typename\n      ... on LtdFinancialEntity {\n        id\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": InsertBusinessDocument,
  "\n  mutation InsertClient($fields: ClientInsertInput!) {\n    insertClient(fields: $fields) {\n      __typename\n      ... on Client {\n        id\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": InsertClientDocument,
  "\n  mutation InsertDocument($record: InsertDocumentInput!) {\n    insertDocument(record: $record) {\n      __typename\n      ... on InsertDocumentSuccessfulResult {\n        document {\n          id\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": InsertDocumentDocument,
  "\n  mutation InsertDynamicReportTemplate($name: String!, $template: String!) {\n    insertDynamicReportTemplate(name: $name, template: $template) {\n      id\n      name\n    }\n  }\n": InsertDynamicReportTemplateDocument,
  "\n  mutation InsertMiscExpense($chargeId: UUID!, $fields: InsertMiscExpenseInput!) {\n    insertMiscExpense(chargeId: $chargeId, fields: $fields) {\n      id\n    }\n  }\n": InsertMiscExpenseDocument,
  "\n  mutation InsertMiscExpenses($chargeId: UUID!, $expenses: [InsertMiscExpenseInput!]!) {\n    insertMiscExpenses(chargeId: $chargeId, expenses: $expenses) {\n      id\n    }\n  }\n": InsertMiscExpensesDocument,
  "\n  mutation InsertSalaryRecord($salaryRecords: [SalaryRecordInput!]!) {\n    insertSalaryRecords(salaryRecords: $salaryRecords) {\n      __typename\n      ... on InsertSalaryRecordsSuccessfulResult {\n        salaryRecords {\n          month\n          employee {\n            id\n          }\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": InsertSalaryRecordDocument,
  "\n  mutation InsertTaxCategory($fields: InsertTaxCategoryInput!) {\n    insertTaxCategory(fields: $fields) {\n      id\n      name\n    }\n  }\n": InsertTaxCategoryDocument,
  "\n  mutation IssueGreenInvoiceDocument(\n    $input: DocumentIssueInput!\n    $emailContent: String\n    $attachment: Boolean\n    $chargeId: UUID\n  ) {\n    issueGreenInvoiceDocument(\n      input: $input\n      emailContent: $emailContent\n      attachment: $attachment\n      chargeId: $chargeId\n    ) {\n      id\n    }\n  }\n": IssueGreenInvoiceDocumentDocument,
  "\n  mutation IssueMonthlyDocuments($generateDocumentsInfo: [DocumentIssueInput!]!) {\n    issueGreenInvoiceDocuments(generateDocumentsInfo: $generateDocumentsInfo) {\n      success\n      errors\n    }\n  }\n": IssueMonthlyDocumentsDocument,
  "\n  mutation LedgerLock($date: TimelessDate!) {\n    lockLedgerRecords(date: $date)\n  }\n": LedgerLockDocument,
  "\n  mutation LockDynamicReportTemplate($name: String!) {\n    lockDynamicReportTemplate(name: $name) {\n      id\n      name\n      isLocked\n      updated\n    }\n  }\n": LockDynamicReportTemplateDocument,
  "\n  mutation MergeBusinesses($targetBusinessId: UUID!, $businessIdsToMerge: [UUID!]!) {\n    mergeBusinesses(targetBusinessId: $targetBusinessId, businessIdsToMerge: $businessIdsToMerge) {\n      __typename\n      id\n    }\n  }\n": MergeBusinessesDocument,
  "\n  mutation MergeCharges(\n    $baseChargeID: UUID!\n    $chargeIdsToMerge: [UUID!]!\n    $fields: UpdateChargeInput\n  ) {\n    mergeCharges(\n      baseChargeID: $baseChargeID\n      chargeIdsToMerge: $chargeIdsToMerge\n      fields: $fields\n    ) {\n      __typename\n      ... on MergeChargeSuccessfulResult {\n        charge {\n          id\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": MergeChargesDocument,
  "\n  mutation PreviewDocument($input: DocumentIssueInput!) {\n    previewDocument(input: $input)\n  }\n": PreviewDocumentDocument,
  "\n  query ProviderCredentials {\n    providerCredentials {\n      id\n      provider\n      configuredAt\n    }\n  }\n": ProviderCredentialsDocument,
  "\n  mutation RegenerateLedger($chargeId: UUID!) {\n    regenerateLedgerRecords(chargeId: $chargeId) {\n      __typename\n      ... on Ledger {\n        records {\n          id\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": RegenerateLedgerDocument,
  "\n  query RelevantDepositsForCharge($chargeId: UUID!) {\n    relevantDepositsForCharge(chargeId: $chargeId) {\n      id\n      deposits {\n        id\n        name\n        currency\n        isOpen\n      }\n      error\n    }\n  }\n": RelevantDepositsForChargeDocument,
  "\n  mutation RemoveBusinessUser($userId: ID!) {\n    removeBusinessUser(userId: $userId)\n  }\n": RemoveBusinessUserDocument,
  "\n  mutation RevokeApiKey($id: ID!) {\n    revokeApiKey(id: $id)\n  }\n": RevokeApiKeyDocument,
  "\n  mutation RevokeInvitation($id: ID!) {\n    revokeInvitation(id: $id)\n  }\n": RevokeInvitationDocument,
  "\n  mutation SetAnnualAuditStepStatus($input: SetAnnualAuditStepStatusInput!) {\n    setAnnualAuditStepStatus(input: $input) {\n      id\n      ownerId\n      year\n      stepId\n      status\n      notes\n      evidence\n      updatedAt\n      completedAt\n    }\n  }\n": SetAnnualAuditStepStatusDocument,
  "\n  mutation SetAnnualAuditStep03Status($input: SetAnnualAuditStep03StatusInput!) {\n    setAnnualAuditStep03Status(input: $input) {\n      id\n      ownerId\n      year\n      stepId\n      status\n      notes\n      updatedAt\n      completedAt\n    }\n  }\n": SetAnnualAuditStep03StatusDocument,
  "\n  mutation SetAnnualAuditStep09Status($input: SetAnnualAuditStep09StatusInput!) {\n    setAnnualAuditStep09Status(input: $input) {\n      id\n      ownerId\n      year\n      stepId\n      status\n      notes\n      evidence\n      updatedAt\n      completedAt\n    }\n  }\n": SetAnnualAuditStep09StatusDocument,
  "\n  mutation SetDeelCredentials($apiToken: String!) {\n    setDeelCredentials(apiToken: $apiToken) {\n      ... on ProviderCredentialResult {\n        id\n        provider\n        configuredAt\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": SetDeelCredentialsDocument,
  "\n  mutation SetGreenInvoiceCredentials($id: String!, $secret: String!) {\n    setGreenInvoiceCredentials(id: $id, secret: $secret) {\n      ... on ProviderCredentialResult {\n        id\n        provider\n        configuredAt\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": SetGreenInvoiceCredentialsDocument,
  "\n  mutation SyncGreenInvoiceDocuments($ownerId: UUID!) {\n    syncGreenInvoiceDocuments(ownerId: $ownerId) {\n      id\n      ...NewFetchedDocumentFields\n    }\n  }\n": SyncGreenInvoiceDocumentsDocument,
  "\n  mutation UnlockDynamicReportTemplate($name: String!) {\n    unlockDynamicReportTemplate(name: $name) {\n      id\n      name\n      isLocked\n      updated\n    }\n  }\n": UnlockDynamicReportTemplateDocument,
  "\n  mutation UpdateAdminBusiness($adminBusinessId: UUID!, $fields: UpdateAdminBusinessInput!) {\n    updateAdminBusiness(businessId: $adminBusinessId, fields: $fields) {\n      id\n    }\n  }\n": UpdateAdminBusinessDocument,
  "\n  mutation UpdateBusinessTripAccommodationsExpense(\n    $fields: UpdateBusinessTripAccommodationsExpenseInput!\n  ) {\n    updateBusinessTripAccommodationsExpense(fields: $fields)\n  }\n": UpdateBusinessTripAccommodationsExpenseDocument,
  "\n  mutation UpdateBusinessTripAccountantApproval(\n    $businessTripId: UUID!\n    $status: AccountantStatus!\n  ) {\n    updateBusinessTripAccountantApproval(businessTripId: $businessTripId, approvalStatus: $status)\n  }\n": UpdateBusinessTripAccountantApprovalDocument,
  "\n  mutation UpdateBusinessTripAttendee($fields: BusinessTripAttendeeUpdateInput!) {\n    updateBusinessTripAttendee(fields: $fields)\n  }\n": UpdateBusinessTripAttendeeDocument,
  "\n  mutation UpdateBusinessTripCarRentalExpense($fields: UpdateBusinessTripCarRentalExpenseInput!) {\n    updateBusinessTripCarRentalExpense(fields: $fields)\n  }\n": UpdateBusinessTripCarRentalExpenseDocument,
  "\n  mutation UpdateBusinessTripFlightsExpense($fields: UpdateBusinessTripFlightsExpenseInput!) {\n    updateBusinessTripFlightsExpense(fields: $fields)\n  }\n": UpdateBusinessTripFlightsExpenseDocument,
  "\n  mutation UpdateBusinessTripOtherExpense($fields: UpdateBusinessTripOtherExpenseInput!) {\n    updateBusinessTripOtherExpense(fields: $fields)\n  }\n": UpdateBusinessTripOtherExpenseDocument,
  "\n  mutation UpdateBusinessTripTravelAndSubsistenceExpense(\n    $fields: UpdateBusinessTripTravelAndSubsistenceExpenseInput!\n  ) {\n    updateBusinessTripTravelAndSubsistenceExpense(fields: $fields)\n  }\n": UpdateBusinessTripTravelAndSubsistenceExpenseDocument,
  "\n  mutation UpdateBusiness($businessId: UUID!, $ownerId: UUID!, $fields: UpdateBusinessInput!) {\n    updateBusiness(businessId: $businessId, ownerId: $ownerId, fields: $fields) {\n      __typename\n      ... on LtdFinancialEntity {\n        id\n        name\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateBusinessDocument,
  "\n  mutation UpdateChargeAccountantApproval($chargeId: UUID!, $status: AccountantStatus!) {\n    updateChargeAccountantApproval(chargeId: $chargeId, approvalStatus: $status)\n  }\n": UpdateChargeAccountantApprovalDocument,
  "\n  mutation UpdateCharge($chargeId: UUID!, $fields: UpdateChargeInput!) {\n    updateCharge(chargeId: $chargeId, fields: $fields) {\n      __typename\n      ... on UpdateChargeSuccessfulResult {\n        charge {\n          id\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateChargeDocument,
  "\n  mutation UpdateClient($businessId: UUID!, $fields: ClientUpdateInput!) {\n    updateClient(businessId: $businessId, fields: $fields) {\n      __typename\n      ... on Client {\n        id\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateClientDocument,
  "\n  mutation UpdateContract($contractId: UUID!, $input: UpdateContractInput!) {\n    updateContract(contractId: $contractId, input: $input) {\n      id\n    }\n  }\n": UpdateContractDocument,
  "\n  mutation UpdateDeposit(\n    $id: UUID!\n    $name: String\n    $openDate: TimelessDate\n    $closeDate: TimelessDate\n  ) {\n    updateDeposit(id: $id, name: $name, openDate: $openDate, closeDate: $closeDate) {\n      id\n      name\n      openDate\n      closeDate\n      isOpen\n    }\n  }\n": UpdateDepositDocument,
  "\n  mutation UpdateDepreciationRecord($fields: UpdateDepreciationRecordInput!) {\n    updateDepreciationRecord(input: $fields) {\n      __typename\n      ... on CommonError {\n        message\n      }\n      ... on DepreciationRecord {\n        id\n      }\n    }\n  }\n": UpdateDepreciationRecordDocument,
  "\n  mutation UpdateDocument($documentId: UUID!, $fields: UpdateDocumentFieldsInput!) {\n    updateDocument(documentId: $documentId, fields: $fields) {\n      __typename\n      ... on CommonError {\n        message\n      }\n      ... on UpdateDocumentSuccessfulResult {\n        document {\n          id\n        }\n      }\n    }\n  }\n": UpdateDocumentDocument,
  "\n  mutation UpdateDynamicReportTemplateName($name: String!, $newName: String!) {\n    updateDynamicReportTemplateName(name: $name, newName: $newName) {\n      id\n      name\n    }\n  }\n": UpdateDynamicReportTemplateNameDocument,
  "\n  mutation UpdateDynamicReportTemplate($name: String!, $template: String!) {\n    updateDynamicReportTemplate(name: $name, template: $template) {\n      id\n      name\n    }\n  }\n": UpdateDynamicReportTemplateDocument,
  "\n  mutation UpdateFinancialAccount(\n    $financialAccountId: UUID!\n    $fields: UpdateFinancialAccountInput!\n  ) {\n    updateFinancialAccount(id: $financialAccountId, fields: $fields) {\n      id\n    }\n  }\n": UpdateFinancialAccountDocument,
  "\n  mutation UpdateMiscExpense($id: UUID!, $fields: UpdateMiscExpenseInput!) {\n    updateMiscExpense(id: $id, fields: $fields) {\n      id\n    }\n  }\n": UpdateMiscExpenseDocument,
  "\n  mutation UpdateOrInsertSalaryRecords($salaryRecords: [SalaryRecordInput!]!) {\n    insertOrUpdateSalaryRecords(salaryRecords: $salaryRecords) {\n      __typename\n      ... on InsertSalaryRecordsSuccessfulResult {\n        salaryRecords {\n          month\n          employee {\n            id\n          }\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateOrInsertSalaryRecordsDocument,
  "\n  mutation UpdateSalaryRecord($salaryRecord: SalaryRecordEditInput!) {\n    updateSalaryRecord(salaryRecord: $salaryRecord) {\n      __typename\n      ... on UpdateSalaryRecordSuccessfulResult {\n        salaryRecord {\n          month\n          employee {\n            id\n          }\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateSalaryRecordDocument,
  "\n  mutation UpdateSortCode($key: Int!, $fields: UpdateSortCodeFieldsInput!) {\n    updateSortCode(key: $key, fields: $fields)\n  }\n": UpdateSortCodeDocument,
  "\n  mutation UpdateTag($tagId: UUID!, $fields: UpdateTagFieldsInput!) {\n    updateTag(id: $tagId, fields: $fields)\n  }\n": UpdateTagDocument,
  "\n  mutation UpdateTaxCategory($taxCategoryId: UUID!, $fields: UpdateTaxCategoryInput!) {\n    updateTaxCategory(taxCategoryId: $taxCategoryId, fields: $fields) {\n      __typename\n      ... on TaxCategory {\n        id\n        name\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateTaxCategoryDocument,
  "\n  mutation UpdateTransaction($transactionId: UUID!, $fields: UpdateTransactionInput!) {\n    updateTransaction(transactionId: $transactionId, fields: $fields) {\n      __typename\n      ... on Transaction {\n        id\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateTransactionDocument,
  "\n  mutation UpdateTransactions($transactionIds: [UUID!]!, $fields: UpdateTransactionInput!) {\n    updateTransactions(transactionIds: $transactionIds, fields: $fields) {\n      __typename\n      ... on UpdatedTransactionsSuccessfulResult {\n        transactions {\n          ... on Transaction {\n            id\n          }\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UpdateTransactionsDocument,
  "\n  mutation UploadDocument($file: FileScalar!, $chargeId: UUID) {\n    uploadDocument(file: $file, chargeId: $chargeId) {\n      __typename\n      ... on UploadDocumentSuccessfulResult {\n        document {\n          id\n          charge {\n            id\n          }\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": UploadDocumentDocument,
  "\n  mutation UploadDocumentsFromGoogleDrive(\n    $sharedFolderUrl: String!\n    $chargeId: UUID\n    $isSensitive: Boolean\n  ) {\n    batchUploadDocumentsFromGoogleDrive(\n      sharedFolderUrl: $sharedFolderUrl\n      chargeId: $chargeId\n      isSensitive: $isSensitive\n    ) {\n      ... on CommonError {\n        message\n      }\n      ... on UploadDocumentSuccessfulResult {\n        document {\n          id\n          ...NewFetchedDocumentFields\n        }\n      }\n    }\n  }\n": UploadDocumentsFromGoogleDriveDocument,
  "\n  mutation UploadMultipleDocuments(\n    $documents: [FileScalar!]!\n    $chargeId: UUID\n    $isSensitive: Boolean\n  ) {\n    batchUploadDocuments(documents: $documents, chargeId: $chargeId, isSensitive: $isSensitive) {\n      ... on CommonError {\n        message\n      }\n      ... on UploadDocumentSuccessfulResult {\n        document {\n          id\n          ...NewFetchedDocumentFields\n        }\n      }\n    }\n  }\n": UploadMultipleDocumentsDocument,
  "\n  mutation UploadPayrollFile($file: FileScalar!, $chargeId: UUID!) {\n    insertSalaryRecordsFromFile(file: $file, chargeId: $chargeId)\n  }\n": UploadPayrollFileDocument,
  "\n  query UserContext {\n    userContext {\n      memberships {\n        businessId\n        role\n        businessName\n      }\n      activeReadScope\n      defaultLocalCurrency\n      defaultCryptoConversionFiatCurrency\n      ledgerLock\n      financialAccountsBusinessesIds\n      locality\n    }\n  }\n": UserContextDocument,
  "\n  mutation RequestIngestControl($input: IngestControlInput!) {\n    requestIngestControl(input: $input) {\n      __typename\n      ... on IngestControlDecision {\n        id\n        tenantId\n        decisionId\n        auditId\n        grant {\n          id\n          jti\n          tenantId\n          action\n          expiresAt\n        }\n        businessEmailConfig {\n          businessId\n          internalEmailLinks\n          emailBody\n          attachments\n        }\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": RequestIngestControlDocument,
  "\n  mutation IngestEmail($input: IngestEmailInput!) {\n    ingestEmail(input: $input) {\n      __typename\n      ... on IngestEmailSuccess {\n        outcome\n        ingestId\n        existingIngestId\n        auditId\n        reasonCode\n      }\n      ... on CommonError {\n        message\n      }\n    }\n  }\n": IngestEmailDocument,
  "\n  query BusinessEmailConfig($email: String!) {\n    businessEmailConfig(email: $email) {\n      businessId\n      internalEmailLinks\n      emailBody\n      attachments\n    }\n  }\n": BusinessEmailConfigDocument,
  "\n  mutation InsertEmailDocuments(\n    $documents: [FileScalar!]!\n    $userDescription: String!\n    $messageId: String\n    $businessId: UUID\n  ) {\n    insertEmailDocuments(\n      documents: $documents\n      userDescription: $userDescription\n      messageId: $messageId\n      businessId: $businessId\n    )\n  }\n": InsertEmailDocumentsDocument,
  "\n  mutation UploadPoalimIlsTransactions($transactions: [PoalimIlsTransactionInput!]!) {\n    uploadPoalimIlsTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadPoalimIlsTransactionsDocument,
  "\n  mutation UploadPoalimForeignTransactions($transactions: [PoalimForeignTransactionInput!]!) {\n    uploadPoalimForeignTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadPoalimForeignTransactionsDocument,
  "\n  mutation UploadPoalimSwiftTransactions($swifts: [PoalimSwiftTransactionInput!]!) {\n    uploadPoalimSwiftTransactions(swifts: $swifts) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadPoalimSwiftTransactionsDocument,
  "\n  mutation UploadIsracardTransactions($transactions: [IsracardTransactionInput!]!) {\n    uploadIsracardTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadIsracardTransactionsDocument,
  "\n  mutation UploadAmexTransactions($transactions: [AmexTransactionInput!]!) {\n    uploadAmexTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadAmexTransactionsDocument,
  "\n  mutation UploadCalTransactions($transactions: [CalTransactionInput!]!) {\n    uploadCalTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadCalTransactionsDocument,
  "\n  mutation UploadDiscountTransactions($transactions: [DiscountTransactionInput!]!) {\n    uploadDiscountTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadDiscountTransactionsDocument,
  "\n  mutation UploadMaxTransactions($transactions: [MaxTransactionInput!]!) {\n    uploadMaxTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadMaxTransactionsDocument,
  "\n  mutation UploadCurrencyRates($rates: [CurrencyRateInput!]!) {\n    uploadCurrencyRates(rates: $rates) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadCurrencyRatesDocument,
  "\n  mutation UploadOtsarHahayalIlsTransactions($transactions: [OtsarHahayalIlsTransactionInput!]!) {\n    uploadOtsarHahayalIlsTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadOtsarHahayalIlsTransactionsDocument,
  "\n  mutation UploadOtsarHahayalForeignTransactions(\n    $transactions: [OtsarHahayalForeignTransactionInput!]!\n  ) {\n    uploadOtsarHahayalForeignTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadOtsarHahayalForeignTransactionsDocument,
  "\n  mutation UploadOtsarHahayalCreditCardTransactions(\n    $transactions: [OtsarHahayalCreditCardTransactionInput!]!\n  ) {\n    uploadOtsarHahayalCreditCardTransactions(transactions: $transactions) {\n      inserted\n      skipped\n      insertedIds\n      insertedTransactions {\n        id\n        date\n        description\n        amount\n        account\n      }\n      changedTransactions {\n        id\n        changedFields {\n          field\n          oldValue\n          newValue\n        }\n      }\n    }\n  }\n": UploadOtsarHahayalCreditCardTransactionsDocument
};
function graphql(source) {
  return documents[source] ?? {};
}

// src/server-requests.ts
var BusinessEmailConfig = graphql(`
  query BusinessEmailConfig($email: String!) {
    businessEmailConfig(email: $email) {
      businessId
      internalEmailLinks
      emailBody
      attachments
    }
  }
`);
var InsertEmailDocuments = graphql(`
  mutation InsertEmailDocuments(
    $documents: [FileScalar!]!
    $userDescription: String!
    $messageId: String
    $businessId: UUID
  ) {
    insertEmailDocuments(
      documents: $documents
      userDescription: $userDescription
      messageId: $messageId
      businessId: $businessId
    )
  }
`);
async function insertEmailDocuments(variables) {
  try {
    const formData = new FormData();
    const operations = {
      query: InsertEmailDocuments.toString(),
      variables: {
        ...variables,
        documents: variables.documents.map(() => null)
      }
    };
    const map = Object.fromEntries(
      variables.documents.map((_, i) => [String(i), [`variables.documents.${i}`]])
    );
    formData.set("operations", JSON.stringify(operations));
    formData.set("map", JSON.stringify(map));
    for (let i = 0; i < variables.documents.length; i += 1) {
      const file = variables.documents[i];
      const fileBlob = new Blob([await file.arrayBuffer()], { type: file.type });
      formData.append(String(i), fileBlob, file.name);
    }
    const response = await fetch2(env.general.serverUrl, {
      method: "POST",
      headers: {
        "X-API-Key": env.authorization.apiKey,
        Accept: "application/graphql-response+json"
      },
      body: formData
    });
    if (!response.ok) {
      throw new Error("Network response was not ok");
    }
    const result = await response.json();
    if (result.errors) {
      console.error("GraphQL errors:", result.errors);
      throw new Error("Error inserting email documents");
    }
    if (!result.data) {
      throw new Error("No data returned from server");
    }
    return result.data;
  } catch (error) {
    console.error("Error executing GraphQL request with files:", error);
    throw error;
  }
}
var businessEmailConfig = async (variables) => {
  try {
    const response = await fetch2(env.general.serverUrl, {
      method: "POST",
      headers: {
        "X-API-Key": env.authorization.apiKey,
        "Content-Type": "application/json",
        Accept: "application/graphql-response+json"
      },
      body: JSON.stringify({
        query: BusinessEmailConfig.toString(),
        variables
      })
    });
    if (!response.ok) {
      throw new Error("Network response was not ok");
    }
    const result = await response.json();
    if (result.errors) {
      console.error("GraphQL errors:", result.errors);
      throw new Error("Error fetching business email config");
    }
    if (!result.data) {
      throw new Error("No data returned from server");
    }
    return result.data;
  } catch (error) {
    console.error("Error executing GraphQL request:", error);
    throw error;
  }
};
var getServer = () => {
  return {
    businessEmailConfig,
    insertEmailDocuments
  };
};

// src/troubleshoot-auth.ts
import { google } from "googleapis";
async function troubleshootOAuth(gmailEnv) {
  console.log("\u{1F50D} OAuth2 Configuration Troubleshooter\n");
  const requiredVars = ["clientId", "clientSecret", "refreshToken"];
  console.log("1. Checking environment variables:");
  let missingVars = !gmailEnv;
  requiredVars.map((varName) => {
    const value = gmailEnv?.[varName];
    if (value) {
      const display = varName.includes("SECRET") || varName.includes("TOKEN") ? `${value.substring(0, 10)}...` : value;
      console.log(`   \u2705 ${varName}: ${display}`);
    } else {
      console.log(`   \u274C ${varName}: Missing`);
      missingVars = true;
    }
  });
  if (missingVars) {
    console.log("\n\u274C Missing required environment variables. Please check your .env file.");
    return;
  }
  console.log("\n2. Testing OAuth2 client setup:");
  const oauth2Client = new google.auth.OAuth2(gmailEnv.clientId, gmailEnv.clientSecret);
  console.log("\n3. Testing refresh token:");
  try {
    oauth2Client.setCredentials({
      refresh_token: gmailEnv.refreshToken
    });
    const { credentials } = await oauth2Client.refreshAccessToken();
    console.log("   \u2705 Refresh token is valid");
    console.log(`   \u{1F4DD} New access token: ${credentials.access_token?.substring(0, 20)}...`);
    console.log("\n4. Testing Gmail API access:");
    const gmail2 = google.gmail({ version: "v1", auth: oauth2Client });
    const profile = await gmail2.users.getProfile({ userId: "me" });
    console.log(`   \u2705 Gmail API access successful`);
    console.log(`   \u{1F4E7} Email: ${profile.data.emailAddress}`);
    console.log(`   \u{1F4AC} Total messages: ${profile.data.messagesTotal}`);
    console.log("\n5. Testing watch permissions:");
    try {
      try {
        await gmail2.users.stop({ userId: "me" });
        console.log("   \u{1F4F4} Stopped existing watch");
      } catch (e) {
        const errorMessage = e?.message;
        console.log(`   \u2139\uFE0F  No existing watch to stop: ${errorMessage}`);
      }
      const projectId = gmailEnv?.cloudProjectId || "your-project-id";
      const topicName = gmailEnv?.topicName || "gmail-notifications";
      const fullTopicName = `projects/${projectId}/topics/${topicName}`;
      console.log(`   \u{1F4E1} Testing watch with topic: ${fullTopicName}`);
      const watchResponse = await gmail2.users.watch({
        userId: "me",
        requestBody: {
          topicName: fullTopicName,
          labelIds: ["INBOX"]
        }
      });
      console.log("   \u2705 Watch setup successful!");
      console.log(
        `   \u{1F550} Expiration: ${new Date(parseInt(watchResponse.data.expiration)).toLocaleString()}`
      );
    } catch (watchError) {
      console.log("   \u274C Watch setup failed:");
      const errorMessage = watchError?.message;
      console.log(`      Error: ${errorMessage}`);
      if (errorMessage?.includes("topicName")) {
        console.log("\n\u{1F4A1} Troubleshooting tips for watch errors:");
        console.log("   \u2022 Verify Pub/Sub topic exists and is properly formatted");
        console.log("   \u2022 Check IAM permissions for the topic");
        console.log("   \u2022 Ensure domain verification is complete");
        console.log("   \u2022 Try using a simpler polling approach instead");
      }
    }
  } catch (error) {
    console.log("   \u274C Refresh token test failed:");
    const errorMessage = error?.message;
    console.log(`      Error: ${errorMessage}`);
    if (errorMessage?.includes("invalid_grant")) {
      console.log("\n\u{1F4A1} invalid_grant error solutions:");
      console.log("   1. Generate a new refresh token (token may have expired)");
      console.log("   2. Ensure OAuth consent screen is published (not in testing)");
      console.log("   3. Check that the user email is added to test users (if in testing)");
      console.log("   4. Verify redirect URI matches exactly in Google Console");
      console.log('   5. Make sure to include "prompt: consent" when generating tokens');
      console.log("\n   Run: npm run generate-token");
    }
    const scopes = [
      "https://www.googleapis.com/auth/gmail.readonly",
      "https://www.googleapis.com/auth/gmail.modify",
      "https://www.googleapis.com/auth/gmail.settings.basic"
    ];
    const authUrl = oauth2Client.generateAuthUrl({
      access_type: "offline",
      scope: scopes,
      prompt: "consent"
      // Forces consent screen to get refresh token
    });
    console.log("\n\u{1F4A1} To manually generate a new refresh token:");
    console.log(`   \u{1F4E5} Visit this URL: ${authUrl}`);
  }
  console.log("\n\u{1F527} Configuration check complete!");
}

// src/gmail-service.ts
var GmailService = class {
  constructor(env2) {
    this.env = env2;
    this.gmailEnv = this.env.gmail;
    this.targetLabel = this.gmailEnv.labelPath;
    const oauth2Client = new google2.auth.OAuth2(this.gmailEnv.clientId, this.gmailEnv.clientSecret);
    oauth2Client.setCredentials({
      refresh_token: this.gmailEnv.refreshToken
    });
    oauth2Client.getAccessToken();
    this.gmail = google2.gmail({ version: "v1", auth: oauth2Client });
    this.server = getServer();
  }
  env;
  gmailEnv;
  targetLabel;
  labelsDict = {
    main: void 0,
    processed: void 0,
    errors: void 0,
    debug: void 0
  };
  gmail;
  server;
  /* labels */
  async getLabelId(labelName) {
    try {
      const response = await this.gmail.users.labels.list({ userId: "me" });
      const label = response.data.labels?.find((l) => l.name === labelName);
      return label?.id || null;
    } catch (error) {
      console.error("Error fetching labels:", error);
      return null;
    }
  }
  async createLabel(name) {
    const newLabel = await this.gmail.users.labels.create({
      userId: "me",
      requestBody: {
        name
      }
    });
    if (!newLabel.data.id) {
      throw new Error("Failed to create label");
    }
    return newLabel.data.id;
  }
  async setupLabels() {
    const response = await this.gmail.users.labels.list({ userId: "me" }).catch((err) => {
      throw `Error fetching inbox labels: ${err}`;
    });
    const labels = response.data.labels ?? [];
    await Promise.all(
      Object.keys(this.labelsDict).map(async (key) => {
        try {
          const path = key === "main" ? this.targetLabel : `${this.targetLabel}/${key}`;
          const existingLabel = labels.find((label) => label.name === path);
          this.labelsDict[key] = existingLabel?.id ?? await this.createLabel(path);
        } catch (e) {
          throw new Error(`Error creating new label [${key}]: ${e}`, { cause: e });
        }
      })
    );
  }
  async isMessageLabeledToProcess(messageId) {
    try {
      const labelId = await this.getLabelId(this.targetLabel);
      if (!labelId) return false;
      const message = await this.gmail.users.messages.get({
        userId: "me",
        id: messageId,
        format: "minimal"
      });
      return message.data.labelIds?.includes(labelId) || false;
    } catch (error) {
      console.error("Error checking labels:", error);
      throw new Error("Error checking message labels", { cause: error });
    }
  }
  async labelMessageAsError(messageId) {
    await this.gmail.users.messages.modify({
      id: messageId,
      userId: "me",
      requestBody: {
        addLabelIds: [this.labelsDict.errors],
        removeLabelIds: [this.labelsDict.main, this.labelsDict.processed, this.labelsDict.debug]
      }
    }).catch((e) => {
      console.error(`Error labeling email id=${messageId} as error: ${e}`);
    });
  }
  async labelMessageAsProcessed(messageId) {
    await this.gmail.users.messages.modify({
      id: messageId,
      userId: "me",
      requestBody: {
        addLabelIds: [this.labelsDict.processed],
        removeLabelIds: [this.labelsDict.main, this.labelsDict.errors, this.labelsDict.debug]
      }
    }).catch((e) => {
      console.error(`Error labeling email id=${messageId} as processed: ${e}`);
    });
  }
  async labelMessageAsDebug(messageId) {
    await this.gmail.users.messages.modify({
      id: messageId,
      userId: "me",
      requestBody: {
        addLabelIds: [this.labelsDict.debug],
        removeLabelIds: [this.labelsDict.main, this.labelsDict.errors, this.labelsDict.processed]
      }
    }).catch((e) => {
      console.error(`Error labeling email id=${messageId} as debug: ${e}`);
    });
  }
  /* documents handling */
  async convertHtmlToPdf(rawHtml) {
    let browser = null;
    try {
      browser = await chromium.launch({
        args: ["--no-sandbox", "--disable-setuid-sandbox"]
      }).catch((e) => {
        throw new Error(`Error launching browser: ${e.message}`);
      });
      const page = await browser.newPage().catch((e) => {
        throw new Error(`Error creating new page: ${e.message}`);
      });
      const html = await inlineCss(rawHtml, { url: "/" }).catch((e) => {
        throw new Error(`Error inlining CSS: ${e.message}`);
      });
      await page.setContent(html, {
        waitUntil: "networkidle"
        // Wait until all network requests are done
      }).catch((e) => {
        throw new Error(`Error setting page content: ${e.message}`);
      });
      const rawPdf = await page.pdf().catch((e) => {
        throw new Error(`Error generating PDF: ${e.message}`);
      });
      await browser.close();
      const content = Buffer.from(rawPdf).toString("base64url");
      return {
        filename: "body.pdf",
        content,
        mimeType: "application/pdf"
      };
    } catch (error) {
      const message = `Error converting HTML to PDF`;
      console.error(`${message}: ${error}`);
      throw new Error(message, { cause: error });
    } finally {
      await browser?.close();
    }
  }
  getLinkFromBody(body, partialUrl) {
    const regex = /<a\s+(?:[^>]*?\s+)?href="([^"]*)"/gi;
    let match;
    try {
      const partial = new URL(partialUrl);
      while ((match = regex.exec(body)) !== null) {
        const urlString = match[1];
        try {
          const fullUrl = new URL(urlString);
          if (fullUrl.hostname === partial.hostname && (fullUrl.pathname === partial.pathname || fullUrl.pathname.startsWith(
            partial.pathname.endsWith("/") ? partial.pathname : partial.pathname + "/"
          ))) {
            return urlString;
          }
        } catch {
        }
      }
    } catch {
    }
    return null;
  }
  async innerLinkDocumentFetcher(body, internalLink) {
    try {
      const link = this.getLinkFromBody(body, internalLink);
      if (!link) {
        return null;
      }
      const response = await fetch(link);
      const contentType = response.headers.get("content-type");
      if (contentType?.includes("text/html")) {
        const html = await response.text();
        const doc = await this.convertHtmlToPdf(html);
        return doc;
      }
      if (contentType?.includes("application/pdf")) {
        const data = await response.arrayBuffer().then((buffer) => Buffer.from(buffer).toString("base64url"));
        if (!data) {
          return null;
        }
        return {
          filename: "external.pdf",
          content: data,
          mimeType: "application/pdf"
        };
      }
      console.error(`Unsupported content type from link ${link}: ${contentType}`);
      return null;
    } catch (e) {
      console.error(`Error fetching document from internal link ${internalLink}: ${e}`);
      return null;
    }
  }
  /* email parsing */
  getBodyWithRecursion(payload, mimeType) {
    let body = "";
    if (payload.parts) {
      for (const part of payload.parts) {
        body = this.getBodyWithRecursion(part, mimeType) || body;
      }
    } else if (payload.body?.data != null && payload.body.attachmentId == null && payload.mimeType === mimeType) {
      body = Buffer.from(payload.body.data, "base64").toString("utf8");
    }
    return body;
  }
  getEmailBody(payload) {
    if (!payload) return "";
    const htmlBody = this.getBodyWithRecursion(payload, "text/html");
    if (htmlBody) {
      return htmlBody;
    }
    return this.getBodyWithRecursion(payload, "text/plain");
  }
  async getEmailAttachments(messageId, payload) {
    if (!payload?.parts) return [];
    const attachments = [];
    const attachmentParts = payload.parts.filter(
      (part) => part.mimeType === "application/pdf" || part.mimeType === "application/octet-stream" && part.filename?.includes(".pdf") || part.mimeType?.split("/")[0] === "image"
    );
    if (attachmentParts.length) {
      for (const attachmentPart of attachmentParts) {
        const attachment = await this.gmail.users.messages.attachments.get({
          userId: "me",
          messageId,
          id: attachmentPart.body?.attachmentId ?? void 0
        }).catch((e) => {
          throw `Error on fetching attachment: ${e.message}`;
        });
        attachments.push({
          filename: attachmentPart.filename ?? void 0,
          content: attachment.data.data ?? void 0,
          mimeType: attachmentPart.mimeType ?? void 0
        });
      }
    }
    return attachments;
  }
  extractEmailAddress(original) {
    const match = original.match(/<(.+)>/);
    if (match?.[1]) {
      return match[1];
    }
    return original;
  }
  async getEmailData(messageId) {
    try {
      const response = await this.gmail.users.messages.get({
        userId: "me",
        id: messageId,
        format: "full"
      });
      const message = response.data;
      if (!message) {
        await this.labelMessageAsDebug(messageId);
        return null;
      }
      const headers = message.payload?.headers || [];
      let from = headers.find((h) => h.name === "From")?.value || "";
      if (from.includes("'SOFTWARE PRODUCTS GUILDA  LTD'")) {
        await this.labelMessageAsProcessed(messageId);
        return null;
      }
      if (from.includes("<")) {
        from = this.extractEmailAddress(from);
      }
      const replyTo = headers.find((h) => h.name === "Reply-To")?.value || void 0;
      const originalFrom = headers.find((h) => h.name === "X-Original-Sender")?.value || this.extractEmailAddress(
        headers.find((h) => h.name === "X-Original-From")?.value || replyTo || ""
      );
      const to = this.extractEmailAddress(headers.find((h) => h.name === "To")?.value || "");
      const subject = headers.find((h) => h.name === "Subject")?.value || "";
      const date = headers.find((h) => h.name === "Date")?.value || "";
      const body = this.getEmailBody(message.payload);
      const emailData = {
        id: message.id,
        threadId: message.threadId,
        subject,
        from,
        originalFrom,
        replyTo,
        to,
        body,
        labels: message.labelIds || [],
        receivedAt: new Date(date)
      };
      const documents2 = await this.getEmailAttachments(messageId, message.payload);
      return { ...emailData, documents: documents2 };
    } catch (error) {
      console.error("Error fetching email:", error);
      throw new Error("Error fetching email data", { cause: error });
    }
  }
  getIssuerEmail(emailData) {
    const regex = /From:.*?<a href="mailto:([^"]+)">/i;
    const invoiceIssuingProvidersEmail = ["notify@morning.co", "c@sumit.co.il", "ap@the-guild.dev"];
    const body = emailData.body;
    const bodyRows = body.split("\n").map((row) => row.trim());
    for (const row of bodyRows) {
      const match = row.match(regex);
      if (match?.[1]) {
        const email = decodeURIComponent(match[1]);
        if (!invoiceIssuingProvidersEmail.includes(email.toLowerCase()) || !emailData.replyTo) {
          return email;
        }
      }
    }
    const senderEmail = [emailData.originalFrom, emailData.from].find(
      (email) => !!email && !invoiceIssuingProvidersEmail.includes(email.toLowerCase())
    );
    if (senderEmail) {
      return senderEmail;
    }
    if (emailData.replyTo) {
      return emailData.replyTo;
    }
    return emailData.from;
  }
  async handleMessage(message) {
    if (!message?.id) return;
    try {
      if (await this.isMessageLabeledToProcess(message.id)) {
        const emailData = await this.getEmailData(message.id);
        if (!emailData) {
          return;
        }
        console.log("Processing email:", {
          subject: emailData.subject,
          from: emailData.from,
          id: emailData.id
        });
        const issuerEmail = this.getIssuerEmail(emailData);
        const { businessEmailConfig: businessEmailConfig2 } = await this.server.businessEmailConfig({
          email: issuerEmail
        }).catch((e) => {
          console.error(`Error fetching business email config for email ${issuerEmail}:`, e);
          throw new Error("Error fetching business email config");
        });
        const extractedDocuments = [];
        const relevantDocuments = (emailData.documents ?? []).filter(
          (doc) => {
            if (!doc.content || !doc.mimeType) return false;
            if (businessEmailConfig2?.attachments) {
              let docType = doc.mimeType.split("/")[1].toLocaleUpperCase();
              if (docType === "OCTET-STREAM" && doc.filename?.includes(".pdf")) {
                doc.mimeType = "application/pdf";
                docType = "PDF";
              }
              if (!businessEmailConfig2.attachments.includes(docType)) {
                return false;
              }
            }
            return true;
          }
        );
        for (const doc of relevantDocuments) {
          extractedDocuments.push(doc);
        }
        if (!businessEmailConfig2?.businessId || businessEmailConfig2?.emailBody === true) {
          const doc = await this.convertHtmlToPdf(emailData.body);
          extractedDocuments.push(doc);
        }
        if (businessEmailConfig2?.internalEmailLinks?.length) {
          for (const link of businessEmailConfig2.internalEmailLinks) {
            const doc = await this.innerLinkDocumentFetcher(emailData.body, link);
            if (doc) {
              extractedDocuments.push(doc);
            }
          }
        }
        if (extractedDocuments.length === 0) {
          console.log(`No relevant documents found in email id=${message.id}, skipping.`);
          await this.labelMessageAsDebug(message.id);
          return;
        }
        const userDescription = `Email documents: ${emailData.subject} (from: ${emailData.from}, ${emailData.receivedAt.toDateString()})`;
        const documents2 = extractedDocuments.map(
          (doc) => new File([Buffer.from(doc.content, "base64")], doc.filename, {
            type: doc.mimeType
          })
        );
        const { insertEmailDocuments: insertEmailDocuments2 } = await this.server.insertEmailDocuments({
          documents: documents2,
          userDescription,
          messageId: message.id ?? void 0,
          businessId: businessEmailConfig2?.businessId
        }).catch((e) => {
          console.error(`Error sending documents to server for email id=${message.id}:`, e);
          throw new Error("Error sending documents to server");
        });
        if (!insertEmailDocuments2) {
          throw new Error(`Server processing failed for email id=${message.id}`);
        }
        await this.labelMessageAsProcessed(message.id);
      }
    } catch (error) {
      console.error(`Error handling message id=${message.id}:`, error);
      await this.labelMessageAsError(message.id);
    }
  }
  async handlePendingMessages() {
    try {
      const response = await this.gmail.users.messages.list({
        userId: "me",
        maxResults: 1e3,
        q: `in:${this.gmailEnv.labelPath}`
      });
      const messages = response.data.messages || [];
      for (const message of messages) {
        await this.handleMessage(message);
      }
      return true;
    } catch (error) {
      console.error("Error fetching messages:", error);
      return false;
    }
  }
  async init() {
    await troubleshootOAuth(this.gmailEnv);
    await this.setupLabels();
  }
};

// src/pubsub-service.ts
import { PubSub } from "@google-cloud/pubsub";
var PubsubService = class _PubsubService {
  constructor(env2, gmailService2) {
    this.env = env2;
    this.gmailService = gmailService2;
    if (!this.env.gmail) {
      throw new Error("Gmail environment configuration is missing");
    }
    this.gmailEnv = this.env.gmail;
    this.pubSubClient = new PubSub({ projectId: this.gmailEnv.cloudProjectId });
  }
  env;
  gmailService;
  static RESTART_DELAY_MS = 5e3;
  static RESTART_RETRY_DELAY_MS = 3e4;
  static HEALTH_CHECK_INTERVAL_MS = 10 * 60 * 1e3;
  // Every 10 minutes
  gmailEnv;
  subscription = null;
  topic = null;
  pubSubClient;
  historyId = void 0;
  processesGuard = /* @__PURE__ */ new Set();
  watchExpirationTimer = null;
  healthCheckInterval = null;
  lastMessageReceived = null;
  messageCount = 0;
  isListening = false;
  async validateAndCreateTopic() {
    if (this.topic) return this.topic;
    try {
      const existingTopic = this.pubSubClient.topic(this.gmailEnv.topicName);
      const [exists] = await existingTopic.exists();
      if (exists) {
        this.topic = existingTopic;
        return existingTopic;
      }
    } catch (error) {
      console.error(`[PubSub] Error checking topic existence:`, error);
    }
    console.log(
      `[PubSub] Creating new Pub/Sub topic [${this.gmailEnv.topicName}] for Gmail notifications...`
    );
    const [topic] = await this.pubSubClient.createTopic(this.gmailEnv.topicName);
    console.log(`[PubSub] Successfully created topic: ${this.gmailEnv.topicName}`);
    this.topic = topic;
    return topic;
  }
  async validateAndCreateSubscription() {
    if (this.subscription) return this.subscription;
    this.topic ||= await this.validateAndCreateTopic();
    try {
      const existingSubscription = this.pubSubClient.subscription(this.gmailEnv.subscriptionName);
      const [exists] = await existingSubscription.exists();
      if (exists) {
        console.log(`[PubSub] Found existing subscription: ${this.gmailEnv.subscriptionName}`);
        this.subscription = existingSubscription;
        return existingSubscription;
      }
      console.log(`[PubSub] Subscription does not exist: ${this.gmailEnv.subscriptionName}`);
    } catch (error) {
      console.error(`[PubSub] Error checking subscription existence:`, error);
    }
    console.log(
      `[PubSub] Creating new Pub/Sub subscription [${this.gmailEnv.subscriptionName}] for [${this.gmailEnv.topicName}] topic...`
    );
    const [subscription] = await this.topic.createSubscription(this.gmailEnv.subscriptionName);
    console.log(`[PubSub] Successfully created subscription: ${this.gmailEnv.subscriptionName}`);
    this.subscription = subscription;
    return subscription;
  }
  async handleGmailNotification(historyId) {
    try {
      if (!this.gmailService.labelsDict.main) {
        console.error("[Gmail] Main label not found, cannot process emails");
        return;
      }
      const history = await this.gmailService.gmail.users.history.list({
        startHistoryId: this.historyId || historyId,
        userId: "me"
      });
      if (history.data?.history?.length) {
        const notifications = history.data.history;
        for (const notification of notifications) {
          if (notification.labelsAdded) {
            for (const message of notification.labelsAdded) {
              if (message?.labelIds?.includes(this.gmailService.labelsDict.main)) {
                const id = message.message?.id;
                if (id && !this.processesGuard.has(id)) {
                  this.processesGuard.add(id);
                  try {
                    await this.gmailService.handleMessage(message.message);
                  } catch (error) {
                    console.error(`[Gmail] Error handling email ${id}:`, error);
                  }
                  this.processesGuard.delete(id);
                }
              }
            }
          }
        }
      }
      this.historyId = historyId;
    } catch (err) {
      console.error(`[Gmail] Error handling push message:`, err);
      throw new Error(`Error handling push message: ${err}`, { cause: err });
    }
  }
  async setupPushNotifications(topicName) {
    const fullTopicName = `projects/${this.gmailEnv.cloudProjectId}/topics/${topicName}`;
    try {
      const response = await this.gmailService.gmail.users.watch({
        userId: "me",
        requestBody: {
          topicName: fullTopicName,
          labelIds: ["INBOX"]
          // Watch inbox changes
        }
      });
      if (response?.data?.historyId) {
        this.historyId = response.data.historyId;
      }
      if (response?.data?.expiration) {
        const expirationMs = parseInt(response.data.expiration);
        const now = Date.now();
        const expirationDate = new Date(expirationMs);
        const renewalTime = expirationMs - now - 24 * 60 * 60 * 1e3;
        if (this.watchExpirationTimer) {
          clearTimeout(this.watchExpirationTimer);
        }
        const renewWatch = () => {
          console.log(`[Gmail Watch] Renewing Gmail watch subscription...`);
          this.setupPushNotifications(topicName).catch((error) => {
            console.error(
              `[Gmail Watch] Failed to renew Gmail watch. Retrying in 5 minutes.`,
              error
            );
            setTimeout(renewWatch, 5 * 60 * 1e3);
          });
        };
        this.watchExpirationTimer = setTimeout(renewWatch, Math.max(renewalTime, 0));
        console.log(
          `[Gmail Watch] Push notifications set up successfully.
  Expiration: ${expirationDate.toISOString()} (${Math.round(renewalTime / 1e3 / 60 / 60)} hours)
  Renewal scheduled: ${new Date(now + renewalTime).toISOString()}`
        );
      } else {
        console.warn(
          `[Gmail Watch] No expiration time in response! Watch may expire unexpectedly.`
        );
      }
    } catch (error) {
      console.error(`[Gmail Watch] Error setting up push notifications:`, error);
      throw error;
    }
  }
  async startListening() {
    this.topic ||= await this.validateAndCreateTopic().catch((error) => {
      console.error("[PubSub] Error validating/creating Pub/Sub topic:", error);
      throw error;
    });
    this.subscription ||= await this.validateAndCreateSubscription().catch((error) => {
      console.error("[PubSub] Error validating/creating Pub/Sub subscription:", error);
      throw error;
    });
    await this.setupPushNotifications(this.gmailEnv.topicName).catch((error) => {
      console.error("[PubSub] Error setting up Gmail push notifications:", error);
      throw error;
    });
    console.log("[PubSub] Setting up message and error handlers...");
    this.subscription.on("message", async (message) => {
      this.lastMessageReceived = /* @__PURE__ */ new Date();
      this.messageCount++;
      try {
        const data = JSON.parse(message.data.toString());
        console.log(
          `[PubSub] <<<< Received notification #${this.messageCount} at ${this.lastMessageReceived.toISOString()}:`,
          { historyId: data.historyId }
        );
        if (data.emailAddress && data.historyId) {
          await this.handleGmailNotification(data.historyId);
        } else {
          console.warn(`[PubSub] Notification missing expected fields:`, {
            historyId: data.historyId
          });
        }
        message.ack();
      } catch (error) {
        console.error("[PubSub] Error processing message:", error);
        console.error("[PubSub] Message data:", message.data.toString());
        message.ack();
      }
    });
    this.subscription.on("error", (error) => {
      console.error(`[PubSub] !!!! Subscription error at ${(/* @__PURE__ */ new Date()).toISOString()}:`, error);
      console.error(`[PubSub] Error stack:`, error.stack);
      console.log(`[PubSub] Attempting to recover from subscription error...`);
      this.restartListening();
    });
    this.subscription.on("close", () => {
      console.warn(`[PubSub] !!!! Subscription closed at ${(/* @__PURE__ */ new Date()).toISOString()}`);
      this.isListening = false;
    });
    this.isListening = true;
    console.log(`[PubSub] ======= Listener is now ACTIVE =======`);
    this.startHealthMonitoring();
  }
  async restartListening() {
    console.log(`[PubSub] Restarting listener...`);
    try {
      this.stopListening();
      await new Promise((resolve) => setTimeout(resolve, _PubsubService.RESTART_DELAY_MS));
      await this.startListening();
    } catch (error) {
      console.error(`[PubSub] Failed to restart listener:`, error);
      setTimeout(() => this.restartListening(), _PubsubService.RESTART_RETRY_DELAY_MS);
    }
  }
  startHealthMonitoring() {
    if (this.healthCheckInterval) {
      clearInterval(this.healthCheckInterval);
    }
    this.healthCheckInterval = setInterval(async () => {
      const now = /* @__PURE__ */ new Date();
      const timeSinceLastMessage = this.lastMessageReceived ? (now.getTime() - this.lastMessageReceived.getTime()) / 1e3 / 60 : null;
      console.log(
        `[PubSub Health] Status Check at ${now.toISOString()}:
  Listening: ${this.isListening}
  Messages received: ${this.messageCount}
  Last message: ${this.lastMessageReceived?.toISOString() || "Never"}
  Time since last: ${timeSinceLastMessage ? `${timeSinceLastMessage.toFixed(1)} minutes` : "N/A"}
  History ID: ${this.historyId || "Not set"}`
      );
      const isHealthy = await this.healthCheck();
      if (isHealthy) {
        console.log(`[PubSub Health] Health check PASSED`);
      } else {
        console.error(`[PubSub Health] Health check FAILED! Attempting restart...`);
        await this.restartListening();
      }
    }, _PubsubService.HEALTH_CHECK_INTERVAL_MS);
    console.log(`[PubSub] Health monitoring started (10-minute intervals)`);
  }
  stopListening() {
    if (this.watchExpirationTimer) {
      clearTimeout(this.watchExpirationTimer);
      this.watchExpirationTimer = null;
    }
    if (this.healthCheckInterval) {
      clearInterval(this.healthCheckInterval);
      this.healthCheckInterval = null;
    }
    this.subscription?.removeAllListeners();
    this.isListening = false;
    console.log(`[PubSub] Stopped listening for notifications`);
  }
  async healthCheck() {
    if (!this.subscription) {
      console.error(`[PubSub Health] No subscription object!`);
      return false;
    }
    if (!this.isListening) {
      console.error(`[PubSub Health] Listener is not active!`);
      return false;
    }
    try {
      const profile = await this.gmailService.gmail.users.getProfile({ userId: "me" });
      console.log(`[PubSub Health] Gmail API connection OK (email: ${profile.data.emailAddress})`);
      return true;
    } catch (error) {
      console.error("[PubSub Health] Gmail API connection FAILED:", error);
      return false;
    }
  }
};

// src/index.ts
var DAILY_PENDING_MESSAGES_INTERVAL_MS = 24 * 60 * 60 * 1e3;
var INIT_MAX_RETRIES = 3;
var INIT_RETRY_DELAY_MS = 5e3;
var PORT = env.general.port;
var gmailService;
var pubsubService;
function startPendingMessagesCronJob() {
  return setInterval(async () => {
    try {
      console.log("[Scheduler] Running pending messages job...");
      const handled = await gmailService.handlePendingMessages();
      if (!handled) {
        console.error("[Scheduler] Pending messages job completed with errors.");
      }
    } catch (error) {
      console.error("[Scheduler] Pending messages job failed:", error);
    }
  }, DAILY_PENDING_MESSAGES_INTERVAL_MS);
}
async function init() {
  gmailService = new GmailService(env);
  try {
    await gmailService.init();
    pubsubService = new PubsubService(env, gmailService);
    try {
      const handled = await gmailService.handlePendingMessages();
      if (!handled) {
        console.error("[Init] Pending messages handling completed with errors.");
      }
    } catch (error) {
      console.error("[Init] Error handling pending messages:", error);
    }
    await pubsubService.startListening();
    startPendingMessagesCronJob();
  } catch (error) {
    console.error("[Init] Failed to initialize Gmail listener service:", error);
    throw error;
  }
}
async function bootstrap() {
  for (let attempt = 1; attempt <= INIT_MAX_RETRIES; attempt++) {
    try {
      await init();
      return;
    } catch (error) {
      const isLastAttempt = attempt === INIT_MAX_RETRIES;
      console.error(
        `[Bootstrap] Initialization attempt ${attempt}/${INIT_MAX_RETRIES} failed:`,
        error
      );
      if (isLastAttempt) {
        console.error("[Bootstrap] Maximum initialization attempts reached. Shutting down.");
        process.exit(1);
      }
      await new Promise((resolve) => setTimeout(resolve, INIT_RETRY_DELAY_MS));
    }
  }
}
function authenticate(req) {
  const authHeader = req.headers.authorization;
  const providedKey = authHeader?.startsWith("Bearer ") ? authHeader.slice(7) : req.headers["x-api-key"];
  if (!providedKey) {
    return false;
  }
  const expectedKey = env.authorization.apiKey;
  const providedKeyBuffer = Buffer.from(providedKey, "utf8");
  const expectedKeyBuffer = Buffer.from(expectedKey, "utf8");
  if (providedKeyBuffer.length !== expectedKeyBuffer.length) {
    return false;
  }
  return timingSafeEqual(providedKeyBuffer, expectedKeyBuffer);
}
function sendJson(res, statusCode, data) {
  res.writeHead(statusCode, { "Content-Type": "application/json" });
  res.end(JSON.stringify(data));
}
var routes = {
  GET: {
    "/health": async (req, res) => {
      const isHealthy = pubsubService ? await pubsubService.healthCheck() : false;
      sendJson(res, isHealthy ? 200 : 503, { healthy: isHealthy });
    }
  },
  POST: {
    // ... other POST routes
    "/start-listening": async (req, res) => {
      if (!pubsubService) {
        sendJson(res, 503, { error: "Service not initialized" });
        return;
      }
      await pubsubService.startListening();
      sendJson(res, 200, { success: true });
    },
    "/stop-listening": async (req, res) => {
      if (!pubsubService) {
        sendJson(res, 503, { error: "Service not initialized" });
        return;
      }
      pubsubService.stopListening();
      sendJson(res, 200, { success: true });
    },
    "/handle-pending-messages": async (req, res) => {
      if (!gmailService) {
        sendJson(res, 503, { error: "Service not initialized" });
        return;
      }
      const handled = await gmailService.handlePendingMessages();
      sendJson(res, handled ? 200 : 500, { success: handled });
    }
  }
};
var server = createServer(async (req, res) => {
  if (!authenticate(req)) {
    res.writeHead(401, { "Content-Type": "application/json" });
    res.end(JSON.stringify({ error: "Unauthorized" }));
    return;
  }
  const url = new URL(req.url ?? "/", `http://localhost:${PORT}`);
  const handler = routes[req.method ?? ""]?.[url.pathname];
  if (handler) {
    try {
      await handler(req, res);
    } catch (error) {
      console.error("[Server] Request error:", error);
      sendJson(res, 500, { error: "Internal server error" });
    }
  } else {
    sendJson(res, 404, { error: "Not Found" });
  }
});
server.listen(PORT, () => {
  console.log(`[Server] HTTP server listening on port ${PORT}`);
  void bootstrap();
});
//# sourceMappingURL=index.js.map