# =============================================================================
# LEGAL - Single Source of Truth for Legal Documents & Compliance
# =============================================================================
# This file defines the IDEAL state for legal documents, terms of service,
# privacy policies, and compliance requirements across all LightWave verticals.
#
# Philosophy:
#   - Legal documents are versioned and auditable
#   - User consent is explicitly tracked with timestamps
#   - Compliance requirements vary by jurisdiction and product
#   - Documents are structured for CMS rendering and PDF generation
#
# Architecture:
#   legal.yaml (this file)
#       ↓ defines
#   Document Types, Section Types, Consent Types
#       ↓ consumed by
#   Django LegalDocument, UserConsent models
#       ↓ rendered by
#   CMS templates, PDF generators
#
# Usage:
#   from lightwave.schema.pydantic.validators import get_field_values
#   document_types = get_field_values("legal_document_types")
# =============================================================================

_meta:
  version: "1.0.0"
  schema_id: "lightwave://schemas/legal"
  title: "LightWave Legal Schema"
  description: "Legal documents, consent tracking, and compliance configuration"
  maintainer: "Legal & Architecture Teams"
  last_updated: "2026-01-22"
  depends_on:
    - "lightwave://schemas/field_options"
    - "lightwave://schemas/tenants"
  generates:
    - "pydantic:LegalDocumentSchema"
    - "pydantic:UserConsentSchema"
    - "django:LegalDocument"
    - "django:UserConsent"

# =============================================================================
# DOCUMENT TYPES
# =============================================================================
# Types of legal documents that can be created and managed.

document_types:
  terms_of_service:
    label: "Terms of Service"
    description: "Master terms governing use of the platform"
    requires_acceptance: true
    version_strategy: "major_minor"
    renewal_trigger: "material_change"
    default_sections:
      - introduction
      - definitions
      - account_terms
      - acceptable_use
      - intellectual_property
      - payment_terms
      - termination
      - limitation_of_liability
      - indemnification
      - governing_law
      - dispute_resolution
      - general_provisions

  privacy_policy:
    label: "Privacy Policy"
    description: "How we collect, use, and protect user data"
    requires_acceptance: true
    version_strategy: "major_minor"
    renewal_trigger: "data_practice_change"
    compliance_frameworks:
      - gdpr
      - ccpa
      - pipeda
    default_sections:
      - introduction
      - information_collected
      - how_we_use_information
      - information_sharing
      - data_retention
      - security_measures
      - user_rights
      - cookies_tracking
      - children_privacy
      - international_transfers
      - policy_changes
      - contact_information

  cookie_policy:
    label: "Cookie Policy"
    description: "Cookie usage and tracking technologies"
    requires_acceptance: true
    version_strategy: "minor"
    renewal_trigger: "cookie_type_change"
    default_sections:
      - what_are_cookies
      - cookies_we_use
      - third_party_cookies
      - managing_cookies
      - consent_choices

  acceptable_use_policy:
    label: "Acceptable Use Policy"
    description: "Rules for acceptable use of services"
    requires_acceptance: true
    version_strategy: "major_minor"
    renewal_trigger: "rule_change"
    default_sections:
      - prohibited_content
      - prohibited_activities
      - enforcement
      - reporting_violations

  data_processing_agreement:
    label: "Data Processing Agreement"
    description: "GDPR-compliant DPA for business customers"
    requires_acceptance: true
    version_strategy: "major"
    renewal_trigger: "processor_change"
    compliance_frameworks:
      - gdpr
    default_sections:
      - definitions
      - scope_and_purpose
      - data_processor_obligations
      - data_controller_obligations
      - subprocessors
      - international_transfers
      - security_measures
      - audit_rights
      - data_breach_notification
      - term_and_termination

  subscription_agreement:
    label: "Subscription Agreement"
    description: "Terms specific to paid subscriptions"
    requires_acceptance: true
    version_strategy: "major_minor"
    renewal_trigger: "pricing_change"
    default_sections:
      - subscription_terms
      - billing_and_payment
      - refunds_and_cancellation
      - service_levels
      - support_terms

  copyright_policy:
    label: "Copyright Policy"
    description: "DMCA and copyright infringement procedures"
    requires_acceptance: false
    version_strategy: "minor"
    renewal_trigger: "process_change"
    default_sections:
      - dmca_notice
      - counter_notice
      - repeat_infringers
      - designated_agent

  community_guidelines:
    label: "Community Guidelines"
    description: "Guidelines for community participation"
    requires_acceptance: true
    version_strategy: "minor"
    renewal_trigger: "guideline_change"
    default_sections:
      - be_respectful
      - no_harassment
      - no_spam
      - content_standards
      - enforcement_actions

