tbl_lettertemplate

-1 rows


Description

Module: HRMS Document Management
Purpose: Central repository for all document templates used across the HRMS system for automated letter generation.
Data: Each row represents a reusable template for generating various HR documents like offer letters, appointment letters, salary slips, etc.
Process Usage:
- Serves as the blueprint for generating employee-specific documents with dynamic data binding.
- Supports both HTML-based and DOCX-based template formats.
- Enables standardized document creation across the organization.
Key Points:
- Flexible template system supporting multiple document types and formats.
- Integrated notification system for workflow automation.
- Granular control over template visibility and acknowledgment requirements.
Business Impact: Ensures consistency in HR communications, reduces manual effort, and maintains compliance with document standards.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigserial 19 nextval('tbl_lettertemplate_id_seq'::regclass)
tbl_employeeletters.lettertemplateid fk__tbl_emplo__lette__61a69f0a R

Primary key
Format: Long (auto-increment)
Used as: Unique identifier for each template record.

templatename varchar 100 null

Format: String
Purpose: Human-readable name for identifying the template.
Examples: “Offer Letter - Standard”, “Appointment Letter”, “Salary Slip Template”, “Experience Certificate”
UI Usage: Displayed in template selection dropdowns and administration interfaces.

htmlcontent varchar 2147483647 null

Stores the HTML template structure with dynamic placeholders.
Format: HTML with embedded variables and conditional logic
Usage: Rendered with employee data to generate final documents when useDocumentFile is false.

status bool 1 null

Flag Type: Boolean
True: Template is active and available for use
False: Template is inactive and cannot be used for new document generation
Workflow: Allows version control and phased rollout of template updates.

isdeleted bool 1 null

Flag Type: Boolean (Soft Delete)
True: Template is marked as deleted and hidden from UI
False: Template is available in the system
Data Retention: Records are preserved for audit purposes even when deleted.

publishoness bool 1 null

Flag Type: Boolean
True: Documents generated from this template are visible on Employee Self-Service portal
False: Documents are for internal/HR use only
Usage: Controls whether employees can access generated documents through their portal.

headerid int8 19 null

FK: public.tbl_LetterHeader.id (or similar header table)
Values: 0 = No header, >0 = Specific header template ID
Purpose: Associates a predefined header template with this letter template for consistent branding.
Usage: Company letterheads, standardized headers with logos and contact information.

notification varchar 200 null

Format: Comma-separated integers
Values: 1=Employee, 2=Manager, 3=Admin, 4=No Notification
Examples: “1,2” (Notify employee and manager), “3” (Notify admin only), “4” (No notifications)
Purpose: Defines recipient groups for notifications when documents are generated from this template.

createdby varchar 50 null
createddate timestamp 29,6 null
modifiedby varchar 50 null
modifieddate timestamp 29,6 null
requireacknowledgement bool 1 null

Flag Type: Boolean
True: Documents generated from this template require employee digital acknowledgment
False: No acknowledgment required
Usage: Critical for legal documents where proof of receipt and understanding is required.

is_offer_letter_template bool 1 null

Flag Type: Boolean (default: false)
True: This template is specifically designed for offer letters
False: General purpose template for other document types
Business Logic: Enables special processing rules and validations specific to offer letter workflows.

usedocumentfile bool 1 false

Flag Type: Boolean
True: Template uses DOCX file stored in S3 (fileName)
False: Template uses HTML content (htmlContent)
Business Logic: Determines the template engine and processing method for document generation.

filename text 2147483647 null

Format: String
Pattern: TemplateFiles/{templateType}_{version}.docx
Example: TemplateFiles/offer_letter_v2.1.docx
Purpose: Reference to DOCX template file in S3 storage for file-based document generation.

Indexes

Constraint Name Type Sort Column(s)
tbl_lettertemplate_pk_tbl_tbl_lettertemplate Primary key Asc id

Relationships