/* Options:
Date: 2025-04-14 15:31:52
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: TestRecurringSchedule.*
//ExcludeTypes: 
//InitializeCollections: True
//TreatTypesAsStrings: 
//DefaultImports: java.math.*,java.util.*,net.servicestack.client.*
*/

import java.math.*
import java.util.*
import net.servicestack.client.*


@Route(Path="/schedules/recurring/test", Verbs="POST")
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@ValidateRequest(Validator="IsAuthenticated")
open class TestRecurringSchedule : IReturn<AvailableTimesResponse>, ICompany, IInterval
{
    /**
    * 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.")
    var CompanyId:UUID? = null

    /**
    * From what datetime to show available times
    */
    @ApiMember(DataType="dateTime", Description="From what datetime to show available times", IsRequired=true, ParameterType="query")
    var From:Date? = null

    /**
    * To what datetime to show available times
    */
    @ApiMember(DataType="dateTime", Description="To what datetime to show available times", IsRequired=true, ParameterType="query")
    var To:Date? = null

    /**
    * The Service Duration to be faked if there is no Service selected
    */
    @ApiMember(Description="The Service Duration to be faked if there is no Service selected")
    var Duration:Int? = null

    /**
    * Time interval for available times. Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM ,  ..... 04:45PM-05:45, 05:00PM-06:00PM
    */
    @ApiMember(Description="Time interval for available times. Here you set the interval at which times should appear. For example, if you select the range 15minutes, and your service has an duration of 1 hour and opening hours are 9AM to 6PM you will see the following suggested times: 09AM-10PM 09:15AM-10:15PM, 09:30AM-10:30PM ,  ..... 04:45PM-05:45, 05:00PM-06:00PM", IsRequired=true)
    var TimeInterval:Int? = null

    /**
    * Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight).
    */
    @ApiMember(Description="Allow bookings end time exceeds the opening hours Here you can choose whether it should be possible to make a reservation exceeding the opening hours. This should be ticked when a service duration is longer than 24 hours (possible to book over midnight).", IsRequired=true)
    var EnableBookingUntilClosingTime:Boolean? = null

    /**
    * The timestamp to which the schedule is valid from
    */
    @ApiMember(Description="The timestamp to which the schedule is valid from", IsRequired=true)
    var ValidFrom:Date? = null

    /**
    * The timestamp to which the schedule is valid to
    */
    @ApiMember(Description="The timestamp to which the schedule is valid to", IsRequired=true)
    var ValidTo:Date? = null

    /**
    * The time for the schedule opening hours (starttime)
    */
    @ApiMember(Description="The time for the schedule opening hours (starttime)", IsRequired=true)
    var StartTime:TimeSpan? = null

    /**
    * The time for the schedule opening hours (endtime)
    */
    @ApiMember(Description="The time for the schedule opening hours (endtime)", IsRequired=true)
    var EndTime:TimeSpan? = null

    /**
    * The number of days the schedule is valid from todays date
    */
    @ApiMember(Description="The number of days the schedule is valid from todays date", IsRequired=true)
    var NumberOfScheduleDays:Int? = null

    /**
    * If recurring, an array indicating which days of the week the schedule recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs
    */
    @ApiMember(Description="If recurring, an array indicating which days of the week the schedule recures on where 1 = Monday .. 7 = Sunday. When recurring then the time portion of the Fields From and To indicates the time of day the recurrence occurs")
    var DaysOfWeek:ArrayList<Int>? = null

    /**
    * If not recuring, an array indicating which dates that are open for the schedule.
    */
    @ApiMember(Description="If not recuring, an array indicating which dates that are open for the schedule.")
    var ScheduleDates:ArrayList<AddRecurringScheduleDate> = ArrayList<AddRecurringScheduleDate>()

    /**
    * Schedule exceptions. For example closed on lunch time between 12AM and 1PM. These times will be removed from the recurring schedule.
    */
    @ApiMember(Description="Schedule exceptions. For example closed on lunch time between 12AM and 1PM. These times will be removed from the recurring schedule.")
    var Exceptions:ArrayList<ScheduleException> = ArrayList<ScheduleException>()

    @ApiMember()
    var Services:ArrayList<AddScheduleService> = ArrayList<AddScheduleService>()

    @ApiMember()
    var Resources:ArrayList<Resource> = ArrayList<Resource>()
    companion object { private val responseType = AvailableTimesResponse::class.java }
    override fun getResponseType(): Any? = TestRecurringSchedule.responseType
}

open class AvailableTimesResponse
{
    var CompanyId:UUID? = null
    var ServiceId:Int? = null
    var TimesFreeTextSingle:String? = null
    var TimesFreeTextMultiple:String? = null
    var Times:ArrayList<AvailableTimesSum> = ArrayList<AvailableTimesSum>()
}

open interface ICompany
{
    var CompanyId:UUID?
}

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<CustomFieldValue> = ArrayList<CustomFieldValue>()

    var CustomField:CustomField? = null
    @Ignore()
    var RegEx:RegEx? = null

    @Ignore()
    var Services:ArrayList<Service> = ArrayList<Service>()

    var CustomFieldServiceRelation:ArrayList<CustomFieldServiceRelation> = ArrayList<CustomFieldServiceRelation>()
    @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<ISchedule>? = null

    @Ignore()
    var Exceptions:IList<ITimeException>? = null

    @Ignore()
    var Bookings:IList<IBookedTime>? = null

    @Ignore()
    var CustomFieldsConfig:IList<CustomFieldConfig>? = null

    @Ignore()
    var CustomFieldsData:IList<CustomFieldDataResponse>? = 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 AddRecurringScheduleDate
{
    /**
    * The date for the schedule opening (only date part is used here
    */
    @ApiMember(Description="The date for the schedule opening (only date part is used here", IsRequired=true)
    var Date:Date? = null

    /**
    * The time for the schedule opening hours (starttime)
    */
    @ApiMember(Description="The time for the schedule opening hours (starttime)", IsRequired=true)
    var StartTime:TimeSpan? = null

    /**
    * The time for the schedule opening hours (endtime)
    */
    @ApiMember(Description="The time for the schedule opening hours (endtime)", IsRequired=true)
    var EndTime:TimeSpan? = null
}

open class ScheduleException
{
    var StartTime:TimeSpan? = null
    var EndTime:TimeSpan? = null
}

open class AddScheduleService
{
    /**
    * The service id
    */
    @ApiMember(Description="The service id", IsRequired=true)
    var Id:Int? = 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 AvailableTimesSum : IAvailableTime
{
    var From:Date? = null
    var To:Date? = null
    var Free:Int? = null
    var FreeSpots:Int? = null
    var ExceptionTexts:ArrayList<ExceptionText> = ArrayList<ExceptionText>()
}

enum class ScheduleType
{
    NotDefined,
    RecurringSchedule,
    DateSchedule,
}

open class BaseModel
{
}

open interface IBaseModelCreated
{
    var CreatedDate:Date?
}

open interface IBaseModelUpdated
{
    var UpdatedDate:Date?
}

open interface ICustomFieldTable
{
    var CustomFieldsConfig:IList<CustomFieldConfig>?
    var CustomFieldsData:IList<CustomFieldDataResponse>?
    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 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 CompanyId:UUID?
    var Resources:IList<Resource>?
    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<Int>?
}

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 ExceptionText
{
    var Reason:String? = null
    var ReasonPublic:String? = null
}

open interface IAvailableTime : IInterval
{
    var Free:Int?
}