
Joi validation schema for TATA AIG insurance policy templates. Defines field constraints, conditional rendering rules, and data types for pixel-perfect HTML/Handlebars output.
Validation Preview
Test Joi schema rules against live JSON data
Joi Constraints
policyNumber
Joi.string().min(8).required()
holderName
Joi.string().min(2).max(100).required()
premium
Joi.number().positive().required()
currency
Joi.string().valid('INR','USD','EUR')
startDate
Joi.date().iso().required()
active
Joi.boolean().required()
templateVersion
Joi.string().optional()
locale
Joi.string().default('en-IN')
Test JSON Input
Validation Results
| 1 | // Auto-generated Joi schema β sage-template v1.0.0 |
| 2 | // Source: tata-aig-policy-certificate.figma.json |
| 3 | |
| 4 | const Joi = require('joi'); |
| 5 | |
| 6 | // Sub-schema: Insured Person Details |
| 7 | const insuredSchema = Joi.object({ |
| 8 | fullName: Joi.string().min(2).max(120).required(), |
| 9 | dateOfBirth: Joi.date().iso().required(), |
| 10 | gender: Joi.string().valid('M', 'F', 'O'), |
| 11 | panNumber: Joi.string().pattern(/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/), |
| 12 | aadharLast4: Joi.string().length(4), |
| 13 | }); |
| 14 | |
| 15 | // Sub-schema: Policy Details |
| 16 | const policySchema = Joi.object({ |
| 17 | policyNumber: Joi.string().required(), |
| 18 | productCode: Joi.string().alphanum().required(), |
| 19 | premiumAmount: Joi.number().positive().precision(2), |
| 20 | currency: Joi.string().valid('INR').default('INR'), |
| 21 | startDate: Joi.date().iso().required(), |
| 22 | expiryDate: Joi.date().iso().min('now'), |
| 23 | coverageType: Joi.string().valid('INDIVIDUAL', 'FAMILY', 'GROUP'), |
| 24 | }); |
| 25 | |
| 26 | // Root export schema |
| 27 | module.exports = Joi.object({ |
| 28 | insured: insuredSchema.required(), |
| 29 | policy: policySchema.required(), |
| 30 | nominees: Joi.array().items(Joi.object()).max(4), |
| 31 | qrCodeUrl: Joi.string().uri().optional(), |
| 32 | watermark: Joi.boolean().default(false) |
| 33 | }); |

Upload your Figma or Adobe design files and let sage-template generate pixel-perfect HTML/Handlebars templates, modular CSS, and Joi validation schemas β all in under 30 seconds.
Drag and drop Figma JSON exports, Adobe API extracts, or design specification files to begin the automated template generation pipeline.
From design ingestion to production-ready packages, sage-template handles the entire pipeline with precision.
Generate HTML/Handlebars templates that match your Figma or Adobe designs down to every last pixel, spacing, and typography detail.
Automatically produce clean, scoped CSS modules that adhere to design specifications with no redundant or hardcoded values.
Auto-generate accurate Joi validation schemas from your design inputs, ensuring data integrity across all template fields.
Download production-ready folders containing templates, CSS, schemas, and dynamic assets aligned with system conventions.
Preview generated templates in real time and compare them side-by-side with the original design for instant validation.
Submit detailed feedback on generated output and trigger regeneration cycles for continuous refinement.
Whether you are designing, developing, or reviewing β sage-template adapts to your workflow with dedicated paths.
Generation Time
Concurrent Files
Design Fidelity
Hardcoded Values
No comments yet. Be the first!