68 lines
2.5 KiB
Go
68 lines
2.5 KiB
Go
package db
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type SearchTarget struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
TargetURL string `json:"target_url"`
|
|
Platform string `json:"platform"` // 'linkedin', 'google_jobs', 'greenhouse', 'lever'
|
|
IsActive bool `json:"is_active"`
|
|
LastCrawledAt *time.Time `json:"last_crawled_at"`
|
|
}
|
|
|
|
type RawJob struct {
|
|
ID int64 `json:"id"`
|
|
CanonicalID string `json:"canonical_id"` // SHA256(company + title + applyURL)
|
|
TargetID *int64 `json:"target_id"`
|
|
Title string `json:"title"`
|
|
Company string `json:"company"`
|
|
Location string `json:"location"`
|
|
ApplyURL string `json:"apply_url"`
|
|
RawContent string `json:"raw_content"`
|
|
CrawledAt time.Time `json:"crawled_at"`
|
|
LastSeenAt time.Time `json:"last_seen_at"`
|
|
}
|
|
|
|
type Task struct {
|
|
ID int64 `json:"id"`
|
|
TaskType string `json:"task_type"` // 'DISCOVER', 'FETCH', 'PROCESS', 'ANALYZE'
|
|
Payload string `json:"payload"` // JSON string
|
|
Status string `json:"status"` // 'PENDING', 'RUNNING', 'COMPLETED', 'FAILED'
|
|
ErrorMessage string `json:"error_message"`
|
|
RetryCount int `json:"retry_count"`
|
|
NextRetryAt time.Time `json:"next_retry_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type JobAnalysis struct {
|
|
ID int64 `json:"id"`
|
|
RawJobID int64 `json:"raw_job_id"`
|
|
Score float64 `json:"score"`
|
|
IsQualified bool `json:"is_qualified"`
|
|
MatchedHighlights string `json:"matched_highlights"` // JSON array string
|
|
MissingHighlights string `json:"missing_highlights"` // JSON array string
|
|
TailoringSuggestions string `json:"tailoring_suggestions"` // JSON array string
|
|
Status string `json:"status"` // 'PENDING', 'PARSED', 'FILTERED_OUT', 'FAILED'
|
|
AnalyzedAt *time.Time `json:"analyzed_at"`
|
|
}
|
|
|
|
type JobApplication struct {
|
|
ID int64 `json:"id"`
|
|
RawJobID int64 `json:"raw_job_id"`
|
|
Status string `json:"status"` // 'SAVED', 'APPLIED', 'INTERVIEW', 'REJECTED', 'OFFER'
|
|
Notes string `json:"notes"`
|
|
AppliedAt *time.Time `json:"applied_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// JobWithAnalysis combines RawJob and JobAnalysis for UI rendering
|
|
type JobWithAnalysis struct {
|
|
RawJob
|
|
Analysis *JobAnalysis `json:"analysis"`
|
|
App *JobApplication `json:"application"`
|
|
}
|