Terms Setup Overview

Overview of the IP Licensing Terms Setup feature

What is Terms Setup?

Terms Setup is a feature that enables accounts (sellers) to define and manage intellectual property (IP) licensing terms for their content. It provides a comprehensive system for creating, updating, approving, and managing three types of IP terms: VoiceOver, Image, and Likeness.

Purpose

The Terms Setup feature allows sellers to:

  • Define licensing terms for their intellectual property before it's used
  • Specify compensation models (one-time fees, percentage-based, per-use pricing)
  • Set approval requirements (no approval needed, user approval, agent approval, AI approval)
  • Add custom restrictions and usage permissions
  • Track terms versions for legal compliance
  • Maintain audit trails of who created, modified, or deleted terms

Key Concepts

IP Term Types

The system supports three distinct types of IP terms:

  1. VoiceOver - Terms for voice recordings and audio content
  2. Image - Terms for image and photograph licensing
  3. Likeness - Terms for using a person's likeness or appearance

Each account can have exactly one active term per type at any given time.

Term Lifecycle

  1. Creation - Terms are automatically generated with defaults when first accessed
  2. Configuration - Sellers can customize compensation, approval requirements, and restrictions
  3. Approval - Terms must be explicitly approved (ipApprove: true) before they become active
  4. Usage - Approved terms are used for licensing transactions
  5. Deletion - Terms are soft-deleted (preserved for audit) rather than permanently removed

Compensation Models

Terms support various compensation structures:

  • One-time fees per minute, second, or image
  • Percentage-based compensation from net revenues
  • Per-use pricing (e.g., payment per 1000 views)
  • Custom offers (MAKE_ME_AN_OFFER compensation type)

Approval Workflows

Terms can require different levels of approval:

  • No approval needed - Automatic usage
  • User approval - Seller must approve each use
  • Agent approval - Designated agent approves uses
  • AI approval - Automated approval based on criteria

Architecture Overview

The Terms Setup feature follows a layered architecture:

  • API Layer (apps/zooly-app/app/api/terms-setup/) - Next.js route handlers
  • Service Layer (packages/app/srv/src/terms-setup/) - Core business logic
  • Database Layer (packages/db/src/access/ipTerms.ts) - Data access functions
  • Terms Package (packages/terms/) - Legal text templates and formatting

This separation ensures:

  • Testability - Each layer can be tested independently
  • Maintainability - Clear separation of concerns
  • Reusability - Core logic can be used by different clients
  • Type Safety - Strong TypeScript typing throughout

Key Features

Automatic Term Generation

When a seller first accesses terms for a specific type, the system automatically generates default terms with sensible defaults. This eliminates the need for manual setup and ensures all accounts have terms available.

Soft Delete

Terms are never physically deleted from the database. Instead, they're marked with a deletedAt timestamp. This preserves audit trails and allows terms to be recreated after deletion.

Audit Trail

Every term change is tracked:

  • Who created it (createdBy)
  • Who last updated it (updatedBy)
  • When it was created (createdAt)
  • When it was last updated (updatedAt)
  • When it was deleted (deletedAt)

Terms Versioning

Each term includes a termsVersion field that tracks which version of the legal template was used. This enables compliance tracking and allows for future template updates.

Admin Access

Users with the "admin" role can manage terms for any account by providing an accountId parameter. This enables support and administrative workflows.