BokaMera.API.Host

<back to all web services

PreviewSummarizedInvoice

Requires Authentication
The following routes are available for this service:
GET/eaccounting/summarizedinvoice/previewPreview eligible bookings for summarized invoicingReturns the customers and booking counts that would be included in a summarized invoice run, without actually creating anything.
import 'package:servicestack/servicestack.dart';

class PreviewCustomerGroup implements IConvertible
{
    String CustomerId = "";
    String CustomerName = "";
    String? Email;
    int BookingCount = 0;
    List<int> BookingIds = [];
    bool MissingInvoiceAddress;
    bool MissingEmail;

    PreviewCustomerGroup({this.CustomerId,this.CustomerName,this.Email,this.BookingCount,this.BookingIds,this.MissingInvoiceAddress,this.MissingEmail});
    PreviewCustomerGroup.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CustomerId = json['CustomerId'];
        CustomerName = json['CustomerName'];
        Email = json['Email'];
        BookingCount = json['BookingCount'];
        BookingIds = JsonConverters.fromJson(json['BookingIds'],'List<int>',context!);
        MissingInvoiceAddress = json['MissingInvoiceAddress'];
        MissingEmail = json['MissingEmail'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CustomerId': CustomerId,
        'CustomerName': CustomerName,
        'Email': Email,
        'BookingCount': BookingCount,
        'BookingIds': JsonConverters.toJson(BookingIds,'List<int>',context!),
        'MissingInvoiceAddress': MissingInvoiceAddress,
        'MissingEmail': MissingEmail
    };

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

class PreviewSummarizedInvoiceResponse implements IConvertible
{
    int TotalCustomers = 0;
    int TotalBookings = 0;
    List<PreviewCustomerGroup> Customers = [];
    ResponseStatus ResponseStatus;

    PreviewSummarizedInvoiceResponse({this.TotalCustomers,this.TotalBookings,this.Customers,this.ResponseStatus});
    PreviewSummarizedInvoiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        TotalCustomers = json['TotalCustomers'];
        TotalBookings = json['TotalBookings'];
        Customers = JsonConverters.fromJson(json['Customers'],'List<PreviewCustomerGroup>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'TotalCustomers': TotalCustomers,
        'TotalBookings': TotalBookings,
        'Customers': JsonConverters.toJson(Customers,'List<PreviewCustomerGroup>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

enum EAccountingInvoiceSendTypes
{
    None,
    AutoInvoiceElectronic,
    AutoInvoicePrint,
    AutoInvoiceB2C,
}

// @ValidateRequest(Validator="IsAuthenticated")
class PreviewSummarizedInvoice 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 date for the booking range to include.
    */
    // @ApiMember(Description="Start date for the booking range to include.", IsRequired=true)
    DateTime DateFrom = DateTime(0);

    /**
    * End date for the booking range to include.
    */
    // @ApiMember(Description="End date for the booking range to include.", IsRequired=true)
    DateTime DateTo = DateTime(0);

    /**
    * Optional customer id filter.
    */
    // @ApiMember(Description="Optional customer id filter.")
    String? CustomerId;

    /**
    * Optional service/event id filter.
    */
    // @ApiMember(Description="Optional service/event id filter.")
    int? ServiceId;

    /**
    * Optional list of booking status ids to include. If empty, all statuses are included.
    */
    // @ApiMember(Description="Optional list of booking status ids to include. If empty, all statuses are included.")
    List<int>? BookingStatusIds;

    /**
    * Send type for invoices. 0 = None, 1 = AutoInvoiceElectronic, 2 = AutoInvoicePrint, 3 = AutoInvoiceB2C. Used to validate customer addresses for postal delivery.
    */
    // @ApiMember(Description="Send type for invoices. 0 = None, 1 = AutoInvoiceElectronic, 2 = AutoInvoicePrint, 3 = AutoInvoiceB2C. Used to validate customer addresses for postal delivery.")
    EAccountingInvoiceSendTypes? SendType;

    PreviewSummarizedInvoice({this.CompanyId,this.DateFrom,this.DateTo,this.CustomerId,this.ServiceId,this.BookingStatusIds,this.SendType});
    PreviewSummarizedInvoice.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
        DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
        CustomerId = json['CustomerId'];
        ServiceId = json['ServiceId'];
        BookingStatusIds = JsonConverters.fromJson(json['BookingStatusIds'],'List<int>',context!);
        SendType = JsonConverters.fromJson(json['SendType'],'EAccountingInvoiceSendTypes',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
        'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!),
        'CustomerId': CustomerId,
        'ServiceId': ServiceId,
        'BookingStatusIds': JsonConverters.toJson(BookingStatusIds,'List<int>',context!),
        'SendType': JsonConverters.toJson(SendType,'EAccountingInvoiceSendTypes',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'PreviewCustomerGroup': TypeInfo(TypeOf.Class, create:() => PreviewCustomerGroup()),
    'PreviewSummarizedInvoiceResponse': TypeInfo(TypeOf.Class, create:() => PreviewSummarizedInvoiceResponse()),
    'List<PreviewCustomerGroup>': TypeInfo(TypeOf.Class, create:() => <PreviewCustomerGroup>[]),
    'EAccountingInvoiceSendTypes': TypeInfo(TypeOf.Enum, enumValues:EAccountingInvoiceSendTypes.values),
    'PreviewSummarizedInvoice': TypeInfo(TypeOf.Class, create:() => PreviewSummarizedInvoice()),
});

Dart PreviewSummarizedInvoice 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 /eaccounting/summarizedinvoice/preview HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PreviewSummarizedInvoiceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Customers>
    <PreviewCustomerGroup>
      <BookingCount>0</BookingCount>
      <BookingIds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </BookingIds>
      <CustomerId>00000000-0000-0000-0000-000000000000</CustomerId>
      <CustomerName>String</CustomerName>
      <Email>String</Email>
      <MissingEmail>false</MissingEmail>
      <MissingInvoiceAddress>false</MissingInvoiceAddress>
    </PreviewCustomerGroup>
  </Customers>
  <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>
  <TotalBookings>0</TotalBookings>
  <TotalCustomers>0</TotalCustomers>
</PreviewSummarizedInvoiceResponse>