package dbtypes

type SubmissionStatus string

const (
	SubStatusUnspecified SubmissionStatus = "unspecified"
	SubStatusNew         SubmissionStatus = "new"
	SubStatusPending     SubmissionStatus = "pending"
	SubStatusOnInterview SubmissionStatus = "on_interview"
	SubStatusApproved    SubmissionStatus = "approved"
	SubStatusCancelled   SubmissionStatus = "cancelled"
	SubStatusRejected    SubmissionStatus = "rejected"
)

func NewSubmissionStatus(status *string) *SubmissionStatus {
	if status == nil {
		return nil
	}

	res := SubmissionStatus(*status)

	return &res
}

type (
	Submission struct {
		Id            string
		AgentInfo     *AgentInfo
		VacancyInfo   *VacancyInfo
		CandidateInfo *CandidateInfo
		Status        SubmissionStatus
	}

	AgentInfo struct {
		Id string
	}

	VacancyInfo struct {
		Id string
	}

	CandidateInfo struct {
		Id          string
		FirstName   string
		LastName    string
		MiddleName  string
		PhoneNumber string
		Email       string
		Birthday    string
		CvLink      *string
		Resume      *string
	}
)

type (
	SubmissionListGetRequest struct {
		Filters  *SubmissionListGetFilters
		Page     uint64
		PageSize uint64
	}

	SubmissionListGetFilters struct {
		AgentId   *string
		VacancyId *string
		Status    *SubmissionStatus
	}

	SubmissionListGetResponse struct {
		Submissions []Submission
	}
)

type (
	SubmissionCreateRequest struct {
		AgentId       string
		VacancyId     string
		CandidateInfo *CandidateInfo
	}

	SubmissionCreateResponse struct {
		Id string
	}
)

type (
	SubmissionStatusUpdateRequest struct {
		Id     string
		Status SubmissionStatus
	}

	SubmissionStatusUpdateResponse struct{}
)

type (
	SubmissionDeleteRequest struct {
		Id string
	}

	SubmissionDeleteResponse struct{}
)
