Add jobs API: listings, applications, and emails - #269
Merged
Conversation
Volunteer job board backend for /jobs on the frontend. New api/jobs blueprint with public listing routes, login-required apply routes (signed-URL PDF resume upload, server-side URL verification, reCAPTCHA, duplicate check), and volunteer.admin CRUD + one-click accept/reject decision emails. Confirmation email carries a reply-within-5-days ask; every application also sends an FYI to questions@ohack.org. Includes validators, 300s caches, and an idempotent seed script for the three Fall 2026 roles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Frontend PR: opportunity-hack/frontend-ohack.dev#352 — deploy this backend PR first. |
| data = request.get_json() or {} | ||
| payload, status = create_resume_upload_url( | ||
| auth_user.user_id, data.get("content_type"), data.get("content_length")) | ||
| return payload, status |
| def admin_post_listing(): | ||
| logger.info("POST /jobs/admin/listings called") | ||
| payload, status = admin_create_listing(request.get_json(), _actor_from_request()) | ||
| return payload, status |
| def admin_patch_listing(slug): | ||
| logger.info(f"PATCH /jobs/admin/listings/{slug} called") | ||
| payload, status = admin_update_listing(slug, request.get_json(), _actor_from_request()) | ||
| return payload, status |
| logger.info(f"POST /jobs/{slug}/apply called") | ||
| payload, status = submit_application( | ||
| auth_user.user_id, request.remote_addr, slug, request.get_json()) | ||
| return payload, status |
| def admin_post_listing(): | ||
| logger.info("POST /jobs/admin/listings called") | ||
| payload, status = admin_create_listing(request.get_json(), _actor_from_request()) | ||
| return payload, status |
| def admin_patch_listing(slug): | ||
| logger.info(f"PATCH /jobs/admin/listings/{slug} called") | ||
| payload, status = admin_update_listing(slug, request.get_json(), _actor_from_request()) | ||
| return payload, status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend for the new volunteer job board at ohack.dev/jobs. Frontend PR is linked in the comments.
What this adds
job_listings(doc id = URL slug) andjob_applicationsvolunteer.admin): create/edit/hide/delete listings, review applications, and send a one-click accept or kind rejection email (with an optional personal note)Emails (Resend)
ENVIRONMENT=testSafety checks on submit
Seeding
python scripts/seed_job_listings.py --applywrites the three Fall 2026 roles as drafts. It skips roles that already exist, so admin edits are safe.Testing
38 checks pass against MockFirestore covering the full lifecycle: create → publish → apply → duplicate 409 → confirm → kind rejection, plus auth gates and validator edge cases.
🤖 Generated with Claude Code