pancake-client-sdk
Version:
Official TypeScript SDK for Pancake POS API
90 lines (89 loc) • 2.63 kB
TypeScript
import { LoyaltyProgram, CreateLoyaltyProgramRequest, LoyaltyTier, CreateLoyaltyTierRequest, LoyaltyTransaction, CustomerLoyalty, AdjustPointsRequest, RedeemPointsRequest, LoyaltyTransactionListParams, LoyaltyAnalytics } from '../types/loyalty';
import { BaseResource } from './base';
export declare class LoyaltyResource extends BaseResource {
/**
* Get loyalty program details
*/
getProgram(): Promise<LoyaltyProgram>;
/**
* Create or update loyalty program
*/
setupProgram(data: CreateLoyaltyProgramRequest): Promise<LoyaltyProgram>;
/**
* Update loyalty program
*/
updateProgram(data: Partial<LoyaltyProgram>): Promise<LoyaltyProgram>;
/**
* Get list of loyalty tiers
*/
listTiers(): Promise<{
data: LoyaltyTier[];
}>;
/**
* Create loyalty tier
*/
createTier(data: CreateLoyaltyTierRequest): Promise<LoyaltyTier>;
/**
* Update loyalty tier
*/
updateTier(tierId: string, data: Partial<LoyaltyTier>): Promise<LoyaltyTier>;
/**
* Delete loyalty tier
*/
deleteTier(tierId: string): Promise<void>;
/**
* Get customer loyalty information
*/
getCustomerLoyalty(customerId: string): Promise<CustomerLoyalty>;
/**
* List loyalty transactions
*/
listTransactions(params?: LoyaltyTransactionListParams): Promise<{
data: LoyaltyTransaction[];
}>;
/**
* Get customer loyalty transactions
*/
getCustomerTransactions(customerId: string, params?: Omit<LoyaltyTransactionListParams, 'customer_id'>): Promise<{
data: LoyaltyTransaction[];
}>;
/**
* Adjust customer points
*/
adjustPoints(data: AdjustPointsRequest): Promise<LoyaltyTransaction>;
/**
* Redeem points
*/
redeemPoints(data: RedeemPointsRequest): Promise<LoyaltyTransaction>;
/**
* Calculate points for order
*/
calculateOrderPoints(orderId: string): Promise<{
points: number;
breakdown: {
base_points: number;
tier_bonus?: number;
promotion_bonus?: number;
};
}>;
/**
* Get loyalty program analytics
*/
getAnalytics(params: {
from_date: string;
to_date: string;
}): Promise<LoyaltyAnalytics>;
/**
* Get expiring points notifications
*/
getExpiringPoints(params?: {
days_threshold?: number;
min_points?: number;
}): Promise<{
customers: {
customer_id: string;
expiring_points: number;
expiry_date: string;
}[];
}>;
}