The provided set of examples describe the following participants:
- Customer Offer: Management of any type of product offers for customers.
- Party Routing Profile: Data directory containing the Profile information for different parties
- Customer Credit Rating: Provides information about Credit Score Ratings
- Customer Offer receives a request to initiate a
CustomerOffer
for a given customer. - The
CustomerOfferInitiated
event is emitted - Customer Offer retrieves the Score Rating from the Customer Credit Rating Service Domain.
- If the retrieved score is over 700 the
CustomerOfferProcedure
will transition toprocessing
- If is lower, it will transition to
incomplete
- If the retrieved score is over 700 the
- An event is emitted regarding the new state transition
- The Party Routing Profile receives the events and updates its internal state.
- The Party Routing Provile shows only active procedures.
- The Party Routing Profile can be queried to retrieve the current profile
The customer credit rating service domain always returns the same value for a given set of customerReferences.
customerReference | score |
---|---|
bob | 600 |
anna | 802 |
jane | 760 |
frank | 500 |
- Create a Minikube cluster with the Mercury Operator and all the dependencies. Look at the Mercury Operator installation instructions
- Create a Service Domain Infra Resource
kubectl create -f deploy/service-domain-infra.yaml
- Create the different Service Domains (Customer Offer, Party Routing Profile and Customer Credit Rating)
- Create Customer Offer Service Domain Resource
kubectl create -f deploy/customer-offer-service-domain.yaml
- Create Party Routing Profile Service Domain Resource
kubectl create -f deploy/party-routing-profile-service-domain.yaml
- Create Customer Credit Rating Service Domain Resource
kubectl create -f deploy/customer-credit-rating-service-domain.yaml
- Create the Reporting services
kubectl create -f deploy/customer-offer-reporting.yaml
kubectl create -f deploy/party-routing-profile-reporting.yaml
- Initiate a Customer Offer
$ curl -vH "Content-Type: application/json" `minikube service -n mercury customer-offer-camelk-rest --url=true`/CustomerOffer/Initiate -d '
{
"CustomerOfferProcedure": {
"CustomerReference": "anna"
}
}'
# Response
{
"CustomerOfferProcedure": {
"CustomerOfferProcessingTask": "1", ## This is the Customer Offer Reference
"CustomerOfferProcessingTaskResult": "processing"
}
}
- Check if the Party Routing Profile exists for this Customer Offer Reference
- For specific Customer Offer Reference status (CUSTOMER_OFFER_REFERENCE)
$ curl -H "Content-Type: application/json" `minikube service -n mercury party-routing-profile-camelk-rest --url=true`/PartyRoutingProfile/anna/Retrieve
{
"Status": {
"CustomerRelationshipStatus": "Processing"
}
}
- Retrieve a report of all the Customer Offer Procedure References
$ curl -H "Content-Type: application/json" `minikube service party-routing-profile-reporting --url=true`/party-routing-profile/
[
{
"referenceId": "anna",
"status": "Processing"
}
]
The Customer Credit Rating example always provide the same result for any input.
$ curl -H "Content-Type: application/json" `minikube service example-customer-credit-rating-camelk-rest --url=true`/CustomerCreditRating/anna/Retrieve
{
"CustomerCreditRatingState": {
"CreditRatingAssessmentResult": "802"
}
}