/* Options:
Date: 2025-01-06 03:45:10
Version: 8.51
Tip: To override a DTO option, remove "//" prefix before updating
BaseUrl: https://blazor-gallery.servicestack.net

//GlobalNamespace: 
//AddServiceStackTypes: True
//AddResponseStatus: False
//AddImplicitVersion: 
//AddDescriptionAsComments: True
IncludeTypes: QueryJobOffers.*
//ExcludeTypes: 
//DefaultImports: package:servicestack/servicestack.dart,dart:typed_data
*/

import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class JobApplicationAttachment implements IConvertible
{
    int? id;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    String? fileName;
    String? filePath;
    String? contentType;
    int? contentLength;

    JobApplicationAttachment({this.id,this.jobApplicationId,this.fileName,this.filePath,this.contentType,this.contentLength});
    JobApplicationAttachment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        jobApplicationId = json['jobApplicationId'];
        fileName = json['fileName'];
        filePath = json['filePath'];
        contentType = json['contentType'];
        contentLength = json['contentLength'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'jobApplicationId': jobApplicationId,
        'fileName': fileName,
        'filePath': filePath,
        'contentType': contentType,
        'contentLength': contentLength
    };

    getTypeName() => "JobApplicationAttachment";
    TypeContext? context = _ctx;
}

class AppUser implements IConvertible
{
    String? id;
    String? firstName;
    String? lastName;
    String? displayName;
    String? profileUrl;

    AppUser({this.id,this.firstName,this.lastName,this.displayName,this.profileUrl});
    AppUser.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        firstName = json['firstName'];
        lastName = json['lastName'];
        displayName = json['displayName'];
        profileUrl = json['profileUrl'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'firstName': firstName,
        'lastName': lastName,
        'displayName': displayName,
        'profileUrl': profileUrl
    };

    getTypeName() => "AppUser";
    TypeContext? context = _ctx;
}

enum EmploymentType
{
    FullTime,
    PartTime,
    Casual,
    Contract,
}

class Job extends AuditBase implements IConvertible
{
    int? id;
    String? title;
    EmploymentType? employmentType;
    String? company;
    String? location;
    int? salaryRangeLower;
    int? salaryRangeUpper;
    String? description;
    List<JobApplication>? applications = [];
    DateTime? closing;

    Job({this.id,this.title,this.employmentType,this.company,this.location,this.salaryRangeLower,this.salaryRangeUpper,this.description,this.applications,this.closing});
    Job.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        title = json['title'];
        employmentType = JsonConverters.fromJson(json['employmentType'],'EmploymentType',context!);
        company = json['company'];
        location = json['location'];
        salaryRangeLower = json['salaryRangeLower'];
        salaryRangeUpper = json['salaryRangeUpper'];
        description = json['description'];
        applications = JsonConverters.fromJson(json['applications'],'List<JobApplication>',context!);
        closing = JsonConverters.fromJson(json['closing'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'title': title,
        'employmentType': JsonConverters.toJson(employmentType,'EmploymentType',context!),
        'company': company,
        'location': location,
        'salaryRangeLower': salaryRangeLower,
        'salaryRangeUpper': salaryRangeUpper,
        'description': description,
        'applications': JsonConverters.toJson(applications,'List<JobApplication>',context!),
        'closing': JsonConverters.toJson(closing,'DateTime',context!)
    });

    getTypeName() => "Job";
    TypeContext? context = _ctx;
}

class Contact implements IConvertible
{
    int? id;
    // @computed()
    String? displayName;

    String? profileUrl;
    String? firstName;
    String? lastName;
    int? salaryExpectation;
    String? jobType;
    int? availabilityWeeks;
    EmploymentType? preferredWorkType;
    String? preferredLocation;
    String? email;
    String? phone;
    List<String>? skills;
    String? about;
    List<JobApplication>? applications = [];

