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-4215 Write migration to add columns to product table and create update APIs #3200

Conversation

kathyavini
Copy link
Collaborator

@kathyavini kathyavini commented Apr 30, 2024

Description

These are the backend updates to the product table and routes

  • n, p, k, and npk_unit columns added
  • some minimal schema validation on the above
  • cleaning up the completely unused POST endpoint on /product and adding a new PATCH
  • permissions update: since adding product via the task routes (using the project.js middleware) has been available to all users, the same will now be done for POST and PATCH directly on the product routes
  • following the pattern (which I really liked!) from LF-4152: Update add animals and batches APIs #3178, all validation on POST and PATCH content is in middleware (checkProductValidity.js)
  • updated API tests

Jira link: https://lite-farm.atlassian.net/browse/LF-4215

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?

  • 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

@kathyavini kathyavini requested review from a team as code owners April 30, 2024 15:31
@kathyavini kathyavini requested review from SayakaOno and removed request for a team April 30, 2024 15:31
@kathyavini kathyavini self-assigned this Apr 30, 2024
@kathyavini kathyavini added the enhancement New feature or request label Apr 30, 2024
@kathyavini kathyavini marked this pull request as draft April 30, 2024 15:32
@kathyavini kathyavini marked this pull request as ready for review April 30, 2024 18:05
Forgot to include this in the down function
Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

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

Looks great! Left one minor comment :)

Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

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

Looks good!

@SayakaOno SayakaOno added this pull request to the merge queue May 1, 2024
Merged via the queue into integration with commit 803a58f May 1, 2024
5 checks passed
SayakaOno added a commit that referenced this pull request Jun 24, 2024
…add-columns-to-product-table-and-create-update-ap-is

LF-4215 Write migration to add columns to product table and create update APIs
SayakaOno added a commit that referenced this pull request Jun 25, 2024
…add-columns-to-product-table-and-create-update-ap-is

LF-4215 Write migration to add columns to product table and create update APIs
SayakaOno added a commit that referenced this pull request Jun 25, 2024
…add-columns-to-product-table-and-create-update-ap-is

LF-4215 Write migration to add columns to product table and create update APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants