@hadoku/jobplatform-worker 2.32.35 → 2.32.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ -- V5 pipeline: what happens to an application after it is sent.
2
+ --
3
+ -- job_states already says where a posting stands for one person. V5 adds the
4
+ -- states past "applied" (interviewing / offered / rejected — the column is
5
+ -- free TEXT by design, see 0005, so those are a code-only change), the facts a
6
+ -- person tracks per application, and an append-only timeline.
7
+ --
8
+ -- The tracking columns live on job_states rather than a table of their own
9
+ -- because they mean nothing without a state: a posting is in someone's
10
+ -- pipeline exactly when it has a job_states row, and that row is also what
11
+ -- makes the posting immune to the daily cull (ingest.ts cullExpired), so a
12
+ -- listing that closes while you are interviewing stays readable.
13
+ --
14
+ -- priority 1 high · 2 normal · 3 low; NULL = unset
15
+ -- follow_up_at the date (YYYY-MM-DD) the person means to chase it
16
+ -- contact_name / contact_email
17
+ -- the recruiter or hiring manager, as the person wrote it down
18
+ ALTER TABLE job_states ADD COLUMN priority INTEGER;
19
+ ALTER TABLE job_states ADD COLUMN follow_up_at TEXT;
20
+ ALTER TABLE job_states ADD COLUMN contact_name TEXT;
21
+ ALTER TABLE job_states ADD COLUMN contact_email TEXT;
22
+
23
+ -- The timeline. One row per thing that happened, never updated:
24
+ --
25
+ -- kind = 'state' written by PUT /jobs/:id/state when the state CHANGES
26
+ -- (from_state → to_state; from_state NULL = was new)
27
+ -- kind = 'note' | 'interview' | 'contact' | 'follow_up'
28
+ -- written by the person (POST /jobs/:id/events), with
29
+ -- occurred_at as they give it — an interview logged the
30
+ -- evening after happened that morning.
31
+ --
32
+ -- Only person-written rows can be deleted; a state row is the record of a
33
+ -- transition and goes only with the job or the person (erase hook).
34
+ CREATE TABLE IF NOT EXISTS job_events (
35
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
36
+ job_id TEXT NOT NULL,
37
+ user_id TEXT NOT NULL,
38
+ kind TEXT NOT NULL,
39
+ from_state TEXT,
40
+ to_state TEXT,
41
+ note TEXT,
42
+ occurred_at TEXT NOT NULL,
43
+ created_at TEXT NOT NULL,
44
+ FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE
45
+ );
46
+
47
+ -- One job's timeline, and the cascade from jobs (job_id leads neither of the
48
+ -- other two, and an unindexed cascade is what 0027 had to fix).
49
+ CREATE INDEX IF NOT EXISTS idx_job_events_job ON job_events(job_id, user_id, occurred_at);
50
+ -- Insights: one person's transitions over time.
51
+ CREATE INDEX IF NOT EXISTS idx_job_events_user ON job_events(user_id, kind, occurred_at);
@@ -0,0 +1,18 @@
1
+ -- Companies a person never wants in their feed (from the JobPulse merge, where
2
+ -- it was a localStorage list on one machine).
3
+ --
4
+ -- Keyed by LOWER(TRIM(company)), computed in SQL on both sides — at insert and
5
+ -- in the feed's NOT EXISTS — so the key and the comparison cannot disagree
6
+ -- about case folding (SQLite's LOWER folds ASCII only; doing it in JS on one
7
+ -- side would not match the other for a non-ASCII name). `company` keeps the
8
+ -- spelling the person blocked, for display.
9
+ --
10
+ -- A filter on the feed only: a blocked employer's postings stay in the shared
11
+ -- corpus, and anything already in the person's pipeline stays there.
12
+ CREATE TABLE IF NOT EXISTS blocked_companies (
13
+ user_id TEXT NOT NULL,
14
+ company_key TEXT NOT NULL,
15
+ company TEXT NOT NULL,
16
+ created_at TEXT NOT NULL,
17
+ PRIMARY KEY (user_id, company_key)
18
+ );
@@ -0,0 +1,13 @@
1
+ -- Where each posting is, as the places its free-text location names, for the
2
+ -- feed's radius filter (near= / radius_miles=). Written at ingest by
3
+ -- geo.ts `geoKeys` and backfilled by POST /ingest/backfill-geo:
4
+ --
5
+ -- '|san-francisco-ca|new-york-ny|' every known place the string names
6
+ -- '' read, and no known place in it
7
+ -- NULL not read yet — backfill pending
8
+ --
9
+ -- Pipe-delimited so the feed can test membership with one LIKE per nearby
10
+ -- place ('%|seattle-wa|%') against a short list it computes from the radius.
11
+ -- No index: the filter runs per candidate row alongside the feed's other
12
+ -- WHERE terms, and a leading-wildcard LIKE could not use one anyway.
13
+ ALTER TABLE jobs ADD COLUMN geo_keys TEXT;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/jobplatform-worker",
3
- "version": "2.32.35",
4
- "gitHead": "e16c45d8f76063779904a75c3115f33668a69438",
3
+ "version": "2.32.37",
4
+ "gitHead": "808b4a95842c638f0d1840d97203dcc06383d710",
5
5
  "description": "Job listings aggregation and tracking dashboard - Worker package",
6
6
  "license": "MIT",
7
7
  "type": "module",