Skip to main content

Standard Sub Customers Import

Introduction

This will import Sub customers.

download sample sub-customers import file.

Fields

Visn Sub Customers Import

Field nameDescriptionMax lengthDatatypeRulesMandatoryDefault ValueExample
Customer Name Customer Name 50Stringa-zA-Z0-9- 'NSenger Boyer and Corkery
Company Registration Number Company Registration Number 50StringA-Z and 0-9 & All Special CharN04876932
Account NumberAccount Number50StringA-Z and 0-9 & All Special CharYACC852614
VAT NumberVAT Number10StringA-Z and 0-9 & All Special CharNGB244524763
Vehicle ProductVehicle Product50StringA-Z and 0-9 & All Special CharNBusiness Contract Hire
Consumer Consumer 1String‘Y' / 'N’NY
Cost Centre Cost Centre 15String[ A-Za-z0-9_@./'#&+-/(/)' ']N10
Invoice Centre Invoice Centre 15String[ A-Za-z0-9_@./'#&+-/(/)' ']N100
Building Number Building Number 50StringA-Z and 0-9 & All Special CharN20
Street Name Street Name 100StringA-Z and 0-9 & All Special CharNGeorge Street
District District 50StringA-Z and 0-9 & All Special CharNLambeth
Town Town 100StringA-Z and 0-9 & All Special CharNLondon
County County 50StringA-Z and 0-9 & All Special CharNSurrey and Kent
Postcode Postcode 15String[a-zA-Z0-9]NB57AA
Contact Name Contact Name 50Stringa-zA-Z0-9- 'NAdah
Email Email 50StringStandard email formatNjitendra+urbkir@digitalinnk.com
Contact Number Contact Number 15Numeric0-9N01234567891
Mobile NumberMobile Number15Numeric0-9N01234567890
Alert EmailAlert Email50StringStandard email formatNalertEmail+lynewy@digitalinnk.com
Policy NotesPolicy Notes250StringA-Z and 0-9 & All Special CharNI'll navigate the cross-platform UTF8 capacitor, that should interface the XML transmitter!

Importing a file

Preparation

  1. Create a new branch with Jira task number in the branch name

  2. Delete all the files in importFiles folder

  3. Create a folder with the current sprint number

  4. Copy the file that needs to be imported

  5. Go to package.json , find the line validate:subCustomers

  6. Modify --leaseId with the required lease Id

  7. Modify --file with the relative path of the file

  8. Save package.json

Validating locally

  1. in a terminal run npm run build

  2. in a terminal run npm run validate:subCustomers

  3. If there are no errors, push the code

Validating in workflow

  1. Go to Action of Import-manger

  2. Find <Environment> - on-demand-import

  3. Select the branch that was created for this import

  4. Enter script name as validate:subCustomers

  5. Leave Overrides empty

Importing the file

  1. If the validation has passed

  2. Go to Actions of import manager repo

  3. Find <Environment> - on-demand-import

  4. Select the branch that was created for this import

  5. Enter script name as import:subCustomers

  6. Enter --persist in Overrides field

Importing the file via cloud run

Creating Schedulers for validating the sub-customers

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: sub_customer_import_file_validation
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/import-subCustomers
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for sub_customer_import_file_validation scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "subCustomers.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com"
}

Create scheduler for validating the sub-customers

Creating Schedulers for importing the sub-customers

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: sub_customer_file_import
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/import-subCustomers
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for sub_customer_file_import scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "subCustomers.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com"
}

Create scheduler for importing the sub-customers

Preparation:

  1. Bucket name is biddirect-2.appspot.com and it will vary for higher envs and the file path should imports/fileDrop, where you can drop the CSV file named "subCustomers". This action will place the file in the specified location within the designated bucket.

Validation:

  1. Go to Cloud Scheduler
  2. Run sub_customer_import_file_validation job (job name could be different on other env)
logs in cloud

Importing:

  1. Go to Cloud Scheduler
  2. Run sub_customer_file_import job (job name could be different on other env)
logs in cloud

Testing:

  1. Sub-customers will be created under customer. You can verify this by navigating to the ViSN customer platform and selecting Settings > Customers.
Status: Pending Approval
Category: Protected
Authored By: Harish on March 25, 2024
Revisions