TicketUserServices

<back to all web services

DiscountCodeReportRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:ReadData
The following routes are available for this service:
POST/DiscountCodeReport
import 'package:servicestack/servicestack.dart';

class DiscountCodeReportRow implements IConvertible
{
    String? code;
    int? discountCodeTypeId;
    String? typeName;
    bool? isPercent;
    double? percent;
    double? fixedAmount;
    int? redemptions;
    int? ticketCount;
    double? amountDiscounted;
    int? reversedRedemptions;
    double? reversedAmount;
    DateTime? firstUsedAt;
    DateTime? lastUsedAt;

    DiscountCodeReportRow({this.code,this.discountCodeTypeId,this.typeName,this.isPercent,this.percent,this.fixedAmount,this.redemptions,this.ticketCount,this.amountDiscounted,this.reversedRedemptions,this.reversedAmount,this.firstUsedAt,this.lastUsedAt});
    DiscountCodeReportRow.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        discountCodeTypeId = json['discountCodeTypeId'];
        typeName = json['typeName'];
        isPercent = json['isPercent'];
        percent = JsonConverters.toDouble(json['percent']);
        fixedAmount = JsonConverters.toDouble(json['fixedAmount']);
        redemptions = json['redemptions'];
        ticketCount = json['ticketCount'];
        amountDiscounted = JsonConverters.toDouble(json['amountDiscounted']);
        reversedRedemptions = json['reversedRedemptions'];
        reversedAmount = JsonConverters.toDouble(json['reversedAmount']);
        firstUsedAt = JsonConverters.fromJson(json['firstUsedAt'],'DateTime',context!);
        lastUsedAt = JsonConverters.fromJson(json['lastUsedAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'discountCodeTypeId': discountCodeTypeId,
        'typeName': typeName,
        'isPercent': isPercent,
        'percent': percent,
        'fixedAmount': fixedAmount,
        'redemptions': redemptions,
        'ticketCount': ticketCount,
        'amountDiscounted': amountDiscounted,
        'reversedRedemptions': reversedRedemptions,
        'reversedAmount': reversedAmount,
        'firstUsedAt': JsonConverters.toJson(firstUsedAt,'DateTime',context!),
        'lastUsedAt': JsonConverters.toJson(lastUsedAt,'DateTime',context!)
    };

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

class DiscountCodeReportResult implements IConvertible
{
    List<DiscountCodeReportRow>? items;
    int? ticketCountTotal;
    double? amountDiscountedTotal;
    int? statusCode;
    String? message;

    DiscountCodeReportResult({this.items,this.ticketCountTotal,this.amountDiscountedTotal,this.statusCode,this.message});
    DiscountCodeReportResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        items = JsonConverters.fromJson(json['items'],'List<DiscountCodeReportRow>',context!);
        ticketCountTotal = json['ticketCountTotal'];
        amountDiscountedTotal = JsonConverters.toDouble(json['amountDiscountedTotal']);
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'items': JsonConverters.toJson(items,'List<DiscountCodeReportRow>',context!),
        'ticketCountTotal': ticketCountTotal,
        'amountDiscountedTotal': amountDiscountedTotal,
        'statusCode': statusCode,
        'message': message
    };

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

class DiscountCodeReportRequest implements IConvertible
{
    int? ownerId;
    List<int>? eventIds;

    DiscountCodeReportRequest({this.ownerId,this.eventIds});
    DiscountCodeReportRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ownerId = json['ownerId'];
        eventIds = JsonConverters.fromJson(json['eventIds'],'List<int>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ownerId': ownerId,
        'eventIds': JsonConverters.toJson(eventIds,'List<int>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'DiscountCodeReportRow': TypeInfo(TypeOf.Class, create:() => DiscountCodeReportRow()),
    'DiscountCodeReportResult': TypeInfo(TypeOf.Class, create:() => DiscountCodeReportResult()),
    'List<DiscountCodeReportRow>': TypeInfo(TypeOf.Class, create:() => <DiscountCodeReportRow>[]),
    'DiscountCodeReportRequest': TypeInfo(TypeOf.Class, create:() => DiscountCodeReportRequest()),
});

Dart DiscountCodeReportRequest 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 /DiscountCodeReport HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DiscountCodeReportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <EventIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </EventIds>
  <OwnerId>0</OwnerId>
</DiscountCodeReportRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DiscountCodeReportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <AmountDiscountedTotal>0</AmountDiscountedTotal>
  <Items>
    <DiscountCodeReportRow>
      <AmountDiscounted>0</AmountDiscounted>
      <Code>String</Code>
      <DiscountCodeTypeId>0</DiscountCodeTypeId>
      <FirstUsedAt>0001-01-01T00:00:00</FirstUsedAt>
      <FixedAmount>0</FixedAmount>
      <IsPercent>false</IsPercent>
      <LastUsedAt>0001-01-01T00:00:00</LastUsedAt>
      <Percent>0</Percent>
      <Redemptions>0</Redemptions>
      <ReversedAmount>0</ReversedAmount>
      <ReversedRedemptions>0</ReversedRedemptions>
      <TicketCount>0</TicketCount>
      <TypeName>String</TypeName>
    </DiscountCodeReportRow>
  </Items>
  <Message>String</Message>
  <StatusCode>0</StatusCode>
  <TicketCountTotal>0</TicketCountTotal>
</DiscountCodeReportResult>