Skip to content

Latest commit

 

History

History
106 lines (72 loc) · 3.43 KB

File metadata and controls

106 lines (72 loc) · 3.43 KB
//////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY THIS FILE                                                                  //
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
// Source: showcase.zmodel · Generated: 2026-02-23                                          //
//////////////////////////////////////////////////////////////////////////////////////////////

Index / Models / Activity

🗃️ Activity Model

Records significant events for audit and activity feed purposes.

Category: Audit · Since: 2.0 · Defined in: showcase.zmodel


Declaration · showcase.zmodel
model Activity with Timestamps {
    id     String  @id @default(uuid())
    action String
    detail String?
    user   User    @relation(fields: [userId], references: [id])
    userId String
    task   Task?   @relation(fields: [taskId], references: [id])
    taskId String?

    @@allow('read', true)
    @@deny('update,delete', true)
    @@meta('doc:category', 'Audit')
    @@meta('doc:since', '2.0')
}

On this page: Mixins · Fields · Relationships · Access Policies

🧩 Mixins

Reusable field groups mixed into this model.

📋 Fields

All fields defined on this entity, including inherited fields from mixins and parent models.

Field Type Required Default Attributes Source Description
createdAt DateTime Yes now() Timestamps
updatedAt DateTime Yes @updatedAt Timestamps
id String Yes uuid() @id
action String Yes
detail String? No
user User Yes @relation(fields: [userId], references: [id])
userId String Yes
task Task? No @relation(fields: [taskId], references: [id])
taskId String? No

🔗 Relationships

Foreign key relationships to other models in the schema.

Field Related Model Type
task Task Many→One?
user User Many→One

diagram

🔐 Access Policies

ZenStack access control rules that determine who can read, create, update, or delete records.

Important

Operations are denied by default. @@allow rules grant access; @@deny rules override any allow.

Operation Rule Effect
read true Allow
update,delete true Deny

📚 References


Next: Comment