| POST,OPTIONS | /v1/fieldlog/submit |
|---|
"use strict";
export class FieldLogSubmitResponse {
/** @param {{ResponseStatus?:ResponseStatus,FieldLogId?:number,FieldLogUID?:string,Status?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {number} */
FieldLogId;
/** @type {string} */
FieldLogUID;
/** @type {string} */
Status;
}
export class FieldLogCrew {
/** @param {{ContactId?:number,StatusCode?:string,Hours?:number,CostCode?:string,SplitCostCode?:string,SplitHours?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ContactId;
/** @type {string} */
StatusCode;
/** @type {number} */
Hours;
/** @type {string} */
CostCode;
/** @type {string} */
SplitCostCode;
/** @type {number} */
SplitHours;
}
export class FieldLogEquipment {
/** @param {{EquipmentId?:number,EquipmentKey?:string,StatusCode?:string,EngineHours?:number,FuelGallons?:number,IdleReason?:string,DownNote?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
EquipmentId;
/** @type {string} */
EquipmentKey;
/** @type {string} */
StatusCode;
/** @type {number} */
EngineHours;
/** @type {number} */
FuelGallons;
/** @type {string} */
IdleReason;
/** @type {string} */
DownNote;
}
export class FieldLogSub {
/** @param {{ContactId?:number,Name?:string,Trade?:string,HeadCount?:number,HoursPer?:number,SourceCode?:string,Reporter?:string,Note?:string,Verified?:boolean,StateCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ContactId;
/** @type {string} */
Name;
/** @type {string} */
Trade;
/** @type {number} */
HeadCount;
/** @type {number} */
HoursPer;
/** @type {string} */
SourceCode;
/** @type {string} */
Reporter;
/** @type {string} */
Note;
/** @type {boolean} */
Verified;
/** @type {string} */
StateCode;
}
export class FieldLogQuantity {
/** @param {{PayItemCode?:string,Name?:string,Unit?:string,TodayQty?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
PayItemCode;
/** @type {string} */
Name;
/** @type {string} */
Unit;
/** @type {number} */
TodayQty;
}
export class FieldLogDelivery {
/** @param {{Po?:string,Material?:string,StatusCode?:string,QtyReceived?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Po;
/** @type {string} */
Material;
/** @type {string} */
StatusCode;
/** @type {string} */
QtyReceived;
}
export class FieldLogConsumed {
/** @param {{Name?:string,Qty?:string,Use?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Name;
/** @type {string} */
Qty;
/** @type {string} */
Use;
}
export class FieldLogSubmitRequest {
/** @param {{ProjectId?:number,JobId?:number,LogDate?:string,Notes?:string,Weather?:string,TempF?:number,WeatherDelayHours?:number,ToolboxTalk?:string,IncidentOccurred?:boolean,IncidentType?:string,IncidentNote?:string,IncidentPhotoCount?:number,Crew?:FieldLogCrew[],Equipment?:FieldLogEquipment[],Subs?:FieldLogSub[],Quantities?:FieldLogQuantity[],Deliveries?:FieldLogDelivery[],Consumed?:FieldLogConsumed[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ProjectId;
/** @type {number} */
JobId;
/** @type {string} */
LogDate;
/** @type {string} */
Notes;
/** @type {string} */
Weather;
/** @type {number} */
TempF;
/** @type {number} */
WeatherDelayHours;
/** @type {string} */
ToolboxTalk;
/** @type {boolean} */
IncidentOccurred;
/** @type {string} */
IncidentType;
/** @type {string} */
IncidentNote;
/** @type {number} */
IncidentPhotoCount;
/** @type {FieldLogCrew[]} */
Crew = [];
/** @type {FieldLogEquipment[]} */
Equipment = [];
/** @type {FieldLogSub[]} */
Subs = [];
/** @type {FieldLogQuantity[]} */
Quantities = [];
/** @type {FieldLogDelivery[]} */
Deliveries = [];
/** @type {FieldLogConsumed[]} */
Consumed = [];
}
JavaScript FieldLogSubmitRequest 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/fieldlog/submit HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProjectId: 0,
JobId: 0,
LogDate: String,
Notes: String,
Weather: String,
TempF: 0,
WeatherDelayHours: 0,
ToolboxTalk: String,
IncidentOccurred: False,
IncidentType: String,
IncidentNote: String,
IncidentPhotoCount: 0,
Crew:
[
{
ContactId: 0,
StatusCode: String,
Hours: 0,
CostCode: String,
SplitCostCode: String,
SplitHours: 0
}
],
Equipment:
[
{
EquipmentId: 0,
EquipmentKey: String,
StatusCode: String,
EngineHours: 0,
FuelGallons: 0,
IdleReason: String,
DownNote: String
}
],
Subs:
[
{
ContactId: 0,
Name: String,
Trade: String,
HeadCount: 0,
HoursPer: 0,
SourceCode: String,
Reporter: String,
Note: String,
Verified: False,
StateCode: String
}
],
Quantities:
[
{
PayItemCode: String,
Name: String,
Unit: String,
TodayQty: 0
}
],
Deliveries:
[
{
Po: String,
Material: String,
StatusCode: String,
QtyReceived: String
}
],
Consumed:
[
{
Name: String,
Qty: String,
Use: String
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
FieldLogId: 0,
FieldLogUID: 00000000000000000000000000000000,
Status: String
}