# =============================================================================
# SECTION TYPES
# =============================================================================
# Reusable section definitions for legal documents.

section_types:
  # --- Introduction & Definitions ---
  introduction:
    label: "Introduction"
    description: "Opening statement and scope of document"
    required_in: ["terms_of_service", "privacy_policy"]
    template_key: "legal_intro"

  definitions:
    label: "Definitions"
    description: "Key terms and their meanings"
    required_in: ["terms_of_service", "data_processing_agreement"]
    template_key: "legal_definitions"

  # --- Account & Access ---
  account_terms:
    label: "Account Terms"
    description: "Account creation, access, and security"
    required_in: ["terms_of_service"]
    subsections:
      - account_creation
      - account_security
      - account_suspension
      - account_termination

  acceptable_use:
    label: "Acceptable Use"
    description: "Permitted and prohibited uses of the service"
    required_in: ["terms_of_service"]
    template_key: "legal_acceptable_use"

  # --- Intellectual Property ---
  intellectual_property:
    label: "Intellectual Property"
    description: "Ownership of content and materials"
    required_in: ["terms_of_service"]
    subsections:
      - our_ip
      - your_content
      - license_grants
      - feedback

  # --- Payment & Billing ---
  payment_terms:
    label: "Payment Terms"
    description: "Payment, billing, and refund policies"
    required_in: ["terms_of_service", "subscription_agreement"]
    subsections:
      - pricing
      - billing_cycle
      - payment_methods
      - refunds
      - taxes

  billing_and_payment:
    label: "Billing and Payment"
    description: "Detailed billing procedures"
    required_in: ["subscription_agreement"]
    template_key: "legal_billing"

  refunds_and_cancellation:
    label: "Refunds and Cancellation"
    description: "Refund policy and cancellation procedures"
    required_in: ["subscription_agreement"]
    template_key: "legal_refunds"

  # --- Liability & Indemnification ---
  limitation_of_liability:
    label: "Limitation of Liability"
    description: "Limits on damages and liability"
    required_in: ["terms_of_service"]
    legal_review_required: true
    jurisdiction_specific: true

  indemnification:
    label: "Indemnification"
    description: "User indemnification obligations"
    required_in: ["terms_of_service"]
    legal_review_required: true

  disclaimer_of_warranties:
    label: "Disclaimer of Warranties"
    description: "Warranty disclaimers"
    required_in: ["terms_of_service"]
    legal_review_required: true

  # --- Legal & Disputes ---
  governing_law:
    label: "Governing Law"
    description: "Choice of law and jurisdiction"
    required_in: ["terms_of_service"]
    jurisdiction_specific: true
    default_jurisdiction: "California, USA"

  dispute_resolution:
    label: "Dispute Resolution"
    description: "Arbitration, mediation, and litigation procedures"
    required_in: ["terms_of_service"]
    subsections:
      - informal_resolution
      - arbitration_agreement
      - class_action_waiver
      - small_claims_exception

  # --- Termination ---
  termination:
    label: "Termination"
    description: "Termination rights and procedures"
    required_in: ["terms_of_service"]
    subsections:
      - termination_by_user
      - termination_by_us
      - effect_of_termination
      - survival

  # --- General Provisions ---
  general_provisions:
    label: "General Provisions"
    description: "Miscellaneous legal provisions"
    required_in: ["terms_of_service"]
    subsections:
      - entire_agreement
      - severability
      - waiver
      - assignment
      - notices
      - force_majeure

  # --- Privacy Specific ---
  information_collected:
    label: "Information We Collect"
    description: "Types of data collected"
    required_in: ["privacy_policy"]
    subsections:
      - information_you_provide
      - information_collected_automatically
      - information_from_third_parties

  how_we_use_information:
    label: "How We Use Your Information"
    description: "Purposes for data processing"
    required_in: ["privacy_policy"]
    gdpr_lawful_basis_required: true

  information_sharing:
    label: "How We Share Information"
    description: "Third parties and data sharing"
    required_in: ["privacy_policy"]
    subsections:
      - service_providers
      - business_transfers
      - legal_requirements
      - with_your_consent

  data_retention:
    label: "Data Retention"
    description: "How long we keep data"
    required_in: ["privacy_policy"]
    template_key: "legal_data_retention"

  security_measures:
    label: "Security"
    description: "How we protect data"
    required_in: ["privacy_policy", "data_processing_agreement"]
    template_key: "legal_security"

  user_rights:
    label: "Your Rights"
    description: "Data subject rights"
    required_in: ["privacy_policy"]
    gdpr_rights:
      - access
      - rectification
      - erasure
      - restriction
      - portability
      - objection
      - automated_decision_making

  cookies_tracking:
    label: "Cookies and Tracking"
    description: "Cookie and tracking technology usage"
    required_in: ["privacy_policy", "cookie_policy"]
    template_key: "legal_cookies"

  children_privacy:
    label: "Children's Privacy"
    description: "COPPA compliance and children's data"
    required_in: ["privacy_policy"]
    coppa_compliant: true
    minimum_age: 13

  international_transfers:
    label: "International Data Transfers"
    description: "Cross-border data transfer mechanisms"
    required_in: ["privacy_policy", "data_processing_agreement"]
    transfer_mechanisms:
      - standard_contractual_clauses
      - binding_corporate_rules
      - adequacy_decisions
      - consent

  policy_changes:
    label: "Changes to This Policy"
    description: "How we notify of policy changes"
    required_in: ["privacy_policy"]
    notification_methods:
      - email
      - website_banner
      - in_app_notification

  contact_information:
    label: "Contact Us"
    description: "How to reach us"
    required_in: ["privacy_policy", "terms_of_service"]
    template_key: "legal_contact"

