// Package sourcing serves externally sourced candidates and the compliance log, and provides the // delete path for any sourced record. It is tenant scoped: every read and the delete run inside a // tenant transaction so Row Level Security isolates each org. Clearance is never shown for these // records (it is unknown by design); they are labeled External and carry a compliance trail. package sourcing // ExternalCandidate is a sourced lead stored in the candidates table. type ExternalCandidate struct { ID string `json:"id"` FullName string `json:"full_name"` Email string `json:"email"` // may be empty if not provided in the source data Headline string `json:"headline"` Location string `json:"location"` YearsExperience int `json:"years_experience"` Available bool `json:"available"` ExternalID string `json:"external_id"` Source string `json:"source"` // always External Clearance string `json:"clearance"` // always Unknown for sourced records CreatedAt string `json:"created_at"` } // SourcingLogEntry is one compliance row. type SourcingLogEntry struct { ID string `json:"id"` CandidateID string `json:"candidate_id"` // empty after the candidate is deleted ExternalID string `json:"external_id"` Source string `json:"source"` Provider string `json:"provider"` Query string `json:"query"` LegalBasis string `json:"legal_basis"` CollectedAt string `json:"collected_at"` }