effect-tea-persistent
    Preparing search index...

    A child, as a parent holds it: a state with its messages, operations and work, and no name, indexes or migrations. The entity is the parent's, and so are its address, its row of the read model and the versions of its state (decision 0133). A part with children of its own is a part too, so a tree is as deep as a program needs.

    interface Part<T extends PartTypes> {
        "[PartTypeId]"?: T;
        init: (flags: T["flags"], at: Utc) => T["state"];
        keys: Keys<T["key"], T["parameter"]>;
        operations: Runners<T>;
        project: (state: T["state"]) => T["projection"];
        schemas: Readonly<
            {
                inbound: Schema.Codec<T["inbound"], Json>;
                internal: Schema.Codec<T["internal"], Json>;
                operation: Schema.Codec<T["operation"], Json>;
                rejection: Schema.Codec<T["rejection"], Json>;
                state: Schema.Codec<T["state"], Json>;
            },
        >;
        update: (
            message: T["inbound"] | T["internal"] | T["external"],
            meta: Meta<T["sender"]>,
        ) => (
            state: T["state"],
        ) => Step<T["state"], T["event"]> | Rejected<T["rejection"]>;
        work: (
            state: T["state"],
        ) => Readonly<
            Record<string, Returned<T["operation"], T["internal"]> | undefined>,
        >;
    }

    Type Parameters

    Index
    "[PartTypeId]"?: T

    Only in the type, so that a parent reads the part's types back: no part has the property.

    init: (flags: T["flags"], at: Utc) => T["state"]

    The child's first state. A part's init never rejects: its parent calls it, in its own init or update, and the parent decides there whether the child starts (decision 0182).

    keys: Keys<T["key"], T["parameter"]>

    Every key the child's work is held under, as a program's are. The parent holds them under the child's name.

    operations: Runners<T>

    The runner of each of the child's operations, by its tag, with its delivery.

    project: (state: T["state"]) => T["projection"]

    The child's projection, which the parent reads in its own project.

    schemas: Readonly<
        {
            inbound: Schema.Codec<T["inbound"], Json>;
            internal: Schema.Codec<T["internal"], Json>;
            operation: Schema.Codec<T["operation"], Json>;
            rejection: Schema.Codec<T["rejection"], Json>;
            state: Schema.Codec<T["state"], Json>;
        },
    >

    The schemas the parent's are made of. The parent's state and projection schemas are the parent's own, and hold the child's where the parent puts it.

    update: (
        message: T["inbound"] | T["internal"] | T["external"],
        meta: Meta<T["sender"]>,
    ) => (
        state: T["state"],
    ) => Step<T["state"], T["event"]> | Rejected<T["rejection"]>

    The child's next step for one of its messages, its parent's included: a state, a state with events for the parent, or a rejection.

    work: (
        state: T["state"],
    ) => Readonly<
        Record<string, Returned<T["operation"], T["internal"]> | undefined>,
    >

    The work the child's state holds, by key, as a program's work.