Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring custom pricing plans should be documented #258

Open
hbruch opened this issue Sep 13, 2023 · 3 comments
Open

Configuring custom pricing plans should be documented #258

hbruch opened this issue Sep 13, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@hbruch
Copy link
Collaborator

hbruch commented Sep 13, 2023

Lamassu supports the cofiguration of custom pricing plans.

How to do this (an example is provided in this PR), and when this would be useful, should be documented.

I.e. it is unclear to me, if it is used to overwrite/redefine existing pricing information, e.g. because they are outdated, should be better described etc., or if it is also possible to augment feeds which don't provide pricing plans at all. In this case: are vehicle_types augmented by default pricing plans (which one then) or should the be redefined in the config also? Do these defined vehicle types overwrite the original vehicle_types info or are they merged in some way?

@testower
Copy link
Collaborator

I added support for providing vehicle types and pricing plans via the configuration as an escape hatch to deal with low quality data feeds at the early beginning of this project. I actually never intended for it to be a permanent feature, so perhaps hence the lack of clarity / documentation on it. I agree that if we intend to keep it, it should be documented properly.

As you'll see in the feed mappers:

https://github.com/entur/lamassu/blob/master/src/main/java/org/entur/lamassu/mapper/feedmapper/VehicleTypesFeedMapper.java#L44

and

https://github.com/entur/lamassu/blob/master/src/main/java/org/entur/lamassu/mapper/feedmapper/SystemPricingPlansFeedMapper.java#L47

if these are provided in the configuration for that system, any existing feed data will be completely replaced, both in the gbfs endpoints and in the aggregated graphql api. So there is no attempt to merge with existing data.

In this case: are vehicle_types augmented by default pricing plans (which one then) or should the be redefined in the config also?

Not automatically, no. But you can of course define it yourself. So to use your own example (trimmed down a bit):

lamassu:
  providers:
    - systemId: lime_zu
      operatorId: LME:Operator:lime
      operatorName: Lime
      codespace: DKY
      url: "https://data.lime.bike/api/partners/v2/gbfs/zug/gbfs.json"
      language: en
      vehicleTypes:
        - vehicleTypeId: TestVehicleType
           defaultPricingPlanId: TestPlan
           ....
      pricingPlans:
        - planId: TestPlan
          name: TestPlan
          ...

@hbruch
Copy link
Collaborator Author

hbruch commented Sep 13, 2023

Ok, and in case vehicle types are defined in config, free bikes are assigned the first vehicle type so this would work for single vehicle type systems, right?

Would be interesting to know, how many feeds in systems.csv have no vehicle types defined. Depending on that, we could decide about documentation/removal. It could be versatile in some use cases, as it's a very light weight way to fix incomplete feeds.

@testower
Copy link
Collaborator

Ok, and in case vehicle types are defined in config, free bikes are assigned the first vehicle type so this would work for single vehicle type systems, right?

Correct!

The problem for me is that it is manual work. Especially for pricing, which tends to be very dynamic at least around here, it very quickly becomes outdated. But I won't object to making it an "official" feature if you need it :)

@testower testower added the documentation Improvements or additions to documentation label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants