Vehicle Import Overview
Vehicle import is one of the key features of Webed 9. It provides a user with the fastest way to input data from a file to WebEd 9. Vehicle import will run based on setting in "Vehicle setting".
How to use Vehicle Import
Vehicle import can run in 2 ways:
-
1In background task: vehicle import run automatically scheduled by the user in the background task setting.
-
2By user click: the user can manually active vehicle import run.
NOTE: Import images for vehicles via the Vehicle Import menu will AUTOMATICALLY convert and create a WebP file.
Setting background tasks for vehicle import
-
1Log in as an administrator and go to the Admin Dashboard.
Learn how to log in here → -
2
Go to the admin page > find background task setting
-
3In background task look for the "Vehicle Setting task" setting then click the config icon
-
4Config background task
- Schedule Type: Interval = run after an amount of time, Schedule = set time to run every day
- Start time: (only enable if choose schedule) choose time to run
- Interval seconds: input how many seconds the task run
- Status: active/inactive
-
5After finishing config > Save
Run vehicle import manually
-
1Log in as an administrator and go to the Admin Dashboard.
Learn how to log in here → -
2Prepare file import: The file import name must be the same as the file name in the site setting "Vehicle setting"
-
3Go to admin page > File Manager
-
4Go to Media\Vehicles\Uploads > click upload file > choose the correct import file
-
5Go to the admin page > vehicle listing > Click import now (Only enable when having a waiting file)
-
6Or go direct to vehicle import on the admin page then look at the result message
Vehicle Module Specific Site Settings
-
1Log in as an administrator and go to the Admin Dashboard.
Learn how to log in here → -
2Go to Admin > Site Settings > Vehicle Settings > Click to show value.
NAME | INFO | VALUES |
Only Display Vehicle Has Images | Only display the vehicle that has an image. If a stock code has no images, it will not be displayed. |
true = hide all vehicles without images false = allow no image vehicle to be shown |
Manually Import Vehicle | Enable the Vehicle import feature in the Admin module Vehicle Index page |
true = Import button is shown false = Import button is hidden |
Uploaded Data File Directory | where the vehicle import will find and read import fil |
/Uploads |
Vehicle Images Directory | where vehicle import check and import images |
/Images |
Logs Directory | Record file path log. |
/Logs |
Backup Directory |
Record file path backups. |
/Backups |
No Vehicle Image | Image used when a vehicle image cannot be found. |
/NoImage.jpg |
Imported File Name | The name of the imported file. | NameFile.tsv |
Days Prior Remove Backup Files | Files in the backup directory that have been created for several days will be deleted. If it is zero, that means no delete. |
0 |
Days Prior Remove Uploaded Images |
Uploaded vehicle images that have been modified for several days will be deleted. If it is zero, that means no delete |
90 |
Days Prior Remove Old Images | Vehicle images that have been modified for several days will be deleted. If it is zero, that means no delete |
90 |
Dealer Site URL | Site of Dealer. This will be shown on vehicle details in the dealer contact section | http://webed9.customercommunity.com.au/ |
Troubleshooting Vehicle Import
Troubleshoot Vehicle Import Overview
If the vehicle listing won't show as expected. Here is a simple way to find out what's going wrong.
Troubleshooting Guide for Vehicle Management
Expect the vehicle doesn't show in the listing have many reasons: go to the vehicle listing on the admin page
-
1Log in as an administrator and go to the Admin Dashboard.
Learn how to log in here → -
2Expect the vehicle hasn't been imported yet: check the data receive date or file awaiting import.
-
3Expect vehicle doesn't have an image: vehicles that don't have ticked in the "has image" column are not shown on the listing.
-
4If there is no file awaiting import and all vehicles have an image: download the latest import find and check the data.
Note: If you did all things above but still can't find out the problem. Please contact [email protected]
Monitoring Vehicle Feeds
The Vehicle Feed Monitoring Overview
This function will help us keep tracking the vehicle up to date. If we didn't receive the import file for 24 hours an email notification will be sent to support. So it will help us more actively to control the vehicle.
The Vehicle Feed Monitoring Description
This function will run along with the vehicle import process. The vehicle import process is a background task and it will run based on the user's preference. The run interval can be changed by doing the following steps:
-
1Log in as an administrator and go to the Admin Dashboard.
Learn how to log in here → -
2Navigate to Settings > System Settings > Background Tasks
-
3Click the Config icon corresponding to Vehicle Import Task
-
4Set the preferred run interval on the Interval (seconds) field
If the vehicle import file is older than 24 hours, an email notification will be sent to [email protected].
The email notification will look like this
Publish an API for Carsales Data (Used to Import Vehicle)
API for Carsales Data Overview
We will publish the API for Carsales to post their data. When Carsales get an update on a vehicle, they call us and we get the new data. We want to process directly into the data tables, not use a CSV file.
We also need to understand how images are handled. We want the images on our server, not linking to images on Carsales.
Import vehicle via JSON files
As we know, we already have a feature to import vehicles via files (CSV, TSV). With the current import function, we process the files (import files and image files) imported by User via FTP. Regarding the new request from Carsales, they will be using our publish API to POST the Vehicle-Json files, our system will process these JSON files to get Vehicle Information and Vehicle Images.
I went through the original Import Vehicle function to get the workflow and check if we can reuse the original function. The answer here's, we cannot reuse the original functions because of these things:
- Structure objects are different: Original functions is using files and process line by line. Vehicle-Json is an object and it's included child objects.
- Vehicle's Images: Original functions handler manual upload by User. Vehicle-JSON, we need to download the image via URL in a JSON file
- We don't want to affect the original function which using on live sites.
New function Import vehicle via JSON files
Based on the idea above, I would like to suggest the new import functions which will handle JSON files (vehicle information and Images).
- Define API, log request, log response
- Define security API (basic authentication, spam,...)
- Mapping JSON data to WebEd object for import vehicles
- Handler import functions (need to create the new function for import)
- Handler downloads images and Mapping with vehicle (download and convert to WebP)
We separate the import function, but we still keep the same goal "Vehicle Import Correctly and Vehicle's Image correctly"
Summary of the Original Import Workflow:
- Write log import
- Get vehicle site setting
- Move file upload to process
- Get dealer name
- Get dealer state
- Import vehicle from file to VehicleLogs tables
- Loop all file
- Read line by line
- Check stocknumber exist
- Update/insert VehicleLogs
- Check and update vehicle images
- Output total records, start index - end index
- Move vehicles from VehicleLogs to Vehicles
- Clean up the VehicleLogs
- Convert WebP for all uploaded images
Vehicle-JSON mapping files
When I compared the vehicle-json with Import CSV/TSV fields, I found that's many fields that have not been included on the JSON. Here's a summary, the field with a question mark does not exist on JSON
StockNo - Identification- StockNumber
DealerCode - Seller- Identification - LegacyId
ManuYear → BuildDate → Year
Make - Specification.Make
Model - Specification.Model
Series - Specification.Series
Badge - Specification.Attributes.Badge
Body - Specification.Attributes.Body
Doors - Specification.Attributes.Doors
Seats - Specification.Attributes.Seats
BodyColour - see Colours Exterior
TrimColour - see Colours Interior
Gears - Specification.Attributes.Gears
Gearbox - Specification.Attributes.Transmission
FuelType - Specification.Attributes.FuelType
Retail - SaleType? see ListingType, SaleStatus & SaleType
Rego - see Registration
Odometer - OdometerReadings
Cylinders - see Specification Attributes Cylinders
EngineCapacity - see Specification Attributes EngineSize
VINNumber - see Identification VIN
EngineNumber - n/a. Not a value we have to provide
ManuMonth - BuildDate → Month
Options - Detailed vehicle options are only provided to RedBook subscribers
Comments - see Description
NVIC - We only use RedBook data, see Specification SpecificationCode
IsDemo - see ListingType, if the vehicle is an applicable selected demonstrator, it will be sent with "Demo".
DriveAwayPrice - see PriceList DAP
PorscheCertification - if applicable see Certifications
NUD - n/a
OriginalPrice - n/a. we only supply the vehicles listed price, ee PriceList EGC&DAP
IsApproved → With regards to the approved certification, if the vehicle is flagged, it will be included within the "Certifications" fields, the example provided notes "Porsche Approved Vehicle".
Estimation
Based on the breakdown list above, I would like to update the estimation:
- Define API, log request, and log response (3 hours)
- Define security API (basic authentication, spam,...) (2 hours)
- Mapping JSON data to WebEd object for import vehicles: define model objects for mapping (2.5 hours)
- Handler import functions (need to create the new function for import) (10 hours)
- Handler downloads images and Mapping with vehicle (download and convert to webp) (8 hours)
- Test and deployment to the test site ( 1.5 hours)
- Create task document: requirement, flowchart, mapping,... on confluence page (2.5 hours)
- Create APIs Document (2.5 hours)
- Create APIs test plan, and test video (3 hours)
Clarifications and Questions
Send an email to Carsales for these things:
1- Need confirmation with Carsales. Are there any changes on the JSON file (10 months ago) that they send us?
2- Every dealer will have a published API URL base on that dealer.
E.g. https://porschecentreadelaide.com.au/API/importVehicle
https://porschebrighton.com.au/API/importVehicle
3- Request Carsales for more Vehicle-Json. We need more JSON for testing.
Update from Carsales (21 Jul 21): "Vehicles are sent individually per transaction"
APIs Documentation
Please find attached the documentation of one of our APIs https://docs.google.com/document/d/1AeSEc01CeqdeJitlKpaQqC7jbcATOQ42BNjZzhxt_KY/edit?usp=sharing
We are using postman to call API. Please download and install postman, then use the account below:
Username: [email protected]
Password: gpz110000