Circle V2 API Docs
    Preparing search index...

    Variable zLegacySelectedTemplateConst

    zLegacySelectedTemplate: ZodObject<
        {
            additional_ai_instructions: ZodOptional<ZodString>;
            check_cpt: ZodOptional<ZodBoolean>;
            check_demo: ZodOptional<ZodBoolean>;
            check_dsm_5: ZodOptional<ZodBoolean>;
            check_icd_10: ZodOptional<ZodBoolean>;
            created_by: ZodOptional<
                ZodNullable<
                    ZodPipe<ZodString, ZodTransform<UserId, string>> & zIdInnerType<
                        ZodString,
                    >,
                >,
            >;
            created_by_circle: ZodOptional<ZodBoolean>;
            hidden_instructions: ZodOptional<ZodNullable<ZodString>>;
            id: ZodPipe<ZodString, ZodTransform<TemplateId, string>> & zIdInnerType<
                ZodString,
            >;
            is_allow_bullet_points: ZodOptional<ZodBoolean>;
            is_unstructured_narrative: ZodOptional<ZodBoolean>;
            last_updated: ZodOptional<ZodNullable<ZodString>>;
            last_used: ZodOptional<ZodNullable<ZodString>>;
            name: ZodOptional<ZodString>;
            original_template_id: ZodOptional<ZodString>;
            sections: ZodArray<
                ZodObject<
                    {
                        body: ZodString;
                        bullet_format: ZodOptional<ZodBoolean>;
                        id: ZodPipe<ZodString, ZodTransform<SectionId, string>> & zIdInnerType<
                            ZodString,
                        >;
                        name: ZodString;
                        optional: ZodBoolean;
                        order: ZodNumber;
                    },
                    $strip,
                >,
            >;
            selected_audit_template_ids: ZodOptional<ZodArray<ZodNumber>>;
            shared_with_org_id: ZodOptional<ZodString>;
            title: ZodString;
        },
        $loose,
    > = ...

    TODO: Refactor this to a proper type

    This was taken from app/client/templates/types/template.ts in the legacy codebase.

    • Currently we store the "selected template" as a jsonb in the database instead of a proper reference
    • This feels wrong... perhaps there's a good reason for it, but we should definitely revisit this