Add application workflow and lead analytics
Test and publish / test (push) Successful in 2m33s
Test and publish / publish (push) Successful in 11m9s

This commit is contained in:
2026-10-23 20:45:48 +01:00
parent d0074aea46
commit 1147bc5697
35 changed files with 4337 additions and 131 deletions
+40 -12
View File
@@ -97,18 +97,46 @@ type ProcessedEmail struct {
// postings are usually taken down long before the interview. It is large, so
// list queries should not select it.
type JobApplication struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
JobTitle string `gorm:"not null" json:"jobTitle"`
Company string `gorm:"not null" json:"company"`
Location *string `json:"location"`
URL *string `json:"url"`
Status string `gorm:"not null" json:"status"`
Notes *string `json:"notes"`
AppliedAt *time.Time `json:"appliedAt"`
Description *string `gorm:"type:text" json:"description"`
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
JobTitle string `gorm:"not null" json:"jobTitle"`
Company string `gorm:"not null" json:"company"`
Location *string `json:"location"`
URL *string `json:"url"`
Status string `gorm:"not null" json:"status"`
Notes *string `json:"notes"`
AppliedAt *time.Time `json:"appliedAt"`
Description *string `gorm:"type:text" json:"description"`
NextAction *string `json:"nextAction"`
NextActionAt *time.Time `json:"nextActionAt"`
ContactName *string `json:"contactName"`
ContactEmail *string `json:"contactEmail"`
ContactRole *string `json:"contactRole"`
SalaryRange *string `json:"salaryRange"`
WorkArrangement *string `json:"workArrangement"`
ApplicationSource *string `json:"applicationSource"`
ResumeVersion *string `json:"resumeVersion"`
RequisitionID *string `json:"requisitionId"`
LastContactedAt *time.Time `json:"lastContactedAt"`
Events []*JobApplicationEvent `gorm:"foreignKey:JobApplicationID" json:"events,omitempty"`
}
// JobApplicationEvent is an append-only audit entry for a tracked application.
// Contact fields are copied onto the event so a later contact edit does not
// rewrite the history of who was involved at the time.
type JobApplicationEvent struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"createdAt"`
JobApplicationID uint `gorm:"index;not null" json:"jobApplicationId"`
Kind string `gorm:"not null;index" json:"kind"`
OccurredAt time.Time `gorm:"not null;index" json:"occurredAt"`
Note *string `gorm:"type:text" json:"note"`
Source string `gorm:"not null;default:manual" json:"source"`
ContactName *string `json:"contactName"`
ContactEmail *string `json:"contactEmail"`
ContactRole *string `json:"contactRole"`
}
// JobSource is one place the lead fetcher (services/job_leads.go) polls for