Models
Pay Stub
Documentation for the Pay Stub document model
Overview
The Pay Stub model extracts and structures information from pay stubs, including employee and employer information, pay period details, and financial calculations.
Schema Structure
Employee Information
Field | Type | Description |
---|---|---|
EmployeeAddress | string? | Address of the employee |
EmployeeName | string? | Name of the employee |
EmployeeSSN | string? | Social security number |
Employer Information
Field | Type | Description |
---|---|---|
EmployerAddress | string? | Address of the employer |
EmployerName | string? | Name of the employer |
Pay Period Information
Field | Type | Description |
---|---|---|
PayDate | string? | Date of salary payment |
PayPeriodStartDate | string? | Start date of the pay period |
PayPeriodEndDate | string? | End date of the pay period |
Current Period Amounts
Field | Type | Description |
---|---|---|
CurrentPeriodGrossPay | number? | Gross pay of the current period |
CurrentPeriodTaxes | number? | Taxes of the current period |
CurrentPeriodDeductions | number? | Deductions of the current period |
CurrentPeriodNetPay | number? | Net pay of the current period |
Year to Date Amounts
Field | Type | Description |
---|---|---|
YearToDateGrossPay | number? | Year-to-date gross pay |
YearToDateTaxes | number? | Year-to-date taxes |
YearToDateDeductions | number? | Year-to-date deductions |
YearToDateNetPay | number? | Year-to-date net pay |
Type Definitions
Validation Rules
Basic Validation
- All fields are optional by default
Strict Validation
The following fields are required in strict mode:
- EmployeeName
- EmployerName
- PayDate
- CurrentPeriodGrossPay
- CurrentPeriodNetPay
Example Usage
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 pay stubs:
- Access data through the result property:
- Handle optional fields appropriately:
- Verify required fields in strict mode:
- Calculate totals carefully: