MyApp

<back to all web services

CreateInterview

Talent
Requires Authentication
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

// @DataContract
abstract class AuditBase
{
    // @DataMember(Order=1)
    DateTime? createdDate;

    // @DataMember(Order=2)
    // @required()
    String? createdBy;

    // @DataMember(Order=3)
    DateTime? modifiedDate;

    // @DataMember(Order=4)
    // @required()
    String? modifiedBy;

    // @DataMember(Order=5)
    DateTime? deletedDate;

    // @DataMember(Order=6)
    String? deletedBy;

    AuditBase({this.createdDate,this.createdBy,this.modifiedDate,this.modifiedBy,this.deletedDate,this.deletedBy});
    AuditBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        createdBy = json['createdBy'];
        modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
        modifiedBy = json['modifiedBy'];
        deletedDate = JsonConverters.fromJson(json['deletedDate'],'DateTime',context!);
        deletedBy = json['deletedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'createdBy': createdBy,
        'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
        'modifiedBy': modifiedBy,
        'deletedDate': JsonConverters.toJson(deletedDate,'DateTime',context!),
        'deletedBy': deletedBy
    };

    getTypeName() => "AuditBase";
    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 JobApplicationStatus
{
    Applied,
    PhoneScreening,
    PhoneScreeningCompleted,
    Interview,
    InterviewCompleted,
    Offer,
    Disqualified,
}

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;
}

// @ValidateRequest(Validator="IsAuthenticated")
class CreateInterview implements ICreateDb<Interview>, IConvertible
{
    // @Validate(Validator="NotNull")
    DateTime? bookingTime;

    // @Validate(Validator="GreaterThan(0)")
    int? jobApplicationId;

    // @Validate(Validator="GreaterThan(0)", Message="An employee to perform interview must be selected.")
    String? appUserId;

    JobApplicationStatus? applicationStatus;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'blazor_gallery.servicestack.net', types: <String, TypeInfo> {
    'AppUser': TypeInfo(TypeOf.Class, create:() => AppUser()),
    'JobApplicationStatus': TypeInfo(TypeOf.Enum, enumValues:JobApplicationStatus.values),
    'Interview': TypeInfo(TypeOf.Class, create:() => Interview()),
    'CreateInterview': TypeInfo(TypeOf.Class, create:() => CreateInterview()),
});

Dart CreateInterview DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/CreateInterview HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	bookingTime: 0001-01-01,
	jobApplicationId: 0,
	appUserId: String,
	applicationStatus: Applied
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	bookingTime: 0001-01-01,
	jobApplicationId: 0,
	appUserId: String,
	appUser: 
	{
		id: String,
		firstName: String,
		lastName: String,
		displayName: String,
		profileUrl: String
	},
	applicationStatus: Applied,
	notes: String,
	createdDate: 0001-01-01,
	createdBy: String,
	modifiedDate: 0001-01-01,
	modifiedBy: String,
	deletedDate: 0001-01-01,
	deletedBy: String
}