The child task of [Customer Service: Customer Domain #11.
Implement service layer.
Prerequisites
Customer Service stores data representing a customer that inquired a product at least once. This data specifies details about a customer, mostly for establishing a communication with. This data is not static, however changes quite rarely. This data can't be changed by customer rather requesting any change to a manager. Usually this data is needed while a manager does operations (changing status, making any decision, arranging purchase, etc.) with an inquiry.
What will happen if a customer bought any product? It should be propagated to a system called User Profile. That system is abstract storage for all user even created in a system (e.g. customer that bought a product, manager that works with the system, system administrator, etc)
Once persistent layer implemented, a service layer for introducing required business operations must be implemented.
Operations:
Create Customer
Update Customer:
Lightweight ops:
Name
Surname
email
Telegram ID
Country
Find product by ID
Find all products
Pagination (default limit 25)
Filtering:
full name
country
Sorting:
country
In order to implement service layer tests we have to have a storage to prove that data fetch, add, update, etc.
For this we will integration tests approach in combination Spring Boot Test + Testcontainer.
Testcontainer will help us to establish a storage and populate data in it.
NOTE: Do not need to cover Spring Repositories with tests
So that,
Tool for DB versioning configured
Domain implemented on persistent and service layers
Test data prepared for being populated
Testcontainer established
Solution covered with integration tests
DoR
Persistent layer is ready to use
- Service layer is ready to use
The child task of [Customer Service: Customer Domain #11.
Implement service layer.
Prerequisites Customer Service stores data representing a customer that inquired a product at least once. This data specifies details about a customer, mostly for establishing a communication with. This data is not static, however changes quite rarely. This data can't be changed by customer rather requesting any change to a manager. Usually this data is needed while a manager does operations (changing status, making any decision, arranging purchase, etc.) with an inquiry.
What will happen if a customer bought any product? It should be propagated to a system called User Profile. That system is abstract storage for all user even created in a system (e.g. customer that bought a product, manager that works with the system, system administrator, etc)
Once persistent layer implemented, a service layer for introducing required business operations must be implemented. Operations:
In order to implement service layer tests we have to have a storage to prove that data fetch, add, update, etc. For this we will integration tests approach in combination Spring Boot Test + Testcontainer. Testcontainer will help us to establish a storage and populate data in it.
NOTE: Do not need to cover Spring Repositories with tests
So that,
DoR