PFM63 pricing
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package pricing
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/paulmach/orb/geojson"
|
||||
)
|
||||
|
||||
type PricingService interface {
|
||||
Prices(vars map[string]any) (map[string]Price, error)
|
||||
Prices(params PricingParams) (map[string]Price, error)
|
||||
}
|
||||
|
||||
func NewPricingService(implementation string) (PricingService, error) {
|
||||
@@ -17,3 +21,32 @@ func NewPricingService(implementation string) (PricingService, error) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
type PricingParams struct {
|
||||
MobilityType string
|
||||
SharedMobility SharedMobilityParams
|
||||
Beneficiary BeneficiaryParams
|
||||
Data map[string]any // other data (specific)
|
||||
}
|
||||
|
||||
type SharedMobilityParams struct {
|
||||
DriverDistance int64
|
||||
PassengerDistance int64
|
||||
Departure GeographyParams
|
||||
Destination GeographyParams
|
||||
OutwardOnly bool
|
||||
}
|
||||
|
||||
type BeneficiaryParams struct {
|
||||
Address GeographyParams
|
||||
Priority bool
|
||||
History int
|
||||
}
|
||||
|
||||
type GeographyParams struct {
|
||||
Location *geojson.Feature
|
||||
CityCode string // INSEE code
|
||||
IntercommunalityCode string // SIRENnumber
|
||||
RegionCode string
|
||||
DepartmentCode string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user