cmoscofian / meliponto

A simple CLI to facilitate punching hours into the ahgora system
MIT License
7 stars 2 forks source link

Fetch previous punches #3

Closed cmoscofian closed 4 years ago

cmoscofian commented 4 years ago

Meliponto - Pull Request

What kind of change does this PR introduces? (Your branch should reflect it...)


Before you push it are you sure that...


Now regarding your changes...

What is the current behavior?

Currently it does not check for previous punches before making new ones, either for day or range commands. Since it does not check for previous punches it does not warn the user and therefore creates possible confusion and duplicate punches defeating the point of this tool.

What is the expected behavior from your changes?

Now it will fetch previous punches from the ahgora system and if there are previous punches within the same period as the user is requesting, it will warn and asks for the user to decide whether or not to make new punches.

[WARNING] You already have 4 punches in this period! Would you like to continue? (y/N) Defaults to NO, so if the user simple presses return the process will stop here. Only with Y it will proceed, therefore is up to an user intentional interaction to proceed.

PS: It will not delete previous punches.


Responsible

@cmoscofian