تفاصيل العمل

System Name: Aljarmaq HR Email Automation Service

System Overview:

The Aljarmaq Email Service is an intelligent, automated C# Background Worker Service designed to act as a virtual HR assistant. It allows employees to request HR services, log attendance, and query their data exclusively via email. The system parses incoming emails, executes complex business logic against a SQL Server database, and manages interactive, multi-tier approval workflows using automated HTML email responses.

1. Core Modules & Services

Leave Management (Annual & Sick Leaves):

Employees can request leaves by sending a specifically formatted email subject.

The system validates available leave balances and checks for date overlapping in real-time.

Sick Leave Handling: Enforces mandatory medical report attachments. The system securely extracts the attachment from the employee's email and forwards it directly to the HR department without storing heavy files in the database.

Time & Attendance Tracking:

Check-In / Check-Out: Employees can log their daily attendance by simply emailing "Check in" or "Check out". The system uses the exact email reception time (DateTime.Now).

Administrative Backdoor: System administrators or HR can log historical attendance using a hidden format (e.g., [DD,MM,YYYY,HH,MM]), which bypasses the standard time-logging rules.

Employee Self-Service Queries:

Leave Balance: Employees can request their current leave balance and receive an elegantly formatted HTML table detailing their credits and debits.

Attendance Reports: Employees can request a timesheet for a specific date range and receive a detailed HTML report of their working hours.

2. Dynamic Approval Workflow

Smart Routing: The system dynamically identifies the correct decision-maker. It checks the database for active temporary delegations (AssignmentEmployee). If an active delegate is found, the request is routed to them; otherwise, it escalates to the original department manager or the HR director.

Interactive Action Buttons: Managers receive an HTML email containing the request details, employee notes, and [APPROVE] / [REJECT] buttons.

Zero-Login Approvals: Clicking a button automatically generates a pre-formatted mailto: response containing a unique GUID. Managers can type their rejection reasons directly into the email body, which the system captures and archives in the database.

Communication Loop: Upon final HR approval (for sick leaves), the system automatically sends an "FYI" notification to the employee's direct manager to keep them informed.

3. Security & Gatekeeping

Spam & No-Reply Shield: A built-in gatekeeper that instantly detects and ignores automated emails (e.g., noreply, daemon, postmaster), moving them to a UNProcessed folder to prevent infinite email loops and server resource exhaustion.

Authorization Check: Only emails registered in the HR database are processed. Unregistered senders are immediately rejected with an automated notification directing them to contact HR.

Rate Limiting: Prevents system abuse by tracking the number of requests per hour per employee, blocking users who exceed the allowed threshold.

4. Interactive User Experience (UX)

Smart Error Handling: If an employee makes a typo or uses an incorrect format, the system does not just send an error message; it sends a visual "Help Guide".

Auto-Fill Integration: The Help Guide includes interactive HTML buttons (mailto: links) for each service. When clicked, these buttons automatically open a new email draft with the perfectly formatted subject line, allowing the employee to simply change the dates and click send.

5. Technical Stack

Framework: .NET Core / C# Background Worker Service.

Email Protocol: MailKit and MimeKit for secure, asynchronous IMAP (reading) and SMTP (sending) operations using TLS 1.2/1.3.

Database: Microsoft SQL Server using ADO.NET (Microsoft.Data.SqlClient) with strict transaction management (SqlTransaction) to ensure data integrity during approvals.

ملفات مرفقة

بطاقة العمل

اسم المستقل
عدد الإعجابات
0
تاريخ الإضافة
تاريخ الإنجاز
المهارات