Starnet.MontenegroTaxationAuthority.WebApi

<back to all web services

ReportBetPayouts

The following routes are available for this service:
POST/bets/payout
import 'package:servicestack/servicestack.dart';

class BetSource
{
    static const BetSource Landbase = const BetSource._(0);
    static const BetSource Web = const BetSource._(1);

    final int _value;
    const BetSource._(this._value);
    int get value => _value;
    static List<BetSource> get values => const [Landbase,Web];
}

class TransactionDtoBase implements IConvertible
{
    String? transaction_id;
    DateTime? transaction_time;
    double? transaction_amount;
    String? game_name;
    String? betting_place_id;
    String? betting_terminal_id;
    String? jmbg;
    String? passport_number;
    BetSource? source;
    String? identification_document_country;
    String? identification_document_type;

    TransactionDtoBase({this.transaction_id,this.transaction_time,this.transaction_amount,this.game_name,this.betting_place_id,this.betting_terminal_id,this.jmbg,this.passport_number,this.source,this.identification_document_country,this.identification_document_type});
    TransactionDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        transaction_id = json['transaction_id'];
        transaction_time = JsonConverters.fromJson(json['transaction_time'],'DateTime',context!);
        transaction_amount = JsonConverters.toDouble(json['transaction_amount']);
        game_name = json['game_name'];
        betting_place_id = json['betting_place_id'];
        betting_terminal_id = json['betting_terminal_id'];
        jmbg = json['jmbg'];
        passport_number = json['passport_number'];
        source = JsonConverters.fromJson(json['source'],'BetSource',context!);
        identification_document_country = json['identification_document_country'];
        identification_document_type = json['identification_document_type'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'transaction_id': transaction_id,
        'transaction_time': JsonConverters.toJson(transaction_time,'DateTime',context!),
        'transaction_amount': transaction_amount,
        'game_name': game_name,
        'betting_place_id': betting_place_id,
        'betting_terminal_id': betting_terminal_id,
        'jmbg': jmbg,
        'passport_number': passport_number,
        'source': JsonConverters.toJson(source,'BetSource',context!),
        'identification_document_country': identification_document_country,
        'identification_document_type': identification_document_type
    };

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

class WinType
{
    static const WinType Regular = const WinType._(0);
    static const WinType Cashback = const WinType._(1);
    static const WinType Cashout = const WinType._(2);

    final int _value;
    const WinType._(this._value);
    int get value => _value;
    static List<WinType> get values => const [Regular,Cashback,Cashout];
}

abstract class IBetEvent
{
}

class WinDto extends TransactionDtoBase implements IConvertible
{
    String? bet_transaction_id;
    String? ticket_id;
    double? win_odds;
    WinType? win_type;
    double? bonus;
    bool? cancel;
    RecordList<IBetEvent>? canceled_events;

    WinDto({this.bet_transaction_id,this.ticket_id,this.win_odds,this.win_type,this.bonus,this.cancel,this.canceled_events});
    WinDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        bet_transaction_id = json['bet_transaction_id'];
        ticket_id = json['ticket_id'];
        win_odds = JsonConverters.toDouble(json['win_odds']);
        win_type = JsonConverters.fromJson(json['win_type'],'WinType',context!);
        bonus = JsonConverters.toDouble(json['bonus']);
        cancel = json['cancel'];
        canceled_events = JsonConverters.fromJson(json['canceled_events'],'RecordList<IBetEvent>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'bet_transaction_id': bet_transaction_id,
        'ticket_id': ticket_id,
        'win_odds': win_odds,
        'win_type': JsonConverters.toJson(win_type,'WinType',context!),
        'bonus': bonus,
        'cancel': cancel,
        'canceled_events': JsonConverters.toJson(canceled_events,'RecordList<IBetEvent>',context!)
    });

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

class ReportBetPayouts implements IConvertible
{
    RecordList<WinDto>? betPayouts;

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

    fromMap(Map<String, dynamic> json) {
        betPayouts = JsonConverters.fromJson(json['betPayouts'],'RecordList<WinDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'betPayouts': JsonConverters.toJson(betPayouts,'RecordList<WinDto>',context!)
    };

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

class RecordList<T> extends ListBase<T> implements IConvertible
{
    final List<T> l = [];
    set length(int newLength) { l.length = newLength; }
    int get length => l.length;
    T operator [](int index) => l[index];
    void operator []=(int index, T value) { l[index] = value; }
    RecordList();
    RecordList.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "RecordList<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.prod_mnta.webhop.biz', types: <String, TypeInfo> {
    'BetSource': TypeInfo(TypeOf.Enum, enumValues:BetSource.values),
    'TransactionDtoBase': TypeInfo(TypeOf.Class, create:() => TransactionDtoBase()),
    'WinType': TypeInfo(TypeOf.Enum, enumValues:WinType.values),
    'IBetEvent': TypeInfo(TypeOf.Interface),
    'WinDto': TypeInfo(TypeOf.Class, create:() => WinDto()),
    'RecordList<IBetEvent>': TypeInfo(TypeOf.Class, create:() => RecordList<IBetEvent>()),
    'ReportBetPayouts': TypeInfo(TypeOf.Class, create:() => ReportBetPayouts()),
    'RecordList<WinDto>': TypeInfo(TypeOf.Class, create:() => RecordList<WinDto>()),
    'RecordList<T>': TypeInfo(TypeOf.GenericDef,create:() => RecordList()),
});

Dart ReportBetPayouts DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /bets/payout HTTP/1.1 
Host: api.prod-mnta.webhop.biz 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"betPayouts":[{"bet_transaction_id":"String","ticket_id":"String","win_odds":0,"win_type":0,"bonus":0,"cancel":false,"canceled_events":[{}],"transaction_id":"String","transaction_time":"0001-01-01T00:00:00.0000000Z","transaction_amount":0,"game_name":"String","betting_place_id":"String","betting_terminal_id":"String","jmbg":"String","passport_number":"String","source":0,"identification_document_country":"String","identification_document_type":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}