mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 01:54:03 +00:00
feat(bot): add self-hosted scheduled dispatch support
Co-authored-by: claw <stanislavkalishin+claw@gmail.com>
This commit is contained in:
@@ -86,6 +86,7 @@ export interface ScheduledDispatchService {
|
||||
cancelAdHocNotification(notificationId: string, cancelledAt?: Instant): Promise<void>
|
||||
reconcileHouseholdBuiltInDispatches(householdId: string, asOf?: Instant): Promise<void>
|
||||
reconcileAllBuiltInDispatches(asOf?: Instant): Promise<void>
|
||||
listDueDispatches(input?: { asOf?: Instant; limit?: number }): Promise<readonly ScheduledDispatchRecord[]>
|
||||
getDispatchById(dispatchId: string): Promise<ScheduledDispatchRecord | null>
|
||||
claimDispatch(dispatchId: string): Promise<boolean>
|
||||
releaseDispatch(dispatchId: string): Promise<void>
|
||||
@@ -307,6 +308,14 @@ export function createScheduledDispatchService(input: {
|
||||
}
|
||||
},
|
||||
|
||||
listDueDispatches(inputValue) {
|
||||
return input.repository.listDueScheduledDispatches({
|
||||
dueBefore: inputValue?.asOf ?? nowInstant(),
|
||||
provider: input.scheduler.provider,
|
||||
limit: inputValue?.limit ?? 25
|
||||
})
|
||||
},
|
||||
|
||||
getDispatchById(dispatchId) {
|
||||
return input.repository.getScheduledDispatchById(dispatchId)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user