Trendsic Platform Service

<back to all web services

InvoiceWorkChangesDecideRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ProjectUID: 00000000000000000000000000000000,
	InvoiceID: 0,
	Decision: String,
	Remember: False,
	Sources: 
	[
		{
			SourceType: String,
			SourceID: 0,
			JobID: 0,
			WorkDay: 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
		}
	},
	Success: False,
	Changes: 
	[
		{
			SourceType: String,
			SourceID: 0,
			JobID: 0,
			WorkDate: 0001-01-01,
			WorkDay: String,
			DisplayDay: String,
			Label: String,
			JobName: String,
			DisplayDate: 0001-01-01,
			Unit: String,
			Billed: 0,
			NowQuantity: 0,
			OverBilled: 0,
			UnitFactor: 0,
			Price: 0,
			Amount: 0,
			LineType: String,
			IsTaxable: False,
			InvoiceID: 0,
			InvoiceUID: 00000000000000000000000000000000,
			InvoiceNumber: String,
			InvoiceTotal: 0,
			InvoiceIsLocked: False,
			InvoiceIsPaid: False,
			State: String,
			Remembered: String,
			DecidedByName: String,
			DecidedAt: 0001-01-01
		}
	]
}