import { ConfigService } from "@nestjs/config";
import { OnModuleDestroy, OnModuleInit } from "@nestjs/common";
import { Repository } from "typeorm";
import { NumberPlateListing } from "src/common/numberplate/numberplate-listing.entity";
import { AdminNumberPlateModerationDto, CreateNumberPlateListingDto, MarkNumberPlateSoldDto, NumberPlateMarketplaceQueryDto, NumberPlateCarPreviewQueryDto, NumberPlatePreviewQueryDto, UpdateNumberPlateListingDto, UpdateNumberPlateListingStatusDto } from "./numberplate.dto";
type PlateDesignConfig = {
    label: string;
    slug: string;
    codes: string[];
};
type PlateEmirateConfig = {
    label: string;
    designs: Record<string, PlateDesignConfig>;
};
export declare class NumberPlateService implements OnModuleInit, OnModuleDestroy {
    private readonly configService;
    private readonly listingRepository;
    private expiryCleanupTimer;
    constructor(configService: ConfigService, listingRepository: Repository<NumberPlateListing>);
    onModuleInit(): void;
    onModuleDestroy(): void;
    getConfig(): Record<string, PlateEmirateConfig>;
    getCarAssets(): Array<{
        slug: string;
        label: string;
    }>;
    generateAllCarPreviews(query: NumberPlateCarPreviewQueryDto): Promise<Record<string, any>>;
    decorateListing(listing: NumberPlateListing): {
        contact: {
            whatsappUrl: string;
            whatsappText: string;
        };
        isExpired: boolean;
        id: number;
        parentListingId: number;
        sellerUserId: number;
        emirate: string;
        emirateLabel: string;
        design: string;
        designLabel: string;
        code: string;
        number: string;
        digitCount: number;
        plateType: string;
        vehicleType: string;
        flag1: string;
        flag2: string;
        price: number;
        isNegotiable: boolean;
        currency: string;
        description: string;
        sellerName: string;
        sellerMobile: string;
        sellerEmail: string;
        plateImageUrl: string;
        uploadedPlateImageUrl: string;
        frontPreviewUrl: string;
        backPreviewUrl: string;
        expiresAt: Date;
        isVisible: boolean;
        validityDays: number;
        approvedAt: Date;
        approvedByUserId: number;
        publishedAt: Date;
        rejectionReason: string;
        status: import("src/common/numberplate/numberplate-listing.entity").NumberPlateListingStatus;
        createdAt: Date;
        updatedAt: Date;
    };
    createListing(dto: CreateNumberPlateListingDto, authenticatedUserId?: number): Promise<NumberPlateListing>;
    findMarketplaceListings(query: NumberPlateMarketplaceQueryDto): Promise<NumberPlateListing[]>;
    findListing(id: number, requesterUserId?: number, allowPrivate?: boolean): Promise<NumberPlateListing>;
    findSellerListings(sellerUserId: number): Promise<NumberPlateListing[]>;
    updateListing(listingId: number, dto: UpdateNumberPlateListingDto, authenticatedUserId: number): Promise<any>;
    updateListingStatus(listingId: number, dto: UpdateNumberPlateListingStatusDto, authenticatedUserId: number): Promise<NumberPlateListing>;
    removeListing(listingId: number, authenticatedUserId: number): Promise<NumberPlateListing>;
    markSold(listingId: number, dto: MarkNumberPlateSoldDto, authenticatedUserId?: number): Promise<NumberPlateListing>;
    getListingPreview(listingId: number, requesterUserId: number): Promise<{
        id: number;
        plateImageUrl: string;
        frontPreviewUrl: string;
        backPreviewUrl: string;
        emirate: string;
        emirateLabel: string;
        code: string;
        number: string;
        plateType: string;
    }>;
    adminFindListings(query: NumberPlateMarketplaceQueryDto & {
        sellerUserId?: string;
    }): Promise<NumberPlateListing[]>;
    adminModerateListing(listingId: number, adminUserId: number, dto: AdminNumberPlateModerationDto): Promise<any>;
    private applyListingUpdateFields;
    private applyEditRequestFields;
    generatePreview(query: NumberPlatePreviewQueryDto): {
        vehicleType: string;
        imageUrl: string;
        emirate: string;
        emirateLabel: string;
        design: string;
        designLabel: string;
        slug: string;
        code: string;
        number: string;
        flag1: string;
        flag2: string;
        width: string;
    };
    private generateCarPlatePreview;
    private generateBikePreview;
    generateCarPreview(query: NumberPlateCarPreviewQueryDto): Promise<any>;
    private generateSingleCarPreview;
    private expandDetectionBox;
    private writePreviewSvg;
    private buildImageUrl;
    private buildBikeImageUrl;
    private normalizeKey;
    private normalizeWidth;
    private normalizeExpandRatio;
    private normalizeBoolean;
    private getDefaultValidityDays;
    private calculateExpiryDate;
    private startExpiryCleanupLoop;
    private cleanupExpiredListings;
    private buildWhatsappUrl;
    private buildWhatsappText;
    private ensureListingOwnership;
    private deriveDigitCount;
    private normalizePhoneNumber;
    private parseOffset;
    private resolvePublicUrl;
    private resolveImageForSvg;
    private getMimeType;
    private escapeXml;
    private fileToDataUri;
    private nullable;
    private preserveNullable;
}
export {};
