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

eat-api version 2 #12

Merged
merged 12 commits into from
Jan 1, 2020
Merged

eat-api version 2 #12

merged 12 commits into from
Jan 1, 2020

Conversation

COM8
Copy link
Member

@COM8 COM8 commented Nov 1, 2019

This aims to restructure the API to make it easier to get access to all required information at once.

This should address #10.

TODO

  • Remove the mensa-garching.json folder
  • Update to the new prices: https://www.studentenwerk-muenchen.de/mensa/mensa-preise/
    • Mensa Leopoldstraße
    • Mensa Weihenstephan and Mensa Lothstraße
    • Self-Service
  • Check if the Self-Service prices match for mensa-garching with the actual prices displayed on-site: Not perfect, but works.
  • Fix unit tests
  • Change the pricing model to student, staff and guests
  • Update CI/CD
  • Add canteens.json - a list of all canteens with their location Command for all available canteens #3
  • Update README.md to reflect the changes and add example

Examples

The new dish object looks like this:

"dishes": [
    {
        "name": "Ravioli mit Pilzfüllung in pikanter Kräutersauce",
        "prices": {
            "students": {
                "base_price": 1.0,
                "price_per_unit": 0.75,
                "unit": "100g"
            },
            "staff": {
                "base_price": 1.0,
                "price_per_unit": 0.9,
                "unit": "100g"
            },
            "guests": {
                "base_price": 1.0,
                "price_per_unit": 1.05,
                "unit": "100g"
            }
        },
        "ingredients": [
            "Ei",
            "Gl",
            "GlW",
            "Kn",
            "Mi",
            "Sl"
        ],
        "dish_type": "Pasta"
    }
]

And for canteens without different pricing tiers:

"dishes": [
    {
        "name": "Tagessuppe",
        "prices": {
            "students": {
                "base_price": 1.0,
                "price_per_unit": null,
                "unit": null
            },
            "staff": {
                "base_price": 1.0,
                "price_per_unit": null,
                "unit": null
            },
            "guests": {
                "base_price": 1.0,
                "price_per_unit": null,
                "unit": null
            }
        },
        "ingredients": [
            "Gl",
            "Sl"
        ],
        "dish_type": "Tagesgericht"
    },
    {
        "name": "(*) Wirsing-Curry mit Kurkuma CousCous",
        "prices": {
            "students": {
                "base_price": 4.5,
                "price_per_unit": null,
                "unit": null
            },
            "staff": {
                "base_price": 4.5,
                "price_per_unit": null,
                "unit": null
            },
            "guests": {
                "base_price": 4.5,
                "price_per_unit": null,
                "unit": null
            }
        },
        "ingredients": [
            "Gl",
            "Mi",
            "Sl"
        ],
        "dish_type": "Tagesgericht"
    },
    {
        "name": "Pasta Front-Cooking Maccaroni Cheese mit Tomatenstücke",
        "prices": {
            "students": {
                "base_price": 4.9,
                "price_per_unit": null,
                "unit": null
            },
            "staff": {
                "base_price": 4.9,
                "price_per_unit": null,
                "unit": null
            },
            "guests": {
                "base_price": 4.9,
                "price_per_unit": null,
                "unit": null
            }
        },
        "ingredients": [
            "Ei",
            "Gl",
            "Mi",
            "Sf",
            "Sl"
        ],
        "dish_type": "Tagesgericht"
    }
]

@COM8 COM8 added the enhancement New feature or request label Nov 1, 2019
@COM8 COM8 changed the title [WIP] Studentenwerk Prices [WIP] eat-api version 2 Nov 24, 2019
@COM8 COM8 changed the title [WIP] eat-api version 2 eat-api version 2 Nov 24, 2019
@COM8 COM8 added CI All CI related stuff pages GitHub Pages related stuff labels Nov 24, 2019
@COM8 COM8 requested a review from jpbernius November 24, 2019 12:05
@COM8 COM8 self-assigned this Nov 24, 2019
@COM8
Copy link
Member Author

COM8 commented Nov 24, 2019

Once merged we can update GitHub-Pages to the new prices.

@jpbernius
Copy link
Member

This breaks all existing API consumers!

@COM8
Copy link
Member Author

COM8 commented Nov 24, 2019

Yes.

@COM8
Copy link
Member Author

COM8 commented Dec 1, 2019

I created issues for all projects I know about that use eat-api.

The plan is to switch to the new format on the 01.01.2020.
Are there any concerns about that?

@COM8 COM8 mentioned this pull request Jan 1, 2020
@COM8 COM8 merged commit 442c64d into master Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI All CI related stuff enhancement New feature or request pages GitHub Pages related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants