mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 23:34:04 +00:00
40 lines
992 B
TypeScript
40 lines
992 B
TypeScript
import type { SupportedLocale } from '@household/domain'
|
|
|
|
export const REMINDER_TYPES = ['utilities', 'rent-warning', 'rent-due'] as const
|
|
|
|
export type ReminderType = (typeof REMINDER_TYPES)[number]
|
|
|
|
export interface ReminderTarget {
|
|
householdId: string
|
|
householdName: string
|
|
telegramChatId: string
|
|
telegramThreadId: string | null
|
|
locale: SupportedLocale
|
|
timezone: string
|
|
rentDueDay: number
|
|
rentWarningDay: number
|
|
utilitiesDueDay: number
|
|
utilitiesReminderDay: number
|
|
}
|
|
|
|
export interface ClaimReminderDispatchInput {
|
|
householdId: string
|
|
period: string
|
|
reminderType: ReminderType
|
|
payloadHash: string
|
|
}
|
|
|
|
export interface ClaimReminderDispatchResult {
|
|
dedupeKey: string
|
|
claimed: boolean
|
|
}
|
|
|
|
export interface ReminderDispatchRepository {
|
|
claimReminderDispatch(input: ClaimReminderDispatchInput): Promise<ClaimReminderDispatchResult>
|
|
releaseReminderDispatch(input: {
|
|
householdId: string
|
|
period: string
|
|
reminderType: ReminderType
|
|
}): Promise<void>
|
|
}
|