import { KeyOfType, RoutePath } from '@serene-dev/la-nest-library';
import { ProxyService } from '../proxy/proxy.service';
import { EProduct, EProductPurchaseResponseCode, ETransactionStatus } from '../product/product.enum';
import { Repository } from 'typeorm';
import { GloTransactionEntity } from './glo.entity';
import { TransactionEntity } from '../product/transaction.entity';
import { ProductRequirementDTO } from 'src/dtos/telco-product.dto';
import { Observable } from 'rxjs';
import { EGloAccountType, EGloAccountTypeId, EGloPrincipalType, EGloProductType, EGloResponseCode } from './glo.enum';
import { IGloVotResponse } from 'src/modules/glo/types/glo-vot-response.interface';
import { IGloVosResponse } from 'src/modules/glo/types/glo-vos-response.interface';
import { IGloTopupResponse } from 'src/modules/glo/types/glo-topup-response.interface';
import { IGloDataResponse } from 'src/modules/glo/types/glo-data-response.interface';
import { IGloVoiceResponse } from 'src/modules/glo/types/glo-voice-response.interface';
import { IGloResponseReturn } from 'src/modules/glo/types/glo-response.interface';
import { PartialTE } from 'src/dtos/transaction.dto';
export declare class GloService {
    protected proxyService: ProxyService;
    protected readonly repo: Repository<GloTransactionEntity>;
    static routePath: RoutePath;
    protected readonly logger: {
        info: (val: unknown, ...meta: any[]) => any;
        log: (val: unknown, ...meta: any[]) => any;
        error: (val: unknown, ...meta: any[]) => any;
    };
    protected get soapEndpoint(): string;
    protected get clientId(): string;
    protected get resellerId(): string;
    protected get userId(): string;
    protected get password(): string;
    protected readonly responseCodeMapping: Record<EGloResponseCode, EProductPurchaseResponseCode>;
    constructor(proxyService: ProxyService, repo: Repository<GloTransactionEntity>);
    protected updateTransactionRecord(transactionID: string, data: Partial<GloTransactionEntity>): Promise<boolean>;
    protected escapeXml(value: string): string;
    protected xmlRequestTopupFormatter(params: {
        msisdn: string;
        amount: number;
        accountTypeId: EGloAccountType;
        productId?: string;
        clientReference?: string;
        clientComment?: string;
    }): string;
    protected xmlRequestAirtimeTopupFormatter(params: {
        msisdn: string;
        amount: number;
        clientReference?: string;
        clientComment?: string;
    }): string;
    protected jsonRequestTopupFormatter(params: {
        msisdn: string;
        amount: number;
        accountTypeId: EGloAccountType;
        productId?: string;
        clientReference?: string;
        clientComment?: string;
    }): {
        resource: string;
        body: {
            context: {
                channel: string;
                clientComment: string;
                clientId: string;
                prepareOnly: boolean;
                clientReference: string;
                clientRequestTimeout: number;
                initiatorPrincipalId: {
                    id: string;
                    type: EGloPrincipalType;
                    userId: string;
                };
                password: string;
                transactionProperties: {
                    entry: {
                        key: string;
                        value: string;
                    }[];
                };
            };
            senderPrincipalId: {
                id: string;
                type: EGloPrincipalType;
                userId: string;
            };
            topupPrincipalId: {
                id: string;
                type: EGloPrincipalType;
            };
            senderAccountSpecifier: {
                accountId: string;
                accountTypeId: EGloAccountTypeId;
            };
            topupAccountSpecifier: {
                accountId: string;
                accountTypeId: EGloAccountType;
            };
            productId: string;
            amount: {
                currency: string;
                value: number;
            };
        };
    };
    protected xmlRequestPurchaseFormatter(params: {
        msisdn: string;
        purchaseAmount: number;
        productId: EGloProductType;
        clientReference?: string;
    }): string;
    protected jsonRequestPurchaseFormatter(params: {
        msisdn: string;
        purchaseAmount: number;
        productId: EGloProductType;
        clientReference?: string;
    }): {
        resource: string;
        body: {
            context: {
                channel: string;
                prepareOnly: boolean;
                clientReference: string;
                clientRequestTimeout: number;
                initiatorPrincipalId: {
                    id: string;
                    type: EGloPrincipalType;
                    userId: string;
                };
                password: string;
                transactionProperties: {
                    entry: {
                        key: string;
                        value: string;
                    }[];
                };
            };
            senderPrincipalId: {
                id: string;
                type: EGloPrincipalType;
                userId: string;
            };
            receiverPrincipalId: {
                id: string;
                type: EGloPrincipalType;
            };
            senderAccountSpecifier: {
                accountTypeId: EGloAccountTypeId;
            };
            purchaseOrder: {
                productSpecifier: {
                    productId: EGloProductType;
                    productIdType: string;
                };
                purchaseCount: number;
            };
        };
    };
    protected callGloSOAP<T extends IGloVotResponse | IGloVosResponse | IGloTopupResponse | IGloDataResponse | IGloVoiceResponse>(requestXml: string, resource: KeyOfType<T['soap:Envelope']['soap:Body'], IGloResponseReturn<unknown>>): Promise<T["soap:Envelope"]["soap:Body"][keyof (T["soap:Envelope"]["soap:Body"] extends infer T_1 ? { [P in keyof T_1 as T["soap:Envelope"]["soap:Body"][P] extends IGloResponseReturn<unknown> ? P : never]: any; } : never)] & {
        responseXML: string;
    }>;
    protected normalizeResultCode(resultCode?: EGloResponseCode): number;
    purchaseAirtimeTopup(msisdn: string, amount: number, clientReference: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
    purchaseDataBundle(msisdn: string, productId: string, amount: number, clientReference: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
    purchaseVoiceBundle(msisdn: string, productId: string, amount: number, clientReference: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
    protected voucherPurchase(msisdn: string, purchaseAmount: number, productId: EGloProductType, clientReference: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
    protected handlePurchaseRequest: (requestXml: string, soapCall: () => Promise<IGloResponseReturn<unknown> & {
        responseXML: string;
    }>, config?: {
        transaction?: TransactionEntity;
    }) => Promise<PartialTE>;
    buyPackage(transaction: TransactionEntity, param: {
        product?: EProduct;
        package?: string;
    }, requestInfo: ProductRequirementDTO): Promise<Partial<TransactionEntity>> | Observable<{
        status: ETransactionStatus;
        errorCode: EProductPurchaseResponseCode;
        error: string;
    }>;
    purchaseVot(msisdn: string, purchaseAmount: number, clientReference?: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
    purchaseVos(msisdn: string, purchaseAmount: number, clientReference?: string, transaction?: TransactionEntity): Promise<Partial<TransactionEntity>>;
}
