{"modulePath":"github.com/gombit-dev/gombit","version":"v0.10.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package task\n\nCode generated by gombit make resource. DO NOT EDIT.\n\nCode generated by gombit make resource. DO NOT EDIT.\n\n## Functions\n\n```go\nfunc Register(app *framework.App)\n```\nRegister mounts task Huma routes, wiring the human-owned Hooks.\n\n```go\nfunc RegisterAdmin(app *framework.App) error\n```\nRegisterAdmin registers Task on the runtime admin. Feature packages own this call — the framework never discovers GORM models by itself (ADR-013).\n\nRegister requires cookie auth; it returns an error under Bearer-only mode.\n\n## Types\n\n```go\ntype Handler struct {\n\tDB    *gorm.DB\n\tHooks TaskHooks\n}\n```\nHandler serves Task HTTP operations over GORM. Register wires DB and Hooks.\n\n```go\ntype Hooks struct{}\n```\nHooks implements TaskHooks. This file is generated once and is yours to edit: set server-managed columns (tenant, owner, timestamps not handled by GORM, …) on row in BeforeCreate. Regeneration does not overwrite it.\n\n```go\nfunc (Hooks) BeforeCreate(ctx context.Context, row *Task, body taskCreateBody) error\n```\nBeforeCreate runs after the request is mapped onto row and before it is persisted. The default is a no-op; add server-derived values here.\n\n```go\ntype Task struct {\n\tID        uint `gorm:\"primaryKey\" json:\"id\"`\n\tCreatedAt time.Time\n\tUpdatedAt time.Time\n\tTitle     string `gorm:\"size:255;not null\"`\n\tDone      bool\n}\n```\nTask is the tutorial's feature-package GORM model — the human-owned source of truth, exactly as \\`gombit make resource Task title:string:required done:bool\\` scaffolds it (model-first: no \"do not edit\" banner). The request/response DTOs and CRUD handler are derived from it into the committed dto.gen.go / handler.gen.go, which TestGeneratedFilesAreFresh re-derives and byte-compares so this model and its generated files never drift. It has no soft-delete DeletedAt: Gombit deletes rows physically (ADR-019).\n\n```go\ntype TaskHooks interface {\n\tBeforeCreate(ctx context.Context, row *Task, body taskCreateBody) error\n}\n```\nTaskHooks are the customization points for the generated Task handler. The generated handler owns the invariant CRUD sequence and calls these; set server-managed columns (tenant, owner, …) in BeforeCreate rather than editing generated plumbing.\n\n","path":"github.com/gombit-dev/gombit/examples/tutorial/internal/task","name":"task","synopsis":"Code generated by gombit make resource.","isRedistributable":true}
