| POST,OPTIONS | /v1/dashboard/kpiv2/visits |
|---|
import 'package:servicestack/servicestack.dart';
class SvcVisitRow implements IConvertible
{
String? CheckinId;
String? TicketLabel;
DateTime? LocalDate;
String? LineId;
String? ServiceName;
String? StationId;
String? StationName;
String? EmployeeId;
String? EmployeeName;
String? CustomerName;
int? ContactId;
int? ContactAgentId;
String? CustomerId;
bool? IsAppointment;
DateTime? LocalHere;
DateTime? LocalCalled;
DateTime? LocalStart;
DateTime? LocalEnd;
int? WaitSec;
int? ServeSec;
String? Outcome;
double? Fee;
SvcVisitRow({this.CheckinId,this.TicketLabel,this.LocalDate,this.LineId,this.ServiceName,this.StationId,this.StationName,this.EmployeeId,this.EmployeeName,this.CustomerName,this.ContactId,this.ContactAgentId,this.CustomerId,this.IsAppointment,this.LocalHere,this.LocalCalled,this.LocalStart,this.LocalEnd,this.WaitSec,this.ServeSec,this.Outcome,this.Fee});
SvcVisitRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CheckinId = json['CheckinId'];
TicketLabel = json['TicketLabel'];
LocalDate = JsonConverters.fromJson(json['LocalDate'],'DateTime',context!);
LineId = json['LineId'];
ServiceName = json['ServiceName'];
StationId = json['StationId'];
StationName = json['StationName'];
EmployeeId = json['EmployeeId'];
EmployeeName = json['EmployeeName'];
CustomerName = json['CustomerName'];
ContactId = json['ContactId'];
ContactAgentId = json['ContactAgentId'];
CustomerId = json['CustomerId'];
IsAppointment = json['IsAppointment'];
LocalHere = JsonConverters.fromJson(json['LocalHere'],'DateTime',context!);
LocalCalled = JsonConverters.fromJson(json['LocalCalled'],'DateTime',context!);
LocalStart = JsonConverters.fromJson(json['LocalStart'],'DateTime',context!);
LocalEnd = JsonConverters.fromJson(json['LocalEnd'],'DateTime',context!);
WaitSec = json['WaitSec'];
ServeSec = json['ServeSec'];
Outcome = json['Outcome'];
Fee = JsonConverters.toDouble(json['Fee']);
return this;
}
Map<String, dynamic> toJson() => {
'CheckinId': CheckinId,
'TicketLabel': TicketLabel,
'LocalDate': JsonConverters.toJson(LocalDate,'DateTime',context!),
'LineId': LineId,
'ServiceName': ServiceName,
'StationId': StationId,
'StationName': StationName,
'EmployeeId': EmployeeId,
'EmployeeName': EmployeeName,
'CustomerName': CustomerName,
'ContactId': ContactId,
'ContactAgentId': ContactAgentId,
'CustomerId': CustomerId,
'IsAppointment': IsAppointment,
'LocalHere': JsonConverters.toJson(LocalHere,'DateTime',context!),
'LocalCalled': JsonConverters.toJson(LocalCalled,'DateTime',context!),
'LocalStart': JsonConverters.toJson(LocalStart,'DateTime',context!),
'LocalEnd': JsonConverters.toJson(LocalEnd,'DateTime',context!),
'WaitSec': WaitSec,
'ServeSec': ServeSec,
'Outcome': Outcome,
'Fee': Fee
};
getTypeName() => "SvcVisitRow";
TypeContext? context = _ctx;
}
class SvcChip implements IConvertible
{
String? LineId;
String? Name;
int? N;
SvcChip({this.LineId,this.Name,this.N});
SvcChip.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
LineId = json['LineId'];
Name = json['Name'];
N = json['N'];
return this;
}
Map<String, dynamic> toJson() => {
'LineId': LineId,
'Name': Name,
'N': N
};
getTypeName() => "SvcChip";
TypeContext? context = _ctx;
}
class SvcVisitPage implements IConvertible
{
List<SvcVisitRow>? Rows = [];
int? TotalRows;
int? Page;
int? PageSize;
Map<String,int?>? OutcomeCounts = {};
List<SvcChip>? Services = [];
bool? CanSeeStaff;
bool? CanSeeFinancial;
SvcVisitPage({this.Rows,this.TotalRows,this.Page,this.PageSize,this.OutcomeCounts,this.Services,this.CanSeeStaff,this.CanSeeFinancial});
SvcVisitPage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Rows = JsonConverters.fromJson(json['Rows'],'List<SvcVisitRow>',context!);
TotalRows = json['TotalRows'];
Page = json['Page'];
PageSize = json['PageSize'];
OutcomeCounts = JsonConverters.fromJson(json['OutcomeCounts'],'Map<String,int?>',context!);
Services = JsonConverters.fromJson(json['Services'],'List<SvcChip>',context!);
CanSeeStaff = json['CanSeeStaff'];
CanSeeFinancial = json['CanSeeFinancial'];
return this;
}
Map<String, dynamic> toJson() => {
'Rows': JsonConverters.toJson(Rows,'List<SvcVisitRow>',context!),
'TotalRows': TotalRows,
'Page': Page,
'PageSize': PageSize,
'OutcomeCounts': JsonConverters.toJson(OutcomeCounts,'Map<String,int?>',context!),
'Services': JsonConverters.toJson(Services,'List<SvcChip>',context!),
'CanSeeStaff': CanSeeStaff,
'CanSeeFinancial': CanSeeFinancial
};
getTypeName() => "SvcVisitPage";
TypeContext? context = _ctx;
}
class KpiV2VisitsResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
SvcVisitPage? Visits;
KpiV2VisitsResponse({this.ResponseStatus,this.Visits});
KpiV2VisitsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Visits = JsonConverters.fromJson(json['Visits'],'SvcVisitPage',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Visits': JsonConverters.toJson(Visits,'SvcVisitPage',context!)
};
getTypeName() => "KpiV2VisitsResponse";
TypeContext? context = _ctx;
}
class KpiV2VisitsRequest implements IConvertible
{
String? BranchId;
DateTime? FromDate;
DateTime? ToDate;
String? StationId;
String? EmployeeId;
String? Outcome;
String? LineId;
int? Page;
int? PageSize;
KpiV2VisitsRequest({this.BranchId,this.FromDate,this.ToDate,this.StationId,this.EmployeeId,this.Outcome,this.LineId,this.Page,this.PageSize});
KpiV2VisitsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
BranchId = json['BranchId'];
FromDate = JsonConverters.fromJson(json['FromDate'],'DateTime',context!);
ToDate = JsonConverters.fromJson(json['ToDate'],'DateTime',context!);
StationId = json['StationId'];
EmployeeId = json['EmployeeId'];
Outcome = json['Outcome'];
LineId = json['LineId'];
Page = json['Page'];
PageSize = json['PageSize'];
return this;
}
Map<String, dynamic> toJson() => {
'BranchId': BranchId,
'FromDate': JsonConverters.toJson(FromDate,'DateTime',context!),
'ToDate': JsonConverters.toJson(ToDate,'DateTime',context!),
'StationId': StationId,
'EmployeeId': EmployeeId,
'Outcome': Outcome,
'LineId': LineId,
'Page': Page,
'PageSize': PageSize
};
getTypeName() => "KpiV2VisitsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'SvcVisitRow': TypeInfo(TypeOf.Class, create:() => SvcVisitRow()),
'SvcChip': TypeInfo(TypeOf.Class, create:() => SvcChip()),
'SvcVisitPage': TypeInfo(TypeOf.Class, create:() => SvcVisitPage()),
'List<SvcVisitRow>': TypeInfo(TypeOf.Class, create:() => <SvcVisitRow>[]),
'Map<String,int?>': TypeInfo(TypeOf.Class, create:() => Map<String,int?>()),
'List<SvcChip>': TypeInfo(TypeOf.Class, create:() => <SvcChip>[]),
'KpiV2VisitsResponse': TypeInfo(TypeOf.Class, create:() => KpiV2VisitsResponse()),
'KpiV2VisitsRequest': TypeInfo(TypeOf.Class, create:() => KpiV2VisitsRequest()),
});
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/dashboard/kpiv2/visits HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
BranchId: 00000000000000000000000000000000,
FromDate: 0001-01-01,
ToDate: 0001-01-01,
StationId: 00000000000000000000000000000000,
EmployeeId: 00000000000000000000000000000000,
Outcome: String,
LineId: 00000000000000000000000000000000,
Page: 0,
PageSize: 0
}
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
}
},
Visits:
{
Rows:
[
{
CheckinId: 00000000000000000000000000000000,
TicketLabel: String,
LocalDate: 0001-01-01,
LineId: 00000000000000000000000000000000,
ServiceName: String,
StationId: 00000000000000000000000000000000,
StationName: String,
EmployeeId: 00000000000000000000000000000000,
EmployeeName: String,
CustomerName: String,
ContactId: 0,
ContactAgentId: 0,
CustomerId: 00000000000000000000000000000000,
IsAppointment: False,
LocalHere: 0001-01-01,
LocalCalled: 0001-01-01,
LocalStart: 0001-01-01,
LocalEnd: 0001-01-01,
WaitSec: 0,
ServeSec: 0,
Outcome: String,
Fee: 0
}
],
TotalRows: 0,
Page: 0,
PageSize: 0,
OutcomeCounts:
{
String: 0
},
Services:
[
{
LineId: 00000000000000000000000000000000,
Name: String,
N: 0
}
],
CanSeeStaff: False,
CanSeeFinancial: False
}
}