Overview

The Contract model extracts and structures information from legal contracts, including parties, dates, jurisdictions, and key contract terms. The model is designed to handle various contract formats while maintaining flexibility for different date formats and party structures.

Model Details

  • Model ID: CONTRACT
  • Supported Locales: en-US
  • Version: GA
  • Release Date: November 30, 2024

Schema Structure

Root Level Fields

FieldTypeDescription
TitlestringContract title
ContractIdstring?Contract identification code
PartiesParty[]List of legal parties
ExecutionDatestring?Date when agreement was fully signed
EffectiveDatestring?Date when contract starts to be in effect
ExpirationDatestring?Date when contract ends to be in effect
ContractDurationstring?Contract terms
RenewalDatestring?Date when contract needs to be renewed
JurisdictionsJurisdiction[]List of jurisdictions

Party Fields

Each party in the Parties array contains:

FieldTypeDescription
Namestring?Name of legal party
AddressAddress?Address of legal party
ReferenceNamestring?Name used throughout the contract as reference
Clausestring?Full description of the party

Jurisdiction Fields

Each jurisdiction in the Jurisdictions array contains:

FieldTypeDescription
Clausestring?Full description of the jurisdiction
Regionstring?Court location

Utility Functions

The model provides several utility functions for contract management:

getPrimaryParties

Returns the first two parties of the contract:

const getPrimaryParties = (contract: Contract): [Party, Party] | null

isContractValid

Checks if the contract is currently valid based on dates:

const isContractValid = (contract: Contract): boolean

needsRenewalSoon

Checks if contract needs renewal within 30 days:

const needsRenewalSoon = (contract: Contract): boolean

getPrimaryJurisdiction

Gets the first listed jurisdiction:

const getPrimaryJurisdiction = (contract: Contract): Jurisdiction | null

formatPartyClause

Formats party information for display:

const formatPartyClause = (party: Party): string

Example Usage

import { validateContract, contractUtils } from '@your-package/models';

// Example contract data
const contractData = {
  title: "SERVICE AGREEMENT",
  contractId: "AB12956",
  parties: [{
    name: "Contoso Corporation",
    address: "1 Microsoft Way, Redmond, Washington, 98052",
    referenceName: "Contoso",
    clause: "Contoso Corporation (Contoso), a Washington corporation, having its principal place of business at 1 Microsoft Way, Redmond, Washington, 98052"
  }],
  executionDate: "2024-02-23",
  effectiveDate: "2024-02-23",
  contractDuration: "5 years",
  jurisdictions: [{
    clause: "This Agreement shall be governed by and construed in accordance with the internal laws of the State of Washington applicable to agreements made and to be performed entirely within such state.",
    region: "Washington"
  }]
};

// Validate the contract
const validatedContract = validateContract(contractData);

// Check contract validity
if (contractUtils.isContractValid(validatedContract)) {
  console.log("Contract is currently valid");
}

// Check if renewal is needed
if (contractUtils.needsRenewalSoon(validatedContract)) {
  console.log("Contract needs renewal soon");
}

// Get primary jurisdiction
const primaryJurisdiction = contractUtils.getPrimaryJurisdiction(validatedContract);

Date Handling

The model accepts dates in multiple formats:

  • ISO 8601 datetime strings
  • YYYY-MM-DD format strings
  • Written form (e.g., “Twenty Third of February”)

All parseable dates are converted to ISO format during validation. Non-parseable dates are preserved as strings.

Type Definitions

import type {
  Party,
  Jurisdiction,
  Contract,
  ContractResponse,
  StrictContractResponse
} from '@your-package/models';

Field Validation Rules

For basic validation:

  • All fields are optional by default
  • Parties and Jurisdictions default to empty arrays if not specified

For strict validation:

  • Title is required
  • ContractId is required
  • ExecutionDate is required
  • EffectiveDate is required
  • At least one party is required
  • For each party in strict mode, Name and ReferenceName are required

Best Practices

  1. Always validate contracts before processing:
const contract = validateContract(contractData);
  1. Check contract validity regularly:
if (!contractUtils.isContractValid(contract)) {
  // Handle invalid contract
}
  1. Monitor contracts for upcoming renewals:
if (contractUtils.needsRenewalSoon(contract)) {
  // Handle renewal notification
}
  1. Preserve original legal language in clauses

  2. Use referenceName for party aliases in contract processing

  3. Store dates in ISO format while maintaining original text if not parseable