BokaMera.API.Host

<back to all web services

PaymentLogQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/articles/paymentsQuery payment logsQuery payment logs
import 'package:servicestack/servicestack.dart';

// @DataContract
abstract class QueryBase
{
    /**
    * Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?skip=10&orderBy=Id</code>
    */
    // @DataMember(Order=1)
    int? Skip;

    /**
    * Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.<br/><br/><strong>Example:</strong><br/><code>?take=20</code>
    */
    // @DataMember(Order=2)
    int? Take;

    /**
    * Comma separated list of fields to order by. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderBy=Id,-Age,FirstName</code>
    */
    // @DataMember(Order=3)
    String? OrderBy;

    /**
    * Comma separated list of fields to order by in descending order. Prefix the field name with a minus if you wan't to invert the sort for that field.<br/><br/><strong>Example:</strong><br/><code>?orderByDesc=Id,-Age,FirstName</code>
    */
    // @DataMember(Order=4)
    String? OrderByDesc;

    /**
    * Include any of the aggregates <code>AVG, COUNT, FIRST, LAST, MAX, MIN, SUM</code> in your result set. The results will be returned in the meta field.<br/><br/><strong>Example:</strong><br/><code>?include=COUNT(*) as Total</code><br/><br/>or multiple fields with<br/><code>?include=Count(*) Total, Min(Age), AVG(Age) AverageAge</code><br/></br>or unique with<br/><code>?include=COUNT(DISTINCT LivingStatus) as UniqueStatus</code>
    */
    // @DataMember(Order=5)
    String? Include;

    // @DataMember(Order=6)
    String? Fields;

    // @DataMember(Order=7)
    Map<String,String?>? Meta;

    QueryBase({this.Skip,this.Take,this.OrderBy,this.OrderByDesc,this.Include,this.Fields,this.Meta});
    QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Skip = json['Skip'];
        Take = json['Take'];
        OrderBy = json['OrderBy'];
        OrderByDesc = json['OrderByDesc'];
        Include = json['Include'];
        Fields = json['Fields'];
        Meta = JsonConverters.toStringMap(json['Meta']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Skip': Skip,
        'Take': Take,
        'OrderBy': OrderBy,
        'OrderByDesc': OrderByDesc,
        'Include': Include,
        'Fields': Fields,
        'Meta': Meta
    };

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

abstract class QueryDb2<From,Into> extends QueryBase
{
    QueryDb2();
    QueryDb2.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "QueryDb<$From,$Into>";
    TypeContext? context = _ctx;
}

class BaseModel implements IConvertible
{
    BaseModel();
    BaseModel.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

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

class ArticleType extends BaseModel implements IConvertible
{
    int? ArticleTypeId;
    // @Required()
    String? ArticleTypeName;

    String? ArticleTypeDescription;

    ArticleType({this.ArticleTypeId,this.ArticleTypeName,this.ArticleTypeDescription});
    ArticleType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ArticleTypeId = json['ArticleTypeId'];
        ArticleTypeName = json['ArticleTypeName'];
        ArticleTypeDescription = json['ArticleTypeDescription'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ArticleTypeId': ArticleTypeId,
        'ArticleTypeName': ArticleTypeName,
        'ArticleTypeDescription': ArticleTypeDescription
    });

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

class CurrencyInfoResponse implements IConvertible
{
    /**
    * The currency id
    */
    // @ApiMember(Description="The currency id")
    String? Id;

    /**
    * The currency id
    */
    // @ApiMember(Description="The currency id")
    String? Name;

    /**
    * The currency id
    */
    // @ApiMember(Description="The currency id")
    String? CurrencySign;

    CurrencyInfoResponse({this.Id,this.Name,this.CurrencySign});
    CurrencyInfoResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        CurrencySign = json['CurrencySign'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'CurrencySign': CurrencySign
    };

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

class PaymentLogQueryResponse implements IConvertible
{
    /**
    * The payment log id
    */
    // @ApiMember(Description="The payment log id")
    int? Id;

    /**
    * The internal reference id, could be reference to a booking, rebate code, gift card etc.
    */
    // @ApiMember(Description="The internal reference id, could be reference to a booking, rebate code, gift card etc.")
    int? InternalReference;