    Contact({this.id,this.displayName,this.profileUrl,this.firstName,this.lastName,this.salaryExpectation,this.jobType,this.availabilityWeeks,this.preferredWorkType,this.preferredLocation,this.email,this.phone,this.skills,this.about,this.applications});
    Contact.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        displayName = json['displayName'];
        profileUrl = json['profileUrl'];
        firstName = json['firstName'];
        lastName = json['lastName'];
        salaryExpectation = json['salaryExpectation'];
        jobType = json['jobType'];
        availabilityWeeks = json['availabilityWeeks'];
        preferredWorkType = JsonConverters.fromJson(json['preferredWorkType'],'EmploymentType',context!);
        preferredLocation = json['preferredLocation'];
        email = json['email'];
        phone = json['phone'];
        skills = JsonConverters.fromJson(json['skills'],'List<String>',context!);
        about = json['about'];
        applications = JsonConverters.fromJson(json['applications'],'List<JobApplication>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'displayName': displayName,
        'profileUrl': profileUrl,
        'firstName': firstName,
        'lastName': lastName,
        'salaryExpectation': salaryExpectation,
        'jobType': jobType,
        'availabilityWeeks': availabilityWeeks,
        'preferredWorkType': JsonConverters.toJson(preferredWorkType,'EmploymentType',context!),
        'preferredLocation': preferredLocation,
        'email': email,
        'phone': phone,
        'skills': JsonConverters.toJson(skills,'List<String>',context!),
        'about': about,
        'applications': JsonConverters.toJson(applications,'List<JobApplication>',context!)
    };

    getTypeName() => "Contact";
    TypeContext? context = _ctx;
}

class JobApplicationComment extends AuditBase implements IConvertible
{
    int? id;
    // @References(typeof(AppUser))
    String? appUserId;

    AppUser? appUser;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    String? comment;

    JobApplicationComment({this.id,this.appUserId,this.appUser,this.jobApplicationId,this.comment});
    JobApplicationComment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        appUserId = json['appUserId'];
        appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
        jobApplicationId = json['jobApplicationId'];
        comment = json['comment'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'appUserId': appUserId,
        'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
        'jobApplicationId': jobApplicationId,
        'comment': comment
    });

    getTypeName() => "JobApplicationComment";
    TypeContext? context = _ctx;
}

enum JobApplicationStatus
{
    Applied,
    PhoneScreening,
    PhoneScreeningCompleted,
    Interview,
    InterviewCompleted,
    Offer,
    Disqualified,
}

class JobApplicationEvent extends AuditBase implements IConvertible
{
    int? id;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    // @References(typeof(AppUser))
    String? appUserId;

    AppUser? appUser;
    String? description;
    JobApplicationStatus? status;
    DateTime? eventDate;

    JobApplicationEvent({this.id,this.jobApplicationId,this.appUserId,this.appUser,this.description,this.status,this.eventDate});
    JobApplicationEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        jobApplicationId = json['jobApplicationId'];
        appUserId = json['appUserId'];
        appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
        description = json['description'];
        status = JsonConverters.fromJson(json['status'],'JobApplicationStatus',context!);
        eventDate = JsonConverters.fromJson(json['eventDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'jobApplicationId': jobApplicationId,
        'appUserId': appUserId,
        'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
        'description': description,
        'status': JsonConverters.toJson(status,'JobApplicationStatus',context!),
        'eventDate': JsonConverters.toJson(eventDate,'DateTime',context!)
    });

    getTypeName() => "JobApplicationEvent";
    TypeContext? context = _ctx;
}

class PhoneScreen extends AuditBase implements IConvertible
{
    int? id;
    // @References(typeof(AppUser))
    String? appUserId;

    AppUser? appUser;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    JobApplicationStatus? applicationStatus;
    String? notes;

    PhoneScreen({this.id,this.appUserId,this.appUser,this.jobApplicationId,this.applicationStatus,this.notes});
    PhoneScreen.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        appUserId = json['appUserId'];
        appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
        jobApplicationId = json['jobApplicationId'];
        applicationStatus = JsonConverters.fromJson(json['applicationStatus'],'JobApplicationStatus',context!);
        notes = json['notes'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'appUserId': appUserId,
        'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
        'jobApplicationId': jobApplicationId,
        'applicationStatus': JsonConverters.toJson(applicationStatus,'JobApplicationStatus',context!),
        'notes': notes
    });

    getTypeName() => "PhoneScreen";
    TypeContext? context = _ctx;
}

