mirror of
https://github.com/grassrootseconomics/farmstar-survey-backend.git
synced 2024-11-19 00:16:45 +01:00
34 lines
612 B
Go
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()
|
||
|
}
|