Skip to content

Commit 70f5ac5

Browse files
author
Ronald A Richardson
committed
feat: add schedule, schedule-item and availability relationships to Driver model
Connects the Driver Ember Data model to the core-api scheduling system by adding three hasMany relationships: - schedules: polymorphic Schedule records where the driver is the subject - schedule_items: individual shift records (ScheduleItem) where the driver is the assignee (assignee_type='driver', assignee_uuid=driver.id) - availabilities: ScheduleAvailability records for time-off and preferred working hours These relationships are required by: 1. The new driver/schedule panel component which renders a per-driver FullCalendar shift management view 2. The Intelligent Order Allocation Engine AllocationPayloadBuilder which queries active schedule_items to inject shift time_window constraints into the VROOM optimization payload Refs: fleetbase/fleetops#214
1 parent 332dc42 commit 70f5ac5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

addon/models/driver.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export default class DriverModel extends Model {
3131
@belongsTo('vendor', { async: true }) vendor;
3232
@hasMany('custom-field-value', { async: false }) custom_field_values;
3333

34+
/** @scheduling-relationships */
35+
@hasMany('schedule', { async: true }) schedules;
36+
@hasMany('schedule-item', { async: true }) schedule_items;
37+
@hasMany('schedule-availability', { async: true }) availabilities;
38+
3439
/** @attributes */
3540
@attr('string') name;
3641
@attr('string') phone;

0 commit comments

Comments
 (0)