class Interview extends AuditBase implements IConvertible
{
    int? id;
    DateTime? bookingTime;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    // @References(typeof(AppUser))
    String? appUserId;

    AppUser? appUser;
    JobApplicationStatus? applicationStatus;
    String? notes;

    Interview({this.id,this.bookingTime,this.jobApplicationId,this.appUserId,this.appUser,this.applicationStatus,this.notes});
    Interview.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        bookingTime = JsonConverters.fromJson(json['bookingTime'],'DateTime',context!);
        jobApplicationId = json['jobApplicationId'];
        appUserId = json['appUserId'];
        appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
        applicationStatus = JsonConverters.fromJson(json['applicationStatus'],'JobApplicationStatus',context!);
        notes = json['notes'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'bookingTime': JsonConverters.toJson(bookingTime,'DateTime',context!),
        'jobApplicationId': jobApplicationId,
        'appUserId': appUserId,
        'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
        'applicationStatus': JsonConverters.toJson(applicationStatus,'JobApplicationStatus',context!),
        'notes': notes
    });

    getTypeName() => "Interview";
    TypeContext? context = _ctx;
}

class JobOffer extends AuditBase implements IConvertible
{
    int? id;
    int? salaryOffer;
    String? currency;
    // @References(typeof(JobApplication))
    int? jobApplicationId;

    // @References(typeof(AppUser))
    String? appUserId;

    AppUser? appUser;
    String? notes;

    JobOffer({this.id,this.salaryOffer,this.currency,this.jobApplicationId,this.appUserId,this.appUser,this.notes});
    JobOffer.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        salaryOffer = json['salaryOffer'];
        currency = json['currency'];
        jobApplicationId = json['jobApplicationId'];
        appUserId = json['appUserId'];
        appUser = JsonConverters.fromJson(json['appUser'],'AppUser',context!);
        notes = json['notes'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'salaryOffer': salaryOffer,
        'currency': currency,
        'jobApplicationId': jobApplicationId,
        'appUserId': appUserId,
        'appUser': JsonConverters.toJson(appUser,'AppUser',context!),
        'notes': notes
    });

    getTypeName() => "JobOffer";
    TypeContext? context = _ctx;
}

class JobApplication implements IConvertible
{
    int? id;
    // @References(typeof(Job))
    int? jobId;

    // @References(typeof(Contact))
    int? contactId;

    Job? position;
    Contact? applicant;
    List<JobApplicationComment>? comments = [];
    DateTime? appliedDate;
    JobApplicationStatus? applicationStatus;
    List<JobApplicationAttachment>? attachments = [];
    List<JobApplicationEvent>? events = [];
    PhoneScreen? phoneScreen;
    Interview? interview;
    JobOffer? jobOffer;

