| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/invoice/workchanges/{ProjectUID}/decide |
|---|
import 'package:servicestack/servicestack.dart';
class InvoiceWorkChange implements IConvertible
{
String? SourceType;
int? SourceID;
int? JobID;
DateTime? WorkDate;
String? WorkDay;
String? DisplayDay;
String? Label;
String? JobName;
DateTime? DisplayDate;
String? Unit;
double? Billed;
double? NowQuantity;
double? OverBilled;
double? UnitFactor;
double? Price;
double? Amount;
String? LineType;
bool? IsTaxable;
int? InvoiceID;
String? InvoiceUID;
String? InvoiceNumber;
double? InvoiceTotal;
bool? InvoiceIsLocked;
bool? InvoiceIsPaid;
String? State;
String? Remembered;
String? DecidedByName;
DateTime? DecidedAt;
InvoiceWorkChange({this.SourceType,this.SourceID,this.JobID,this.WorkDate,this.WorkDay,this.DisplayDay,this.Label,this.JobName,this.DisplayDate,this.Unit,this.Billed,this.NowQuantity,this.OverBilled,this.UnitFactor,this.Price,this.Amount,this.LineType,this.IsTaxable,this.InvoiceID,this.InvoiceUID,this.InvoiceNumber,this.InvoiceTotal,this.InvoiceIsLocked,this.InvoiceIsPaid,this.State,this.Remembered,this.DecidedByName,this.DecidedAt});
InvoiceWorkChange.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
SourceType = json['SourceType'];
SourceID = json['SourceID'];
JobID = json['JobID'];
WorkDate = JsonConverters.fromJson(json['WorkDate'],'DateTime',context!);
WorkDay = json['WorkDay'];
DisplayDay = json['DisplayDay'];
Label = json['Label'];
JobName = json['JobName'];
DisplayDate = JsonConverters.fromJson(json['DisplayDate'],'DateTime',context!);
Unit = json['Unit'];
Billed = JsonConverters.toDouble(json['Billed']);
NowQuantity = JsonConverters.toDouble(json['NowQuantity']);
OverBilled = JsonConverters.toDouble(json['OverBilled']);
UnitFactor = JsonConverters.toDouble(json['UnitFactor']);
Price = JsonConverters.toDouble(json['Price']);
Amount = JsonConverters.toDouble(json['Amount']);
LineType = json['LineType'];
IsTaxable = json['IsTaxable'];
InvoiceID = json['InvoiceID'];
InvoiceUID = json['InvoiceUID'];
InvoiceNumber = json['InvoiceNumber'];
InvoiceTotal = JsonConverters.toDouble(json['InvoiceTotal']);
InvoiceIsLocked = json['InvoiceIsLocked'];
InvoiceIsPaid = json['InvoiceIsPaid'];
State = json['State'];
Remembered = json['Remembered'];
DecidedByName = json['DecidedByName'];
DecidedAt = JsonConverters.fromJson(json['DecidedAt'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'SourceType': SourceType,
'SourceID': SourceID,
'JobID': JobID,
'WorkDate': JsonConverters.toJson(WorkDate,'DateTime',context!),
'WorkDay': WorkDay,
'DisplayDay': DisplayDay,
'Label': Label,
'JobName': JobName,
'DisplayDate': JsonConverters.toJson(DisplayDate,'DateTime',context!),
'Unit': Unit,
'Billed': Billed,
'NowQuantity': NowQuantity,
'OverBilled': OverBilled,
'UnitFactor': UnitFactor,
'Price': Price,
'Amount': Amount,
'LineType': LineType,
'IsTaxable': IsTaxable,
'InvoiceID': InvoiceID,
'InvoiceUID': InvoiceUID,
'InvoiceNumber': InvoiceNumber,
'InvoiceTotal': InvoiceTotal,
'InvoiceIsLocked': InvoiceIsLocked,
'InvoiceIsPaid': InvoiceIsPaid,
'State': State,
'Remembered': Remembered,
'DecidedByName': DecidedByName,
'DecidedAt': JsonConverters.toJson(DecidedAt,'DateTime',context!)
};
getTypeName() => "InvoiceWorkChange";
TypeContext? context = _ctx;
}
class InvoiceWorkChangesResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
bool? Success;
List<InvoiceWorkChange>? Changes = [];
InvoiceWorkChangesResponse({this.ResponseStatus,this.Success,this.Changes});
InvoiceWorkChangesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Success = json['Success'];
Changes = JsonConverters.fromJson(json['Changes'],'List<InvoiceWorkChange>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Success': Success,
'Changes': JsonConverters.toJson(Changes,'List<InvoiceWorkChange>',context!)
};
getTypeName() => "InvoiceWorkChangesResponse";
TypeContext? context = _ctx;
}
class InvoiceWorkChangeKey implements IConvertible
{
String? SourceType;
int? SourceID;
int? JobID;
String? WorkDay;
InvoiceWorkChangeKey({this.SourceType,this.SourceID,this.JobID,this.WorkDay});
InvoiceWorkChangeKey.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
SourceType = json['SourceType'];
SourceID = json['SourceID'];
JobID = json['JobID'];
WorkDay = json['WorkDay'];
return this;
}
Map<String, dynamic> toJson() => {
'SourceType': SourceType,
'SourceID': SourceID,
'JobID': JobID,
'WorkDay': WorkDay
};
getTypeName() => "InvoiceWorkChangeKey";
TypeContext? context = _ctx;
}
class InvoiceWorkChangesDecideRequest implements IConvertible
{
String? ProjectUID;
int? InvoiceID;
String? Decision;
bool? Remember;
List<InvoiceWorkChangeKey>? Sources = [];
InvoiceWorkChangesDecideRequest({this.ProjectUID,this.InvoiceID,this.Decision,this.Remember,this.Sources});
InvoiceWorkChangesDecideRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectUID = json['ProjectUID'];
InvoiceID = json['InvoiceID'];
Decision = json['Decision'];
Remember = json['Remember'];
Sources = JsonConverters.fromJson(json['Sources'],'List<InvoiceWorkChangeKey>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectUID': ProjectUID,
'InvoiceID': InvoiceID,
'Decision': Decision,
'Remember': Remember,
'Sources': JsonConverters.toJson(Sources,'List<InvoiceWorkChangeKey>',context!)
};
getTypeName() => "InvoiceWorkChangesDecideRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'InvoiceWorkChange': TypeInfo(TypeOf.Class, create:() => InvoiceWorkChange()),
'InvoiceWorkChangesResponse': TypeInfo(TypeOf.Class, create:() => InvoiceWorkChangesResponse()),
'List<InvoiceWorkChange>': TypeInfo(TypeOf.Class, create:() => <InvoiceWorkChange>[]),
'InvoiceWorkChangeKey': TypeInfo(TypeOf.Class, create:() => InvoiceWorkChangeKey()),
'InvoiceWorkChangesDecideRequest': TypeInfo(TypeOf.Class, create:() => InvoiceWorkChangesDecideRequest()),
'List<InvoiceWorkChangeKey>': TypeInfo(TypeOf.Class, create:() => <InvoiceWorkChangeKey>[]),
});
Dart InvoiceWorkChangesDecideRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/invoice/workchanges/{ProjectUID}/decide HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<InvoiceWorkChangesDecideRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Decision>String</Decision>
<InvoiceID>0</InvoiceID>
<ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
<Remember>false</Remember>
<Sources>
<InvoiceWorkChangeKey>
<JobID>0</JobID>
<SourceID>0</SourceID>
<SourceType>String</SourceType>
<WorkDay>String</WorkDay>
</InvoiceWorkChangeKey>
</Sources>
</InvoiceWorkChangesDecideRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<InvoiceWorkChangesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Changes>
<InvoiceWorkChange>
<Amount>0</Amount>
<Billed>0</Billed>
<DecidedAt>0001-01-01T00:00:00</DecidedAt>
<DecidedByName>String</DecidedByName>
<DisplayDate>0001-01-01T00:00:00</DisplayDate>
<DisplayDay>String</DisplayDay>
<InvoiceID>0</InvoiceID>
<InvoiceIsLocked>false</InvoiceIsLocked>
<InvoiceIsPaid>false</InvoiceIsPaid>
<InvoiceNumber>String</InvoiceNumber>
<InvoiceTotal>0</InvoiceTotal>
<InvoiceUID>00000000-0000-0000-0000-000000000000</InvoiceUID>
<IsTaxable>false</IsTaxable>
<JobID>0</JobID>
<JobName>String</JobName>
<Label>String</Label>
<LineType>String</LineType>
<NowQuantity>0</NowQuantity>
<OverBilled>0</OverBilled>
<Price>0</Price>
<Remembered>String</Remembered>
<SourceID>0</SourceID>
<SourceType>String</SourceType>
<State>String</State>
<Unit>String</Unit>
<UnitFactor>0</UnitFactor>
<WorkDate>0001-01-01T00:00:00</WorkDate>
<WorkDay>String</WorkDay>
</InvoiceWorkChange>
</Changes>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<Success>false</Success>
</InvoiceWorkChangesResponse>