import { Sequelize as SequelizeInstance } from 'sequelize-typescript';
import { Stock, CronConfig } from 'src/models';
import { AlphaVantageClient } from 'src/utils/alphavantage';
import { SearchParams, AddParams, StaleParams, DeadActionParams, ListParams, UsersParams, EditParams, SetThresholdParams } from './stocks-manage.entity';
interface AddResult {
    agregados: Array<{
        symbol: string;
        price: number;
        changePercent: number | null;
    }>;
    duplicados: string[];
    agregados_sin_precio: string[];
    fallidos: Array<{
        symbol: string;
        error: string;
    }>;
}
export declare class AdminSystemStocksManageService {
    private readonly stockModel;
    private readonly cronConfigModel;
    private readonly sequelize;
    private readonly av;
    constructor(stockModel: typeof Stock, cronConfigModel: typeof CronConfig, sequelize: SequelizeInstance, av: AlphaVantageClient);
    search(request: SearchParams): Promise<{
        query: string;
        count: number;
        matches: import("src/utils/alphavantage").SymbolSearchMatch[];
    }>;
    add(request: AddParams): Promise<AddResult & {
        counts: Record<string, number>;
    }>;
    stale(_request: StaleParams): Promise<{
        threshold_hours: number;
        counts: {
            pendientes: number;
            muertas: number;
        };
        pendientes: object[];
        muertas: object[];
    }>;
    deadAction(request: DeadActionParams): Promise<{
        ok: boolean;
        status: string;
        stock_id: any;
        symbol: string;
        price?: undefined;
        changePercent?: undefined;
    } | {
        ok: boolean;
        status: string;
        stock_id: any;
        symbol: string;
        price: any;
        changePercent: any;
    } | {
        ok: boolean;
        status: string;
        stock_id: any;
        symbol: string;
        reason?: undefined;
        message?: undefined;
    } | {
        ok: boolean;
        reason: string;
        status: string;
        stock_id: any;
        symbol: string;
        message: string;
    }>;
    private retryQuote;
    private deleteStock;
    list(request: ListParams): Promise<{
        rows: any[];
        count: number;
        total: number;
        page: number;
        per_page: number;
    }>;
    private usuariosCountByStockIds;
    users(request: UsersParams): Promise<{
        stock_id: number;
        count: number;
        users: {
            id: number;
            name: string;
            lastname: string;
            email: string;
        }[];
    }>;
    edit(request: EditParams): Promise<{
        ok: boolean;
        stock: {
            id: any;
            symbol: string;
            name: string;
            priority: boolean;
        };
    }>;
    private toPositiveInt;
    private resolveOrderBy;
    private resolveOrderDir;
    private sanitizeName;
    private resolveSymbols;
    private findTargetStock;
    private getStaleThresholdHours;
    setThreshold(request: SetThresholdParams): Promise<{
        ok: boolean;
        key: string;
        hours: number;
    }>;
    private validateThresholdHours;
    private isForeignKeyError;
}
export {};
