58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
/**
|
|
* Test wallet settings and credit request history.
|
|
*/
|
|
export type TestWalletSettingsRow = {
|
|
id: number;
|
|
enabled: boolean;
|
|
credit_amount_raw: string;
|
|
max_requests_per_user: number;
|
|
cooldown_hours: number;
|
|
wallet_type_id: number;
|
|
prediction_limit_enabled: boolean;
|
|
max_test_predictions_per_window: number;
|
|
test_prediction_window_hours: number;
|
|
updated_at: Date;
|
|
};
|
|
export type TestWalletCreditRow = {
|
|
id: string;
|
|
user_id: string;
|
|
wallet_type_id: number;
|
|
amount_raw: string;
|
|
created_at: Date;
|
|
};
|
|
export type TestWalletCreditListRow = TestWalletCreditRow & {
|
|
user_email: string | null;
|
|
wallet_code: string;
|
|
};
|
|
export declare function getSettings(): Promise<TestWalletSettingsRow>;
|
|
export declare function updateSettings(input: {
|
|
enabled?: boolean;
|
|
creditAmountRaw?: string;
|
|
maxRequestsPerUser?: number;
|
|
cooldownHours?: number;
|
|
walletTypeId?: number;
|
|
predictionLimitEnabled?: boolean;
|
|
maxTestPredictionsPerWindow?: number;
|
|
testPredictionWindowHours?: number;
|
|
}): Promise<TestWalletSettingsRow>;
|
|
export declare function countUserCredits(userId: string): Promise<number>;
|
|
export declare function getLastCreditAt(userId: string): Promise<Date | null>;
|
|
/** Sliding-window count of Test Wallet predictions (single + multi + auto). */
|
|
export declare function countTestPredictionsInWindow(userId: string, windowHours: number): Promise<{
|
|
count: number;
|
|
oldestInWindowAt: Date | null;
|
|
}>;
|
|
export declare function createCreditRecord(input: {
|
|
userId: string;
|
|
walletTypeId: number;
|
|
amountRaw: string;
|
|
}): Promise<TestWalletCreditRow>;
|
|
export declare function listCredits(options: {
|
|
userId?: string;
|
|
limit: number;
|
|
offset: number;
|
|
}): Promise<{
|
|
items: TestWalletCreditListRow[];
|
|
total: number;
|
|
}>;
|
|
//# sourceMappingURL=testWalletRepository.d.ts.map
|