# =============================================================================
# CONSENT TYPES
# =============================================================================
# Types of consent that can be collected and tracked.

consent_types:
  terms_acceptance:
    label: "Terms of Service Acceptance"
    description: "User accepted the Terms of Service"
    document_type: terms_of_service
    required_for_account: true
    revocable: false
    collection_points:
      - signup
      - checkout

  privacy_acceptance:
    label: "Privacy Policy Acceptance"
    description: "User accepted the Privacy Policy"
    document_type: privacy_policy
    required_for_account: true
    revocable: false
    collection_points:
      - signup

  marketing_emails:
    label: "Marketing Emails"
    description: "Consent to receive marketing communications"
    required_for_account: false
    revocable: true
    default: false
    collection_points:
      - signup
      - account_settings
      - checkout
    opt_out_mechanism: unsubscribe_link

  analytics_cookies:
    label: "Analytics Cookies"
    description: "Consent for analytics tracking cookies"
    required_for_account: false
    revocable: true
    default: false
    gdpr_category: "performance"
    collection_points:
      - cookie_banner

  marketing_cookies:
    label: "Marketing Cookies"
    description: "Consent for marketing and advertising cookies"
    required_for_account: false
    revocable: true
    default: false
    gdpr_category: "targeting"
    collection_points:
      - cookie_banner

  functional_cookies:
    label: "Functional Cookies"
    description: "Consent for functional enhancement cookies"
    required_for_account: false
    revocable: true
    default: true
    gdpr_category: "functional"
    collection_points:
      - cookie_banner

  data_processing:
    label: "Data Processing Consent"
    description: "Explicit consent for specific data processing"
    required_for_account: false
    revocable: true
    gdpr_lawful_basis: consent
    collection_points:
      - specific_feature_usage

  age_verification:
    label: "Age Verification"
    description: "User confirms they meet minimum age requirement"
    required_for_account: true
    revocable: false
    minimum_age: 18
    collection_points:
      - signup

  newsletter_subscription:
    label: "Newsletter Subscription"
    description: "Consent to receive newsletter"
    required_for_account: false
    revocable: true
    default: false
    collection_points:
      - signup
      - footer_form
      - account_settings
    opt_out_mechanism: unsubscribe_link

