Skip to content

Commit

Permalink
Added custom avatar properties to DriverModel VehicleModel and PlaceM…
Browse files Browse the repository at this point in the history
…odel
  • Loading branch information
roncodes committed Feb 18, 2024
1 parent 9d92927 commit 73933eb
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 307 deletions.
4 changes: 4 additions & 0 deletions addon/models/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export default class DriverModel extends Model {
vehicle_avatar;
@attr('string') vendor_name;
@attr('string') drivers_license_number;
@attr('string', {
defaultValue: get(config, 'defaultValues.driverAvatar'),
}) avatar_url;
@attr('string') avatar_value;
@attr('point') location;
@attr('number') heading;
@attr('string') country;
Expand Down
5 changes: 5 additions & 0 deletions addon/models/place.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { computed, get } from '@ember/object';
import { not } from '@ember/object/computed';
import { format as formatDate, isValid as isValidDate, formatDistanceToNow } from 'date-fns';
import isValidCoordinates from '@fleetbase/ember-core/utils/is-valid-coordinates';
import config from 'ember-get-config';

export default class PlaceModel extends Model {
/** @ids */
Expand All @@ -15,6 +16,10 @@ export default class PlaceModel extends Model {
@attr('string') name;
@attr('string') phone;
@attr('string') type;
@attr('string', {
defaultValue: get(config, 'defaultValues.placeAvatar'),
}) avatar_url;
@attr('string') avatar_value;
@attr('string') address;
@attr('string') address_html;
@attr('string') street1;
Expand Down
1 change: 1 addition & 0 deletions addon/models/vehicle.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default class VehicleModel extends Model {
defaultValue: get(config, 'defaultValues.vehicleAvatar'),
})
avatar_url;
@attr('string') avatar_value;
@attr('point') location;
@attr('string') make;
@attr('string') model;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/fleetops-data",
"version": "0.1.8",
"version": "0.1.9",
"description": "Fleetbase Fleet-Ops based models, serializers, transforms, adapters and GeoJson utility functions.",
"keywords": [
"fleetbase-data",
Expand Down
Loading

0 comments on commit 73933eb

Please sign in to comment.