Handover workspace

ERS, Todo, OfferReview, and Docu in one view

Imported from live server docs, code structure, and deployment notes.

Apr 3, 2026, 12:38 PM

OfferReview

W10 Quick Reference

**W10 SMO Decision** is the final approval stage where:

W10-QUICK-START.md

Updated Feb 19, 2026, 6:59 AM

Codex 5.3 Refactor Note: Canonical refactor plan: docs/CODEX-5.3-REFACTOR-PLAN.md. This document is retained for historical and implementation context during the refactor.

W10 Quick Reference

๐ŸŽฏ What is W10?

W10 SMO Decision is the final approval stage where:

  • SMO/Admin reviews candidate escalated to TO_SMO
  • Finalizes decision: APPROVED, REJECTED, or KIV
  • Updates candidate status immutably
  • Logs audit events for compliance
  • Emits domain event for W16 notifications

๐Ÿš€ 5-Minute Quick Start

1. Verify Setup

npm run dev  # Start server
# Ensure candidate exists with status: TO_SMO

2. Navigate

Login as SMO user โ†’ Candidates โ†’ Select candidate โ†’ SMO Decision tab

3. Finalize

  • Select decision: APPROVED, REJECTED, or KIV
  • Add notes (required for REJECT/KIV)
  • Click "Finalize Decision"

4. Verify

  • โœ… Status changes to APPROVED/REJECTED/KIV
  • โœ… Form becomes read-only
  • โœ… Server logs: [DomainEvent] DecisionUpdated: {...}

๐Ÿ“ Files Created

FileTypePurpose
src/app/api/candidates/[id]/decision/route.tsAPIGET/POST decision
src/app/(app)/candidates/[id]/_tabs/SmoDecisionTab.tsxComponentDecision form + history
src/lib/events/emitter.tsLibDomain event stub
W10-IMPLEMENTATION.mdDocsFull specification
W10-DELIVERY.mdDocsDelivery summary
W10-INDEX.mdDocsNavigation index

๐Ÿ”„ Decision Flow

Candidate at TO_SMO
        โ†“
SMO reviews & decides
        โ†“
POST /api/candidates/[id]/decision
        โ†“
Validate (notes required for REJECT/KIV)
        โ†“
Create Decision record (immutable)
        โ†“
Update Candidate status
        โ†“
Log audit events (DECISION_FINALIZED + CANDIDATE_STATUS_UPDATED)
        โ†“
Emit DecisionUpdated event
        โ†“
Candidate โ†’ APPROVED/REJECTED/KIV (final)

โœ… Acceptance Checklist

  • SMO can finalize decision (APPROVED/REJECTED/KIV)
  • Notes required for REJECTED/KIV
  • Decision immutable (409 on retry)
  • Status updates: TO_SMO โ†’ final
  • Audit logged
  • Domain event emitted
  • RBAC enforced (SMO/Admin only)
  • No offer letter upload

๐Ÿงช Minimal Test

  1. Create candidate with status TO_SMO
  2. As SMO user, visit /candidates/[id]?tab=smo-decision
  3. Select APPROVED, click "Finalize Decision"
  4. Verify:
    • Candidate status = APPROVED
    • Form = read-only
    • Server console = [DomainEvent] DecisionUpdated: {...}
    • Audit logs = DECISION_FINALIZED + CANDIDATE_STATUS_UPDATED

๐Ÿ” Access Control

RoleCan ViewCan Finalize
HRโœ…โŒ
Managerโœ…โŒ
SMOโœ…โœ…
Adminโœ…โœ…

๐Ÿ“Š API Endpoints

GET /api/candidates/:id/decision

  • Auth: HR/Manager/SMO/Admin
  • Returns: Decision if exists, else null

POST /api/candidates/:id/decision

  • Auth: SMO/Admin only
  • Body: { decision, notes? }
  • Validates: TO_SMO status, notes required for REJECT/KIV
  • Immutable: 409 if already exists
  • Returns: { success, status, decision, decidedAt }

๐Ÿ“š Full Documentation


โ“ Common Questions

Q: What if candidate is not TO_SMO?
A: Form shows "Not in SMO review stage" and is read-only.

Q: Can I change my decision?
A: No. Decision is immutable. Second POST returns 409 Conflict.

Q: Are notes always required?
A: Only for REJECTED/KIV. Optional for APPROVED.

Q: Who gets notified?
A: Domain event emitted (stub). W16 will route to notifications.

Q: What about the offer letter?
A: Not in W10. W11+ will handle offer uploads.


๐Ÿ› ๏ธ Troubleshooting

Problem: Form shows "Not in SMO review stage"
โ†’ Candidate status is not TO_SMO. Escalate via Manager Review tab first.

Problem: Cannot click "Finalize Decision" button
โ†’ Check user role (must be SMO/Admin). Check candidate status (must be TO_SMO).

Problem: Got 409 Conflict error
โ†’ Decision already exists (immutable). Refresh page to see finalized decision.

Problem: Domain event not showing in console
โ†’ Check server logs (not browser console). Event logs on POST success.


๐Ÿ“ž Support

For issues or questions:

  1. Review W10-IMPLEMENTATION.md Test Checklist
  2. Check API responses for error details
  3. Review audit logs for history