refactor(bot): replace reminder polling with scheduled dispatches

This commit is contained in:
2026-03-24 20:51:54 +04:00
parent a1acec5e60
commit 7f836eeee2
48 changed files with 6425 additions and 1557 deletions

View File

@@ -12,6 +12,7 @@ import type {
HouseholdUtilityCategoryRecord
} from '@household/ports'
import { Money, Temporal, type CurrencyCode } from '@household/domain'
import type { ScheduledDispatchService } from './scheduled-dispatch-service'
function isValidDay(value: number): boolean {
return Number.isInteger(value) && value >= 1 && value <= 31
@@ -339,7 +340,8 @@ function normalizeAssistantText(
}
export function createMiniAppAdminService(
repository: HouseholdConfigurationRepository
repository: HouseholdConfigurationRepository,
scheduledDispatchService?: ScheduledDispatchService
): MiniAppAdminService {
return {
async getSettings(input) {
@@ -531,6 +533,10 @@ export function createMiniAppAdminService(
throw new Error('Failed to resolve household chat after settings update')
}
if (scheduledDispatchService) {
await scheduledDispatchService.reconcileHouseholdBuiltInDispatches(input.householdId)
}
return {
status: 'ok',
householdName: household.householdName,