@fleetbase/fleetops-data
Version:
Fleetbase Fleet-Ops based models, serializers, transforms, adapters and GeoJson utility functions.
71 lines (63 loc) • 1.94 kB
JavaScript
import FacilitatorModel from './facilitator';
import { attr } from '@ember-data/model';
import { computed, get } from '@ember/object';
import config from 'ember-get-config';
export default class FacilitatorDriverModel extends FacilitatorModel {
/** @ids */
public_id;
company_uuid;
user_uuid;
vehicle_uuid;
vendor_uuid;
current_job_uuid;
photo_uuid;
vehicle_id;
vendor_id;
current_job_id;
internal_id;
/** @attributes */
name;
phone;
email;
photo_url;
vehicle_name;
vehicle_avatar;
vendor_name;
drivers_license_number;
avatar_url;
avatar_value;
location;
heading;
country;
city;
status;
online;
meta;
/** @dates */
license_expiry;
deleted_at;
created_at;
updated_at;
/** @computed */
get photoUrl() {
if (!this.photo_url) {
return get(config, 'defaultValues.driverImage');
}
return this.photo_url;
}
get displayName() {
if (!this.name) {
return this.public_id;
}
return this.name;
}
}