select
    'VEHICLE_REGISTRATION' as entity_type,
    cast(v.id as varchar(128)) as source_entity_id,
    concat('YELLOWFOX:', trim(v.vrn)) as source_external_key,
    trim(v.vrn) as display_name,
    true as active,
    null::timestamptz as valid_from,
    null::timestamptz as valid_to,
    null::timestamptz as source_updated_at,
    v.id as vehicle_id,
    trim(v.vin) as vin,
    'UNKNOWN' as registration_nation,
    trim(v.vrn) as registration_number,
    v.fleet_id as fleet_id
from data.vehicle v
where nullif(trim(v.vrn), '') is not null;
