This repository contains a simple Person Registry API built using Spring Boot. The API allows users to store and fetch information about persons and their family members, including spouses and children.
- Store a person's information, including their name and social security number.
- Save a person's spouse name.
- Save a person's children's names and ages.
- Fetch a person's information using their social security number.
- Retrieve the name of the oldest child for a person.
- Java 8 or higher
- Maven
Clone the repository:
git clone https://github.com/anazri/peoplecase.git
cd peoplecaseBuild the project:
mvn clean installRun the application:
mvn spring-boot:runThe API will be available at http://localhost:8088.
API Endpoints The following API endpoints are available:
Save a person's information, including their spouse and children's information.
POST /api/v1/personExample request body:
{
"name": "John Doe",
"spouseName": "Jane Doe",
"ssn": "123-456-789",
"children": [
{
"name": "Alice Doe",
"age": 10
},
{
"name": "Bob Doe",
"age": 7
}
]
}Fetch a person's information using their SSN.
GET /api/v1/person/{ssn}Retrieve the name of the oldest child for a person with the given SSN.
GET /api/v1/person/{ssn}/oldest-child