FS 370536 FleetCheck Interface: Difference between revisions
From Calidus HUB
(v0.1 - Initial draft version - incomplete) |
(v0.4 - Changes after review, additional scope and corrections to trigger naming.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
{{#vardefine:SystemCode|CTMS}} | {{#vardefine:SystemCode|CTMS}} | ||
{{#vardefine:Doc_Title|FleetCheck Interface}} | {{#vardefine:Doc_Title|FleetCheck Interface}} | ||
{{#vardefine:Version|0. | {{#vardefine:Version|0.4}} | ||
{{#vardefine:Date| | {{#vardefine:Date|19th May 2020}} | ||
{{#vardefine:Reference|370536}} | {{#vardefine:Reference|370536}} | ||
{{#vardefine:Year|2020}} | {{#vardefine:Year|2020}} | ||
Line 76: | Line 76: | ||
It is expected that the following are the responsibilities of the systems: | It is expected that the following are the responsibilities of the systems: | ||
* CTMS: | * CTMS: | ||
** Maintain | ** Maintain trailer types (external type) and carriers (categories) - inform FleetCheck of the data. | ||
** Tractor/Trailer/Driver carrier assignment (TBC) | ** Tractor/Trailer/Driver carrier assignment (TBC) | ||
* FleetCheck: | * FleetCheck: | ||
Line 88: | Line 88: | ||
* Carriers and Category may be maintained separately without an interface, but this may result in messages failing to be processed. | * Carriers and Category may be maintained separately without an interface, but this may result in messages failing to be processed. | ||
* Vehicle and trailer types should be created and maintained within CTMS. As this is a CTMS convention rather than a FleetCheck one, this should be the responsibility of CTMS. | * Vehicle and trailer types should be created and maintained within CTMS. As this is a CTMS convention rather than a FleetCheck one, this should be the responsibility of CTMS. | ||
{{Note}} This interface is at system level, and therefore any carriers with named resources will be managed through FleetCheck, when this system is enabled. In the future, the system may be modified to enable/disable the interface on a per-carrier basis. | |||
{{Note}} It may be that, when adding a record into CTMS and therefore triggering the add of the record in FleetCheck, that this may already exist. In this case, the process will log the failure, if a failure code is returned - it will not then attempt to call the web service method again to update the existing record. It is expected that, if this were required, then the FleetCheck web services should support that automatically, as the CALIDUS web services will. | |||
Line 103: | Line 108: | ||
== Menu Structure == | == Menu Structure == | ||
The EDI Log is accessible from Administration/EDI/Interface Errors, the EDI audit is available on tab EDI Audit. | |||
== Data == | == Data == | ||
N/A | |||
== Implementation Advice == | == Implementation Advice == | ||
N/A | |||
Line 179: | Line 184: | ||
* Accessible options. | * Accessible options. | ||
* Configuration. | * Configuration. | ||
Actions taken when updating data will be audited in the system through this user account. | Actions taken when updating data will be audited in the system through this user account. | ||
Line 220: | Line 226: | ||
* Authorisation parameters | * Authorisation parameters | ||
* ''id'' - unique ID. Used when updating an existing tractor. Use the registration. | * ''id'' - unique ID. Used when updating an existing tractor. Use the registration. | ||
* ''type'' - must be a valid | * ''type'' - must be a valid trailer type in the system. Required when creating a tractor. | ||
* ''desc'' - Required when creating a tractor. Maximum length 50. | * ''desc'' - Required when creating a tractor. Maximum length 50. | ||
* ''inactive'' - Optional. Will be assumed to be "N" when creating a new tractor if not provided. Values "Y" or "N". | * ''inactive'' - Optional. Will be assumed to be "N" when creating a new tractor if not provided. Values "Y" or "N". | ||
Line 332: | Line 338: | ||
* Authentication parameters. | * Authentication parameters. | ||
* ''CategoryName'' | * ''CategoryName'' | ||
* ''CategoryId'' | * ''CategoryId'' | ||
Line 346: | Line 352: | ||
* Authentication parameters. | * Authentication parameters. | ||
* ''DriverId'' | * ''DriverId'' | ||
* '' | * ''CategoryName'' | ||
Line 406: | Line 412: | ||
<!-- NEW PAGE --> | <!-- NEW PAGE --> | ||
= TECHNICAL NOTES = | = TECHNICAL NOTES = | ||
== CTMS Web Service, for FC->CTMS == | == CTMS Web Service, for FC->CTMS == | ||
Line 434: | Line 430: | ||
These are RESTful web services and generally support only the POST and PUT actions. | These are RESTful web services and generally support only the POST and PUT actions. | ||
=== General Notes === | |||
All code to process the received data from FleetCheck should be in package DP_FLEETCHECK. | |||
=== Responses === | === Responses === | ||
Responses will be handled by the .NET code. | |||
Responses will be sent as per HTTP standards: | Responses will be sent as per HTTP standards: | ||
Line 453: | Line 455: | ||
} | } | ||
</pre> | </pre> | ||
=== Parameters === | |||
Parameters will be extracted and validated in the .NET code. | |||
Line 464: | Line 470: | ||
&surname=SMITH&forename=JOHN&job=DRIVER&inactive=N&carrier=FLEET | &surname=SMITH&forename=JOHN&job=DRIVER&inactive=N&carrier=FLEET | ||
</pre> | </pre> | ||
All parameters passed in to all web service methods will be checked to ensure that there is no SQL insertion, as well as standard checks for requirement, length and basic type. | |||
Parameters will be extracted from the call to the web service. They will be passed to the appropriate procedure within CTMS package DP_FLEETCHECK. | |||
=== Authorisation === | |||
Authorisation parameters consist of: | Authorisation parameters consist of: | ||
Line 475: | Line 487: | ||
* Configuration. | * Configuration. | ||
A default FLEETCHECK user will be created. This FleetCheck user will be used solely by the .NET web service system for connection purposes. | |||
A new user parameter will be created called FLEETCHECK_AUTHCODE. This will be set against the default FLEETCHECK user - many may be created, but only one expected, and is an optional parameter. | |||
The authorisation procedure in .NET will call package DP_FLEETCHECK.AUTHORISE_USER, accepting the authcode parameter above, returning an error code, and with in/out parameters for username, password and errors (if any). | |||
The procedure will find the user set up with FLEETCHECK_AUTHCODE set to the passed-in Auth Code. | |||
Any issues should be returned with a false return code (negative integer), and the description of the issue, for example: | |||
* -1 - Authcode not valid. | |||
Actions taken when updating data will be audited in the system through this default FleetCheck user account. | |||
Any issues should also be logged by the .NET code to a local logging file. These files should be created new every hour. | |||
=== General Processing === | |||
Procedure code should exist in package DP_FLEETCHECK dedicated to the particular web service, for example, DRIVER. | |||
The .NET code should call the correct procedure associated to the web service, passing in the specific parameters in the process, as well as the following: | |||
* p_message - error descriptions, if any. | |||
* p_action - the action derived from the HTTP action above: | |||
** A - Add | |||
** U - Update | |||
The procedure should also return a basic error code (0 or negative number to identify the specific error) or 1 if all worked as expected. | |||
The procedure should update or create records on appropriate tables, as detailed in the specific descriptions. | |||
The .NET code written should be separated into DAL and BAL objects. BAL objects should define the actions being taken for each web service method, for example AddDriver, UpdateDriver or AddUpdateDriver. These will call define DAL object methods. DAL objects should contain the call the the CTMS Oracle package code - Oracle should not be referenced in any other places in the code, as this web services project may be converted to work with SQL Server for CTL TMS or for C-ePOD. | |||
If adding a record that already exists, the process should look to update it. If updating a record that doesn't already exist, if the process has enough key information to create the user, then the process should create it instead. | |||
=== Audit Logging === | |||
Actions taken when updating data will be audited in the system through this user account. | Actions taken when updating data will be audited in the system through this user account. | ||
All package code will audit to ADM_EDI_AUDIT, for success and failure. | |||
{| class="wikitable" border="1" | |||
|-bgcolor="silver" | |||
!Field !! Comment | |||
|- | |||
|STMT || Generated | |||
|- | |||
|PROG_NAME || Package and procedure, dot delimited e.g. DP_FLEETCHECK.DRIVER | |||
|- | |||
|ORI_USER || As normal | |||
|- | |||
|USER_SESSION || As normal | |||
|- | |||
|ERR_TYPE || 'ERROR' if an error, 'INFO' otherwise. 'AUDIT' may be used for debugging statements, but should be limited. | |||
|- | |||
|DATE_CREATED || System date and time | |||
|- | |||
|ERR_MESSAGE || The generated error message for an error plus an indication of the data e.g. "Error updating Driver XXX: YYYY", otherwise a success message indicating the action taken, identifying the data e.g. "Driver XXX updated". | |||
|- | |||
|SCHED_NAME || N/A | |||
|- | |||
|CUSTOMER_ID || N/A | |||
|- | |||
|LOCATION_ID || N/A | |||
|} | |||
Line 490: | Line 566: | ||
Parameters: | Parameters: | ||
* Authorisation parameters | * Authorisation parameters | ||
* '' | * ''p_id'' - unique numeric ID. Used as the key when adding or updating a driver. | ||
* '' | * ''p_surname'' - must be provided when creating a new driver. Maximum 50 characters. If id is not provided, surname and forename will be used to identify the driver. | ||
* '' | * ''p_forename'' - must be provided when creating a new driver. Maximum 50 characters. If id is not provided, surname and forename will be used to identify the driver. | ||
* '' | * ''p_job'' - must be provided when creating a new driver. Maximum 50 characters. | ||
* '' | * ''p_inactive'' - Optional. Will be assumed to be "N" when creating a new driver is not provided. Values "Y" or "N" | ||
* '' | * ''p_agency'' - Is this an agency driver. "Y" or "N". Optional. Assumed to be "N" when creating a new driver if not provided. | ||
* '' | * ''p_agencyname'' - provide the agency name. Maximum 100 characters. Required if agency = "Y". | ||
* '' | * ''p_carrier'' - must be a valid carrier id. Maximum 12 characters. Optional. Assumes driver is not assigned to a carrier if omitted when creating a new driver. | ||
* '' | * ''p_carriername'' - must be a valid carrier name. Maximum 50 characters. Optional. Assumes driver is not assigned to a carrier if omitted when creating a new driver. | ||
Procedure: DP_FLEETCHECK.DRIVER. | |||
Table RES_PERSON: | Table RES_PERSON: | ||
Line 509: | Line 584: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| ID || NUMBER || | | ID || NUMBER || ''p_id'' | ||
|- | |- | ||
| SURNAME || VARCHAR2(50) || | | SURNAME || VARCHAR2(50) || ''p_surname'' | ||
|- | |- | ||
| FORENAME || VARCHAR2(50) || | | FORENAME || VARCHAR2(50) || ''p_forename'' | ||
|- | |- | ||
| JOB_TITLE || VARCHAR2(50) || | | JOB_TITLE || VARCHAR2(50) || ''p_job'' | ||
|- | |- | ||
| LOCATION_ID || VARCHAR2(12) || | | LOCATION_ID || VARCHAR2(12) || | ||
|- | |- | ||
| CREATED_BY || VARCHAR2(40) || | | CREATED_BY || VARCHAR2(40) || When adding, CTMS Username | ||
|- | |- | ||
| CREATED_DATE || DATE || | | CREATED_DATE || DATE || When adding, SYSDATE | ||
|- | |- | ||
| UPDATED_BY || VARCHAR2(40) || | | UPDATED_BY || VARCHAR2(40) || When updating, CTMS Username | ||
|- | |- | ||
| UPDATED_DATE || DATE || | | UPDATED_DATE || DATE || When updating, SYSDATE | ||
|- | |- | ||
| CONTACT_NO || VARCHAR2(50) || | | CONTACT_NO || VARCHAR2(50) || N/A | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) | | | INACTIVE || VARCHAR2(1) || ''p_inactive'' | ||
|- | |- | ||
| AGENCY || VARCHAR2(1) || | | AGENCY || VARCHAR2(1) || ''p_agency'' | ||
|- | |- | ||
| SMARTPHONE_ENABLED || VARCHAR2(100) || | | SMARTPHONE_ENABLED || VARCHAR2(100) || N/A | ||
|- | |- | ||
| EPOD_USERNAME || VARCHAR2(10) || | | EPOD_USERNAME || VARCHAR2(10) || N/A | ||
|- | |- | ||
| TOMTOM_ENABLED || VARCHAR2(1) || | | TOMTOM_ENABLED || VARCHAR2(1) || N/A | ||
|- | |- | ||
| HUB_LOCATION || VARCHAR2(12) || | | HUB_LOCATION || VARCHAR2(12) || N/A | ||
|- | |- | ||
| START_AT_HUB || VARCHAR2(1) || | | START_AT_HUB || VARCHAR2(1) || N/A | ||
|- | |- | ||
| RETURN_TO_HUB || VARCHAR2(1) || | | RETURN_TO_HUB || VARCHAR2(1) || N/A | ||
|- | |- | ||
| AGENCY_NAME || VARCHAR2(100) || | | AGENCY_NAME || VARCHAR2(100) || ''p_agencyname'' | ||
|} | |} | ||
If a carrier or carrier name is provided, the carrier should be updated. | |||
To update driver carrier assignment. | To update driver carrier assignment. | ||
First, the process should find the carrier. This may be through the ID provided or the carrier name. If the carrier is not found, do not perform the update of the carrier assignment. Return an error. | |||
If the carrier is found, check whether the driver has a carrier entry. If it does not, one should be created. If found, it should be updated. | |||
Table RES_PERSON_CARRIER | Table RES_PERSON_CARRIER | ||
Line 564: | Line 639: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) || | | INACTIVE || VARCHAR2(1) || ''p_inactive'' | ||
|- | |- | ||
| PC_ID || NUMBER(10) || | | PC_ID || NUMBER(10) || ''p_id'' | ||
|- | |- | ||
| ID || NUMBER || | | ID || NUMBER || N/A | ||
|- | |- | ||
| CARRIER_ID || VARCHAR2(12) || | | CARRIER_ID || VARCHAR2(12) || The carrier ID found | ||
|- | |- | ||
| RAG || VARCHAR2(1) || | | RAG || VARCHAR2(1) || N/A | ||
|} | |} | ||
{{Note}}As FleetCheck supports only one category assigned to each resource, then changing the category should make the prior carrier unavailable and this carrier available. The process should find all other carrier records and mark them inactive, if the user is being marked as active to this carrier. This is handled in the CTMS-FleetCheck interface, defined below. | |||
{{Note}} This is a method available to either system. Therefore, if updating carrier assignment from this method, this method should not then send an update out through the other system web service method. | |||
Line 591: | Line 669: | ||
Parameters: | Parameters: | ||
* Authorisation parameters | * Authorisation parameters | ||
* '' | * ''p_id'' - unique ID. Used when updating an existing tractor. Use the registration. | ||
* '' | * ''p_type'' - must be a valid trailer type in the system. Required when creating a tractor. | ||
* '' | * ''p_desc'' - Required when creating a tractor. Maximum length 50. | ||
* '' | * ''p_inactive'' - Optional. Will be assumed to be "N" when creating a new tractor if not provided. Values "Y" or "N". | ||
* '' | * ''p_mpg'' - Optional. Decimal number, 3 decimal places. | ||
* '' | * ''p_vin'' - optional. Maximum length 17. | ||
* '' | * ''p_carrier'' - must be a valid carrier id. Maximum 12 characters. Optional. Assumes tractor is not assigned to a carrier if omitted when creating a new tractor. | ||
* '' | * ''p_carriername'' - must be a valid carrier name. Maximum 50 characters. Optional. Assumes tractor is not assigned to a carrier if omitted when creating a new tractor. | ||
Procedure: DP_FLEETCHECK.TRACTOR. | |||
Table RES_TRACTOR | Table RES_TRACTOR: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 609: | Line 687: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| TRACTOR_ID || VARCHAR2(12) || | | TRACTOR_ID || VARCHAR2(12) || ''p_id'' | ||
|- | |- | ||
| TRACTOR_TYPE || VARCHAR2(12) || | | TRACTOR_TYPE || VARCHAR2(12) || ''p_type'' | ||
|- | |- | ||
| DESCRIPTION || VARCHAR2(50) || | | DESCRIPTION || VARCHAR2(50) || ''p_desc'', if provided | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) || | | INACTIVE || VARCHAR2(1) || ''p_inactive'', if provided | ||
|- | |- | ||
| LOCATION_ID || VARCHAR2(12) || | | LOCATION_ID || VARCHAR2(12) || N/A | ||
|- | |- | ||
| TRACKING_ENABLED || VARCHAR2(50) || | | TRACKING_ENABLED || VARCHAR2(50) || N/A | ||
|- | |- | ||
| CONTACT_NO || VARCHAR2(50) || | | CONTACT_NO || VARCHAR2(50) || N/A | ||
|- | |- | ||
| MPG || NUMBER(6,3) || | | MPG || NUMBER(6,3) || ''p_mpg'', if provided. | ||
|- | |- | ||
| TRACK_REF || VARCHAR2(30) || | | TRACK_REF || VARCHAR2(30) || N/A | ||
|- | |- | ||
| VIN_NO || VARCHAR2(17) || | | VIN_NO || VARCHAR2(17) || ''p_vin'' if provided. | ||
|- | |- | ||
| FLEET_ID || VARCHAR2(100) || | | FLEET_ID || VARCHAR2(100) || N/A | ||
|- | |- | ||
| BLUE_LIGHT || VARCHAR2(1) || | | BLUE_LIGHT || VARCHAR2(1) || N/A | ||
|- | |- | ||
| TAIL_LIFT || VARCHAR2(1) || | | TAIL_LIFT || VARCHAR2(1) || N/A | ||
|- | |- | ||
| TOMTOM_ENABLED || VARCHAR2(1) || | | TOMTOM_ENABLED || VARCHAR2(1) || N/A | ||
|- | |- | ||
| EPOD_ENABLED || VARCHAR2(1) || | | EPOD_ENABLED || VARCHAR2(1) || N/A | ||
|- | |- | ||
| RAG || VARCHAR2(1) || | | RAG || VARCHAR2(1) || N/A | ||
|} | |} | ||
If a carrier or carrier name is provided, the carrier should be updated. | |||
To update vehicle carrier assignment. | To update vehicle carrier assignment. | ||
First, the process should find the carrier. This may be through the ID provided or the carrier name. If the carrier is not found, do not perform the update of the carrier assignment. Return an error. | |||
If the carrier is found, check whether the vehicle has a carrier entry. If it does not, one should be created. If found, it should be updated. | |||
Line 653: | Line 737: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| ID || NUMBER(10) || | | ID || NUMBER(10) || N/A | ||
|- | |- | ||
| TRACTOR_ID || VARCHAR2(12) || | | TRACTOR_ID || VARCHAR2(12) || ''p_id'' | ||
|- | |- | ||
| CARRIER_ID || VARCHAR2(12) || | | CARRIER_ID || VARCHAR2(12) || The carrier ID found | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) || | | INACTIVE || VARCHAR2(1) || ''p_inactive'' | ||
|} | |} | ||
{{Note}}As FleetCheck supports only one category assigned to each resource, then changing the category should make the prior carrier unavailable and this carrier available. The process should find all other carrier records and mark them inactive, if the user is being marked as active to this carrier. | |||
{{Note}} This is a method available to either system. Therefore, if updating carrier assignment from this method, this method should not then send an update out through the other system web service method. This is handled in the CTMS-FleetCheck interface, defined below. | |||
Line 677: | Line 765: | ||
Parameters: | Parameters: | ||
* Authorisation parameters | * Authorisation parameters | ||
* '' | * ''p_id'' - unique ID. Used when updating an existing trailer. | ||
* '' | * ''p_type'' - must be a valid trailer type in the system. Required when creating a trailer. | ||
* '' | * ''p_inactive'' - Optional. Will be assumed to be "N" when creating a new trailer if not provided. Values "Y" or "N". | ||
* '' | * ''p_carrier'' - must be a valid carrier id. Maximum 12 characters. Optional. Assumes trailer is not assigned to a carrier if omitted when creating a new trailer. | ||
* '' | * ''p_carriername'' - must be a valid carrier name. Maximum 50 characters. Optional. Assumes trailer is not assigned to a carrier if omitted when creating a new trailer. | ||
Procedure: DP_FLEETCHECK.TRAILER | |||
The process should first check the authorised user parameters. If the user does not have a default cost centre, return an error and do no more processing. | |||
Table RES_TRAILER | Table RES_TRAILER | ||
Line 692: | Line 781: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| TRAILER_ID || VARCHAR2(12) || | | TRAILER_ID || VARCHAR2(12) || ''p_id'' | ||
|- | |- | ||
| TRAILER_TYPE || VARCHAR2(12) || | | TRAILER_TYPE || VARCHAR2(12) || ''p_type'' | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) || | | INACTIVE || VARCHAR2(1) || ''p_inactive'' | ||
|- | |- | ||
| TRACKING_ENABLED || VARCHAR2(50) || | | TRACKING_ENABLED || VARCHAR2(50) || N/A | ||
|- | |- | ||
| COST_CENTRE_NAME || VARCHAR2(12) || | | COST_CENTRE_NAME || VARCHAR2(12) || from the user cost centre parameter | ||
|} | |} | ||
Line 706: | Line 795: | ||
To update trailer carrier assignment. | To update trailer carrier assignment. | ||
First, the process should find the carrier. This may be through the ID provided or the carrier name. If the carrier is not found, do not perform the update of the carrier assignment. Return an error. | |||
If the carrier is found, check whether the vehicle has a carrier group entry for the carrier group of that carrier. If it does not, one should be created. If found, it should be updated. | |||
Table RES_TRAILER_CARRIER_GROUP | Table RES_TRAILER_CARRIER_GROUP | ||
Line 716: | Line 805: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| ID || NUMBER(10) || | | ID || NUMBER(10) || N/A | ||
|- | |- | ||
| TRAILER_ID || VARCHAR2(12) || | | TRAILER_ID || VARCHAR2(12) || ''p_id'' | ||
|- | |- | ||
| INACTIVE || VARCHAR2(1) || | | INACTIVE || VARCHAR2(1) || ''p_inactive'' | ||
|- | |- | ||
| NAME || VARCHAR2(35) || Carrier Group, taken from RES_CARRIER. | | NAME || VARCHAR2(35) || Carrier Group, taken from RES_CARRIER.GROUP_NAME | ||
|} | |} | ||
{{Note}} This is a method available to either system. Therefore, if updating carrier assignment from this method, this method should not then send an update out through the other system web service method. This is handled in the CTMS-FleetCheck interface, defined below. | |||
{{Note}} Assigning a trailer to a carrier will check the carrier group of that carrier and assign the trailer to that carrier group. As trailers can only be assigned to one category in FleetCheck, if this trailer is assigned to another carrier group, this should be made unavailable to that prior carrier group. | |||
Line 739: | Line 832: | ||
Parameters: | Parameters: | ||
* Authorisation parameters | * Authorisation parameters | ||
* '' | * ''p_id'' - unique ID. Used when updating an existing tractor. | ||
* '' | * ''p_desc'' - Required when creating equipment. Maximum length 255. If id not provided, this will be used to identify the equipment. | ||
* '' | * ''p_qty'' - Optional. If not provided when creating new equipment, defaults to 1. | ||
Procedure: DP_FLEETCHECK.EQUIPMENT | |||
RES_EQUIPMENT | Table RES_EQUIPMENT | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 757: | Line 845: | ||
! Field !! Type !! Notes | ! Field !! Type !! Notes | ||
|- | |- | ||
| EQUIPMENT_TYPE || VARCHAR2(12) || | | EQUIPMENT_TYPE || VARCHAR2(12) || ''p_id''. {{Note}} This will be used as a unique identifier rather than a type. | ||
|- | |- | ||
| EQUIPMENT_DESCRIPTION || VARCHAR2(255) || | | EQUIPMENT_DESCRIPTION || VARCHAR2(255) || ''p_desc'' | ||
|- | |- | ||
| RPE | NUMBER || | | RPE || NUMBER || 0 | ||
|- | |- | ||
| WEIGHT | NUMBER || | | WEIGHT || NUMBER || 0 | ||
|- | |- | ||
| TRIP_FREQUENCY | VARCHAR2(20) || | | TRIP_FREQUENCY || VARCHAR2(20) || N/A | ||
|- | |- | ||
| QUANTITY | NUMBER || | | QUANTITY || NUMBER || ''p_qty'' if provided, else 1. | ||
|- | |- | ||
| LOADING_TIME | NUMBER || | | LOADING_TIME || NUMBER || 0 | ||
|} | |} | ||
Line 813: | Line 901: | ||
=== System Parameters === | === System Parameters === | ||
System parameters are required to control access to the FleetCheck interface. | |||
* FC_URL - the base URL for the FleetCheck system. | * FC_URL - the base URL for the FleetCheck system. | ||
Line 819: | Line 907: | ||
* FC_FLEET_KEY - the FleetCheck fleet being updated by C-TMS. | * FC_FLEET_KEY - the FleetCheck fleet being updated by C-TMS. | ||
* FC_TIMEOUT - the amount of time to wait when trying to update FleetCheck. | * FC_TIMEOUT - the amount of time to wait when trying to update FleetCheck. | ||
Line 829: | Line 914: | ||
Any triggers that must update FleetCheck should call the appropriate procedure within DP_FLEETCHECK. | Any triggers that must update FleetCheck should call the appropriate procedure within DP_FLEETCHECK. | ||
All triggers should be named appropriately to the table following system conventions | All triggers should be named appropriately to the table following system conventions. | ||
For example: | For example: | ||
TRG_RES_TRAILER_TYPE_BUI | |||
All FleetCheck code should be clearly marked in these triggers (as they may already exist and the code will be added to them). | |||
Line 843: | Line 927: | ||
The procedures will receive several parameters, predominantly driven by the data to send to FleetCheck. One is common: | The procedures will receive several parameters, predominantly driven by the data to send to FleetCheck. One is common: | ||
* | * p_action - (A)dd, (U)pdate or (D)elete. | ||
This will be determined by whether we are adding, updating or deleting data. | This will be determined by whether we are adding, updating or deleting data. | ||
Line 858: | Line 942: | ||
* ''FleetKey'' - from FC_ACCESS_FLEET. | * ''FleetKey'' - from FC_ACCESS_FLEET. | ||
The action for the web service call will be determined by the parameter | The action for the web service call will be determined by the parameter p_action: | ||
* A - POST | * A - POST | ||
* U - PUT | * U - PUT | ||
Line 870: | Line 954: | ||
If this is in the success range (200), this should be audited so that it is visible in the existing EDI Log screen as a successful send. | If this is in the success range (200), this should be audited so that it is visible in the existing EDI Log screen as a successful send. | ||
If this is in the error range (400), this should be audited so that it is visible in the existing EDI Log screen as an error. | If this is in the error range (400), this should be audited so that it is visible in the existing EDI Log screen as an error. Any data included in the error returned should be kept as part of the audit. | ||
{{Note}} It may be that, when adding a record into CTMS and therefore triggering the add of the record in FleetCheck, that this may already exist. In this case, the process will log the failure, if a failure code is returned - it will not then attempt to call the web service method again to update the existing record. It is expected that, if this were required, then the FleetCheck web services should support that automatically, as the CALIDUS web services will. | |||
=== Audit Logging === | |||
Actions taken when updating data will be audited in the system through this user account. | |||
All package code will audit to ADM_EDI_AUDIT, for success and failure. | |||
{| class="wikitable" border="1" | |||
|-bgcolor="silver" | |||
!Field !! Comment | |||
|- | |||
|STMT || Generated | |||
|- | |||
|PROG_NAME || Package and procedure, dot delimited e.g. DP_FLEETCHECK.UPDATE_EXTERNAL_TYPE | |||
|- | |||
|ORI_USER || As normal | |||
|- | |||
|USER_SESSION || As normal | |||
|- | |||
|ERR_TYPE || 'ERROR' if an error, 'INFO' otherwise. 'AUDIT' may be used for debugging statements, but should be limited. | |||
|- | |||
|DATE_CREATED || System date and time | |||
|- | |||
|ERR_MESSAGE || The generated error message for an error plus an indication of the data e.g. "Error updating trailer type XXX: YYYY", otherwise a success message indicating the action taken, identifying the data e.g. "Trailer type XXX updated". | |||
|- | |||
|SCHED_NAME || N/A | |||
|- | |||
|CUSTOMER_ID || N/A | |||
|- | |||
|LOCATION_ID || N/A | |||
|} | |||
=== External Type === | === External Type === | ||
To add, update or delete FleetCheck External Types (trailer types). | |||
Whenever | Whenever trailer types are added to C-TMS, edited or deleted (i.e. in a database trigger), the system will call DP_FLEETCHECK.UPDATE_EXTERNAL_TYPE, passing in parameters of: | ||
* | * p_action - (A)dd, (U)pdate or (D)elete. | ||
* | * p_id - the trailer type (RES_TRAILER_TYPE.TRAILER_TYPE). | ||
* | * P_desc - the trailer type description. | ||
The system will do this by adding a FleetCheck trigger to | The system will do this by adding a FleetCheck trigger to the table RES_TRAILER_TYPE. | ||
DP_FLEETCHECK.UPDATE_EXTERNAL_TYPE will call the FleetCheck web service method to update External Types, method | DP_FLEETCHECK.UPDATE_EXTERNAL_TYPE will call the FleetCheck web service method to update External Types, method: "UpdateExternalType.ashx". | ||
Parameters: | Parameters: | ||
* Authentication | * Authentication parameters. | ||
* ''ExternalTypeId'' - | * ''ExternalTypeId'' - p_id | ||
* ''ExternalTypeDescription'' - | * ''ExternalTypeDescription'' - p_desc | ||
=== Category === | === Category === | ||
To add or | To add, update or delete FleetCheck Categories (home fleet carriers) | ||
Whenever carriers are added to C-TMS, edited or deleted (i.e. in a database trigger), the system will call DP_FLEETCHECK.UPDATE_CATEGORY, passing in parameters of: | |||
* p_action - (A)dd, (U)pdate or (D)elete. | |||
* p_id - the carrier ID (RES_CARRIER.CARRIER_ID). | |||
* p_name - the carrier name (RES_CARRIER.CARRIER_NAME). | |||
The system will do this by adding a FleetCheck trigger to table RES_CARRIER. | |||
DP_FLEETCHECK.UPDATE_CATEGORY will call the FleetCheck web service method to update Categories, method: "UpdateCategory.ashx". | |||
Parameters: | Parameters: | ||
* Authentication parameters. | * Authentication parameters. | ||
* ''CategoryName'' | * ''CategoryName'' - p_name | ||
* ''CategoryId'' - | * ''CategoryId'' - p_id | ||
Line 908: | Line 1,032: | ||
To update driver carrier assignment. | To update driver carrier assignment. | ||
Whenever drivers are assigned to carriers in C-TMS, edited or deleted (i.e. in a database trigger), the system will check and attempt to update FleetCheck. | |||
The system will do this by adding a FleetCheck trigger to table RES_PERSON_CARRIER. | |||
When a driver carrier record is created or INACTIVE set to "N", the process will call DP_FLEETCHECK.UPDATE_DRIVER_CATEGORY, passing in parameters of: | |||
* p_action - (A)dd, (U)pdate or (D)elete. | |||
* p_id - the carrier ID (RES_PERSON_CARRIER.CARRIER_ID). | |||
* p_driver - the driver ID (RES_PERSON_CARRIER.ID). | |||
* p_user - the user making the amendment. | |||
The procedure DP_FLEETCHECK.UPDATE_DRIVER_CATEGORY will check the user (p_user) making the amendment. | |||
If this is not the default FLEETCHECK user, the process will retrieve the carrier name CARRIER_NAME using the carrier ID provided (p_id) from RES_CARRIER. | |||
Then the procedure will call the FleetCheck web service method to update Driver Categories, method: "UpdateDriverCategory.ashx". | |||
Parameters: | Parameters: | ||
* Authentication parameters. | * Authentication parameters. | ||
* ''DriverId'' | * ''DriverId'' - p_driver | ||
* '' | * ''CategoryName'' - the retrieved carrier name from RES_CARRIER.CARRIER_NAME. | ||
Furthermore, all other entries for that driver against other carriers will be set to INACTIVE = "Y". The process will update all of these records at the end of the process. | |||
Line 922: | Line 1,060: | ||
To update vehicle carrier assignment. | To update vehicle carrier assignment. | ||
Whenever tractors are assigned to carriers in C-TMS, edited or deleted (i.e. in a database trigger), the system will check and attempt to update FleetCheck. | |||
The system will do this by adding a FleetCheck trigger to table RES_TRACTOR_CARRIER. | |||
When a tractor carrier record is created or INACTIVE set to "N", the process will call DP_FLEETCHECK.UPDATE_TRACTOR_CATEGORY, passing in parameters of: | |||
* p_action - (A)dd, (U)pdate or (D)elete. | |||
* p_id - the carrier ID (RES_TRACTOR_CARRIER.CARRIER_ID). | |||
* p_vehicle_id - the vehicle registration (RES_TRACTOR_CARRIER.TRACTOR_ID). | |||
* p_user - the user making the amendment. | |||
The procedure DP_FLEETCHECK.UPDATE_TRACTOR_CATEGORY will check the user (p_user) making the amendment. | |||
If this is not the default FLEETCHECK user, the process will retrieve the carrier name CARRIER_NAME using the carrier ID provided (p_id) from RES_CARRIER. | |||
Then the procedure will call the FleetCheck web service method to update Vehicle Categories, method: "UpdateVehicleCategory.ashx". | |||
Parameters: | Parameters: | ||
* Authentication parameters. | * Authentication parameters. | ||
* ''VehicleRegistration'' | * ''VehicleRegistration'' - p_vehicle_id | ||
* ''CategoryName'' | * ''CategoryName'' - the retrieved carrier name from RES_CARRIER.CARRIER_NAME. | ||
Furthermore, all other entries for that tractor against other carriers will be set to INACTIVE = "Y". The process will update all of these records at the end of the process. | |||
Line 936: | Line 1,088: | ||
To update trailer carrier assignment. | To update trailer carrier assignment. | ||
Whenever trailers are assigned to carriers in C-TMS, edited or deleted (i.e. in a database trigger), the system will check and attempt to update FleetCheck. | |||
The system will do this by adding a FleetCheck trigger to table RES_TRAILER_CARRIER_GROUP. | |||
When a tractor carrier record is created or INACTIVE set to "N", the process will call DP_FLEETCHECK.UPDATE_TRAILER_CATEGORY, passing in parameters of: | |||
* p_action - (A)dd, (U)pdate or (D)elete. | |||
* p_id - the carrier group ID (RES_TRAILER_CARRIER_GROUP.NAME). | |||
* p_vehicle_id - the trailer ID (RES_TRAILER_CARRIER_GROUP.TRAILER_ID). | |||
* p_user - the user making the amendment. | |||
The procedure DP_FLEETCHECK.UPDATE_TRAILER_CATEGORY will check the user (p_user) making the amendment. | |||
If this is not the default FLEETCHECK user, the process will retrieve the carrier name CARRIER_NAME of the first carrier found in this carrier group using the carrier group ID provided (p_id) from RES_CARRIER. | |||
Then the procedure will call the FleetCheck web service method to update Vehicle Categories, method: "UpdateVehicleCategory.ashx". | |||
Parameters: | Parameters: | ||
* Authentication parameters. | * Authentication parameters. | ||
* '' | * ''VehicleRegistration'' - p_vehicle_id | ||
* ''CategoryName'' | * ''CategoryName'' - the retrieved carrier name from RES_CARRIER.CARRIER_NAME. | ||
Furthermore, all other entries for that trailer against other carrier groups will be set to INACTIVE = "Y". The process will update all of these records at the end of the process. | |||
<!-- INTERNAL COSTS | |||
Description Days Notes System | |||
Inbound from FleetCheck to CTMS | |||
General RESTful web service project in .NET 3.0 Plus security/insertion checks. General error handling .NET | |||
BAL/DAL: .NET | |||
BAL (Business logic) 3.75 .NET. 5 required (one for each method plus authorisation) @0.75e .NET | |||
DAL (Data Access, specific to CTMS) 2.5 .NET and also potentially Oracle Packages. 5 @ 0.5ea .NET/CTMS | |||
Authentication fields/parameters 0.5 CTMS | |||
Outbound from CTMS to FleetCheck | |||
System parameters for FC web service 0.5 CTMS | |||
Immediate update of FleetCheck when data updated 3.0 5 different processes, added as triggers, running if FC I/F enabled CTMS | |||
Total 13.25 | |||
--> | |||
<!-- NEW PAGE --> | <!-- NEW PAGE --> | ||
{{Doc_AppendixNew | {{Doc_AppendixNew | ||
|Appendix=A | |Appendix=A | ||
|Estimate= | |Estimate=Y | ||
|Glossary=CTMS | |Glossary=CTMS | ||
|Ref1=[[REQ 370536 FleetCheck Interface]] | |Ref1=[[REQ 370536 FleetCheck Interface]] | ||
|RefV1=0.3 | |RefV1=0.3 | ||
|RefDate1=06/ | |RefDate1=06/05/2020 | ||
|REQ=0 | |REQ=0 | ||
|EST=0 | |EST=0 | ||
|FS= | |FS=3.00 | ||
|TS=0 | |TS=0 | ||
|DEV= | |DEV=13.25 | ||
|ST= | |ST=3.00 | ||
|IMP= | |IMP=2.00 | ||
|PM= | |PM=2.25 | ||
|Client={{#var:Client}} | |Client={{#var:Client}} | ||
|Year={{#var:Year}} | |Year={{#var:Year}} |