Skip to main content

Lex SNM2 Network Import

Introduction

This is a full import which will import Labour Rates and Parts Discount for existing suppliers which belong to LEX.

download sample lex snm2 import file.

Fields

LEX SNM2 Network Import

Column PositionHeader NameMap to ViSN Fields (Description)DatatypeValidationMax lengthMandatoryDefault ValueExample
1SNM1IGNORE(This field will not be imported)No
2RecordVersionNoIGNORE(This field will not be imported)No
31LinkSiteReferenceDI Group ID - DI Supplier IDStringA-Z, 0-9 and hyphen(Hyphen is mandatory and should have strings containing A-Z,0-9 before and after it)50YesALRbwQqIVhr0wBjWu0Wp-lIi9PzxKgG9GahqAf4HM
4SchemeIGNORE(This field will not be imported)No
5ServiceCentreNameIGNORE(This field will not be imported)No
6SupplierAccountReferenceSupplier IDStringA-Z ,0-920Yes020237
7FranchiseHeldManufacturer codeStringA-Z ,0-9 and all special characters30YesB4
8PreferenceIGNORE(This field will not be imported)No
9ExpectedLabourRateLabour Rate Car / Labour Rate LCV / Labour Rate EVString0-9 and . (decimal number)6Yes4.5
10ExpectedPartsDiscountParts DiscountString0-9 and . (decimal number)5No94.5
11ReviewDateIGNORE(This field will not be imported)No
1233++IGNORE(This field will not be imported)No

Prerequisites and how the import works

  • This is a full import in which the supplier Id, Labour Rate Car or Labour Rate LCV or Labour Rate EV and parts discount will be imported.

  • The 1LinkSiteReference(Column C) is the combination of DI Group Id and DI supplier Id which will be used to update these values for a supplier and they will be imported in the lease supplier level

  • The franchise and vehicle type should be already present against the franchises in the lease supplier level. The manufacturer code(FranchiseHeld - Column F) in the csv will be used to find the existence of franchise and corresponding vehicle type against the supplier.

  • A row will be skipped if a matching franchise is not found against the supplier or if the 1LinkSiteReference doesn't have a valid DI Group Id and DI supplier Id.

Importing a file

Preparation

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

  2. Delete all the files within the importFiles folder to prevent accidental import of incorrect files

  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:lex-snm2-network-import

  6. Modify --leaseId with the required lease Id

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

  8. Save the package.json

Validating locally

  1. in a terminal run npm run build

  2. in a terminal run npm run validate:lex-snm2-network-import

  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:lex-snm2-network-import

  5. Leave Overrides empty or you can specify --leaseId or --file if required

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 validate:lex-snm2-network-import

  6. Enter --persist in Overrides field

Importing and validating the file via cloud run

Creating Schedulers for validating the Lex SNM2 delta file

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: lex-snm2-network-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/lex-snm2-network-import
  • 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 lex-snm2-network-validation scheduler

{
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "SNM2-full-labour-rates.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"leaseId": "QJKgdjS4I02sEia4yTne"
}

Create scheduler for validating Lex SNM2 file

Creating Schedulers for importing the Lex SNM2 file

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: lex-snm2-network-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/lex-snm2-network-import
  • 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 lex-snm2-network-import scheduler

{
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "SNM2-full-labour-rates.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com"
}

Create scheduler for importing Lex SNM2 file

Preparation:

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

Validation:

  1. Go to Cloud Scheduler
  2. Run lex-snm2-network-validation job

Importing:

  1. Go to Cloud Scheduler
  2. Run lex-snm2-network-import job
logs in cloud

Testing

  1. Supplier Id, labour rate for Car, LCV or EV and parts discount will be updated in the supplier config screen for lex customer.
Status: Pending Approval
Category: Protected
Authored By: Vignesh Kanthimathinathan on Nov 11, 2024