import { PrismaService } from '../../database/prisma.service';
import { CreateAdminWithShopDto } from './dto/create-admin-with-shop.dto';
import { Prisma, ShopStatus, UserRole } from '@prisma/client';
import { CreateSubadminDto } from './dto/create-subadmin.dto';
import { CreateCustomerDto } from './dto/create-customer.dto';
import { CreateOwnedShopDto } from './dto/create-owned-shop.dto';
import { UploadsService } from '../uploads/uploads.service';
import { UpdateOwnedShopDto } from './dto/update-owned-shop.dto';
import { CreateSuperadminDto } from './dto/create-superadmin.dto';
import { UpdateManagedUserDto } from './dto/update-managed-user.dto';
import { UpdateMyLocationDto } from './dto/update-my-location.dto';
import { UpdateMyProfileDto } from './dto/update-my-profile.dto';
import { WalletService } from '../wallet/wallet.service';
import { MailService } from '../mail/mail.service';
export declare class UsersService {
    private readonly prisma;
    private readonly uploads;
    private readonly wallet;
    private readonly mail;
    private readonly logger;
    constructor(prisma: PrismaService, uploads: UploadsService, wallet: WalletService, mail: MailService);
    private queueShopApprovedEmail;
    private resolveCustomerIdsForMe;
    private defaultSubadminPermissions;
    private sharedPlanSelect;
    private shopResponseSelect;
    private mapShopResponse;
    updateMyProfile(userId: string, dto: UpdateMyProfileDto): Promise<{
        id: string;
        email: string | null;
        phone: string | null;
        role: import("@prisma/client").$Enums.UserRole;
        name: string | null;
    }>;
    updateMyLocation(userId: string, dto: UpdateMyLocationDto): Promise<{
        id: string;
        latitude: number | null;
        longitude: number | null;
        locationAddress: string | null;
    }>;
    deactivateMe(userId: string): Promise<{
        deactivated: boolean;
        user?: undefined;
    } | {
        deactivated: boolean;
        user: {
            id: string;
            isActive: boolean;
            deactivatedAt: Date | null;
        };
    }>;
    listShopsForRequester(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }): Promise<any[]>;
    listShopsForRequesterPaged(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, args: {
        page: number;
        limit: number;
        q?: string;
        status?: string;
        isActive?: string;
        planCode?: string;
    }): Promise<{
        page: number;
        limit: number;
        total: number;
        items: any[];
    }>;
    private normalizeShopUsername;
    createShopForAdmin(adminUserId: string, dto: CreateOwnedShopDto): Promise<any>;
    switchAdminCurrentShop(adminUserId: string, shopId: string): Promise<{
        switched: boolean;
        shopId: string;
    }>;
    switchCurrentShop(requester: {
        id: string;
        role: UserRole;
    }, shopId: string): Promise<{
        switched: boolean;
        shopId: string;
    }>;
    setShopPlanForAdmin(adminUserId: string, shopId: string, dto: {
        planCode: string;
        renew?: boolean;
    }, portalPublicUrl?: string | null): Promise<{
        updated: boolean;
        renewed: boolean;
        shop: any;
        scheduled?: undefined;
        effectiveAt?: undefined;
    } | {
        updated: boolean;
        scheduled: boolean;
        effectiveAt: Date;
        shop: any;
        renewed?: undefined;
    } | {
        updated: boolean;
        shop: any;
        renewed?: undefined;
        scheduled?: undefined;
        effectiveAt?: undefined;
    }>;
    updateShopForAdmin(adminUserId: string, shopId: string, dto: {
        name?: string;
        username?: string;
        address?: string;
        city?: string;
        state?: string;
        pincode?: string;
        gstNo?: string;
        upiId?: string;
        businessTypeId?: string;
        imageUrl?: string;
        latitude?: number;
        longitude?: number;
    }): Promise<{
        updated: boolean;
        shop: any;
    }>;
    updateShopForRequester(requester: {
        id: string;
        role: UserRole;
    }, shopId: string, dto: UpdateOwnedShopDto): Promise<{
        updated: boolean;
        shop: any;
    }>;
    uploadShopImageForAdmin(adminUserId: string, shopId: string, file: {
        buffer: Buffer;
        originalname?: string;
        mimetype?: string;
    }): Promise<{
        updated: boolean;
        shop: {
            id: string;
            imageUrl: string | null;
        };
    }>;
    uploadShopImageForRequester(requester: {
        id: string;
        role: UserRole;
    }, shopId: string, file: {
        buffer: Buffer;
        originalname?: string;
        mimetype?: string;
    }): Promise<{
        updated: boolean;
        shop: {
            id: string;
            imageUrl: string | null;
        };
    }>;
    getUserById(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, userId: string): Promise<{
        shop: {
            plan: {
                id: string;
                name: string;
                code: string;
                currency: string;
                priceMonthly: number;
                features: Prisma.JsonValue;
            } | null;
            id: string;
            name: string;
            address: string;
            city: string;
            state: string;
            pincode: string;
            gstNo: string | null;
            upiId: string | null;
            adminId: string;
            admin: {
                adminSubscription: {
                    plan: {
                        id: string;
                        name: string;
                        code: string;
                        currency: string;
                        priceMonthly: number;
                        features: Prisma.JsonValue;
                    };
                    planExpiresAt: Date | null;
                    scheduledPlanCode: string | null;
                    scheduledPlanAt: Date | null;
                } | null;
            };
        } | null;
        id: string;
        email: string | null;
        phone: string | null;
        role: import("@prisma/client").$Enums.UserRole;
        tokenVersion: number;
        shopId: string | null;
        createdAt: Date;
        updatedAt: Date;
    }>;
    createAdminWithShop(dto: CreateAdminWithShopDto): Promise<{
        admin: {
            id: string;
            email: string | null;
            role: import("@prisma/client").$Enums.UserRole;
            phone: string | null;
        };
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            city: string;
            state: string;
            pincode: string;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
        };
        reusedAdmin: boolean;
    }>;
    createSubadminForAdmin(adminUserId: string, dto: CreateSubadminDto): Promise<{
        shops: {
            id: string;
            name: string;
        }[];
        id: string;
        email: string | null;
        phone: string | null;
        role: import("@prisma/client").$Enums.UserRole;
        shopId: string | null;
        permissions: Prisma.JsonValue;
        createdAt: Date;
    }>;
    listSubadminsForAdmin(adminUserId: string): Promise<any[]>;
    updateSubadminPermissionsForAdmin(adminUserId: string, subadminId: string, dto: {
        permissions?: string[];
    }): Promise<{
        updated: boolean;
    }>;
    updateSubadminShopsForAdmin(adminUserId: string, subadminId: string, dto: {
        allShops?: boolean;
        shopIds?: string[];
    }): Promise<{
        updated: boolean;
    }>;
    deleteSubadminForAdmin(adminUserId: string, subadminId: string): Promise<{
        deleted: boolean;
    }>;
    createCustomerForAdmin(adminUserId: string, dto: CreateCustomerDto): Promise<any>;
    private assertCanAccessShop;
    getShopIntegrations(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, shopId: string): Promise<{
        id: string;
        googleApiKey: string | null;
        googlePlaceId: string | null;
        facebookAppId: string | null;
        facebookAppSecret: string | null;
        instagramAccessToken: string | null;
        instagramBusinessAccountId: string | null;
    }>;
    updateShopIntegrations(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, shopId: string, dto: {
        googleApiKey?: string;
        googlePlaceId?: string;
        facebookAppId?: string;
        facebookAppSecret?: string;
        instagramAccessToken?: string;
        instagramBusinessAccountId?: string;
    }): Promise<{
        updated: boolean;
        integrations: {
            id: string;
            updatedAt: Date;
            googleApiKey: string | null;
            googlePlaceId: string | null;
            facebookAppId: string | null;
            facebookAppSecret: string | null;
            instagramAccessToken: string | null;
            instagramBusinessAccountId: string | null;
        };
    }>;
    createCustomerForShop(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, dto: {
        phone: string;
        email?: string;
        name?: string;
    }): Promise<any>;
    listCustomers(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, shopIdQuery?: string): Promise<{
        shopId: string;
        isCashiUser: boolean;
        linkedToShop: boolean;
        rewards: {
            availableCoupons: number;
            availablePoints: number;
        };
        id: string;
        email: string | null;
        phone: string | null;
        name: string | null;
        createdAt: Date;
    }[]>;
    listCustomersPaged(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, args: {
        shopId?: string;
        page: number;
        limit: number;
        q?: string;
        isActive?: string;
        isCashiUser?: string;
        couponOnly?: string;
    }): Promise<{
        page: number;
        limit: number;
        total: number;
        items: any[];
    }>;
    setCustomerActive(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, customerId: string, isActive: boolean): Promise<{
        updated: boolean;
        customer: {
            id: string;
            isActive: boolean;
            deactivatedAt: Date | null;
        };
    }>;
    listUsersPaged(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, args: {
        page: number;
        limit: number;
        q?: string;
        role?: string;
        isActive?: string;
    }): Promise<{
        page: number;
        limit: number;
        total: number;
        items: {
            shops: any[];
            id: string;
            email: string | null;
            phone: string | null;
            role: import("@prisma/client").$Enums.UserRole;
            name: string | null;
            tokenVersion: number;
            isActive: boolean;
            deactivatedAt: Date | null;
            shopId: string | null;
            permissions: Prisma.JsonValue;
            createdAt: Date;
            updatedAt: Date;
            shop: {
                id: string;
                name: string;
            } | null;
            ownedShops: {
                id: string;
                name: string;
            }[];
            subadminShops: {
                shop: {
                    id: string;
                    name: string;
                };
            }[];
        }[];
    }>;
    setUserActive(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, userId: string, isActive: boolean): Promise<{
        updated: boolean;
        user: {
            id: string;
            role: import("@prisma/client").$Enums.UserRole;
            tokenVersion: number;
            isActive: boolean;
            deactivatedAt: Date | null;
        };
    }>;
    createSuperadmin(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, dto: CreateSuperadminDto): Promise<{
        created: boolean;
        user: {
            id: string;
            email: string | null;
            phone: string | null;
            role: import("@prisma/client").$Enums.UserRole;
            name: string | null;
            isActive: boolean;
            permissions: Prisma.JsonValue;
            createdAt: Date;
        };
    }>;
    updateManagedUser(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, userId: string, dto: UpdateManagedUserDto): Promise<{
        updated: boolean;
        user: {
            id: string;
            email: string | null;
            phone: string | null;
            role: import("@prisma/client").$Enums.UserRole;
            name: string | null;
            isActive: boolean;
            deactivatedAt: Date | null;
            shopId: string | null;
            permissions: Prisma.JsonValue;
            createdAt: Date;
            updatedAt: Date;
        };
    }>;
    lookupCustomerByPhone(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, phone: string, shopIdQuery?: string): Promise<any>;
    lookupCustomerById(requester: {
        id: string;
        role: UserRole;
        shopId?: string | null;
    }, userId: string, shopIdQuery?: string): Promise<any>;
    listMyCoupons(userId: string): Promise<{
        active: any[];
        used: any[];
        expired: any[];
    }>;
    private haversineKm;
    listMyAvailableCoupons(userId: string, args: {
        shopId?: string;
        coords?: {
            lat: number;
            lng: number;
        };
        radiusKm: number;
        limit: number;
    }): Promise<{
        items: any[];
        radiusKm: number;
        usedCoords: boolean;
    }>;
    claimCouponWithPoints(userId: string, dto: {
        couponId: string;
    }): Promise<{
        ok: boolean;
        assignment: {
            assignmentId: string;
            status: import("@prisma/client").$Enums.CustomerCouponStatus;
            assignedAt: Date;
            redeemedAt: Date | null;
            cashiCoinsSpent: number;
            cashiPointsSpent: number;
            coupon: any;
        };
        cashiCoins: {
            available: number;
        };
        cashiPoints: {
            available: number;
        };
    }>;
    getMyDashboard(userId: string): Promise<{
        cashiCoins: {
            available: number;
            earned: number;
            spent: number;
        };
        cashiPoints: {
            available: number;
            earned: number;
            redeemed: number;
        };
        cashback: {
            savedAmount: number;
        };
        coupons: {
            active: number;
            used: number;
            expired: number;
        };
    }>;
    listMyEarnings(userId: string, page?: number, limit?: number): Promise<{
        page: number;
        limit: number;
        total: number;
        items: {
            id: string;
            createdAt: Date;
            amount: number;
            cashiCoinsEarned: any;
            cashiPointsEarned: number;
            cashiPointsRedeemed: number;
            originalAmount: number | null;
            discountAmount: number;
            pointsEarned: number;
            pointsRedeemed: number;
            shop: {
                id: string;
                name: string;
                username: string | null;
                imageUrl: string | null;
            };
        }[];
    }>;
    getMyShopActivity(userId: string, shopId: string, page?: number, limit?: number): Promise<{
        shopId: string;
        stats: {
            visits: number;
            cashiPointsAvailable: number;
            cashiPointsEarned: number;
            cashiPointsRedeemed: number;
            cashiCoinsEarned: number;
            savedAmount: number;
        };
        page: number;
        limit: number;
        total: number;
        items: {
            id: string;
            createdAt: Date;
            amount: number;
            cashiCoinsEarned: any;
            cashiPointsEarned: number;
            cashiPointsRedeemed: number;
            originalAmount: number | null;
            discountAmount: number;
            pointsEarned: number;
            pointsRedeemed: number;
        }[];
    }>;
    approveShop(shopId: string): Promise<{
        approved: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            city: string;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
    rejectShop(shopId: string, reason: string): Promise<{
        rejected: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
    setShopStatus(shopId: string, dto: {
        status: ShopStatus;
        reason?: string | null;
        note?: string | null;
    }): Promise<{
        approved: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            city: string;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    } | {
        rejected: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    } | {
        updated: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
    setShopActive(shopId: string, isActive: boolean): Promise<{
        updated: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
    resubmitRejectedShopForAdmin(adminUserId: string, shopId: string): Promise<{
        resubmitted: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
    archiveShop(shopId: string): Promise<{
        archived: boolean;
        shop: {
            id: string;
            name: string;
            isActive: boolean;
            deactivatedAt: Date | null;
            status: import("@prisma/client").$Enums.ShopStatus;
            approvedAt: Date | null;
            rejectedAt: Date | null;
            rejectedReason: string | null;
        };
    }>;
}
