Skip to main content

Zenith Sub Customers Import

Introduction

This will import zenith sub customers.

download sample sub-customers import file.

Fields

Zenith Sub Customers Import

Zenith Customer contract fieldsDescriptionMax lengthData TypeRules MandatoryDefault ValueExample
Customer NameCustomer Name150StringA-Z & 0-9 and special charactersNÉléonore-Marie de Bourbon-Condé
Customer Account NumberAccount Number50StringA-Z & 0-9 and special charactersYZNKFHA04
VAT NumberVAT Number10StringA-Z and 0-9 & All Special CharNGB244524763
Vehicle ProductVehicle Product50StringA-Z and 0-9 & All Special CharNBusiness Contract Hire
Cost Centre Cost Centre 15String[ A-Za-z0-9_@./'#&+-/(/)' ']N10
Invoice Centre Invoice Centre 15String[ A-Za-z0-9_@./'#&+-/(/)' ']N100
Address 1Building Number 50StringA-Z and 0-9 & All Special CharN20
Address 2Street Name 100StringA-Z and 0-9 & All Special CharNGeorge Street
Address 3District 50StringA-Z and 0-9 & All Special CharNLambeth
Address 4Town100StringA-Z and 0-9 & All Special CharNLondon
Address 5County50StringA-Z and 0-9 & All Special CharNSurrey and Kent
PostcodePostcode15String[a-zA-Z0-9]NB57AA
Customer EmailEmail 50StringStandard email formatNjitendra+urbkir@digitalinnk.com
Customer ContactContact Number15Numeric0-9N01234567891
Customer NumberMobile Number15Numeric0-9N01234567890
Customer Policy NotesPolicy Notes250StringA-Z and 0-9 & All Special CharNI'll navigate the cross-platform UTF8 capacitor, that should interface the XML transmitter!
Customer Recharge LimitRecharge Limit6Numeric0-9N300
Customer Referral LimitReferral Limit6Numeric0-9N300

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:zenithSubCustomers

  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:zenithSubCustomers

  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:zenithSubCustomers

  5. Leave Overrides empty

Importing the file

  1. If the validation has passed

  2. Go to Action of Import-manger

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

  4. Select the branch that was created for this import

  5. Enter script name as import:zenithSubCustomers

  6. Enter --persist in Overrides field

Importing the file via cloud run

Creating Schedulers for validating the zenith-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: zenith_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 zenith_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": "zenithSubCustomer.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_SUB_CUSTOMER"
}

Create scheduler for validating the zenith-sub-customers

Creating Schedulers for importing the zenith-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: zenith_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 zenith_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": "zenithSubCustomer.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_SUB_CUSTOMER"
}

Create scheduler for importing the zenith-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 "zenithSubCustomer". This action will place the file in the specified location within the designated bucket.

Validation:

  1. Go to Cloud Scheduler
  2. Run zenith_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 zenith_sub_customer_file_import job (job name could be different on other env)
logs in cloud

Testing

  1. Zenith 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: Hadley on June 20, 2024
Revisions