Documentation Index
Fetch the complete documentation index at: https://docs.ledgerbox.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Marriage Certificate model extracts and structures information from marriage certificates, including spouse details and certificate information.
Schema Structure
Spouse 1 Details
| Field | Type | Description |
|---|
Spouse1FirstName | string? | First name of spouse 1 |
Spouse1MiddleName | string? | Middle name of spouse 1 |
Spouse1LastName | string? | Last name of spouse 1 |
Spouse1Age | number? | Age of spouse 1 |
Spouse1BirthDate | string? | Birth date of spouse 1 |
Spouse1Address | string? | Address of spouse 1 |
Spouse1BirthPlace | string? | Birth place of spouse 1 |
Spouse 2 Details
| Field | Type | Description |
|---|
Spouse2FirstName | string? | First name of spouse 2 |
Spouse2MiddleName | string? | Middle name of spouse 2 |
Spouse2LastName | string? | Last name of spouse 2 |
Spouse2Age | number? | Age of spouse 2 |
Spouse2BirthDate | string? | Birth date of spouse 2 |
Spouse2Address | string? | Address of spouse 2 |
Spouse2BirthPlace | string? | Birth place of spouse 2 |
Certificate Details
| Field | Type | Description |
|---|
DocumentNumber | string? | Document number |
IssueDate | string? | Issue date of the certificate |
IssuePlace | string? | Issue place of the certificate |
MarriageDate | string? | Marriage date |
MarriagePlace | string? | Marriage place |
Type Definitions
import type {
SpouseDetails,
MarriageCertificate,
MarriageCertificateResponse,
StrictMarriageCertificateResponse
} from '@your-package/models';
Validation Rules
Basic Validation
- All fields are optional by default
Strict Validation
The following fields are required in strict mode:
- DocumentNumber
- MarriageDate
- Spouse1FirstName
- Spouse1LastName
- Spouse2FirstName
- Spouse2LastName
Example Usage
import { validateMarriageCertificate } from '@your-package/models';
// Example marriage certificate data
const certificateData = {
Spouse1FirstName: "John",
Spouse1LastName: "Doe",
Spouse1Age: 30,
Spouse1BirthDate: "1994-01-15",
Spouse2FirstName: "Jane",
Spouse2LastName: "Smith",
Spouse2Age: 28,
Spouse2BirthDate: "1996-03-20",
DocumentNumber: "2024-0123",
MarriageDate: "2024-02-14",
MarriagePlace: "City Chapel"
};
// Validate the certificate
const validatedCertificate = validateMarriageCertificate(certificateData);
// Access validated data through result property
console.log(validatedCertificate.result.DocumentNumber);
Date Handling
The model accepts dates in multiple formats:
- ISO 8601 datetime strings
- YYYY-MM-DD format
All dates are converted to ISO format during validation.
Best Practices
- Always validate certificates:
const certificate = validateMarriageCertificate(certificateData);
- Access data through the result property:
const spouse1Name = `${certificate.result.Spouse1FirstName} ${certificate.result.Spouse1LastName}`;
- Handle optional fields appropriately:
const spouse1MiddleName = certificate.result.Spouse1MiddleName || '';
- Verify required fields in strict mode:
if (!certificate.result.DocumentNumber || !certificate.result.MarriageDate) {
// Handle missing required fields
}