# =============================================================================
# COMPLIANCE FRAMEWORKS
# =============================================================================
# Supported compliance frameworks and their requirements.

compliance_frameworks:
  gdpr:
    label: "GDPR"
    full_name: "General Data Protection Regulation"
    jurisdiction: "European Union"
    effective_date: "2018-05-25"
    requirements:
      - explicit_consent
      - data_subject_rights
      - data_breach_notification_72h
      - dpo_appointment
      - privacy_by_design
      - data_processing_records
      - lawful_basis_documentation
    penalties:
      max_fine_percentage: 4
      max_fine_amount: 20000000
      currency: EUR

  ccpa:
    label: "CCPA"
    full_name: "California Consumer Privacy Act"
    jurisdiction: "California, USA"
    effective_date: "2020-01-01"
    requirements:
      - privacy_notice
      - opt_out_sale
      - access_requests
      - deletion_requests
      - non_discrimination
    penalties:
      per_violation_intentional: 7500
      per_violation_unintentional: 2500
      currency: USD

  cpra:
    label: "CPRA"
    full_name: "California Privacy Rights Act"
    jurisdiction: "California, USA"
    effective_date: "2023-01-01"
    extends: ccpa
    additional_requirements:
      - sensitive_personal_information
      - opt_out_sharing
      - data_minimization
      - purpose_limitation
      - retention_limits

  pipeda:
    label: "PIPEDA"
    full_name: "Personal Information Protection and Electronic Documents Act"
    jurisdiction: "Canada"
    effective_date: "2000-04-13"
    requirements:
      - accountability
      - identifying_purposes
      - consent
      - limiting_collection
      - limiting_use_disclosure_retention
      - accuracy
      - safeguards
      - openness
      - individual_access
      - challenging_compliance

  coppa:
    label: "COPPA"
    full_name: "Children's Online Privacy Protection Act"
    jurisdiction: "United States"
    effective_date: "2000-04-21"
    requirements:
      - parental_consent
      - privacy_notice
      - data_minimization
      - data_security
      - data_retention_limits
    minimum_age: 13

  dma:
    label: "DMA"
    full_name: "Digital Markets Act"
    jurisdiction: "European Union"
    effective_date: "2023-05-02"
    applies_to: "gatekeepers"
    requirements:
      - interoperability
      - data_portability
      - fair_access
      - transparency_reporting

  dsa:
    label: "DSA"
    full_name: "Digital Services Act"
    jurisdiction: "European Union"
    effective_date: "2024-02-17"
    requirements:
      - content_moderation
      - transparency_reports
      - illegal_content_removal
      - appeals_mechanism
      - trusted_flaggers

# =============================================================================
# JURISDICTION CONFIGURATIONS
# =============================================================================
# Jurisdiction-specific legal configurations.

jurisdictions:
  us_california:
    label: "California, USA"
    governing_law: "State of California"
    venue: "Ventura County, California"
    arbitration_provider: "JAMS"
    arbitration_rules: "Comprehensive Arbitration Rules & Procedures"
    small_claims_limit: 10000
    applicable_frameworks:
      - ccpa
      - cpra
      - coppa

  us_delaware:
    label: "Delaware, USA"
    governing_law: "State of Delaware"
    venue: "Court of Chancery of the State of Delaware"
    notes: "Common for corporate entities"

  eu_general:
    label: "European Union"
    governing_law: "Laws of the Republic of Ireland"
    venue: "Courts of Ireland"
    applicable_frameworks:
      - gdpr
      - dma
      - dsa
    data_protection_authority: "Irish Data Protection Commission"

  uk:
    label: "United Kingdom"
    governing_law: "Laws of England and Wales"
    venue: "Courts of England and Wales"
    applicable_frameworks:
      - uk_gdpr
    data_protection_authority: "Information Commissioner's Office"

  canada:
    label: "Canada"
    governing_law: "Laws of Ontario, Canada"
    venue: "Courts of Ontario"
    applicable_frameworks:
      - pipeda
    data_protection_authority: "Office of the Privacy Commissioner of Canada"

