### Clone Repository and Setup Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/README.md Instructions for cloning the repository, installing dependencies, starting Docker containers, and running the development server. ```bash git clone https://github.com/your-username/ai-resume-backend.git cd ai-resume-backend npm install docker-compose up -d npm run start:dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/README.md Installs all necessary project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Start Development Server Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/README.md Starts the Vite development server for the React application. ```bash pnpm run dev ``` -------------------------------- ### Start PostgreSQL Container Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/DATABASE.md Use this command to start the PostgreSQL database container in detached mode for local development. ```bash docker compose up -d ``` -------------------------------- ### Implement Last-chance Cache Hook with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Guides Copilot to implement the useLastChanceCache hook for saving draft content on beforeunload and restoring it on mount, with clearing on successful save. ```copilot @workspace Implement src/features/ui/useLastChanceCache.ts with: useLastChanceCache(draftId, getContent, setContent). Save on beforeunload, show restore banner on mount, clear on successful save. ``` -------------------------------- ### Response Envelope Example Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Illustrates the standard JSON structure for successful API responses, including data, a request ID, and metadata. ```json { "data": { ... }, "requestId": "uuid", "meta": { ... } } ``` -------------------------------- ### Frontend Project Structure Reference Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md This is a reference structure for organizing frontend components and files. It includes directories for components, screens, and features, with examples of specific files and their purposes. ```tree src/ components/ ResultsWidget/ ResultsWidget.tsx // orchestrates cards with blur gating ResultCard.tsx // simple card UpgradeOverlay.tsx // blurred overlay + Upgrade CTA Editor/ ResumeEditor.tsx // rich editor (latest rewrite only) ModelDropdown.tsx // ChatGPT models (extensible) AiChangesPanel.tsx // "What AI changed" collapsible list CooldownTimer.tsx // mm:ss countdown, disables regenerate RewriteHeader.tsx // title rename, plan badge, model, actions Upload/ ResumeInput.tsx JdInput.tsx CheckScoreButton.tsx Dashboard/ DraftsTable.tsx // pagination, sort, search, status chips StatusChip.tsx TableToolbar.tsx QuickSwitcher.tsx // searchable dropdown to open any draft/finalized Common/ PageHeader.tsx ConfirmDialog.tsx // Save&Switch/Discard&Switch NameDraftModal.tsx ToastHost.tsx SkeletonCard.tsx screens/ TryPage.tsx UploadPage.tsx RewritePage.tsx GeneralBuilderPage.tsx DashboardPage.tsx AdminPage.tsx features/ session/ // plan, entitlements, quotas, flags entities/ // drafts, jobs (normalized) *optional advanced* drafts/ // actions/selectors for current draft jobs/ // job tracking (poll/SSE) ui/ // toasts, modals, cache presence tables/ // dashboard/admin table state ``` -------------------------------- ### Build Dashboard Drafts Table with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Guides Copilot to build the DraftsTable component for the dashboard, including features like pagination, sorting, search, status chips, tabs, and a soft delete action. ```copilot @workspace Build src/components/Dashboard/DraftsTable.tsx with pagination, sort, search, status chips, tabs Drafts/Finalized. Use shadcn Table primitives; Soft Delete action with confirm dialog. ``` -------------------------------- ### Implement Rewrite Header with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Guides Copilot to implement the RewriteHeader component with features like an inline title, plan badge, model dropdown, and a regenerate button with cooldown timer. ```copilot @workspace Implement src/components/Editor/RewriteHeader.tsx with: - inline title (opens NameDraftModal if empty) - plan badge - ModelDropdown - Regenerate button with CooldownTimer (disables during cooldown) - emit onSave/onMarkReady/onRegenerate events ``` -------------------------------- ### Generate Presigned S3 GET URL Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Generates a presigned URL for retrieving an object from an S3 bucket. Useful for temporary, secure file access. ```typescript const url = await s3.getSignedUrlPromise('getObject', { Bucket: bucket, Key: key, Expires: 900, }); ``` -------------------------------- ### Error Response Shape Example Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Defines the JSON structure for API errors, including an error code, message, optional details, and the request ID. ```json { "error": { "code": "QUOTA_EXCEEDED", "message": "...", "details": {...} }, "requestId": "uuid" } ``` -------------------------------- ### Run TypeORM Migrations Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/DATABASE.md Execute this command to apply all pending database migrations using TypeORM. ```bash npm run typeorm:migrate ``` -------------------------------- ### Create Rewrite Quick Switcher with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Instructs Copilot to create the QuickSwitcher component for the dashboard, enabling users to search and open drafts/finalized items via a command palette or dropdown. ```copilot @workspace Create src/components/Dashboard/QuickSwitcher.tsx: command palette or dropdown to search drafts/finalized by title/date/status and open into RewritePage. ``` -------------------------------- ### GET /jobs/:jobId Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Retrieves the status and result of a job. The response includes the job status (queued, running, completed, failed) and, if completed, the analysis result. ```APIDOC ## GET /jobs/:jobId ### Description Retrieves the status and result of a job. The response includes the job status (queued, running, completed, failed) and, if completed, the analysis result. ### Method GET ### Endpoint /jobs/:jobId ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the job to retrieve status for. ### Response #### Success Response (200) - **job** (object) - Contains job status information (queued|running|completed|failed). - **result** (object) - Optional - The analysis result if the job is completed. #### Response Example ```json { "job": { "status": "completed" }, "result": { "data": "analysis snippet or link" } } ``` ``` -------------------------------- ### HTTP Server Bootstrap with Pino, Helmet, and CORS Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md This snippet demonstrates how to bootstrap a NestJS application with Pino for logging, Helmet for security, and CORS for cross-origin requests. It includes configuration for trust proxy, global pipes, and filters. ```typescript async function bootstrap() { const app = await NestFactory.create(AppModule, { bufferLogs: true }); // Pino logger app.useLogger(app.get(PinoLogger)); // custom provider wrapping pino app.use(pinoHttp({ // request logs autoLogging: true, customProps: (req) => ({ requestId: req.id, userId: req.user?.id, }), })); // Trust proxy if behind NGINX app.set('trust proxy', 1); // Security hardening app.use(helmet()); app.enableCors({ origin: [process.env.APP_ORIGIN], // allowlist credentials: true, // cookies }); // Global pipes/filters app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); app.useGlobalFilters(new AllExceptionsFilter()); // ensures JSON error shape await app.listen(process.env.PORT || 3000); } bootstrap(); ``` -------------------------------- ### PostgreSQL Connection String Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/DATABASE.md The direct connection string for the PostgreSQL database. Alternatively, use environment variables for configuration. ```text postgresql://appuser:apppass@localhost:5433/appdb ``` ```text DB_HOST=localhost DB_PORT=5433 DB_USERNAME=appuser DB_PASSWORD=apppass DB_NAME=appdb ``` -------------------------------- ### Backend Folder Structure Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Illustrates the recommended directory layout for the NestJS backend application, including common modules, feature modules, and database-related directories. ```tree /src app.module.ts /config/ # env & config factories /common/ # shared code (no feature logic) /logging/ # pino logger module + http middleware /security/ # helmet, cors, csrf (if cross-site), throttler /guards/ # auth/ownership guards /interceptors/ # response shaping, timeout /types/ # shared enums/types/utils /modules/ # ⬅️ all feature modules live here /auth/ auth.module.ts auth.controller.ts auth.service.ts dto/ strategies/ # jwt/refresh strategies guards/ /users/ users.module.ts users.controller.ts users.service.ts dto/ entities/ # (option A) co-locate entity /drafts/ drafts.module.ts drafts.controller.ts drafts.service.ts dto/ entities/ /analyses/ analyses.module.ts analyses.controller.ts analyses.service.ts dto/ entities/ /rewrites/ /exports/ /files/ /jobs/ # BullMQ queues + processors + Job entity /admin/ /mailer/ # SES mailer service + templates /scheduler/ # cron; EventBridge adapter later /database /entities/ # (option B) keep entities centralized /migrations/ ``` -------------------------------- ### Create AI Changes Panel with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Instructs Copilot to create the AiChangesPanel component, specifying its props and behavior for collapsible sections with URL hash state persistence. ```copilot @workspace Create src/components/Editor/AiChangesPanel.tsx. Props: sections with lists of improvements. Collapsible per section; remember open state in URL hash. ``` -------------------------------- ### Build Results Widget with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Instructs Copilot to build the ResultsWidget component, including rendering specific cards, handling entitlement gating, and managing loading, error, and retry states. ```copilot @workspace Build src/components/ResultsWidget/ResultsWidget.tsx per frontend-instructions.md. Render ATS, Match, Missing Skills, Section Suggestions cards. Blur non-entitled cards and overlay Upgrade CTA. Add loading + error + Retry states. ``` -------------------------------- ### BullMQ Processor Skeleton for Analysis Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md A basic structure for a BullMQ processor that handles analysis jobs. Includes placeholders for job state management and persistence. ```typescript @Processor('analysis.run') export class AnalysisProcessor { @Process() async handle(job: Job) { // set Job.running, startedAt // perform work // persist Analysis, update Draft.status & latest_analysis_id // set Job.completed, finishedAt } ``` -------------------------------- ### API Endpoints for Finalize and Export Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Defines the API endpoints for finalizing a resume and exporting it in various formats (PDF, DOCX), and retrieving download links for exports. ```http # Finalize / Export POST /drafts/:id/finalize # body: { format: 'PDF'|'DOCX' } → { jobId } GET /exports/:exportId # { downloadUrl, expiresAt } ``` -------------------------------- ### Implement Job Tracking Hook with Copilot Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md Instructs Copilot to implement the useJobTracking hook for polling job status, persisting job IDs, dispatching updates, and showing notifications. ```copilot @workspace Implement src/features/jobs/useJobTracking.ts: poll /jobs/{id} every 3s (flag: SSE/WebSocket), persist jobId in localStorage, dispatch updates, toast "Result ready" with View action to open the draft. ``` -------------------------------- ### Ownership Guard Logic Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Comment outlining the logic for an ownership guard, allowing access if the user is the owner or a guest session matches. ```typescript // Allow if draft.userId === req.user.id OR draft.guestSessionId === req.cookies['guest_draft_id'] ``` -------------------------------- ### API Endpoints for Rewrite Functionality Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Outlines the API endpoints for initiating and retrieving the status of resume rewriting tasks, including specifying the model to use. ```http # Rewrite POST /drafts/:id/rewrite # body: { model, ... } → { jobId, cooldownUntil? } GET /drafts/:id/rewrite ``` -------------------------------- ### Rewrite Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Endpoints for initiating and retrieving information about resume rewrites. ```APIDOC ## POST /drafts/:id/rewrite ### Description Initiates a rewrite for a specific draft resume, potentially with model selection. ### Method POST ### Endpoint /drafts/:id/rewrite ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to rewrite. ### Request Body - **model** (string) - Required - The model to use for rewriting. - **...** (any) - Optional - Additional parameters for the rewrite. ### Response #### Success Response (200) - **jobId** (string) - The ID of the rewrite job. - **cooldownUntil** (string) - Optional - Timestamp indicating when the rewrite can be retried. ``` ```APIDOC ## GET /drafts/:id/rewrite ### Description Retrieves information about a previous rewrite for a specific draft resume. ### Method GET ### Endpoint /drafts/:id/rewrite ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft whose rewrite information is requested. ### Response (Details not provided in source) ``` -------------------------------- ### Normalized Frontend State Shape (Recommended for Scale) Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-frontend/docs/frontend-instructions.md An optional, normalized state shape recommended for scaling applications. It organizes entities and views for better manageability. ```typescript * entities.drafts.byId/ids with resumeText, jdText, latestRewriteText, dirty, cooldownUntil * entities.jobs.byId/ids, plus jobsIndex.byDraft map * ui.lastChanceCache[draftId] = true per draft * views.dashboard.table, views.admin.table etc. ``` -------------------------------- ### API Endpoints for Analysis and Jobs Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Details the API endpoints for initiating resume analysis and retrieving job status and results. Supports polling for job completion. ```http # Analysis POST /drafts/:id/analysis # → { jobId } GET /jobs/:jobId # → { job, result? } # (optional later) GET /jobs/:jobId/stream # SSE ``` -------------------------------- ### Generate TypeORM Migration Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/DATABASE.md Command to generate a new migration file using TypeORM. Replace 'MyMigrationName' with your desired migration name. ```bash npm run typeorm:gen MyMigrationName ``` -------------------------------- ### Admin Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Administrative endpoints for system overview, job retries, and user plan management. ```APIDOC ## GET /admin/overview ### Description Retrieves an overview of the system's administrative status. ### Method GET ### Endpoint /admin/overview ### Response (Details not provided in source) ``` ```APIDOC ## POST /admin/jobs/:id/retry ### Description Retries a failed administrative job. ### Method POST ### Endpoint /admin/jobs/:id/retry ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the job to retry. ### Response (Details not provided in source) ``` ```APIDOC ## PATCH /admin/users/:id/plan ### Description Updates the plan for a specific user. ### Method PATCH ### Endpoint /admin/users/:id/plan ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the user whose plan to update. ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## PATCH /admin/flags/:key ### Description Updates a feature flag. ### Method PATCH ### Endpoint /admin/flags/:key ### Parameters #### Path Parameters - **key** (string) - Required - The key of the feature flag to update. ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` -------------------------------- ### Visitor Postman Verification - Analysis Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Verify that a Visitor can successfully POST to the /drafts/:id/analysis endpoint. This confirms access to ATS-related functionality. ```json { "request": { "method": "POST", "url": "/drafts/:id/analysis" }, "response": { "status": 200 } } ``` -------------------------------- ### Idempotency Key Handling Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Comment describing the process for handling idempotency keys to prevent duplicate operations. Involves reading a header and upserting a job. ```typescript // Read 'Idempotency-Key' header, upsert Job with meta.idemKey, return existing job if found ``` -------------------------------- ### Set HTTP Cookies for Authentication Tokens Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Sets 'access_token' and 'refresh_token' cookies with appropriate security and expiration settings. Use for user login and session management. ```typescript res.cookie('access_token', accessToken, { httpOnly: true, secure: true, sameSite: 'lax', path: '/', maxAge: 15*60*1000, }); res.cookie('refresh_token', refreshToken, { httpOnly: true, secure: true, sameSite: 'lax', path: '/auth/refresh', maxAge: 14*24*60*60*1000, }); ``` -------------------------------- ### API Endpoints for Authentication Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Defines the HTTP methods and paths for user authentication operations including registration, login, refresh, logout, and retrieving user information. ```http # Auth (cookies; no tokens in body) POST /auth/register POST /auth/login POST /auth/refresh POST /auth/logout GET /auth/me ``` -------------------------------- ### Uploads Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Endpoint for obtaining a presigned URL for uploading files. ```APIDOC ## POST /uploads/presign ### Description Requests a presigned URL for uploading a file to S3. ### Method POST ### Endpoint /uploads/presign ### Request Body - **kind** (string) - Required - The type of file being uploaded. - **mime** (string) - Required - The MIME type of the file. - **size** (integer) - Required - The size of the file in bytes. ### Response #### Success Response (200) - **url** (string) - The presigned URL for the upload. - **fields** (object) - Additional fields required for the upload. ``` -------------------------------- ### Pro User Postman Verification - Finalize Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Verify that a Pro user can successfully POST to the /drafts/:id/finalize endpoint. This confirms that users with the EXPORT entitlement are granted access. ```json { "request": { "method": "POST", "url": "/drafts/:id/finalize" }, "response": { "status": 202 } } ``` -------------------------------- ### API Endpoints for Draft Management Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Specifies the API endpoints for managing draft resumes, including creating, retrieving, updating, and deleting drafts. ```http # Drafts POST /drafts GET /drafts?status=&q=&pageSize= GET /drafts/:id PATCH /drafts/:id DELETE /drafts/:id ``` -------------------------------- ### Database Health Check Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/DATABASE.md Use this cURL command to check the status of the database connection. Expect a JSON response indicating the database status. ```bash curl http://localhost:3000/healthz ``` ```json { "ok": true, "db": "up" } ``` -------------------------------- ### Analysis Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Endpoints for initiating and monitoring the analysis of draft resumes. ```APIDOC ## POST /drafts/:id/analysis ### Description Initiates an analysis for a specific draft resume. ### Method POST ### Endpoint /drafts/:id/analysis ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to analyze. ### Request Body (Details not provided in source) ### Response #### Success Response (200) - **jobId** (string) - The ID of the analysis job. ``` ```APIDOC ## GET /jobs/:jobId ### Description Retrieves the status and result of an analysis job. ### Method GET ### Endpoint /jobs/:jobId ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the job to retrieve. ### Response #### Success Response (200) - **job** (object) - Details about the job. - **result** (any) - Optional - The result of the job if completed. ``` -------------------------------- ### API Endpoints for Admin Operations Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Lists the API endpoints available for administrative tasks, such as retrieving overview data, retrying jobs, managing user plans, and feature flags. ```http # Admin GET /admin/overview POST /admin/jobs/:id/retry PATCH /admin/users/:id/plan PATCH /admin/flags/:key ``` -------------------------------- ### Auth Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Endpoints for user authentication, including registration, login, token refresh, logout, and retrieving current user information. Authentication is handled via cookies. ```APIDOC ## POST /auth/register ### Description Registers a new user. ### Method POST ### Endpoint /auth/register ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## POST /auth/login ### Description Logs in an existing user. ### Method POST ### Endpoint /auth/login ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## POST /auth/refresh ### Description Refreshes the user's authentication token. ### Method POST ### Endpoint /auth/refresh ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## POST /auth/logout ### Description Logs out the current user. ### Method POST ### Endpoint /auth/logout ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## GET /auth/me ### Description Retrieves information about the currently authenticated user. ### Method GET ### Endpoint /auth/me ### Response (Details not provided in source) ``` -------------------------------- ### Visitor Postman Verification - Finalize Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Verify that a Visitor receives a 403 Forbidden response when attempting to POST to the /drafts/:id/finalize endpoint. This confirms the EXPORT entitlement is correctly enforced. ```json { "request": { "method": "POST", "url": "/drafts/:id/finalize" }, "response": { "status": 403 } } ``` -------------------------------- ### POST /drafts/:id/analysis Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Initiates an analysis for a specific draft. It supports idempotency using the 'Idempotency-Key' header and returns a job ID for status polling. Ownership and visitor access checks are performed. ```APIDOC ## POST /drafts/:id/analysis ### Description Initiates an analysis for a specific draft. Supports idempotency via the 'Idempotency-Key' header and returns a job ID for status polling. Ownership and visitor access checks are performed. ### Method POST ### Endpoint /drafts/:id/analysis ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to analyze. #### Headers - **Idempotency-Key** (string) - Optional - Used to ensure the request is processed only once. ### Request Example ```json { "example": "POST /drafts/123/analysis" } ``` ### Response #### Success Response (200) - **jobId** (string) - The ID of the job created for the analysis. #### Response Example ```json { "jobId": "job-abc-123" } ``` ``` -------------------------------- ### API Endpoints for File Uploads Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Specifies the API endpoint for obtaining presigned URLs and fields required for uploading files, typically for resume attachments. ```http # Files (optional presign) POST /uploads/presign # { kind, mime, size } → { url, fields } ``` -------------------------------- ### Drafts Endpoints Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/resume-screener-backend/docs/backend-instructions.md Endpoints for managing draft resumes, including creation, retrieval, updating, and deletion. ```APIDOC ## POST /drafts ### Description Creates a new draft resume. ### Method POST ### Endpoint /drafts ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## GET /drafts ### Description Retrieves a list of drafts, with optional filtering and pagination. ### Method GET ### Endpoint /drafts ### Query Parameters - **status** (string) - Optional - Filter by status. - **q** (string) - Optional - Search query. - **page** (integer) - Optional - Page number. - **pageSize** (integer) - Optional - Number of items per page. ### Response (Details not provided in source) ``` ```APIDOC ## GET /drafts/:id ### Description Retrieves a specific draft resume by its ID. ### Method GET ### Endpoint /drafts/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to retrieve. ### Response (Details not provided in source) ``` ```APIDOC ## PATCH /drafts/:id ### Description Updates an existing draft resume. ### Method PATCH ### Endpoint /drafts/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to update. ### Request Body (Details not provided in source) ### Response (Details not provided in source) ``` ```APIDOC ## DELETE /drafts/:id ### Description Deletes a draft resume. ### Method DELETE ### Endpoint /drafts/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the draft to delete. ### Response (Details not provided in source) ``` -------------------------------- ### Update /auth/me Endpoint Source: https://github.com/ubaidurrehmankhan/resume-screener-ai/blob/main/docs/sprints/sprint-current.md Modify the /auth/me endpoint to include the user's entitlements in the response. This allows clients to be aware of the user's permissions. ```typescript @Get('/me') @ApiOkResponse({ type: UserProfileDto }) async me(@Req() request: Request): Promise { const user = request.user; const entitlements = await this.entitlementsService.resolve(user); return { ...user, entitlements: Array.from(entitlements) }; } ```