Requires the role: | superadmin |
POST | /superadmin/incentives/action | Add a new incentive action |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Imports BokaMera.API.ServiceModel.Db.Incentive
Imports BokaMera.API.ServiceModel.Db
Namespace Global
Namespace BokaMera.API.ServiceModel.Db
Public Partial Class BaseModel
End Class
Public Partial Class Country
Inherits BaseModel
<References(GetType(Currency))>
Public Overridable Property CurrencyId As String
Public Overridable Property CurrencyInfo As Currency
<Required>
Public Overridable Property Name As String
Public Overridable Property Culture As String
Public Overridable Property TimeZone As String
Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
<Required>
Public Overridable Property Id As String
End Class
Public Partial Class Currency
Inherits BaseModel
<Required>
Public Overridable Property Name As String
<Required>
Public Overridable Property CurrencySign As String
<Required>
Public Overridable Property Active As Boolean
Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
<Required>
Public Overridable Property Id As String
End Class
Public Partial Class LicensePrice
Inherits BaseModel
<Ignore>
Public Overridable Property Country As Country
<Ignore>
Public Overridable Property MonthlyPayment As Boolean
<Required>
Public Overridable Property LicenseTypeId As Integer
<Required>
Public Overridable Property CountryId As String
<Required>
Public Overridable Property Price As Integer
Public Overridable Property ModifiedDate As Nullable(Of DateTimeOffset)
End Class
End Namespace
Namespace BokaMera.API.ServiceModel.Db.Incentive
Public Enum IncentiveActionType
Upgrade = 1
AddOn = 2
Information = 3
End Enum
End Namespace
Namespace BokaMera.API.ServiceModel.Dtos
<ValidateRequest(Validator:="IsAuthenticated")>
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
Public Partial Class CreateIncentiveAction
Public Overridable Property Id As Integer
Public Overridable Property ActionType As IncentiveActionType
Public Overridable Property Description As String
Public Overridable Property Page As String
Public Overridable Property Segment As String
Public Overridable Property Element As String
Public Overridable Property LicenseTypeId As Nullable(Of Integer)
End Class
Public Partial Class IncentiveActionResponse
Public Overridable Property Id As Integer
Public Overridable Property Description As String
Public Overridable Property ActionType As IncentiveActionType
Public Overridable Property Page As String
Public Overridable Property Segment As String
Public Overridable Property Element As String
Public Overridable Property LicenseTypeId As Nullable(Of Integer)
Public Overridable Property SuggestedLicenseToUpgrade As LicenseTypeQueryResponse
End Class
Public Partial Class LicenseItemsResponse
Public Overridable Property Id As Integer
Public Overridable Property Name As String
Public Overridable Property AllowedItems As Integer
End Class
Public Partial Class LicenseTypeQueryResponse
Public Sub New()
Items = New List(Of LicenseItemsResponse)
Prices = New List(Of LicensePrice)
End Sub
'''<Summary>
'''The license type id
'''</Summary>
<ApiMember(Description:="The license type id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The license type name
'''</Summary>
<ApiMember(Description:="The license type name")>
Public Overridable Property Name As String
'''<Summary>
'''The license type description
'''</Summary>
<ApiMember(Description:="The license type description")>
Public Overridable Property Description As String
'''<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.")>
Public Overridable Property IsExtraLicenseOption As Boolean
'''<Summary>
'''The period of notice for the license in days.
'''</Summary>
<ApiMember(Description:="The period of notice for the license in days.")>
Public Overridable Property PeriodOfNoticeDays As Integer
'''<Summary>
'''The license items for the license type
'''</Summary>
<ApiMember(Description:="The license items for the license type")>
Public Overridable Property Items As List(Of LicenseItemsResponse)
'''<Summary>
'''The license prices in each country for the license type
'''</Summary>
<ApiMember(Description:="The license prices in each country for the license type")>
Public Overridable Property Prices As List(Of LicensePrice)
End Class
End Namespace
End Namespace
VB.NET CreateIncentiveAction DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /superadmin/incentives/action HTTP/1.1
Host: api.bookmore.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Id":0,"ActionType":"Upgrade","Description":"String","Page":"String","Segment":"String","Element":"String","LicenseTypeId":0}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Id":0,"Description":"String","ActionType":"Upgrade","Page":"String","Segment":"String","Element":"String","LicenseTypeId":0,"SuggestedLicenseToUpgrade":{"Id":0,"Name":"String","Description":"String","IsExtraLicenseOption":false,"PeriodOfNoticeDays":0,"Items":[{"Id":0,"Name":"String","AllowedItems":0}],"Prices":[{"Country":{"CurrencyId":"String","CurrencyInfo":{"Name":"String","CurrencySign":"String","Active":false,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"Name":"String","Culture":"String","TimeZone":"String","ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"MonthlyPayment":true,"LicenseTypeId":0,"CountryId":"String","Price":0,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00"}]}}