farmstar-survey-backend/internal/hooks/hooks.go

37 lines
736 B
Go
Raw Permalink Normal View History

2024-02-05 14:05:28 +01:00
package hooks
import (
"github.com/grassrootseconomics/farmstar-survey-backend/internal/worker"
"github.com/pocketbase/pocketbase"
)
type (
Opts struct {
PB *pocketbase.PocketBase
Worker *worker.Worker
RedemptionVault string
}
HooksContainer struct {
pb *pocketbase.PocketBase
worker *worker.Worker
redemptionVault string
}
)
func NewHooks(o Opts) *HooksContainer {
return &HooksContainer{
pb: o.PB,
worker: o.Worker,
redemptionVault: o.RedemptionVault,
}
}
func (r *HooksContainer) Bootsrap() {
r.bootstrapRegistrationHook()
r.bootstrapFarmerHook()
r.bootstrapDistributorHook()
r.bootstrapTransactionHook()
r.bootstrapRedeemHook()
}