| GET,POST,PUT,DELETE,OPTIONS | /v1/Project/Materials/{ProjectID} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/Project/Materials/{ProjectID}/{JobID} |
"use strict";
export class Location {
/** @param {{Id?:string,ClientId?:string,Name?:string,Address1?:string,Address2?:string,City?:string,State?:string,Zip?:string,Phone?:string,Fax?:string,URL?:string,Email?:string,TimeZone?:string,Active?:boolean,EntDate?:string,ModDate?:string,LocationImage?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Id;
/** @type {string} */
ClientId;
/** @type {string} */
Name;
/** @type {string} */
Address1;
/** @type {string} */
Address2;
/** @type {string} */
City;
/** @type {string} */
State;
/** @type {string} */
Zip;
/** @type {string} */
Phone;
/** @type {string} */
Fax;
/** @type {string} */
URL;
/** @type {string} */
Email;
/** @type {string} */
TimeZone;
/** @type {boolean} */
Active;
/** @type {string} */
EntDate;
/** @type {string} */
ModDate;
/** @type {string} */
LocationImage;
}
export class Project {
/** @param {{ProjectID?:number,ProjectUID?:string,ProjectName?:string,ImageURL?:string,ImageKey?:string,ClientName?:string,ClientPhone?:string,ClientEmail?:string,NotifyCustomerOnVisitCompletion?:boolean,ClientContactID?:number,ProjectManagerID?:number,ProjectManagerName?:string,StartDate?:string,EndDate?:string,ActualStartDate?:string,ActualEndDate?:string,JobCount?:number,CrewMemberCount?:number,CrewAvatarsJson?:string,CrewNamesSearch?:string,EquipmentCount?:number,MaterialCount?:number,ProjectStatusID?:number,ProjectStatusDescription?:string,Budget?:number,CostToDate?:number,ProjectLocation?:string,ProjectType?:string,ProjectSponsor?:string,CreatedBy?:string,CreatedAt?:string,UpdatedAt?:string,ProjectDescription?:string,Scope?:string,StatusId?:number,BranchId?:string,BranchName?:string,Location?:Location}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ProjectID;
/** @type {string} */
ProjectUID;
/** @type {string} */
ProjectName;
/** @type {string} */
ImageURL;
/** @type {string} */
ImageKey;
/** @type {string} */
ClientName;
/** @type {string} */
ClientPhone;
/** @type {string} */
ClientEmail;
/** @type {boolean} */
NotifyCustomerOnVisitCompletion;
/** @type {?number} */
ClientContactID;
/** @type {number} */
ProjectManagerID;
/** @type {string} */
ProjectManagerName;
/** @type {?string} */
StartDate;
/** @type {?string} */
EndDate;
/** @type {?string} */
ActualStartDate;
/** @type {?string} */
ActualEndDate;
/** @type {number} */
JobCount;
/** @type {number} */
CrewMemberCount;
/** @type {string} */
CrewAvatarsJson;
/** @type {string} */
CrewNamesSearch;
/** @type {number} */
EquipmentCount;
/** @type {number} */
MaterialCount;
/** @type {number} */
ProjectStatusID;
/** @type {string} */
ProjectStatusDescription;
/** @type {number} */
Budget;
/** @type {number} */
CostToDate;
/** @type {string} */
ProjectLocation;
/** @type {string} */
ProjectType;
/** @type {string} */
ProjectSponsor;
/** @type {string} */
CreatedBy;
/** @type {?string} */
CreatedAt;
/** @type {?string} */
UpdatedAt;
/** @type {string} */
ProjectDescription;
/** @type {string} */
Scope;
/** @type {number} */
StatusId;
/** @type {string} */
BranchId;
/** @type {string} */
BranchName;
/** @type {Location} */
Location;
}
export class Material {
/** @param {{MaterialID?:number,MaterialName?:string,MaterialTypeID?:number,MaterialStatusID?:number,Quantity?:number,Supplier?:string,OrderDate?:string,DeliveryDate?:string,OnSiteDate?:string,MaterialLocation?:string,Manufacturer?:string,SerialNumber?:string,BarCode?:string,TrackingInfo?:string,MaterialDescription?:string,Notes?:string,ImageURL?:string,DetailsURL?:string,CreatedByUID?:string,Active?:boolean,RecordCreatedDate?:string,StatusId?:number,MaterialTypeName?:string,Cost?:number,MaterialStatusName?:string,Projects?:Project[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
MaterialID;
/** @type {string} */
MaterialName;
/** @type {number} */
MaterialTypeID;
/** @type {number} */
MaterialStatusID;
/** @type {number} */
Quantity;
/** @type {string} */
Supplier;
/** @type {string} */
OrderDate;
/** @type {string} */
DeliveryDate;
/** @type {string} */
OnSiteDate;
/** @type {string} */
MaterialLocation;
/** @type {string} */
Manufacturer;
/** @type {string} */
SerialNumber;
/** @type {string} */
BarCode;
/** @type {string} */
TrackingInfo;
/** @type {string} */
MaterialDescription;
/** @type {string} */
Notes;
/** @type {string} */
ImageURL;
/** @type {string} */
DetailsURL;
/** @type {string} */
CreatedByUID;
/** @type {boolean} */
Active;
/** @type {string} */
RecordCreatedDate;
/** @type {number} */
StatusId;
/** @type {string} */
MaterialTypeName;
/** @type {number} */
Cost;
/** @type {string} */
MaterialStatusName;
/** @type {Project[]} */
Projects = [];
}
export class ProjectMaterial extends Material {
/** @param {{ProjectMaterialID?:number,ProjectID?:number,ProjectEndDate?:string,FirstJobUseDate?:string,LastJobUseDate?:string,MaterialCost?:number,JobID?:number,BilledMaterialCost?:number,MaterialQty?:number,Source?:string,Allocated?:number,AvailableQty?:number,MaterialID?:number,MaterialName?:string,MaterialTypeID?:number,MaterialStatusID?:number,Quantity?:number,Supplier?:string,OrderDate?:string,DeliveryDate?:string,OnSiteDate?:string,MaterialLocation?:string,Manufacturer?:string,SerialNumber?:string,BarCode?:string,TrackingInfo?:string,MaterialDescription?:string,Notes?:string,ImageURL?:string,DetailsURL?:string,CreatedByUID?:string,Active?:boolean,RecordCreatedDate?:string,StatusId?:number,MaterialTypeName?:string,Cost?:number,MaterialStatusName?:string,Projects?:Project[]}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {number} */
ProjectMaterialID;
/** @type {number} */
ProjectID;
/** @type {string} */
ProjectEndDate;
/** @type {string} */
FirstJobUseDate;
/** @type {string} */
LastJobUseDate;
/** @type {number} */
MaterialCost;
/** @type {number} */
JobID;
/** @type {number} */
BilledMaterialCost;
/** @type {number} */
MaterialQty;
/** @type {string} */
Source;
/** @type {number} */
Allocated;
/** @type {number} */
AvailableQty;
}
export class ProjectMaterialListResponse {
/** @param {{ResponseStatus?:ResponseStatus,ProjectMaterials?:ProjectMaterial[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {ResponseStatus} */
ResponseStatus;
/** @type {ProjectMaterial[]} */
ProjectMaterials = [];
}
export class ProjectMaterialListRequest {
/** @param {{ProjectID?:number,JobID?:number,ProjectMaterials?:Material[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
ProjectID;
/** @type {number} */
JobID;
/** @type {Material[]} */
ProjectMaterials = [];
}
JavaScript ProjectMaterialListRequest 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/Project/Materials/{ProjectID} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ProjectID: 0,
JobID: 0,
ProjectMaterials:
[
{
MaterialID: 0,
MaterialName: String,
MaterialTypeID: 0,
MaterialStatusID: 0,
Quantity: 0,
Supplier: String,
OrderDate: 0001-01-01,
DeliveryDate: 0001-01-01,
OnSiteDate: 0001-01-01,
MaterialLocation: String,
Manufacturer: String,
SerialNumber: String,
BarCode: String,
TrackingInfo: String,
MaterialDescription: String,
Notes: String,
ImageURL: String,
DetailsURL: String,
CreatedByUID: 00000000000000000000000000000000,
Active: False,
RecordCreatedDate: 0001-01-01,
StatusId: 0,
MaterialTypeName: String,
Cost: 0,
MaterialStatusName: String,
Projects:
[
{
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
ImageURL: String,
ImageKey: String,
ClientName: String,
ClientPhone: String,
ClientEmail: String,
NotifyCustomerOnVisitCompletion: False,
ClientContactID: 0,
ProjectManagerID: 0,
ProjectManagerName: String,
StartDate: 0001-01-01,
EndDate: 0001-01-01,
ActualStartDate: 0001-01-01,
ActualEndDate: 0001-01-01,
JobCount: 0,
CrewMemberCount: 0,
CrewAvatarsJson: String,
CrewNamesSearch: String,
EquipmentCount: 0,
MaterialCount: 0,
ProjectStatusID: 0,
ProjectStatusDescription: String,
Budget: 0,
CostToDate: 0,
ProjectLocation: String,
ProjectType: String,
ProjectSponsor: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
ProjectDescription: String,
Scope: String,
StatusId: 0,
BranchId: 00000000000000000000000000000000,
BranchName: String,
Location:
{
Id: 00000000000000000000000000000000,
ClientId: 00000000000000000000000000000000,
Name: String,
Address1: String,
Address2: String,
City: String,
State: String,
Zip: String,
Phone: String,
Fax: String,
URL: String,
Email: String,
TimeZone: String,
Active: False,
EntDate: 0001-01-01,
ModDate: 0001-01-01,
LocationImage: 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
}
},
ProjectMaterials:
[
{
ProjectMaterialID: 0,
ProjectID: 0,
ProjectEndDate: 0001-01-01,
FirstJobUseDate: 0001-01-01,
LastJobUseDate: 0001-01-01,
MaterialCost: 0,
JobID: 0,
BilledMaterialCost: 0,
MaterialQty: 0,
Source: String,
Allocated: 0,
AvailableQty: 0,
MaterialID: 0,
MaterialName: String,
MaterialTypeID: 0,
MaterialStatusID: 0,
Quantity: 0,
Supplier: String,
OrderDate: 0001-01-01,
DeliveryDate: 0001-01-01,
OnSiteDate: 0001-01-01,
MaterialLocation: String,
Manufacturer: String,
SerialNumber: String,
BarCode: String,
TrackingInfo: String,
MaterialDescription: String,
Notes: String,
ImageURL: String,
DetailsURL: String,
CreatedByUID: 00000000000000000000000000000000,
Active: False,
RecordCreatedDate: 0001-01-01,
StatusId: 0,
MaterialTypeName: String,
Cost: 0,
MaterialStatusName: String,
Projects:
[
{
ProjectID: 0,
ProjectUID: 00000000000000000000000000000000,
ProjectName: String,
ImageURL: String,
ImageKey: String,
ClientName: String,
ClientPhone: String,
ClientEmail: String,
NotifyCustomerOnVisitCompletion: False,
ClientContactID: 0,
ProjectManagerID: 0,
ProjectManagerName: String,
StartDate: 0001-01-01,
EndDate: 0001-01-01,
ActualStartDate: 0001-01-01,
ActualEndDate: 0001-01-01,
JobCount: 0,
CrewMemberCount: 0,
CrewAvatarsJson: String,
CrewNamesSearch: String,
EquipmentCount: 0,
MaterialCount: 0,
ProjectStatusID: 0,
ProjectStatusDescription: String,
Budget: 0,
CostToDate: 0,
ProjectLocation: String,
ProjectType: String,
ProjectSponsor: String,
CreatedBy: String,
CreatedAt: 0001-01-01,
UpdatedAt: 0001-01-01,
ProjectDescription: String,
Scope: String,
StatusId: 0,
BranchId: 00000000000000000000000000000000,
BranchName: String,
Location:
{
Id: 00000000000000000000000000000000,
ClientId: 00000000000000000000000000000000,
Name: String,
Address1: String,
Address2: String,
City: String,
State: String,
Zip: String,
Phone: String,
Fax: String,
URL: String,
Email: String,
TimeZone: String,
Active: False,
EntDate: 0001-01-01,
ModDate: 0001-01-01,
LocationImage: String
}
}
]
}
]
}