Skip to main content

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

FieldTypeDescription
Spouse1FirstNamestring?First name of spouse 1
Spouse1MiddleNamestring?Middle name of spouse 1
Spouse1LastNamestring?Last name of spouse 1
Spouse1Agenumber?Age of spouse 1
Spouse1BirthDatestring?Birth date of spouse 1
Spouse1Addressstring?Address of spouse 1
Spouse1BirthPlacestring?Birth place of spouse 1

Spouse 2 Details

FieldTypeDescription
Spouse2FirstNamestring?First name of spouse 2
Spouse2MiddleNamestring?Middle name of spouse 2
Spouse2LastNamestring?Last name of spouse 2
Spouse2Agenumber?Age of spouse 2
Spouse2BirthDatestring?Birth date of spouse 2
Spouse2Addressstring?Address of spouse 2
Spouse2BirthPlacestring?Birth place of spouse 2

Certificate Details

FieldTypeDescription
DocumentNumberstring?Document number
IssueDatestring?Issue date of the certificate
IssuePlacestring?Issue place of the certificate
MarriageDatestring?Marriage date
MarriagePlacestring?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

  1. Always validate certificates:
const certificate = validateMarriageCertificate(certificateData);
  1. Access data through the result property:
const spouse1Name = `${certificate.result.Spouse1FirstName} ${certificate.result.Spouse1LastName}`;
  1. Handle optional fields appropriately:
const spouse1MiddleName = certificate.result.Spouse1MiddleName || '';
  1. Verify required fields in strict mode:
if (!certificate.result.DocumentNumber || !certificate.result.MarriageDate) {
  // Handle missing required fields
}