feat: new notes start with status new for tracking applications

This commit is contained in:
2026-11-25 10:38:01 +01:00
parent cc7bb4212e
commit 50382c0c10
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -252,7 +252,7 @@ func TestRenderNote(t *testing.T) {
} }
note := renderNote(pkg, "https://x.test/job", time.Date(2026, 11, 24, 10, 0, 0, 0, time.UTC)) note := renderNote(pkg, "https://x.test/job", time.Date(2026, 11, 24, 10, 0, 0, 0, time.UTC))
for _, want := range []string{ for _, want := range []string{
"moc: \"[[00-Job Hunt]]\"\ncreated: 2026-11-24\ncompany: \"Acme\"\nrole: \"Backend Engineer\"\nfit: 82\nverdict: \"apply\"\nlocation: \"Utrecht\"\nposting: \"https://x.test/job\"\n---", "# Acme - Backend Engineer", "- [ ] Review and decide: **apply**, fit 82/100", "moc: \"[[00-Job Hunt]]\"\ncreated: 2026-11-24\ncompany: \"Acme\"\nrole: \"Backend Engineer\"\nfit: 82\nverdict: \"apply\"\nlocation: \"Utrecht\"\nposting: \"https://x.test/job\"\nstatus: \"new\"\n---", "# Acme - Backend Engineer", "- [ ] Review and decide: **apply**, fit 82/100",
"- **Posting:** https://x.test/job", "## Strengths\n- Go at Ghaaf", "## Gaps\n- No Dutch", "- **Posting:** https://x.test/job", "## Strengths\n- Go at Ghaaf", "## Gaps\n- No Dutch",
"## Cover letter draft\nDear hiring team,", "## Related\n- [[00-Job Hunt|Job Hunt]]\n- [[CV]]", "## Cover letter draft\nDear hiring team,", "## Related\n- [[00-Job Hunt|Job Hunt]]\n- [[CV]]",
} { } {
+3 -2
View File
@@ -53,11 +53,12 @@ func yamlString(s string) string {
// renderNote writes the package as a vault note: frontmatter, plain title, a // renderNote writes the package as a vault note: frontmatter, plain title, a
// Related section at the end. The properties after `created` are the columns // Related section at the end. The properties after `created` are the columns
// of the vault's "Job Hunt" base (the table of all postings). // of the vault's "Job Hunt" base (the table of all postings). `status` starts
// as "new"; the user changes it by hand (applied, interview, ...).
func renderNote(pkg *Package, url string, now time.Time) string { func renderNote(pkg *Package, url string, now time.Time) string {
var b strings.Builder var b strings.Builder
fmt.Fprintf(&b, "---\nmoc: \"[[00-Job Hunt]]\"\ncreated: %s\n", now.Format("2006-01-02")) fmt.Fprintf(&b, "---\nmoc: \"[[00-Job Hunt]]\"\ncreated: %s\n", now.Format("2006-01-02"))
fmt.Fprintf(&b, "company: %s\nrole: %s\nfit: %d\nverdict: %s\nlocation: %s\nposting: %s\n---\n\n", fmt.Fprintf(&b, "company: %s\nrole: %s\nfit: %d\nverdict: %s\nlocation: %s\nposting: %s\nstatus: \"new\"\n---\n\n",
yamlString(pkg.Company), yamlString(pkg.Title), pkg.FitScore, yamlString(strings.ToLower(pkg.Verdict)), yamlString(pkg.Company), yamlString(pkg.Title), pkg.FitScore, yamlString(strings.ToLower(pkg.Verdict)),
yamlString(pkg.Location), yamlString(url)) yamlString(pkg.Location), yamlString(url))
fmt.Fprintf(&b, "# %s\n\n", noteName(pkg)) fmt.Fprintf(&b, "# %s\n\n", noteName(pkg))