job

package
v0.0.0-...-80e8cda Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SearchTypeJob    = "job"
	SearchTypeSalary = "salary"
)
View Source
const (
	JobAdBasic = iota
	JobAdSponsoredBackground
	JobAdSponsoredPinnedFor30Days
	JobAdSponsoredPinnedFor7Days
	JobAdSponsoredPinnedFor60Days
	JobAdSponsoredPinnedFor90Days
)
View Source
const (
	JobPlanTypeBasic    = "basic"
	JobPlanTypePro      = "pro"
	JobPlanTypePlatinum = "platinum"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Applicant

type Applicant struct {
	Token       string
	Cv          []byte
	Email       string
	CreatedAt   time.Time
	ConfirmedAt pq.NullTime
	CvSize      int
}

type Job

type Job struct {
	CreatedAt                       int64
	JobTitle                        string
	Company                         string
	SalaryMin                       string
	SalaryMax                       string
	SalaryCurrency                  string
	SalaryPeriod                    string
	SalaryRange                     string
	Location                        string
	Description                     string
	Perks                           string
	InterviewProcess                string
	HowToApply                      string
	Email                           string
	Expired                         bool
	LastWeekClickouts               int
	PlanType                        string
	PlanDuration                    int
	NewsletterEligibilityExpiredAt  time.Time
	BlogEligibilityExpiredAt        time.Time
	SocialMediaEligibilityExpiredAt time.Time
	FrontPageEligibilityExpiredAt   time.Time
	CompanyPageEligibilityExpiredAt time.Time
	PlanExpiredAt                   time.Time
}

type JobApplyURL

type JobApplyURL struct {
	ID  int
	URL string
}

type JobExpirationEntity

type JobExpirationEntity struct {
	NewsletterEligibilityExpiredAt  time.Time
	BlogEligibilityExpiredAt        time.Time
	SocialMediaEligibilityExpiredAt time.Time
	FrontPageEligibilityExpiredAt   time.Time
	CompanyPageEligibilityExpiredAt time.Time
	PlanExpiredAt                   time.Time
}

type JobPost

type JobPost struct {
	ID                              int
	CreatedAt                       int64
	TimeAgo                         string
	JobTitle                        string
	Company                         string
	CompanyURL                      string
	SalaryRange                     string
	Location                        string
	JobDescription                  string
	Perks                           string
	InterviewProcess                string
	HowToApply                      string
	Slug                            string
	SalaryCurrency                  string
	SalaryMin                       int64
	SalaryMax                       int64
	CompanyIconID                   string
	ExternalID                      string
	EditToken                       string
	IsQuickApply                    bool
	ApprovedAt                      *time.Time
	CompanyEmail                    string
	SalaryPeriod                    string
	CompanyURLEnc                   string
	Expired                         bool
	LastWeekClickouts               int
	PlanType                        string
	PlanDuration                    int
	NewsletterEligibilityExpiredAt  time.Time
	BlogEligibilityExpiredAt        time.Time
	SocialMediaEligibilityExpiredAt time.Time
	FrontPageEligibilityExpiredAt   time.Time
	CompanyPageEligibilityExpiredAt time.Time
	PlanExpiredAt                   time.Time
	JobDescriptionHTML              interface{}
	InterviewProcessHTML            interface{}
	PerksHTML                       interface{}
}

type JobPostForEdit

type JobPostForEdit struct {
	ID                                                                        int
	JobTitle, Company, CompanyEmail, CompanyURL, Location                     string
	SalaryMin, SalaryMax                                                      int
	SalaryCurrency, JobDescription, Perks, InterviewProcess, HowToApply, Slug string
	CreatedAt                                                                 time.Time
	ApprovedAt                                                                pq.NullTime
	CompanyIconID                                                             string
	ExternalID                                                                string
	SalaryPeriod                                                              string
	PlanType                                                                  string
	PlanDuration                                                              int
	NewsletterEligibilityExpiredAt                                            time.Time
	BlogEligibilityExpiredAt                                                  time.Time
	SocialMediaEligibilityExpiredAt                                           time.Time
	FrontPageEligibilityExpiredAt                                             time.Time
	CompanyPageEligibilityExpiredAt                                           time.Time
	PlanExpiredAt                                                             time.Time
}

type JobRq

type JobRq struct {
	JobTitle          string `json:"job_title"`
	Location          string `json:"job_location"`
	Company           string `json:"company_name"`
	CompanyURL        string `json:"company_url"`
	SalaryMin         string `json:"salary_min"`
	SalaryMax         string `json:"salary_max"`
	SalaryCurrency    string `json:"salary_currency"`
	Description       string `json:"job_description"`
	HowToApply        string `json:"how_to_apply"`
	Perks             string `json:"perks"`
	InterviewProcess  string `json:"interview_process,omitempty"`
	Email             string `json:"company_email"`
	StripeToken       string `json:"stripe_token,omitempty"`
	PlanType          string `json:"plan_type"`
	PlanDurationStr   string `json:"plan_duration"`
	PlanDuration      int
	CurrencyCode      string `json:"currency_code"`
	CompanyIconID     string `json:"company_icon_id,omitempty"`
	SalaryCurrencyISO string `json:"salary_currency_iso"`
	VisaSponsorship   bool   `json:"visa_sponsorship,omitempty"`
}

type JobRqUpdate

type JobRqUpdate struct {
	JobTitle         string `json:"job_title"`
	Location         string `json:"job_location"`
	Company          string `json:"company_name"`
	CompanyURL       string `json:"company_url"`
	SalaryMin        string `json:"salary_min"`
	SalaryMax        string `json:"salary_max"`
	SalaryCurrency   string `json:"salary_currency"`
	Description      string `json:"job_description"`
	HowToApply       string `json:"how_to_apply"`
	Perks            string `json:"perks"`
	InterviewProcess string `json:"interview_process"`
	Email            string `json:"company_email"`
	Token            string `json:"token"`
	CompanyIconID    string `json:"company_icon_id,omitempty"`
	SalaryPeriod     string `json:"salary_period"`
}

type JobRqUpsell

type JobRqUpsell struct {
	Token           string `json:"token"`
	Email           string `json:"email"`
	StripeToken     string `json:"stripe_token,omitempty"`
	PlanType        string `json:"plan_type"`
	PlanDuration    int
	PlanDurationStr string `json:"plan_duration"`
}

type JobStat

type JobStat struct {
	Date      string `json:"date"`
	Clickouts int    `json:"clickouts"`
	PageViews int    `json:"pageviews"`
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(db *sql.DB) *Repository

func (*Repository) ApplyToJob

func (r *Repository) ApplyToJob(jobID int, cv []byte, email, token string) error

func (*Repository) ApproveJob

func (r *Repository) ApproveJob(jobID int) error

func (*Repository) CleanupExpiredApplyTokens

func (r *Repository) CleanupExpiredApplyTokens() error

func (*Repository) ConfirmApplyToJob

func (r *Repository) ConfirmApplyToJob(token string) error

func (*Repository) DeleteJobCascade

func (r *Repository) DeleteJobCascade(jobID int) error

func (*Repository) DisapproveJob

func (r *Repository) DisapproveJob(jobID int) error

func (*Repository) GetApplicantByApplyToken

func (r *Repository) GetApplicantByApplyToken(applyToken string) (Applicant, error)

func (*Repository) GetApplicantsForJob

func (r *Repository) GetApplicantsForJob(jobID int) ([]*Applicant, error)

func (*Repository) GetClickoutCountForJob

func (r *Repository) GetClickoutCountForJob(jobID int) (int, error)

func (*Repository) GetCompanyJobs

func (r *Repository) GetCompanyJobs(companyName string, limit int) ([]*JobPost, error)

GetCompanyJobs returns jobs for a given company

func (*Repository) GetJobApplyURLs

func (r *Repository) GetJobApplyURLs() ([]JobApplyURL, error)

func (*Repository) GetJobByApplyToken

func (r *Repository) GetJobByApplyToken(token string) (JobPost, Applicant, error)

func (*Repository) GetJobByExternalID

func (r *Repository) GetJobByExternalID(externalID string) (JobPost, error)

func (*Repository) GetJobByStripeSessionID

func (r *Repository) GetJobByStripeSessionID(sessionID string) (JobPost, error)

func (*Repository) GetLastNJobs

func (r *Repository) GetLastNJobs(max int, loc string) ([]*JobPost, error)

func (*Repository) GetLastNJobsFromID

func (r *Repository) GetLastNJobsFromID(max, jobID int) ([]*JobPost, error)

func (*Repository) GetPendingJobs

func (r *Repository) GetPendingJobs() ([]*JobPost, error)

func (*Repository) GetPinnedJobs

func (r *Repository) GetPinnedJobs() ([]*JobPost, error)

func (*Repository) GetRelevantJobs

func (r *Repository) GetRelevantJobs(location string, jobID int, limit int) ([]*JobPost, error)

GetRelevantJobs returns pinned and most recent jobs for now

func (*Repository) GetStatsForJob

func (r *Repository) GetStatsForJob(jobID int) ([]JobStat, error)

func (*Repository) GetValue

func (r *Repository) GetValue(key string) (string, error)

func (*Repository) GetViewCountForJob

func (r *Repository) GetViewCountForJob(jobID int) (int, error)

func (*Repository) JobPostByCreatedAt

func (r *Repository) JobPostByCreatedAt() ([]*JobPost, error)

func (*Repository) JobPostByExternalIDForEdit

func (r *Repository) JobPostByExternalIDForEdit(externalID string) (*JobPostForEdit, error)

func (*Repository) JobPostByIDForEdit

func (r *Repository) JobPostByIDForEdit(jobID int) (*JobPostForEdit, error)

func (*Repository) JobPostBySlug

func (r *Repository) JobPostBySlug(slug string) (*JobPost, error)

func (*Repository) JobPostBySlugAdmin

func (r *Repository) JobPostBySlugAdmin(slug string) (*JobPost, error)

func (*Repository) JobPostByURLID

func (r *Repository) JobPostByURLID(URLID int64) (*JobPost, error)

func (*Repository) JobPostIDByToken

func (r *Repository) JobPostIDByToken(token string) (int, error)

func (*Repository) JobsByQuery

func (r *Repository) JobsByQuery(location, tag string, pageId, salary int, currency string, jobsPerPage int, includePinnedJobs bool) ([]*JobPost, int, error)

func (*Repository) JobsCountByEmail

func (r *Repository) JobsCountByEmail(email string) (int, error)

func (*Repository) JobsForRecruiter

func (r *Repository) JobsForRecruiter(posterEmail string, pageId, jobsPerPage int) ([]*JobPost, int, error)

func (*Repository) LastJobPosted

func (r *Repository) LastJobPosted() (time.Time, error)

func (*Repository) LastJobPostedByEmail

func (r *Repository) LastJobPostedByEmail(email string) (*JobPost, error)

func (*Repository) MarkJobAsExpired

func (r *Repository) MarkJobAsExpired(jobID int) error

func (*Repository) NewJobsLastWeekOrMonth

func (r *Repository) NewJobsLastWeekOrMonth() (int, int, error)

func (*Repository) PlanTypeAndDurationToExpirations

func (r *Repository) PlanTypeAndDurationToExpirations(planType string, planDuration int) (JobExpirationEntity, error)

func (*Repository) PlanTypeAndDurationToExpirationsFromExistingExpirations

func (r *Repository) PlanTypeAndDurationToExpirationsFromExistingExpirations(expiration JobExpirationEntity, planType string, planDuration int) (JobExpirationEntity, error)

func (*Repository) SaveDraft

func (r *Repository) SaveDraft(job *JobRq) (int, error)

func (*Repository) SaveTokenForJob

func (r *Repository) SaveTokenForJob(token string, jobID int) error

func (*Repository) SetValue

func (r *Repository) SetValue(key, val string) error

func (*Repository) TokenByJobID

func (r *Repository) TokenByJobID(jobID int) (string, error)

func (*Repository) TopNJobsByCurrencyAndLocation

func (r *Repository) TopNJobsByCurrencyAndLocation(currency, location string, max int) ([]*JobPost, error)

func (*Repository) TrackJobClickout

func (r *Repository) TrackJobClickout(jobID int) error

func (*Repository) TrackJobView

func (r *Repository) TrackJobView(job *JobPost) error

func (*Repository) UpdateJob

func (r *Repository) UpdateJob(job *JobRqUpdate, jobID int) error

func (*Repository) UpdateJobPlan

func (r *Repository) UpdateJobPlan(jobID int, planType string, planDuration int, expiration JobExpirationEntity) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL