/* Options: Date: 2024-07-03 14:14:23 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bokamera.se //Package: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: ResourceQuery.* //ExcludeTypes: //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: java.math.*,java.util.*,net.servicestack.client.*,com.google.gson.annotations.*,com.google.gson.reflect.* */ import java.math.* import java.util.* import net.servicestack.client.* import com.google.gson.annotations.* import com.google.gson.reflect.* @Route(Path="/resource", Verbs="GET") @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403) @ValidateRequest(Validator="IsAuthenticated") open class ResourceQuery : QueryDb(), IReturn> { /** * Enter the company and id you want to see the information for a resource, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown */ @ApiMember(Description="Enter the company and id you want to see the information for a resource, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", IsRequired=true, ParameterType="query") var CompanyId:UUID? = null var Id:Int? = null var Active:Boolean? = null /** * If you want to include the exceptions for each resource, only allowed for administrators. Select between what dates in the parameters [ExceptionsQueryFromDate] and [ExceptionsQueryToDate] , if no dates added */ @ApiMember(DataType="boolean", Description="If you want to include the exceptions for each resource, only allowed for administrators. Select between what dates in the parameters [ExceptionsQueryFromDate] and [ExceptionsQueryToDate] , if no dates added ", ParameterType="query") var IncludeExceptions:Boolean? = null /** * If [IncludeExceptions], choose what from and to date to search exceptions between, if nothing entered i will search from todays date. */ @ApiMember(DataType="dateTime", Description="If [IncludeExceptions], choose what from and to date to search exceptions between, if nothing entered i will search from todays date.", ParameterType="query") var ExceptionsQueryFromDate:Date? = null /** * If [IncludeExceptions], choose what from and to date to search exceptions between, if nothing entered i will search to 1 year forward from todays date. */ @ApiMember(DataType="dateTime", Description="If [IncludeExceptions], choose what from and to date to search exceptions between, if nothing entered i will search to 1 year forward from todays date.", ParameterType="query") var ExceptionsQueryToDate:Date? = null /** * If you want to include the bookings for each resource, only allowed for administrators. Select between what dates in the parameters [BookingsQueryFromDate] and [BookingsQueryToDate] , if nothing entered i will search to 1 year forward from todays date. */ @ApiMember(DataType="boolean", Description="If you want to include the bookings for each resource, only allowed for administrators. Select between what dates in the parameters [BookingsQueryFromDate] and [BookingsQueryToDate] , if nothing entered i will search to 1 year forward from todays date.", ParameterType="query") var IncludeBookings:Boolean? = null /** * If [IncludeBookings], choose what from and to date to search bookings between, if nothing entered i will search from todays date. */ @ApiMember(DataType="dateTime", Description="If [IncludeBookings], choose what from and to date to search bookings between, if nothing entered i will search from todays date.", ParameterType="query") var BookingsQueryFromDate:Date? = null /** * If [IncludeBookings], choose what from and to date to search bookings between, if nothing entered i will search to 1 year forward from todays date. */ @ApiMember(DataType="dateTime", Description="If [IncludeBookings], choose what from and to date to search bookings between, if nothing entered i will search to 1 year forward from todays date.", ParameterType="query") var BookingsQueryToDate:Date? = null companion object { private val responseType = object : TypeToken>(){}.type } override fun getResponseType(): Any? = ResourceQuery.responseType } @DataContract open class QueryResponse { @DataMember(Order=1) var Offset:Int? = null @DataMember(Order=2) var Total:Int? = null @DataMember(Order=3) var Results:ArrayList = ArrayList() @DataMember(Order=4) var Meta:HashMap = HashMap() @DataMember(Order=5) var ResponseStatus:ResponseStatus? = null } open class QueryDb : QueryBase() { } enum class BookingStatusEnum(val value:Int) { Booked(1), Unbooked(2), Reserved(3), Canceled(4), AwaitingPayment(5), AwaitingPaymentNoTimeLimit(6), Payed(7), AwaitingPaymentRequestFromAdmin(8), AwaitingPaymentFromProvider(9), Invoiced(10), } open interface IInterval { var From:Date? var To:Date? } open class CustomFieldConfig : BaseModel() { @Ignore() var Values:ArrayList = ArrayList() var CustomField:CustomField? = null @Ignore() var RegEx:RegEx? = null @Ignore() var Services:ArrayList = ArrayList() var CustomFieldServiceRelation:ArrayList = ArrayList() @Required() var CompanyId:UUID? = null var Id:Int? = null var GroupId:Int? = null @Required() var FieldId:Int? = null @Required() var IconId:Int? = null var RegExId:Int? = null @Required() var Name:String? = null @Required() var Description:String? = null @Required() var Datatype:String? = null @Required() var MaxLength:Int? = null @Required() var IsPublic:Boolean? = null @Required() var IsHidden:Boolean? = null @Required() var IsMandatory:Boolean? = null var DefaultValue:String? = null var RegExErrorMessage:String? = null var MandatoryErrorMessage:String? = null var Width:Int? = null @Required() var MultipleLineText:Boolean? = null var ModifiedDate:Date? = null } open class Resource : BaseModel(), ICustomFieldTable, IBaseModelCreated, IBaseModelUpdated { @Ignore() var Priority:Int? = null @Ignore() var Schedules:IList? = null @Ignore() var Exceptions:IList? = null @Ignore() var Bookings:IList? = null @Ignore() var CustomFieldsConfig:IList? = null @Ignore() var CustomFieldsData:IList? = null @Required() var CompanyId:UUID? = null var Id:Int? = null @Required() var Name:String? = null @Required() var Active:Boolean? = null var Description:String? = null var ImageUrl:String? = null @Required() var UpdatedDate:Date? = null @Required() var CreatedDate:Date? = null @Required() var Color:String? = null var Email:String? = null var MobilePhone:String? = null var EmailNotification:Boolean? = null var SMSNotification:Boolean? = null @Required() var SendSMSReminder:Boolean? = null @Required() var SendEmailReminder:Boolean? = null var ModifiedDate:Date? = null var AccessGroup:String? = null var TextField1:String? = null var TextField2:String? = null var TextField3:String? = null var TextField4:String? = null var TextField5:String? = null var TextField6:String? = null var TextField7:String? = null var TextField8:String? = null var TextField9:String? = null var TextField10:String? = null var TextField11:String? = null var TextField12:String? = null var TextField13:String? = null var TextField14:String? = null var TextField15:String? = null var TextField16:String? = null var TextField17:String? = null var TextField18:String? = null var TextField19:String? = null var TextField20:String? = null } open class CustomFieldDataResponse { var Id:Int? = null var Column:String? = null var Name:String? = null var Description:String? = null var Value:String? = null /** * Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */ @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'") var DataType:String? = null } open class BookedCustomer { var Id:UUID? = null var Firstname:String? = null var Lastname:String? = null var Email:String? = null var Phone:String? = null var FacebookUserName:String? = null var ImageUrl:String? = null var CorporateIdentityNumber:String? = null var InvoiceAddress1:String? = null var InvoiceAddress2:String? = null var InvoiceCity:String? = null var InvoicePostalCode:String? = null var InvoiceCountryCode:String? = null } open class TimeException : ITimeException { /** * Time exception id */ @ApiMember(Description="Time exception id") var Id:Int? = null /** * Indicates whether or not the time exception is recurring */ @ApiMember(Description="Indicates whether or not the time exception is recurring") var IsRecurring:Boolean? = null /** * Indicates whether the time exception is blocking the time or not */ @ApiMember(Description="Indicates whether the time exception is blocking the time or not") var IsBlock:Boolean? = null /** * The reason of the time exception, example: Vacation, doctors appointment, ... */ @ApiMember(Description="The reason of the time exception, example: Vacation, doctors appointment, ...") var ReasonText:String? = null /** * The public reason of the time exception, example: Vacation, doctors appointment, ... */ @ApiMember(Description="The public reason of the time exception, example: Vacation, doctors appointment, ...") var ReasonTextPublic:String? = null /** * Time exception start */ @ApiMember(Description="Time exception start") var From:Date? = null /** * Time exception end */ @ApiMember(Description="Time exception end") var To:Date? = null /** * Resources that owns this exception */ @ApiMember(Description="Resources that owns this exception") var ResourceIds:ArrayList? = null } open class BookedTime : IBookedTime { /** * Booking id */ @ApiMember(Description="Booking id") var Id:Int? = null /** * The booked service */ @ApiMember(Description="The booked service") var ServiceId:Int? = null /** * Booking start */ @ApiMember(Description="Booking start") var From:Date? = null /** * Booking end */ @ApiMember(Description="Booking end") var To:Date? = null /** * Number of booked spots */ @ApiMember(Description="Number of booked spots") var BookedSpots:Int? = null /** * Number of total spots for the service */ @ApiMember(Description="Number of total spots for the service") var TotalSpots:Int? = null /** * The pause after the booking */ @ApiMember(Description="The pause after the booking") var PauseAfterInMinutes:Int? = null /** * The booking status */ @ApiMember(Description="The booking status") var StatusId:Int? = null var Status:BookingStatusEnum? = null /** * The customer the booking belongs to */ @ApiMember(Description="The customer the booking belongs to") var Customer:BookedCustomer? = null } enum class ScheduleType { NotDefined, RecurringSchedule, DateSchedule, } @DataContract open class QueryBase { /** * Skip over a given number of elements in a sequence and then return the remainder. Use this when you need paging.

Example:
?skip=10&orderBy=Id */ @DataMember(Order=1) var Skip:Int? = null /** * Return a given number of elements in a sequence and then skip over the remainder. Use this when you need paging.

Example:
?take=20 */ @DataMember(Order=2) var Take:Int? = null /** * 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.

Example:
?orderBy=Id,-Age,FirstName */ @DataMember(Order=3) var OrderBy:String? = null /** * 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.

Example:
?orderByDesc=Id,-Age,FirstName */ @DataMember(Order=4) var OrderByDesc:String? = null /** * Include any of the aggregates AVG, COUNT, FIRST, LAST, MAX, MIN, SUM in your result set. The results will be returned in the meta field.

Example:
?include=COUNT(*) as Total

or multiple fields with
?include=Count(*) Total, Min(Age), AVG(Age) AverageAge

or unique with
?include=COUNT(DISTINCT LivingStatus) as UniqueStatus */ @DataMember(Order=5) var Include:String? = null @DataMember(Order=6) var Fields:String? = null @DataMember(Order=7) var Meta:HashMap = HashMap() } open class BaseModel { } open interface ICustomFieldTable { var CustomFieldsConfig:IList? var CustomFieldsData:IList? var TextField1:String? var TextField2:String? var TextField3:String? var TextField4:String? var TextField5:String? var TextField6:String? var TextField7:String? var TextField8:String? var TextField9:String? var TextField10:String? var TextField11:String? var TextField12:String? var TextField13:String? var TextField14:String? var TextField15:String? var TextField16:String? var TextField17:String? var TextField18:String? var TextField19:String? var TextField20:String? } open interface IBaseModelUpdated { var UpdatedDate:Date? } open interface IBaseModelCreated { var CreatedDate:Date? } open class CustomFieldValue : BaseModel() { @Required() var CompanyId:UUID? = null var Id:Int? = null @Required() var Value:String? = null @Required() var Active:Boolean? = null var SortOrder:Short? = null var ModifiedDate:Date? = null } open class CustomField : BaseModel() { @Required() var Table:String? = null @Required() var Column:String? = null @Required() var DataType:String? = null @Required() var Description:String? = null @Required() var Active:Boolean? = null var ModifiedDate:Date? = null var Id:Int? = null } open class RegEx : BaseModel() { @Required() var Name:String? = null @Required() var Description:String? = null @Required() var RegExCode:String? = null var ErrorMessage:String? = null var ModifiedDate:Date? = null var Id:Int? = null } open class CustomFieldServiceRelation : BaseModel() { @Required() var CompanyId:UUID? = null var Id:Int? = null @Required() var CustomFieldConfigId:Int? = null @Required() var ServiceId:Int? = null var ModifiedDate:Date? = null } open interface ISchedule { var Resources:IList? var Type:ScheduleType? var Active:Boolean? var IsResourceSpecific:Boolean? } open interface ITimeException : IInterval { var Id:Int? var ReasonText:String? var IsBlock:Boolean? var ReasonTextPublic:String? var IsRecurring:Boolean? var ResourceIds:ArrayList? } open interface IBookedTime : IInterval { var Id:Int? var ServiceId:Int? var BookedSpots:Int? var TotalSpots:Int? var PauseAfterInMinutes:Int? var Status:BookingStatusEnum? var StatusId:Int? var Customer:BookedCustomer? } open class ResourceQueryResponse { /** * The resource id */ @ApiMember(Description="The resource id") var Id:Int? = null /** * The resource name */ @ApiMember(Description="The resource name") var Name:String? = null /** * The resource description */ @ApiMember(Description="The resource description") var Description:String? = null /** * If resource is active or not */ @ApiMember(Description="If resource is active or not") var Active:Boolean? = null /** * The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue. */ @ApiMember(Description="The resource color in scheduler in hexadecimal color code. Example: #00b0f0 for blue.") var Color:String? = null /** * The email of the resource */ @ApiMember(Description="The email of the resource") var Email:String? = null /** * The image url of the resource */ @ApiMember(Description="The image url of the resource") var ImageUrl:Uri? = null /** * The mobile phone number of the resource */ @ApiMember(Description="The mobile phone number of the resource") var MobilePhone:String? = null /** * Used by example code locks to know what access group the resource is assigned to */ @ApiMember(Description="Used by example code locks to know what access group the resource is assigned to") var AccessGroup:String? = null /** * If the resource should receive email notification when booked */ @ApiMember(Description="If the resource should receive email notification when booked") var EmailNotification:Boolean? = null /** * If the resource should receive SMS notification when booked */ @ApiMember(Description="If the resource should receive SMS notification when booked") var SMSNotification:Boolean? = null /** * If the resource should receive email reminders on bookings */ @ApiMember(Description="If the resource should receive email reminders on bookings") var SendEmailReminder:Boolean? = null /** * If the resource should receive SMS reminders on bookings */ @ApiMember(Description="If the resource should receive SMS reminders on bookings") var SendSMSReminder:Boolean? = null /** * The resource time exceptions */ @ApiMember(Description="The resource time exceptions") var Exceptions:ArrayList = ArrayList() /** * The resource bookings */ @ApiMember(Description="The resource bookings") var Bookings:ArrayList = ArrayList() /** * Then date when the resource was created */ @ApiMember(Description="Then date when the resource was created") var Created:Date? = null /** * Then date when the resource was updated */ @ApiMember(Description="Then date when the resource was updated") var Updated:Date? = null var ResponseStatus:ResponseStatus? = null }