# =============================================================================
# COOKIE CONSENT CONFIGURATION
# =============================================================================
# Cookie banner and preference center configuration.

cookie_consent:
  banner:
    title: "Cookie Preference Center"
    description: |
      When you visit our website, we use cookies and other similar technologies
      (collectively, "Cookies") to provide site functionality and for analytics,
      advertising, personalization, and otherwise to enhance your experience.
      Your cookie settings are specific to the device, website, and browser you
      are using, and are deleted whenever you clear your browser's cache.
    privacy_policy_link: true
    buttons:
      - id: allow_all
        label: "Allow All"
        action: accept_all
      - id: reject_all
        label: "Reject All"
        action: reject_non_essential
      - id: confirm
        label: "Confirm My Choices"
        action: save_preferences

  categories:
    strictly_necessary:
      label: "Strictly Necessary Cookies"
      description: |
        These cookies are essential for the website to function properly.
        They enable basic functions like page navigation, secure area access,
        and remembering your cookie preferences. The website cannot function
        properly without these cookies.
      required: true
      default: true
      can_disable: false
      examples:
        - session_id
        - csrf_token
        - cookie_consent

    performance_analytics:
      label: "Performance & Analytics Cookies"
      description: |
        These cookies help us understand how visitors interact with our website
        by collecting and reporting information anonymously. This helps us
        improve our website and your experience.
      required: false
      default: false
      can_disable: true
      gdpr_category: performance
      vendors:
        - name: "Google Analytics"
          privacy_url: "https://policies.google.com/privacy"
        - name: "Mixpanel"
          privacy_url: "https://mixpanel.com/legal/privacy-policy"
      examples:
        - _ga
        - _gid
        - _gat

    functional:
      label: "Functional Cookies"
      description: |
        These cookies enable enhanced functionality and personalization, such
        as remembering your preferences, language settings, and login status.
        If you disable these cookies, some features may not work properly.
      required: false
      default: true
      can_disable: true
      gdpr_category: functional
      examples:
        - language_preference
        - theme_preference
        - recently_viewed

    targeting_advertising:
      label: "Targeting & Advertising Cookies"
      description: |
        These cookies are used to deliver advertisements more relevant to you
        and your interests. They also help limit the number of times you see
        an advertisement and measure the effectiveness of advertising campaigns.
      required: false
      default: false
      can_disable: true
      gdpr_category: targeting
      ccpa_sale_sharing: true
      vendors:
        - name: "Google Ads"
          privacy_url: "https://policies.google.com/privacy"
        - name: "Meta Pixel"
          privacy_url: "https://www.facebook.com/privacy/policy"
        - name: "LinkedIn Insight"
          privacy_url: "https://www.linkedin.com/legal/privacy-policy"
      examples:
        - _fbp
        - _gcl_au
        - li_sugr

  ccpa_opt_out:
    enabled: true
    link_text: "Do Not Sell or Share My Personal Information"
    link_location:
      - footer
      - privacy_policy
    description: |
      California Residents: To opt-out of the sale or sharing of your personal
      information, other than cookies, click on the "Do Not Sell or Share My
      Personal Information" link.

  global_privacy_control:
    enabled: true
    description: |
      We honor the Global Privacy Control (GPC) signal. If your browser sends
      a GPC signal, we will treat it as a valid opt-out request for the sale
      or sharing of your personal information.

  retention:
    consent_record: "3 years"
    cookie_preferences: "1 year"

# =============================================================================
# PERSONAL INFORMATION CATEGORIES
# =============================================================================
# Categories of personal information collected (for privacy policy disclosure).

