mirror of
https://github.com/grassrootseconomics/farmstar-survey-backend.git
synced 2024-12-21 15:07:32 +01:00
37 lines
736 B
Go
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()
|
|
}
|