| POST | /v1/schedule/job/workers |
|---|
"use strict";
export class WorkerScheduleItem {
/** @param {{WorkerScheduleItemID?:number,JobID?:number,ProjectID?:number,ContactID?:number,ScheduledDate?:string,SortOrder?:number,SourceCrewID?:number,Status?:string,StartedAt?:string,CompletedAt?:string,WorkerNotes?:string,JobName?:string,ProjectName?:string,FirstName?:string,LastName?:string,WorkerName?:string,SourceCrewName?:string,ProjectLocationID?:number,ProjectLocationName?:string,LocationZip?:string,LocationCity?:string,LocationLatitude?:number,LocationLongitude?:number,JobStatusName?:string,BranchId?:string,BranchName?:string,WorkerHomeBranchId?:string,WorkerHomeBranchName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
WorkerScheduleItemID;
/** @type {number} */
JobID;
/** @type {?number} */
ProjectID;
/** @type {number} */
ContactID;
/** @type {?string} */
ScheduledDate;
/** @type {number} */
SortOrder;
/** @type {?number} */
SourceCrewID;
/** @type {string} */
Status;
/** @type {?string} */
StartedAt;
/** @type {?string} */
CompletedAt;
/** @type {string} */
WorkerNotes;
/** @type {string} */
JobName;
/** @type {string} */
ProjectName;
/** @type {string} */
FirstName;
/** @type {string} */
LastName;
/** @type {string} */
WorkerName;
/** @type {string} */
SourceCrewName;
/** @type {?number} */
ProjectLocationID;
/** @type {string} */
ProjectLocationName;
/** @type {string} */
LocationZip;
/** @type {string} */
LocationCity;
/** @type {?number} */
LocationLatitude;
/** @type {?number} */
LocationLongitude;
/** @type {string} */
JobStatusName;
/** @type {string} */
BranchId;
/** @type {string} */
BranchName;
/** @type {?string} */
WorkerHomeBranchId;
/** @type {string} */
WorkerHomeBranchName;
}
export class SchedulableJob {
/** @param {{JobID?:number,JobName?:string,ProjectID?:number,ProjectName?:string,StatusID?:number,StatusName?:string,ProjectLocationID?:number,ProjectLocationName?:string,LocationZip?:string,LocationCity?:string,LocationLatitude?:number,LocationLongitude?:number,ExpectedStartDate?:string,ExpectedCompletionDate?:string,IsRecurring?:boolean,OccurrenceDates?:string[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
JobID;
/** @type {string} */
JobName;
/** @type {number} */
ProjectID;
/** @type {string} */
ProjectName;
/** @type {?number} */
StatusID;
/** @type {string} */
StatusName;
/** @type {?number} */
ProjectLocationID;
/** @type {string} */
ProjectLocationName;
/** @type {string} */
LocationZip;
/** @type {string} */
LocationCity;
/** @type {?number} */
LocationLatitude;
/** @type {?number} */
LocationLongitude;
/** @type {?string} */
ExpectedStartDate;
/** @type {?string} */
ExpectedCompletionDate;
/** @type {boolean} */
IsRecurring;
/** @type {string[]} */
OccurrenceDates = [];
}
export class ScheduleWorker {
/** @param {{ContactId?:number,FirstName?:string,LastName?:string,Name?:string,Initials?:string,Rate?:number,ImageUrl?:string,BranchId?:string,BranchName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ContactId;
/** @type {string} */
FirstName;
/** @type {string} */
LastName;
/** @type {string} */
Name;
/** @type {string} */
Initials;
/** @type {?number} */
Rate;
/** @type {string} */
ImageUrl;
/** @type {?string} */
BranchId;
/** @type {string} */
BranchName;
}
export class Crew {
/** @param {{CrewID?:number,CrewName?:string,CrewNumber?:string,CrewManagerContactID?:number,CrewManagerContactName?:string,CrewColor?:string,RecordCreatedDate?:string,Active?:boolean,CreatedByUID?:string,ProjectID?:number,CrewMemberCount?:number,ProjectCrewID?:number,ProjectName?:string,BranchId?:string,BranchName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
CrewID;
/** @type {string} */
CrewName;
/** @type {string} */
CrewNumber;
/** @type {number} */
CrewManagerContactID;
/** @type {string} */
CrewManagerContactName;
/** @type {string} */
CrewColor;
/** @type {string} */
RecordCreatedDate;
/** @type {boolean} */
Active;
/** @type {string} */
CreatedByUID;
/** @type {number} */
ProjectID;
/** @type {number} */
CrewMemberCount;
/** @type {number} */
ProjectCrewID;
/** @type {string} */
ProjectName;
/** @type {string} */
BranchId;
/** @type {string} */
BranchName;
}
export class ScheduleLastAssignment {
/** @param {{JobID?:number,ContactIds?:number[],SourceCrewID?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
JobID;
/** @type {number[]} */
ContactIds = [];
/** @type {?number} */
SourceCrewID;
}
export class ScheduleAutoFillResult {
/** @param {{JobsFilled?:number,JobsSkipped?:number,VisitsScheduled?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
JobsFilled;
/** @type {number} */
JobsSkipped;
/** @type {number} */
VisitsScheduled;
}
export class WorkerScheduleResponse {
/** @param {{Items?:WorkerScheduleItem[],SchedulableJobs?:SchedulableJob[],Workers?:ScheduleWorker[],Crews?:Crew[],BudgetedCrew?:ScheduleWorker[],LastAssignment?:ScheduleLastAssignment,AutoFill?:ScheduleAutoFillResult,DatesScheduled?:number,WorkersScheduled?:number,ItemsRemoved?:number,ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {WorkerScheduleItem[]} */
Items = [];
/** @type {SchedulableJob[]} */
SchedulableJobs = [];
/** @type {ScheduleWorker[]} */
Workers = [];
/** @type {Crew[]} */
Crews = [];
/** @type {ScheduleWorker[]} */
BudgetedCrew = [];
/** @type {ScheduleLastAssignment} */
LastAssignment;
/** @type {ScheduleAutoFillResult} */
AutoFill;
/** @type {?number} */
DatesScheduled;
/** @type {?number} */
WorkersScheduled;
/** @type {?number} */
ItemsRemoved;
/** @type {ResponseStatus} */
ResponseStatus;
}
export class ScheduleJobWorkersRequest {
/** @param {{JobID?:number,ProjectID?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
JobID;
/** @type {number} */
ProjectID;
}
JavaScript ScheduleJobWorkersRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/schedule/job/workers HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
JobID: 0,
ProjectID: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Items:
[
{
WorkerScheduleItemID: 0,
JobID: 0,
ProjectID: 0,
ContactID: 0,
ScheduledDate: 0001-01-01,
SortOrder: 0,
SourceCrewID: 0,
Status: String,
StartedAt: 0001-01-01,
CompletedAt: 0001-01-01,
WorkerNotes: String,
JobName: String,
ProjectName: String,
FirstName: String,
LastName: String,
WorkerName: String,
SourceCrewName: String,
ProjectLocationID: 0,
ProjectLocationName: String,
LocationZip: String,
LocationCity: String,
LocationLatitude: 0,
LocationLongitude: 0,
JobStatusName: String,
BranchId: 00000000000000000000000000000000,
BranchName: String,
WorkerHomeBranchId: 00000000000000000000000000000000,
WorkerHomeBranchName: String
}
],
SchedulableJobs:
[
{
JobID: 0,
JobName: String,
ProjectID: 0,
ProjectName: String,
StatusID: 0,
StatusName: String,
ProjectLocationID: 0,
ProjectLocationName: String,
LocationZip: String,
LocationCity: String,
LocationLatitude: 0,
LocationLongitude: 0,
ExpectedStartDate: 0001-01-01,
ExpectedCompletionDate: 0001-01-01,
IsRecurring: False,
OccurrenceDates:
[
String
]
}
],
Workers:
[
{
ContactId: 0,
FirstName: String,
LastName: String,
Name: String,
Initials: String,
Rate: 0,
ImageUrl: String,
BranchId: 00000000000000000000000000000000,
BranchName: String
}
],
Crews:
[
{
CrewID: 0,
CrewName: String,
CrewNumber: String,
CrewManagerContactID: 0,
CrewManagerContactName: String,
CrewColor: String,
RecordCreatedDate: 0001-01-01,
Active: False,
CreatedByUID: 00000000000000000000000000000000,
ProjectID: 0,
CrewMemberCount: 0,
ProjectCrewID: 0,
ProjectName: String,
BranchId: 00000000000000000000000000000000,
BranchName: String
}
],
BudgetedCrew:
[
{
ContactId: 0,
FirstName: String,
LastName: String,
Name: String,
Initials: String,
Rate: 0,
ImageUrl: String,
BranchId: 00000000000000000000000000000000,
BranchName: String
}
],
LastAssignment:
{
JobID: 0,
ContactIds:
[
0
],
SourceCrewID: 0
},
AutoFill:
{
JobsFilled: 0,
JobsSkipped: 0,
VisitsScheduled: 0
},
DatesScheduled: 0,
WorkersScheduled: 0,
ItemsRemoved: 0,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}