Split the job tracker out of web_server into its own app
The applications tracker, leads inbox, email pipeline and capture userscript move here from web_server's backend, Python service and Vue app, as one Go binary that serves its own Vue SPA under /jobs/. - The Go services, resolvers and tests move over almost unchanged. - The three Claude calls are ported from Python to Go (internal/claude), with the same prompts, per-model request shaping and error messages. - There is no login: internal/auth asks the site backend's /auth/validate-admin with the visitor's cookies, and relays refreshed cookies back. - A Settings page replaces the admin-panel capture token card and adds the Microsoft sign-in link and a manual email sync. - The userscript is 2.0.0, at /jobs/, and migrates a saved API base. - Dockerfile, a standalone compose with Postgres, Makefile, and a Gitea CI workflow that tests and publishes the image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Job applications for the tracker at /jobs/ — CRUD built on
|
||||
* createCrudStore(), plus the on-demand posting text.
|
||||
*
|
||||
* Admin-only on the server, and only that one page uses it, so nothing fetches
|
||||
* it until the view mounts.
|
||||
*/
|
||||
|
||||
import { createCrudStore } from "@/stores/createCrudStore";
|
||||
import { gql } from "@/graphql";
|
||||
|
||||
// `description` is deliberately not here: it is the full text of the posting,
|
||||
// tens of kilobytes a row, and is fetched per row when asked for.
|
||||
const APP_FIELDS = `id jobTitle company location url status notes appliedAt createdAt updatedAt`;
|
||||
|
||||
export const useJobApplicationsStore = createCrudStore("jobApplications", {
|
||||
type: "JobApplication",
|
||||
list: "jobApplications",
|
||||
itemsKey: "applications",
|
||||
fields: APP_FIELDS,
|
||||
insert: "prepend",
|
||||
// deleteJobApplication returns Boolean!, and errors for an id that is gone.
|
||||
deleteReturns: "boolean",
|
||||
extend: () => ({
|
||||
/**
|
||||
* The captured posting text for one row; `""` when none was saved. Throws
|
||||
* on failure. Not cached here: the view keeps its own per-visit cache, so
|
||||
* returning to the page re-reads a posting the userscript may have
|
||||
* replaced.
|
||||
*/
|
||||
async fetchDescription(id) {
|
||||
const data = await gql(
|
||||
`query JobDescription($id: ID!) { jobApplication(id: $id) { description } }`,
|
||||
{ id },
|
||||
);
|
||||
return data.jobApplication?.description ?? "";
|
||||
},
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user