Prerequisites
Inquiry Service stores data representing a concrete product that a customer inquired. This data specifies details about product, customer details, a source from where an inquiry was initiated and propagated to the service. This data is not static, changes often while working over it.
Usually this data is needed while CRM manager is looking for inquiries that to be processed and moved to another step/status.
Who inquiry will come to CRM? A customer will sent a form via landing page or a manager can create an inquiry manually via GUI of CRM.
Structures:
Inquiry
id (PK)
productRefId (bigint, not-null)
customerRefId (bigint, not-null)
managerRefId (bigint, not-null)
source_id (FK, not-null)
comment (text, nullable) // from inquiry
status (enum, not-null)
note (text, nullable) // for manager while working on inquiry
createdAt (timestamp with timezone, UTC+0 only, not-null)
updatedAt (timestamp with timezone, UTC+0 only, not-null)
Inquiry hold references to product, customer and manager it relates to. A manager is a responsible person for processing one or more assigned to him/her inquiries. A comment is a part of an inbound inquiry that specifies customer desires. Any customer does not know directly about a manager that serves the inquiry. A note is data that a manager can put to an inquiry while processing it. Statuses: NEW, INPROGRESS, PAYMENT, PAID, REJECTED. Hence, internationalization (i18n)_ is crucial part of any entity in CRM. Because of that status attribute represents a key based on what a corresponding translation will be applied.
createdAt (timestamp with timezone, UTC+0 only, not-null)
updatedAt (timestamp with timezone, UTC+0 only, not-null)
A source is a place where an inquiry was initiated and propagated to the service. Types: Landing Page, CRM, Telegram. Managers may operate over CRM from any possible country with different language support. Hence, internationalization (i18n) is crucial part of any entity in CRM. Because of that name attribute represents a key based on what a corresponding translation will be applied.
Once persistent layer implemented, a service layer for introducing required business operations must be implemented.
Operations:
Create Inquiry
While creating a brand new inquiry next initiating steps to be done:
Set status NEW
Assign to Head of Managers
Update Inquiry:
Lightweight ops:
change status
change manager
Find Inquiry by ID
Find all Inquiry
Pagination (default limit 25)
Filtering:
status
customer
manager
Sorting:
status
createdAt
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
Prerequisites Inquiry Service stores data representing a concrete product that a customer inquired. This data specifies details about product, customer details, a source from where an inquiry was initiated and propagated to the service. This data is not static, changes often while working over it. Usually this data is needed while CRM manager is looking for inquiries that to be processed and moved to another step/status. Who inquiry will come to CRM? A customer will sent a form via landing page or a manager can create an inquiry manually via GUI of CRM.
Structures:
Inquiry
Inquiry hold references to product, customer and manager it relates to. A manager is a responsible person for processing one or more assigned to him/her inquiries. A comment is a part of an inbound inquiry that specifies customer desires. Any customer does not know directly about a manager that serves the inquiry. A note is data that a manager can put to an inquiry while processing it. Statuses: NEW, INPROGRESS, PAYMENT, PAID, REJECTED. Hence, internationalization (i18n)_ is crucial part of any entity in CRM. Because of that
status
attribute represents a key based on what a corresponding translation will be applied.Relations Product: Many-2-One Customer: Many-2-One Manager: Many-2-One Source: Many-2-One
Source
A source is a place where an inquiry was initiated and propagated to the service. Types: Landing Page, CRM, Telegram. Managers may operate over CRM from any possible country with different language support. Hence, internationalization (i18n) is crucial part of any entity in CRM. Because of that
name
attribute represents a key based on what a corresponding translation will be applied.Once persistent layer implemented, a service layer for introducing required business operations must be implemented. Operations:
NEW
Head of Managers
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