/** * @file types.ts * @description Foundation type aliases for signature.digital contract system * All type aliases use T prefix as per project conventions */ // ============================================================================ // CONTRACT CLASSIFICATION // ============================================================================ /** * Broad categories of contracts for classification and routing */ export type TContractCategory = | 'employment' | 'service' | 'sales' | 'lease' | 'license' | 'partnership' | 'confidentiality' | 'financial' | 'real_estate' | 'intellectual_property' | 'government' | 'construction' | 'healthcare' | 'insurance' | 'other'; /** * Specific contract types within categories - extensible via string literal union */ export type TContractType = // Employment | 'employment_full_time' | 'employment_part_time' | 'employment_minijob' | 'employment_internship' | 'employment_freelance' | 'employment_consulting' | 'employment_executive' | 'employment_temporary' | 'employment_apprenticeship' // Service | 'service_agreement' | 'service_level_agreement' | 'master_service_agreement' | 'maintenance_agreement' | 'support_agreement' | 'managed_services' // Sales | 'sales_agreement' | 'purchase_order' | 'distribution_agreement' | 'supply_agreement' | 'consignment_agreement' // Lease/Rental | 'lease_residential' | 'lease_commercial' | 'lease_equipment' | 'lease_vehicle' | 'sublease' // License | 'software_license' | 'patent_license' | 'trademark_license' | 'franchise_agreement' | 'content_license' // Partnership | 'partnership_general' | 'partnership_limited' | 'joint_venture' | 'strategic_alliance' | 'consortium_agreement' // Confidentiality | 'nda_unilateral' | 'nda_bilateral' | 'nda_multilateral' | 'non_compete' | 'non_solicitation' // Financial | 'loan_agreement' | 'credit_facility' | 'guarantee' | 'security_agreement' | 'investment_agreement' | 'shareholder_agreement' // Other | 'settlement_agreement' | 'release_waiver' | 'power_of_attorney' | 'memorandum_of_understanding' | 'letter_of_intent' | string; // Allow custom types // ============================================================================ // CONTRACT LIFECYCLE STATUS // ============================================================================ /** * Contract lifecycle status - complete workflow states */ export type TContractStatus = // Draft phase | 'draft' | 'internal_review' | 'legal_review' // Negotiation phase | 'negotiation' | 'pending_approval' // Signature phase | 'pending_signature' | 'partially_signed' | 'signed' // Active phase | 'executed' | 'active' | 'suspended' | 'renewal_pending' // End phase | 'expired' | 'terminated' | 'superseded' | 'cancelled' | 'voided'; // ============================================================================ // PARTY AND ROLE TYPES // ============================================================================ /** * Role types in contract signing workflow */ export type TPartyRole = | 'signer' | 'witness' | 'notary' | 'cc' | 'approver' | 'guarantor' | 'beneficiary'; /** * Signing dependency types */ export type TSigningDependency = | 'none' | 'sequential' | 'parallel' | 'after_specific'; /** * Legal capacity when signing */ export type TLegalCapacity = | 'individual' | 'representative' | 'attorney' | 'guardian'; // ============================================================================ // SIGNATURE TYPES // ============================================================================ /** * All supported signature input methods */ export type TSignatureType = | 'drawn' | 'typed' | 'click' | 'digital' | 'qualified' | 'biometric'; /** * Signature legal level based on eIDAS regulation */ export type TSignatureLegalLevel = | 'simple' | 'advanced' | 'qualified'; /** * Signature lifecycle status */ export type TSignatureStatus = | 'pending' | 'captured' | 'verified' | 'timestamped' | 'complete' | 'revoked' | 'expired'; // ============================================================================ // IDENTITY VERIFICATION TYPES // ============================================================================ /** * Supported identity verification methods */ export type TIdentityVerificationMethod = | 'none' | 'email' | 'sms' | 'knowledge' | 'document_upload' | 'document_nfc' | 'document_ocr' | 'biometric_facial' | 'video_ident' | 'bankid' | 'eid' | 'third_party_idp'; /** * Verification confidence levels */ export type TVerificationConfidence = | 'none' | 'low' | 'medium' | 'high' | 'verified'; /** * Identity verification status */ export type TIdentityVerificationStatus = | 'pending' | 'in_progress' | 'manual_review' | 'verified' | 'failed' | 'expired' | 'cancelled'; /** * Identity document types */ export type TIdentityDocumentType = | 'passport' | 'national_id' | 'drivers_license' | 'residence_permit' | 'travel_document' | 'other'; // ============================================================================ // FINANCIAL TYPES // ============================================================================ /** * Payment frequency for recurring payments */ export type TPaymentFrequency = | 'one_time' | 'daily' | 'weekly' | 'bi_weekly' | 'semi_monthly' | 'monthly' | 'bi_monthly' | 'quarterly' | 'semi_annually' | 'annually' | 'on_demand' | 'upon_completion' | 'milestone_based' | 'custom'; /** * Payment method types */ export type TPaymentMethod = | 'bank_transfer' | 'sepa_direct_debit' | 'credit_card' | 'check' | 'cash' | 'paypal' | 'crypto' | 'escrow' | 'letter_of_credit' | 'other'; /** * Interest calculation methods */ export type TInterestType = | 'simple' | 'compound' | 'fixed' | 'variable' | 'prime_plus' | 'reference_plus' | 'none'; /** * Payment status */ export type TPaymentStatus = | 'pending' | 'invoiced' | 'paid' | 'overdue' | 'waived' | 'refunded'; /** * Penalty types */ export type TPenaltyType = | 'late_payment' | 'early_termination' | 'breach' | 'non_performance' | 'custom'; // ============================================================================ // TIME AND DURATION TYPES // ============================================================================ /** * Duration unit for time periods */ export type TDurationUnit = | 'hours' | 'days' | 'weeks' | 'months' | 'years' | 'indefinite'; /** * Renewal types */ export type TRenewalType = | 'none' | 'manual' | 'auto_renew' | 'evergreen' | 'option_to_renew'; /** * Notice effective point */ export type TNoticeEffectivePoint = | 'immediate' | 'end_of_week' | 'end_of_month' | 'end_of_quarter' | 'end_of_year' | 'anytime'; /** * Notice form requirements */ export type TNoticeForm = | 'written' | 'email' | 'registered_mail' | 'any'; /** * Milestone status */ export type TMilestoneStatus = | 'pending' | 'in_progress' | 'completed' | 'delayed' | 'cancelled'; /** * Termination reason taxonomy */ export type TTerminationReason = | 'breach_of_contract' | 'mutual_agreement' | 'convenience' | 'non_performance' | 'insolvency' | 'force_majeure' | 'regulatory_change' | 'merger_acquisition' | 'other'; // ============================================================================ // CONTENT AND SECTION TYPES // ============================================================================ /** * Section types for contract structure */ export type TSectionType = | 'preamble' | 'definitions' | 'clause' | 'subclause' | 'schedule' | 'exhibit' | 'annex' | 'amendment' | 'signature_block' | 'witness_block' | 'acknowledgment' | 'recital' | 'custom'; /** * Variable/placeholder types for dynamic content */ export type TVariableType = | 'text' | 'number' | 'currency' | 'date' | 'duration' | 'percentage' | 'party_name' | 'party_address' | 'party_contact' | 'calculated' | 'selection' | 'custom'; /** * Condition operators for conditional sections */ export type TConditionOperator = | 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'greater_than' | 'less_than' | 'in_list' | 'not_in_list' | 'is_empty' | 'is_not_empty' | 'party_has_role' | 'contract_type_is'; /** * Logical combination for conditions */ export type TConditionCombine = 'and' | 'or'; // ============================================================================ // VERSIONING TYPES // ============================================================================ /** * Version type */ export type TVersionType = 'draft' | 'final' | 'amendment'; /** * Change operation types for diff tracking */ export type TChangeOperation = | 'insert' | 'delete' | 'modify' | 'move' | 'format' | 'merge'; /** * Branch status */ export type TBranchStatus = 'active' | 'merged' | 'abandoned'; // ============================================================================ // COLLABORATION TYPES // ============================================================================ /** * User presence status */ export type TPresenceStatus = | 'viewing' | 'editing' | 'commenting' | 'idle' | 'offline'; /** * Comment thread status */ export type TCommentThreadStatus = 'open' | 'resolved' | 'archived'; /** * Suggestion status */ export type TSuggestionStatus = 'pending' | 'accepted' | 'rejected' | 'superseded'; /** * Suggestion change type */ export type TSuggestionChangeType = 'insert' | 'delete' | 'replace' | 'format'; /** * Conflict resolution strategy */ export type TConflictResolutionStrategy = 'accept_first' | 'accept_last' | 'manual_merge'; /** * Editing mode */ export type TEditingMode = 'collaborative' | 'suggestion_only' | 'view_only'; /** * Permission level for collaboration */ export type TCollaborationPermission = | 'owner' | 'admin' | 'editor' | 'suggester' | 'commenter' | 'viewer'; // ============================================================================ // AUDIT TYPES // ============================================================================ /** * Action categories for filtering and reporting */ export type TActionCategory = // Document lifecycle | 'create' | 'view' | 'edit' | 'status_change' | 'version_create' | 'version_rollback' // Collaboration | 'share' | 'permission_change' | 'comment' | 'suggestion' // Signature | 'signature_request' | 'signature_given' | 'signature_declined' | 'signature_revoked' // Export/Import | 'export' | 'print' | 'download' // Administrative | 'archive' | 'restore' | 'delete' | 'retention_policy_applied'; /** * Action severity levels */ export type TActionSeverity = 'info' | 'warning' | 'critical'; /** * Signature audit action types */ export type TSignatureAuditAction = | 'signature_requested' | 'document_viewed' | 'signature_captured' | 'identity_verification_started' | 'identity_verification_completed' | 'identity_verification_failed' | 'timestamp_requested' | 'timestamp_received' | 'signature_validated' | 'signature_revoked' | 'certificate_expired'; /** * Compliance action types */ export type TComplianceAction = | 'proof_created' | 'tsa_timestamp_requested' | 'tsa_timestamp_received' | 'blockchain_anchor_requested' | 'blockchain_anchor_confirmed' | 'validation_performed' | 'ltv_data_collected' | 'archive_timestamp_added'; // ============================================================================ // ATTACHMENT TYPES // ============================================================================ /** * Attachment type classification */ export type TAttachmentType = | 'exhibit' | 'schedule' | 'appendix' | 'amendment' | 'side_letter' | 'certificate' | 'evidence'; /** * Attachment category for organization */ export type TAttachmentCategory = // Legal documents | 'legal_entity_docs' | 'authorization' | 'insurance' | 'compliance' // Identity documents | 'identity' | 'address_proof' // Technical documents | 'specifications' | 'diagrams' | 'data_schemas' // Financial documents | 'financial_statements' | 'pricing' | 'payment_terms' // Other | 'correspondence' | 'other'; /** * Prior contract relationship types */ export type TPriorContractRelationship = | 'supersedes' | 'amends' | 'extends' | 'references' | 'depends_on' | 'conflicts_with'; /** * Confidentiality levels */ export type TConfidentialityLevel = | 'public' | 'internal' | 'confidential' | 'restricted'; // ============================================================================ // LEGAL COMPLIANCE TYPES // ============================================================================ /** * Timestamping methods */ export type TTimestampMethod = | 'tsa' | 'blockchain' | 'qualified_tsa'; /** * Supported blockchain networks for timestamping */ export type TBlockchainNetwork = | 'bitcoin' | 'ethereum' | 'polygon' | 'arbitrum' | 'optimism' | 'hyperledger' | 'private'; /** * Hash algorithms */ export type THashAlgorithm = | 'SHA-256' | 'SHA-384' | 'SHA-512' | 'Keccak-256'; /** * Signature algorithm types */ export type TSignatureAlgorithm = | 'RSA-SHA256' | 'RSA-SHA384' | 'RSA-SHA512' | 'ECDSA-P256' | 'ECDSA-P384' | 'Ed25519'; /** * Qualification status for eIDAS */ export type TQualificationStatus = 'qualified' | 'withdrawn' | 'unknown'; /** * Validation status */ export type TValidationStatus = 'valid' | 'invalid' | 'indeterminate' | 'expired'; // ============================================================================ // PDF GENERATION TYPES // ============================================================================ /** * Page size presets */ export type TPageSize = 'A4' | 'Letter' | 'Legal' | 'custom'; /** * Page orientation */ export type TPageOrientation = 'portrait' | 'landscape'; /** * Header/footer content types */ export type THeaderFooterContentType = | 'text' | 'image' | 'page_number' | 'date' | 'custom'; /** * Page number format */ export type TPageNumberFormat = 'numeric' | 'roman' | 'alpha'; /** * PDF encryption algorithm */ export type TPdfEncryptionAlgorithm = 'AES-128' | 'AES-256'; /** * PDF printing permission level */ export type TPdfPrintingPermission = 'none' | 'low_resolution' | 'high_resolution'; /** * PDF generation job status */ export type TPdfJobStatus = 'queued' | 'processing' | 'completed' | 'failed'; // ============================================================================ // OBLIGATION TYPES // ============================================================================ /** * Obligation types */ export type TObligationType = | 'performance' | 'payment' | 'delivery' | 'confidentiality' | 'compliance' | 'reporting' | 'insurance' | 'indemnification' | 'custom'; /** * Obligation status */ export type TObligationStatus = | 'pending' | 'active' | 'completed' | 'breached' | 'waived'; /** * Obligation priority */ export type TObligationPriority = 'critical' | 'high' | 'medium' | 'low'; /** * Deliverable status */ export type TDeliverableStatus = | 'pending' | 'in_progress' | 'delivered' | 'accepted' | 'rejected' | 'revised'; /** * Insurance requirement types */ export type TInsuranceType = | 'general_liability' | 'professional_liability' | 'workers_comp' | 'property' | 'auto' | 'cyber' | 'other'; // ============================================================================ // WORKFLOW TYPES // ============================================================================ /** * Workflow types for signing */ export type TWorkflowType = | 'sequential' | 'parallel' | 'hybrid' | 'custom'; /** * Workflow status */ export type TWorkflowStatus = | 'draft' | 'active' | 'completed' | 'expired' | 'cancelled' | 'voided'; /** * Workflow events */ export type TWorkflowEvent = | 'workflow_started' | 'signature_completed' | 'signature_declined' | 'workflow_completed' | 'deadline_approaching' | 'deadline_expired' | 'all_signatures_complete'; // ============================================================================ // SIGNATURE FIELD TYPES // ============================================================================ /** * Signature field status */ export type TSignatureFieldStatus = | 'pending' | 'ready' | 'in_progress' | 'completed' | 'declined' | 'expired' | 'voided'; /** * Signature field placement types */ export type TPlacementType = | 'paragraph' | 'page' | 'anchor' | 'append'; /** * Signing dependency types for fields */ export type TFieldDependencyType = | 'sequential' | 'parallel' | 'any' | 'witness'; /** * Invitation status */ export type TInvitationStatus = | 'not_sent' | 'sent' | 'delivered' | 'opened' | 'bounced'; // ============================================================================ // LEGAL REFERENCE TYPES // ============================================================================ /** * Legal reference types */ export type TLegalReferenceType = | 'statute' | 'regulation' | 'case_law' | 'internal_clause' | 'standard' | 'definition'; /** * Dispute resolution methods */ export type TDisputeResolution = | 'litigation' | 'arbitration' | 'mediation' | 'negotiation';