AutoBE
    Preparing search index...

    Interface AutoBeRealizeCollectorMapping

    Field/relation mapping for Prisma CreateInput generation.

    Documents handling strategy for ONE Prisma schema member. EVERY field and relation must be listed — the validator rejects incomplete mappings.

    Samchon

    interface AutoBeRealizeCollectorMapping {
        how: string;
        kind: "scalar" | "belongsTo" | "hasOne" | "hasMany";
        member: string;
        nullable: boolean | null;
    }
    Index

    Properties

    Properties

    how: string

    Brief strategy for obtaining this field's value (NOT code).

    Write phase: "Generate with v4()", "From props.body.email", "Connect using props.customer.id", "Nested create with TagCollector".

    Correct phase: "No change needed", "Fix: Wrong name 'x' → 'y'".

    Even if correct or unused, you MUST include it. This ensures complete schema coverage.

    kind: "scalar" | "belongsTo" | "hasOne" | "hasMany"

    Kind of Prisma schema member.

    • "scalar": Regular column → direct value assignment
    • "belongsTo": FK relation → { connect: { id } }
    • "hasOne": 1:1 relation this side owns
    • "hasMany": 1:N or M:N → { create: [...] } or omit

    The kind forces explicit classification BEFORE deciding how to handle it, preventing confusion like treating belongsTo relations as scalar fields.

    member: string

    Exact field or relation name from Prisma schema (case-sensitive).

    Examples:

    // Scalar fields
    { member: "id", kind: "scalar", nullable: false, how: "Generate with v4()" }
    { member: "email", kind: "scalar", nullable: false, how: "From props.body.email" }
    { member: "created_at", kind: "scalar", nullable: false, how: "Default to new Date()" }
    { member: "description", kind: "scalar", nullable: true, how: "From props.body.description ?? null" }

    // BelongsTo relations — use Prisma RELATION name, NOT FK column name
    { member: "customer", kind: "belongsTo", nullable: false, how: "Connect using props.customer.id" }
    { member: "parent", kind: "belongsTo", nullable: true, how: "Undefined (nullable FK)" }

    // HasMany relations
    { member: "tags", kind: "hasMany", nullable: null, how: "Nested create with TagCollector" }
    { member: "comments", kind: "hasMany", nullable: null, how: "Not needed (optional has-many)" }

    DO NOT use FK column names (e.g., "customer_id" is WRONG — use "customer"). Include ALL members even if unused in this collector.

    nullable: boolean | null

    Whether nullable in Prisma schema.

    • false: Non-nullable — must provide value
    • true: Nullable — use ?? null for scalar, undefined for belongsTo
    • null: Not applicable (hasMany/hasOne)