Remove tenant service pattern

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-05-20 16:18:23 -07:00
parent 30db98455d
commit 3e4a9be7c0
89 changed files with 3510 additions and 3031 deletions

View File

@@ -25,17 +25,18 @@ import (
)
type FrameworkService struct {
svc *TenantService
svc *Service
}
func (s FrameworkService) Get(
ctx context.Context,
scope coredata.Scoper,
frameworkID gid.GID,
) (*coredata.Framework, error) {
framework := &coredata.Framework{}
err := s.svc.pg.WithConn(ctx, func(ctx context.Context, conn pg.Querier) error {
err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID)
err := framework.LoadByID(ctx, conn, scope, frameworkID)
if err != nil {
return fmt.Errorf("cannot load framework: %w", err)
}
@@ -51,6 +52,7 @@ func (s FrameworkService) Get(
func (s FrameworkService) GenerateLightLogoURL(
ctx context.Context,
scope coredata.Scoper,
frameworkID gid.GID,
expiresIn time.Duration,
) (*string, error) {
@@ -60,7 +62,7 @@ func (s FrameworkService) GenerateLightLogoURL(
ctx,
func(ctx context.Context, conn pg.Querier) error {
framework := &coredata.Framework{}
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
if err := framework.LoadByID(ctx, conn, scope, frameworkID); err != nil {
return fmt.Errorf("cannot load framework: %w", err)
}
@@ -68,7 +70,7 @@ func (s FrameworkService) GenerateLightLogoURL(
return nil
}
if err := file.LoadByID(ctx, conn, s.svc.scope, *framework.LightLogoFileID); err != nil {
if err := file.LoadByID(ctx, conn, scope, *framework.LightLogoFileID); err != nil {
return fmt.Errorf("cannot load file: %w", err)
}
@@ -93,6 +95,7 @@ func (s FrameworkService) GenerateLightLogoURL(
func (s FrameworkService) GenerateDarkLogoURL(
ctx context.Context,
scope coredata.Scoper,
frameworkID gid.GID,
expiresIn time.Duration,
) (*string, error) {
@@ -102,7 +105,7 @@ func (s FrameworkService) GenerateDarkLogoURL(
ctx,
func(ctx context.Context, conn pg.Querier) error {
framework := &coredata.Framework{}
if err := framework.LoadByID(ctx, conn, s.svc.scope, frameworkID); err != nil {
if err := framework.LoadByID(ctx, conn, scope, frameworkID); err != nil {
return fmt.Errorf("cannot load framework: %w", err)
}
@@ -110,7 +113,7 @@ func (s FrameworkService) GenerateDarkLogoURL(
return nil
}
if err := file.LoadByID(ctx, conn, s.svc.scope, *framework.DarkLogoFileID); err != nil {
if err := file.LoadByID(ctx, conn, scope, *framework.DarkLogoFileID); err != nil {
return fmt.Errorf("cannot load file: %w", err)
}