CSR-LC / csr-be

Back-end application for CSR project
0 stars 1 forks source link

The blocked status is not automatically removed when the block period ends. #86

Open elenalshv opened 3 months ago

elenalshv commented 3 months ago

Steps to Reproduce the Bug:

  1. Log in.
  2. Navigate to the "Equipment" section.
  3. Click on the "Block" button. A modal window titled "Equipment blocking" appears.
  4. Select the block dates.
  5. Click the "Block" button.
  6. The equipment status changes to "Blocked."
  7. After the block period ends, the "Blocked" status should automatically change to "Available."
wvxiw8 commented 3 months ago

@IanaVagner @ZharIvan Is unblocking really done automatically or a manager must confirm unblocking and do it manually?

IanaVagner commented 3 months ago

@IanaVagner @ZharIvan Is unblocking really done automatically or a manager must confirm unblocking and do it manually?

We have two possible scenarios:

-Automatic unblocking occurs after the block period expires. -Manual unblocking occurs at the user's discretion. If it is necessary to cancel the block in the future or to end the block period immediately, the user can use the "Unblock" button for these purposes.

wvxiw8 commented 2 months ago

@IanaVagner what should we do with orders which have been waiting for the equipment to be unblocked?

When we were blocking the equipment we checking if it has orders within current time and status "prepared" or "approved". Then we set to those orders the new status "Blocked". So we loose the previous status of the orders.

Currently the UnblockEquipment() (it's not the same function as for the issue, there will be another function for unblocking expired blockings) doesn't do anything with the blocked orders for the blocked equipment, so this might be kind of a resource leak. Are such blocked orders managed manually? If so, will we also manage them manually in this case and just leave "blocked"?

wvxiw8 commented 1 month ago

@ZharIvan maybe you can provide some info about my previous question

wvxiw8 commented 1 month ago

@ZharIvan @IanaVagner
We have a configured variable for a time interval to periodically check for overdue - OrderStatusOverdueTimeCheckDuration. I think we can use the same period to check for expired blockings, can we? I can rename the variable to something like PeriodicalCheckDuration. Or do we need to use a separate variable for it?

wvxiw8 commented 1 month ago

Concerning my questions above we decided to 1) Do not do anything with orders for equipment which blocking period expired. This will be a manual operation (after calling to customers) 2) Have a common configuration variable for periodical checkings

elenalshv commented 1 month ago

The reservation for one day, the entry should be from 00:00:00 to 23:59:59 on the same day, at 00:00:00 the next day the blocking should be automatically canceled.