Trendsic Platform Service

<back to all web services

VisitBoardRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/visits/board
import 'package:servicestack/servicestack.dart';

class VisitCard implements IConvertible
{
    String? VisitKey;
    int? JobID;
    int? ProjectID;
    String? ProjectUID;
    int? AgreementJobID;
    String? ScheduledDate;
    String? CustomerName;
    String? JobName;
    String? LocationName;
    String? City;
    String? Zip;
    double? Lat;
    double? Lng;
    int? CrewID;
    String? CrewName;
    int? SortOrder;
    String? Status;
    int? DurationMinutes;
    String? EtaWindow;
    bool? IsCommercial;

    VisitCard({this.VisitKey,this.JobID,this.ProjectID,this.ProjectUID,this.AgreementJobID,this.ScheduledDate,this.CustomerName,this.JobName,this.LocationName,this.City,this.Zip,this.Lat,this.Lng,this.CrewID,this.CrewName,this.SortOrder,this.Status,this.DurationMinutes,this.EtaWindow,this.IsCommercial});
    VisitCard.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        VisitKey = json['VisitKey'];
        JobID = json['JobID'];
        ProjectID = json['ProjectID'];
        ProjectUID = json['ProjectUID'];
        AgreementJobID = json['AgreementJobID'];
        ScheduledDate = json['ScheduledDate'];
        CustomerName = json['CustomerName'];
        JobName = json['JobName'];
        LocationName = json['LocationName'];
        City = json['City'];
        Zip = json['Zip'];
        Lat = JsonConverters.toDouble(json['Lat']);
        Lng = JsonConverters.toDouble(json['Lng']);
        CrewID = json['CrewID'];
        CrewName = json['CrewName'];
        SortOrder = json['SortOrder'];
        Status = json['Status'];
        DurationMinutes = json['DurationMinutes'];
        EtaWindow = json['EtaWindow'];
        IsCommercial = json['IsCommercial'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'VisitKey': VisitKey,
        'JobID': JobID,
        'ProjectID': ProjectID,
        'ProjectUID': ProjectUID,
        'AgreementJobID': AgreementJobID,
        'ScheduledDate': ScheduledDate,
        'CustomerName': CustomerName,
        'JobName': JobName,
        'LocationName': LocationName,
        'City': City,
        'Zip': Zip,
        'Lat': Lat,
        'Lng': Lng,
        'CrewID': CrewID,
        'CrewName': CrewName,
        'SortOrder': SortOrder,
        'Status': Status,
        'DurationMinutes': DurationMinutes,
        'EtaWindow': EtaWindow,
        'IsCommercial': IsCommercial
    };

    getTypeName() => "VisitCard";
    TypeContext? context = _ctx;
}

class CrewColumn implements IConvertible
{
    int? CrewID;
    String? CrewName;
    String? CrewColor;
    int? MemberCount;
    List<VisitCard>? Visits = [];
    double? DriveMiles;
    int? DriveMinutes;
    int? OnSiteMinutes;
    int? BillablePct;

    CrewColumn({this.CrewID,this.CrewName,this.CrewColor,this.MemberCount,this.Visits,this.DriveMiles,this.DriveMinutes,this.OnSiteMinutes,this.BillablePct});
    CrewColumn.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CrewID = json['CrewID'];
        CrewName = json['CrewName'];
        CrewColor = json['CrewColor'];
        MemberCount = json['MemberCount'];
        Visits = JsonConverters.fromJson(json['Visits'],'List<VisitCard>',context!);
        DriveMiles = JsonConverters.toDouble(json['DriveMiles']);
        DriveMinutes = json['DriveMinutes'];
        OnSiteMinutes = json['OnSiteMinutes'];
        BillablePct = json['BillablePct'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CrewID': CrewID,
        'CrewName': CrewName,
        'CrewColor': CrewColor,
        'MemberCount': MemberCount,
        'Visits': JsonConverters.toJson(Visits,'List<VisitCard>',context!),
        'DriveMiles': DriveMiles,
        'DriveMinutes': DriveMinutes,
        'OnSiteMinutes': OnSiteMinutes,
        'BillablePct': BillablePct
    };

    getTypeName() => "CrewColumn";
    TypeContext? context = _ctx;
}

class BoardReadiness implements IConvertible
{
    int? TotalVisits;
    int? Assigned;
    int? Unassigned;
    int? Conflicts;
    int? AssignedPct;

