/* Options: Date: 2024-12-22 21:40:58 SwiftVersion: 6.0 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: QueryContacts.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack public class QueryContacts : QueryDb, IReturn { public typealias Return = QueryResponse public var id:Int? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } } } public class JobApplicationAttachment : Codable { public var id:Int? // @References(typeof(JobApplication)) public var jobApplicationId:Int? public var fileName:String? public var filePath:String? public var contentType:String? public var contentLength:Int? required public init(){} } public class AppUser : Codable { public var id:String? public var firstName:String? public var lastName:String? public var displayName:String? public var profileUrl:String? required public init(){} } public enum EmploymentType : String, Codable { case FullTime case PartTime case Casual case Contract } public class Contact : Codable { public var id:Int? // @Computed() public var displayName:String? public var profileUrl:String? public var firstName:String? public var lastName:String? public var salaryExpectation:Int? public var jobType:String? public var availabilityWeeks:Int? public var preferredWorkType:EmploymentType? public var preferredLocation:String? public var email:String? public var phone:String? public var skills:[String]? public var about:String? public var applications:[JobApplication] = [] required public init(){} } public class Job : AuditBase { public var id:Int? public var title:String? public var employmentType:EmploymentType? public var company:String? public var location:String? public var salaryRangeLower:Int? public var salaryRangeUpper:Int? public var Description:String? public var applications:[JobApplication] = [] public var closing:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case title case employmentType case company case location case salaryRangeLower case salaryRangeUpper case Description case applications case closing } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) title = try container.decodeIfPresent(String.self, forKey: .title) employmentType = try container.decodeIfPresent(EmploymentType.self, forKey: .employmentType) company = try container.decodeIfPresent(String.self, forKey: .company) location = try container.decodeIfPresent(String.self, forKey: .location) salaryRangeLower = try container.decodeIfPresent(Int.self, forKey: .salaryRangeLower) salaryRangeUpper = try container.decodeIfPresent(Int.self, forKey: .salaryRangeUpper) Description = try container.decodeIfPresent(String.self, forKey: .Description) applications = try container.decodeIfPresent([JobApplication].self, forKey: .applications) ?? [] closing = try container.decodeIfPresent(Date.self, forKey: .closing) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if title != nil { try container.encode(title, forKey: .title) } if employmentType != nil { try container.encode(employmentType, forKey: .employmentType) } if company != nil { try container.encode(company, forKey: .company) } if location != nil { try container.encode(location, forKey: .location) } if salaryRangeLower != nil { try container.encode(salaryRangeLower, forKey: .salaryRangeLower) } if salaryRangeUpper != nil { try container.encode(salaryRangeUpper, forKey: .salaryRangeUpper) } if Description != nil { try container.encode(Description, forKey: .Description) } if applications.count > 0 { try container.encode(applications, forKey: .applications) } if closing != nil { try container.encode(closing, forKey: .closing) } } } public enum JobApplicationStatus : String, Codable { case Applied case PhoneScreening case PhoneScreeningCompleted case Interview case InterviewCompleted case Offer case Disqualified } public class JobApplication : Codable { public var id:Int? // @References(typeof(Job)) public var jobId:Int? // @References(typeof(Contact)) public var contactId:Int? public var position:Job? public var applicant:Contact? public var comments:[JobApplicationComment] = [] public var appliedDate:Date? public var applicationStatus:JobApplicationStatus? public var attachments:[JobApplicationAttachment] = [] public var events:[JobApplicationEvent] = [] public var phoneScreen:PhoneScreen? public var interview:Interview? public var jobOffer:JobOffer? required public init(){} } public class PhoneScreen : AuditBase { public var id:Int? // @References(typeof(AppUser)) public var appUserId:String? public var appUser:AppUser? // @References(typeof(JobApplication)) public var jobApplicationId:Int? public var applicationStatus:JobApplicationStatus? public var notes:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case appUserId case appUser case jobApplicationId case applicationStatus case notes } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) appUserId = try container.decodeIfPresent(String.self, forKey: .appUserId) appUser = try container.decodeIfPresent(AppUser.self, forKey: .appUser) jobApplicationId = try container.decodeIfPresent(Int.self, forKey: .jobApplicationId) applicationStatus = try container.decodeIfPresent(JobApplicationStatus.self, forKey: .applicationStatus) notes = try container.decodeIfPresent(String.self, forKey: .notes) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if appUser != nil { try container.encode(appUser, forKey: .appUser) } if jobApplicationId != nil { try container.encode(jobApplicationId, forKey: .jobApplicationId) } if applicationStatus != nil { try container.encode(applicationStatus, forKey: .applicationStatus) } if notes != nil { try container.encode(notes, forKey: .notes) } } } public class Interview : AuditBase { public var id:Int? public var bookingTime:Date? // @References(typeof(JobApplication)) public var jobApplicationId:Int? // @References(typeof(AppUser)) public var appUserId:String? public var appUser:AppUser? public var applicationStatus:JobApplicationStatus? public var notes:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case bookingTime case jobApplicationId case appUserId case appUser case applicationStatus case notes } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) bookingTime = try container.decodeIfPresent(Date.self, forKey: .bookingTime) jobApplicationId = try container.decodeIfPresent(Int.self, forKey: .jobApplicationId) appUserId = try container.decodeIfPresent(String.self, forKey: .appUserId) appUser = try container.decodeIfPresent(AppUser.self, forKey: .appUser) applicationStatus = try container.decodeIfPresent(JobApplicationStatus.self, forKey: .applicationStatus) notes = try container.decodeIfPresent(String.self, forKey: .notes) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if bookingTime != nil { try container.encode(bookingTime, forKey: .bookingTime) } if jobApplicationId != nil { try container.encode(jobApplicationId, forKey: .jobApplicationId) } if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if appUser != nil { try container.encode(appUser, forKey: .appUser) } if applicationStatus != nil { try container.encode(applicationStatus, forKey: .applicationStatus) } if notes != nil { try container.encode(notes, forKey: .notes) } } } public class JobOffer : AuditBase { public var id:Int? public var salaryOffer:Int? public var currency:String? // @References(typeof(JobApplication)) public var jobApplicationId:Int? // @References(typeof(AppUser)) public var appUserId:String? public var appUser:AppUser? public var notes:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case salaryOffer case currency case jobApplicationId case appUserId case appUser case notes } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) salaryOffer = try container.decodeIfPresent(Int.self, forKey: .salaryOffer) currency = try container.decodeIfPresent(String.self, forKey: .currency) jobApplicationId = try container.decodeIfPresent(Int.self, forKey: .jobApplicationId) appUserId = try container.decodeIfPresent(String.self, forKey: .appUserId) appUser = try container.decodeIfPresent(AppUser.self, forKey: .appUser) notes = try container.decodeIfPresent(String.self, forKey: .notes) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if salaryOffer != nil { try container.encode(salaryOffer, forKey: .salaryOffer) } if currency != nil { try container.encode(currency, forKey: .currency) } if jobApplicationId != nil { try container.encode(jobApplicationId, forKey: .jobApplicationId) } if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if appUser != nil { try container.encode(appUser, forKey: .appUser) } if notes != nil { try container.encode(notes, forKey: .notes) } } } public class JobApplicationEvent : AuditBase { public var id:Int? // @References(typeof(JobApplication)) public var jobApplicationId:Int? // @References(typeof(AppUser)) public var appUserId:String? public var appUser:AppUser? public var Description:String? public var status:JobApplicationStatus? public var eventDate:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case jobApplicationId case appUserId case appUser case Description case status case eventDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) jobApplicationId = try container.decodeIfPresent(Int.self, forKey: .jobApplicationId) appUserId = try container.decodeIfPresent(String.self, forKey: .appUserId) appUser = try container.decodeIfPresent(AppUser.self, forKey: .appUser) Description = try container.decodeIfPresent(String.self, forKey: .Description) status = try container.decodeIfPresent(JobApplicationStatus.self, forKey: .status) eventDate = try container.decodeIfPresent(Date.self, forKey: .eventDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if jobApplicationId != nil { try container.encode(jobApplicationId, forKey: .jobApplicationId) } if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if appUser != nil { try container.encode(appUser, forKey: .appUser) } if Description != nil { try container.encode(Description, forKey: .Description) } if status != nil { try container.encode(status, forKey: .status) } if eventDate != nil { try container.encode(eventDate, forKey: .eventDate) } } } public class JobApplicationComment : AuditBase { public var id:Int? // @References(typeof(AppUser)) public var appUserId:String? public var appUser:AppUser? // @References(typeof(JobApplication)) public var jobApplicationId:Int? public var comment:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case appUserId case appUser case jobApplicationId case comment } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) appUserId = try container.decodeIfPresent(String.self, forKey: .appUserId) appUser = try container.decodeIfPresent(AppUser.self, forKey: .appUser) jobApplicationId = try container.decodeIfPresent(Int.self, forKey: .jobApplicationId) comment = try container.decodeIfPresent(String.self, forKey: .comment) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if appUser != nil { try container.encode(appUser, forKey: .appUser) } if jobApplicationId != nil { try container.encode(jobApplicationId, forKey: .jobApplicationId) } if comment != nil { try container.encode(comment, forKey: .comment) } } }