KEMBAR78
Handle edits before snapshots · Issue #5262 · rubyforgood/human-essentials · GitHub
Skip to content

Handle edits before snapshots #5262

@cielf

Description

@cielf

Summary

Disallow changes to eventables that will result in changes to inventory levels if the original entry date is before the latest snapshot.

Why

We want to ensure that we can keep the performance levels high. When we check levels, we run the events from the last snapshot. We had the option of cutting it off or writing a lot of special code to adjust for changes before the snapshot. Recent analysis indicates that we are only seeing changes more than 6 months ago that are not inventory impacting, but we want to enforce this. (Note: this is with the exception of a case where the goods were lost in shipment, which we didn't have a way to properly handle -- there is a separate issue in the works for that.)

Details

If someone is updating a donation, purchase,or distribution from before the latest snapshot, they will only be able to change the non-inventory changing aspects (e.g. status, comments, date, agency rep) can only change
No user will be able to delete purchases, donations, or transfers that are from before the latest snapshot.
No user will be able to reclaim distributions from before the latest snapshot

If someone is editing a purchase/distribution/donation from before the snapshot, we can merely show the contents, but we should also add a message saying that we do not allow changes to the levels more than 6 months in the past.

When these items are saved, they will not update the inventory history (will not appear in the history report).

Note: There will be a follow-on issue once this is in place to create snapshots 6 months back.

Criteria for completion

  • Changes as described
  • automated tests to support said changes
  • We're going to have to add a bit to the user guide on this as well -- a 1 sentence 'note' on each of purchases, donations, and distributions should do.

Additional note

This will require functional testing based on production data, as the seed is not set up to have data pre snapshot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions