Skip to main content

LEAVE-001: Leave Request System (IM-Workflow)

Download Materials​

You can download the prompt materials (a set of Markdown files) used in this sample from the links below.

Overview​

A system in which employees apply online for annual paid leave and half-day paid leave, and the remaining paid leave balance is automatically managed after two-stage approval by the supervisor and the HR department. Validations such as balance and duplication checks are performed at the time of application, and the remaining paid leave balance is deducted when final approval is completed.

Target Users​

PersonaDescription
General EmployeeAn employee who applies for leave. Wants to check the remaining balance and apply easily
SupervisorThe direct supervisor who approves a subordinate's leave request. Decides while considering the subordinate's work situation
HR StaffPerforms the final approval of leave requests. Manages paid leave usage across the company

User Stories​

As a General Employee​

  • Can apply for leave after checking the remaining balance. Cannot apply if the remaining balance is insufficient
  • Can withdraw a request that the supervisor has not yet processed, in order to revise and resubmit it
  • Can cancel a request that is no longer needed
  • Can check the comment on a sent-back request, revise it, and resubmit it

As a Supervisor​

  • Can review a subordinate's leave request details (type, period, reason, remaining balance) and approve, send it back, or deny it
  • Can convey the reason via a comment when sending back or denying
  • Can temporarily hold processing and resume it later
  • Can withdraw an approval if the HR department has not yet processed it

As HR Staff​

  • Can give the final review to a leave request already approved by the supervisor, and complete the approval, send it back, or deny it
  • Can choose the send-back destination: the applicant or the supervisor
  • The remaining paid leave balance is automatically deducted when the final approval is completed

Workflow Definitions​

For details on each definition, refer to the individual documents.

Functional Requirements​

F-001: Leave Request​

F-001-1: Request Input​

  • The applicant can enter the required information into the leave request form and submit the request
  • Information required for the request:
    • Leave type (required, selectable: Annual Paid Leave / Half-Day Paid Leave)
    • Start date (required, a date on or after today)
    • End date (required, a date on or after the start date. Must be the same as the start date for half-day paid leave)
    • Half-day segment (required only for half-day paid leave, selectable: Morning / Afternoon)
    • Number of days taken (auto-calculated, business days excluding weekends and public holidays. 0.5 days for half-day paid leave)
    • Reason for the request (required, selectable: Personal / Medical visit / Ceremonial occasion / Family circumstances / Refresh / Other)
    • Emergency contact (optional, up to 50 characters)
    • Remarks (optional, up to 500 characters)
  • Displays the remaining paid leave balance at the time of application, and disallows requests that exceed the remaining balance (validated by the user program)
  • Saves data to the leave_request table via the user program when the request is completed
  • Sends a notification email to the supervisor when the request is completed

F-001-2: Withdrawing a Request​

  • The applicant can withdraw a request that the supervisor has not yet processed
  • After withdrawal, the request content can be revised and resubmitted

F-001-3: Canceling a Request​

  • The applicant can cancel an unapproved request
  • After cancellation, the matter is completed (canceled)

F-001-4: Resubmission After Send-Back​

  • A sent-back request can be revised and resubmitted
  • The revision is made after checking the send-back comment
  • On resubmission, the user program updates the leave_request table and re-runs the validations

F-002: Approval Process​

F-002-1: Supervisor Approval​

  • The supervisor reviews a subordinate's leave request and can approve, send it back, deny it, hold it, or release the hold
  • Items to check when approving:
    • Request details (leave type, period, reason)
    • The subordinate's remaining paid leave balance
  • A send-back comment is required when sending back (up to 300 characters)
  • The send-back destination is the application node
  • A denial reason is required when denying (up to 300 characters)
  • While on hold, processing by any assignee other than the person who placed the hold is prohibited
  • If the HR department has not yet processed the request, the supervisor can withdraw the approval
  • Sends a result notification email to the applicant when processing is completed

F-002-2: Final HR Approval​

  • HR staff review a leave request already approved by the supervisor, and can complete the approval, send it back, deny it, hold it, or release the hold
  • Items to check for final approval:
    • Request details (leave type, period, reason)
    • The applicant's remaining paid leave balance
    • Consistency with internal regulations
  • A send-back comment is required when sending back (up to 300 characters)
  • The send-back destination can be selected as the application node or the supervisor approval node (any already-processed node)
  • A denial reason is required when denying (up to 300 characters)
  • While on hold, processing by any assignee other than the person who placed the hold is prohibited
  • The user program deducts the remaining paid leave balance in the leave_balance table when the approval is completed
  • Sends a result notification email to the applicant when processing is completed

F-003: Displaying the Remaining Paid Leave Balance​

  • Displays the remaining paid leave balance on the application screen
  • Remaining balance = annual granted days + days carried over from the previous year − days already taken

Non-Functional Requirements​

Performance Requirements​

  • Screen display: within 3 seconds
  • Application/approval processing: within 2 seconds
  • Concurrent users: 500

Business Rules​

