Documentation
¶
Index ¶
- func DeletedAtHook(next ent.Mutator) ent.Mutator
- func IDField(fieldName string) ent.Field
- func NewUUID() uuid.UUID
- func UpdatedAtHook(next ent.Mutator) ent.Mutator
- func WithStatus(ctx context.Context, status Status) context.Context
- type ActiveStatus
- type ActiveStatusSchema
- type AuditedEntitySchema
- type BaseEntitySchema
- type DomainScopeMixin
- type GlobalEntitySchema
- type Media
- type MediaFormat
- type Status
- type StatusContextKey
- type TenantEntitySchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDField ¶
IDField creates a UUID field with standard configuration. fieldName should be the database field name in snake_case (e.g., "id", "created_by_id"). The JSON tag will be converted to lowerCamelCase (e.g., "id", "createdById").
Types ¶
type ActiveStatus ¶
type ActiveStatus string
const ( StatusActive ActiveStatus = "active" StatusInactive ActiveStatus = "inactive" )
func (*ActiveStatus) Scan ¶
func (s *ActiveStatus) Scan(value any) error
type ActiveStatusSchema ¶
func (ActiveStatusSchema) Fields ¶
func (ActiveStatusSchema) Fields() []ent.Field
type AuditedEntitySchema ¶
AuditedEntitySchema defines shared id/audit fields without tenant scoping.
func (AuditedEntitySchema) Fields ¶
func (AuditedEntitySchema) Fields() []ent.Field
func (AuditedEntitySchema) Indexes ¶
func (AuditedEntitySchema) Indexes() []ent.Index
type BaseEntitySchema ¶
type BaseEntitySchema struct {
AuditedEntitySchema
}
func (BaseEntitySchema) Fields ¶
func (BaseEntitySchema) Fields() []ent.Field
Fields returns domain-scoped entity fields (id + audit + owner_domain_id).
func (BaseEntitySchema) Indexes ¶
func (BaseEntitySchema) Indexes() []ent.Index
Indexes returns domain-scoped entity indexes.
type DomainScopeMixin ¶
DomainScopeMixin adds an optional owner_domain_id field for domain-scoped data isolation. Entities using this mixin can be filtered by the DomainInterceptor based on the acting domain.
func (DomainScopeMixin) Fields ¶
func (DomainScopeMixin) Fields() []ent.Field
func (DomainScopeMixin) Indexes ¶
func (DomainScopeMixin) Indexes() []ent.Index
type GlobalEntitySchema ¶
type GlobalEntitySchema struct {
AuditedEntitySchema
}
GlobalEntitySchema defines global/platform-scoped entities.
func (GlobalEntitySchema) Fields ¶
func (GlobalEntitySchema) Fields() []ent.Field
Fields returns global/platform entity fields.
func (GlobalEntitySchema) Indexes ¶
func (GlobalEntitySchema) Indexes() []ent.Index
Indexes returns global/platform entity indexes.
type MediaFormat ¶
func (MediaFormat) Edges ¶
func (MediaFormat) Edges() []ent.Edge
func (MediaFormat) Fields ¶
func (MediaFormat) Fields() []ent.Field
func (MediaFormat) Indexes ¶
func (MediaFormat) Indexes() []ent.Index
func (MediaFormat) Mixin ¶
func (MediaFormat) Mixin() []ent.Mixin
type StatusContextKey ¶
type StatusContextKey struct{}
type TenantEntitySchema ¶
type TenantEntitySchema struct {
AuditedEntitySchema
}
TenantEntitySchema defines tenant-scoped entities.
func (TenantEntitySchema) Fields ¶
func (TenantEntitySchema) Fields() []ent.Field
Fields returns tenant-scoped fields and requires explicit tenant assignment.
func (TenantEntitySchema) Indexes ¶
func (TenantEntitySchema) Indexes() []ent.Index
Indexes returns tenant-scoped indexes.