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

34 lines
612 B
Go

package router
import (
"github.com/grassrootseconomics/farmstar-survey-backend/pkg/ussd"
"github.com/pocketbase/pocketbase"
)
type (
Opts struct {
PB *pocketbase.PocketBase
USSDClient *ussd.USSDClient
}
RouterContainer struct {
PB *pocketbase.PocketBase
ussd *ussd.USSDClient
}
)
func NewRouter(o Opts) *RouterContainer {
return &RouterContainer{
PB: o.PB,
ussd: o.USSDClient,
}
}
func (r *RouterContainer) Bootsrap() {
r.bootstrapRegistrationRoute()
r.bootstrapFarmerSurveyRoute()
r.bootstrapTransactionRoute()
r.bootstrapDistributorRoute()
r.bootstrapRedeemRoute()
}