Limit Medical Certificate Uploads Per Month
TL;DR
- Each applicant can upload a limited number of Medical Certificates (MC) per calendar month.
- The limit is a value in the table
configurations. - The system counts the applicant's
account_suspensionsrows withdocument_uploaded_atin the current month. - When the count already reaches the limit, the system rejects the new MC automatically.
- The APP and the web app show the applicant how many MCs they uploaded this month.
- The APP and the web app warn the applicant at the limit.
- The APP and the web app never block the cancellation, even when the MC will be rejected.
- OPS can filter the MCs the system rejected in the portal.
Words used in this doc
| Word | Meaning |
|---|---|
| Applicant | A jodder who applied to a gig job, and the hiring manager selected them |
| Medical Certificate (MC) | The document an applicant uploads to explain a late cancellation |
| OPS | The internal Jod team that reviews each MC |
| APP | The mobile app for applicants |
| Web app | The repo jodgig-web-applicant, the browser version of the APP for applicants |
| Calendar month | The 1st to the last day of a month, in Singapore time |
The table account_suspensions | One row per cancellation that puts an applicant at risk of suspension |
The table configurations | Key and value settings that the backend reads at runtime, found by config_key |
Problem
Some applicants cancel a job late and upload an MC many times in one month.
- An MC is easy to buy online, so an upload does not prove the applicant was sick.
- OPS spends much time on these MCs.
The data shows that a small group of applicants cancels more than 3 times a month.
| Measure | Range | Source |
|---|---|---|
| Users who cancel more than 3 times in a month | 11 to 52, about 29 a month | BI question 397: users who cancel more than 3 times |
| Their share of all users who cancelled that month | About 4% to 13%, average about 7.6% | BI question 397: users who cancel more than 3 times |
User stories
- US-1: As OPS, I want the system to reject an MC over the limit, so my queue holds real cases.
- US-2: As product, I want to change the limit without a deploy, so we can tune it.
- US-3: As an applicant, I want to see how many MCs I uploaded this month, so I know my limit.
- US-4: As an applicant, I want a warning before the system rejects my MC, so I am not surprised.
- US-5: As an applicant, I want to cancel even over the limit, so I am not forced to attend.
- US-6: As OPS, I want to filter the MCs the system rejected, so I see them apart from mine.
- US-7: As OPS, I want the upload count next to the applicant, so I judge each MC with context.
Rules
| Rule | Applies to | Example |
|---|---|---|
The limit is the value in the table configurations. The code uses a default of 3 only when the row is missing or its value is not a number | US-2 | Product changes 3 to 4 in the table |
| The count covers all jobs and slots of the applicant | always | Two jobs and two slots in September count as four uploads |
| An MC counts when the applicant uploads it, even if OPS approves it later | always | An approved MC on 3 September stays in the count |
A new file for the same account_suspensions row does not add to the count | always | A clearer photo for the same job does not count again |
| A new file for a row the system rejected keeps the row rejected, and does not suspend the applicant again | always | Adam sends a clearer photo for Slot D, and Slot D stays rejected |
| A new file for any other row that already has an MC sends the row back to OPS for review | always | A clearer photo for Job A goes back to OPS |
| When the count is below the limit, the MC goes to OPS for review, as today | US-1 | The 3rd MC in a month goes to OPS |
| When the count reaches the limit, the system rejects the new MC | US-1 | The 4th MC in a month never reaches OPS |
| The count starts again on the 1st of each month | always | An MC on 1 October goes to OPS |
| The APP and the web app show the MCs uploaded this month and the limit, before the applicant uploads | US-3 | Adam sees "2 of 3" before his 3rd MC |
| When the count already reaches the limit, the APP and the web app warn that the next MC will be rejected | US-4 | Adam sees the warning before his 4th MC |
| The APP and the web app do not block the cancellation or the upload after the warning | US-5 | Adam still cancels Slot D, and the system suspends him |
The suspension report can filter rows with account_suspensions.is_auto_rejected: true | US-6 | OPS lists every system rejection in September |
| The portal shows the upload count next to the applicant's name | US-7 | OPS sees "3 used" beside Adam |
Design
Configuration
One new row goes into the table configurations.
-
config_key: 'portal.mc_upload_monthly_limit', which matches the existingportal.*keys -
value: '3' -
The migration
2026_10_20_100100_execute_mc_upload_monthly_limit_configuration_seeder.phpadds the row, so product can change the value without a deploy. -
The backend reads the row on every check, so a change takes effect at once.
-
If the row is missing, or its value is not a number, the backend uses
Constants::MC_UPLOAD_MONTHLY_LIMIT_DEFAULT, which is 3.
Database
Two columns and one index go on the table account_suspensions.
Schema::table('account_suspensions', function (Blueprint $table) {
$table->timestamp('document_uploaded_at')->nullable()
->comment('Set once on the first MC upload for this suspension row');
$table->boolean('is_auto_rejected')->default(false)
->comment('True only when the system rejected the MC for the monthly upload limit');
$table->index(['user_id', 'document_uploaded_at']);
});
account_suspensions.document_uploaded_atis set on the first MC upload for the row, and it does not change after that.account_suspensions.is_auto_rejectedistrueonly when the system rejected the MC for the monthly limit.- Old rows keep
account_suspensions.document_uploaded_atempty, so the count starts at 0 on the release day.
Backend
Every MC upload path calls one shared check before it saves the MC.
- The APP and the web app call the same endpoints, so one check covers both.
| Upload path | File | Entry point |
|---|---|---|
| The MC comes with the cancellation | app/Services/SuspendedService.php | suspendWithGracePeriod |
| The MC comes after the cancellation, for a job | app/Services/JodJobService.php | applicantUploadCancellationDocumentJobService |
| The MC comes after the cancellation, for a slot | app/Services/JodJobService.php | applicantUploadCancellationDocumentSlotService |
| OPS uploads the MC in the portal, see Portal-Assisted Medical Certificate Upload | app/Services/PendingSuspensionService.php | uploadCancellationDocumentByAdmin |
- The shared check is
McUploadLimitService::recordUpload. - A new upload path must call
recordUploadtoo.
The check follows these steps.
- If the row already has an MC (
document_uploaded_atis set), this is a new file for the same row.- When the system rejected the row, the row stays rejected. The system does not suspend the applicant again or send a second notification.
- For any other row, set the status of the row to pending for review.
document_uploaded_atdoes not change.
- Read the limit from the table
configurations. - Count the applicant's other
account_suspensionsrows withdocument_uploaded_atin the current calendar month, Singapore time. - When the count is below the limit, set the status of the row to pending for review, as today, and set
document_uploaded_atto now. - When the count reaches the limit, reject the MC.
- Set
account_suspensions.is_auto_rejected: true,account_suspensions.is_document_approved: falseanddocument_uploaded_atto now. - Suspend the applicant the same way OPS does when it rejects an MC.
- The row and the user are updated in one database transaction, so they are always updated together.
- If the applicant is suspended now, keep the first
users.suspended_at, so the 30-day suspension does not start again. - If the applicant is not suspended now, set
users.suspended_atto now, even if an old value is still in the column.
- Set
When the MC comes with the cancellation (suspendWithGracePeriod) and the count reaches the limit:
- The system suspends the applicant at once. There is no grace period, and the system does not send
UPCOMING_SUSPENSION. - The cancelled slot still goes back to the marketplace, the same as a cancellation under the limit.
APP
The cancellation screen and the urgent-cancellation screen get two fields from GET job/get-mc-limit-info.
- The endpoint uses the middleware
auth.mobile, and returns the fields for the applicant who is signed in.
| Field | Meaning |
|---|---|
data.mc_uploads_used_this_month | The number of MCs the applicant uploaded this calendar month |
data.mc_upload_monthly_limit | The limit, which the backend reads from the table configurations |
The APP shows one message before the applicant uploads an MC.
| MCs uploaded this month | What the APP shows |
|---|---|
| Below the limit | "You have uploaded used of limit medical certificates this month." |
| At the limit or more | "You have used all limit medical certificate uploads this month. If you upload another one, we will reject it automatically and suspend your account." |
- The warning does not block the applicant.
- The applicant can still cancel and upload the MC.
- After the system rejects the MC, the APP shows that the MC was rejected, not "under review".
Web app
The web app gets the same message as the APP on four pages.
| Web app page | File | Backend endpoint |
|---|---|---|
| Cancel a job | app/routes/jobs/job-cancel-page.jsx | POST job/applicantCancelJob |
| Cancel a slot | app/routes/jobs/job-cancel-single-slot-page.jsx | POST job/cancel-single-slot |
| Upload an MC after the cancellation, for a job | app/routes/jobs/job-upload-cancellation-document-page.jsx | POST job/applicant-upload-cancellation-document-job |
| Upload an MC after the cancellation, for a slot | app/routes/jobs/job-upload-cancellation-document-single-slot-page.jsx | POST job/applicant-upload-cancellation-document-slot |
- Each page loads the job from
GET job/applicant-job-detail, as today.- Each page also calls
GET job/get-mc-limit-infoto get the two fields from APP.
- Each page also calls
- Each page shows the message from the table in APP above the field Supporting Document.
- On the two cancel pages, this field shows only after the applicant picks Upload now.
- The warning does not block the applicant.
- The web app has no separate urgent-cancellation page.
- In the last 3 hours before the start, the applicant clicks Request for Urgent Cancellation and confirms a modal.
- The modal then opens the same cancel page, so the message shows there too.
- The web app shows no MC review status today.
- After a cancel or an upload, the web app shows a toast that says "successfully".
- When the system rejects the MC, the toast must also say that the MC was rejected.
- The backend response tells the web app whether the system rejected the MC, in the field
data.is_mc_auto_rejected.
| Backend endpoint | Field |
|---|---|
POST job/applicantCancelJob | data.is_mc_auto_rejected |
POST job/cancel-single-slot | data.is_mc_auto_rejected |
POST job/applicant-upload-cancellation-document-job | data.is_mc_auto_rejected, next to data.cancellation_document_url |
POST job/applicant-upload-cancellation-document-slot | data.is_mc_auto_rejected, next to data.cancellation_document_url |
truemeans the system rejected the MC for the monthly limit and suspended the applicant.- When the applicant uploads a new file for a row the system already rejected, the value is still
true.
Portal
The portal shows OPS which rejections the system made, and how many MCs each applicant uploaded.
| Portal page | File | Entry point |
|---|---|---|
| The pending suspension list | app/Services/PendingSuspensionService.php | getListPendingSuspension |
| The applicant detail view | app/Http/Controllers/ApplicantUserController.php | detail, GET applicantuser/detail/{id} |
- The pending suspension list shows only rows with the status pending for review.
- A row the system rejected is never in this list, so OPS does not review it.
- The pending suspension list returns
mc_uploads_used_this_monthon each row.- The backend gets the counts for the whole page with one query.
- The applicant detail view returns
data.mc_uploads_used_this_month. - The suspension report gets a filter and a column for
account_suspensions.is_auto_rejected.
Worked example: Adam in September
The limit in the table configurations is 3.
- Adam cancels Job A on 3 September and uploads an MC, so the count is 1.
- Adam cancels Slot B on 10 September in the web app and uploads an MC, so the count is 2.
- Adam cancels Job C on 20 September and uploads an MC, so the count is 3.
- OPS reviews these three MCs, as today.
- Adam opens the cancellation screen for Slot D on 25 September.
- The APP calls
GET job/get-mc-limit-info, and warns him that he used all 3 uploads, and that the next MC will be rejected. - Adam still cancels Slot D and uploads an MC.
- The count is already 3, so the system rejects the MC and suspends Adam at once, with no grace period.
- The system sets
account_suspensions.is_auto_rejected: trueon the row for Slot D, and the response returnsdata.is_mc_auto_rejected: true.- Slot D still goes back to the marketplace.
- OPS does not see the Slot D row in the pending suspension list.
- OPS filters the suspension report by
account_suspensions.is_auto_rejectedand finds the Slot D row. - On 1 October the count is 0, so Adam's next MC goes to OPS.