An Enovate Wiki
Attachments
History
Blame
View Source
Changelog
Documentation
About An Otter Wiki
Toggle dark mode
Login
Home
A - Z
Page Index
CMMI
Governance
Template
Statement Of Work
Guidelines
Coding Standard
Android Coding Standards
Core Java
Front-End Styling (CSS)
Golang
iOS Coding Standard (Swift)
Java EE
Javascript
Python
Request structure guidelines
Scala
TypeScript
Product Integration
Practical Training PPT
Procedure
Configuration Management (CM)
Estimating (EST)
Managing Performance and Measurement (MPM)
Monitoring and Control (MC)
Peer Review (PR)
Planning (PLAN)
Process Management (PCM)
Process Quality Assurance (PQA)
Product Integration (PI)
Requirement Development Management(RDM)
Risk and Opportunity Management
Technical Solution (TS)
Verification and Validation (VV)
Process Areas
Process Areas - Documents & Evidences
Standard
Document Creation
Naming Convention Standard
Templates
Audit Plan
LLD
Enovate Tools
EnovateIT
Company Profile & Website Portfolio
Home
Local AI
Projects
Audit-matic
HLD
CommNet
Face Recognation
Document
Flowcast
Enovate IT-QMS-PL01-Project Plan-[FlowCast]-V10
HireGenius
SRS
Technical Document (LLD+HLD))
OptiQA
Sentify
SkillShift
HLD
LLD
Social Media Manager
Teams
Team Apex
Team Catalyst
Team Fusion
Team Nova
Team Orbit
Team Pulse
Team Quantum
Team Spark
Team Vision
Templates
Project Template
Team Template
Projects
HireGenius
Technical Document (LLD+HLD))
a29d45
Commit
a29d45
2025-10-13 16:37:46
Vinay Deokar
: "Templates" table added
Projects/HireGenius/Technical Document (LLD+HLD)).md
..
@@ 545,20 545,43 @@
- `idx_comm_type` on `type` (filter by type)
---
+
##### Table: templates
+
**Purpose:** Store user-specific email templates for communication
+
+
| Column | Type | Constraints | Description |
+
|--------------|-------------|--------------------------------------|---------------------------------------|
+
| template_id | UUID | PRIMARY KEY, DEFAULT gen_random_uuid() | Unique template identifier |
+
| created_by | UUID | FOREIGN KEY REFERENCES users(user_id) | User who created the template |
+
| name | VARCHAR(255)| NOT NULL | Template name |
+
| type | VARCHAR(50) | NOT NULL, CHECK (type IN ('outreach','follow_up','reply','manual')) | Type of template |
+
| subject | VARCHAR(500)| NOT NULL | Email subject template |
+
| body | TEXT | NOT NULL | Email body template |
+
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | Template creation time |
+
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | Last update time |
+
**Indexes:**
+
- `idx_templates_user` on `created_by` (fetch templates by user)
+
- `idx_templates_type` on `type` (filter templates by type)
+
+
---
+
#### 4.3 Database Relationships
| Parent Table | Child Table | Relationship Type | Foreign Key | On Delete |
|--------------|---------------------|-----------------|-----------------------------------------------|-----------|
| users | jobs | One-to-Many | jobs.created_by → users.user_id | SET NULL |
+
| users | templates | One-to-Many | templates.created_by → users.user_id | CASCADE |
| jobs | job_candidate_matches | One-to-Many | job_candidate_matches.job_id → jobs.job_id | CASCADE |
| candidates | job_candidate_matches | One-to-Many | job_candidate_matches.candidate_id → candidates.candidate_id | CASCADE |
| candidates | communication | One-to-Many | communication.candidate_id → candidates.candidate_id | CASCADE |
+
| templates | communication | One-to-Many | communication.template_id → templates.template_id | SET NULL |
**Cascade Deletion Logic:**
- When a job is deleted, all associated job-candidate matches are deleted
- When a candidate is deleted, all associated job-candidate matches and communications are deleted
-
- When a user is deleted, their jobs remain but `created_by` is set to NULL
+
- When a user is deleted, their jobs remain but `created_by` is set to NULL
+
- When a user is deleted, all their templates are deleted
+
- When a template is deleted, communications referencing it will have `template_id` set to NULL
---
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9