Vehicle Management
Comprehensive guide to vehicle management in bidcars.ch
Vehicle Management
Vehicle management is the core of the bidcars.ch platform. Here you can create, edit, publish, and market vehicles through the auction system. This guide walks you through all aspects of vehicle management.
Accessing Vehicle Management
Vehicle management is accessible through the "Vehicles" section in your team account:
- Sign in to your account
- Select the desired team account from the account selector
- Click on "Vehicles" in the sidebar
You need the vehicles.manage
permission to access these functions. This permission is enabled by default for account owners and members.
Vehicle Overview
The vehicle overview shows all vehicles associated with your team account. Here you can see:
- Vehicle status (Draft, Available, In Auction, Sold, Withdrawn)
- Basic information (Make, Model, Year, Mileage)
- Prices (Starting price, Reserve price)
- Creation and modification dates
- Quick access to actions (Edit, Delete, Publish)
You can filter and sort the list to quickly find specific vehicles.
Technical Architecture of Vehicle Management
The vehicle management is based on a tab structure that enables progressive data entry and validation:
- Components: Specialized React components for each tab
- Validation: Progressive validation with immediate feedback
- Database Schema: Robust structure with relationships to images and auctions
- Security: Row-Level Security (RLS) for access protection
All vehicle data is stored in the central vehicles
table, with links to vehicle_images
for images and various auction tables for the sales process.
Creating a Vehicle
To create a new vehicle:
- Click on the "Create New Vehicle" button
- Fill in the required information in the various tabs
- Save as draft or publish directly
The creation process is divided into five tabs that provide a structured workflow:
1. Basic Information
This tab contains the fundamental vehicle data:
Required Fields:
- Make and model
- First registration date
- Mileage
- Fuel type
- Transmission type
Optional Fields:
- Vehicle Identification Number (VIN) - Recommended for unique identification
- Color
- Number of doors
- Number of seats
Technical Details:
- Inputs are validated in real-time
- When entering a VIN, the system can automatically retrieve technical data via the Auto-i-DAT integration
- Date inputs are validated according to Swiss format (DD.MM.YYYY)
2. Vehicle Features
In the "Features" tab, you can provide detailed technical data and feature information:
Technical Specifications:
- Power (HP and kW)
- Engine displacement (cc)
- Weight (kg)
- CO2 emissions
- Drive type (front-wheel, rear-wheel, all-wheel)
- Body type
Feature Details:
- Comfort and safety features
- Multimedia and navigation systems
- Driver assistance systems
- Special equipment
The features are stored as structured JSONB data, enabling efficient filtering in the marketplace.
3. Vehicle Condition
The "Condition" tab allows for transparent documentation of the vehicle's condition:
General Condition Indicators:
- Hail damage (Yes/No/Unspecified)
- Accident vehicle (Yes/No/Unspecified)
- Smoker vehicle (Yes/No/Unspecified)
- Pet owner (Yes/No/Unspecified)
Detailed Condition Descriptions:
- Mechanical condition (free text field)
- Body condition (free text field)
- Paint condition (free text field)
Additional Information:
- Inspection date and validity
- First owner (Yes/No/Unspecified)
- Number of keys
- Service information
- Additional information
These details are stored directly in specialized fields in the database and are validated with enum types.
4. Pricing
In the "Pricing" tab, you set the financial parameters for the auction:
Price Fields:
- Starting price: The initial price for the auction (required)
- Reserve price: The minimum price at which the vehicle will be sold (required)
Important Notes:
- The reserve price must be positive
- The starting price should be below the reserve price
- These values can only be changed in limited ways after publication
Prices are stored in the database as DECIMAL(12,2) to allow for precise amounts.
5. Images
The Images tab is crucial for successful vehicle presentation:
Upload Methods:
- Direct upload via browser (drag & drop or file selection)
- QR code-based mobile upload (see detailed description below)
Image Management:
- Set main image: Determines the primary image for list views
- Arrangement: Drag & drop to set display order
- Delete: Remove unwanted images
- Preview: Large view by clicking on images
Technical Details:
- Images are automatically converted to different formats (AVIF, WebP, JPEG)
- Thumbnails are automatically generated
- The system selects the optimal format based on the browser
Image Optimization System
The image optimization system automatically processes all uploaded vehicle images:
Format Conversion
Each image is converted into three formats:
- AVIF: State-of-the-art compression standard (up to 50% smaller than JPEG)
- WebP: Good compromise between quality and size
- JPEG: Universal compatibility
Size Adjustment
Each image is created in two sizes:
- Thumbnail: 300px width for list views and galleries
- Full size: 1200px width for detailed views (maintaining aspect ratio)
Technical Implementation
The image optimization uses Sharp.js for:
- Efficient resizing
- Quality optimization
- Metadata preservation
- Format conversion
All image variants are stored in Supabase Storage and linked via the vehicle_images
table.
QR Code Upload System
The QR code upload system is an innovative feature that allows uploading images directly from a smartphone:
How It Works
- Generate QR Code: Click on "Generate QR Code" in the Images tab
- Token Generation: The system creates a secure, time-limited token
- Display QR Code: A QR code with the upload URL and token is displayed
- Mobile Access: Scan the QR code with a smartphone
- Upload Interface: A mobile page opens with direct access to the camera
- Image Capture: Take photos or select images from the gallery
- Automatic Upload: The images are uploaded, optimized, and associated with the vehicle
Security Features
- Time Limitation: The token is only valid for 1 hour
- Vehicle Binding: The token is bound to a specific vehicle
- Nonce System: Server-side validation via a nonce system
- Permission Check: Only authorized users can generate tokens
Technical Implementation
- Token Format:
timestamp.vehicleId.randomString
- API Endpoints: Dedicated endpoints for token generation and image upload
- Mobile Optimization: Responsive page with direct camera integration
- Parallel Processing: Multiple images can be uploaded simultaneously
This feature is particularly useful for car dealers who want to photograph vehicles on-site without complex transfer processes.
Vehicle Status and Workflow
Vehicles go through various statuses during their lifecycle on the platform:
Status Types
Draft:
- Initial status for new vehicles
- Not publicly visible
- Incomplete information allowed
- Only visible to team members
Available:
- After publication
- Publicly visible in the marketplace
- All required fields must be filled
- Ready for auctions
In Auction:
- During an active auction
- Limited editing possibilities
- Bids can be placed
- Status is automatically set by the auction system
Sold:
- After successful auction
- No editing possible (protected by database triggers)
- Appears in sales and purchase history
- Read-only view
Withdrawn:
- Manually withdrawn vehicles
- No longer publicly visible
- Can be reactivated
Status Transitions
Status transitions are triggered by various actions:
- Draft → Available: Through manual publication (with validation)
- Available → In Auction: Automatically at the start of an auction
- In Auction → Sold: Automatically at successful auction end (if reserve price is met)
- In Auction → Available: Automatically at unsuccessful auction end
- Available → Withdrawn: Through manual withdrawal
- Withdrawn → Available: Through manual reactivation
Database Constraints
Special database triggers and constraints protect integrity:
- Sales Protection: Sold vehicles cannot be edited
- Image Protection: Images of sold vehicles cannot be changed
- Validation Rule: Non-drafts must have all required fields
- Auction Protection: A vehicle can only be in one active auction
Database Schema
The vehicle management system is based on a solid database schema:
Main Tables
- vehicles: Central table with all vehicle information
- vehicle_images: Links images to vehicles
- auctions: Management of auctions
- auction_vehicles: Links vehicles to auctions
- bids: Tracks bids on vehicles
Relationships
- A vehicle belongs to one team account (1:N)
- A vehicle can have multiple images (1:N)
- A vehicle can be in multiple auctions, but only one active one (M:N with restriction)
- A vehicle can receive multiple bids (1:N)
Security
Row-Level Security (RLS) protects access to vehicle data:
- Reading: Only published vehicles are publicly visible
- Creating: Only team members with vehicles.manage permission
- Editing: Only team members of the associated account
- Deleting: Only team members with vehicles.manage permission
Sold and Purchased Vehicles
After an auction is completed, the vehicles are categorized accordingly:
Sold Vehicles
- Accessible via the "Sold" tab in the vehicle overview
- Shows all vehicles your team account has successfully sold
- Contains transaction details (buyer, selling price, date)
- Provides contact options to the buyer
Purchased Vehicles
- Accessible via the "Purchased" tab in the vehicle overview
- Shows all vehicles your team account has purchased
- Contains transaction details (seller, purchase price, date)
- Provides contact options to the seller
For both categories, there are special read-only views that display all relevant vehicle information.
Auto-i-DAT Integration
The system offers an optional integration with Auto-i-DAT:
Features
- Vehicle Identification: Automatic detection via VIN or type certificate
- Data Import: Automatic filling of technical data
- Validation: Verification of vehicle information
Usage
- Enter the Vehicle Identification Number (VIN) in the Basic tab
- Click on "Load Vehicle Data"
- The system automatically fills in available technical data
The integration stores both structured technical data and the raw data of the API response for later reference.
Tips for Successful Vehicle Listings
- Completeness: Fill in as many fields as possible, including optional ones
- Image Quality: Upload at least 5-10 high-quality images
- Transparency: Provide honest information about the vehicle condition
- Pricing: Set realistic prices based on market values
- Response Time: Respond quickly to inquiries and bids
Troubleshooting
Common problems and their solutions:
- Images not displaying: Check if the images are in the correct formats (JPG, PNG)
- Vehicle cannot be published: Ensure all required fields are filled
- QR code not working: Generate a new QR code as the old one may have expired
- Auction not starting: Check if the vehicle has "Available" status
- Image upload fails: Check image size (max. 10MB) and format