Form Validation Rules for Leave Requests
This prompt defines validation rules for different types of leave requests in a form. It ensures compliance with specific leave conditions based on the type of leave and prevents duplicate requests for overlapping dates.
Prompt template
- Format
- Json
- Outputs
- result (text)
{
"rules": [
{
"leaveType": "Marriage Leave",
"validity": "Granted for 3 business days in the event of the employee's marriage.",
"maxDays": 3
},
{
"leaveType": "Paternity Leave",
"validity": "5 business days if the employee's spouse gives birth.",
"maxDays": 5
},
{
"leaveType": "Leave for the Death of a First-Degree Relative",
"validity": "3 business days in the event of the death of the employee's mother, father, sibling, spouse, or child.",
"maxDays": 3
},
{
"leaveType": "Natural Disaster Leave",
"validity": "Leave of up to 10 business days in the event of a natural disaster.",
"maxDays": 10
},
{
"leaveType": "Paid Maternity Leave",
"validity": "In cases of pregnancy and maternity, action is taken in accordance with the Law. Female employees are generally not to work for 8 weeks before and 8 weeks after childbirth. In the case of a multiple pregnancy, 2 weeks are added to the 8-week period during which they are not to work before childbirth.",
"preBirthWeeks": 8,
"postBirthWeeks": 8,
"extraWeeksForMultiplePregnancy": 2,
"workUntilPreWeeks": 3
},
{
"leaveType": "Unpaid Parental Leave",
"validity": "Leave granted for up to 6 months at the employee's request after paid maternity leave ends. It cannot be taken in separate periods.",
"maxMonths": 6
},
{
"leaveType": "Leave for a Pregnant Employee's Medical Checkups",
"validity": "A type of leave that can be used for monthly checkups when a pregnant employee documents her pregnancy, with no limit on the number of days.",
"documentationRequired": true
},
{
"leaveType": "Social Excuse Leave",
"validity": "The employee may use a total of 3 business days of excuse leave per year. Leave exceeding 3 days is deducted from annual leave.",
"maxDaysPerYear": 3
},
{
"leaveType": "Unpaid Leave",
"validity": "A type of leave with no set limit, granted when the employer approves the employee's written request.",
"documentationRequired": true
}
],
"generalRules": {
"duplicateCheck": "If a leave request already exists for the same dates, the user should not submit another leave request.",
"applicableFormId": 1
}
}
What you'll create
A data specification records maximum durations and relevant maternity or family-event conditions for different leave types.
Comments
Tried this prompt? Share what you made, compare results, or ask a question