import { ConfigService } from '@nestjs/config';
import { PrismaService } from "../../../../core/database/prisma/prisma.service";
import { DingtalkYidaService } from '../sdk/dingtalk-yida.service';
import { SapPurchaseService, SapEnvironment } from '../sap/sap-purchase.service';
import { SyncLogger } from './sync-logger';
import { SyncExecutionResult } from './business-trip-sync.service';
export declare class PurchaseSapSyncService {
    private yidaService;
    private sapService;
    private prisma;
    private configService;
    private readonly logger;
    constructor(yidaService: DingtalkYidaService, sapService: SapPurchaseService, prisma: PrismaService, configService: ConfigService);
    private getPurchaseFormUuid;
    sync(fromTime?: string, toTime?: string, userId?: string, externalLogger?: SyncLogger, sapEnv?: SapEnvironment): Promise<SyncExecutionResult>;
    private static readonly SYNC_CONFIG_TASK_CODE_PREFIX;
    listPurchases(sapEnv?: SapEnvironment, keyword?: string, status?: string): Promise<{
        items: {
            formInstanceId: string;
            serialNumber: string;
            applicantName: string;
            applicantDept: string;
            applicantEmployeeId: any;
            budgetNumber: string;
            budgetAmount: number;
            purchaseProjectDescription: string;
            applicationDate: string;
            demandCategory: string;
            demandInitiator: string;
            companyName: any;
            purchasingCompanyName: string;
            purchaser: string;
            expectedCompletionDate: string;
            materialGroup: string;
            costCenterNumber: any;
            fixedAssetsNumber: any;
            generalLedgerAccount: any;
            syncStatus: string;
            sapPrNumber: string | null;
            sapMessages: string | number | true | import("@prisma/client/runtime/library").JsonObject | import("@prisma/client/runtime/library").JsonArray | null;
            sapRawResponse: string | number | true | import("@prisma/client/runtime/library").JsonObject | import("@prisma/client/runtime/library").JsonArray | null;
            approverChain: string | null;
            syncedAt: string | null;
            sapRequestPreview: {
                header: Record<string, string>;
                item: Record<string, string | number>;
            } | null;
        }[];
        total: number;
    }>;
    refreshPurchaseCache(sapEnv?: SapEnvironment): Promise<{
        fetched: number;
        upserted: number;
        fromTime: any;
        toTime: string;
    }>;
    getRecords(page?: number, limit?: number, status?: string): Promise<{
        items: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            syncedAt: Date;
            serialNumber: string;
            formInstanceId: string;
            applicantName: string;
            budgetAmount: import("@prisma/client/runtime/library").Decimal;
            sapPrNumber: string | null;
            sapStatus: string;
            sapMessages: import("@prisma/client/runtime/library").JsonValue | null;
            sapRawResponse: import("@prisma/client/runtime/library").JsonValue | null;
            approverChain: string | null;
        }[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
    }>;
    syncSingle(serialNumber: string, sapEnv: SapEnvironment): Promise<{
        serialNumber: string;
        success: boolean;
        alreadyExists: boolean;
        prNumber: string | null;
        messages: {
            type: string;
            message: string;
        }[];
        approverChain: string;
    }>;
    syncBatch(serialNumbers: string[], sapEnv: SapEnvironment): Promise<({
        serialNumber: string;
        success: boolean;
        alreadyExists: boolean;
        prNumber: string | null;
        messages: {
            type: string;
            message: string;
        }[];
        approverChain: string;
    } | {
        serialNumber: string;
        success: boolean;
        prNumber: null;
        messages: {
            type: string;
            message: any;
        }[];
        approverChain: string;
    })[]>;
    private upsertSyncRecord;
    private buildPurchaseFormData;
    private buildApproverChain;
    private parseYidaDate;
    private extractEmployeeFieldName;
}
