import { ModelsService } from 'src/models/models.service';
import { CommonService } from 'src/common/common.service';
import { SmsService } from 'src/common/services/sms.service';
import { Types } from 'mongoose';
import { CreateDriverDto, UpdateDriverDto, DriverListDto, VerifyOtpDto, ResendOtpDto, DriverLoginDto, VerifyDriverLoginOtpDto, ResendDriverLoginOtpDto, UpdateDriverStatusDto, GetAvailableDriversDto, DriverSosDto } from './dto/driver.dto';
import { StatusHistoryService } from 'src/status-history/status-history.service';
import { PayDriverSalaryDto, GetDriverLedgerDto, AddDriverPenaltyDto, PayFromReserveDto, GiveDailyAllowanceDto, FinalSettlementDto, InterimSettlementDto } from './dto/driver.dto';
import { LeaveService } from 'src/leave/leave.service';
export declare function getSalaryCycleStart(driver: any): number;
export declare function getSalaryTermsForMonth(driver: any, monthStr: string): {
    salary: number;
    cycleStart: number;
    revisions: any[];
    paymentStructure?: string;
    monthlyAllowance?: number;
};
export declare function getSalaryTermsAsOf(driver: any, asOfTs: number): {
    salary: number;
    cycleStart: number;
    revisions: any[];
};
export declare function getRevisionLastOldDay(r: any): number;
export declare function applyRevisedSalary(revisions: any[], currentSalary: number, cycleStartDay: number, revised?: {
    day: number;
    salary: number;
}): {
    revisions: {
        salary: number;
        new_salary: number;
        changed_at: number;
        effective_from: number;
    }[];
    salary: number;
};
export declare function getSalaryOnDayOfMonth(driver: any, monthStr: string, day: number): number;
export declare function getSalaryForDaysOfMonth(driver: any, monthStr: string, startDay: number, endDay: number): {
    amount: number;
    exact: number;
    days: number;
    daysInMonth: number;
    segments: {
        salary: number;
        from_day: number;
        to_day: number;
        days: number;
        amount: number;
    }[];
};
export declare function getFullMonthSalary(driver: any, monthStr: string): number;
export declare function getLeaveDeductionForDays(driver: any, monthStr: string, leaveDays: number[]): number;
export declare function calculateDriverAllowanceAccrual(driver: any, asOfDateTimestamp?: number): {
    accrued: number;
    taken: number;
    available: number;
    daysElapsed: number;
    currentDailyRate: number;
    monthlyAllowance: number;
    cycleStartDate: any;
};
export declare class DriverService {
    private readonly models;
    private readonly common;
    private readonly smsService;
    private readonly statusHistoryService;
    private readonly leaveService;
    constructor(models: ModelsService, common: CommonService, smsService: SmsService, statusHistoryService: StatusHistoryService, leaveService: LeaveService);
    clearDriverCache(businessId?: any, driverId?: any): Promise<void>;
    private normalizeToUTCMidnight;
    private calculateDistanceInKm;
    private getTripDistanceInKm;
    calculateDriverAllowanceAccrual(driver: any, asOfDateTimestamp?: number): {
        accrued: number;
        taken: number;
        available: number;
        daysElapsed: number;
        currentDailyRate: number;
        monthlyAllowance: number;
        cycleStartDate: any;
    };
    creditCompletedTripsForDriver(driverId: string | Types.ObjectId): Promise<void>;
    createDriver(createDriverDto: CreateDriverDto, req: any): Promise<any>;
    uploadDriversCsv(file: any, req: any): Promise<any>;
    updateDriver(driverId: string, updateDriverDto: UpdateDriverDto, adminId: string): Promise<any>;
    private enrichDriverStats;
    getDriverList(queryDto: DriverListDto, req: any): Promise<any>;
    getAvailableDrivers(queryDto: GetAvailableDriversDto, req: any): Promise<any>;
    getDriverById(driverId: string, adminId: string): Promise<any>;
    updateDriverStatus(driverId: string, statusDto: UpdateDriverStatusDto, adminId: string): Promise<any>;
    deleteMyAccount(driverId: string): Promise<any>;
    deleteDriver(driverId: string, adminId: string): Promise<any>;
    verifyOtp(verifyOtpDto: VerifyOtpDto): Promise<any>;
    resendOtp(resendOtpDto: ResendOtpDto): Promise<any>;
    driverLogin(driverLoginDto: DriverLoginDto): Promise<any>;
    verifyDriverLoginOtp(verifyDto: VerifyDriverLoginOtpDto): Promise<any>;
    resendDriverLoginOtp(resendDto: ResendDriverLoginOtpDto): Promise<any>;
    private normalizeDateToMidday;
    addPenalty(dto: AddDriverPenaltyDto, adminId: string): Promise<any>;
    getPendingPenalties(driverId: string, req: any): Promise<any>;
    settleDriverPenalties(driverId: any, amountToDeduct: number, salaryId?: any, ledgerId?: any): Promise<{
        penalty_id: any;
        amount: number;
    }[]>;
    private sendDriverPushNotification;
    paySalary(payDto: PayDriverSalaryDto, adminId: string): Promise<any>;
    getDriverLedger(driverId: string, queryDto: GetDriverLedgerDto, req?: any): Promise<any>;
    getMonthlyCompensation(driverId: string, monthStr?: string, adminId?: string): Promise<any>;
    payFromReserve(dto: PayFromReserveDto, adminId: string): Promise<any>;
    giveDailyAllowance(dto: GiveDailyAllowanceDto, adminId: string): Promise<any>;
    private getExpectedSalaryForMonth;
    private getExpectedSalaryForMonthReconstructed;
    private getSalaryDueTimestamp;
    private computeSalaryOutstanding;
    private computeAllowanceAndReserveByMonth;
    private getSalaryPaymentsByMonth;
    private computeUnpaidSalaryAndLeave;
    getFinalSettlementPreview(driverId: string, req: any, requestedExitDate?: string | number): Promise<any>;
    private applySettlement;
    executeFinalSettlement(dto: FinalSettlementDto, adminId: string): Promise<any>;
    executeInterimSettlement(dto: InterimSettlementDto, adminId: string): Promise<any>;
    triggerSos(dto: DriverSosDto, driverId: string): Promise<any>;
}
