import { Repository } from 'typeorm';
import { ClsService } from 'nestjs-cls';
import { ServicePaymentCollectionRepository } from './repositories/service-payment-collection.repository';
import { ServicePaymentCollectionConfirmationRepository } from './repositories/service-payment-collection-confirmation.repository';
import { CollectionAnalyticsRepository } from './repositories/collection-analytics.repository';
import { ServicePaymentCollectionEntity } from '../../entities/service-payment-collection.entity';
import { ServicePaymentCollectionConfirmationEntity } from '../../entities/service-payment-collection-confirmation.entity';
import { BookingEntity } from '../../entities/booking.entity';
import { QueryEntity } from '../../entities/query.entity';
import { BookingTransportItemEntity } from '../../entities/booking-transport-item.entity';
import { BookingActivityItemEntity } from '../../entities/booking-activity-item.entity';
import { BookingSpecialItemEntity } from '../../entities/booking-special-item.entity';
import { PaymentSettlementEntity } from '../../entities/payment-settlement.entity';
import { SettlementPaymentEntity } from '../../entities/settlement-payment.entity';
import { CreateServicePaymentCollectionDto } from './dto/create-service-payment-collection.dto';
import { UpdateServicePaymentCollectionDto } from './dto/update-service-payment-collection.dto';
import { ConfirmCollectionDto } from './dto/confirm-collection.dto';
import { VoidConfirmationDto } from './dto/void-confirmation.dto';
import { ListCollectionsQueryDto } from './dto/list-collections-query.dto';
import { PaymentSettlementService } from '../payment-settlement/payment-settlement.service';
import { AuditService } from '../audit/audit.service';
import { PermissionCheckService } from '../../common/permissions/permission-check.service';
export declare class ServicePaymentCollectionService {
    private readonly collections;
    private readonly confirmations;
    private readonly analytics;
    private readonly bookingRepo;
    private readonly queryRepo;
    private readonly transportRepo;
    private readonly activityRepo;
    private readonly specialRepo;
    private readonly settlementRepo;
    private readonly settlementPaymentRepo;
    private readonly settlementsService;
    private readonly audit;
    private readonly perms;
    private readonly cls;
    constructor(collections: ServicePaymentCollectionRepository, confirmations: ServicePaymentCollectionConfirmationRepository, analytics: CollectionAnalyticsRepository, bookingRepo: Repository<BookingEntity>, queryRepo: Repository<QueryEntity>, transportRepo: Repository<BookingTransportItemEntity>, activityRepo: Repository<BookingActivityItemEntity>, specialRepo: Repository<BookingSpecialItemEntity>, settlementRepo: Repository<PaymentSettlementEntity>, settlementPaymentRepo: Repository<SettlementPaymentEntity>, settlementsService: PaymentSettlementService, audit: AuditService, perms: PermissionCheckService, cls: ClsService);
    list(query: ListCollectionsQueryDto): Promise<{
        items: Array<ServicePaymentCollectionEntity & {
            latest_confirmation: ServicePaymentCollectionConfirmationEntity | null;
        }>;
    }>;
    findByIdWithDetail(id: string): Promise<{
        history: ServicePaymentCollectionConfirmationEntity[];
        booking: BookingEntity;
        booking_id: string;
        service_type: "TRANSPORT" | "ACTIVITY" | "SPECIAL";
        transport_item: BookingTransportItemEntity | null;
        transport_item_id: string | null;
        activity_item: BookingActivityItemEntity | null;
        activity_item_id: string | null;
        special_item: BookingSpecialItemEntity | null;
        special_item_id: string | null;
        transport_item_supplier: import("../../entities/booking-transport-item-supplier.entity").BookingTransportItemSupplierEntity | null;
        transport_item_supplier_id: string | null;
        activity_item_supplier: import("../../entities/booking-activity-item-supplier.entity").BookingActivityItemSupplierEntity | null;
        activity_item_supplier_id: string | null;
        special_item_supplier: import("../../entities/booking-special-item-supplier.entity").BookingSpecialItemSupplierEntity | null;
        special_item_supplier_id: string | null;
        expected_amount: number;
        currency: import("../../entities").CurrencyEntity;
        currency_id: string;
        status: "PENDING" | "COLLECTED" | "CANCELLED";
        notes: string | null;
        confirmations: ServicePaymentCollectionConfirmationEntity[];
        id: string;
        tenant_id: string;
        created_by: string | null;
        updated_by: string | null;
        created_at: Date;
        updated_at: Date;
        is_deleted: boolean;
    }>;
    aggregateBySupplier(opts: Parameters<CollectionAnalyticsRepository['bySupplier']>[0]): Promise<{
        items: {
            collection_kind: "CASH" | "EXPENSE";
            collected_by_type: "OWN" | "SUPPLIER";
            collector_name: string | null;
            supplier_id: string | null;
            supplier_name: string;
            currency_code: string;
            collections_count: number;
            pending_count: number;
            collected_count: number;
            total_collection: number;
            total_collected: number;
            total_pending: number;
        }[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
        };
    }>;
    aggregateSupplierCollectionDrivers(opts: Parameters<CollectionAnalyticsRepository['supplierCollectionDrivers']>[0]): Promise<{
        items: {
            driver_id: string | null;
            driver_name: string;
            driver_phone: string | null;
            service_type: string | null;
            currency_code: string;
            collections_count: number;
            pending_count: number;
            collected_count: number;
            total_collection: number;
            total_collected: number;
            total_pending: number;
            notes: string | null;
            routes: string | null;
        }[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
        };
    }>;
    setRequired(dto: CreateServicePaymentCollectionDto): Promise<ServicePaymentCollectionEntity>;
    update(id: string, dto: UpdateServicePaymentCollectionDto): Promise<ServicePaymentCollectionEntity>;
    cancel(id: string): Promise<ServicePaymentCollectionEntity>;
    confirm(id: string, dto: ConfirmCollectionDto): Promise<ServicePaymentCollectionEntity>;
    voidLatestConfirmation(id: string, dto: VoidConfirmationDto): Promise<ServicePaymentCollectionEntity>;
    private requireAtLeast;
    private polymorphicItemFks;
    private resolveItem;
    private resolveItemSupplierId;
    private applyToCustomerLedger;
}
