CS2103-AY1819S2-T12-3 / main

MediTabs: Medicine Stock Taking Application
https://cs2103-ay1819s2-t12-3.github.io/main/
MIT License
2 stars 4 forks source link

Suggestion: Add a way to retrieve the exact medicine batch number which is low in stock or expiring soon #105

Closed JonathanLeeWH closed 5 years ago

JonathanLeeWH commented 5 years ago

Suggestion: Possible to add a way to retrieve the exact medicine batch number which is low in stock or expiring soon as it would be good to have a method that does so as to not have to keep reimplementing the same implementation for example thresholds etc to check which medicine and exactly which batch is expiring soon or low stock?

It would also make for easier integration by other commands such as the export command as the data could be collated and organised in the exported csv file since each medicine can have multiple batches and it would be useful to have a method which shows which medicine and also which exact batch number is expiring soon or low in stock.

As currently, I think based on the source code in ModelManager I can get the medicines which are expiring soon or low in stock but I cannot tell the exact batch which is expiring soon or low in stock without actually reimplementing the same checks done in checking and displaying the warning panel.

This is just a suggestion as I have not found a better way to integrate it.

jtankw3 commented 5 years ago

Sure we can easily add getExpiringBatches() and getLowQuantityBatches() to the Medicine class. I'll get it done by this week.

flxffy commented 5 years ago

I can add the batch number to the list of expiring medicines when they are displayed on the warning panel.

However, is it necessary to have batch numbers for medicine with low quantity? Since there could be multiple small batches of the same medicine, but the total quantity of the medicine is more than sufficient to warrant it being labelled as "low in stock".

JonathanLeeWH commented 5 years ago

@flxffy Good point I think it is indeed true that low stock for a particular batch does not make sense since company do not repeat manufacturing the same batch with the same batch number as the point of the batch is to be unique so when we purchase new stock it will be a new batch number. I think maybe for low stock you can do as you suggested which is to find the total of all the quantities of all the batches of a particular medicine and from them come up with the threshold number and if it is below the threshold then just display the name.

If that is the case, I think for my csv file data organisation for low stock, since I separate particular medicine with different batches on different lines due to the requirement to show the expiry date of each individual batches, I will just add low stock next to all the medicine regardless of their batch for the medicine which is low stock as the low stock refers to the medicine as a whole.

For the expiring medicines, I think including the batch number besides the medicine itself would be good. Thank you.

Thank you for pointing it out and also thank you @jtankw3 for planning to add the additional method.

JonathanLeeWH commented 5 years ago

Completed PR #121 by @flxffy and integrated with Export Command in PR #122 by me