feat(bot): add self-hosted scheduled dispatch support

Co-authored-by: claw <stanislavkalishin+claw@gmail.com>
This commit is contained in:
2026-03-30 15:27:15 +02:00
parent 94c1f48794
commit 575a68b3bb
13 changed files with 331 additions and 40 deletions

View File

@@ -7,7 +7,11 @@ export const SCHEDULED_DISPATCH_KINDS = [
'rent_due'
] as const
export const SCHEDULED_DISPATCH_STATUSES = ['scheduled', 'sent', 'cancelled'] as const
export const SCHEDULED_DISPATCH_PROVIDERS = ['gcp-cloud-tasks', 'aws-eventbridge'] as const
export const SCHEDULED_DISPATCH_PROVIDERS = [
'gcp-cloud-tasks',
'aws-eventbridge',
'self-hosted'
] as const
export type ScheduledDispatchKind = (typeof SCHEDULED_DISPATCH_KINDS)[number]
export type ScheduledDispatchStatus = (typeof SCHEDULED_DISPATCH_STATUSES)[number]
@@ -64,6 +68,11 @@ export interface ScheduledDispatchRepository {
listScheduledDispatchesForHousehold(
householdId: string
): Promise<readonly ScheduledDispatchRecord[]>
listDueScheduledDispatches(input: {
dueBefore: Instant
provider?: ScheduledDispatchProvider
limit: number
}): Promise<readonly ScheduledDispatchRecord[]>
updateScheduledDispatch(
input: UpdateScheduledDispatchInput
): Promise<ScheduledDispatchRecord | null>