CourseController::signSkills(). Silently skips any skill_log_id in the payload that doesn't belong to {log_code} and the authenticated user (continue, no error) rather than rejecting the whole request. Only the skills named in the request change: they are merged into the stored user_skills map. A skill that is not posted keeps its stored value; a skill is un-signed only by an explicit false.App\Http\Controllers\Api\V1\Diver\CourseController::signSkills()api.v1.diver.courses.skills.signAuthorization: Bearer {token}POST/api/v1/diver/courses/{log_code}/skills/signapplication/json| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Opaque course log code, owned by the authenticated diver |
{
"signatures": [
{ "skill_log_id": 207055, "skills": { "1": true, "2": false } }
]
}| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
signatures | array | Yes | required|array|min:1 | One entry per skill log to sign |
signatures.*.skill_log_id | integer | Yes | required|integer|exists:skill_logs,id | Existence is checked against all skill logs, not scoped to this diver or this log_code — ownership is enforced later, per-entry, by silently skipping |
signatures.*.skills | object | Yes | required|array | {skillId: bool} map, merged into the stored user_skills: skills not posted keep their stored value, false un-signs |
signatures.*.skills.* | boolean | Yes | boolean |
App\Http\Requests\Api\V1\Diver\SignSkillsRequest, extends ApiFormRequest — full envelope 422.200 OKskill_log_id 207055 with {"1":true,"2":false}, against a course log with 1 skill log. Abbreviated to 1 skill.{
"success": true,
"status": "success",
"message": "Skills signed successfully",
"data": [
{
"id": 207055,
"log_code": "67995bd8bfa208cec4bd72b809c745d3",
"skill_type_id": 1,
"skill_type_name": "Confined Water or Pool",
"user_completed": null,
"start": "2025-04-02 18:07:22",
"end": "2026-09-23 10:12:28",
"skills": [
{
"id": 1,
"name": "Example skill",
"description": "Example skill description.",
"diver_signed": true,
"instructor_signed": false
}
]
}
]
}data is SkillProgressResource::collection() of every skill log for {log_code} and this diver, post-update — see _resources.md → "Skill progress entry". end is set to the time of this request regardless of whether any value in skills actually changed.401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}403 Forbidden - repetition{
"success": false,
"status": "error",
"message": "Skills are not available for a repetition."
}404 Not Found{log_code} does not resolve to a course log owned by the authenticated user.{
"message": "No query results for model [App\\Models\\CourseLog\\CourseLog]."
}422 Unprocessable Entity — validationPOST_quiz_submit.md's 422 — not re-captured separately; SignSkillsRequest extends the same ApiFormRequest base.user_skills map. A skill that is not posted keeps its stored value; a skill is un-signed only by an explicit false.expire_date in the past) answers 403 with the message Skills cannot be signed on an expired course. and nothing is written: an expired course can only take quizzes, as on the website.SkillLog.user_skills, user_ip and end for every matched signature.signatures entry whose skill_log_id doesn't belong to {log_code} and this diver is silently skipped, not rejected.signatures.*.skill_log_id's exists:skill_logs,id validation rule checks the id exists at all, not that it belongs to this diver — ownership is enforced afterward in the loop, not by the FormRequest.Call to undefined relationship [skills] on model [App\Models\Skills\SkillType] crash documented until 23c8454ad (finding 2 of docs/plans/ApiDocsDiver/findings.md) is fixed: the write and the response are atomic again, captured 2026-09-23.docs/api/diver/courses/POST_skills_sign.mdcurl --location 'https://test.diveraid.com/api/v1/diver/courses//skills/sign' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"signatures": [
{
"skill_log_id": 0,
"skills": {
"property1": true,
"property2": true
}
}
]
}'{
"status": "success",
"message": "string",
"data": [
{
"id": 0,
"log_code": "string",
"skill_type_id": 0,
"skill_type_name": "string",
"user_completed": true,
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"skills": [
{
"id": 0,
"name": "string",
"description": "string",
"diver_signed": true,
"instructor_signed": true
}
]
}
]
}