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

Lf 4380 api route for edit update route for edit animal and batch details #3484

Draft
wants to merge 20 commits into
base: integration
Choose a base branch
from

Conversation

Duncan-Brain
Copy link
Collaborator

@Duncan-Brain Duncan-Brain commented Sep 27, 2024

Description

SUGGESTION: Follow the commits, most of code changes are copied test templates

Notes:

  • found myself copying hundreds of lines of code I didn't fully understand from create middleware to edit middleware
    • In order to reuse those hundreds of lines had to use throw syntax as return res.send does not work nested in a reusable function
  • ~700 LOC is just copied tests, most of the other 700 is just consolidating two different middleware files

TODO:

  • handle new types and new breeds - nulling out ovewritten changed
  • batch count and sex detail?
    • sex detail has no constraints allowing multiple batch_id, sex_id
    • managing count and sex detail count changes
  • animal use
  • origin_id
    • if edited then brought in date nulled?

Jira link: LF-4380

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

Essentially seems to be working. Groups needs to be provided in obect format not array of ids.

TODO check identifier what happens on edit.
…quests

To do:
- fix orgiin_id being editable
- sex detail has no constraints on multiple batch_id sex_id combination
- handle new types and breeds on animals and batches
- handle verifying count when sex details change and vice versa
- change utility functions to use positive language versus negating the language
- commetns will be removed at the end
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.

1 participant