Giter Club home page Giter Club logo

lunatech-lunch-planner's Introduction

Build Status

This is the source code for the Lunatech Lunch Planner application

This is a Play Framework 2 application. The application will allow Lunatech do manage friday lunches' menus and the people that are attending those lunches.

To get started:

Set up authentication for github packages

If you have not done so yet you have to configure authentication for github packages, because this app depends on some lunatech provided jars hosted there.

For this you need to generated a github personal access token (https://github.com/settings/tokens) with access to at least the following scope: write:packages.

This can be provided to the build in two ways:

  1. Set the environment variable GITHUB_TOKEN
  2. Configure it in your git config (e.g.: $HOME/.gitconfig) with the following command: git config --global github.token "<your token>"
Compile and run the docker container:

In /dockerdev/postgres run

docker build -t lunatech-lunch-planner .
docker run -it --rm -m 1024m -p 5432:5432 lunatech-lunch-planner
Create configuration override

Create a conf/override.conf file with the following fields:

PLAY_SECRET = xxx

POSTGRESQL_ADDON_HOST = localhost
POSTGRESQL_ADDON_PORT = 5432
POSTGRESQL_ADDON_DB = lunch-planner
POSTGRESQL_ADDON_USER = postgres
POSTGRESQL_ADDON_PASSWORD = password

GOOGLE_CLIENTID = xxx
GOOGLE_SECRET = xxx

SLACK_API_TOKEN = xxx
SLACK_HOST_NAME = xxx

administrators = ["[email protected]"]

Ensure that your database credentials are correct.

Start the app:
sbt run

Make sure the docker image withe the DB is running. Open the browser and you are all set:

localhost:9000
Run the tests:

To run the tests no docker image is necessary, instead an H2 in-memory DB has been set up

New developments

There are two permanent branches: master and clevercloud. All new developments are to be merged in master branch and tested locally and then later deployed by using the clevercloud branch.

Deployment

The lunch-planner is hosted in clever-cloud. The deployment is done by rebasing clevercloud branch onto master branch locally. This rebase will always be a fast-forward one.

Before doing a deployment make sure you have the latest versions of master and production branches. Rebase clevercloud onto master and push it. Clever-cloud will do the deployment automatically.

$ git checkout master
[master]$ git pull
[master]$ git checkout clevercloud
[clevercloud]$ git pull
[clevercloud]$ git rebase master
[clevercloud]$ git push

lunatech-lunch-planner's People

Contributors

arnieel avatar azthec avatar dependabot[bot] avatar eneskorukcu avatar jdijt avatar leo-bogastry avatar lunatech-ops avatar nmoncho avatar scala-steward avatar vijaykiran avatar wjglerum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lunatech-lunch-planner's Issues

Add CRUD functionality for Dishes

A dish has detailed information about the food that will be available and it will be associated with one or more menus
No FE is necessary at this point.

Select location on planned meal

Description

The user should be able to select for a given date only one scheduled meal if there are planning to go to any of the available locations.
For that goal a new column should be added, Location, which shows where it's scheduled.
Also, for UI consistency sake the user should still see a checkbox for the selection, but with the caveat that would only be possible to select only one location per date (this validation should happen on the frontend as well as in the backend).

On why use a checkbox and not a radio button: Certainly a radio button would make things easier on selection, validation wise, since you would be allowed to select only one option. But this has two drawbacks:

  • When there is planed meal for only one location (this is going to be unlikely in the future) a radio button doesn't make sense.
  • On the scenario where you want to erase your selection, for example when you're on holidays but mistakenly selected a date. For which we need other solutions.

Users

Everyone

Depends

On #99

Create API for MenuPerDay

Create endpoint to:

  • add new menu per certain day
  • list all menus for all days available
  • delete a menu for a certain day
  • query menus per day by UUID / menu UUID / date

Create API for MenuDishes

Create endpoints to:

  • add new menu dish
  • list all menu dishes
  • remove menu dish
  • query menu dish by UUID / Menu UUID

Small UI issues with checkboxes

I have noticed that when editing a menu, clicking in the labels of the dishes to select them, selects always the first dish.

To solve this issue check the code for the code for newMenu.scala.html, line 22. An index has to be added!

Check as well if this issue is happening in any other view

Create API for Menu

Create endpoints to:

  • add menu
  • list all menus
  • delete menu
  • query menu by UUID / name

Add keyboard shortcuts

Add a minimum amount of keyboard shortcuts.
Pay attention to do not override any import browser / system shortcut.

Create API for dishes

Create endpoints to

  • add dish
  • query all dishes
  • query dishes by name / UUID
  • query all flags in dishes (IsVegetarian, IsGlutenFree, ..)
  • delete a dish

Remove dead code

The MailerUtils is dead code, not being used. Please remove it

Modify UI to work with locations

(Depends on issue 99)

After adding locations to the lunch planner, modifications in the UI have to be put in place.
One option would be to add a location office to the profile of the user, but the truth is that we want people to be able to easily choose if they are going to Rotterdam or Amsterdam office on different Fridays, so this may not be the best option.

In summary, after adding locations to the app, make it work nice in the UI 😄

Add locations

Description

The user should be able to define where a 'scheduled meal' is going to happen.
When creating an new 'scheduled meal' the user should see a dropdown with just two options:

  • Amsterdam
  • Rotterdam

The selection must be mandatory.

Users

  • Admin

=================================================================

Lunatech is growing and lunch has to be organised for more than one office on Fridays.
The current version does not have the notion off a location for the planned meals.

For admin users, add the possibility to add / modify locations.

The option to delete can also be added, but at least add a confirmation dialog to it.

Synchronisation between lunch and vacations app

@dirkjonker gave the idea of synchronising the lunch and vacation apps!
We don't want the user to lose any previous choices, so i think this features has to be user-proactive.

A simple button that allows the user synchronise both apps. If the user is on vacation a certain Friday, then the attendance should be set automatically to "Not attenting". Simple! Simple!

TODO: check with the vacation app people if this can be done

Create google api credentials using the Lunatech account

The current google api credentials, in order to use the Google Authorisation are linked to my lunatech email account!

Contact Sietse/ Erik Bakker in order to find out to who can create these credentials in a lunatech "general" account and modify it on the clever cloud env variables.

Default lunch-option

It would be nice to have an option to have some lunch option selected by default.
For example the option for which there were the most votes.
And only not to get lunch if you select option ‘no lunch’.

Add a user profile

Add a user profile separator that allows the user to add information about diet restrictions:

  • is vegetarian
  • does not eat sea food
  • does not eat pork
  • does not eat beef
  • does not eat chicken
  • does not eat gluten
  • does not eat lactose

If more than one menu in same day allow only one choice

The administrator has added more than one menu for the same day hoping that people would choose only one of those menus (for the same day), but the app allows the user to choose for more than one menu in the same day.
Add a validation that does not allow this and explains the user that is case of more than one menu in the same day only one can be selected

Create API for MenuPerDayPerPerson

Create endpoint to:

  • add new menu per certain day for person
  • list all menus for all days and persons available
  • delete a menu for a certain day for person
  • query menus per day per person by UUID / menu per day UUID / user UUID

Monthly Reports by Location

Now that the lunch app supports meals at different locations, this need to be reflected in the monthly reports.
The organization of the information is an open point. You can ask Shelley what is her preference

Monthly reports

I would really appreciate a monthly report with the total amount of people who have had lunch. This is for tax purposes.

Make use of Slack to remind and ask users if they're attending lunch.

This is related to #95, #75.

The idea is to create a Slack bot to remind users (via direct message) and ask them is they'll be attending the lunch or not. This will give the convenience for users to decide via Slack and by not going to the lunch app. This will also give better tracking and better data for the monthly report.

Lunch bot specs:

  1. Will remind all user (who have not responded yet) to make a decision whether they'll attend or not
  2. Reminder will be every Tuesdays and Thursday (10 AM)
  3. Choices are: "YES, I'll attend" and "NO, I will not attend"
  4. Will state that user can still change decision by going to lunch web-app
  5. Bot will state the menu and location
  6. If there are more than 2 locations for one day, the choices will be: "YES to Amsterdam", "YES to Rotterdam" and "NO, I will not attend"

Feel free to add, edit the bot specs.

Replace hard delete of data by soft delete

When the Lunch app was created it was not known that reports about who attended a meal were necessary. Because of this whenever data is deleted, a hard delete takes places.

Issue: Reports of past months have little data, it's known that more people have attended the meals. Data has disappeared.

Resolution: Let's created a "Deleted" column in the BD that will just mark the data as deleted.

Currently when, for example, a dish is deleted, all related data is deleted as well because of foreign keys in the BD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.