Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/paypal

src/scheduled-reimbursement-scan.ts

14 lines · 462 B · TypeScript
import { searchInvoicesForReimbursement } from './reimbursements.ts'

/**
 * No-argument scheduled wrapper. Scans recent invoices and incoming
 * transactions for reimbursement matching. The job is disabled by default.
 */
export default async function scheduledReimbursementScan() {
	const end = new Date()
	const start = new Date(end.getTime() - 7 * 24 * 60 * 60 * 1000)
	return await searchInvoicesForReimbursement({
		startDate: start,
		endDate: end,
	})
}