Skip to content

Instantly share code, notes, and snippets.

@pdbradley
Last active June 25, 2020 20:01
Show Gist options
  • Save pdbradley/e39c51b043bc27a27e8a8f3ccc49a7a4 to your computer and use it in GitHub Desktop.
Save pdbradley/e39c51b043bc27a27e8a8f3ccc49a7a4 to your computer and use it in GitHub Desktop.
stories re jobs and caregivers
Here are some stories:
An employer logs in and creates a Job and fills in the various criteria. This job belongs_to an employer, but does not belong_to a caregiver YET.
job
name: Home Nursing A
belongs_to employer A
Based on the criteria defined in the job, you can now create JobOpportunities for every caregiver that matches
job_opportunity_1
caregiver: caregiver A
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
job_opportunity_2
caregiver: caregiver B
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
job_opportunity_3
caregiver: caregiver C
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
The caregivers each can log in and see their specific JobOpportunities and then accept / reject them.
this could be boolean like 'accepted' or a status field with values like 'viewed' 'not_interested' 'interested'
job_opportunity_1
caregiver: caregiver A
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
status: 'viewed'
job_opportunity_2
caregiver: caregiver B
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
status: 'declined'
job_opportunity_3
caregiver: caregiver C
job: home nursing A above
employer: employer A above (this could be THROUGH the job and not direct actually)
status: 'interested'
The employer can now see any caregivers that are interested because they are associated with the job opportunities
job.job_opportunities.where(status: 'interested')
And when the employer "hires" one, that caregiver now is attached to the original job:
job
name: Home Nursing A
belongs_to employer A
belongs_to caregiver C
@pdbradley
Copy link
Author

so basically the first thing created is a Job, which is presented to caregivers as a JobOpportunity just for them. And when the employer agrees to hire, that caregiver is attached to the original Job which makes it sort of a contract, a real job.

I don't think you need an AssignedJob model or anything like that.

you can have a method in the Job class:

def assigned?
  caregiver
end

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