Leave Management Module • 2024

Streamlining leave requests and approvals for organizations.

A sophisticated leave management system that handles employee leave requests, approvals, and tracking across organizations. The system supports multiple leave types, accrual policies, carry-forward rules, and integrates with the approval workflow system for multi-level leave approvals.

Role
Backend Engineer
Company
Sidmach Technologies
Type
Multi-tenant SaaS
ASP.NET Core 7.0 C# 11 SQL Server 2022 Domain-Driven Design EF Core Fluent API
MY ROLE AND SUMMARY

I was the backend engineer responsible for building this leave management module from the ground up. The challenge was creating a system flexible enough to handle different leave policies across organizations while maintaining accuracy in leave balance calculations and accruals.

I designed the database schema using Entity Framework Core with Fluent API to handle complex relationships between employees, leave types, policies, and approvals. I built the leave accrual engine that automatically calculates leave balances based on configurable policies—some organizations accrue monthly, others annually, some pro-rate for new employees.

The system integrates with our approval workflow engine, meaning leave requests automatically route through the right approval chains. I also implemented temporal tables to track complete leave history, crucial for audits and disputes.

Add anime GIF here
(Determined/Let's build moment)

Key Achievement: Built a flexible leave system handling 15+ leave types across 50+ organizations with automated accrual calculations and seamless approval workflow integration.

CHALLENGE, EMPATHY AND PLAN

How do you build leave management that works for every organization's unique policies?

Leave policies are deceptively complex. One organization gives 20 days annual leave that accrues monthly. Another gives 15 days that vest annually. Some allow carry-forward of unused leave, others have "use it or lose it" policies. Some have sick leave that doesn't accrue, others have maternity leave with special conditions.

And that's just the policies. Then there's the workflow—who approves leave? Does it need multiple approvers? What happens to pending requests when someone goes on leave themselves?

Add anime GIF here
(Thinking/Problem-solving)

For employees: They wanted clarity. How much leave do I have? Can I take these dates? Will my request be approved? When will I know?

For managers: They needed visibility. Who's on leave when? Are there conflicts? Can I approve this without breaking team coverage?

For HR: They needed control. Set policies once, have them apply automatically. Track leave usage, identify patterns, generate reports for compliance.

The technical reality: We needed a rule engine for policy configuration, an accrual calculator that handles different scenarios, integration with approval workflows, conflict detection, and complete history tracking.

The core question: How do we build a system that's flexible enough for any policy while simple enough for employees to use daily?

THE SOLUTION

Domain-driven design meets flexible policy management.

I used Domain-Driven Design principles to model the leave domain properly. Leave types, policies, accruals, balances—each became a well-defined entity with clear responsibilities and relationships.

The policy engine: Each organization configures their leave policies—accrual rates, carry-forward rules, eligibility criteria. The system applies these automatically. New employee? Leave is pro-rated based on join date. End of year? Unused leave either carries forward or expires based on policy.

Leave accrual calculator: I built an engine that runs monthly to calculate accrued leave. It handles different scenarios—monthly accrual, annual vesting, pro-rating for new hires, adjustments for terminated employees. All automatic.

Workflow integration: Leave requests automatically route through approval chains defined in our workflow engine. Sequential approvals, parallel approvals—the workflow handles it. Real-time notifications keep everyone informed.

Conflict detection: Before approving leave, the system checks for conflicts—is another team member already on leave? Will this affect project deadlines? Managers get visibility to make informed decisions.

Add anime GIF here
(Coding/Working hard)

The backend systems powering payroll automation.

Backend Framework
ASP.NET Core 7.0, C# 11, Domain-Driven Design (DDD), Microservices-ready architecture.
Database Design
SQL Server 2022, Entity Framework Core, Fluent API for complex relationships, Temporal tables for leave history tracking.
Core Features
Multiple leave types (Annual, Sick, Maternity), Leave accrual engine with configurable policies, Leave balance calculator, Carry-forward rules implementation.
Workflow Integration
Integration with Approval Workflow System, Real-time approval status updates, Notification triggers for approvers, Escalation handling for overdue approvals.
Business Rules Engine
Configurable leave policies per organization, Pro-rated leave calculations for new employees, Holiday calendar integration, Leave conflict detection.
API Design
RESTful API endpoints, Swagger/OpenAPI documentation, Versioned APIs for backward compatibility, Rate limiting and throttling.

Visual breakdown of the technical implementation.

Add system architecture diagram here

Entity relationships and data structure.

Add database schema diagram here
IMPACT AND LEARNING

Results that matter.

0
Organizations
0
Leave Types
0
Monthly Requests
0
Approval Speed

The system transformed leave management for our clients. What used to be email chains and spreadsheet tracking became streamlined digital workflows. Employees submit leave requests in seconds, managers approve with full context, HR gets complete visibility.

The accrual engine runs automatically every month, calculating leave balances accurately based on each organization's policies. The workflow integration means approvals happen faster—80% improvement in average approval time. The conflict detection prevents scheduling issues before they happen.

Add anime GIF here
(Celebration/Success)

What I learned from this:

Domain modeling matters deeply. Taking time to properly model the leave domain—policies, accruals, balances—made the system intuitive and maintainable. When the domain model is right, the code almost writes itself.

Flexibility needs boundaries. We made the system flexible, but not infinitely so. Some organizations wanted truly custom logic. We learned to say "configure within these rules" rather than "we'll build anything." Constraints made the system better.

Temporal data is crucial for leave. People dispute leave calculations. Having complete history via temporal tables meant we could always answer "what was the balance on this date?" Critical for resolving conflicts.

Integration is more than APIs. Integrating with the approval workflow wasn't just about calling endpoints—it was about understanding the workflow lifecycle, handling state transitions, managing notifications. Real integration goes deep.