personal_information_categories:
  identifiers:
    label: "Personal Identifiers"
    description: "Name, email address, phone number, mailing address, IP address"
    examples:
      - full_name
      - email_address
      - phone_number
      - mailing_address
      - ip_address
      - account_username
    ccpa_category: "A"
    sensitive: false

  demographics:
    label: "Demographic Information"
    description: "Age, gender, location, language preferences"
    examples:
      - age_range
      - gender
      - country
      - timezone
      - language
    ccpa_category: "B"
    sensitive: false

  financial:
    label: "Financial Information"
    description: "Payment card details, billing address, transaction history"
    examples:
      - payment_card_last_four
      - billing_address
      - purchase_history
      - subscription_status
    ccpa_category: "D"
    sensitive: true
    pci_scope: true

  commercial:
    label: "Commercial Information"
    description: "Products/services purchased, usage patterns, preferences"
    examples:
      - purchase_history
      - subscription_tier
      - feature_usage
      - support_tickets
    ccpa_category: "D"
    sensitive: false

  internet_activity:
    label: "Internet/Device Activity"
    description: "Browsing history, device info, interaction with our services"
    examples:
      - pages_visited
      - click_patterns
      - device_type
      - browser_type
      - referral_source
    ccpa_category: "F"
    sensitive: false
    collected_automatically: true

  geolocation:
    label: "Geolocation Data"
    description: "Approximate location based on IP address"
    examples:
      - city
      - region
      - country
    ccpa_category: "G"
    sensitive: false
    precise_location: false

  audio_visual:
    label: "Audio/Visual Information"
    description: "Profile photos, uploaded media, call recordings (if consented)"
    examples:
      - profile_photo
      - uploaded_images
      - support_call_recordings
    ccpa_category: "H"
    sensitive: false
    requires_consent: true

  professional:
    label: "Professional/Employment Information"
    description: "Job title, company name, professional background"
    examples:
      - job_title
      - company_name
      - industry
      - company_size
    ccpa_category: "I"
    sensitive: false

  inferences:
    label: "Inferences"
    description: "Profiles reflecting preferences, characteristics, behavior"
    examples:
      - interest_categories
      - predicted_preferences
      - engagement_score
    ccpa_category: "K"
    sensitive: false
    derived_data: true

  sensitive_personal:
    label: "Sensitive Personal Information"
    description: "Government IDs, precise geolocation, biometric data (if applicable)"
    examples:
      - government_id_number
      - precise_geolocation
    ccpa_category: "Sensitive"
    sensitive: true
    requires_explicit_consent: true
    minimize_collection: true

# =============================================================================
# AI USAGE DISCLOSURE
# =============================================================================
# AI/ML usage in services for transparency.

ai_usage:
  enabled: true
  disclosure_required: true
  uses:
    - name: "Email Classification"
      description: "AI categorizes incoming emails by priority and topic"
      data_used:
        - email_subject
        - email_body
        - sender_information
      human_oversight: true
      automated_decision: false

    - name: "Auto-Reply Drafting"
      description: "AI generates draft email responses for human review"
      data_used:
        - email_content
        - conversation_context
      human_oversight: true
      automated_decision: false

    - name: "Content Recommendations"
      description: "AI suggests relevant content based on usage patterns"
      data_used:
        - browsing_history
        - interaction_data
      human_oversight: false
      automated_decision: false

    - name: "Support Chat"
      description: "AI-powered chat assistance for common questions"
      data_used:
        - chat_messages
        - account_context
      human_oversight: true
      automated_decision: false

  opt_out_available: true
  gdpr_article_22_compliant: true

# =============================================================================
# DOCUMENT TEMPLATES
# =============================================================================
# Reusable content blocks and templates.

templates:
  legal_intro_tos:
    content: |
      Welcome to {company_name}. These Terms of Service ("Terms") govern your
      access to and use of {company_name}'s website, products, and services
      (collectively, the "Services"). Please read these Terms carefully before
      using our Services.

      By accessing or using our Services, you agree to be bound by these Terms.
      If you do not agree to these Terms, you may not access or use the Services.

  legal_intro_privacy:
    content: |
      {company_name} ("we," "us," or "our") respects your privacy and is
      committed to protecting your personal information. This Privacy Policy
      explains how we collect, use, disclose, and safeguard your information
      when you use our services.

      Please read this Privacy Policy carefully. If you do not agree with the
      terms of this Privacy Policy, please do not access our services.

  legal_contact:
    content: |
      If you have any questions about these {document_type}, please contact us at:

      {company_name}
      {company_address}
      Email: {legal_email}

  legal_changes_notice:
    content: |
      We may update this {document_type} from time to time. We will notify you
      of any changes by posting the new {document_type} on this page and updating
      the "Last Updated" date. You are advised to review this {document_type}
      periodically for any changes.

  arbitration_agreement:
    content: |
      PLEASE READ THIS SECTION CAREFULLY. IT AFFECTS YOUR LEGAL RIGHTS,
      INCLUDING YOUR RIGHT TO FILE A LAWSUIT IN COURT.

      You and {company_name} agree to resolve any disputes through final and
      binding arbitration, except as set forth below. This includes any claims
      arising out of or relating to these Terms, the Services, or our
      relationship (collectively, "Disputes").

  class_action_waiver:
    content: |
      YOU AND {company_name} AGREE THAT EACH MAY BRING CLAIMS AGAINST THE OTHER
      ONLY IN YOUR OR ITS INDIVIDUAL CAPACITY AND NOT AS A PLAINTIFF OR CLASS
      MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE ACTION.

  no_legal_advice:
    content: |
      {company_name} is not a law firm and does not provide legal advice. The
      information provided through our Services is for general informational
      purposes only and should not be relied upon as legal advice. You should
      consult with a qualified attorney for advice regarding your specific
      situation.

# =============================================================================
# ENTITY INFORMATION
# =============================================================================
# Company legal entity information for document generation.

entities:
  lightwave_media:
    legal_name: "LightWave Media LLC"
    dba: "LightWave Media"
    entity_type: "Limited Liability Company"
    jurisdiction: "California"
    address:
      street: "623 N Spaulding Ave"
      city: "Los Angeles"
      state: "CA"
      zip: "90036"
      country: "USA"
    contact:
      legal_email: "legal@lightwave-media.ltd"
      privacy_email: "privacy@lightwave-media.ltd"
      support_email: "support@lightwave-media.ltd"
    dpo:
      name: "Data Protection Officer"
      email: "dpo@lightwave-media.ltd"

# =============================================================================
# CODEGEN HINTS
# =============================================================================

_codegen:
  pydantic:
    enabled: true
    output_path: "lightwave/schema/pydantic/models/legal.py"
    base_class: "JSONFieldSchema"
    models:
      - LegalDocumentSchema
      - LegalSectionSchema
      - UserConsentSchema
      - ConsentRecordSchema
      - ComplianceRequirementSchema

  django:
    enabled: true
    app: "apps.legal"
    models:
      - name: LegalDocument
        fields:
          - document_type  # from document_types
          - version
          - effective_date
          - content
          - sections
          - is_active
      - name: UserConsent
        fields:
          - user
          - consent_type  # from consent_types
          - document_version
          - consented_at
          - ip_address
          - user_agent
          - revoked_at

# =============================================================================
# VALIDATION RULES
# =============================================================================

_validation:
  rules:
    - name: "document_type_valid"
      description: "Document type must be defined in document_types"
      severity: error

    - name: "consent_type_valid"
      description: "Consent type must be defined in consent_types"
      severity: error

    - name: "sections_documented"
      description: "All sections should have descriptions"
      severity: warning

    - name: "legal_review_flagged"
      description: "Sections requiring legal review should be flagged"
      severity: warning

    - name: "jurisdiction_specified"
      description: "Jurisdiction-specific sections must specify jurisdiction"
      severity: error

# =============================================================================
# REFERENCES
# =============================================================================

_references:
  related_schemas:
    - schema_id: "lightwave://schemas/field_options"
      description: "Field option enums including legal_document_types"

    - schema_id: "lightwave://schemas/tenants"
      description: "Tenant configuration for multi-tenant legal docs"

  external:
    - url: "https://gdpr.eu/"
      description: "GDPR official text"

    - url: "https://oag.ca.gov/privacy/ccpa"
      description: "CCPA official resources"

    - url: "https://www.priv.gc.ca/en/privacy-topics/privacy-laws-in-canada/the-personal-information-protection-and-electronic-documents-act-pipeda/"
      description: "PIPEDA official resources"