IDRule
BR-001A leave request exceeding the remaining paid leave balance is not allowed
BR-002For half-day paid leave, the start date and end date must be the same
BR-003The number of days taken is auto-calculated as business days excluding weekends and public holidays (0.5 days for half-day paid leave)
BR-004The start date must be on or after the application date
BR-005The user program deducts the remaining paid leave balance in leave_balance when the final approval is completed
BR-006A denied or canceled request does not affect the remaining paid leave balance. The leave_request data is retained as history and not deleted
BR-007Duplicate leave requests for the same period are not allowed

Screen List​

Screen IDScreen NameIM-Workflow Screen TypeOverview
SCR-001Leave RequestApplication Screen / Resubmission ScreenInput form for a leave request. Displays the remaining paid leave balance. Displays the send-back comment on resubmission
SCR-002ProcessingProcessing ScreenScreen where an approver reviews the request and approves, sends it back, denies it, or holds it
SCR-003Processing DetailProcessing Detail ScreenScreen where an assignee views the details of a matter
SCR-004Reference DetailReference Detail ScreenScreen where a viewer views the details of a matter

Screen Field Definitions​

SCR-001: Leave Request Screen (Application Screen / Resubmission Screen)​

Field NameInput TypeRequiredNotes
ApplicantDisplay only-Automatically displays the login user's name
OrganizationDisplay only-Automatically displays the login user's organization
Remaining Paid Leave BalanceDisplay only-Displays the current remaining paid leave balance
Leave TypeSelect○Annual Paid Leave / Half-Day Paid Leave
Start DateDate○Calendar picker. On or after today
End DateDate○Calendar picker. On or after the start date
Half-Day SegmentRadio△Morning / Afternoon. Displayed and required only for half-day paid leave
Number of Days TakenDisplay only-Automatically calculates and displays the business day count
ReasonSelect○Personal / Medical visit / Ceremonial occasion / Family circumstances / Refresh / Other
Emergency ContactText-Up to 50 characters
RemarksText-Up to 500 characters
Send-Back CommentDisplay only-Shown only on resubmission. Displays the approver's send-back comment

SCR-002: Processing Screen (For Approvers)​

Field NameInput TypeRequiredNotes
ApplicantDisplay only-Applicant's name
OrganizationDisplay only-Applicant's organization
Remaining Paid Leave BalanceDisplay only-Applicant's remaining paid leave balance
Leave TypeDisplay only-Displays the request details
Start DateDisplay only-Displays the request details
End DateDisplay only-Displays the request details
Half-Day SegmentDisplay only-Displayed only for half-day paid leave
Number of Days TakenDisplay only-Displays the request details
ReasonDisplay only-Displays the request details
Emergency ContactDisplay only-Displays the request details
RemarksDisplay only-Displays the request details
CommentText△Required when sending back or denying. Up to 300 characters

SCR-003: Processing Detail Screen (For Assignees)​

Field NameInput TypeNotes
ApplicantDisplay onlyApplicant's name
OrganizationDisplay onlyApplicant's organization
Remaining Paid Leave BalanceDisplay onlyApplicant's remaining paid leave balance
Leave TypeDisplay onlyDisplays the request details
Start DateDisplay onlyDisplays the request details
End DateDisplay onlyDisplays the request details
Half-Day SegmentDisplay onlyDisplayed only for half-day paid leave
Number of Days TakenDisplay onlyDisplays the request details
ReasonDisplay onlyDisplays the request details
Emergency ContactDisplay onlyDisplays the request details
RemarksDisplay onlyDisplays the request details
Processing HistoryDisplay onlyDisplays the processing history of each node

SCR-004: Reference Detail Screen (For Viewers)​

Uses the same layout and fields as SCR-003 (Processing Detail Screen).

Data Model (Overview)​

User Data (User Content Management Scope)​

Leave Request (leave_request)
├── User Data ID (PK)
├── Applicant User ID
├── Leave Type (annual/half_day)
├── Start Date
├── End Date
├── Half-Day Segment (am/pm, nullable)
├── Number of Days Taken
├── Reason Category
├── Emergency Contact
├── Remarks
├── Created At
└── Updated At

Paid Leave Balance (leave_balance)
├── User ID (PK)
├── Fiscal Year (PK)
├── Granted Days
├── Carried-Over Days
├── Days Taken
├── Remaining Days (= Granted Days + Carried-Over Days − Days Taken)
├── Created At
└── Updated At

Matter Properties​

Property KeySet AtPurpose
leave_daysOn applicationNumber of days taken. Used in the email replacement string

Glossary​

TermDescription
Annual Paid LeavePaid leave granted under the Labor Standards Act, based on years of continuous service
Half-Day Paid LeaveLeave taken by splitting one day of paid leave into a morning and an afternoon portion. Counted as 0.5 days
Remaining Paid Leave BalanceThe number of paid leave days available to take in the current fiscal year (granted days + days carried over from the previous year − days already taken)
Business DayA working day excluding Saturdays, Sundays, and public holidays