Happy Pet is a web-based project for veterinary practice management
Developed by Juan Bernal (@bernalcodes) and Andrés Sanabria (@80asv)
Minuto de Dios University Corporation, 2023
- Plan project
- Define style guides
- Define UI
- Define stack
- Model data
- Design app architecture
- Design tests
- Develop local demo
- Test local demo
- Deploy demo
- Test deployed demo
- All requests must include the header
Authorizationwith the value of a bearer token (such asBearer {tokenString})
- To log into a user account the provided endpoint is
/login - The request should be made via
POSTmethod using the following JSON:{ "email": "customer_test", "password": "customer_test" } - The expected response should look like this:
- Success:
{ "id": "21911b48-8a0e-4352-8b65-4c1b9798fdcb", "enabled": true, "authorities": [], "credentialsNonExpired": true, "accountNonExpired": true, "accountNonLocked": true, "username": "customer_test", "Authorization": "Bearer {tokenString}" } - Failure:
403 UNAUTHORIZED
- Success:
- There are available the following endpoints per operation:
CREATE/users/newviaPOSTmethod with the following request body:- Customer-type User.
{ "userDetails": { "email": "customer_test", "password": "customer_test", "role": "CUSTOMER", "profile_pic": "{base64String}" }, "personDetails": { "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "customer_test@test.com", "address": "Test Address for Test Customer" } } - Veterinary-type User.
{ "userDetails": { "email": "veterinary_test", "password": "veterinary_test", "role": "VETERINARY", "profile_pic": "{base64String}" }, "personDetails": { "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "veterinary_test@test.com", "professional_card": "123456789" } } - No-type User.
{ "userDetails": { "email": "user", "password": "password", "role": "", "profile_pic": "{base64String}" } } - The expected response should look like the following:
- Success:
User was created successfullywith201 CREATED - Failure:
There was an error creating the userwith500 INTERNAL SERVER ERROR
- Success:
- Customer-type User.
READ/users/{userId}viaGETmethod- The expected response should look like the following
- Success (with
200 OK):- Customer-type user:
{ "id": "{userId}", "email": "customer_test", "password": "{encryptedUserPassword}", "role": "CUSTOMER", "profile_pic": "{base64String}", "customer_details": { "id": "{customerId}", "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "customer_test@test.com", "address": "Test Address for Test Customer" } } - Veterinary-type user:
{ "id": "21911b48-8a0e-4352-8b65-4c1b9798fdcb", "email": "customer_test", "password": "{encryptedUserPassword}", "role": "CUSTOMER", "profile_pic": "{base64String}", "vet_details": { "name": { "id": "{vetId}", "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "veterinary_test@test.com", "professional_card": "123456789" } } - No-type USer:
{ "id": "{userId}", "email": "customer_test", "password": "{encryptedUserPassword}", "role": "CUSTOMER", "profile_pic": "{base64String}" }
- Customer-type user:
- Failure:
Requested user was not foundwith404 NOT FOUND
- Success (with
- The expected response should look like the following
/users/allviaGETmethod- The expected response should be the following:
- Success: A list of User-type objects with
200 OK - Failure:
No users foundwith404 NOT FOUND
- Success: A list of User-type objects with
- The expected response should be the following:
UPDATE/usersviaPUTmethod- The body of the request is the same as of the creation of a user without the
personDetailsfield - The value of the userId will remain constant for the update process to work
{ "userDetails": { "id": "{userId}", "email": "user", "password": "password", "role": "", "profile_pic": "{base64String}" } }
- The body of the request is the same as of the creation of a user without the
- The expected response should be the following:
- Success:
User was updated successfullywith200 OK - Failure:
Requested user to update was not foundwith404 NOT FOUND
- Success:
DELETE/users/{userId}viaDELETEmethod- The expected response should be the following:
- Success:
User was deleted successfullywith200 OK - Failure:
Requested user to delete was not foundwith404 NOT FOUND
- Success:
- There are available the following endpoints per operation:
-
CREATE -
/customers/newviaPOSTmethod with the following request body:{ "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "customer_test@test.com", "address": "Test Address for Test Customer" } -
/customers/new/listviaPOSTmethod- The body should be a list of Customer-type objects
- The expected response should look like the following:
- Success:
List of customers created successfullywith201 CREATED - Failure:
Error occurred while creating list of customerwith500 INTERNAL SERVER ERROR
- Success:
-
READ/customers/{customerId}viaGETmethod- The expected response should look like the following
- Success (with
200 OK):{ "id": "{customerId}", "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "customer_test@test.com", "address": "Test Address for Test Customer" } - Failure:
Requested customer was not foundwith400 NOT FOUND
- Success (with
- The expected response should look like the following
/customers/allviaGETmethod- The expected response should be the following:
- Success: A list of User-type objects with
200 OK - Failure:
No customers foundwith404 NOT FOUND
- Success: A list of User-type objects with
- The expected response should be the following:
-
UPDATE/customersviaPUTmethod- The body of the request is the same as the value of the
customer_detailsfor creation of a user - The value of the customerId will remain constant for the update process to work
{ "id": "{customerId}", "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "customer_test@test.com", "address": "Test Address for Test Customer" }
- The body of the request is the same as the value of the
- The expected response should be the following:
- Success:
Customer was updated successfullywith200 OK - Failure:
Requested customer to update was not foundwith404 NOT FOUND
- Success:
-
DELETE/customers/{customerId}viaDELETEmethod- The expected response should be the following:
- Success:
Customer was deleted successfullywith200 OK - Failure:
Requested customer to delete was not foundwith404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE -
/vets/newviaPOSTmethod with the following request body:{ "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "veterinary_test@test.com", "professional_card": "123456789" } -
/vets/new/listviaPOSTmethod- The body should be a list of Veterinary-type objects
- The expected response should look like the following:
- Success:
List of veterinaries created successfullywith201 CREATED - Failure:
Error occurred while creating list of veterinarieswith500 INTERNAL SERVER ERROR
- Success:
-
READ/vets/{vetId}viaGETmethod- The expected response should look like the following
- Success (with
200 OK):{ "id": "{customerId}", "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "veterinary_test@test.com", "professional_card": "123456789" } - Failure:
Requested veterinary was not foundwith400 NOT FOUND
- Success (with
- The expected response should look like the following
/vets/allviaGETmethod- The expected response should be the following:
- Success: A list of Veterinary-type objects with
200 OK - Failure:
No veterinaries foundwith404 NOT FOUND
- Success: A list of Veterinary-type objects with
- The expected response should be the following:
-
UPDATE/vetsviaPUTmethod- The body of the request is the same as the value of the
vet_detailsfor creation of a user - The value of the vetId will remain constant for the update process to work
{ "id": "{vetId}", "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "veterinary_test@test.com", "professional_card": "123456789" }
- The body of the request is the same as the value of the
- The expected response should be the following:
- Success:
Veterinary was updated successfullywith200 OK - Failure:
Requested veterinary to update was not foundwith404 NOT FOUND
- Success:
-
DELETE/vets/{vetId}viaDELETEmethod- The expected response should be the following:
- Success:
Veterinary was deleted successfullywith200 OK - Failure:
Requested veterinary to delete was not foundwith404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE -
/pets/newviaPOSTmethod with the following request body:{ "name": "Pet Name", "specs": "Pet specifications", "type": "petType", "owner_id": "{customerId}", "pet_pic": "{base64String}" } -
/pets/new/listviaPOSTmethod- The body should be a list of Pet-type objects
- The expected response should look like the following:
- Success:
List of pets created successfullywith201 CREATED - Failure:
Error occurred while creating list of petswith500 INTERNAL SERVER ERROR
- Success:
-
READ/petsviaGETmethod- Using the header
owner_idwith the user's ID (Customer-type User) as its value - The expected response should be the following:
- Success: A list of the user's pets as a list of Pet-type objects with
200 OK - Failure:
No pets foundwith404 NOT FOUND
- Success: A list of the user's pets as a list of Pet-type objects with
- Using the header
/pets/{petId}viaGETmethod- The expected response should look like the following
- Success (with
200 OK):{ "id": "{petId}", "name": "Pet Name", "specs": "Pet specifications", "type": "petType", "owner_id": "{customerId}", "pet_pic": "{base64String}" } - Failure:
Requested pet was not foundwith400 NOT FOUND
- Success (with
- The expected response should look like the following
/pets/allviaGETmethod- The expected response should be the following:
- Success: A list of Pet-type objects with
200 OK - Failure:
No pets foundwith404 NOT FOUND
- Success: A list of Pet-type objects with
- The expected response should be the following:
-
UPDATE/petsviaPUTmethod- The body of the request is the same as the one used for the creation of a pet
- The value of the petId will remain constant for the update process to work
{ "id": "{petId}", "name": "Pet Name", "specs": "Pet specifications", "type": "petType", "owner_id": "{customerId}", "pet_pic": "{base64String}" }
- The expected response should be the following:
- Success:
Pet was updated successfullywith200 OK - Failure:
Requested pet to update was not foundwith404 NOT FOUND
- Success:
-
DELETE/pets/{petId}viaDELETEmethod- The expected response should be the following:
- Success:
Pet was deleted successfullywith200 OK - Failure:
Requested pet to delete was not foundwith404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE -
/visits/newviaPOSTmethod with the following request body:{ "pet_id": "{petId}", "vet_id": "{vetId}", "date": {visitDate}, "temperature": {petTemp}, "weight": {petWeight}, "resp_freq": {petRespFreq}, "cardiac_freq": {petCardiacFreq}, "mood": "{petMood}", "recommendation": "{vetRecommendation}" } -
/visits/new/listviaPOSTmethod- The body should be a list of Visit-type objects
- The expected response should look like the following:
- Success:
List of visits created successfullywith201 CREATED - Failure:
Error occurred while creating list of visitswith500 INTERNAL SERVER ERROR
- Success:
-
READ/visits/{visitId}viaGETmethod- The expected response should look like the following
- Success (with
200 OK):{ "id": "{visitId}", "pet_id": "{petId}", "vet_id": "{vetId}", "date": {visitDate}, "temperature": {petTemp}, "weight": {petWeight}, "resp_freq": {petRespFreq}, "cardiac_freq": {petCardiacFreq}, "mood": "{petMood}", "recommendation": "{vetRecommendation}" } - Failure:
Requested visit was not foundwith400 NOT FOUND
- Success (with
- The expected response should look like the following
visits/argsviaGETmethod- Using the following headers:
ownerIdwith the pet's ID as its valuevetIdwith the vet's ID as its valuedatewith the visit's date string as its value
- The expected response should be the following:
- Success (with
200 OK):{ "id": "{visitId}", "pet_id": "{petId}", "vet_id": "{vetId}", "date": {visitDate}, "temperature": {petTemp}, "weight": {petWeight}, "resp_freq": {petRespFreq}, "cardiac_freq": {petCardiacFreq}, "mood": "{petMood}", "recommendation": "{vetRecommendation}" } - Failure:
No visit with provided data was foundwith404 NOT FOUND
- Success (with
- Using the following headers:
/visits/allviaGETmethod- The expected response should be the following:
- Success: A list of Visit-type objects with
200 OK - Failure:
No visits foundwith404 NOT FOUND
- Success: A list of Visit-type objects with
- The expected response should be the following:
-
UPDATE/petsviaPUTmethod- The body of the request is the same as the one used for the creation of a visit
- The value of the petId will remain constant for the update process to work
{ "id": "{visitId}", "pet_id": "{petId}", "vet_id": "{vetId}", "date": {visitDate}, "temperature": {petTemp}, "weight": {petWeight}, "resp_freq": {petRespFreq}, "cardiac_freq": {petCardiacFreq}, "mood": "{petMood}", "recommendation": "{vetRecommendation}" }
- The expected response should be the following:
- Success:
Visit was updated successfullywith200 OK - Failure:
Requested visit to update was not foundwith404 NOT FOUND
- Success:
-
DELETE/visits/{visitId}viaDELETEmethod- The expected response should be the following:
- Success:
Visit was deleted successfullywith200 OK - Failure:
Requested visit to delete was not foundwith404 NOT FOUND
- Success:
-