Skip to content
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

AP-4380: Add copy case feature #5895

Closed
wants to merge 5 commits into from
Closed

Conversation

jsugarman
Copy link
Contributor

@jsugarman jsugarman commented Oct 20, 2023

What

Add copy case feature

Link to story

The ability to copy case details from one application to another
is considered a prerequisite for the linking cases feature.

TODO

  • do we really need the copy_case boolean attribute to be stored - try to use un-persisted option
  • prevent or validate against "finding" of applications that are from other firms
  • prevent or validate against "finding" of applications that are not submitted
  • add the actual copying of the case
  • consider state and step to leave case in after copy
  • consider ability to amend substantive cost limitation and delegated function cost limitation
  • elements from the legal aid application that relate to substantive and emergency costs may/will need to be copied over too - see *1

*1

# legal_aid_application attributes that are derived from proceedings
# and will therefore require copying too
t.boolean "emergency_cost_override"
t.decimal "emergency_cost_requested"
t.string "emergency_cost_reasons"
...
t.boolean "substantive_cost_override"
t.decimal "substantive_cost_requested"
t.string "substantive_cost_reasons"

Checklist

Before you ask people to review this PR:

  • Tests and rubocop should be passing: bundle exec rake
  • Github should not be reporting conflicts; you should have recently run git rebase main.
  • There should be no unnecessary whitespace changes. These make diffs harder to read and conflicts more likely.
  • The PR description should say what you changed and why, with a link to the JIRA story.
  • You should have looked at the diff against main and ensured that nothing unexpected is included in your changes.
  • You should have checked that the commit messages say why the change was made.

@jsugarman jsugarman force-pushed the ap-4380/copy-case-spike branch from dcc8c81 to 48f3bdc Compare October 23, 2023 10:07
To store answer to question "Copy an application to your application?"
inline with designs.
Add controller form and view to ask the user
if they want to copy an existing application to this
one.
Use deep_clonable. This is one option, amoeba being
another.
Required and used as an example of using
deep clone to copy nested associations.
@jsugarman jsugarman force-pushed the ap-4380/copy-case-spike branch from ef53de6 to 87ea245 Compare October 24, 2023 15:23
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@kmahern kmahern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I think this branch meets the criteria for "agreed approach for copying an existing application's detail to a new application". in terms of providing a poc for how to achieve this with the deep_cloneable gem.

It looks like it only tests the copying of proceedings and not other application associations like dependants or opponents.

I do think there are some concerns about how well the deep_cloneable gem is supported but this is probably also true of alternatives (ie amoeba).

@jsugarman
Copy link
Contributor Author

see implmentation branch #5932

@jsugarman jsugarman closed this Nov 1, 2023
@jsugarman jsugarman deleted the ap-4380/copy-case-spike branch November 1, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants