BokaMera.API.Host

<back to all web services

CompanyIncentiveQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/companies/{CompanyId}/incentivesIt gets either incentives which are not read or engaged by the current company/administrator.
namespace BokaMera.API.ServiceModel.Db

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    type IncentiveActionType =
        | Upgrade = 1
        | AddOn = 2
        | Information = 3

    [<AllowNullLiteral>]
    type LicenseItemsResponse() = 
        member val Id:Int32 = new Int32() with get,set
        member val Name:String = null with get,set
        member val AllowedItems:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type BaseModel() = 
        class end

    [<AllowNullLiteral>]
    type Currency() = 
        inherit BaseModel()
        [<Required>]
        member val Name:String = null with get,set

        [<Required>]
        member val CurrencySign:String = null with get,set

        [<Required>]
        member val Active:Boolean = new Boolean() with get,set

        member val ModifiedDate:Nullable<DateTimeOffset> = new Nullable<DateTimeOffset>() with get,set
        [<Required>]
        member val Id:String = null with get,set

    [<AllowNullLiteral>]
    type Country() = 
        inherit BaseModel()
        [<References(typeof<Currency>)>]
        member val CurrencyId:String = null with get,set

        member val CurrencyInfo:Currency = null with get,set
        [<Required>]
        member val Name:String = null with get,set

        member val Culture:String = null with get,set
        member val TimeZone:String = null with get,set
        member val ModifiedDate:Nullable<DateTimeOffset> = new Nullable<DateTimeOffset>() with get,set
        [<Required>]
        member val Id:String = null with get,set

    [<AllowNullLiteral>]
    type LicensePrice() = 
        inherit BaseModel()
        [<Ignore>]
        member val Country:Country = null with get,set

        [<Ignore>]
        member val MonthlyPayment:Boolean = new Boolean() with get,set

        [<Required>]
        member val LicenseTypeId:Int32 = new Int32() with get,set

        [<Required>]
        member val CountryId:String = null with get,set

        [<Required>]
        member val Price:Int32 = new Int32() with get,set

        member val ModifiedDate:Nullable<DateTimeOffset> = new Nullable<DateTimeOffset>() with get,set

    [<AllowNullLiteral>]
    type LicenseTypeQueryResponse() = 
        ///<summary>
        ///The license type id
        ///</summary>
        [<ApiMember(Description="The license type id")>]
        member val Id:Int32 = new Int32() with get,set

        ///<summary>
        ///The license type name
        ///</summary>
        [<ApiMember(Description="The license type name")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The license type description
        ///</summary>
        [<ApiMember(Description="The license type description")>]
        member val Description:String = null with get,set

        ///<summary>
        ///If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.
        ///</summary>
        [<ApiMember(Description="If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.")>]
        member val IsExtraLicenseOption:Boolean = new Boolean() with get,set

        ///<summary>
        ///The period of notice for the license in days.
        ///</summary>
        [<ApiMember(Description="The period of notice for the license in days.")>]
        member val PeriodOfNoticeDays:Int32 = new Int32() with get,set

        ///<summary>
        ///The license items for the license type
        ///</summary>
        [<ApiMember(Description="The license items for the license type")>]
        member val Items:ResizeArray<LicenseItemsResponse> = new ResizeArray<LicenseItemsResponse>() with get,set

        ///<summary>
        ///The license prices in each country for the license type
        ///</summary>
        [<ApiMember(Description="The license prices in each country for the license type")>]
        member val Prices:ResizeArray<LicensePrice> = new ResizeArray<LicensePrice>() with get,set

    [<AllowNullLiteral>]
    type IncentiveActionResponse() = 
        member val Id:Int32 = new Int32() with get,set
        member val Description:String = null with get,set
        member val ActionType:IncentiveActionType = new IncentiveActionType() with get,set
        member val Page:String = null with get,set
        member val Segment:String = null with get,set
        member val Element:String = null with get,set
        member val LicenseTypeId:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val SuggestedLicenseToUpgrade:LicenseTypeQueryResponse = null with get,set

    type IncentiveRecurrenceFrequency =
        | OneTime = 1
        | Weekly = 2
        | Monthly = 3

    type CriteriaType =
        | LicenseAvailability = 0
        | SmsActivation = 1
        | eAccountingActivation = 2
        | CodeLockActivation = 3
        | SocialActivation = 4
        | OnlinePaymentActivation = 5
        | FollowUpMessageActivation = 6
        | RatingActivation = 7

    [<AllowNullLiteral>]
    type IncentiveCriteriaDto() = 
        member val CriteriaType:CriteriaType = new CriteriaType() with get,set
        member val Value:String = null with get,set
        member val InvertCondition:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type CompanyIncentiveResponse() = 
        member val Id:Int32 = new Int32() with get,set
        member val Heading:String = null with get,set
        member val StorageUrl:String = null with get,set
        member val SuccessButtonText:String = null with get,set
        member val ActionId:Int32 = new Int32() with get,set
        member val InitialDelayInSeconds:Int32 = new Int32() with get,set
        member val MaxDisplayCount:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val ValidFrom:DateTimeOffset = new DateTimeOffset() with get,set
        member val ValidTo:DateTimeOffset = new DateTimeOffset() with get,set
        member val Action:IncentiveActionResponse = null with get,set
        member val Payload:String = null with get,set
        [<ApiMember>]
        member val Body:String = null with get,set

        [<ApiMember(IsRequired=true)>]
        member val Frequency:IncentiveRecurrenceFrequency = new IncentiveRecurrenceFrequency() with get,set

        [<ApiMember(IsRequired=true)>]
        member val InitialDeferredDays:Int32 = new Int32() with get,set

        [<ApiMember>]
        member val RecurrenceInterval:UInt32 = new UInt32() with get,set

        [<ApiMember>]
        member val Active:Boolean = new Boolean() with get,set

        member val CompanyIds:ResizeArray<Guid> = new ResizeArray<Guid>() with get,set
        member val Criteria:ResizeArray<IncentiveCriteriaDto> = new ResizeArray<IncentiveCriteriaDto>() with get,set

    [<AllowNullLiteral>]
    type CompanyIncentivesQueryResponse() = 
        member val Incentives:IList<CompanyIncentiveResponse> = null with get,set
        member val CompanyId:Guid = new Guid() with get,set

    [<ValidateRequest(Validator="IsAuthenticated")>]
    [<ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)>]
    [<AllowNullLiteral>]
    type CompanyIncentiveQuery() = 
        ///<summary>
        ///The company id, if empty will use the company id for the user you are logged in with.
        ///</summary>
        [<ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", IsRequired=true, ParameterType="path")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

F# CompanyIncentiveQuery DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /companies/{CompanyId}/incentives HTTP/1.1 
Host: api.bookmore.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}