Skip to content

feat(jobs): allow users to withdraw job applications (Fixes #171)#317

Open
Ishant5436 wants to merge 8 commits into
algora-io:mainfrom
Ishant5436:fix-withdraw-application
Open

feat(jobs): allow users to withdraw job applications (Fixes #171)#317
Ishant5436 wants to merge 8 commits into
algora-io:mainfrom
Ishant5436:fix-withdraw-application

Conversation

@Ishant5436
Copy link
Copy Markdown

Summary

Users currently have no option to withdraw a submitted job application. This PR adds:

Changes

  1. Jobs.withdraw_application/2 — New context function that hard-deletes a user's pending application for a given job. The existing unique_constraint([:job_id, :user_id]) allows clean re-application after withdrawal.

  2. UI (jobs_live.ex) — Replaced the disabled 'Applied' button with a red 'Withdraw' button that calls the new withdraw_job LiveView event.

  3. Event handlers — Added withdraw_job handlers in all three LiveViews (jobs_live, home_live, platform_live) with proper error handling and flash messages.

Design Decision: Hard Delete vs Soft Delete

Chose hard delete (Repo.delete) over soft delete for simplicity:

  • The schema status enum only has [:pending] — adding :withdrawn would require a migration
  • Hard delete allows clean re-application via the existing unique constraint
  • No business requirement to track withdrawn applications was mentioned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant