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
Authorization
with 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
POST
method 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/new
viaPOST
method 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": "[email protected]", "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": "[email protected]", "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 successfully
with201 CREATED
- Failure:
There was an error creating the user
with500 INTERNAL SERVER ERROR
- Success:
- Customer-type User.
READ
/users/{userId}
viaGET
method- 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": "[email protected]", "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": "[email protected]", "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 found
with404 NOT FOUND
- Success (with
- The expected response should look like the following
/users/all
viaGET
method- The expected response should be the following:
- Success: A list of User-type objects with
200 OK
- Failure:
No users found
with404 NOT FOUND
- Success: A list of User-type objects with
- The expected response should be the following:
UPDATE
/users
viaPUT
method- The body of the request is the same as of the creation of a user without the
personDetails
field - 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 successfully
with200 OK
- Failure:
Requested user to update was not found
with404 NOT FOUND
- Success:
DELETE
/users/{userId}
viaDELETE
method- The expected response should be the following:
- Success:
User was deleted successfully
with200 OK
- Failure:
Requested user to delete was not found
with404 NOT FOUND
- Success:
- There are available the following endpoints per operation:
-
CREATE
-
/customers/new
viaPOST
method with the following request body:{ "name": "Customer Test Name", "last_name": "Customer Test Last Name", "phone_number": "123456789", "email": "[email protected]", "address": "Test Address for Test Customer" }
-
/customers/new/list
viaPOST
method- The body should be a list of Customer-type objects
- The expected response should look like the following:
- Success:
List of customers created successfully
with201 CREATED
- Failure:
Error occurred while creating list of customer
with500 INTERNAL SERVER ERROR
- Success:
-
READ
/customers/{customerId}
viaGET
method- 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": "[email protected]", "address": "Test Address for Test Customer" }
- Failure:
Requested customer was not found
with400 NOT FOUND
- Success (with
- The expected response should look like the following
/customers/all
viaGET
method- The expected response should be the following:
- Success: A list of User-type objects with
200 OK
- Failure:
No customers found
with404 NOT FOUND
- Success: A list of User-type objects with
- The expected response should be the following:
-
UPDATE
/customers
viaPUT
method- The body of the request is the same as the value of the
customer_details
for 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": "[email protected]", "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 successfully
with200 OK
- Failure:
Requested customer to update was not found
with404 NOT FOUND
- Success:
-
DELETE
/customers/{customerId}
viaDELETE
method- The expected response should be the following:
- Success:
Customer was deleted successfully
with200 OK
- Failure:
Requested customer to delete was not found
with404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE
-
/vets/new
viaPOST
method with the following request body:{ "name": "Veterinary Test Name", "last_name": "Veterinary Test Last Name", "phone_number": "123456789", "email": "[email protected]", "professional_card": "123456789" }
-
/vets/new/list
viaPOST
method- The body should be a list of Veterinary-type objects
- The expected response should look like the following:
- Success:
List of veterinaries created successfully
with201 CREATED
- Failure:
Error occurred while creating list of veterinaries
with500 INTERNAL SERVER ERROR
- Success:
-
READ
/vets/{vetId}
viaGET
method- 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": "[email protected]", "professional_card": "123456789" }
- Failure:
Requested veterinary was not found
with400 NOT FOUND
- Success (with
- The expected response should look like the following
/vets/all
viaGET
method- The expected response should be the following:
- Success: A list of Veterinary-type objects with
200 OK
- Failure:
No veterinaries found
with404 NOT FOUND
- Success: A list of Veterinary-type objects with
- The expected response should be the following:
-
UPDATE
/vets
viaPUT
method- The body of the request is the same as the value of the
vet_details
for 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": "[email protected]", "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 successfully
with200 OK
- Failure:
Requested veterinary to update was not found
with404 NOT FOUND
- Success:
-
DELETE
/vets/{vetId}
viaDELETE
method- The expected response should be the following:
- Success:
Veterinary was deleted successfully
with200 OK
- Failure:
Requested veterinary to delete was not found
with404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE
-
/pets/new
viaPOST
method with the following request body:{ "name": "Pet Name", "specs": "Pet specifications", "type": "petType", "owner_id": "{customerId}", "pet_pic": "{base64String}" }
-
/pets/new/list
viaPOST
method- The body should be a list of Pet-type objects
- The expected response should look like the following:
- Success:
List of pets created successfully
with201 CREATED
- Failure:
Error occurred while creating list of pets
with500 INTERNAL SERVER ERROR
- Success:
-
READ
/pets
viaGET
method- Using the header
owner_id
with 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 found
with404 NOT FOUND
- Success: A list of the user's pets as a list of Pet-type objects with
- Using the header
/pets/{petId}
viaGET
method- 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 found
with400 NOT FOUND
- Success (with
- The expected response should look like the following
/pets/all
viaGET
method- The expected response should be the following:
- Success: A list of Pet-type objects with
200 OK
- Failure:
No pets found
with404 NOT FOUND
- Success: A list of Pet-type objects with
- The expected response should be the following:
-
UPDATE
/pets
viaPUT
method- 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 successfully
with200 OK
- Failure:
Requested pet to update was not found
with404 NOT FOUND
- Success:
-
DELETE
/pets/{petId}
viaDELETE
method- The expected response should be the following:
- Success:
Pet was deleted successfully
with200 OK
- Failure:
Requested pet to delete was not found
with404 NOT FOUND
- Success:
-
- There are available the following endpoints per operation:
-
CREATE
-
/visits/new
viaPOST
method 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/list
viaPOST
method- The body should be a list of Visit-type objects
- The expected response should look like the following:
- Success:
List of visits created successfully
with201 CREATED
- Failure:
Error occurred while creating list of visits
with500 INTERNAL SERVER ERROR
- Success:
-
READ
/visits/{visitId}
viaGET
method- 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 found
with400 NOT FOUND
- Success (with
- The expected response should look like the following
visits/args
viaGET
method- Using the following headers:
ownerId
with the pet's ID as its valuevetId
with the vet's ID as its valuedate
with 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 found
with404 NOT FOUND
- Success (with
- Using the following headers:
/visits/all
viaGET
method- The expected response should be the following:
- Success: A list of Visit-type objects with
200 OK
- Failure:
No visits found
with404 NOT FOUND
- Success: A list of Visit-type objects with
- The expected response should be the following:
-
UPDATE
/pets
viaPUT
method- 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 successfully
with200 OK
- Failure:
Requested visit to update was not found
with404 NOT FOUND
- Success:
-
DELETE
/visits/{visitId}
viaDELETE
method- The expected response should be the following:
- Success:
Visit was deleted successfully
with200 OK
- Failure:
Requested visit to delete was not found
with404 NOT FOUND
- Success:
-