Assessment Specification Details

This change is to capture the customer from a third-party REST web service.

There are two main requirements

  1. The standard function of capturing customers must be fetched from the third-party REST web service
    Sales → More → Customers → Capture Customer
  2. When the operator attempts to go into tendering by pressing the ‘Total’ button on the POS, if a customer hasn’t been captured already in the basket, the POS must force the operator to capture the customer from the third-party web service

Replace the Enactor standard customer capture function with a customer process that captures a customer number and calls the [RESTAPI]/customer/{customerNumber} service. This service returns additional information related to the customer’s Year To Date Spend (YTD spend). Once a customer is looked up successfully, the POS must record the customer’s DoB and YTD spend data in the transaction XML under the Customer Retail Details section using Extended Customer Details.

The details which are retrieved by the REST service should be shown in the Customer Details Confirmation prompt. In this prompt operator should only be able to add/edit the “Customer Tax Identification Number”. If there’s a non-empty value for this field it should be recorded in the ‘Additional Data’ map supported in the Enactor POS Basket.

This data must end up in the transaction XML that is recorded in the file system and sent to the Estate Manager.


1. Customer Capture

Customer Capture Prompt and Showing Error Responses

A new prompt is required to capture the customer number


Once the customer number is entered and proceeded the relevant REST web service should be invoked to lookup the customer. If there’s an error response (other than HTTP status 200) it should be displayed properly with a message prompt.


If there’s a successful response the details should be displayed in the next prompt (Customer Confirmation Prompt)

Customer Confirmation Prompt


Conditions to present the values in the Customer Confirmation prompt

Customer Name should be formatted to show the “forename + surname” (eg. Johnny Depp)

DoB value should be formatted to show “dd MMM yyyy” (eg. 9 Jun 1963)

YTD Spend value should be formatted to show the correct currency symbol(which is ytdSpendCurrency)

YTD Spend Voucher value should be extracted from a message resource

display value should be changed based on the ytdSpendVoucher property
eg. if ytdSpendVoucher is true then the value should be “Eligible to use the voucher” else “Not eligible to use the voucher”

Only the Customer Tax Identification Number should be added/edited by the operator(This field is not mandatory).

When the OK button is pressed, if the customer’s ytdSpendVoucher is true, display a message to the operator. (e.g. Please inform the customer to visit the website to receive a special reward!)

If ytdSpendVoucher is true then the receipt footer must include “You are entitled to a special reward. Please login to [website] to claim!”

2. Customer Capturing when the Total button is pressed

When the operator presses the “Total” button, if a customer has not been captured and the basket total is exceeding 100 GBP (this is an example amount) then a message should be displayed forcing the operator to capture the customer. (Once the OK button is pressed POS should prompt the Customer Capture Prompt)

Changes to the Transaction XML

Completed successful transaction XML should contain the following properties

Customer Lookup Service

The attached customer lookup service is a simple REST service that will return customer-related information

This has the following API:

  • URL
    • http://localhost:3000/<customerNumber>
    • The mock implementation supports the following customer numbers
      • 123 – valid response
      • 456 – valid response
      • 878 – valid response
      • 956 – valid response
      • 500 – returns an internal server error with status 500
  • Method
    • GET
  • Success Response
    • Code: 200
    • Sample Content
{
    "customerNumber" : "123",
    "customerName" : {
      "surname" : "K",
      "forename" : "Savva",
      "dateOfBirth" : 1611310262549
    },
    "customerTaxIdentificationNo": "CTINAB8754LT",
    "ytdSpendData" : {
        "ytdSpend" : 1000,
      "ytdSpendCurrency" : "GBP",
      "ytdSpendVoucher" : true
    }
}

Error Response 404

  • Code: 404 NOT FOUND
  • Content
{
    "messageText": "Customer Not Found",
    "errorCode": "CUSTOMER NOT FOUND",
    "errorStatus": "404"
}

Error Response 500

  • Code: 500 INTERNAL SERVER ERROR
  • Content
{
   "messageText" : "Error processing the request",
   "errorCode" : "INTERNAL SERVER ERROR",
   "errorStatus" : "500"
}



3. Resources

Course Content

Expand All