feat(bot): route purchase dms through confirmation flow

This commit is contained in:
2026-03-11 06:19:14 +04:00
parent b6b6f9e1b8
commit dd243d7edd
5 changed files with 832 additions and 7 deletions

View File

@@ -120,6 +120,7 @@ export type PurchaseProposalActionResult =
}
export interface PurchaseMessageIngestionRepository {
hasClarificationContext(record: PurchaseTopicRecord): Promise<boolean>
save(
record: PurchaseTopicRecord,
interpreter?: PurchaseMessageInterpreter,
@@ -626,6 +627,11 @@ export function createPurchaseMessageRepository(databaseUrl: string): {
}
const repository: PurchaseMessageIngestionRepository = {
async hasClarificationContext(record) {
const clarificationContext = await getClarificationContext(record)
return Boolean(clarificationContext && clarificationContext.length > 0)
},
async save(record, interpreter, defaultCurrency) {
const matchedMember = await db
.select({ id: schema.members.id })