Smart Contract: Approve and Reject Job Applications
Learn to extend our project further to approve, reject, and withdraw applications.
We'll cover the following
New features
In this lesson, we’ll be implementing the following two features:
Approve job applications as the job creator.
Reject or decline job applications as the job creator.
These new features are significant, but for them to work, we need to add a few minor ones.
New statuses for job offers: Job offers now will be in one of three states—open, filled, or closed. The last status is used if the creator wants to close the offer without filling the position. The default value once a new job is created will be
Open
.Confirm the status of a job before specific actions: We’ll add a check during job applications to confirm if the job being applied for is open before the application is created.
Feature enhancements: We’ll add two new fields called
numberOfMaxHires
andnumberHired
on theJobOffer
struct that lets the creator specify the maximum number of people that can be hired for this role and lets us track the number hired. Once this requirement is met, the job should automatically close and stop accepting responses.
Let’s get started.
Code changes
Get hands-on with 1400+ tech skills courses.