    /**
    * The payment reference id
    */
    // @ApiMember(Description="The payment reference id")
    String? PaymentReferenceId;

    /**
    * The payment order item reference id
    */
    // @ApiMember(Description="The payment order item reference id")
    String? OrderItemReferenceId;

    /**
    * The payment reference id
    */
    // @ApiMember(Description="The payment reference id")
    int? PaymentProviderId;

    /**
    * The payment amount
    */
    // @ApiMember(Description="The payment amount")
    double? Amount;

    /**
    * The article type
    */
    // @ApiMember(Description="The article type")
    ArticleType? ArticleType;

    /**
    * The payment VAT in percent
    */
    // @ApiMember(Description="The payment VAT in percent")
    double? VAT;

    /**
    * The payment amount that is credited
    */
    // @ApiMember(Description="The payment amount that is credited")
    double? AmountCredited;

    /**
    * The payment currency id
    */
    // @ApiMember(Description="The payment currency id")
    String? CurrencyId;

    /**
    * The payment currency info
    */
    // @ApiMember(Description="The payment currency info")
    CurrencyInfoResponse? CurrencyInfo;

    /**
    * Comments that could be added to the event log item
    */
    // @ApiMember(Description="Comments that could be added to the event log item")
    String? Comments;

    /**
    * The date when the payment items was created
    */
    // @ApiMember(Description="The date when the payment items was created")
    DateTime? Created;

    /**
    * The date when the payment items were updated.
    */
    // @ApiMember(Description="The date when the payment items were updated.")
    DateTime? Updated;

    PaymentLogQueryResponse({this.Id,this.InternalReference,this.PaymentReferenceId,this.OrderItemReferenceId,this.PaymentProviderId,this.Amount,this.ArticleType,this.VAT,this.AmountCredited,this.CurrencyId,this.CurrencyInfo,this.Comments,this.Created,this.Updated});
    PaymentLogQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        InternalReference = json['InternalReference'];
        PaymentReferenceId = json['PaymentReferenceId'];
        OrderItemReferenceId = json['OrderItemReferenceId'];
        PaymentProviderId = json['PaymentProviderId'];
        Amount = JsonConverters.toDouble(json['Amount']);
        ArticleType = JsonConverters.fromJson(json['ArticleType'],'ArticleType',context!);
        VAT = JsonConverters.toDouble(json['VAT']);
        AmountCredited = JsonConverters.toDouble(json['AmountCredited']);
        CurrencyId = json['CurrencyId'];
        CurrencyInfo = JsonConverters.fromJson(json['CurrencyInfo'],'CurrencyInfoResponse',context!);
        Comments = json['Comments'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'InternalReference': InternalReference,
        'PaymentReferenceId': PaymentReferenceId,
        'OrderItemReferenceId': OrderItemReferenceId,
        'PaymentProviderId': PaymentProviderId,
        'Amount': Amount,
        'ArticleType': JsonConverters.toJson(ArticleType,'ArticleType',context!),
        'VAT': VAT,
        'AmountCredited': AmountCredited,
        'CurrencyId': CurrencyId,
        'CurrencyInfo': JsonConverters.toJson(CurrencyInfo,'CurrencyInfoResponse',context!),
        'Comments': Comments,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Updated': JsonConverters.toJson(Updated,'DateTime',context!)
    };

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

class Currency extends BaseModel implements IConvertible
{
    // @Required()
    String? Name;

    // @Required()
    String? CurrencySign;

    // @Required()
    bool? Active;

    DateTime? ModifiedDate;
    // @Required()
    String? Id;

    Currency({this.Name,this.CurrencySign,this.Active,this.ModifiedDate,this.Id});
    Currency.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Name = json['Name'];
        CurrencySign = json['CurrencySign'];
        Active = json['Active'];
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        Id = json['Id'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Name': Name,
        'CurrencySign': CurrencySign,
        'Active': Active,
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!),
        'Id': Id
    });

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

class PaymentLog extends BaseModel implements IConvertible
{
    // @References(typeof(Currency))
    String? CurrencyId;

    Currency? CurrencyInfo;
    // @Required()
    String? CompanyId;

    int? Id;
    // @Required()
    String? InternalReferenceId;

    // @Required()
    int? ArticleTypeId;

    String? PaymentReferenceId;
    int? PaymentProviderId;
    String? OrderItemReferenceId;
    double? Amount;
    double? VAT;
    double? AmountCredited;
    String? Comments;
    // @Required()
    DateTime? Created;

    // @Required()
    DateTime? Updated;

    DateTime? ModifiedDate;

    PaymentLog({this.CurrencyId,this.CurrencyInfo,this.CompanyId,this.Id,this.InternalReferenceId,this.ArticleTypeId,this.PaymentReferenceId,this.PaymentProviderId,this.OrderItemReferenceId,this.Amount,this.VAT,this.AmountCredited,this.Comments,this.Created,this.Updated,this.ModifiedDate});
    PaymentLog.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CurrencyId = json['CurrencyId'];
        CurrencyInfo = JsonConverters.fromJson(json['CurrencyInfo'],'Currency',context!);
        CompanyId = json['CompanyId'];
        Id = json['Id'];
        InternalReferenceId = json['InternalReferenceId'];
        ArticleTypeId = json['ArticleTypeId'];
        PaymentReferenceId = json['PaymentReferenceId'];
        PaymentProviderId = json['PaymentProviderId'];
        OrderItemReferenceId = json['OrderItemReferenceId'];
        Amount = JsonConverters.toDouble(json['Amount']);
        VAT = JsonConverters.toDouble(json['VAT']);
        AmountCredited = JsonConverters.toDouble(json['AmountCredited']);
        Comments = json['Comments'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
        ModifiedDate = JsonConverters.fromJson(json['ModifiedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CurrencyId': CurrencyId,
        'CurrencyInfo': JsonConverters.toJson(CurrencyInfo,'Currency',context!),
        'CompanyId': CompanyId,
        'Id': Id,
        'InternalReferenceId': InternalReferenceId,
        'ArticleTypeId': ArticleTypeId,
        'PaymentReferenceId': PaymentReferenceId,
        'PaymentProviderId': PaymentProviderId,
        'OrderItemReferenceId': OrderItemReferenceId,
        'Amount': Amount,
        'VAT': VAT,
        'AmountCredited': AmountCredited,
        'Comments': Comments,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Updated': JsonConverters.toJson(Updated,'DateTime',context!),
        'ModifiedDate': JsonConverters.toJson(ModifiedDate,'DateTime',context!)
    });

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

// @ValidateRequest(Validator="IsAuthenticated")
class PaymentLogQuery extends QueryDb2<PaymentLog,PaymentLogQueryResponse> implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * Start of interval to query for payments when they where created. UTC+0 and parameter as defined by date-time - RFC3339
    */
    // @ApiMember(DataType="dateTime", Description="Start of interval to query for payments when they where created. UTC+0 and parameter as defined by date-time - RFC3339", ParameterType="query")
    DateTime? CreatedFrom;

    /**
    * End of interval to query for payments when they where created. UTC+0 and parameter as defined by date-time - RFC3339
    */
    // @ApiMember(DataType="dateTime", Description="End of interval to query for payments when they where created. UTC+0 and parameter as defined by date-time - RFC3339", ParameterType="query")
    DateTime? CreatedTo;

    /**
    * Article type (Could be Service, rebate code types, etc..
    */
    // @ApiMember(Description="Article type (Could be Service, rebate code types, etc..", IsRequired=true)
    int? ArticleTypeId;

    /**
    * 
    */
    // @ApiMember(Description="")
    bool? IncludeArticleType;

    PaymentLogQuery({this.CompanyId,this.CreatedFrom,this.CreatedTo,this.ArticleTypeId,this.IncludeArticleType});
    PaymentLogQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        CompanyId = json['CompanyId'];
        CreatedFrom = JsonConverters.fromJson(json['CreatedFrom'],'DateTime',context!);
        CreatedTo = JsonConverters.fromJson(json['CreatedTo'],'DateTime',context!);
        ArticleTypeId = json['ArticleTypeId'];
        IncludeArticleType = json['IncludeArticleType'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'CompanyId': CompanyId,
        'CreatedFrom': JsonConverters.toJson(CreatedFrom,'DateTime',context!),
        'CreatedTo': JsonConverters.toJson(CreatedTo,'DateTime',context!),
        'ArticleTypeId': ArticleTypeId,
        'IncludeArticleType': IncludeArticleType
    });

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

class AccessKeyTypeResponse implements IConvertible
{
    int? Id;
    String? KeyType;
    String? Description;

    AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
    AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        KeyType = json['KeyType'];
        Description = json['Description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'KeyType': KeyType,
        'Description': Description
    };

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

// @DataContract
class QueryResponse<T> implements IConvertible
{
    // @DataMember(Order=1)
    int? Offset;

    // @DataMember(Order=2)
    int? Total;

    // @DataMember(Order=3)
    List<AccessKeyTypeResponse>? Results;

    // @DataMember(Order=4)
    Map<String,String?>? Meta;

    // @DataMember(Order=5)
    ResponseStatus? ResponseStatus;

    QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
    QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Offset = json['Offset'];
        Total = json['Total'];
        Results = JsonConverters.fromJson(json['Results'],'List<AccessKeyTypeResponse>',context!);
        Meta = JsonConverters.toStringMap(json['Meta']);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Offset': Offset,
        'Total': Total,
        'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
        'Meta': Meta,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "QueryResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'BaseModel': TypeInfo(TypeOf.Class, create:() => BaseModel()),
    'ArticleType': TypeInfo(TypeOf.Class, create:() => ArticleType()),
    'CurrencyInfoResponse': TypeInfo(TypeOf.Class, create:() => CurrencyInfoResponse()),
    'PaymentLogQueryResponse': TypeInfo(TypeOf.Class, create:() => PaymentLogQueryResponse()),
    'Currency': TypeInfo(TypeOf.Class, create:() => Currency()),
    'PaymentLog': TypeInfo(TypeOf.Class, create:() => PaymentLog()),
    'PaymentLogQuery': TypeInfo(TypeOf.Class, create:() => PaymentLogQuery()),
    'List<PaymentLogQueryResponse>': TypeInfo(TypeOf.Class, create:() => <PaymentLogQueryResponse>[]),
    'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
    'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});

Dart PaymentLogQuery 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.

GET /articles/payments HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<QueryResponseOfPaymentLogQueryResponseWg5EthtI xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Offset>0</Offset>
  <Total>0</Total>
  <Results xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
    <d2p1:PaymentLogQueryResponse>
      <d2p1:Amount>0</d2p1:Amount>
      <d2p1:AmountCredited>0</d2p1:AmountCredited>
      <d2p1:ArticleType xmlns:d4p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
        <d4p1:ArticleTypeDescription>String</d4p1:ArticleTypeDescription>
        <d4p1:ArticleTypeId>0</d4p1:ArticleTypeId>
        <d4p1:ArticleTypeName>String</d4p1:ArticleTypeName>
      </d2p1:ArticleType>
      <d2p1:Comments>String</d2p1:Comments>
      <d2p1:Created>0001-01-01T00:00:00</d2p1:Created>
      <d2p1:CurrencyId>String</d2p1:CurrencyId>
      <d2p1:CurrencyInfo>
        <d2p1:CurrencySign>String</d2p1:CurrencySign>
        <d2p1:Id>String</d2p1:Id>
        <d2p1:Name>String</d2p1:Name>
      </d2p1:CurrencyInfo>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:InternalReference>0</d2p1:InternalReference>
      <d2p1:OrderItemReferenceId>String</d2p1:OrderItemReferenceId>
      <d2p1:PaymentProviderId>0</d2p1:PaymentProviderId>
      <d2p1:PaymentReferenceId>String</d2p1:PaymentReferenceId>
      <d2p1:Updated>0001-01-01T00:00:00</d2p1:Updated>
      <d2p1:VAT>0</d2p1:VAT>
    </d2p1:PaymentLogQueryResponse>
  </Results>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <ResponseStatus>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StackTrace>String</StackTrace>
    <Errors>
      <ResponseError>
        <ErrorCode>String</ErrorCode>
        <FieldName>String</FieldName>
        <Message>String</Message>
        <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>
        </Meta>
      </ResponseError>
    </Errors>
    <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>
    </Meta>
  </ResponseStatus>
</QueryResponseOfPaymentLogQueryResponseWg5EthtI>