import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
  ID: { input: string; output: string; }
  String: { input: string; output: string; }
  Boolean: { input: boolean; output: boolean; }
  Int: { input: number; output: number; }
  Float: { input: number; output: number; }
  DateTime: { input: string; output: string; }
  Decimal: { input: any; output: any; }
  UUID: { input: any; output: any; }
};

/** An enumeration. */
export enum BillingAppOperationStateChoices {
  /** TigerBeetle transfer completed */
  Completed = 'COMPLETED',
  /** TigerBeetle transfer failed */
  Failed = 'FAILED',
  /** Pending TigerBeetle transfer */
  Pending = 'PENDING'
}

/** Balance information for a team's account. */
export type TeamBalance = {
  __typename?: 'TeamBalance';
  /** Current balance (credits_posted - debits_posted) */
  balance: Scalars['Float']['output'];
  /** Total credits posted to account */
  creditsPosted: Scalars['Float']['output'];
  /** Total debits posted from account */
  debitsPosted: Scalars['Float']['output'];
  /** Whether the account exists in TigerBeetle */
  exists: Scalars['Boolean']['output'];
};

export type TeamQuery = {
  __typename?: 'TeamQuery';
  /** Get balance for the authenticated team */
  teamBalance?: Maybe<TeamBalance>;
  /** Get transactions for the authenticated team */
  teamTransactions?: Maybe<Array<Maybe<TeamTransaction>>>;
};


export type TeamQueryTeamTransactionsArgs = {
  limit?: InputMaybe<Scalars['Int']['input']>;
  offset?: InputMaybe<Scalars['Int']['input']>;
};

/** Transaction/operation involving the team's account. */
export type TeamTransaction = {
  __typename?: 'TeamTransaction';
  /** The amount transferred in this operation */
  amount: Scalars['Decimal']['output'];
  createdAt: Scalars['DateTime']['output'];
  /** 'credit' or 'debit' relative to team account */
  direction?: Maybe<Scalars['String']['output']>;
  reasonName?: Maybe<Scalars['String']['output']>;
  /** Current state of the TigerBeetle transfer for this operation */
  state: BillingAppOperationStateChoices;
  updatedAt: Scalars['DateTime']['output'];
  uuid: Scalars['UUID']['output'];
};

export type GetTeamBalanceQueryVariables = Exact<{ [key: string]: never; }>;


export type GetTeamBalanceQuery = { __typename?: 'TeamQuery', teamBalance?: { __typename?: 'TeamBalance', balance: number, creditsPosted: number, debitsPosted: number, exists: boolean } | null };

export type GetTeamTransactionsQueryVariables = Exact<{
  limit?: InputMaybe<Scalars['Int']['input']>;
  offset?: InputMaybe<Scalars['Int']['input']>;
}>;


export type GetTeamTransactionsQuery = { __typename?: 'TeamQuery', teamTransactions?: Array<{ __typename?: 'TeamTransaction', uuid: any, amount: any, state: BillingAppOperationStateChoices, reasonName?: string | null, direction?: string | null, createdAt: string, updatedAt: string } | null> | null };


export const GetTeamBalanceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTeamBalance"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"teamBalance"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"balance"}},{"kind":"Field","name":{"kind":"Name","value":"creditsPosted"}},{"kind":"Field","name":{"kind":"Name","value":"debitsPosted"}},{"kind":"Field","name":{"kind":"Name","value":"exists"}}]}}]}}]} as unknown as DocumentNode<GetTeamBalanceQuery, GetTeamBalanceQueryVariables>;
export const GetTeamTransactionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTeamTransactions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"teamTransactions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"uuid"}},{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"reasonName"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetTeamTransactionsQuery, GetTeamTransactionsQueryVariables>;