We just need to update that file with the actual business logic:
Find all the member bundle requests in the database with an start date in the next 3 days.
Fire the net.veraid.authority.member-bundle-request event for each record and then delete the DB record. Make sure to use the MemberBundleRequest.id as the CloudEvent id, to allow the broker to dedupe events.
Keep in mind that this can be tested with skaffold dev: That sink is triggered every minute.
I already implemented the scaffolding around this in https://github.com/relaycorp/veraid-authority/blob/1ca6f08f5cf18480f969eb7253b5d988f3fd6c8b/src/backgroundQueue/sinks/memberBundleRequestTrigger.sink.ts
We just need to update that file with the actual business logic:
net.veraid.authority.member-bundle-request
event for each record and then delete the DB record. Make sure to use theMemberBundleRequest.id
as the CloudEventid
, to allow the broker to dedupe events.Keep in mind that this can be tested with
skaffold dev
: That sink is triggered every minute.