-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement claim revisions on claim form #508
Conversation
04be47a
to
7e10084
Compare
fd08e16
to
c9b9315
Compare
Deployments
|
c9b9315
to
5d19193
Compare
5d19193
to
e9fc22b
Compare
e9fc22b
to
5033f1c
Compare
5033f1c
to
59ec911
Compare
59ec911
to
5eba415
Compare
end | ||
|
||
def authorize_claim | ||
authorize @claim || Claims::Claim | ||
end | ||
|
||
def create_revision? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be duplicated in a few places. Could we put this into a concern or service to DRY it up?
After discussion, we've decided to try a different approach. |
e6cadba
to
f15f39b
Compare
f15f39b
to
80b38e8
Compare
80b38e8
to
b218e8a
Compare
b218e8a
to
3e640c6
Compare
@@ -0,0 +1,28 @@ | |||
class Claims::Claim::UpdateDraft < Claims::Claim::CreateDraft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This service does the same btw 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it 👍🏻
3e640c6
to
6952488
Compare
claim record on the check page when creating a claim. Issues were found when the user would click the back buttons to go back to the check page after completing half their changes. The changes they did were being saved. Even if they backed off from doing them. To solve this issue and many others, we are implementing a revision system on the claim. Creating a revision every time a user wants to edit a claim from the check page. If they back off half way through their changes we revert back to the last valid claim revision. This implementation will increase the audit records and possibly pollute some of them with `system changes` i.e. changes to `previous_revision_id` or `next_revision_id` which the user doesn't care about. For the draft claim This should fix the issue where a support user edits a draft claim and with every edit, the draft claim is updated for everyone. This will only `update` the draft claim when the support user actually clicks `Update claim`. They way this works is by using the `internal_draft` status. A generated revision starts with `internal_draft` as its status and is changed to draft when the support user finishes editing the draft claim. The previous revision is then set to `internal_draft`, to not show more than 1 claim per reference.
6952488
to
0682645
Compare
Context
In testing the claim form we concluded that we cannot edit the same claim record on the check page when creating a claim.Issues were found when the user would click the back buttons to go back to the check page after completing half their changes. The changes they did were being saved. Even if they backed off from doing them.
To solve this issue and many others, we are implementing a revision system on the claim.
Creating a revision every time a user wants to edit a claim from the check page. If they back off half way through their changes we revert back to the last valid claim revision.
This implementation will increase the audit records and possibly pollute some of them with
system changes
i.e. changes toprevious_revision_id
which the user doesn't care about.This should fix the issue where a support user edits a draft claim and with every edit, the draft claim is updated for everyone.
The way this works is by using the
internal_draft
status. A generated revision starts withinternal_draft
as its status and is changed to draft when the support user finishes editing the draft claim. The previous revision is then set tointernal_draft
, to not show more than 1 claim per reference.Changes proposed in this pull request
Claim model
Claim form
Claim support form
Guidance to review
Normal User:
Support User:
Do the same things as the normal user
Edit a draft claim
Edit a draft claim and click back buttons
Your changes to the draft claim should only be saved after you click
Update claim
Screenshots
Peek.2024-04-24.11-00.mp4