mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 13:54:02 +00:00
23 lines
772 B
TypeScript
23 lines
772 B
TypeScript
import type { Instant } from '@household/domain'
|
|
|
|
export const TELEGRAM_PENDING_ACTION_TYPES = ['anonymous_feedback'] as const
|
|
|
|
export type TelegramPendingActionType = (typeof TELEGRAM_PENDING_ACTION_TYPES)[number]
|
|
|
|
export interface TelegramPendingActionRecord {
|
|
telegramUserId: string
|
|
telegramChatId: string
|
|
action: TelegramPendingActionType
|
|
payload: Record<string, unknown>
|
|
expiresAt: Instant | null
|
|
}
|
|
|
|
export interface TelegramPendingActionRepository {
|
|
upsertPendingAction(input: TelegramPendingActionRecord): Promise<TelegramPendingActionRecord>
|
|
getPendingAction(
|
|
telegramChatId: string,
|
|
telegramUserId: string
|
|
): Promise<TelegramPendingActionRecord | null>
|
|
clearPendingAction(telegramChatId: string, telegramUserId: string): Promise<void>
|
|
}
|