LeaseCompany_Stock Tables
The leaseCompany_stock_changelog and leaseCompany_stock_latest tables stores the stock details for all lease companies, including allocation, vehicle information, notifications, and associated customer/contract data.
πΉ Standard Columnsβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
document_name | STRING | YES | Firestore document path reference | 
document_event_id | STRING | YES | Unique identifier for the document event | 
document_timestamp | TIMESTAMP | YES | Timestamp of the document modification/creation | 
document_operation | STRING | YES | Type of document operation (e.g., INSERT, UPDATE, DELETE) | 
document_id | STRING | YES | Unique document ID in Firestore | 
stockId | STRING | YES | Unique ID for the stock record | 
addedByUser | BOOL | YES | Whether the record was manually added by a user | 
addedByUserId | STRING | YES | ID of the user who added the record | 
argicCode | STRING | YES | Internal or classification code | 
assetId | STRING | YES | ID of the physical asset | 
capid | STRING | YES | CAP ID used for valuation or classification | 
colour | STRING | YES | Colour of the vehicle | 
fuelType | STRING | YES | Type of fuel | 
isRFLSupplierManaged | BOOL | YES | If the Road Fund Licence is managed by supplier | 
makeCode | STRING | YES | Code representing the make | 
modelCode | STRING | YES | Code representing the model | 
make.label | STRING | YES | Label/name of the make | 
model | STRING | YES | Vehicle model name | 
registrationDate | TIMESTAMP | YES | Date of vehicle registration | 
rflRenewalDate | STRING | YES | Date for RFL renewal | 
motDueDate | TIMESTAMP | YES | MOT due date | 
vehicleEndDate | STRING | YES | End date of the vehicleβs service | 
vehicleType | STRING | YES | Type/classification of the vehicle | 
vin | STRING | YES | Vehicle Identification Number | 
vrm | STRING | YES | Vehicle Registration Mark | 
variant | STRING | YES | Variant of the model | 
carClass | STRING | YES | Class/category of the car | 
assetNumber | STRING | YES | Number assigned to the asset | 
departmentCode | STRING | YES | Code of the department | 
branch | STRING | YES | Branch code | 
group | STRING | YES | Group the vehicle belongs to | 
dailyLicenceCheckReportEmail | STRING | YES | Email used for daily license check reports | 
customerAlertEmail | STRING | YES | Email address for customer alerts | 
vehicleNotes | STRING | YES | Notes related to the vehicle | 
addedToOECList | BOOL | YES | Whether added to the OEC list | 
independent | BOOL | YES | Flag for independent supplier | 
franchise | BOOL | YES | Franchise flag | 
mobile | BOOL | YES | If mobile support is available | 
serviceProgramIncludedFlag | BOOL | YES | Whether service program is included | 
schemeDataRef | STRING | YES | Reference to scheme data | 
authorityNotes | STRING | YES | Notes related to vehicle authority or use | 
warrantyExpiryDate | TIMESTAMP | YES | Expiry date of the warranty | 
warrantyParameterMileage | STRING | YES | Parameter to determine mileage warranty | 
vrmLookedUp | BOOL | YES | Has Vrm look up been performed for the stock | 
πΈ Struct Columnsβ
addedTimeStampβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
_seconds | INT64 | YES | Seconds part of timestamp | 
_nanoseconds | INT64 | YES | Nanoseconds part of timestamp | 
ancillaryEquipmentβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
crane | BOOL | YES | If crane is included | 
fridge | BOOL | YES | If fridge is included | 
tailLift | BOOL | YES | If tail lift included | 
Notificationsβ
- 
carHealthCheckNotification - 
lcvHealthCheckNotification - 
mileageNotification - 
motReminderNotification - 
oilCheckNotification - 
serviceManagerNotification 
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
lastSent | TIMESTAMP | YES | When notification was last sent | 
lastSentTimestamp | TIMESTAMP | YES | Timestamp of last notification | 
customerβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
costCentre | STRING | YES | Cost center for the customer | 
customerAccountNumber | STRING | YES | Customer account number | 
customerName | STRING | YES | Name of the customer | 
customerRechargeLimit | STRUCT | YES | Recharge limit info in multiple formats: masked : (STRING), raw : (FLOAT), value : (FLOAT) | 
customerReferralLimit | STRUCT | YES | Referral limit info in multiple formats: masked : (STRING), raw : (FLOAT), value : (FLOAT) | 
invoiceCentre | STRING | YES | Invoice center location | 
leaseCompanyDetailsβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
id | STRING | YES | Lease company ID | 
name | STRING | YES | Lease company name | 
vehicleContractβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
contractStartDate | TIMESTAMP | YES | When the contract starts | 
contractEndDate | TIMESTAMP | YES | When the contract ends | 
vehicleProduct | STRING | YES | Type of vehicle contract product | 
smr | BOOL | YES | If smr included | 
tyres | BOOL | YES | If tyres included | 
rental | BOOL | YES | If rental included | 
glass | BOOL | YES | If glass included | 
accidentManagement | BOOL | YES | If accident management included | 
breakdown | BOOL | YES | If breakdown included | 
insurance | BOOL | YES | If insurance included | 
manualOverride | BOOL | YES | If manually overridden | 
serviceSchedule | STRING | YES | Service Schedule Term | 
assetNumber | STRING | YES | Number of the asset | 
latestAllocationβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
driverDetails | RECORD | YES | Details of the allocated driver | 
driverDetails.driverId | STRING | YES | ID of the driver | 
driverDetails.driverName | STRING | YES | Name of the driver | 
driverDetails.driverTitle | STRING | YES | Title of the driver | 
driverDetails.subCustomerId | STRING | YES | Associated sub-customer ID | 
endDate | TIMESTAMP | YES | Allocation end date | 
isActive | BOOLEAN | YES | Whether the allocation is active | 
startDate | TIMESTAMP | YES | Allocation start date | 
smrBudgetβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
masked | STRING | YES | Masked value of the budget | 
raw | INTEGER | YES | Raw value of the budget | 
value | INTEGER | YES | Final value of the budget | 
vrmLookupβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
isValid | BOOLEAN | YES | Indicates if the VRM is valid | 
lookUpProvider | STRING | YES | Provider of the VRM lookup | 
maintained | STRING | YES | Maintenance status | 
response | RECORD | YES | Response record from lookup | 
response.colour | STRING | YES | Colour of the vehicle | 
response.fuelType | STRING | YES | Fuel type of the vehicle | 
response.make | RECORD | YES | Make details of the vehicle | 
response.make.label | STRING | YES | Label of the make | 
response.make.model | STRING | YES | Model of the vehicle | 
response.make.registrationDate | STRING | YES | Registration date of the vehicle | 
response.make.vehicleCategoryDescription | STRING | YES | Description of the vehicle category | 
response.vehicleType | RECORD | YES | Type of vehicle | 
response.vehicleType.index | INTEGER | YES | Index of the vehicle type | 
response.vehicleType.label | STRING | YES | Label of the vehicle type | 
response.vehicleType.type | STRING | YES | Type name | 
response.vehicleType.value | STRING | YES | Value representation of the vehicle type | 
vin | STRING | YES | Vehicle Identification Number | 
source | STRING | YES | Source of the data | 
status | STRING | YES | Status of the VRM lookup | 
timestamp | TIMESTAMP | YES | Timestamp of the lookup | 
vrm | STRING | YES | Vehicle Registration Mark | 
spendToDateβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
masked | STRING | YES | Masked spend value | 
raw | FLOAT | YES | Raw spend value | 
value | INTEGER | YES | Final spend value | 
warrantyMileageβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
| warrantyMileage.masked | STRING | NULLABLE | Masked value | 
| warrantyMileage.raw | FLOAT | NULLABLE | Raw mileage value | 
warrantyMonthsβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
| warrantyMonths.masked | STRING | NULLABLE | Masked value | 
| warrantyMonths.raw | FLOAT | NULLABLE | Raw months value | 
servicesβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
| services.accidentManagement | BOOLEAN | YES | Whether accident management is included | 
| services.breakdown | BOOLEAN | YES | Whether breakdown service is provided | 
| services.glass | BOOLEAN | YES | Whether glass repair/replacement is covered | 
| services.insurance | BOOLEAN | YES | Indicates if insurance is included | 
| services.rental | BOOLEAN | YES | Indicates if rental services are provided | 
| services.smr | BOOLEAN | YES | Indicates if service, maintenance, and repair is included | 
| services.tyres | BOOLEAN | YES | Indicates if tyre services are provided | 
policyβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
| policy.policyNumber | STRING | YES | The unique number of the policy | 
| policy.policyTerm | STRING | YES | The term/duration of the policy | 
| policy.productType | STRING | YES | Type of insurance product or coverage | 
πΈ Array Columnsβ
activeAllocatedDriversβ
Array of STRUCT
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
driverId | STRING | YES | Unique ID of the driver | 
driverName | STRING | YES | Name of the driver | 
driverTitle | STRING | YES | Title or role of the driver | 
endDate | INT64 | YES | End date in epoch seconds | 
startDate | INT64 | YES | Start date in epoch seconds | 
subCustomerId | STRING | YES | Sub-customer to which the stock is linked to | 
visnSpendToDateβ
Array of STRUCT
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
amount | STRUCT | YES | Amount fields in multiple formats: masked : (STRING), raw : (FLOAT), value : (FLOAT) | 
enquiryId | STRING | YES | Enquiry identifier (e.g., qhsZoHgBdz0fWJWxyKLD) | 
invoiceDate | STRUCT | YES | Date of invoice: _seconds: (INT64), _nanoseconds: (INT64) | 
invoiceNumber | STRING | YES | Invoice number | 
creditDate | STRUCT | YES | Credit transaction date: _seconds: (INT64), _nanoseconds: (INT64) | 
branchHistoryβ
| Column Name | Data Type | Nullable | Description | 
|---|---|---|---|
startTimestamp | INTEGER | YES | Start timestamp (epoch) | 
code | STRING | YES | Branch code | 
endTimestamp | INTEGER | YES | End timestamp (epoch) | 
startDateTime | STRING | YES | Start datetime (string format) | 
endDateTime | STRING | YES | End datetime (string format) | 
outstandingβ
Array of STRING
Holds list of outstanding tags/identifiers associated with the stock. (e.g [SERVICE_MANAGER, MILEAGE_UPDATE]). Can be empty if there are no outstanding tags present