    BoardReadiness({this.TotalVisits,this.Assigned,this.Unassigned,this.Conflicts,this.AssignedPct});
    BoardReadiness.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TotalVisits = json['TotalVisits'];
        Assigned = json['Assigned'];
        Unassigned = json['Unassigned'];
        Conflicts = json['Conflicts'];
        AssignedPct = json['AssignedPct'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TotalVisits': TotalVisits,
        'Assigned': Assigned,
        'Unassigned': Unassigned,
        'Conflicts': Conflicts,
        'AssignedPct': AssignedPct
    };

    getTypeName() => "BoardReadiness";
    TypeContext? context = _ctx;
}

class VisitBoardResponse implements IConvertible
{
    String? Date;
    List<CrewColumn>? Crews = [];
    List<VisitCard>? Unassigned = [];
    BoardReadiness? Readiness;
    ResponseStatus? ResponseStatus;

    VisitBoardResponse({this.Date,this.Crews,this.Unassigned,this.Readiness,this.ResponseStatus});
    VisitBoardResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Date = json['Date'];
        Crews = JsonConverters.fromJson(json['Crews'],'List<CrewColumn>',context!);
        Unassigned = JsonConverters.fromJson(json['Unassigned'],'List<VisitCard>',context!);
        Readiness = JsonConverters.fromJson(json['Readiness'],'BoardReadiness',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Date': Date,
        'Crews': JsonConverters.toJson(Crews,'List<CrewColumn>',context!),
        'Unassigned': JsonConverters.toJson(Unassigned,'List<VisitCard>',context!),
        'Readiness': JsonConverters.toJson(Readiness,'BoardReadiness',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "VisitBoardResponse";
    TypeContext? context = _ctx;
}

class VisitBoardRequest implements IConvertible
{
    String? Date;

    VisitBoardRequest({this.Date});
    VisitBoardRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Date = json['Date'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Date': Date
    };

    getTypeName() => "VisitBoardRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'VisitCard': TypeInfo(TypeOf.Class, create:() => VisitCard()),
    'CrewColumn': TypeInfo(TypeOf.Class, create:() => CrewColumn()),
    'List<VisitCard>': TypeInfo(TypeOf.Class, create:() => <VisitCard>[]),
    'BoardReadiness': TypeInfo(TypeOf.Class, create:() => BoardReadiness()),
    'VisitBoardResponse': TypeInfo(TypeOf.Class, create:() => VisitBoardResponse()),
    'List<CrewColumn>': TypeInfo(TypeOf.Class, create:() => <CrewColumn>[]),
    'VisitBoardRequest': TypeInfo(TypeOf.Class, create:() => VisitBoardRequest()),
});

Dart VisitBoardRequest 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.

GET /v1/visits/board HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Date: String,
	Crews: 
	[
		{
			CrewID: 0,
			CrewName: String,
			CrewColor: String,
			MemberCount: 0,
			Visits: 
			[
				{
					VisitKey: String,
					JobID: 0,
					ProjectID: 0,
					ProjectUID: String,
					AgreementJobID: 0,
					ScheduledDate: String,
					CustomerName: String,
					JobName: String,
					LocationName: String,
					City: String,
					Zip: String,
					Lat: 0,
					Lng: 0,
					CrewID: 0,
					CrewName: String,
					SortOrder: 0,
					Status: String,
					DurationMinutes: 0,
					EtaWindow: String,
					IsCommercial: False
				}
			],
			DriveMiles: 0,
			DriveMinutes: 0,
			OnSiteMinutes: 0,
			BillablePct: 0
		}
	],
	Unassigned: 
	[
		{
			VisitKey: String,
			JobID: 0,
			ProjectID: 0,
			ProjectUID: String,
			AgreementJobID: 0,
			ScheduledDate: String,
			CustomerName: String,
			JobName: String,
			LocationName: String,
			City: String,
			Zip: String,
			Lat: 0,
			Lng: 0,
			CrewID: 0,
			CrewName: String,
			SortOrder: 0,
			Status: String,
			DurationMinutes: 0,
			EtaWindow: String,
			IsCommercial: False
		}
	],
	Readiness: 
	{
		TotalVisits: 0,
		Assigned: 0,
		Unassigned: 0,
		Conflicts: 0,
		AssignedPct: 0
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}