diff --git a/README.md b/README.md index c865c3b51..43c1ede50 100644 --- a/README.md +++ b/README.md @@ -163,3 +163,18 @@ For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: S ## License The Spring PetClinic sample application is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0). + +## Assignment Enhancements + +- Added endpoints to GET and POST pet attributes (Temperament, Length, Weight). +- Created REST API endpoints to **GET** and **POST** pet type data +- Developed model, service, repository, and controller layers +- Included SQL schema for new table + +## Endpoints + +- `POST /api/pettypes` — Create a new pet with attributes +- `GET /api/pettypes` — Retrieve all pet types with their attributes + +Access the endpoints via Postman or curl at: +http://localhost:8080/api/pettypes \ No newline at end of file diff --git a/src/main/resources/db/h2/schema.sql b/src/main/resources/db/h2/schema.sql index 4a6c322cb..f4bbaa875 100644 --- a/src/main/resources/db/h2/schema.sql +++ b/src/main/resources/db/h2/schema.sql @@ -62,3 +62,11 @@ CREATE TABLE visits ( ); ALTER TABLE visits ADD CONSTRAINT fk_visits_pets FOREIGN KEY (pet_id) REFERENCES pets (id); CREATE INDEX visits_pet_id ON visits (pet_id); + +CREATE TABLE pet_types ( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + temperament VARCHAR(255), + length DOUBLE, + weight DOUBLE +);