import { assertOwnTenant } from '@voltro/plugin-multitenancy/guard' import type { AppContext } from '@voltro/runtime' const execute = async ( input: { tenantId: string; title: string; body: string }, ctx: AppContext, ) => { assertOwnTenant(input.tenantId, ctx.request.subject) // Framework auto-injects a `note_…` id from the table's id() decl. return ctx.store.insert('notes', { title: input.title, body: input.body, done: false, tenantId: input.tenantId, createdAt: new Date(), }) } export default execute