Trendsic Platform Service

<back to all web services

KpiV2VisitsRequest

Requires Authentication
The following routes are available for this service:
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()),
});

Dart KpiV2VisitsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<KpiV2VisitsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <BranchId>00000000-0000-0000-0000-000000000000</BranchId>
  <EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
  <FromDate>0001-01-01T00:00:00</FromDate>
  <LineId>00000000-0000-0000-0000-000000000000</LineId>
  <Outcome>String</Outcome>
  <Page>0</Page>
  <PageSize>0</PageSize>
  <StationId>00000000-0000-0000-0000-000000000000</StationId>
  <ToDate>0001-01-01T00:00:00</ToDate>
</KpiV2VisitsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<KpiV2VisitsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <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>
  <Visits>
    <CanSeeFinancial>false</CanSeeFinancial>
    <CanSeeStaff>false</CanSeeStaff>
    <OutcomeCounts xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringint>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>0</d3p1:Value>
      </d3p1:KeyValueOfstringint>
    </OutcomeCounts>
    <Page>0</Page>
    <PageSize>0</PageSize>
    <Rows>
      <SvcVisitRow>
        <CheckinId>00000000-0000-0000-0000-000000000000</CheckinId>
        <ContactAgentId>0</ContactAgentId>
        <ContactId>0</ContactId>
        <CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
        <CustomerName>String</CustomerName>
        <EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
        <EmployeeName>String</EmployeeName>
        <Fee>0</Fee>
        <IsAppointment>false</IsAppointment>
        <LineId>00000000-0000-0000-0000-000000000000</LineId>
        <LocalCalled>0001-01-01T00:00:00</LocalCalled>
        <LocalDate>0001-01-01T00:00:00</LocalDate>
        <LocalEnd>0001-01-01T00:00:00</LocalEnd>
        <LocalHere>0001-01-01T00:00:00</LocalHere>
        <LocalStart>0001-01-01T00:00:00</LocalStart>
        <Outcome>String</Outcome>
        <ServeSec>0</ServeSec>
        <ServiceName>String</ServiceName>
        <StationId>00000000-0000-0000-0000-000000000000</StationId>
        <StationName>String</StationName>
        <TicketLabel>String</TicketLabel>
        <WaitSec>0</WaitSec>
      </SvcVisitRow>
    </Rows>
    <Services>
      <SvcChip>
        <LineId>00000000-0000-0000-0000-000000000000</LineId>
        <N>0</N>
        <Name>String</Name>
      </SvcChip>
    </Services>
    <TotalRows>0</TotalRows>
  </Visits>
</KpiV2VisitsResponse>