mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 12:04:02 +00:00
feat(bot): add multi-household reminder delivery
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { SupportedLocale } from '@household/domain'
|
||||
import type { ReminderTarget } from './reminders'
|
||||
|
||||
export const HOUSEHOLD_TOPIC_ROLES = ['purchase', 'feedback', 'reminders'] as const
|
||||
|
||||
@@ -80,6 +81,7 @@ export interface HouseholdConfigurationRepository {
|
||||
telegramThreadId: string
|
||||
}): Promise<HouseholdTopicBindingRecord | null>
|
||||
listHouseholdTopicBindings(householdId: string): Promise<readonly HouseholdTopicBindingRecord[]>
|
||||
listReminderTargets(): Promise<readonly ReminderTarget[]>
|
||||
upsertHouseholdJoinToken(input: {
|
||||
householdId: string
|
||||
token: string
|
||||
|
||||
@@ -3,6 +3,7 @@ export {
|
||||
type ClaimReminderDispatchInput,
|
||||
type ClaimReminderDispatchResult,
|
||||
type ReminderDispatchRepository,
|
||||
type ReminderTarget,
|
||||
type ReminderType
|
||||
} from './reminders'
|
||||
export {
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
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
|
||||
}
|
||||
|
||||
export interface ClaimReminderDispatchInput {
|
||||
householdId: string
|
||||
period: string
|
||||
@@ -16,4 +26,9 @@ export interface ClaimReminderDispatchResult {
|
||||
|
||||
export interface ReminderDispatchRepository {
|
||||
claimReminderDispatch(input: ClaimReminderDispatchInput): Promise<ClaimReminderDispatchResult>
|
||||
releaseReminderDispatch(input: {
|
||||
householdId: string
|
||||
period: string
|
||||
reminderType: ReminderType
|
||||
}): Promise<void>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user