AutoBE
    Preparing search index...

    Interface AutoBeDatabaseComponent

    Interface representing a logical grouping of database tables organized by business domain for schema file generation.

    Components provide a systematic way to organize database tables into coherent groups following domain-driven design principles. Each component represents a specific business domain or functional area that will be generated as a separate Prisma schema file, ensuring maintainable and logically structured database architecture.

    This interface is primarily used during the database design phase when the Database agent analyzes requirements and determines the complete scope of tables needed, then organizes them into logical groups based on business relationships and functional dependencies.

    Components serve as the blueprint for generating multiple Prisma schema files:

    1. Requirements Analysis: AI agent identifies all required tables from business requirements
    2. Domain Grouping: Tables are organized into components based on business domains and functional relationships
    3. File Generation: Each component becomes a separate .prisma file containing related models
    4. Dependency Management: Components are ordered to handle cross-domain relationships properly

    Based on typical business applications, components commonly include:

    • Systematic: Core system tables (channels, sections, configurations)
    • Actors: User management (customers, citizens, administrators)
    • Sales: Product catalog and sales entities
    • Carts: Shopping cart and item management
    • Orders: Order processing and fulfillment
    • Coupons: Discount and promotion systems
    • Coins: Digital currency and mileage systems
    • Inquiries: Customer support and FAQ systems
    • Favorites: User preference and wishlist management
    • Articles: Content management and BBS systems

    Each AutoBeDatabaseComponent serves as a blueprint for generating one IFile during the schema generation process. The component's metadata (filename, namespace, tables) is used to structure the actual Prisma schema file with proper models, relationships, and indexes.

    Samchon

    • AutoBeDatabase.IFile For the actual schema file structure generated from components
    • AutoBeDatabaseComponentEvent For the event that delivers component organization results
    interface AutoBeDatabaseComponent {
        filename: string & Pattern<"^[a-zA-Z0-9._-]+\\.prisma$">;
        namespace: string;
        rationale: string;
        review: string;
        tables: AutoBeDatabaseComponentTableDesign[] & MinItems<1>;
        thinking: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    filename: string & Pattern<"^[a-zA-Z0-9._-]+\\.prisma$">

    Target filename for the Prisma schema file containing this component's tables.

    🔧 TECHNICAL FIELD #2: Determined AFTER reasoning and namespace are complete. Follows the naming convention schema-{number}-{domain}.prisma where the number indicates dependency order and domain represents the business area.

    namespace: string

    Business domain namespace that groups related models.

    🔧 TECHNICAL FIELD #1: Determined AFTER reasoning is complete. Used in Prisma documentation comments as "@\namespace directive". Examples: "Systematic", "Actors", "Sales", "Carts", "Orders", "Coupons", "Coins", "Inquiries", "Favorites", "Articles"

    rationale: string

    Final rationale for this component's composition.

    REASONING FIELD #3: The conclusive reasoning that cements the component's structure before committing to technical choices (namespace, filename).

    Example:

    "This component groups all actor-related tables to maintain a clear
    separation between identity management and business transactions."
    
    review: string

    Review considerations for this component grouping.

    REASONING FIELD #2: After initial thinking, the AI reviews its decisions by considering relationships with other domains and validating the grouping strategy.

    Example:

    "Reviewed relationships with other domains. While customers create orders,
    the customer entity itself is fundamentally about user identity, not sales."
    
    tables: AutoBeDatabaseComponentTableDesign[] & MinItems<1>

    Array of table designs that will be included in this component's schema file.

    Contains all database tables that belong to this business domain, each with a name and description explaining its purpose. This ensures logical grouping, proper organization, and clear documentation of related data structures.

    thinking: string

    Initial thoughts on why these tables belong together.

    REASONING FIELD #1: This field comes FIRST to ensure the AI reasons through the component's purpose before determining technical details. Function calling order matters - thinking drives decision-making.

    Example:

    "These tables all relate to user management and authentication.
    They share common patterns like user identification and access control."