You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want an admin to able run the Cow Health Update Job so that cows get killed off everytime the Cow Health Update job runs according to the logic outlined in step 3.
Discussion
NEED TO UPDATE ISSUE: don't think we need all of these endpoints
Note that a backend entity called CowDeath and a new repository called CowDeathRepository exists:
CowDeath.java is where the basic entity is created with variables id, commonsId, userId, ZonedDateTime, cowsKilled, and avgHealth
CowDeathRepository.java is where the basic CRUD repo is
Step 1 (20pts)
Add a CowDeathController with three routes:
POST /api/cowdeath available only to admins, that allows the creation of a new CowDeath entity
GET /api/cowdeath/bycommons available only to admins that takes a commons id, and lists all cow casualties for that commons.
GET /api/cowdeath/byusercommons that takes a commonsId and a userId and lists all cow deaths for that user commons
Acceptance Criteria
Step 1
Test the implemented routes in the CowDeathController using Swagger UI, ensuring the proper functioning and correct response formats.
Perform local testing of each route with various input scenarios, confirming the expected responses and error handling.
Confirm unit tests and integration tests pass for the CowDeathController to confirm proper functionality and appropriate security constraints. Ensure they pass mutation testing.
Implementation Todos
Step 1
Implement a POST route /api/cowdeath in the CowDeathController that allows admin users to create a new CowDeath entity.
Implement a GET route /api/cowdeath/bycommons in the CowDeathController that allows admin users to retrieve cow casualties for a specific commons by providing a commonsId.
Implement a GET route /api/cowdeath/byusercommons in the CowDeathController that retrieves cow deaths for a specific user commons by providing a userId and a commonsId.
Add appropriate security constraints to the routes ensuring that only admin users have access to these endpoints.
Testing:
Back end tests pass and there is adequate coverage
The text was updated successfully, but these errors were encountered:
ashleybudman
changed the title
FEATURE: Cow Death - Creating CowDeathController
FEATURE: Cow Death - Creating CowDeathController (1/3 Routes POST /api/cowdeath)
Jun 5, 2023
Feature Summary
We want an admin to able run the Cow Health Update Job so that cows get killed off everytime the Cow Health Update job runs according to the logic outlined in step 3.
Discussion
NEED TO UPDATE ISSUE: don't think we need all of these endpoints
Note that a backend entity called CowDeath and a new repository called CowDeathRepository exists:
CowDeath.java
is where the basic entity is created with variables id, commonsId, userId, ZonedDateTime, cowsKilled, and avgHealthCowDeathRepository.java
is where the basic CRUD repo isStep 1 (20pts)
Add a CowDeathController with three routes:
Acceptance Criteria
Step 1
Implementation Todos
Step 1
Testing:
The text was updated successfully, but these errors were encountered: