@ztimson/momentum
Version:
Client library for momentum
30 lines • 1.05 kB
TypeScript
import { PathEventEmitter } from '@ztimson/utils';
import { Api } from './api';
import { Meta } from './core';
/** Payment discounts */
export type Discount = Meta & {
/** Discount code */
code: string;
/** Discount information */
description?: string;
/** Invalidate discount code */
expire?: Date;
/** Limit the number of uses */
limit?: number;
/** Type of discount: fixed - flat rate, percent - percentage of total */
type: 'fixed' | 'percent';
/** Number of times used */
used?: number;
/** Value of discount: integer when fixed, float between 0-1 when percent */
value: number;
};
export declare class Discounts extends PathEventEmitter {
private api;
constructor(api: Api);
all(): Promise<Discount[]>;
create(discount: Partial<Discount>): Promise<Discount>;
delete(discount: string | Partial<Discount>): Promise<void>;
read(code: string): Promise<Discount>;
update(discount: Partial<Discount>): Promise<Discount>;
}
//# sourceMappingURL=discounts.d.ts.map