UNPKG

@vulog/aima-promocode

Version:

```bash npm i @vulog/aima-client @vulog/aima-promocode ```

51 lines (44 loc) 1.65 kB
import { Client } from '@vulog/aima-client'; type ProductGroup = { id: string; name: string; status: 'ACTIVE' | 'INACTIVE'; }; type PromoCodeUsage = { id: number; walletUsage: 'TRIP' | 'PRODUCTS'; discountCategory: 'CREDITS'; percentage: number; amount: number; cappedPercentage: null; isOneTimeUsage: boolean; productGroup?: ProductGroup | null; }; type PromoCode = { reference: string; walletType: string; status: 'ACTIVE' | 'INACTIVE'; validityDuration: number; effectiveDate: string; expiryDate: string; validityEndDate: string; description?: string; id: number; fleetId: string; registration: boolean; maxUses: number; usages: PromoCodeUsage[]; [key: string]: any; }; type ReferralInfo = { referralUserId: string; referralCode: string; referralPromocodeId: number; refereePromocodeId: number; }; declare const checkInvitationCode: (client: Client, referralCode: string) => Promise<ReferralInfo | undefined>; declare const getPromoCodeByReference: (client: Client, reference: string) => Promise<PromoCode | undefined>; declare const getPromoCodeById: (client: Client, id: number) => Promise<PromoCode | undefined>; declare const submitPromoCode: (client: Client, userId: string, entityId: string, code: string) => Promise<string>; declare const submitReferral: (client: Client, userId: string, entityId: string, code: string) => Promise<void>; export { type ProductGroup, type PromoCode, type PromoCodeUsage, type ReferralInfo, checkInvitationCode, getPromoCodeById, getPromoCodeByReference, submitPromoCode, submitReferral };