Documentation
¶
Index ¶
- func New(pool *pgxpool.Pool) port.ProcessRepository
- type Repository
- func (r *Repository) CountTemplatesByProcess(ctx context.Context, tenantID, processCode string) (int, error)
- func (r *Repository) Create(ctx context.Context, process *entity.Process) (string, error)
- func (r *Repository) Delete(ctx context.Context, id string) error
- func (r *Repository) ExistsByCode(ctx context.Context, tenantID, code string) (bool, error)
- func (r *Repository) ExistsByCodeExcluding(ctx context.Context, tenantID, code, excludeID string) (bool, error)
- func (r *Repository) FindByCode(ctx context.Context, tenantID, code string) (*entity.Process, error)
- func (r *Repository) FindByCodeWithGlobalFallback(ctx context.Context, tenantID, code string) (*entity.Process, error)
- func (r *Repository) FindByID(ctx context.Context, id string) (*entity.Process, error)
- func (r *Repository) FindByTenant(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.Process, int64, error)
- func (r *Repository) FindByTenantWithGlobalFallback(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.Process, int64, error)
- func (r *Repository) FindByTenantWithTemplateCount(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.ProcessListItem, int64, error)
- func (r *Repository) FindByTenantWithTemplateCountAndGlobal(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.ProcessListItem, int64, error)
- func (r *Repository) FindTemplatesByProcess(ctx context.Context, tenantID, processCode string) ([]*entity.ProcessTemplateInfo, error)
- func (r *Repository) IsSysTenant(ctx context.Context, tenantID string) (bool, error)
- func (r *Repository) Update(ctx context.Context, process *entity.Process) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository implements the process repository using PostgreSQL.
func (*Repository) CountTemplatesByProcess ¶
func (r *Repository) CountTemplatesByProcess(ctx context.Context, tenantID, processCode string) (int, error)
CountTemplatesByProcess returns the number of templates using this process code. Scoped to tenant via workspace join since process is a VARCHAR column on templates.
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, id string) error
Delete deletes a process.
func (*Repository) ExistsByCode ¶
ExistsByCode checks if a process with the given code exists in the tenant.
func (*Repository) ExistsByCodeExcluding ¶
func (r *Repository) ExistsByCodeExcluding(ctx context.Context, tenantID, code, excludeID string) (bool, error)
ExistsByCodeExcluding checks excluding a specific process ID.
func (*Repository) FindByCode ¶
func (r *Repository) FindByCode(ctx context.Context, tenantID, code string) (*entity.Process, error)
FindByCode finds a process by code within a tenant.
func (*Repository) FindByCodeWithGlobalFallback ¶
func (r *Repository) FindByCodeWithGlobalFallback(ctx context.Context, tenantID, code string) (*entity.Process, error)
FindByCodeWithGlobalFallback finds a process by code, checking tenant first then SYS tenant.
func (*Repository) FindByTenant ¶
func (r *Repository) FindByTenant(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.Process, int64, error)
FindByTenant lists all processes for a tenant with pagination.
func (*Repository) FindByTenantWithGlobalFallback ¶
func (r *Repository) FindByTenantWithGlobalFallback(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.Process, int64, error)
FindByTenantWithGlobalFallback lists processes including global (SYS tenant) processes. Tenant's own processes take priority over global processes with the same code.
func (*Repository) FindByTenantWithTemplateCount ¶
func (r *Repository) FindByTenantWithTemplateCount(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.ProcessListItem, int64, error)
FindByTenantWithTemplateCount lists processes with template usage count.
func (*Repository) FindByTenantWithTemplateCountAndGlobal ¶
func (r *Repository) FindByTenantWithTemplateCountAndGlobal(ctx context.Context, tenantID string, filters port.ProcessFilters) ([]*entity.ProcessListItem, int64, error)
FindByTenantWithTemplateCountAndGlobal lists processes with template count, including global processes.
func (*Repository) FindTemplatesByProcess ¶
func (r *Repository) FindTemplatesByProcess(ctx context.Context, tenantID, processCode string) ([]*entity.ProcessTemplateInfo, error)
FindTemplatesByProcess returns templates assigned to this process code. Scoped to tenant via workspace join since process is a VARCHAR column on templates.
func (*Repository) IsSysTenant ¶
IsSysTenant checks if the given tenant is the system tenant.