/* Options: Date: 2024-07-03 14:24:43 SwiftVersion: 5.0 Version: 8.23 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bokamera.se //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: TestDateSchedule.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/schedules/date/test", "POST") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ValidateRequest(Validator="IsAuthenticated") public class TestDateSchedule : IReturn, ICompany, IInterval, Codable { public typealias Return = AvailableTimesResponse /** * 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.") public var companyId:String? /** * The dates for the schedule. This is the actual timeslots. */ // @ApiMember(Description="The dates for the schedule. This is the actual timeslots.", IsRequired=true) public var scheduleDates:[AddDateScheduleDate] = [] /** * From what datetime to show available times */ // @ApiMember(DataType="dateTime", Description="From what datetime to show available times", IsRequired=true, ParameterType="query") public var from:Date /** * To what datetime to show available times */ // @ApiMember(DataType="dateTime", Description="To what datetime to show available times", IsRequired=true, ParameterType="query") public var to:Date /** * The Service Duration */ // @ApiMember(Description="The Service Duration") public var serviceId:Int? required public init(){} } public class AvailableTimesResponse : Codable { public var companyId:String public var serviceId:Int public var timesFreeTextSingle:String public var timesFreeTextMultiple:String public var times:[AvailableTimesSum] = [] required public init(){} } public protocol ICompany { var companyId:String? { get set } } public protocol IInterval { var from:Date { get set } var to:Date { get set } } public class AddDateScheduleDate : Codable { /** * The from date for the timeslot */ // @ApiMember(Description="The from date for the timeslot", IsRequired=true) public var from:Date /** * The to date for the timeslot */ // @ApiMember(Description="The to date for the timeslot", IsRequired=true) public var to:Date required public init(){} } public class AvailableTimesSum : IAvailableTime, Codable { public var from:Date public var to:Date public var free:Int public var freeSpots:Int public var exceptionTexts:[ExceptionText] = [] required public init(){} } public class ExceptionText : Codable { public var reason:String public var reasonPublic:String required public init(){} } public protocol IAvailableTime : IInterval { var free:Int { get set } }