import { AbacusStateActionStatus, AbacusState } from '@abacus/ows-state-client';
import { AbacusEvent } from '@abacus/ows-event-client';
import { Environment, Logger, TypedReadable } from '@abacus/common';
import snowflake, { Pool, Connection } from 'snowflake-sdk';
import { SecretsManager } from '@abacus/secrets-manager';

interface AccountContract {
    accountId: number;
    contractId: number;
    createdAt: Date;
    createdBy: string;
    id: number;
    isCalcPrimary: boolean;
    lastModified: Date;
    lastModifiedBy: string;
}
interface AccountId {
    id: number;
}
interface ContractId {
    id: number;
}
interface AccountPaymentEntityId {
    accountId: number;
    paymentEntityId: number;
}
interface AdjustmentType {
    id: number;
    name: string;
    oaCategoryName: string;
}
interface ContractTerm {
    attachments: string[];
    contractId: number;
    id: number;
    type: ContractTermType;
}
declare enum ContractTermType {
    Contribution = "contribution",
    ContributionSchedule = "contribution_schedule",
    ContributorSchedule = "contributor_schedule",
    Label = "label",
    Product = "product",
    Track = "track"
}
interface SnowflakeClientOptions {
    database: string;
    environment: Environment;
    logger?: Logger;
    pool: Pool<Connection>;
}
interface SnowflakeConfig {
    account: string;
    authenticator: string;
    database: string;
    environment: Environment;
    host?: string;
    privateKey?: string;
    privateKeyPath?: string;
    privateKeyPass?: string;
    role?: string;
    username?: string;
    warehouse?: string;
}
interface StatementPeriod {
    closedBy: string;
    closedDate: Date;
    id: number;
    month: number;
    name: string;
    status: StatementPeriodStatus;
    year: number;
}
interface StatementPeriodId {
    id: number;
}
declare enum StatementPeriodStatus {
    Closed = "closed",
    Current = "current",
    Open = "open"
}
interface Upc {
    displayUpc: string;
    upc: number;
}
interface UpcVendor {
    displayUpc: string;
    upc: number;
    vendorId: number;
}

declare class SnowflakeClient {
    private db;
    private env;
    private logger?;
    private pool;
    constructor({ database, environment, logger, pool }: SnowflakeClientOptions);
    private get;
    getAccountIdsByAccountIds(accountIds: number[]): Promise<TypedReadable<AccountId>>;
    getAccountContractsByAccountIdsAndContractIds(accountIds: number[], contractIds: number[]): Promise<TypedReadable<AccountContract>>;
    getAccountPaymentEntityIdsByAccountIds(accountIds: number[]): Promise<TypedReadable<AccountPaymentEntityId>>;
    getAbacusEvents(targetIds: number[], eventName?: string, targetType?: string, createdBy?: string): Promise<TypedReadable<AbacusEvent>>;
    getAbacusStates(parentTableName: string, parentTableIds: number[], actionName?: string, actionStatus?: AbacusStateActionStatus): Promise<TypedReadable<AbacusState>>;
    getAdjustmentTypes(): Promise<TypedReadable<AdjustmentType>>;
    getContractIdsByContractIds(contractIds: number[]): Promise<TypedReadable<ContractId>>;
    getContractTermsByTermTypesAndContractIds(contractIds: number[], termTypes: ContractTermType[]): Promise<TypedReadable<ContractTerm>>;
    getCurrentStatementPeriodIdsByIds(statementPeriodIds: number[]): Promise<TypedReadable<StatementPeriodId>>;
    getStatementPeriodsByYears(years: number[]): Promise<TypedReadable<StatementPeriod>>;
    getUpcsByDisplayUpcs(displayUpcs: string[]): Promise<TypedReadable<Upc>>;
    getUpcsByUpcsAndVendorIds(vendorIds: number[], upcs: string[]): Promise<TypedReadable<UpcVendor>>;
}

declare function getConfig(processEnv?: NodeJS.ProcessEnv): SnowflakeConfig;
declare function getPool(config: SnowflakeConfig): snowflake.Pool<snowflake.Connection>;
declare function getPrivateKey(secretsManager: SecretsManager): Promise<string>;

export { type AccountContract, type AccountId, type AccountPaymentEntityId, type AdjustmentType, type ContractTerm, ContractTermType, SnowflakeClient, type SnowflakeClientOptions, type SnowflakeConfig, type StatementPeriod, type StatementPeriodId, StatementPeriodStatus, type Upc, type UpcVendor, getConfig, getPool, getPrivateKey };
