farmstar-survey-backend/internal/hooks/hooks.go
2024-02-05 16:05:28 +03:00

37 lines
736 B
Go

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()
}