slippy-idk / Smart-cashOS

My funny cash register OS
1 stars 3 forks source link

The Employee menu is printing out twice #9

Closed slippy-idk closed 1 month ago

slippy-idk commented 1 month ago

What is the expected behavior? For the menu to print out only once once sale is ended

What is the actual behavior? the menu is printed out twice but it still able to continue running and take inputs after ending sales

Please provide a unit test that demonstrates the bug. End the users sale

Other notes on how to reproduce the issue? Please provide JSON protocol traces and log files. What would you like to do 1: Start Sale END: end your shift on console You entered the Wrong character try again What would you like to do 1: Start Sale END: end your shift on console ENd You have worked this amount of Hours 0 You Gross Earnings is 21.5

Any possible solutions? look into a correct break command Can you identify the location in the driver source code where the problem exists? at line 177 and below

Sir-Cleetus commented 1 month ago

Taking a look at this if that's alright.

Sir-Cleetus commented 1 month ago

Think I've managed to sort it as there seems to be no looping. Was able to get this output and it seems to be the behaviour you want. If your happy, I'll make a PR.

What user would you like to login as
1: Employee
2: Administrator
1

Please enter your name
example

What would you like to do
1: Start Sale
END: end your shift on console
1

What is the Amount of Money Paid
Enter 0 to END sales
0

What would you like to do
1: Start Sale
END: end your shift on console
end

You have worked this amount of Hours
0
You Gross Earnings is
0.0

What user would you like to login as
1: Employee
2: Administrator
slippy-idk commented 1 month ago

This is great and fixes the issue but now does not display a error message for an incorrect input i will look into fixing this, thank you very much this should be ready to be closed soon and merged

Sir-Cleetus commented 1 month ago

Sorry, my bad, I seemingly removed the prompt. Added it back so we get the wanted behaviour.

What user would you like to login as
1: Employee
2: Administrator
1

Please enter your name
example

What would you like to do
1: Start Sale
END: end your shift on console
3

You entered the wrong character try again
What would you like to do
1: Start Sale
END: end your shift on console
end

You have worked this amount of Hours
0
You Gross Earnings is
0.0

What user would you like to login as
1: Employee
2: Administrator

Is this good for a PR?

slippy-idk commented 1 month ago

Yep that is perfect thank you very Much I will pull it now