You must implement an HTTP API server with basic CRUD operations for the Customer entity.
Expected Result: Link to the Git repository.
- Backend: Spring Boot application
- Frontend: Not needed
- Database: Any relational persistent SQL DB (MySQL/PostgreSQL/...)
- Authentication: Not needed
POST /api/customers
Content-Type: application/json
Request Body:
fullName
: String (2..50 chars including whitespaces)email
: String (2..100 chars, unique, should include exactly one @)phone
: String (6..14 chars, only digits, should start from +, optional field)
Response Body:
id
: LongfullName
: Stringemail
: Stringphone
: String
GET /api/customers
Response Body:
- List of:
id
: LongfullName
: Stringemail
: Stringphone
: String
GET /api/customers/{id}
Response Body:
id
: LongfullName
: Stringemail
: Stringphone
: String
PUT /api/customers/{id}
Content-Type: application/json
Request Body:
id
: LongfullName
: String (2..50 chars including whitespaces)email
: String (not editable)phone
: String (6..14 chars, only digits, should start from +)
Response Body:
id
: LongfullName
: Stringemail
: Stringphone
: String
DELETE /api/customers/{id}
Just mark a customer as deleted, but leave his data in DB. Related DB column: is_active
.
Customer Table:
id
: bigintcreated
: bigintupdated
: bigintfull_name
: varcharemail
: varcharphone
: varchar, nullableis_active
: bool