Skip to content

Move businessrules app under backend/businessrules #6778

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

Open
wants to merge 16 commits into
base: issue-6769
Choose a base branch
from

Conversation

pashiav
Copy link
Contributor

@pashiav pashiav commented Jun 25, 2025

Fixes #6777

This PR reorganizes the project structure by moving the businessrules app into a new backend/businessrules/ directory under specifyweb/.

Summary of Changes:

  • Moved businessrules to specifyweb/backend/businessrules/
  • Updated all import paths to reflect the new location:
    • businessrules/migrations
    • businessrules/tests
    • businessrules/rules
    • specify
    • workbench
  • Updated SPECIFY_APPS in settings.py to include specifyweb.backend.businessrules

This is the 13th PR in a broader backend reorganization. No frontend behavior or functionality was changed.

Notes:

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests
  • Add a reverse migration if a migration is present in the PR

Testing instructions

Relevant Documentation: Uniqueness Rules & Business Rules

Please cross check the following functionalities with main:

  • General Business Rules testing (additional gen testing in addition to the ones below)

    • Create a new Accession
    • Add an Accession Agent, but do not fill in the fields (Agent/Role)
    • Click on the Save button
    • Verify that save is blocked and a Field is required. points to a required empty field
    • Ensure that save blockers work the same as main on other tables (e.g. Taxon, Collection Object)

    • Go to Schema Config -> Choose any table
    • Configure a new Uniqueness Rule (Note: Don't set scope to 'Created by agent' - it is not handled properly)
    • Attempt to create duplicate records that violate the uniqueness constraints
    • Verify that the rule is respected and behavior is identical to main

@pashiav pashiav added this to the 7.12.0 milestone Jun 25, 2025
@pashiav pashiav self-assigned this Jun 25, 2025
@github-project-automation github-project-automation bot moved this to 📋Back Log in General Tester Board Jun 25, 2025
@pashiav pashiav linked an issue Jun 25, 2025 that may be closed by this pull request
@pashiav pashiav changed the title Move businessrules under backend/businessrules Move businessrules app under backend/businessrules Jun 25, 2025
@pashiav pashiav marked this pull request as ready for review June 25, 2025 19:20
@pashiav pashiav requested review from CarolineDenis and a team June 25, 2025 19:20
@pashiav pashiav added Migration Prs that contain migration and removed Migration Prs that contain migration labels Jun 25, 2025
Copy link
Collaborator

@bhumikaguptaa bhumikaguptaa left a comment

Choose a reason for hiding this comment

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

[X] General Business Rules testing
- [X] Verify that save is blocked and a Field is required. points to a required empty field
- [X] Ensure that save blockers work the same as main on other tables (e.g. Taxon, Collection Object)
- [X] Verify that the rule is respected and behavior is identical to main

Works as expected!

@pashiav pashiav requested a review from a team July 2, 2025 18:18
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • General Business Rules testing (additional gen testing in addition to the ones below)
    • Verify that save is blocked and a Field is required. points to a required empty field

    • Ensure that save blockers work the same as main on other tables (e.g. Taxon, Collection Object)

    • Verify that the rule is respected and behavior is identical to main


Issues:

  • If you add accession agents but don't fill out the fields you can't save but the save button also doesn't turn red. This happens in seemingly all other forms if you don't fill out the required field the field turns red but the save button stays orange.

Issue branch:

07-03_10.21.mp4

Main:

07-03_10.22.mp4
  • Similarly there is also no save blocker if you uncheck 'is current' under determination on the CO form so you can save without a current determination.

Issue branch:

07-03_10.28.mp4

Main:

07-03_10.29.mp4
  • There is an issue with uniqueness rules where sometimes you can save an invalid form (possibly related to #4800 but does not happen in main) also could be related to the save blocker issues I mentioned above.

Issue branch:

07-03_10.36.mp4

Crash report: Specify 7 Crash Report - 2025-07-03T15_36_57.593Z.txt

Main:

07-03_10.37.mp4

@github-project-automation github-project-automation bot moved this from 📋Back Log to Dev Attention Needed in General Tester Board Jul 3, 2025
@pashiav
Copy link
Contributor Author

pashiav commented Jul 16, 2025

@emenslin thanks for your review! All issues should be fixed now - please try it out again!

@pashiav pashiav requested a review from emenslin July 16, 2025 17:10
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • General Business Rules testing (additional gen testing in addition to the ones below)
    • Verify that save is blocked and a Field is required. points to a required empty field
    • Ensure that save blockers work the same as main on other tables (e.g. Taxon, Collection Object)
    • Verify that the rule is respected and behavior is identical to main

Looks good, all behavior seems to be identical to main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Dev Attention Needed
Development

Successfully merging this pull request may close these issues.

Reorganize businessrules app under backend/businessrules/
4 participants