PFM63 pricing

This commit is contained in:
2025-06-16 13:01:59 +02:00
parent b422c8adc3
commit 53d3a7f51f
6 changed files with 421 additions and 67 deletions

View File

@@ -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
}