xml-updater v1.0.1
XML Update Process for Renewal Notices
in the state of Massachusetts (only)
Process
Pick up the xml files in located in the
F:/Groups/Auto Jobs/Exports/Varidoc/Renewal Notices/New/Pendingdirectory and process the file with the requirements listed below.Once the file has been processed place the processed file in the
F:/Groups/Auto Jobs/Exports/Varidoc/Renewal Notices/Newdirectory, where it will be picked up and sent over to the vender via FTP.Place a copy of the processed file in the
F:/Groups/Auto Jobs/Exports/Varidoc/Renewal Noticesdirectory for audit records.Move the original file out of pending to
F:/Groups/Auto Jobs/Exports/Varidoc/Renewal Notices/Original Copies.Repeat steps 1 - 4 everytime there are new files. For this reason the application is triggered by events and watches the
Pendingdirectory for additions.
To run
From the command line run the command yarn dev to start the application in development
To start in production yarn start or node src/index.js
Requirements
All of the following changes will only be applied where the
ServiceState=== 'MA'Add
NewRateInCentsfield to eachStandardizedFileNewRateInCentsdata can be gathered from theRateand converted to cents (multiply by 100) and format to two decimal places.
Add
CurrentRateInCentsfield to eachStandardizedFileThe Current Rate for individual customers must be queried for in the RatePlanContract table under the 'Cntrt_Rate' and 'Cntrt_CustNo' columns and the 'cm_custno' column CustomerMaster table and joined by the customer number in the ClearviewPrd database. Note: You can sort out states that are not 'MA'
Once you have this list, you can collect the current rates based on the
CustNo
Add
ContractEndMonthandContractEndYearin eachStandardizedFile- Both of these fields can be gathered from 
ContractEndDatein the eachStandardizedFile 
- Both of these fields can be gathered from 
 
Other Notes from the vender:
- Xml files must contain xml declaration
 - Each open and closing tag must be on the same line (except tags containing other tags)
 - xml needs to be formated
 - Brodnax does not accept duplicate file names
 
TODO:
- Connect Pino logging to the company's SQL Server Reporting Services
 Move application to production environment (ie. place on server)
- Check that drives of file locations are the same
 
Create automated removal of processed files from the pending directory