credix
Version:
Official SDK for Credix Credit Management System
73 lines • 1.59 kB
TypeScript
/**
* Discount Campaign Types
*/
/**
* Discount type - percentage or fixed amount
*/
export type DiscountType = 'percentage' | 'fixed_amount';
/**
* Trigger type for discount campaigns
*/
export type DiscountTriggerType = 'first_signin' | 'period_based';
/**
* Active discount campaign
*/
export interface Discount {
id: string;
name: string;
discountType: DiscountType;
discountRate?: number;
discountAmount?: number;
triggerType: DiscountTriggerType;
validityDays?: number;
maxDiscountAmount?: number;
startDate?: string;
endDate?: string;
createdAt: string;
updatedAt: string;
}
/**
* Response from getting active discounts
*/
export interface GetActiveDiscountsResponse {
discounts: Discount[];
}
/**
* Parameters for getting active discounts
*/
export interface GetActiveDiscountsParams {
externalUserId: string;
}
/**
* Parameters for applying a discount
*/
export interface ApplyDiscountParams {
externalUserId: string;
discountId: string;
amount: number;
}
/**
* Response from applying a discount
*/
export interface ApplyDiscountResponse {
success: boolean;
discountApplied: number;
finalAmount: number;
message?: string;
}
/**
* Parameters for checking discount eligibility
*/
export interface CheckEligibilityParams {
externalUserId: string;
discountId: string;
}
/**
* Response from checking discount eligibility
*/
export interface CheckEligibilityResponse {
eligible: boolean;
reason?: string;
discount?: Discount;
}
//# sourceMappingURL=discounts.d.ts.map