Skip to content

Commit

Permalink
Merge pull request #35 from fleetbase/dev-v0.1.17
Browse files Browse the repository at this point in the history
v0.1.17
  • Loading branch information
roncodes authored Jul 5, 2024
2 parents e5e3fd6 + fa29384 commit e385e8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion addon/models/customer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ContactModel from './contact';
import { attr } from '@ember-data/model';
import { attr, hasMany } from '@ember-data/model';
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
import { format as formatDate, isValid as isValidDate, formatDistanceToNow } from 'date-fns';
Expand All @@ -9,6 +9,9 @@ export default class CustomerModel extends ContactModel {
@attr('string') name;
@attr('string') customer_type;

/** @relations */
@hasMany('waypoint') waypoints;

/** @computed */
@equal('customer_type', 'vendor') isVendor;
@equal('customer_type', 'contact') isContact;
Expand Down
2 changes: 1 addition & 1 deletion addon/models/waypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class WaypointModel extends PlaceModel {
/** @relationships */
@belongsTo('place', { async: false }) place;
@belongsTo('tracking-number', { async: false }) tracking_number;
@belongsTo('customer', { polymorphic: true, async: false }) customer;
@belongsTo('customer', { polymorphic: true, async: false, inverse: 'waypoints' }) customer;

/** @attributes */
@attr('string') public_id;
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.16",
"version": "0.1.17",
"description": "Fleetbase Fleet-Ops based models, serializers, transforms, adapters and GeoJson utility functions.",
"keywords": [
"fleetbase-data",
Expand Down

0 comments on commit e385e8e

Please sign in to comment.