Skip to main content

Overview

Kontrak Backend supports three distinct contract types, each designed for different employment scenarios. Each contract type has specific requirements, fields, and use cases.

Contract Type Definition

The contract type is defined as a TypeScript union type:
src/types/employees.interface.ts
export type ContractType = 'PLANILLA' | 'SUBSIDIO' | 'PART TIME';
This type is used throughout the system to ensure type safety and consistent contract handling.

Contract Types

Full-Time Employment Contract

PLANILLA is the standard full-time employment contract with all legal benefits required by law.

When to Use

  • Permanent full-time employees
  • Staff entitled to full legal benefits
  • Long-term employment relationships
  • Positions requiring complete benefit packages

Required Fields

PLANILLA contracts require all base employee information plus standard employment details.
requiredFields: [
  // Base Information
  'name',
  'lastNameFather',
  'lastNameMother',
  'dni',
  'entryDate',
  'endDate',
  'position',
  'subDivisionOrParking',
  
  // Location Information
  'province',
  'district',
  'department',
  'address',
  
  // Compensation
  'salary',
  'salaryInWords'
]

Key Characteristics

  • Full legal benefits and protections
  • Standard probationary period applies
  • Complete social security coverage
  • Eligible for all company benefits

Template Generation

The PLANILLA contract uses the generatePlanillaContract() function which renders a full-time employment template with:
  • Complete employee information
  • Formatted salary display
  • Probationary period clause
  • Digital signatures from both employers
  • Letter format (8.5” x 11”) with custom margins

Contract Type Validation

The system validates contract types during Excel import and employee creation:
src/services/validation.service.ts
private mapContractType(tipo: string): ContractType {
  const normalized = tipo.trim();
  const lower = normalized.toLowerCase();

  if (lower === 'planilla') return 'PLANILLA';
  if (lower === 'subsidio') return 'SUBSIDIO';
  if (lower === 'part-time' || lower === 'part_time' || lower === 'part time')
    return 'PART TIME';

  return 'PLANILLA'; // Default fallback
}
If an invalid contract type is provided in an Excel file, the row will be skipped during processing.

Contract Type in Excel Files

When importing employees via Excel, the contract type column can use various aliases:
src/constants/contract-field.ts
contractType: {
  aliases: [
    'tipo de contrato',
    'Tipo Contrato',
    'tipodecontrato',
    'tipo_de_contrato',
    'tipo contrato',
    'TIPO DE CONTRATO'
  ],
  description: 'Tipo de contrato del empleado'
}

Selecting the Right Contract Type

Contract Data Interface

When contracts are generated and stored, they use the following interface:
src/types/employees.interface.ts
export interface ContractData {
  emplooyeeDni: string;      // Employee's DNI
  fileName: string;           // Generated PDF filename
  buffer: Buffer;             // PDF file binary data
  contractType: ContractType; // Type of contract
}

Employee Data Structure

Learn about the complete employee data interface

PDF Generation

Understand how contracts are rendered as PDFs

Excel Processing

See how contract types are validated in Excel imports

API Endpoints

Use the API to generate contracts

Build docs developers (and LLMs) love