    JobApplication({this.id,this.jobId,this.contactId,this.position,this.applicant,this.comments,this.appliedDate,this.applicationStatus,this.attachments,this.events,this.phoneScreen,this.interview,this.jobOffer});
    JobApplication.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        jobId = json['jobId'];
        contactId = json['contactId'];
        position = JsonConverters.fromJson(json['position'],'Job',context!);
        applicant = JsonConverters.fromJson(json['applicant'],'Contact',context!);
        comments = JsonConverters.fromJson(json['comments'],'List<JobApplicationComment>',context!);
        appliedDate = JsonConverters.fromJson(json['appliedDate'],'DateTime',context!);
        applicationStatus = JsonConverters.fromJson(json['applicationStatus'],'JobApplicationStatus',context!);
        attachments = JsonConverters.fromJson(json['attachments'],'List<JobApplicationAttachment>',context!);
        events = JsonConverters.fromJson(json['events'],'List<JobApplicationEvent>',context!);
        phoneScreen = JsonConverters.fromJson(json['phoneScreen'],'PhoneScreen',context!);
        interview = JsonConverters.fromJson(json['interview'],'Interview',context!);
        jobOffer = JsonConverters.fromJson(json['jobOffer'],'JobOffer',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'jobId': jobId,
        'contactId': contactId,
        'position': JsonConverters.toJson(position,'Job',context!),
        'applicant': JsonConverters.toJson(applicant,'Contact',context!),
        'comments': JsonConverters.toJson(comments,'List<JobApplicationComment>',context!),
        'appliedDate': JsonConverters.toJson(appliedDate,'DateTime',context!),
        'applicationStatus': JsonConverters.toJson(applicationStatus,'JobApplicationStatus',context!),
        'attachments': JsonConverters.toJson(attachments,'List<JobApplicationAttachment>',context!),
        'events': JsonConverters.toJson(events,'List<JobApplicationEvent>',context!),
        'phoneScreen': JsonConverters.toJson(phoneScreen,'PhoneScreen',context!),
        'interview': JsonConverters.toJson(interview,'Interview',context!),
        'jobOffer': JsonConverters.toJson(jobOffer,'JobOffer',context!)
    };

    getTypeName() => "JobApplication";
    TypeContext? context = _ctx;
}

// @ValidateRequest(Validator="IsAuthenticated")
class QueryJobOffers extends QueryDb<JobOffer> implements IReturn<QueryResponse<JobOffer>>, IConvertible, IGet
{
    int? id;
    int? jobApplicationId;

    QueryJobOffers({this.id,this.jobApplicationId});
    QueryJobOffers.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        id = json['id'];
        jobApplicationId = json['jobApplicationId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'id': id,
        'jobApplicationId': jobApplicationId
    });

    createResponse() => QueryResponse<JobOffer>();
    getResponseTypeName() => "QueryResponse<JobOffer>";
    getTypeName() => "QueryJobOffers";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'blazor_gallery.servicestack.net', types: <String, TypeInfo> {
    'JobApplicationAttachment': TypeInfo(TypeOf.Class, create:() => JobApplicationAttachment()),
    'AppUser': TypeInfo(TypeOf.Class, create:() => AppUser()),
    'EmploymentType': TypeInfo(TypeOf.Enum, enumValues:EmploymentType.values),
    'Job': TypeInfo(TypeOf.Class, create:() => Job()),
    'List<JobApplication>': TypeInfo(TypeOf.Class, create:() => <JobApplication>[]),
    'JobApplication': TypeInfo(TypeOf.Class, create:() => JobApplication()),
    'Contact': TypeInfo(TypeOf.Class, create:() => Contact()),
    'JobApplicationComment': TypeInfo(TypeOf.Class, create:() => JobApplicationComment()),
    'JobApplicationStatus': TypeInfo(TypeOf.Enum, enumValues:JobApplicationStatus.values),
    'JobApplicationEvent': TypeInfo(TypeOf.Class, create:() => JobApplicationEvent()),
    'PhoneScreen': TypeInfo(TypeOf.Class, create:() => PhoneScreen()),
    'Interview': TypeInfo(TypeOf.Class, create:() => Interview()),
    'JobOffer': TypeInfo(TypeOf.Class, create:() => JobOffer()),
    'List<JobApplicationComment>': TypeInfo(TypeOf.Class, create:() => <JobApplicationComment>[]),
    'List<JobApplicationAttachment>': TypeInfo(TypeOf.Class, create:() => <JobApplicationAttachment>[]),
    'List<JobApplicationEvent>': TypeInfo(TypeOf.Class, create:() => <JobApplicationEvent>[]),
    'QueryResponse<JobOffer>': TypeInfo(TypeOf.Class, create:() => QueryResponse<JobOffer>()),
    'QueryJobOffers': TypeInfo(TypeOf.Class, create:() => QueryJobOffers()),
    'List<JobOffer>': TypeInfo(TypeOf.Class, create:() => <JobOffer>[]),
});