TEST: Difference between revisions

From Calidus HUB
No edit summary
(#tagtest)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
346238
= 325145 Device Audit Log Improvements =
Client JBG JBL Global - Oak furniture
Summary CR: Lot code validation
DEV
DEV


== Requirements ==
* Send the device audit log through a new web service method, rather than through email.
* Request that the device send through the audit log by making a setting on the server.
* Allow configuration of the audit log:
** Per device and default for the system.
** What is to be audited (types of audit log messages).
** Number of records to store on the audit log.
* Admin screen available to OBSL users only, to configure audit logs and request them to be sent (Devices screen).




== Overview of Solution ==
=== Device Audit Log Web Service Method ===
The PDA Audit Log screen will be modified to build a message onto the pending queue, containing all the logged data.


|Requirement=The requirement is to add validation to the lot number UDF scan for containers ("items") delivered to customers from the depots (the JBGSW site). The lot number that the user scans off the product label (GS1 barcode) in the UDF form should be validated against the container ID (item code) that the user scanned off the item label. This is to verify that the user has scanned both labels from the same box. ePOD doesn't have the product code for container deliveries so the change will require JBG to import the product code with the job details so that it can be validated.
A new message request will be created for this (AUDIT_LOG).
|OBS-Solution=The existing code for validating and extracting GS1 barcode types must be modified to allow extraction and validation against multiple components (AIs) of the barcode.


The system will be modified to allow a new field type of "GS1 Barcode" to be configured in User-Defined Forms (UDF).
Structure to be defined, but it is assumed this will follow the structure of the existing XF_AUDIT device table.


This type will then allow the configuration of each AI value to be extracted from the barcode, specifying whether this is default AI value to be returned, whether the value is required to be found in the barcode and any validation against this AI value. This will be done through a list of items for the field. At least one must be specified.
The server PDA web service will be modified to receive this message and save this to a file in a server-side folder. The folder will be defined as a system web configuration parameter. The name to be confirmed, but will likely comprise:
* "AUDIT_LOG_"
* device_id
* date
* time
* ".XML"


For this specific change, a field will be entered as "Scan Lot Number" of type "GS1 Barcode". The field will extract 2 items:
* AI "10 - Lot Number", required to be extracted, and validated as a numeric field from 1 to 20 in length.
* AI "91 - Agreed between Suppliers", not required to be extracted. If it is extracted, this will be validated as being the same as the value in EPL_CODE_2.


This configuration will be sent to the device for entry.
=== Request Device Audit Log ===
The EPOD_DEVICE table will be modified to add the following fields:
* EPD_AUDIT_LOG_REQUESTED_IND - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0
* EPD_LAST_AUDIT_LOG_RECEIVED_DATE - int default 0
* EPD_LAST_AUDIT_LOG_RECEIVED_TIME - int default 0
* EPD_LAST_AUDIT_LOG_RECEIVED - nvarchar(100) NULL


The server PDA web service will be modified to recognise this flag on the following existing web service methods:
* LOGON_REQUEST
* AUTO_UPDATE_REQUEST


On the device, when a field of type "GS1 Barcode" is encountered, the device will display an entry box for the barcode field as now. However, additional display-only fields will be added for each AI type specified as required underneath it.
The device will be extracted and, if EPD_AUDIT_LOG_REQUESTED_IND is set to 1, the following additional information will be returned on the message:
* EPD_AUDIT_LOG_REQUESTED_IND - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
* EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0


When a barcode is scanned or entered in this field, the device will extract all of the found values matching the list of AIs to be extracted. These will be displayed in the fields under the barcode scan entry field.
Structure to be defined, but it is assumed this will follow the structure of the existing EPOD_DEVICE table.


For this specific configuration, the screen will display the barcode entry field and two fields below for the extracted AI values, as shown in the prototypes below.


When a barcode is scanned in the field, the process will extract the values of the AIs configured and display them in the fields below. When a value has been scanned and extracted, the screen will also display a button to clear the scanned values if required, although scanning a new barcode will clear all extracted values.
The device will be modified to check the responses to these messages (including a grace logon) and check the value of the indicator. If the flag is set to 1, the process will check the last requested date and time is different to the last request received. If so, the device will call the same code as the Audit screen i.e. generate a new AUDIT_LOG web service call.


<gallery widths=200px heights=320px perrow=3>
File:EST_346238_PDA_LotUDF.png|''Lot Number Entry''
File:EST_346238_PDA_LotUDF2.png|''Lot Number Entry, with extracted values''
</gallery><br />


When the user clicks '''Save''' on the form, the device will validate each extracted element with the validation specified against each field.  
The server PDA web service AUDIT_LOG method will be modified to extract the device from the message and update the following fields:
* EPD_AUDIT_LOG_REQUESTED_IND - set to 0
* EPD_LAST_AUDIT_LOG_RECEIVED_DATE - set to sysdate
* EPD_LAST_AUDIT_LOG_RECEIVED_TIME - set to systime
* EPD_LAST_AUDIT_LOG_RECEIVED - set to the name of the audit log file created.


For this specific configuration, the lot number is required and must be numeric. Product ID is not required to be extracted but, if it is, the value must match the value of the product ID sent in EPL_CODE_2.


The validation process will be changed to validate each specific extract. If any fails, the user will not be allowed to continue. The validation will highlight the field with the issue and show a generic error.
=== Device Audit Log Configuration ===
{{Note}} This supersedes the Audit Logging configuration on the device.


When viewing already entered UDF, for GS1 fields, all values already saved will be displayed on entry into the form.
The EPOD_DEVICE table will be modified to add the following fields:
* EPD_AUDIT_LOGGING_IND - int, default 0
* EPD_AUDIT_LOG_TYPES - nvarchar(MAX) -
* EPD_AUDIT_LOG_LIMIT - int, default 2000


Defaults for the system will be set to be:
* EPD_AUDIT_LOGGING_IND - 0
* EPD_AUDIT_LOG_TYPES - "{}"
* EPD_AUDIT_LOG_LIMIT - 2000


The device will return the value in the first extracted item in the VALUE tag of the UDF. All extracted AI values will also be returned in additional VALUE tags within the field, identifying the AI from which the value was extracted.
The server PDA web service will be modified for the LOGON_REQUEST method to return the content of the EPD_DEVICE table for the device.


For this specific configuration, the extracted lot number will be returned in the VALUE tag.


The device will be modified to check the LOGON_RESPONSE message and store the devices flags. The value of EPD_AUDIT_LOG_TYPES will be stored as a JSON object or as a delimited list of areas.


{{Note}} The completed UDF will be displayed in the C-ePOD Admin screen against the container (item), showing only the Lot Number label and the value for this.
{{Note}} This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.


This change will be completed in the latest version (V4) of the ''CALIDUS'' ePOD application.
The device will store the log indicator and limit (EPD_AUDIT_LOGGING_IND and EPD_AUDIT_LOG_LIMIT) as new global variables or system properties.


The device audit logging process (XF_AUDIT) will be modified to use the limit (EPD_AUDIT_LOG_LIMIT) instead of the fixed limit (2000). If the limit has changed, all messages will be removed from the table.


Development:
The device logging process will be modified to check whether the area exists in EPD_AUDIT_LOG_TYPES. If so, and audit logging is enabled (EPD_AUDIT_LOGGING_IND = 1), the device will write the debug message to the audit log.
Admin screen: 2.0d
 
Device: 2.0d
 
=== Devices Maintenance Screen ===
The EPOD_DEVICE table will be modified to add the following fields:
* EPD_NAME - nvarchar(50)
 
EPOD_LISTS and EPOD_LIST_ITEMS records will be created with all logging areas.
 
{{Note}} This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.
 
 
A new Devices screen will be created to maintain the device table, including the new logging functionality.
 
This screen is available to OBSL users only, to configure audit logs and request them to be sent. This screen will not be added to any menus.
 
This will be created as a new MVC screen. This requires the existing EPOD_DEVICE and EPOD_DEVICE_TYPE DAL classes to be converted to the new models.
 
The screen will allow work similarly to existing screens, for finding and editing data.
 
New devices cannot be created from this screen.
 
The screen will allow searching for devices using the following criteria:
* ''Device ID'' - text box with fuzzy match.
* ''Device Name'' - text box with fuzzy match.
* ''Date Type'' selector, one of:
** ''Last Used''.
** ''Audit Requested''.
** ''Audit Received''.
* ''Date Range'' - a date range from/to, defaulting to the last week.
* ''User'' - textbox.
* ''Site'' - textbox, defaulting to the logged-on site.
* ''Audit Logging'' - a checkbox, defaulting to unchecked.
 
The results will be displayed in a jQuery datatable-enabled gridview.
 
The columns will be:
* ''Device ID''.
* ''Device Name''.
* ''Last Used'' (Date/Time).
* ''User''.
* ''Site''.
 
Clicking on a row will display the actions:
* '''Show Audit Logs''' - optional, allowing showing all logs associated to that device ID. This requires opening a folder on the IIS web server for browsing, like the PDAUpdates folder on the server.
* '''Select'''.
 
Pressing '''Select''' shows the details of the device:
* ''Device ID'' - read only
* ''Device Name'' - textbox.
* ''Last Used Date/Time'' - read only
* ''User'' - read only
* ''Site'' - read only
* ''Audit Logging'' section:
** ''Last Requested Date/Time'' - read only
** ''Last Received Date/Time'' - read only
** ''Last Audit Log'' - read only
** ''Enable Audit Logging'' - checkbox.
** ''Audit Log Types'' - a multi-select list. This is disabled if audit logging is disabled. This list will be populated from EPOD_LIST_ITEMS for the requisite list.
** '''Request Audit Log''' button - clicking this button enables the EPD_AUDIT_LOG_REQUESTED_IND field. This button is disabled if the indicator is already 1. This button is disabled if audit logging is disabled on the device.
 
 
A '''Save''' and '''Cancel''' button will also be provided.

Latest revision as of 17:13, 25 April 2019

325145 Device Audit Log Improvements

Requirements

  • Send the device audit log through a new web service method, rather than through email.
  • Request that the device send through the audit log by making a setting on the server.
  • Allow configuration of the audit log:
    • Per device and default for the system.
    • What is to be audited (types of audit log messages).
    • Number of records to store on the audit log.
  • Admin screen available to OBSL users only, to configure audit logs and request them to be sent (Devices screen).


Overview of Solution

Device Audit Log Web Service Method

The PDA Audit Log screen will be modified to build a message onto the pending queue, containing all the logged data.

A new message request will be created for this (AUDIT_LOG).

Structure to be defined, but it is assumed this will follow the structure of the existing XF_AUDIT device table.

The server PDA web service will be modified to receive this message and save this to a file in a server-side folder. The folder will be defined as a system web configuration parameter. The name to be confirmed, but will likely comprise:

  • "AUDIT_LOG_"
  • device_id
  • date
  • time
  • ".XML"


Request Device Audit Log

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_AUDIT_LOG_REQUESTED_IND - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_TIME - int default 0
  • EPD_LAST_AUDIT_LOG_RECEIVED - nvarchar(100) NULL

The server PDA web service will be modified to recognise this flag on the following existing web service methods:

  • LOGON_REQUEST
  • AUTO_UPDATE_REQUEST

The device will be extracted and, if EPD_AUDIT_LOG_REQUESTED_IND is set to 1, the following additional information will be returned on the message:

  • EPD_AUDIT_LOG_REQUESTED_IND - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_DATE - int default 0
  • EPD_LAST_AUDIT_LOG_REQUESTED_TIME - int default 0

Structure to be defined, but it is assumed this will follow the structure of the existing EPOD_DEVICE table.


The device will be modified to check the responses to these messages (including a grace logon) and check the value of the indicator. If the flag is set to 1, the process will check the last requested date and time is different to the last request received. If so, the device will call the same code as the Audit screen i.e. generate a new AUDIT_LOG web service call.


The server PDA web service AUDIT_LOG method will be modified to extract the device from the message and update the following fields:

  • EPD_AUDIT_LOG_REQUESTED_IND - set to 0
  • EPD_LAST_AUDIT_LOG_RECEIVED_DATE - set to sysdate
  • EPD_LAST_AUDIT_LOG_RECEIVED_TIME - set to systime
  • EPD_LAST_AUDIT_LOG_RECEIVED - set to the name of the audit log file created.


Device Audit Log Configuration

Note Note: This supersedes the Audit Logging configuration on the device.

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_AUDIT_LOGGING_IND - int, default 0
  • EPD_AUDIT_LOG_TYPES - nvarchar(MAX) -
  • EPD_AUDIT_LOG_LIMIT - int, default 2000

Defaults for the system will be set to be:

  • EPD_AUDIT_LOGGING_IND - 0
  • EPD_AUDIT_LOG_TYPES - "{}"
  • EPD_AUDIT_LOG_LIMIT - 2000

The server PDA web service will be modified for the LOGON_REQUEST method to return the content of the EPD_DEVICE table for the device.


The device will be modified to check the LOGON_RESPONSE message and store the devices flags. The value of EPD_AUDIT_LOG_TYPES will be stored as a JSON object or as a delimited list of areas.

Note Note: This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.

The device will store the log indicator and limit (EPD_AUDIT_LOGGING_IND and EPD_AUDIT_LOG_LIMIT) as new global variables or system properties.

The device audit logging process (XF_AUDIT) will be modified to use the limit (EPD_AUDIT_LOG_LIMIT) instead of the fixed limit (2000). If the limit has changed, all messages will be removed from the table.

The device logging process will be modified to check whether the area exists in EPD_AUDIT_LOG_TYPES. If so, and audit logging is enabled (EPD_AUDIT_LOGGING_IND = 1), the device will write the debug message to the audit log.


Devices Maintenance Screen

The EPOD_DEVICE table will be modified to add the following fields:

  • EPD_NAME - nvarchar(50)

EPOD_LISTS and EPOD_LIST_ITEMS records will be created with all logging areas.

Note Note: This list of all areas is defined as a list of all calls to logAudit or funLogMessage in the mobile device application.


A new Devices screen will be created to maintain the device table, including the new logging functionality.

This screen is available to OBSL users only, to configure audit logs and request them to be sent. This screen will not be added to any menus.

This will be created as a new MVC screen. This requires the existing EPOD_DEVICE and EPOD_DEVICE_TYPE DAL classes to be converted to the new models.

The screen will allow work similarly to existing screens, for finding and editing data.

New devices cannot be created from this screen.

The screen will allow searching for devices using the following criteria:

  • Device ID - text box with fuzzy match.
  • Device Name - text box with fuzzy match.
  • Date Type selector, one of:
    • Last Used.
    • Audit Requested.
    • Audit Received.
  • Date Range - a date range from/to, defaulting to the last week.
  • User - textbox.
  • Site - textbox, defaulting to the logged-on site.
  • Audit Logging - a checkbox, defaulting to unchecked.

The results will be displayed in a jQuery datatable-enabled gridview.

The columns will be:

  • Device ID.
  • Device Name.
  • Last Used (Date/Time).
  • User.
  • Site.

Clicking on a row will display the actions:

  • Show Audit Logs - optional, allowing showing all logs associated to that device ID. This requires opening a folder on the IIS web server for browsing, like the PDAUpdates folder on the server.
  • Select.

Pressing Select shows the details of the device:

  • Device ID - read only
  • Device Name - textbox.
  • Last Used Date/Time - read only
  • User - read only
  • Site - read only
  • Audit Logging section:
    • Last Requested Date/Time - read only
    • Last Received Date/Time - read only
    • Last Audit Log - read only
    • Enable Audit Logging - checkbox.
    • Audit Log Types - a multi-select list. This is disabled if audit logging is disabled. This list will be populated from EPOD_LIST_ITEMS for the requisite list.
    • Request Audit Log button - clicking this button enables the EPD_AUDIT_LOG_REQUESTED_IND field. This button is disabled if the indicator is already 1. This button is disabled if audit logging is disabled on the device.


A Save and Cancel button will also be provided.