| Requires any of the roles: | Admin, TeamAdmin, MobileApp | Requires the permission: | ReadData |
| GET POST | /ticketOrder/CalculatePrices |
|---|
import 'package:servicestack/servicestack.dart';
class TicketDetails implements IConvertible
{
int? id;
int? ticketId;
int? eventSeriesTicketType;
int? eventSeriesOwnerTicketType;
double? ticketPrice;
double? totalPrice;
int? count;
String? ticketColor;
bool? showUsedTickets;
String? ticketName;
String? ticketDisplayString;
int? ticketDetailsTransferredFrom;
int? teamPassId;
bool? isSpecialTicket;
String? specialTicketId;
bool? justChangedBySQL;
DateTime? sqlJustChangedTimeStamp;
String? currency;
String? discountCode;
double? totalDiscount;
double? totalAmountBeforeDiscount;
double? ticketPriceBeforeDiscount;
TicketDetails({this.id,this.ticketId,this.eventSeriesTicketType,this.eventSeriesOwnerTicketType,this.ticketPrice,this.totalPrice,this.count,this.ticketColor,this.showUsedTickets,this.ticketName,this.ticketDisplayString,this.ticketDetailsTransferredFrom,this.teamPassId,this.isSpecialTicket,this.specialTicketId,this.justChangedBySQL,this.sqlJustChangedTimeStamp,this.currency,this.discountCode,this.totalDiscount,this.totalAmountBeforeDiscount,this.ticketPriceBeforeDiscount});
TicketDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
ticketId = json['ticketId'];
eventSeriesTicketType = json['eventSeriesTicketType'];
eventSeriesOwnerTicketType = json['eventSeriesOwnerTicketType'];
ticketPrice = JsonConverters.toDouble(json['ticketPrice']);
totalPrice = JsonConverters.toDouble(json['totalPrice']);
count = json['count'];
ticketColor = json['ticketColor'];
showUsedTickets = json['showUsedTickets'];
ticketName = json['ticketName'];
ticketDisplayString = json['ticketDisplayString'];
ticketDetailsTransferredFrom = json['ticketDetailsTransferredFrom'];
teamPassId = json['teamPassId'];
isSpecialTicket = json['isSpecialTicket'];
specialTicketId = json['specialTicketId'];
justChangedBySQL = json['justChangedBySQL'];
sqlJustChangedTimeStamp = JsonConverters.fromJson(json['sqlJustChangedTimeStamp'],'DateTime',context!);
currency = json['currency'];
discountCode = json['discountCode'];
totalDiscount = JsonConverters.toDouble(json['totalDiscount']);
totalAmountBeforeDiscount = JsonConverters.toDouble(json['totalAmountBeforeDiscount']);
ticketPriceBeforeDiscount = JsonConverters.toDouble(json['ticketPriceBeforeDiscount']);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'ticketId': ticketId,
'eventSeriesTicketType': eventSeriesTicketType,
'eventSeriesOwnerTicketType': eventSeriesOwnerTicketType,
'ticketPrice': ticketPrice,
'totalPrice': totalPrice,
'count': count,
'ticketColor': ticketColor,
'showUsedTickets': showUsedTickets,
'ticketName': ticketName,
'ticketDisplayString': ticketDisplayString,
'ticketDetailsTransferredFrom': ticketDetailsTransferredFrom,
'teamPassId': teamPassId,
'isSpecialTicket': isSpecialTicket,
'specialTicketId': specialTicketId,
'justChangedBySQL': justChangedBySQL,
'sqlJustChangedTimeStamp': JsonConverters.toJson(sqlJustChangedTimeStamp,'DateTime',context!),
'currency': currency,
'discountCode': discountCode,
'totalDiscount': totalDiscount,
'totalAmountBeforeDiscount': totalAmountBeforeDiscount,
'ticketPriceBeforeDiscount': ticketPriceBeforeDiscount
};
getTypeName() => "TicketDetails";
TypeContext? context = _ctx;
}
class CalculateDiscountPricesRequest implements IConvertible
{
String? discountCode;
String? fullPhoneNumber;
int? eventId;
List<TicketDetails>? orderDetails;
CalculateDiscountPricesRequest({this.discountCode,this.fullPhoneNumber,this.eventId,this.orderDetails});
CalculateDiscountPricesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
discountCode = json['discountCode'];
fullPhoneNumber = json['fullPhoneNumber'];
eventId = json['eventId'];
orderDetails = JsonConverters.fromJson(json['orderDetails'],'List<TicketDetails>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'discountCode': discountCode,
'fullPhoneNumber': fullPhoneNumber,
'eventId': eventId,
'orderDetails': JsonConverters.toJson(orderDetails,'List<TicketDetails>',context!)
};
getTypeName() => "CalculateDiscountPricesRequest";
TypeContext? context = _ctx;
}
class CalculateDiscountPricesResult implements IConvertible
{
List<TicketDetails>? orderDetails;
int? statusCode;
String? message;
CalculateDiscountPricesResult({this.orderDetails,this.statusCode,this.message});
CalculateDiscountPricesResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
orderDetails = JsonConverters.fromJson(json['orderDetails'],'List<TicketDetails>',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'orderDetails': JsonConverters.toJson(orderDetails,'List<TicketDetails>',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "CalculateDiscountPricesResult";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'TicketDetails': TypeInfo(TypeOf.Class, create:() => TicketDetails()),
'CalculateDiscountPricesRequest': TypeInfo(TypeOf.Class, create:() => CalculateDiscountPricesRequest()),
'List<TicketDetails>': TypeInfo(TypeOf.Class, create:() => <TicketDetails>[]),
'CalculateDiscountPricesResult': TypeInfo(TypeOf.Class, create:() => CalculateDiscountPricesResult()),
});
Dart CalculateDiscountPricesRequest DTOs
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 /ticketOrder/CalculatePrices HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
discountCode: String,
fullPhoneNumber: String,
eventId: 0,
orderDetails:
[
{
id: 0,
ticketId: 0,
eventSeriesTicketType: 0,
eventSeriesOwnerTicketType: 0,
ticketPrice: 0,
totalPrice: 0,
count: 0,
ticketColor: String,
showUsedTickets: False,
ticketName: String,
ticketDisplayString: String,
ticketDetailsTransferredFrom: 0,
teamPassId: 0,
isSpecialTicket: False,
specialTicketId: String,
justChangedBySQL: False,
sqlJustChangedTimeStamp: 0001-01-01,
currency: String,
discountCode: String,
totalDiscount: 0,
totalAmountBeforeDiscount: 0,
ticketPriceBeforeDiscount: 0
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
orderDetails:
[
{
id: 0,
ticketId: 0,
eventSeriesTicketType: 0,
eventSeriesOwnerTicketType: 0,
ticketPrice: 0,
totalPrice: 0,
count: 0,
ticketColor: String,
showUsedTickets: False,
ticketName: String,
ticketDisplayString: String,
ticketDetailsTransferredFrom: 0,
teamPassId: 0,
isSpecialTicket: False,
specialTicketId: String,
justChangedBySQL: False,
sqlJustChangedTimeStamp: 0001-01-01,
currency: String,
discountCode: String,
totalDiscount: 0,
totalAmountBeforeDiscount: 0,
ticketPriceBeforeDiscount: 0
}
],
statusCode: 0,
message: String
}