Pārlūkot izejas kodu

fix: rename presentation service to liaison layer

ntorga 2 mēneši atpakaļ
vecāks
revīzija
dd0dda40b3
63 mainītis faili ar 4044 papildinājumiem un 4042 dzēšanām
  1. 15 15
      src/presentation/api/controller/account.go
  2. 5 5
      src/presentation/api/controller/authentication.go
  3. 10 10
      src/presentation/api/controller/cron.go
  4. 13 13
      src/presentation/api/controller/database.go
  5. 11 11
      src/presentation/api/controller/marketplace.go
  6. 4 4
      src/presentation/api/controller/o11y.go
  7. 7 7
      src/presentation/api/controller/runtime.go
  8. 7 7
      src/presentation/api/controller/scheduledTask.go
  9. 18 18
      src/presentation/api/controller/services.go
  10. 3 3
      src/presentation/api/controller/setup.go
  11. 11 11
      src/presentation/api/controller/ssl.go
  12. 27 27
      src/presentation/api/controller/virtualHost.go
  13. 3 3
      src/presentation/api/docs/docs.go
  14. 9 9
      src/presentation/api/helper/liaisonResponseWrapper.go
  15. 15 15
      src/presentation/cli/controller/account.go
  16. 5 5
      src/presentation/cli/controller/authentication.go
  17. 10 10
      src/presentation/cli/controller/cron.go
  18. 13 13
      src/presentation/cli/controller/database.go
  19. 11 11
      src/presentation/cli/controller/marketplace.go
  20. 4 4
      src/presentation/cli/controller/o11y.go
  21. 11 11
      src/presentation/cli/controller/runtime.go
  22. 7 7
      src/presentation/cli/controller/scheduledTask.go
  23. 15 15
      src/presentation/cli/controller/services.go
  24. 9 9
      src/presentation/cli/controller/ssl.go
  25. 27 27
      src/presentation/cli/controller/virtualHost.go
  26. 8 8
      src/presentation/cli/helper/liaisonResponseWrapper.go
  27. 415 0
      src/presentation/liaison/account.go
  28. 24 22
      src/presentation/liaison/authentication.go
  29. 284 0
      src/presentation/liaison/cron.go
  30. 352 0
      src/presentation/liaison/database.go
  31. 12 12
      src/presentation/liaison/helper/paginationParser.go
  32. 3 3
      src/presentation/liaison/helper/requiredParamsInspector.go
  33. 4 4
      src/presentation/liaison/helper/timeParamsParser.go
  34. 131 131
      src/presentation/liaison/marketplace.go
  35. 9 9
      src/presentation/liaison/o11y.go
  36. 6 6
      src/presentation/liaison/output.go
  37. 134 0
      src/presentation/liaison/runtime.go
  38. 59 59
      src/presentation/liaison/scheduledTask.go
  39. 937 0
      src/presentation/liaison/services.go
  40. 313 0
      src/presentation/liaison/ssl.go
  41. 994 0
      src/presentation/liaison/virtualHost.go
  42. 0 415
      src/presentation/service/account.go
  43. 0 284
      src/presentation/service/cron.go
  44. 0 352
      src/presentation/service/database.go
  45. 0 134
      src/presentation/service/runtime.go
  46. 0 937
      src/presentation/service/services.go
  47. 0 313
      src/presentation/service/ssl.go
  48. 0 994
      src/presentation/service/virtualHost.go
  49. 5 5
      src/presentation/ui/presenter/accounts/presenter.go
  50. 5 5
      src/presentation/ui/presenter/crons/presenter.go
  51. 5 5
      src/presentation/ui/presenter/databases/presenter.go
  52. 9 9
      src/presentation/ui/presenter/footer/footer.go
  53. 6 6
      src/presentation/ui/presenter/helper/readVirtualHostHostnames.go
  54. 4 4
      src/presentation/ui/presenter/helper/shouldEnableInitialSetup.go
  55. 4 4
      src/presentation/ui/presenter/login/login.go
  56. 16 16
      src/presentation/ui/presenter/mappings/presenter.go
  57. 5 5
      src/presentation/ui/presenter/mappings/securityRulesPresenter.go
  58. 7 7
      src/presentation/ui/presenter/marketplace/presenter.go
  59. 1 1
      src/presentation/ui/presenter/overview/index.templ
  60. 7 7
      src/presentation/ui/presenter/overview/presenter.go
  61. 5 5
      src/presentation/ui/presenter/runtimes/presenter.go
  62. 4 4
      src/presentation/ui/presenter/setup/setup.go
  63. 6 6
      src/presentation/ui/presenter/ssls/presenter.go

+ 15 - 15
src/presentation/api/controller/account.go

@@ -3,12 +3,12 @@ package apiController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type AccountController struct {
-	accountService *service.AccountService
+	accountLiaison *liaison.AccountLiaison
 }
 
 func NewAccountController(
@@ -16,7 +16,7 @@ func NewAccountController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *AccountController {
 	return &AccountController{
-		accountService: service.NewAccountService(persistentDbSvc, trailDbSvc),
+		accountLiaison: liaison.NewAccountLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -43,8 +43,8 @@ func (controller *AccountController) Read(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.Read(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.Read(requestInputData),
 	)
 }
 
@@ -64,8 +64,8 @@ func (controller *AccountController) Create(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.Create(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.Create(requestInputData),
 	)
 }
 
@@ -85,8 +85,8 @@ func (controller *AccountController) Update(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.Update(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.Update(requestInputData),
 	)
 }
 
@@ -106,8 +106,8 @@ func (controller *AccountController) Delete(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.Delete(requestInputData),
 	)
 }
 
@@ -127,8 +127,8 @@ func (controller *AccountController) CreateSecureAccessPublicKey(c echo.Context)
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.CreateSecureAccessPublicKey(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.CreateSecureAccessPublicKey(requestInputData),
 	)
 }
 
@@ -148,7 +148,7 @@ func (controller *AccountController) DeleteSecureAccessPublicKey(c echo.Context)
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.accountService.DeleteSecureAccessPublicKey(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.accountLiaison.DeleteSecureAccessPublicKey(requestInputData),
 	)
 }

+ 5 - 5
src/presentation/api/controller/authentication.go

@@ -3,12 +3,12 @@ package apiController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type AuthenticationController struct {
-	authenticationService *service.AuthenticationService
+	authenticationLiaison *liaison.AuthenticationLiaison
 }
 
 func NewAuthenticationController(
@@ -16,7 +16,7 @@ func NewAuthenticationController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *AuthenticationController {
 	return &AuthenticationController{
-		authenticationService: service.NewAuthenticationService(
+		authenticationLiaison: liaison.NewAuthenticationLiaison(
 			persistentDbSvc, trailDbSvc,
 		),
 	}
@@ -38,7 +38,7 @@ func (controller *AuthenticationController) Login(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.authenticationService.Login(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.authenticationLiaison.Login(requestInputData),
 	)
 }

+ 10 - 10
src/presentation/api/controller/cron.go

@@ -3,19 +3,19 @@ package apiController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type CronController struct {
-	cronService *service.CronService
+	cronLiaison *liaison.CronLiaison
 }
 
 func NewCronController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *CronController {
 	return &CronController{
-		cronService: service.NewCronService(trailDbSvc),
+		cronLiaison: liaison.NewCronLiaison(trailDbSvc),
 	}
 }
 
@@ -41,7 +41,7 @@ func (controller *CronController) Read(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(c, controller.cronService.Read(requestInputData))
+	return apiHelper.LiaisonResponseWrapper(c, controller.cronLiaison.Read(requestInputData))
 }
 
 // CreateCron    godoc
@@ -60,8 +60,8 @@ func (controller *CronController) Create(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.cronService.Create(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.cronLiaison.Create(requestInputData),
 	)
 }
 
@@ -81,8 +81,8 @@ func (controller *CronController) Update(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.cronService.Update(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.cronLiaison.Update(requestInputData),
 	)
 }
 
@@ -102,7 +102,7 @@ func (controller *CronController) Delete(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.cronService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.cronLiaison.Delete(requestInputData),
 	)
 }

+ 13 - 13
src/presentation/api/controller/database.go

@@ -4,7 +4,7 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 
 	tkPresentation "github.com/goinfinite/tk/src/presentation"
@@ -12,7 +12,7 @@ import (
 
 type DatabaseController struct {
 	persistentDbService *internalDbInfra.PersistentDatabaseService
-	dbService           *service.DatabaseService
+	databaseLiaison     *liaison.DatabaseLiaison
 }
 
 func NewDatabaseController(
@@ -21,7 +21,7 @@ func NewDatabaseController(
 ) *DatabaseController {
 	return &DatabaseController{
 		persistentDbService: persistentDbService,
-		dbService: service.NewDatabaseService(
+		databaseLiaison: liaison.NewDatabaseLiaison(
 			persistentDbService, trailDbSvc,
 		),
 	}
@@ -50,8 +50,8 @@ func (controller *DatabaseController) Read(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.dbService.Read(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.databaseLiaison.Read(requestInputData),
 	)
 }
 
@@ -72,8 +72,8 @@ func (controller *DatabaseController) Create(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.dbService.Create(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.databaseLiaison.Create(requestInputData),
 	)
 }
 
@@ -94,8 +94,8 @@ func (controller *DatabaseController) Delete(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.dbService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.databaseLiaison.Delete(requestInputData),
 	)
 }
 
@@ -127,8 +127,8 @@ func (controller *DatabaseController) CreateUser(c echo.Context) error {
 		)
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.dbService.CreateUser(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.databaseLiaison.CreateUser(requestInputData),
 	)
 }
 
@@ -150,7 +150,7 @@ func (controller *DatabaseController) DeleteUser(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.dbService.DeleteUser(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.databaseLiaison.DeleteUser(requestInputData),
 	)
 }

+ 11 - 11
src/presentation/api/controller/marketplace.go

@@ -10,12 +10,12 @@ import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	marketplaceInfra "github.com/goinfinite/os/src/infra/marketplace"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type MarketplaceController struct {
-	marketplaceService *service.MarketplaceService
+	marketplaceLiaison *liaison.MarketplaceLiaison
 	persistentDbSvc    *internalDbInfra.PersistentDatabaseService
 }
 
@@ -24,7 +24,7 @@ func NewMarketplaceController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *MarketplaceController {
 	return &MarketplaceController{
-		marketplaceService: service.NewMarketplaceService(persistentDbSvc, trailDbSvc),
+		marketplaceLiaison: liaison.NewMarketplaceLiaison(persistentDbSvc, trailDbSvc),
 		persistentDbSvc:    persistentDbSvc,
 	}
 }
@@ -53,8 +53,8 @@ func (controller *MarketplaceController) ReadCatalog(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.marketplaceService.ReadCatalog(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.marketplaceLiaison.ReadCatalog(requestInputData),
 	)
 }
 
@@ -168,8 +168,8 @@ func (controller *MarketplaceController) InstallCatalogItem(c echo.Context) erro
 		)
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.marketplaceService.InstallCatalogItem(requestInputData, true),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.marketplaceLiaison.InstallCatalogItem(requestInputData, true),
 	)
 }
 
@@ -197,8 +197,8 @@ func (controller *MarketplaceController) ReadInstalledItems(c echo.Context) erro
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.marketplaceService.ReadInstalledItems(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.marketplaceLiaison.ReadInstalledItems(requestInputData),
 	)
 }
 
@@ -219,8 +219,8 @@ func (controller *MarketplaceController) DeleteInstalledItem(c echo.Context) err
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.marketplaceService.DeleteInstalledItem(requestInputData, true),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.marketplaceLiaison.DeleteInstalledItem(requestInputData, true),
 	)
 }
 

+ 4 - 4
src/presentation/api/controller/o11y.go

@@ -3,19 +3,19 @@ package apiController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type O11yController struct {
-	o11yService *service.O11yService
+	o11yLiaison *liaison.O11yLiaison
 }
 
 func NewO11yController(
 	transientDbService *internalDbInfra.TransientDatabaseService,
 ) *O11yController {
 	return &O11yController{
-		o11yService: service.NewO11yService(transientDbService),
+		o11yLiaison: liaison.NewO11yLiaison(transientDbService),
 	}
 }
 
@@ -29,5 +29,5 @@ func NewO11yController(
 // @Success      200 {object} entity.O11yOverview
 // @Router       /v1/o11y/overview/ [get]
 func (controller *O11yController) ReadOverview(c echo.Context) error {
-	return apiHelper.ServiceResponseWrapper(c, controller.o11yService.ReadOverview())
+	return apiHelper.LiaisonResponseWrapper(c, controller.o11yLiaison.ReadOverview())
 }

+ 7 - 7
src/presentation/api/controller/runtime.go

@@ -10,12 +10,12 @@ import (
 	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type RuntimeController struct {
-	runtimeService *service.RuntimeService
+	runtimeLiaison *liaison.RuntimeLiaison
 }
 
 func NewRuntimeController(
@@ -23,7 +23,7 @@ func NewRuntimeController(
 	trailDbService *internalDbInfra.TrailDatabaseService,
 ) *RuntimeController {
 	return &RuntimeController{
-		runtimeService: service.NewRuntimeService(persistentDbService, trailDbService),
+		runtimeLiaison: liaison.NewRuntimeLiaison(persistentDbService, trailDbService),
 	}
 }
 
@@ -43,8 +43,8 @@ func (controller *RuntimeController) ReadPhpConfigs(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.runtimeService.ReadPhpConfigs(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.runtimeLiaison.ReadPhpConfigs(requestInputData),
 	)
 }
 
@@ -170,7 +170,7 @@ func (controller *RuntimeController) UpdatePhpConfigs(c echo.Context) error {
 		requestInputData["settings"] = phpSettings
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.runtimeService.UpdatePhpConfigs(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.runtimeLiaison.UpdatePhpConfigs(requestInputData),
 	)
 }

+ 7 - 7
src/presentation/api/controller/scheduledTask.go

@@ -12,12 +12,12 @@ import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
 type ScheduledTaskController struct {
-	scheduledTaskService *service.ScheduledTaskService
+	scheduledTaskLiaison *liaison.ScheduledTaskLiaison
 	persistentDbSvc      *internalDbInfra.PersistentDatabaseService
 }
 
@@ -25,7 +25,7 @@ func NewScheduledTaskController(
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
 ) *ScheduledTaskController {
 	return &ScheduledTaskController{
-		scheduledTaskService: service.NewScheduledTaskService(persistentDbSvc),
+		scheduledTaskLiaison: liaison.NewScheduledTaskLiaison(persistentDbSvc),
 		persistentDbSvc:      persistentDbSvc,
 	}
 }
@@ -90,8 +90,8 @@ func (controller *ScheduledTaskController) Read(c echo.Context) error {
 		requestInputData["taskTags"] = taskTags
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.scheduledTaskService.Read(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.scheduledTaskLiaison.Read(requestInputData),
 	)
 }
 
@@ -111,8 +111,8 @@ func (controller *ScheduledTaskController) Update(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.scheduledTaskService.Update(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.scheduledTaskLiaison.Update(requestInputData),
 	)
 }
 

+ 18 - 18
src/presentation/api/controller/services.go

@@ -12,13 +12,13 @@ import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	servicesInfra "github.com/goinfinite/os/src/infra/services"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type ServicesController struct {
-	servicesService *service.ServicesService
+	servicesLiaison *liaison.ServicesLiaison
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 }
 
@@ -27,7 +27,7 @@ func NewServicesController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *ServicesController {
 	return &ServicesController{
-		servicesService: service.NewServicesService(persistentDbService, trailDbSvc),
+		servicesLiaison: liaison.NewServicesLiaison(persistentDbService, trailDbSvc),
 		persistentDbSvc: persistentDbService,
 	}
 }
@@ -56,8 +56,8 @@ func (controller *ServicesController) ReadInstalledItems(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.ReadInstalledItems(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.ReadInstalledItems(requestInputData),
 	)
 }
 
@@ -85,8 +85,8 @@ func (controller *ServicesController) ReadInstallablesItems(c echo.Context) erro
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.ReadInstallableItems(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.ReadInstallableItems(requestInputData),
 	)
 }
 
@@ -234,7 +234,7 @@ func (controller *ServicesController) parseRawPortBindings(
 
 // CreateInstallableService godoc
 // @Summary      CreateInstallableService
-// @Description  Install a new installable service.
+// @Description  Install a new installable liaison.
 // @Tags         services
 // @Accept       json
 // @Produce      json
@@ -268,14 +268,14 @@ func (controller *ServicesController) CreateInstallable(c echo.Context) error {
 	}
 	requestInputData["portBindings"] = portBindings
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.CreateInstallable(requestInputData, true),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.CreateInstallable(requestInputData, true),
 	)
 }
 
 // CreateCustomService godoc
 // @Summary      CreateCustomService
-// @Description  Install a new custom service.
+// @Description  Install a new custom liaison.
 // @Tags         services
 // @Accept       json
 // @Produce      json
@@ -309,8 +309,8 @@ func (controller *ServicesController) CreateCustom(c echo.Context) error {
 	}
 	requestInputData["portBindings"] = portBindings
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.CreateCustom(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.CreateCustom(requestInputData),
 	)
 }
 
@@ -348,14 +348,14 @@ func (controller *ServicesController) Update(c echo.Context) error {
 		requestInputData["portBindings"] = rawPortBindings
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.Update(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.Update(requestInputData),
 	)
 }
 
 // DeleteService godoc
 // @Summary      DeleteService
-// @Description  Delete/Uninstall a service.
+// @Description  Delete/Uninstall a liaison.
 // @Tags         services
 // @Accept       json
 // @Produce      json
@@ -370,8 +370,8 @@ func (controller *ServicesController) Delete(c echo.Context) error {
 	}
 	requestInputData["name"] = requestInputData["svcName"]
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.servicesService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.servicesLiaison.Delete(requestInputData),
 	)
 }
 

+ 3 - 3
src/presentation/api/controller/setup.go

@@ -10,7 +10,7 @@ import (
 	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
@@ -62,7 +62,7 @@ func (controller *SetupController) Setup(c echo.Context) error {
 
 	isSuperAdmin := false
 
-	operatorIpAddress := service.LocalOperatorIpAddress
+	operatorIpAddress := liaison.LocalOperatorIpAddress
 	if requestBody["operatorIpAddress"] != nil {
 		operatorIpAddress, err = valueObject.NewIpAddress(
 			requestBody["operatorIpAddress"],
@@ -73,7 +73,7 @@ func (controller *SetupController) Setup(c echo.Context) error {
 	}
 
 	createDto := dto.NewCreateAccount(
-		username, password, isSuperAdmin, service.LocalOperatorAccountId,
+		username, password, isSuperAdmin, liaison.LocalOperatorAccountId,
 		operatorIpAddress,
 	)
 

+ 11 - 11
src/presentation/api/controller/ssl.go

@@ -11,7 +11,7 @@ import (
 	sslInfra "github.com/goinfinite/os/src/infra/ssl"
 	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
 	"github.com/labstack/echo/v4"
 )
@@ -19,7 +19,7 @@ import (
 type SslController struct {
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 	transientDbSvc  *internalDbInfra.TransientDatabaseService
-	sslService      *service.SslService
+	sslLiaison      *liaison.SslLiaison
 }
 
 func NewSslController(
@@ -30,7 +30,7 @@ func NewSslController(
 	return &SslController{
 		persistentDbSvc: persistentDbSvc,
 		transientDbSvc:  transientDbSvc,
-		sslService: service.NewSslService(
+		sslLiaison: liaison.NewSslLiaison(
 			persistentDbSvc, transientDbSvc, trailDbSvc,
 		),
 	}
@@ -69,8 +69,8 @@ func (controller *SslController) Read(c echo.Context) error {
 		)
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.sslService.Read(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.sslLiaison.Read(requestInputData),
 	)
 }
 
@@ -144,8 +144,8 @@ func (controller *SslController) Create(c echo.Context) error {
 		requestInputData["chainCertificates"] = nil
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.sslService.Create(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.sslLiaison.Create(requestInputData),
 	)
 }
 
@@ -165,8 +165,8 @@ func (controller *SslController) CreatePubliclyTrusted(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.sslService.CreatePubliclyTrusted(requestInputData, true),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.sslLiaison.CreatePubliclyTrusted(requestInputData, true),
 	)
 }
 
@@ -186,8 +186,8 @@ func (controller *SslController) Delete(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.sslService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.sslLiaison.Delete(requestInputData),
 	)
 }
 

+ 27 - 27
src/presentation/api/controller/virtualHost.go

@@ -3,7 +3,7 @@ package apiController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	apiHelper "github.com/goinfinite/os/src/presentation/api/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 
 	tkValueObject "github.com/goinfinite/tk/src/domain/valueObject"
@@ -11,7 +11,7 @@ import (
 )
 
 type VirtualHostController struct {
-	virtualHostService *service.VirtualHostService
+	virtualHostLiaison *liaison.VirtualHostLiaison
 }
 
 func NewVirtualHostController(
@@ -19,7 +19,7 @@ func NewVirtualHostController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *VirtualHostController {
 	return &VirtualHostController{
-		virtualHostService: service.NewVirtualHostService(persistentDbSvc, trailDbSvc),
+		virtualHostLiaison: liaison.NewVirtualHostLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -50,8 +50,8 @@ func (controller *VirtualHostController) Read(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.Read(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.Read(requestInputData),
 	)
 }
 
@@ -71,8 +71,8 @@ func (controller *VirtualHostController) Create(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.Create(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.Create(requestInputData),
 	)
 }
 
@@ -92,8 +92,8 @@ func (controller *VirtualHostController) Update(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.Update(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.Update(requestInputData),
 	)
 }
 
@@ -113,8 +113,8 @@ func (controller *VirtualHostController) Delete(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.Delete(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.Delete(requestInputData),
 	)
 }
 
@@ -145,8 +145,8 @@ func (controller *VirtualHostController) ReadWithMappings(c echo.Context) error
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.ReadWithMappings(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.ReadWithMappings(requestInputData),
 	)
 }
 
@@ -166,8 +166,8 @@ func (controller *VirtualHostController) CreateMapping(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.CreateMapping(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.CreateMapping(requestInputData),
 	)
 }
 
@@ -187,8 +187,8 @@ func (controller *VirtualHostController) UpdateMapping(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.UpdateMapping(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.UpdateMapping(requestInputData),
 	)
 }
 
@@ -208,8 +208,8 @@ func (controller *VirtualHostController) DeleteMapping(c echo.Context) error {
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.DeleteMapping(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.DeleteMapping(requestInputData),
 	)
 }
 
@@ -239,8 +239,8 @@ func (controller *VirtualHostController) ReadMappingSecurityRules(c echo.Context
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.ReadMappingSecurityRules(
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.ReadMappingSecurityRules(
 			requestInputData,
 		),
 	)
@@ -274,8 +274,8 @@ func (controller *VirtualHostController) CreateMappingSecurityRule(c echo.Contex
 		)
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.CreateMappingSecurityRule(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.CreateMappingSecurityRule(requestInputData),
 	)
 }
 
@@ -307,8 +307,8 @@ func (controller *VirtualHostController) UpdateMappingSecurityRule(c echo.Contex
 		)
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.UpdateMappingSecurityRule(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.UpdateMappingSecurityRule(requestInputData),
 	)
 }
 
@@ -328,7 +328,7 @@ func (controller *VirtualHostController) DeleteMappingSecurityRule(c echo.Contex
 		return err
 	}
 
-	return apiHelper.ServiceResponseWrapper(
-		c, controller.virtualHostService.DeleteMappingSecurityRule(requestInputData),
+	return apiHelper.LiaisonResponseWrapper(
+		c, controller.virtualHostLiaison.DeleteMappingSecurityRule(requestInputData),
 	)
 }

+ 3 - 3
src/presentation/api/docs/docs.go

@@ -1798,7 +1798,7 @@ const docTemplate = `{
                         "Bearer": []
                     }
                 ],
-                "description": "Install a new custom service.",
+                "description": "Install a new custom liaison.",
                 "consumes": [
                     "application/json"
                 ],
@@ -1919,7 +1919,7 @@ const docTemplate = `{
                         "Bearer": []
                     }
                 ],
-                "description": "Install a new installable service.",
+                "description": "Install a new installable liaison.",
                 "consumes": [
                     "application/json"
                 ],
@@ -1958,7 +1958,7 @@ const docTemplate = `{
                         "Bearer": []
                     }
                 ],
-                "description": "Delete/Uninstall a service.",
+                "description": "Delete/Uninstall a liaison.",
                 "consumes": [
                     "application/json"
                 ],

+ 9 - 9
src/presentation/api/helper/serviceResponseWrapper.go → src/presentation/api/helper/liaisonResponseWrapper.go

@@ -3,7 +3,7 @@ package apiHelper
 import (
 	"net/http"
 
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/labstack/echo/v4"
 )
 
@@ -12,25 +12,25 @@ type newFormattedResponse struct {
 	Body   interface{} `json:"body"`
 }
 
-func ServiceResponseWrapper(
+func LiaisonResponseWrapper(
 	c echo.Context,
-	serviceOutput service.ServiceOutput,
+	liaisonOutput liaison.LiaisonOutput,
 ) error {
 	responseStatus := http.StatusOK
-	switch serviceOutput.Status {
-	case service.Created:
+	switch liaisonOutput.Status {
+	case liaison.Created:
 		responseStatus = http.StatusCreated
-	case service.MultiStatus:
+	case liaison.MultiStatus:
 		responseStatus = http.StatusMultiStatus
-	case service.UserError:
+	case liaison.UserError:
 		responseStatus = http.StatusBadRequest
-	case service.InfraError:
+	case liaison.InfraError:
 		responseStatus = http.StatusInternalServerError
 	}
 
 	formattedResponse := newFormattedResponse{
 		Status: responseStatus,
-		Body:   serviceOutput.Body,
+		Body:   liaisonOutput.Body,
 	}
 	return c.JSON(responseStatus, formattedResponse)
 }

+ 15 - 15
src/presentation/cli/controller/account.go

@@ -3,12 +3,12 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type AccountController struct {
-	accountService *service.AccountService
+	accountLiaison *liaison.AccountLiaison
 }
 
 func NewAccountController(
@@ -16,7 +16,7 @@ func NewAccountController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *AccountController {
 	return &AccountController{
-		accountService: service.NewAccountService(persistentDbSvc, trailDbSvc),
+		accountLiaison: liaison.NewAccountLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -63,8 +63,8 @@ func (controller *AccountController) Read() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -112,8 +112,8 @@ func (controller *AccountController) Create() *cobra.Command {
 				"isSuperAdmin": isSuperAdminStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.Create(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.Create(requestBody),
 			)
 		},
 	}
@@ -156,8 +156,8 @@ func (controller *AccountController) Update() *cobra.Command {
 				requestBody["isSuperAdmin"] = isSuperAdminStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.Update(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.Update(requestBody),
 			)
 		},
 	}
@@ -183,8 +183,8 @@ func (controller *AccountController) Delete() *cobra.Command {
 				"accountId": accountIdUint64,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.Delete(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.Delete(requestBody),
 			)
 		},
 	}
@@ -211,8 +211,8 @@ func (controller *AccountController) CreateSecureAccessPublicKey() *cobra.Comman
 				requestBody["name"] = keyNameStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.CreateSecureAccessPublicKey(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.CreateSecureAccessPublicKey(requestBody),
 			)
 		},
 	}
@@ -242,8 +242,8 @@ func (controller *AccountController) DeleteSecureAccessPublicKey() *cobra.Comman
 				"id":        keyIdUint16,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.accountService.DeleteSecureAccessPublicKey(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.accountLiaison.DeleteSecureAccessPublicKey(requestBody),
 			)
 		},
 	}

+ 5 - 5
src/presentation/cli/controller/authentication.go

@@ -3,12 +3,12 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type AuthenticationController struct {
-	authenticationService *service.AuthenticationService
+	authenticationLiaison *liaison.AuthenticationLiaison
 }
 
 func NewAuthenticationController(
@@ -16,7 +16,7 @@ func NewAuthenticationController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *AuthenticationController {
 	return &AuthenticationController{
-		authenticationService: service.NewAuthenticationService(
+		authenticationLiaison: liaison.NewAuthenticationLiaison(
 			persistentDbSvc, trailDbSvc,
 		),
 	}
@@ -35,8 +35,8 @@ func (controller *AuthenticationController) Login() *cobra.Command {
 				"operatorIpAddress": ipAddressStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.authenticationService.Login(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.authenticationLiaison.Login(requestBody),
 			)
 		},
 	}

+ 10 - 10
src/presentation/cli/controller/cron.go

@@ -3,19 +3,19 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type CronController struct {
-	cronService *service.CronService
+	cronLiaison *liaison.CronLiaison
 }
 
 func NewCronController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *CronController {
 	return &CronController{
-		cronService: service.NewCronService(trailDbSvc),
+		cronLiaison: liaison.NewCronLiaison(trailDbSvc),
 	}
 }
 
@@ -60,7 +60,7 @@ func (controller *CronController) Read() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(controller.cronService.Read(requestBody))
+			cliHelper.LiaisonResponseWrapper(controller.cronLiaison.Read(requestBody))
 		},
 	}
 
@@ -103,8 +103,8 @@ func (controller *CronController) Create() *cobra.Command {
 				requestBody["comment"] = commentStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.cronService.Create(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.cronLiaison.Create(requestBody),
 			)
 		},
 	}
@@ -140,8 +140,8 @@ func (controller *CronController) Update() *cobra.Command {
 				requestBody["comment"] = commentStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.cronService.Update(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.cronLiaison.Update(requestBody),
 			)
 		},
 	}
@@ -171,8 +171,8 @@ func (controller *CronController) Delete() *cobra.Command {
 				requestBody["comment"] = commentStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.cronService.Delete(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.cronLiaison.Delete(requestBody),
 			)
 		},
 	}

+ 13 - 13
src/presentation/cli/controller/database.go

@@ -4,14 +4,14 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	tkPresentation "github.com/goinfinite/tk/src/presentation"
 	"github.com/spf13/cobra"
 )
 
 type DatabaseController struct {
 	persistentDbService *internalDbInfra.PersistentDatabaseService
-	dbService           *service.DatabaseService
+	databaseLiaison     *liaison.DatabaseLiaison
 }
 
 func NewDatabaseController(
@@ -20,7 +20,7 @@ func NewDatabaseController(
 ) *DatabaseController {
 	return &DatabaseController{
 		persistentDbService: persistentDbService,
-		dbService: service.NewDatabaseService(
+		databaseLiaison: liaison.NewDatabaseLiaison(
 			persistentDbService, trailDbSvc,
 		),
 	}
@@ -55,8 +55,8 @@ func (controller *DatabaseController) Read() *cobra.Command {
 				paginationSortByStr, paginationSortDirectionStr, paginationLastSeenIdStr,
 			)
 
-			cliHelper.ServiceResponseWrapper(
-				controller.dbService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.databaseLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -95,8 +95,8 @@ func (controller *DatabaseController) Create() *cobra.Command {
 				"dbName": dbNameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.dbService.Create(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.databaseLiaison.Create(requestBody),
 			)
 		},
 	}
@@ -120,8 +120,8 @@ func (controller *DatabaseController) Delete() *cobra.Command {
 				"dbName": dbNameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.dbService.Delete(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.databaseLiaison.Delete(requestBody),
 			)
 		},
 	}
@@ -154,8 +154,8 @@ func (controller *DatabaseController) CreateUser() *cobra.Command {
 				)
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.dbService.CreateUser(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.databaseLiaison.CreateUser(requestBody),
 			)
 		},
 	}
@@ -189,8 +189,8 @@ func (controller *DatabaseController) DeleteUser() *cobra.Command {
 				"dbUser": dbUsernameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.dbService.DeleteUser(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.databaseLiaison.DeleteUser(requestBody),
 			)
 		},
 	}

+ 11 - 11
src/presentation/cli/controller/marketplace.go

@@ -7,13 +7,13 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type MarketplaceController struct {
 	persistentDbSvc    *internalDbInfra.PersistentDatabaseService
-	marketplaceService *service.MarketplaceService
+	marketplaceLiaison *liaison.MarketplaceLiaison
 }
 
 func NewMarketplaceController(
@@ -22,7 +22,7 @@ func NewMarketplaceController(
 ) *MarketplaceController {
 	return &MarketplaceController{
 		persistentDbSvc:    persistentDbSvc,
-		marketplaceService: service.NewMarketplaceService(persistentDbSvc, trailDbSvc),
+		marketplaceLiaison: liaison.NewMarketplaceLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -75,8 +75,8 @@ func (controller *MarketplaceController) ReadCatalog() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.marketplaceService.ReadCatalog(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.marketplaceLiaison.ReadCatalog(requestBody),
 			)
 		},
 	}
@@ -176,8 +176,8 @@ func (controller *MarketplaceController) InstallCatalogItem() *cobra.Command {
 				requestBody["urlPath"] = urlPathStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.marketplaceService.InstallCatalogItem(requestBody, false),
+			cliHelper.LiaisonResponseWrapper(
+				controller.marketplaceLiaison.InstallCatalogItem(requestBody, false),
 			)
 		},
 	}
@@ -242,8 +242,8 @@ func (controller *MarketplaceController) ReadInstalledItems() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.marketplaceService.ReadInstalledItems(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.marketplaceLiaison.ReadInstalledItems(requestBody),
 			)
 		},
 	}
@@ -295,8 +295,8 @@ func (controller *MarketplaceController) DeleteInstalledItem() *cobra.Command {
 				"shouldUninstallServices": shouldUninstallServicesStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.marketplaceService.DeleteInstalledItem(requestBody, false),
+			cliHelper.LiaisonResponseWrapper(
+				controller.marketplaceLiaison.DeleteInstalledItem(requestBody, false),
 			)
 		},
 	}

+ 4 - 4
src/presentation/cli/controller/o11y.go

@@ -3,19 +3,19 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type O11yController struct {
-	o11yService *service.O11yService
+	o11yLiaison *liaison.O11yLiaison
 }
 
 func NewO11yController(
 	transientDbService *internalDbInfra.TransientDatabaseService,
 ) *O11yController {
 	return &O11yController{
-		o11yService: service.NewO11yService(transientDbService),
+		o11yLiaison: liaison.NewO11yLiaison(transientDbService),
 	}
 }
 
@@ -24,7 +24,7 @@ func (controller *O11yController) ReadOverview() *cobra.Command {
 		Use:   "overview",
 		Short: "ReadO11yOverview",
 		Run: func(cmd *cobra.Command, args []string) {
-			cliHelper.ServiceResponseWrapper(controller.o11yService.ReadOverview())
+			cliHelper.LiaisonResponseWrapper(controller.o11yLiaison.ReadOverview())
 		},
 	}
 

+ 11 - 11
src/presentation/cli/controller/runtime.go

@@ -8,12 +8,12 @@ import (
 	infraHelper "github.com/goinfinite/os/src/infra/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type RuntimeController struct {
-	runtimeService *service.RuntimeService
+	runtimeLiaison *liaison.RuntimeLiaison
 }
 
 func NewRuntimeController(
@@ -21,7 +21,7 @@ func NewRuntimeController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *RuntimeController {
 	return &RuntimeController{
-		runtimeService: service.NewRuntimeService(persistentDbService, trailDbSvc),
+		runtimeLiaison: liaison.NewRuntimeLiaison(persistentDbService, trailDbSvc),
 	}
 }
 
@@ -55,8 +55,8 @@ func (controller *RuntimeController) ReadPhpConfigs() *cobra.Command {
 				"hostname": hostname.String(),
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.runtimeService.ReadPhpConfigs(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.runtimeLiaison.ReadPhpConfigs(requestBody),
 			)
 		},
 	}
@@ -107,8 +107,8 @@ func (controller *RuntimeController) UpdatePhpConfig() *cobra.Command {
 				requestBody["settings"] = settings
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.runtimeService.UpdatePhpConfigs(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.runtimeLiaison.UpdatePhpConfigs(requestBody),
 			)
 		},
 	}
@@ -148,8 +148,8 @@ func (controller *RuntimeController) UpdatePhpModule() *cobra.Command {
 			}
 			requestBody["modules"] = []entity.PhpModule{module}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.runtimeService.UpdatePhpConfigs(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.runtimeLiaison.UpdatePhpConfigs(requestBody),
 			)
 		},
 	}
@@ -187,8 +187,8 @@ func (controller *RuntimeController) UpdatePhpSetting() *cobra.Command {
 			}
 			requestBody["settings"] = []entity.PhpSetting{setting}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.runtimeService.UpdatePhpConfigs(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.runtimeLiaison.UpdatePhpConfigs(requestBody),
 			)
 		},
 	}

+ 7 - 7
src/presentation/cli/controller/scheduledTask.go

@@ -3,13 +3,13 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"github.com/spf13/cobra"
 )
 
 type ScheduledTaskController struct {
 	persistentDbSvc      *internalDbInfra.PersistentDatabaseService
-	scheduledTaskService *service.ScheduledTaskService
+	scheduledTaskLiaison *liaison.ScheduledTaskLiaison
 }
 
 func NewScheduledTaskController(
@@ -17,7 +17,7 @@ func NewScheduledTaskController(
 ) *ScheduledTaskController {
 	return &ScheduledTaskController{
 		persistentDbSvc:      persistentDbSvc,
-		scheduledTaskService: service.NewScheduledTaskService(persistentDbSvc),
+		scheduledTaskLiaison: liaison.NewScheduledTaskLiaison(persistentDbSvc),
 	}
 }
 
@@ -85,8 +85,8 @@ func (controller *ScheduledTaskController) Read() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.scheduledTaskService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.scheduledTaskLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -152,8 +152,8 @@ func (controller *ScheduledTaskController) Update() *cobra.Command {
 				requestBody["runAt"] = runAtInt64
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.scheduledTaskService.Update(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.scheduledTaskLiaison.Update(requestBody),
 			)
 		},
 	}

+ 15 - 15
src/presentation/cli/controller/services.go

@@ -4,13 +4,13 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
 	"github.com/spf13/cobra"
 )
 
 type ServicesController struct {
-	servicesService *service.ServicesService
+	servicesLiaison *liaison.ServicesLiaison
 }
 
 func NewServicesController(
@@ -18,7 +18,7 @@ func NewServicesController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *ServicesController {
 	return &ServicesController{
-		servicesService: service.NewServicesService(persistentDbSvc, trailDbSvc),
+		servicesLiaison: liaison.NewServicesLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -69,8 +69,8 @@ func (controller *ServicesController) ReadInstalledItems() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.ReadInstalledItems(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.ReadInstalledItems(requestBody),
 			)
 		},
 	}
@@ -154,8 +154,8 @@ func (controller *ServicesController) ReadInstallableItems() *cobra.Command {
 				requestBody["lastSeenId"] = paginationLastSeenIdStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.ReadInstallableItems(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.ReadInstallableItems(requestBody),
 			)
 		},
 	}
@@ -244,8 +244,8 @@ func (controller *ServicesController) CreateInstallable() *cobra.Command {
 				requestBody["mappingPath"] = mappingPath
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.CreateInstallable(requestBody, false),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.CreateInstallable(requestBody, false),
 			)
 		},
 	}
@@ -341,8 +341,8 @@ func (controller *ServicesController) CreateCustom() *cobra.Command {
 				requestBody["mappingPath"] = mappingPath
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.CreateCustom(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.CreateCustom(requestBody),
 			)
 		},
 	}
@@ -428,8 +428,8 @@ func (controller *ServicesController) Update() *cobra.Command {
 				requestBody["portBindings"] = portBindingsSlice
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.Update(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.Update(requestBody),
 			)
 		},
 	}
@@ -459,8 +459,8 @@ func (controller *ServicesController) Delete() *cobra.Command {
 				"name": nameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.servicesService.Delete(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.servicesLiaison.Delete(requestBody),
 			)
 		},
 	}

+ 9 - 9
src/presentation/cli/controller/ssl.go

@@ -5,13 +5,13 @@ import (
 	infraHelper "github.com/goinfinite/os/src/infra/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	tkPresentation "github.com/goinfinite/tk/src/presentation"
 	"github.com/spf13/cobra"
 )
 
 type SslController struct {
-	sslService *service.SslService
+	sslLiaison *liaison.SslLiaison
 }
 
 func NewSslController(
@@ -20,7 +20,7 @@ func NewSslController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *SslController {
 	return &SslController{
-		sslService: service.NewSslService(persistentDbSvc, transientDbSvc, trailDbSvc),
+		sslLiaison: liaison.NewSslLiaison(persistentDbSvc, transientDbSvc, trailDbSvc),
 	}
 }
 
@@ -51,8 +51,8 @@ func (controller *SslController) Read() *cobra.Command {
 				paginationSortByStr, paginationSortDirectionStr, paginationLastSeenIdStr,
 			)
 
-			cliHelper.ServiceResponseWrapper(
-				controller.sslService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.sslLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -119,7 +119,7 @@ func (controller *SslController) Create() *cobra.Command {
 			}
 			requestBody["key"] = privateKeyContentStr
 
-			cliHelper.ServiceResponseWrapper(controller.sslService.Create(requestBody))
+			cliHelper.LiaisonResponseWrapper(controller.sslLiaison.Create(requestBody))
 		},
 	}
 
@@ -147,8 +147,8 @@ func (controller *SslController) CreatePubliclyTrusted() *cobra.Command {
 				"virtualHostHostname": hostnameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.sslService.CreatePubliclyTrusted(requestBody, false),
+			cliHelper.LiaisonResponseWrapper(
+				controller.sslLiaison.CreatePubliclyTrusted(requestBody, false),
 			)
 		},
 	}
@@ -169,7 +169,7 @@ func (controller *SslController) Delete() *cobra.Command {
 				"id": sslPairIdStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(controller.sslService.Delete(requestBody))
+			cliHelper.LiaisonResponseWrapper(controller.sslLiaison.Delete(requestBody))
 		},
 	}
 

+ 27 - 27
src/presentation/cli/controller/virtualHost.go

@@ -3,14 +3,14 @@ package cliController
 import (
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	cliHelper "github.com/goinfinite/os/src/presentation/cli/helper"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	tkValueObject "github.com/goinfinite/tk/src/domain/valueObject"
 	tkPresentation "github.com/goinfinite/tk/src/presentation"
 	"github.com/spf13/cobra"
 )
 
 type VirtualHostController struct {
-	virtualHostService *service.VirtualHostService
+	virtualHostLiaison *liaison.VirtualHostLiaison
 }
 
 func NewVirtualHostController(
@@ -18,7 +18,7 @@ func NewVirtualHostController(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *VirtualHostController {
 	return &VirtualHostController{
-		virtualHostService: service.NewVirtualHostService(persistentDbSvc, trailDbSvc),
+		virtualHostLiaison: liaison.NewVirtualHostLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -55,8 +55,8 @@ func (controller *VirtualHostController) Read() *cobra.Command {
 				paginationSortByStr, paginationSortDirectionStr, paginationLastSeenIdStr,
 			)
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -106,8 +106,8 @@ func (controller *VirtualHostController) Create() *cobra.Command {
 				requestBody["parentHostname"] = parentHostnameStr
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.Create(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.Create(requestBody),
 			)
 		},
 	}
@@ -136,8 +136,8 @@ func (controller *VirtualHostController) Update() *cobra.Command {
 				"isWildcard": isWildcardBoolStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.Update(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.Update(requestBody),
 			)
 		},
 	}
@@ -161,8 +161,8 @@ func (controller *VirtualHostController) Delete() *cobra.Command {
 				"hostname": hostnameStr,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.Delete(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.Delete(requestBody),
 			)
 		},
 	}
@@ -204,8 +204,8 @@ func (controller *VirtualHostController) ReadWithMappings() *cobra.Command {
 				paginationSortByStr, paginationSortDirectionStr, paginationLastSeenIdStr,
 			)
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.Read(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.Read(requestBody),
 			)
 		},
 	}
@@ -266,8 +266,8 @@ func (controller *VirtualHostController) CreateMapping() *cobra.Command {
 				requestBody["mappingSecurityRuleId"] = mappingSecurityRuleIdUint
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.CreateMapping(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.CreateMapping(requestBody),
 			)
 		},
 	}
@@ -343,8 +343,8 @@ func (controller *VirtualHostController) UpdateMapping() *cobra.Command {
 				requestBody["mappingSecurityRuleId"] = mappingSecurityRuleIdUint
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.UpdateMapping(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.UpdateMapping(requestBody),
 			)
 		},
 	}
@@ -385,8 +385,8 @@ func (controller *VirtualHostController) DeleteMapping() *cobra.Command {
 				"id": mappingIdUint,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.DeleteMapping(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.DeleteMapping(requestBody),
 			)
 		},
 	}
@@ -434,8 +434,8 @@ func (controller *VirtualHostController) ReadMappingSecurityRules() *cobra.Comma
 				paginationSortByStr, paginationSortDirectionStr, paginationLastSeenIdStr,
 			)
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.ReadMappingSecurityRules(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.ReadMappingSecurityRules(requestBody),
 			)
 		},
 	}
@@ -528,8 +528,8 @@ func (controller *VirtualHostController) CreateMappingSecurityRule() *cobra.Comm
 				requestBody["responseCodeOnMaxConnections"] = responseCodeOnMaxConnectionsUint
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.CreateMappingSecurityRule(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.CreateMappingSecurityRule(requestBody),
 			)
 		},
 	}
@@ -640,8 +640,8 @@ func (controller *VirtualHostController) UpdateMappingSecurityRule() *cobra.Comm
 				requestBody["responseCodeOnMaxConnections"] = responseCodeOnMaxConnectionsUint
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.UpdateMappingSecurityRule(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.UpdateMappingSecurityRule(requestBody),
 			)
 		},
 	}
@@ -699,8 +699,8 @@ func (controller *VirtualHostController) DeleteMappingSecurityRule() *cobra.Comm
 				"id": ruleIdUint,
 			}
 
-			cliHelper.ServiceResponseWrapper(
-				controller.virtualHostService.DeleteMappingSecurityRule(requestBody),
+			cliHelper.LiaisonResponseWrapper(
+				controller.virtualHostLiaison.DeleteMappingSecurityRule(requestBody),
 			)
 		},
 	}

+ 8 - 8
src/presentation/cli/helper/serviceResponseWrapper.go → src/presentation/cli/helper/liaisonResponseWrapper.go

@@ -8,25 +8,25 @@ import (
 	"github.com/alecthomas/chroma/formatters"
 	"github.com/alecthomas/chroma/lexers"
 	"github.com/alecthomas/chroma/styles"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	"golang.org/x/term"
 )
 
-func ServiceResponseWrapper(serviceOutput service.ServiceOutput) {
+func LiaisonResponseWrapper(liaisonOutput liaison.LiaisonOutput) {
 	exitCode := 0
-	switch serviceOutput.Status {
-	case service.MultiStatus:
+	switch liaisonOutput.Status {
+	case liaison.MultiStatus:
 		exitCode = 1
-	case service.UserError:
+	case liaison.UserError:
 		exitCode = 1
-	case service.InfraError:
+	case liaison.InfraError:
 		exitCode = 1
 	}
 
 	stdoutFileDescriptor := int(os.Stdout.Fd())
 	isNonInteractiveSession := !term.IsTerminal(stdoutFileDescriptor)
 	if isNonInteractiveSession {
-		standardJsonBytes, err := json.Marshal(serviceOutput)
+		standardJsonBytes, err := json.Marshal(liaisonOutput)
 		if err != nil {
 			fmt.Println("ResponseEncodingError")
 			os.Exit(1)
@@ -36,7 +36,7 @@ func ServiceResponseWrapper(serviceOutput service.ServiceOutput) {
 		os.Exit(exitCode)
 	}
 
-	prettyJsonBytes, err := json.MarshalIndent(serviceOutput, "", "  ")
+	prettyJsonBytes, err := json.MarshalIndent(liaisonOutput, "", "  ")
 	if err != nil {
 		fmt.Println("PrettyResponseEncodingError")
 		os.Exit(1)

+ 415 - 0
src/presentation/liaison/account.go

@@ -0,0 +1,415 @@
+package liaison
+
+import (
+	"errors"
+
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
+	accountInfra "github.com/goinfinite/os/src/infra/account"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+)
+
+var LocalOperatorAccountId = valueObject.AccountIdSystem
+var LocalOperatorIpAddress = valueObject.IpAddressSystem
+
+type AccountLiaison struct {
+	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
+	accountQueryRepo      *accountInfra.AccountQueryRepo
+	accountCmdRepo        *accountInfra.AccountCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewAccountLiaison(
+	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *AccountLiaison {
+	return &AccountLiaison{
+		persistentDbSvc:       persistentDbSvc,
+		accountQueryRepo:      accountInfra.NewAccountQueryRepo(persistentDbSvc),
+		accountCmdRepo:        accountInfra.NewAccountCmdRepo(persistentDbSvc),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *AccountLiaison) Read(untrustedInput map[string]any) LiaisonOutput {
+	if untrustedInput["id"] != nil {
+		untrustedInput["accountId"] = untrustedInput["id"]
+	}
+
+	var idPtr *valueObject.AccountId
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewAccountId(untrustedInput["id"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		idPtr = &id
+	}
+
+	var usernamePtr *valueObject.Username
+	if untrustedInput["name"] != nil {
+		username, err := valueObject.NewUsername(untrustedInput["username"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		usernamePtr = &username
+	}
+
+	shouldIncludeSecureAccessPublicKeys := false
+	if untrustedInput["shouldIncludeSecureAccessPublicKeys"] != nil {
+		var err error
+		shouldIncludeSecureAccessPublicKeys, err = voHelper.InterfaceToBool(
+			untrustedInput["shouldIncludeSecureAccessPublicKeys"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+	}
+
+	paginationDto := useCase.MarketplaceDefaultPagination
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
+		}
+		paginationDto.PageNumber = pageNumber
+	}
+
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
+		}
+		paginationDto.ItemsPerPage = itemsPerPage
+	}
+
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortBy = &sortBy
+	}
+
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(
+			untrustedInput["sortDirection"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortDirection = &sortDirection
+	}
+
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.LastSeenId = &lastSeenId
+	}
+
+	readRequestDto := dto.ReadAccountsRequest{
+		Pagination:                          paginationDto,
+		AccountId:                           idPtr,
+		AccountUsername:                     usernamePtr,
+		ShouldIncludeSecureAccessPublicKeys: &shouldIncludeSecureAccessPublicKeys,
+	}
+
+	accountsList, err := useCase.ReadAccounts(liaison.accountQueryRepo, readRequestDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, accountsList)
+}
+
+func (liaison *AccountLiaison) Create(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"username", "password"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	username, err := valueObject.NewUsername(untrustedInput["username"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	password, err := valueObject.NewPassword(untrustedInput["password"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	isSuperAdmin := false
+	if untrustedInput["isSuperAdmin"] != nil {
+		isSuperAdmin, err = voHelper.InterfaceToBool(untrustedInput["isSuperAdmin"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateAccount(
+		username, password, isSuperAdmin, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.CreateAccount(
+		liaison.accountQueryRepo, liaison.accountCmdRepo,
+		liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "AccountCreated")
+}
+
+func (liaison *AccountLiaison) Update(untrustedInput map[string]any) LiaisonOutput {
+	if untrustedInput["id"] != nil {
+		untrustedInput["accountId"] = untrustedInput["id"]
+	}
+
+	requiredParams := []string{"accountId"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	accountId, err := valueObject.NewAccountId(untrustedInput["accountId"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var passwordPtr *valueObject.Password
+	if untrustedInput["password"] != nil && untrustedInput["password"] != "" {
+		password, err := valueObject.NewPassword(untrustedInput["password"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		passwordPtr = &password
+	}
+
+	var isSuperAdminPtr *bool
+	if untrustedInput["isSuperAdmin"] != nil {
+		isSuperAdmin, err := voHelper.InterfaceToBool(untrustedInput["isSuperAdmin"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		isSuperAdminPtr = &isSuperAdmin
+	}
+
+	var shouldUpdateApiKeyPtr *bool
+	if untrustedInput["shouldUpdateApiKey"] != nil {
+		shouldUpdateApiKey, err := voHelper.InterfaceToBool(untrustedInput["shouldUpdateApiKey"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		shouldUpdateApiKeyPtr = &shouldUpdateApiKey
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateAccount(
+		accountId, passwordPtr, isSuperAdminPtr, shouldUpdateApiKeyPtr,
+		operatorAccountId, operatorIpAddress,
+	)
+
+	if updateDto.ShouldUpdateApiKey != nil && *updateDto.ShouldUpdateApiKey {
+		newKey, err := useCase.UpdateAccountApiKey(
+			liaison.accountQueryRepo, liaison.accountCmdRepo,
+			liaison.activityRecordCmdRepo, updateDto,
+		)
+		if err != nil {
+			return NewLiaisonOutput(InfraError, err.Error())
+		}
+		return NewLiaisonOutput(Success, newKey)
+	}
+
+	err = useCase.UpdateAccount(
+		liaison.accountQueryRepo, liaison.accountCmdRepo,
+		liaison.activityRecordCmdRepo, updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "AccountUpdated")
+}
+
+func (liaison *AccountLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"accountId"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	accountId, err := valueObject.NewAccountId(untrustedInput["accountId"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteAccount(accountId, operatorAccountId, operatorIpAddress)
+
+	err = useCase.DeleteAccount(
+		liaison.accountQueryRepo, liaison.accountCmdRepo,
+		liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "AccountDeleted")
+}
+
+func (liaison *AccountLiaison) CreateSecureAccessPublicKey(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"accountId", "content"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	keyContent, err := valueObject.NewSecureAccessPublicKeyContent(untrustedInput["content"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	keyName, err := valueObject.NewSecureAccessPublicKeyName(untrustedInput["name"])
+	if err != nil {
+		keyName, err = keyContent.ReadOnlyKeyName()
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	accountId, err := valueObject.NewAccountId(untrustedInput["accountId"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateSecureAccessPublicKey(
+		accountId, keyContent, keyName, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.CreateSecureAccessPublicKey(
+		liaison.accountCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "SecureAccessPublicKeyCreated")
+}
+
+func (liaison *AccountLiaison) DeleteSecureAccessPublicKey(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"secureAccessPublicKeyId"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	keyId, err := valueObject.NewSecureAccessPublicKeyId(
+		untrustedInput["secureAccessPublicKeyId"],
+	)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteSecureAccessPublicKey(
+		keyId, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.DeleteSecureAccessPublicKey(
+		liaison.accountQueryRepo, liaison.accountCmdRepo,
+		liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "SecureAccessPublicKeyDeleted")
+}

+ 24 - 22
src/presentation/service/authentication.go → src/presentation/liaison/authentication.go

@@ -1,4 +1,4 @@
-package service
+package liaison
 
 import (
 	"github.com/goinfinite/os/src/domain/dto"
@@ -8,56 +8,58 @@ import (
 	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
 	authInfra "github.com/goinfinite/os/src/infra/auth"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
 )
 
-type AuthenticationService struct {
+type AuthenticationLiaison struct {
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 	trailDbSvc      *internalDbInfra.TrailDatabaseService
 }
 
-func NewAuthenticationService(
+func NewAuthenticationLiaison(
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *AuthenticationService {
-	return &AuthenticationService{
+) *AuthenticationLiaison {
+	return &AuthenticationLiaison{
 		persistentDbSvc: persistentDbSvc,
 		trailDbSvc:      trailDbSvc,
 	}
 }
 
-func (service *AuthenticationService) Login(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"username", "password"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
+func (liaison *AuthenticationLiaison) Login(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"username", "password", "operatorIpAddress"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
-	username, err := valueObject.NewUsername(input["username"])
+	username, err := valueObject.NewUsername(untrustedInput["username"])
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
-	password, err := valueObject.NewPassword(input["password"])
+	password, err := valueObject.NewPassword(untrustedInput["password"])
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
-	operatorIpAddress, err := valueObject.NewIpAddress(input["operatorIpAddress"])
+	operatorIpAddress, err := valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
 	dto := dto.NewCreateSessionToken(username, password, operatorIpAddress)
 
-	authQueryRepo := authInfra.NewAuthQueryRepo(service.persistentDbSvc)
+	authQueryRepo := authInfra.NewAuthQueryRepo(liaison.persistentDbSvc)
 	authCmdRepo := authInfra.AuthCmdRepo{}
-	accountQueryRepo := accountInfra.NewAccountQueryRepo(service.persistentDbSvc)
+	accountQueryRepo := accountInfra.NewAccountQueryRepo(liaison.persistentDbSvc)
 	activityRecordQueryRepo := activityRecordInfra.NewActivityRecordQueryRepo(
-		service.trailDbSvc,
+		liaison.trailDbSvc,
 	)
 	activityRecordCmdRepo := activityRecordInfra.NewActivityRecordCmdRepo(
-		service.trailDbSvc,
+		liaison.trailDbSvc,
 	)
 
 	accessToken, err := useCase.CreateSessionToken(
@@ -65,8 +67,8 @@ func (service *AuthenticationService) Login(input map[string]interface{}) Servic
 		activityRecordCmdRepo, dto,
 	)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, accessToken)
+	return NewLiaisonOutput(Success, accessToken)
 }

+ 284 - 0
src/presentation/liaison/cron.go

@@ -0,0 +1,284 @@
+package liaison
+
+import (
+	"errors"
+
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	cronInfra "github.com/goinfinite/os/src/infra/cron"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+)
+
+type CronLiaison struct {
+	cronQueryRepo         *cronInfra.CronQueryRepo
+	cronCmdRepo           *cronInfra.CronCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewCronLiaison(
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *CronLiaison {
+	return &CronLiaison{
+		cronQueryRepo:         cronInfra.NewCronQueryRepo(),
+		cronCmdRepo:           cronInfra.NewCronCmdRepo(),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *CronLiaison) Read(untrustedInput map[string]any) LiaisonOutput {
+	var idPtr *valueObject.CronId
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewCronId(untrustedInput["id"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		idPtr = &id
+	}
+
+	var commentPtr *valueObject.CronComment
+	if untrustedInput["comment"] != nil {
+		slug, err := valueObject.NewCronComment(untrustedInput["comment"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		commentPtr = &slug
+	}
+
+	paginationDto := useCase.MarketplaceDefaultPagination
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
+		}
+		paginationDto.PageNumber = pageNumber
+	}
+
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
+		}
+		paginationDto.ItemsPerPage = itemsPerPage
+	}
+
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortBy = &sortBy
+	}
+
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(
+			untrustedInput["sortDirection"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortDirection = &sortDirection
+	}
+
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.LastSeenId = &lastSeenId
+	}
+
+	readDto := dto.ReadCronsRequest{
+		Pagination:  paginationDto,
+		CronId:      idPtr,
+		CronComment: commentPtr,
+	}
+
+	cronsList, err := useCase.ReadCrons(liaison.cronQueryRepo, readDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, cronsList)
+}
+
+func (liaison *CronLiaison) Create(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"schedule", "command"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	schedule, err := valueObject.NewCronSchedule(untrustedInput["schedule"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	command, err := valueObject.NewUnixCommand(untrustedInput["command"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var commentPtr *valueObject.CronComment
+	if untrustedInput["comment"] != nil && untrustedInput["comment"] != "" {
+		comment, err := valueObject.NewCronComment(untrustedInput["comment"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		commentPtr = &comment
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateCron(
+		schedule, command, commentPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.CreateCron(
+		liaison.cronCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "CronCreated")
+}
+
+func (liaison *CronLiaison) Update(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"id"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	id, err := valueObject.NewCronId(untrustedInput["id"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var schedulePtr *valueObject.CronSchedule
+	if untrustedInput["schedule"] != nil {
+		schedule, err := valueObject.NewCronSchedule(untrustedInput["schedule"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		schedulePtr = &schedule
+	}
+
+	var commandPtr *valueObject.UnixCommand
+	if untrustedInput["command"] != nil {
+		command, err := valueObject.NewUnixCommand(untrustedInput["command"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		commandPtr = &command
+	}
+
+	var commentPtr *valueObject.CronComment
+	if untrustedInput["comment"] != nil {
+		comment, err := valueObject.NewCronComment(untrustedInput["comment"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		commentPtr = &comment
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateCron(
+		id, schedulePtr, commandPtr, commentPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.UpdateCron(
+		liaison.cronQueryRepo, liaison.cronCmdRepo, liaison.activityRecordCmdRepo,
+		updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "CronUpdated")
+}
+
+func (liaison *CronLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	var idPtr *valueObject.CronId
+	if untrustedInput["cronId"] != nil {
+		id, err := valueObject.NewCronId(untrustedInput["cronId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		idPtr = &id
+	}
+
+	var commentPtr *valueObject.CronComment
+	if untrustedInput["comment"] != nil {
+		comment, err := valueObject.NewCronComment(untrustedInput["comment"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		commentPtr = &comment
+	}
+
+	var err error
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteCron(
+		idPtr, commentPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.DeleteCron(
+		liaison.cronQueryRepo, liaison.cronCmdRepo, liaison.activityRecordCmdRepo,
+		deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "CronDeleted")
+}

+ 352 - 0
src/presentation/liaison/database.go

@@ -0,0 +1,352 @@
+package liaison
+
+import (
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	databaseInfra "github.com/goinfinite/os/src/infra/database"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
+)
+
+type DatabaseLiaison struct {
+	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+	availabilityInspector *sharedHelper.ServiceAvailabilityInspector
+}
+
+func NewDatabaseLiaison(
+	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *DatabaseLiaison {
+	return &DatabaseLiaison{
+		persistentDbSvc:       persistentDbSvc,
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+		availabilityInspector: sharedHelper.NewServiceAvailabilityInspector(
+			persistentDbSvc,
+		),
+	}
+}
+
+func (liaison *DatabaseLiaison) Read(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"dbType"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbType, err := valueObject.NewDatabaseType(untrustedInput["dbType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	serviceName, err := valueObject.NewServiceName(dbType.String())
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	requestPagination, err := liaisonHelper.PaginationParser(
+		untrustedInput, useCase.DatabasesDefaultPagination,
+	)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var databaseNamePtr *valueObject.DatabaseName
+	if untrustedInput["name"] != nil {
+		databaseName, err := valueObject.NewDatabaseName(untrustedInput["name"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		databaseNamePtr = &databaseName
+	}
+
+	var usernamePtr *valueObject.DatabaseUsername
+	if untrustedInput["username"] != nil {
+		username, err := valueObject.NewDatabaseUsername(untrustedInput["username"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		usernamePtr = &username
+	}
+
+	requestDto := dto.ReadDatabasesRequest{
+		Pagination:   requestPagination,
+		DatabaseName: databaseNamePtr,
+		DatabaseType: &dbType,
+		Username:     usernamePtr,
+	}
+
+	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
+
+	responseDto, err := useCase.ReadDatabases(databaseQueryRepo, requestDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, responseDto)
+}
+
+func (liaison *DatabaseLiaison) Create(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"dbType", "dbName"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbType, err := valueObject.NewDatabaseType(untrustedInput["dbType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbName, err := valueObject.NewDatabaseName(untrustedInput["dbName"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	serviceName, err := valueObject.NewServiceName(dbType.String())
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateDatabase(dbName, operatorAccountId, operatorIpAddress)
+
+	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
+	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
+
+	err = useCase.CreateDatabase(
+		databaseQueryRepo, databaseCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "DatabaseCreated")
+}
+
+func (liaison *DatabaseLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"dbType", "dbName"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbType, err := valueObject.NewDatabaseType(untrustedInput["dbType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	serviceName, err := valueObject.NewServiceName(dbType.String())
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	dbName, err := valueObject.NewDatabaseName(untrustedInput["dbName"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteDatabase(dbName, operatorAccountId, operatorIpAddress)
+
+	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
+	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
+
+	err = useCase.DeleteDatabase(
+		databaseQueryRepo, databaseCmdRepo, liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "DatabaseDeleted")
+}
+
+func (liaison *DatabaseLiaison) CreateUser(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"dbType", "dbName", "username", "password"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbType, err := valueObject.NewDatabaseType(untrustedInput["dbType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	serviceName, err := valueObject.NewServiceName(dbType.String())
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	dbName, err := valueObject.NewDatabaseName(untrustedInput["dbName"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbUsername, err := valueObject.NewDatabaseUsername(untrustedInput["username"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbPassword, err := valueObject.NewPassword(untrustedInput["password"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbPrivileges := []valueObject.DatabasePrivilege{
+		valueObject.DatabasePrivilege("ALL"),
+	}
+	if untrustedInput["privileges"] != nil {
+		var assertOk bool
+		dbPrivileges, assertOk = untrustedInput["privileges"].([]valueObject.DatabasePrivilege)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidDatabasePrivileges")
+		}
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateDatabaseUser(
+		dbName, dbUsername, dbPassword, dbPrivileges, operatorAccountId,
+		operatorIpAddress,
+	)
+
+	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
+	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
+
+	err = useCase.CreateDatabaseUser(
+		databaseQueryRepo, databaseCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "DatabaseUserCreated")
+}
+
+func (liaison *DatabaseLiaison) DeleteUser(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"dbType", "dbName", "dbUser"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbType, err := valueObject.NewDatabaseType(untrustedInput["dbType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	serviceName, err := valueObject.NewServiceName(dbType.String())
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	dbName, err := valueObject.NewDatabaseName(untrustedInput["dbName"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	dbUsername, err := valueObject.NewDatabaseUsername(untrustedInput["dbUser"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteDatabaseUser(
+		dbName, dbUsername, operatorAccountId, operatorIpAddress,
+	)
+
+	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
+	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
+
+	err = useCase.DeleteDatabaseUser(
+		databaseQueryRepo, databaseCmdRepo, liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "DatabaseUserDeleted")
+}

+ 12 - 12
src/presentation/service/helper/paginationParser.go → src/presentation/liaison/helper/paginationParser.go

@@ -1,4 +1,4 @@
-package serviceHelper
+package liaisonHelper
 
 import (
 	"errors"
@@ -9,45 +9,45 @@ import (
 )
 
 func PaginationParser(
-	userInput map[string]interface{},
+	untrustedInput map[string]any,
 	defaultPagination dto.Pagination,
 ) (requestPagination dto.Pagination, err error) {
 	requestPagination = defaultPagination
 
-	if userInput["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(userInput["pageNumber"])
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
 		if err != nil {
 			return requestPagination, errors.New("InvalidPageNumber")
 		}
 		requestPagination.PageNumber = pageNumber
 	}
 
-	if userInput["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(userInput["itemsPerPage"])
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
 		if err != nil {
 			return requestPagination, errors.New("InvalidItemsPerPage")
 		}
 		requestPagination.ItemsPerPage = itemsPerPage
 	}
 
-	if userInput["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(userInput["sortBy"])
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
 		if err != nil {
 			return requestPagination, err
 		}
 		requestPagination.SortBy = &sortBy
 	}
 
-	if userInput["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(userInput["sortDirection"])
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(untrustedInput["sortDirection"])
 		if err != nil {
 			return requestPagination, err
 		}
 		requestPagination.SortDirection = &sortDirection
 	}
 
-	if userInput["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(userInput["lastSeenId"])
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
 		if err != nil {
 			return requestPagination, err
 		}

+ 3 - 3
src/presentation/service/helper/requiredParamsInspector.go → src/presentation/liaison/helper/requiredParamsInspector.go

@@ -1,4 +1,4 @@
-package serviceHelper
+package liaisonHelper
 
 import (
 	"errors"
@@ -6,12 +6,12 @@ import (
 )
 
 func RequiredParamsInspector(
-	input map[string]interface{},
+	untrustedInput map[string]any,
 	requiredParams []string,
 ) error {
 	missingParams := []string{}
 	for _, param := range requiredParams {
-		if _, exists := input[param]; !exists {
+		if _, exists := untrustedInput[param]; !exists {
 			missingParams = append(missingParams, param)
 		}
 	}

+ 4 - 4
src/presentation/service/helper/timeParamsParser.go → src/presentation/liaison/helper/timeParamsParser.go

@@ -1,4 +1,4 @@
-package serviceHelper
+package liaisonHelper
 
 import (
 	"log/slog"
@@ -8,16 +8,16 @@ import (
 
 func TimeParamsParser(
 	timeParamNames []string,
-	userInput map[string]interface{},
+	untrustedInput map[string]any,
 ) map[string]*valueObject.UnixTime {
 	timeParamPtrs := map[string]*valueObject.UnixTime{}
 
 	for _, timeParamName := range timeParamNames {
-		if userInput[timeParamName] == nil {
+		if untrustedInput[timeParamName] == nil {
 			continue
 		}
 
-		timeParam, err := valueObject.NewUnixTime(userInput[timeParamName])
+		timeParam, err := valueObject.NewUnixTime(untrustedInput[timeParamName])
 		if err != nil {
 			slog.Debug("InvalidTimeParam", slog.String("timeParamName", timeParamName))
 			timeParamPtrs[timeParamName] = nil

+ 131 - 131
src/presentation/service/marketplace.go → src/presentation/liaison/marketplace.go

@@ -1,4 +1,4 @@
-package service
+package liaison
 
 import (
 	"errors"
@@ -17,21 +17,21 @@ import (
 	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
 	servicesInfra "github.com/goinfinite/os/src/infra/services"
 	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
 )
 
-type MarketplaceService struct {
+type MarketplaceLiaison struct {
 	marketplaceQueryRepo  *marketplaceInfra.MarketplaceQueryRepo
 	marketplaceCmdRepo    *marketplaceInfra.MarketplaceCmdRepo
 	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
 	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
 }
 
-func NewMarketplaceService(
+func NewMarketplaceLiaison(
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *MarketplaceService {
-	return &MarketplaceService{
+) *MarketplaceLiaison {
+	return &MarketplaceLiaison{
 		marketplaceQueryRepo:  marketplaceInfra.NewMarketplaceQueryRepo(persistentDbSvc),
 		marketplaceCmdRepo:    marketplaceInfra.NewMarketplaceCmdRepo(persistentDbSvc),
 		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
@@ -39,84 +39,84 @@ func NewMarketplaceService(
 	}
 }
 
-func (service *MarketplaceService) ReadCatalog(
-	input map[string]interface{},
-) ServiceOutput {
+func (liaison *MarketplaceLiaison) ReadCatalog(
+	untrustedInput map[string]any,
+) LiaisonOutput {
 	var idPtr *valueObject.MarketplaceItemId
-	if input["id"] != nil {
-		id, err := valueObject.NewMarketplaceItemId(input["id"])
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewMarketplaceItemId(untrustedInput["id"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		idPtr = &id
 	}
 
 	var slugPtr *valueObject.MarketplaceItemSlug
-	if input["slug"] != nil {
-		slug, err := valueObject.NewMarketplaceItemSlug(input["slug"])
+	if untrustedInput["slug"] != nil {
+		slug, err := valueObject.NewMarketplaceItemSlug(untrustedInput["slug"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		slugPtr = &slug
 	}
 
 	var namePtr *valueObject.MarketplaceItemName
-	if input["name"] != nil {
-		name, err := valueObject.NewMarketplaceItemName(input["name"])
+	if untrustedInput["name"] != nil {
+		name, err := valueObject.NewMarketplaceItemName(untrustedInput["name"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		namePtr = &name
 	}
 
 	var typePtr *valueObject.MarketplaceItemType
-	if input["type"] != nil {
-		itemType, err := valueObject.NewMarketplaceItemType(input["type"])
+	if untrustedInput["type"] != nil {
+		itemType, err := valueObject.NewMarketplaceItemType(untrustedInput["type"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		typePtr = &itemType
 	}
 
 	paginationDto := useCase.MarketplaceDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
 		}
 		paginationDto.PageNumber = pageNumber
 	}
 
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
 		}
 		paginationDto.ItemsPerPage = itemsPerPage
 	}
 
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortBy = &sortBy
 	}
 
-	if input["sortDirection"] != nil {
+	if untrustedInput["sortDirection"] != nil {
 		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
+			untrustedInput["sortDirection"],
 		)
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortDirection = &sortDirection
 	}
 
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.LastSeenId = &lastSeenId
 	}
@@ -130,65 +130,65 @@ func (service *MarketplaceService) ReadCatalog(
 	}
 
 	marketplaceQueryRepo := marketplaceInfra.NewMarketplaceQueryRepo(
-		service.persistentDbSvc,
+		liaison.persistentDbSvc,
 	)
 	itemsList, err := useCase.ReadMarketplaceCatalogItems(marketplaceQueryRepo, readDto)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, itemsList)
+	return NewLiaisonOutput(Success, itemsList)
 }
 
-func (service *MarketplaceService) InstallCatalogItem(
-	input map[string]interface{},
+func (liaison *MarketplaceLiaison) InstallCatalogItem(
+	untrustedInput map[string]any,
 	shouldSchedule bool,
-) ServiceOutput {
+) LiaisonOutput {
 	hostname, err := infraHelper.ReadPrimaryVirtualHostHostname()
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	if input["hostname"] != nil {
-		hostname, err = valueObject.NewFqdn(input["hostname"])
+	if untrustedInput["hostname"] != nil {
+		hostname, err = valueObject.NewFqdn(untrustedInput["hostname"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 	}
 
 	var idPtr *valueObject.MarketplaceItemId
-	if input["id"] != nil {
-		id, err := valueObject.NewMarketplaceItemId(input["id"])
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewMarketplaceItemId(untrustedInput["id"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 		idPtr = &id
 	}
 
 	var slugPtr *valueObject.MarketplaceItemSlug
-	if input["slug"] != nil {
-		slug, err := valueObject.NewMarketplaceItemSlug(input["slug"])
+	if untrustedInput["slug"] != nil {
+		slug, err := valueObject.NewMarketplaceItemSlug(untrustedInput["slug"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 		slugPtr = &slug
 	}
 
 	var urlPathPtr *valueObject.UrlPath
-	if input["urlPath"] != nil {
-		urlPath, err := valueObject.NewUrlPath(input["urlPath"])
+	if untrustedInput["urlPath"] != nil {
+		urlPath, err := valueObject.NewUrlPath(untrustedInput["urlPath"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 		urlPathPtr = &urlPath
 	}
 
 	dataFields := []valueObject.MarketplaceInstallableItemDataField{}
-	if _, exists := input["dataFields"]; exists {
+	if _, exists := untrustedInput["dataFields"]; exists {
 		var assertOk bool
-		dataFields, assertOk = input["dataFields"].([]valueObject.MarketplaceInstallableItemDataField)
+		dataFields, assertOk = untrustedInput["dataFields"].([]valueObject.MarketplaceInstallableItemDataField)
 		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidDataFields")
+			return NewLiaisonOutput(UserError, "InvalidDataFields")
 		}
 	}
 
@@ -217,7 +217,7 @@ func (service *MarketplaceService) InstallCatalogItem(
 
 		cliCmd += " " + strings.Join(installParams, " ")
 
-		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(service.persistentDbSvc)
+		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(liaison.persistentDbSvc)
 		taskName, _ := valueObject.NewScheduledTaskName("InstallMarketplaceCatalogItem")
 		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
 		taskTag, _ := valueObject.NewScheduledTaskTag("marketplace")
@@ -230,25 +230,25 @@ func (service *MarketplaceService) InstallCatalogItem(
 
 		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
 		if err != nil {
-			return NewServiceOutput(InfraError, err.Error())
+			return NewLiaisonOutput(InfraError, err.Error())
 		}
 
-		return NewServiceOutput(Created, "MarketplaceCatalogItemInstallationScheduled")
+		return NewLiaisonOutput(Created, "MarketplaceCatalogItemInstallationScheduled")
 	}
 
 	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 	}
 
 	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 	}
 
@@ -257,99 +257,99 @@ func (service *MarketplaceService) InstallCatalogItem(
 		operatorIpAddress,
 	)
 
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbSvc)
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbSvc)
 
 	err = useCase.InstallMarketplaceCatalogItem(
-		vhostQueryRepo, service.marketplaceQueryRepo, service.marketplaceCmdRepo,
-		service.activityRecordCmdRepo, installDto,
+		vhostQueryRepo, liaison.marketplaceQueryRepo, liaison.marketplaceCmdRepo,
+		liaison.activityRecordCmdRepo, installDto,
 	)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Created, "MarketplaceCatalogItemInstalled")
+	return NewLiaisonOutput(Created, "MarketplaceCatalogItemInstalled")
 }
 
-func (service *MarketplaceService) ReadInstalledItems(
-	input map[string]interface{},
-) ServiceOutput {
+func (liaison *MarketplaceLiaison) ReadInstalledItems(
+	untrustedInput map[string]any,
+) LiaisonOutput {
 	var idPtr *valueObject.MarketplaceItemId
-	if input["id"] != nil {
-		id, err := valueObject.NewMarketplaceItemId(input["id"])
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewMarketplaceItemId(untrustedInput["id"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		idPtr = &id
 	}
 
 	var hostnamePtr *valueObject.Fqdn
-	if input["hostname"] != nil {
-		hostname, err := valueObject.NewFqdn(input["hostname"])
+	if untrustedInput["hostname"] != nil {
+		hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		hostnamePtr = &hostname
 	}
 
 	var typePtr *valueObject.MarketplaceItemType
-	if input["type"] != nil {
-		itemType, err := valueObject.NewMarketplaceItemType(input["type"])
+	if untrustedInput["type"] != nil {
+		itemType, err := valueObject.NewMarketplaceItemType(untrustedInput["type"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		typePtr = &itemType
 	}
 
 	var installationUuidPtr *valueObject.MarketplaceInstalledItemUuid
-	if input["installationUuid"] != nil {
+	if untrustedInput["installationUuid"] != nil {
 		installationUuid, err := valueObject.NewMarketplaceInstalledItemUuid(
-			input["installationUuid"],
+			untrustedInput["installationUuid"],
 		)
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		installationUuidPtr = &installationUuid
 	}
 
 	paginationDto := useCase.MarketplaceDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
 		}
 		paginationDto.PageNumber = pageNumber
 	}
 
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
 		}
 		paginationDto.ItemsPerPage = itemsPerPage
 	}
 
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortBy = &sortBy
 	}
 
-	if input["sortDirection"] != nil {
+	if untrustedInput["sortDirection"] != nil {
 		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
+			untrustedInput["sortDirection"],
 		)
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortDirection = &sortDirection
 	}
 
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.LastSeenId = &lastSeenId
 	}
@@ -363,38 +363,38 @@ func (service *MarketplaceService) ReadInstalledItems(
 	}
 
 	marketplaceQueryRepo := marketplaceInfra.NewMarketplaceQueryRepo(
-		service.persistentDbSvc,
+		liaison.persistentDbSvc,
 	)
 	itemsList, err := useCase.ReadMarketplaceInstalledItems(
 		marketplaceQueryRepo, readDto,
 	)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, itemsList)
+	return NewLiaisonOutput(Success, itemsList)
 }
 
-func (service *MarketplaceService) DeleteInstalledItem(
-	input map[string]interface{},
+func (liaison *MarketplaceLiaison) DeleteInstalledItem(
+	untrustedInput map[string]any,
 	shouldSchedule bool,
-) ServiceOutput {
+) LiaisonOutput {
 	requiredParams := []string{"installedId"}
 
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
-	installedId, err := valueObject.NewMarketplaceItemId(input["installedId"])
+	installedId, err := valueObject.NewMarketplaceItemId(untrustedInput["installedId"])
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
 	shouldUninstallServices := true
-	if input["shouldUninstallServices"] != nil {
+	if untrustedInput["shouldUninstallServices"] != nil {
 		shouldUninstallServices, err = voHelper.InterfaceToBool(
-			input["shouldUninstallServices"],
+			untrustedInput["shouldUninstallServices"],
 		)
 		if err != nil {
 			shouldUninstallServices = false
@@ -402,18 +402,18 @@ func (service *MarketplaceService) DeleteInstalledItem(
 	}
 
 	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 	}
 
 	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 	}
 
@@ -427,7 +427,7 @@ func (service *MarketplaceService) DeleteInstalledItem(
 		cliCmd += " " + strings.Join(installParams, " ")
 
 		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(
-			service.persistentDbSvc,
+			liaison.persistentDbSvc,
 		)
 		taskName, _ := valueObject.NewScheduledTaskName("DeleteMarketplaceCatalogItem")
 		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
@@ -441,29 +441,29 @@ func (service *MarketplaceService) DeleteInstalledItem(
 
 		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
 		if err != nil {
-			return NewServiceOutput(InfraError, err.Error())
+			return NewLiaisonOutput(InfraError, err.Error())
 		}
 
-		return NewServiceOutput(Created, "MarketplaceCatalogItemDeletionScheduled")
+		return NewLiaisonOutput(Created, "MarketplaceCatalogItemDeletionScheduled")
 	}
 
 	deleteMarketplaceInstalledItem := dto.NewDeleteMarketplaceInstalledItem(
 		installedId, shouldUninstallServices, operatorAccountId, operatorIpAddress,
 	)
 
-	mappingQueryRepo := vhostInfra.NewMappingQueryRepo(service.persistentDbSvc)
-	mappingCmdRepo := vhostInfra.NewMappingCmdRepo(service.persistentDbSvc)
-	servicesQueryRepo := servicesInfra.NewServicesQueryRepo(service.persistentDbSvc)
-	servicesCmdRepo := servicesInfra.NewServicesCmdRepo(service.persistentDbSvc)
+	mappingQueryRepo := vhostInfra.NewMappingQueryRepo(liaison.persistentDbSvc)
+	mappingCmdRepo := vhostInfra.NewMappingCmdRepo(liaison.persistentDbSvc)
+	servicesQueryRepo := servicesInfra.NewServicesQueryRepo(liaison.persistentDbSvc)
+	servicesCmdRepo := servicesInfra.NewServicesCmdRepo(liaison.persistentDbSvc)
 
 	err = useCase.DeleteMarketplaceInstalledItem(
-		service.marketplaceQueryRepo, service.marketplaceCmdRepo,
+		liaison.marketplaceQueryRepo, liaison.marketplaceCmdRepo,
 		mappingQueryRepo, mappingCmdRepo, servicesQueryRepo, servicesCmdRepo,
-		service.activityRecordCmdRepo, deleteMarketplaceInstalledItem,
+		liaison.activityRecordCmdRepo, deleteMarketplaceInstalledItem,
 	)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, "MarketplaceInstalledItemDeleted")
+	return NewLiaisonOutput(Success, "MarketplaceInstalledItemDeleted")
 }

+ 9 - 9
src/presentation/service/o11y.go → src/presentation/liaison/o11y.go

@@ -1,4 +1,4 @@
-package service
+package liaison
 
 import (
 	"github.com/goinfinite/os/src/domain/useCase"
@@ -6,25 +6,25 @@ import (
 	o11yInfra "github.com/goinfinite/os/src/infra/o11y"
 )
 
-type O11yService struct {
+type O11yLiaison struct {
 	transientDbSvc *internalDbInfra.TransientDatabaseService
 }
 
-func NewO11yService(
+func NewO11yLiaison(
 	transientDbSvc *internalDbInfra.TransientDatabaseService,
-) *O11yService {
-	return &O11yService{
+) *O11yLiaison {
+	return &O11yLiaison{
 		transientDbSvc: transientDbSvc,
 	}
 }
 
-func (service *O11yService) ReadOverview() ServiceOutput {
-	o11yQueryRepo := o11yInfra.NewO11yQueryRepo(service.transientDbSvc)
+func (liaison *O11yLiaison) ReadOverview() LiaisonOutput {
+	o11yQueryRepo := o11yInfra.NewO11yQueryRepo(liaison.transientDbSvc)
 
 	o11yOverview, err := useCase.ReadO11yOverview(o11yQueryRepo, true)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, o11yOverview)
+	return NewLiaisonOutput(Success, o11yOverview)
 }

+ 6 - 6
src/presentation/service/output.go → src/presentation/liaison/output.go

@@ -1,4 +1,4 @@
-package service
+package liaison
 
 type StatusEnum string
 
@@ -11,13 +11,13 @@ const (
 	InfraError   StatusEnum = "infraError"
 )
 
-type ServiceOutput struct {
-	Status StatusEnum  `json:"status"`
-	Body   interface{} `json:"body"`
+type LiaisonOutput struct {
+	Status StatusEnum `json:"status"`
+	Body   any        `json:"body"`
 }
 
-func NewServiceOutput(status StatusEnum, body interface{}) ServiceOutput {
-	return ServiceOutput{
+func NewLiaisonOutput(status StatusEnum, body any) LiaisonOutput {
+	return LiaisonOutput{
 		Status: status,
 		Body:   body,
 	}

+ 134 - 0
src/presentation/liaison/runtime.go

@@ -0,0 +1,134 @@
+package liaison
+
+import (
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/entity"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	runtimeInfra "github.com/goinfinite/os/src/infra/runtime"
+	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
+)
+
+type RuntimeLiaison struct {
+	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
+	availabilityInspector *sharedHelper.ServiceAvailabilityInspector
+	runtimeQueryRepo      runtimeInfra.RuntimeQueryRepo
+	runtimeCmdRepo        *runtimeInfra.RuntimeCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewRuntimeLiaison(
+	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *RuntimeLiaison {
+	return &RuntimeLiaison{
+		persistentDbSvc: persistentDbSvc,
+		availabilityInspector: sharedHelper.NewServiceAvailabilityInspector(
+			persistentDbSvc,
+		),
+		runtimeQueryRepo:      runtimeInfra.RuntimeQueryRepo{},
+		runtimeCmdRepo:        runtimeInfra.NewRuntimeCmdRepo(persistentDbSvc),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *RuntimeLiaison) ReadPhpConfigs(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	serviceName, _ := valueObject.NewServiceName("php-webserver")
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	phpConfigs, err := useCase.ReadPhpConfigs(liaison.runtimeQueryRepo, hostname)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, phpConfigs)
+}
+
+func (liaison *RuntimeLiaison) UpdatePhpConfigs(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	serviceName, _ := valueObject.NewServiceName("php-webserver")
+	if !liaison.availabilityInspector.IsAvailable(serviceName) {
+		return NewLiaisonOutput(InfraError, sharedHelper.ServiceUnavailableError)
+	}
+
+	requiredParams := []string{"hostname", "version"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	phpVersion, err := valueObject.NewPhpVersion(untrustedInput["version"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	phpModules := []entity.PhpModule{}
+	if _, exists := untrustedInput["modules"]; exists {
+		var assertOk bool
+		phpModules, assertOk = untrustedInput["modules"].([]entity.PhpModule)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidPhpModules")
+		}
+	}
+
+	phpSettings := []entity.PhpSetting{}
+	if _, exists := untrustedInput["settings"]; exists {
+		var assertOk bool
+		phpSettings, assertOk = untrustedInput["settings"].([]entity.PhpSetting)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidPhpSettings")
+		}
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdatePhpConfigs(
+		hostname, phpVersion, phpModules, phpSettings, operatorAccountId,
+		operatorIpAddress,
+	)
+
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbSvc)
+
+	err = useCase.UpdatePhpConfigs(
+		liaison.runtimeQueryRepo, liaison.runtimeCmdRepo, vhostQueryRepo,
+		liaison.activityRecordCmdRepo, updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "PhpConfigsUpdated")
+}

+ 59 - 59
src/presentation/service/scheduledTask.go → src/presentation/liaison/scheduledTask.go

@@ -1,4 +1,4 @@
-package service
+package liaison
 
 import (
 	"errors"
@@ -9,60 +9,60 @@ import (
 	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
 	"golang.org/x/text/cases"
 	"golang.org/x/text/language"
 )
 
-type ScheduledTaskService struct {
+type ScheduledTaskLiaison struct {
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 }
 
-func NewScheduledTaskService(
+func NewScheduledTaskLiaison(
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-) *ScheduledTaskService {
-	return &ScheduledTaskService{
+) *ScheduledTaskLiaison {
+	return &ScheduledTaskLiaison{
 		persistentDbSvc: persistentDbSvc,
 	}
 }
 
-func (service *ScheduledTaskService) Read(input map[string]interface{}) ServiceOutput {
+func (liaison *ScheduledTaskLiaison) Read(untrustedInput map[string]any) LiaisonOutput {
 	var taskIdPtr *valueObject.ScheduledTaskId
-	if input["id"] != nil {
-		input["taskId"] = input["id"]
+	if untrustedInput["id"] != nil {
+		untrustedInput["taskId"] = untrustedInput["id"]
 	}
-	if input["taskId"] != nil {
-		taskId, err := valueObject.NewScheduledTaskId(input["taskId"])
+	if untrustedInput["taskId"] != nil {
+		taskId, err := valueObject.NewScheduledTaskId(untrustedInput["taskId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		taskIdPtr = &taskId
 	}
 
 	var taskNamePtr *valueObject.ScheduledTaskName
-	if input["taskName"] != nil {
-		taskName, err := valueObject.NewScheduledTaskName(input["taskName"])
+	if untrustedInput["taskName"] != nil {
+		taskName, err := valueObject.NewScheduledTaskName(untrustedInput["taskName"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		taskNamePtr = &taskName
 	}
 
 	var taskStatusPtr *valueObject.ScheduledTaskStatus
-	if input["taskStatus"] != nil {
-		taskStatus, err := valueObject.NewScheduledTaskStatus(input["taskStatus"])
+	if untrustedInput["taskStatus"] != nil {
+		taskStatus, err := valueObject.NewScheduledTaskStatus(untrustedInput["taskStatus"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		taskStatusPtr = &taskStatus
 	}
 
 	taskTags := []valueObject.ScheduledTaskTag{}
-	if input["taskTags"] != nil {
+	if untrustedInput["taskTags"] != nil {
 		var assertOk bool
-		taskTags, assertOk = input["taskTags"].([]valueObject.ScheduledTaskTag)
+		taskTags, assertOk = untrustedInput["taskTags"].([]valueObject.ScheduledTaskTag)
 		if !assertOk {
-			return NewServiceOutput(UserError, errors.New("InvalidTaskTags"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidTaskTags"))
 		}
 	}
 
@@ -76,14 +76,14 @@ func (service *ScheduledTaskService) Read(input map[string]interface{}) ServiceO
 		"createdBeforeAt", "createdAfterAt",
 	}
 	for _, timeParamName := range timeParamNames {
-		if input[timeParamName] == nil {
+		if untrustedInput[timeParamName] == nil {
 			continue
 		}
 
-		timeParam, err := valueObject.NewUnixTime(input[timeParamName])
+		timeParam, err := valueObject.NewUnixTime(untrustedInput[timeParamName])
 		if err != nil {
 			capitalParamName := cases.Title(language.English).String(timeParamName)
-			return NewServiceOutput(UserError, errors.New("Invalid"+capitalParamName))
+			return NewLiaisonOutput(UserError, errors.New("Invalid"+capitalParamName))
 		}
 
 		switch timeParamName {
@@ -103,42 +103,42 @@ func (service *ScheduledTaskService) Read(input map[string]interface{}) ServiceO
 	}
 
 	paginationDto := useCase.ScheduledTasksDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
 		}
 		paginationDto.PageNumber = pageNumber
 	}
 
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
 		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
 		}
 		paginationDto.ItemsPerPage = itemsPerPage
 	}
 
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortBy = &sortBy
 	}
 
-	if input["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(input["sortDirection"])
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(untrustedInput["sortDirection"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.SortDirection = &sortDirection
 	}
 
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
 		if err != nil {
-			return NewServiceOutput(UserError, err)
+			return NewLiaisonOutput(UserError, err)
 		}
 		paginationDto.LastSeenId = &lastSeenId
 	}
@@ -157,46 +157,46 @@ func (service *ScheduledTaskService) Read(input map[string]interface{}) ServiceO
 		CreatedAfterAt:   createdAfterAtPtr,
 	}
 
-	scheduledTaskQueryRepo := scheduledTaskInfra.NewScheduledTaskQueryRepo(service.persistentDbSvc)
+	scheduledTaskQueryRepo := scheduledTaskInfra.NewScheduledTaskQueryRepo(liaison.persistentDbSvc)
 	scheduledTasksList, err := useCase.ReadScheduledTasks(scheduledTaskQueryRepo, readDto)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, scheduledTasksList)
+	return NewLiaisonOutput(Success, scheduledTasksList)
 }
 
-func (service *ScheduledTaskService) Update(input map[string]interface{}) ServiceOutput {
-	if input["id"] != nil {
-		input["taskId"] = input["id"]
+func (liaison *ScheduledTaskLiaison) Update(untrustedInput map[string]any) LiaisonOutput {
+	if untrustedInput["id"] != nil {
+		untrustedInput["taskId"] = untrustedInput["id"]
 	}
 
 	requiredParams := []string{"taskId"}
 
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
-	taskId, err := valueObject.NewScheduledTaskId(input["taskId"])
+	taskId, err := valueObject.NewScheduledTaskId(untrustedInput["taskId"])
 	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
+		return NewLiaisonOutput(UserError, err.Error())
 	}
 
 	var taskStatusPtr *valueObject.ScheduledTaskStatus
-	if input["status"] != nil {
-		taskStatus, err := valueObject.NewScheduledTaskStatus(input["status"])
+	if untrustedInput["status"] != nil {
+		taskStatus, err := valueObject.NewScheduledTaskStatus(untrustedInput["status"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 		taskStatusPtr = &taskStatus
 	}
 
 	var runAtPtr *valueObject.UnixTime
-	if input["runAt"] != nil {
-		runAt, err := valueObject.NewUnixTime(input["runAt"])
+	if untrustedInput["runAt"] != nil {
+		runAt, err := valueObject.NewUnixTime(untrustedInput["runAt"])
 		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
+			return NewLiaisonOutput(UserError, err.Error())
 		}
 		runAtPtr = &runAt
 	}
@@ -205,15 +205,15 @@ func (service *ScheduledTaskService) Update(input map[string]interface{}) Servic
 		taskId, taskStatusPtr, runAtPtr,
 	)
 
-	scheduledTaskQueryRepo := scheduledTaskInfra.NewScheduledTaskQueryRepo(service.persistentDbSvc)
-	scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(service.persistentDbSvc)
+	scheduledTaskQueryRepo := scheduledTaskInfra.NewScheduledTaskQueryRepo(liaison.persistentDbSvc)
+	scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(liaison.persistentDbSvc)
 
 	err = useCase.UpdateScheduledTask(
 		scheduledTaskQueryRepo, scheduledTaskCmdRepo, updateDto,
 	)
 	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
+		return NewLiaisonOutput(InfraError, err.Error())
 	}
 
-	return NewServiceOutput(Success, "ScheduledTaskUpdated")
+	return NewLiaisonOutput(Success, "ScheduledTaskUpdated")
 }

+ 937 - 0
src/presentation/liaison/services.go

@@ -0,0 +1,937 @@
+package liaison
+
+import (
+	"errors"
+	"log/slog"
+	"strconv"
+	"strings"
+
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	infraEnvs "github.com/goinfinite/os/src/infra/envs"
+	infraHelper "github.com/goinfinite/os/src/infra/helper"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
+	servicesInfra "github.com/goinfinite/os/src/infra/services"
+	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+)
+
+type ServicesLiaison struct {
+	persistentDbService   *internalDbInfra.PersistentDatabaseService
+	servicesQueryRepo     *servicesInfra.ServicesQueryRepo
+	servicesCmdRepo       *servicesInfra.ServicesCmdRepo
+	mappingQueryRepo      *vhostInfra.MappingQueryRepo
+	mappingCmdRepo        *vhostInfra.MappingCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewServicesLiaison(
+	persistentDbService *internalDbInfra.PersistentDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *ServicesLiaison {
+	return &ServicesLiaison{
+		persistentDbService:   persistentDbService,
+		servicesQueryRepo:     servicesInfra.NewServicesQueryRepo(persistentDbService),
+		servicesCmdRepo:       servicesInfra.NewServicesCmdRepo(persistentDbService),
+		mappingQueryRepo:      vhostInfra.NewMappingQueryRepo(persistentDbService),
+		mappingCmdRepo:        vhostInfra.NewMappingCmdRepo(persistentDbService),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *ServicesLiaison) ReadInstalledItems(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	var namePtr *valueObject.ServiceName
+	if untrustedInput["name"] != nil {
+		name, err := valueObject.NewServiceName(untrustedInput["name"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		namePtr = &name
+	}
+
+	var naturePtr *valueObject.ServiceNature
+	if untrustedInput["nature"] != nil {
+		nature, err := valueObject.NewServiceNature(untrustedInput["nature"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		naturePtr = &nature
+	}
+
+	var statusPtr *valueObject.ServiceStatus
+	if untrustedInput["status"] != nil {
+		status, err := valueObject.NewServiceStatus(untrustedInput["status"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		statusPtr = &status
+	}
+
+	var typePtr *valueObject.ServiceType
+	if untrustedInput["type"] != nil {
+		itemType, err := valueObject.NewServiceType(untrustedInput["type"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		typePtr = &itemType
+	}
+
+	shouldIncludeMetrics := false
+	if untrustedInput["shouldIncludeMetrics"] != nil {
+		var err error
+		shouldIncludeMetrics, err = voHelper.InterfaceToBool(untrustedInput["shouldIncludeMetrics"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+	}
+
+	paginationDto := useCase.ServicesDefaultPagination
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
+		}
+		paginationDto.PageNumber = pageNumber
+	}
+
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
+		}
+		paginationDto.ItemsPerPage = itemsPerPage
+	}
+
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortBy = &sortBy
+	}
+
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(
+			untrustedInput["sortDirection"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortDirection = &sortDirection
+	}
+
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.LastSeenId = &lastSeenId
+	}
+
+	readDto := dto.ReadInstalledServicesItemsRequest{
+		Pagination:           paginationDto,
+		ServiceName:          namePtr,
+		ServiceNature:        naturePtr,
+		ServiceType:          typePtr,
+		ServiceStatus:        statusPtr,
+		ShouldIncludeMetrics: &shouldIncludeMetrics,
+	}
+
+	servicesList, err := useCase.ReadInstalledServices(
+		liaison.servicesQueryRepo, readDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, servicesList)
+}
+
+func (liaison *ServicesLiaison) ReadInstallableItems(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	var namePtr *valueObject.ServiceName
+	if untrustedInput["name"] != nil {
+		name, err := valueObject.NewServiceName(untrustedInput["name"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		namePtr = &name
+	}
+
+	var naturePtr *valueObject.ServiceNature
+	if untrustedInput["nature"] != nil {
+		nature, err := valueObject.NewServiceNature(untrustedInput["nature"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		naturePtr = &nature
+	}
+
+	var typePtr *valueObject.ServiceType
+	if untrustedInput["type"] != nil {
+		itemType, err := valueObject.NewServiceType(untrustedInput["type"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		typePtr = &itemType
+	}
+
+	paginationDto := useCase.ServicesDefaultPagination
+	if untrustedInput["pageNumber"] != nil {
+		pageNumber, err := voHelper.InterfaceToUint32(untrustedInput["pageNumber"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidPageNumber"))
+		}
+		paginationDto.PageNumber = pageNumber
+	}
+
+	if untrustedInput["itemsPerPage"] != nil {
+		itemsPerPage, err := voHelper.InterfaceToUint16(untrustedInput["itemsPerPage"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidItemsPerPage"))
+		}
+		paginationDto.ItemsPerPage = itemsPerPage
+	}
+
+	if untrustedInput["sortBy"] != nil {
+		sortBy, err := valueObject.NewPaginationSortBy(untrustedInput["sortBy"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortBy = &sortBy
+	}
+
+	if untrustedInput["sortDirection"] != nil {
+		sortDirection, err := valueObject.NewPaginationSortDirection(
+			untrustedInput["sortDirection"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.SortDirection = &sortDirection
+	}
+
+	if untrustedInput["lastSeenId"] != nil {
+		lastSeenId, err := valueObject.NewPaginationLastSeenId(untrustedInput["lastSeenId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err)
+		}
+		paginationDto.LastSeenId = &lastSeenId
+	}
+
+	readDto := dto.ReadInstallableServicesItemsRequest{
+		Pagination:    paginationDto,
+		ServiceName:   namePtr,
+		ServiceNature: naturePtr,
+		ServiceType:   typePtr,
+	}
+
+	servicesList, err := useCase.ReadInstallableServices(
+		liaison.servicesQueryRepo, readDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, servicesList)
+}
+
+func (liaison *ServicesLiaison) CreateInstallable(
+	untrustedInput map[string]any,
+	shouldSchedule bool,
+) LiaisonOutput {
+	requiredParams := []string{"name"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	name, err := valueObject.NewServiceName(untrustedInput["name"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var versionPtr *valueObject.ServiceVersion
+	if untrustedInput["version"] != nil {
+		version, err := valueObject.NewServiceVersion(untrustedInput["version"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		versionPtr = &version
+	}
+
+	var startupFilePtr *valueObject.UnixFilePath
+	if untrustedInput["startupFile"] != nil {
+		startupFile, err := valueObject.NewUnixFilePath(untrustedInput["startupFile"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		startupFilePtr = &startupFile
+	}
+
+	var workingDirPtr *valueObject.UnixFilePath
+	if untrustedInput["workingDir"] != nil {
+		workingDir, err := valueObject.NewUnixFilePath(untrustedInput["workingDir"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		workingDirPtr = &workingDir
+	}
+
+	envs := []valueObject.ServiceEnv{}
+	if untrustedInput["envs"] != nil {
+		var assertOk bool
+		envs, assertOk = untrustedInput["envs"].([]valueObject.ServiceEnv)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidServiceEnvs")
+		}
+	}
+
+	portBindings := []valueObject.PortBinding{}
+	if untrustedInput["portBindings"] != nil {
+		var assertOk bool
+		portBindings, assertOk = untrustedInput["portBindings"].([]valueObject.PortBinding)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidPortBindings")
+		}
+	}
+
+	var autoStartPtr *bool
+	if untrustedInput["autoStart"] != nil {
+		autoStart, err := voHelper.InterfaceToBool(untrustedInput["autoStart"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoStartMustBeBool")
+		}
+		autoStartPtr = &autoStart
+	}
+
+	var timeoutStartSecsPtr *uint
+	if untrustedInput["timeoutStartSecs"] != nil {
+		timeoutStartSecs, err := voHelper.InterfaceToUint(untrustedInput["timeoutStartSecs"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "TimeoutStartSecsMustBeUint")
+		}
+		timeoutStartSecsPtr = &timeoutStartSecs
+	}
+
+	var autoRestartPtr *bool
+	if untrustedInput["autoRestart"] != nil {
+		autoRestart, err := voHelper.InterfaceToBool(
+			untrustedInput["autoRestart"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoRestartMustBeBool")
+		}
+		autoRestartPtr = &autoRestart
+	}
+
+	var maxStartRetriesPtr *uint
+	if untrustedInput["maxStartRetries"] != nil {
+		maxStartRetries, err := voHelper.InterfaceToUint(untrustedInput["maxStartRetries"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "MaxStartRetriesMustBeUint")
+		}
+		maxStartRetriesPtr = &maxStartRetries
+	}
+
+	autoCreateMapping := true
+	if untrustedInput["autoCreateMapping"] != nil {
+		autoCreateMapping, err = voHelper.InterfaceToBool(untrustedInput["autoCreateMapping"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoCreateMappingMustBeBool")
+		}
+	}
+
+	var mappingHostnamePtr *valueObject.Fqdn
+	if untrustedInput["mappingHostname"] != nil {
+		mappingHostname, err := valueObject.NewFqdn(untrustedInput["mappingHostname"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingHostnamePtr = &mappingHostname
+	}
+
+	var mappingPathPtr *valueObject.MappingPath
+	if untrustedInput["mappingPath"] != nil {
+		mappingPath, err := valueObject.NewMappingPath(untrustedInput["mappingPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingPathPtr = &mappingPath
+	}
+
+	var mappingUpgradeInsecureRequestsPtr *bool
+	if untrustedInput["mappingUpgradeInsecureRequests"] != nil {
+		mappingUpgradeInsecureRequests, err := voHelper.InterfaceToBool(
+			untrustedInput["mappingUpgradeInsecureRequests"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidMappingUpgradeInsecureRequests")
+		}
+		mappingUpgradeInsecureRequestsPtr = &mappingUpgradeInsecureRequests
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	if shouldSchedule {
+		cliCmd := infraEnvs.InfiniteOsBinary + " services create-installable"
+		installParams := []string{
+			"--name", name.String(),
+			"--auto-create-mapping", strconv.FormatBool(autoCreateMapping),
+		}
+
+		if len(envs) > 0 {
+			for _, env := range envs {
+				escapedField := infraHelper.ShellEscape{}.Quote(env.String())
+				installParams = append(installParams, "--envs", escapedField)
+			}
+		}
+
+		if len(portBindings) > 0 {
+			for _, portBinding := range portBindings {
+				escapedField := infraHelper.ShellEscape{}.Quote(portBinding.String())
+				installParams = append(installParams, "--port-bindings", escapedField)
+			}
+		}
+
+		if versionPtr != nil {
+			installParams = append(installParams, "--version", versionPtr.String())
+		}
+
+		if startupFilePtr != nil {
+			installParams = append(installParams, "--startup-file", startupFilePtr.String())
+		}
+
+		if workingDirPtr != nil {
+			installParams = append(installParams, "--working-dir", workingDirPtr.String())
+		}
+
+		if autoStartPtr != nil {
+			autoStartStr := strconv.FormatBool(*autoStartPtr)
+			installParams = append(installParams, "--auto-start", autoStartStr)
+		}
+
+		if timeoutStartSecsPtr != nil {
+			timeoutStartSecsStr := strconv.FormatUint(uint64(*timeoutStartSecsPtr), 10)
+			installParams = append(installParams, "--timeout-start-secs", timeoutStartSecsStr)
+		}
+
+		if autoRestartPtr != nil {
+			autoRestartStr := strconv.FormatBool(*autoRestartPtr)
+			installParams = append(installParams, "--auto-restart", autoRestartStr)
+		}
+
+		if maxStartRetriesPtr != nil {
+			maxStartRetriesStr := strconv.FormatUint(uint64(*maxStartRetriesPtr), 10)
+			installParams = append(installParams, "--max-start-retries", maxStartRetriesStr)
+		}
+
+		if mappingHostnamePtr != nil {
+			installParams = append(installParams, "--mapping-hostname", mappingHostnamePtr.String())
+		}
+
+		if mappingPathPtr != nil {
+			installParams = append(installParams, "--mapping-path", mappingPathPtr.String())
+		}
+
+		if mappingUpgradeInsecureRequestsPtr != nil {
+			installParams = append(
+				installParams,
+				"--mapping-upgrade-insecure-requests",
+				strconv.FormatBool(*mappingUpgradeInsecureRequestsPtr),
+			)
+		}
+
+		cliCmd += " " + strings.Join(installParams, " ")
+
+		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(liaison.persistentDbService)
+		taskName, _ := valueObject.NewScheduledTaskName("CreateInstallableService")
+		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
+		taskTag, _ := valueObject.NewScheduledTaskTag("services")
+		taskTags := []valueObject.ScheduledTaskTag{taskTag}
+		timeoutSecs := uint16(1800)
+
+		scheduledTaskCreateDto := dto.NewCreateScheduledTask(
+			taskName, taskCmd, taskTags, &timeoutSecs, nil,
+		)
+
+		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
+		if err != nil {
+			return NewLiaisonOutput(InfraError, err.Error())
+		}
+
+		return NewLiaisonOutput(Created, "CreateInstallableServiceScheduled")
+	}
+
+	createDto := dto.NewCreateInstallableService(
+		name, envs, portBindings, versionPtr, startupFilePtr, workingDirPtr,
+		autoStartPtr, timeoutStartSecsPtr, autoRestartPtr, maxStartRetriesPtr,
+		&autoCreateMapping, mappingHostnamePtr, mappingPathPtr,
+		mappingUpgradeInsecureRequestsPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbService)
+
+	err = useCase.CreateInstallableService(
+		liaison.servicesQueryRepo, liaison.servicesCmdRepo, vhostQueryRepo,
+		liaison.mappingCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "InstallableServiceCreated")
+}
+
+func (liaison *ServicesLiaison) CreateCustom(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"name", "type", "startCmd"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	name, err := valueObject.NewServiceName(untrustedInput["name"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	svcType, err := valueObject.NewServiceType(untrustedInput["type"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	startCmd, err := valueObject.NewUnixCommand(untrustedInput["startCmd"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var versionPtr *valueObject.ServiceVersion
+	if untrustedInput["version"] != nil {
+		version, err := valueObject.NewServiceVersion(untrustedInput["version"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		versionPtr = &version
+	}
+
+	var execUserPtr *valueObject.UnixUsername
+	if untrustedInput["execUser"] != nil {
+		execUser, err := valueObject.NewUnixUsername(untrustedInput["execUser"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		execUserPtr = &execUser
+	}
+
+	envs := []valueObject.ServiceEnv{}
+	if untrustedInput["envs"] != nil {
+		var assertOk bool
+		envs, assertOk = untrustedInput["envs"].([]valueObject.ServiceEnv)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidServiceEnvs")
+		}
+	}
+
+	portBindings := []valueObject.PortBinding{}
+	if untrustedInput["portBindings"] != nil {
+		var assertOk bool
+		portBindings, assertOk = untrustedInput["portBindings"].([]valueObject.PortBinding)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidPortBindings")
+		}
+	}
+
+	var autoStartPtr *bool
+	if untrustedInput["autoStart"] != nil {
+		autoStart, err := voHelper.InterfaceToBool(untrustedInput["autoStart"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoStartMustBeBool")
+		}
+		autoStartPtr = &autoStart
+	}
+
+	var timeoutStartSecsPtr *uint
+	if untrustedInput["timeoutStartSecs"] != nil {
+		timeoutStartSecs, err := voHelper.InterfaceToUint(untrustedInput["timeoutStartSecs"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "TimeoutStartSecsMustBeUint")
+		}
+		timeoutStartSecsPtr = &timeoutStartSecs
+	}
+
+	var autoRestartPtr *bool
+	if untrustedInput["autoRestart"] != nil {
+		autoRestart, err := voHelper.InterfaceToBool(
+			untrustedInput["autoRestart"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoRestartMustBeBool")
+		}
+		autoRestartPtr = &autoRestart
+	}
+
+	var maxStartRetriesPtr *uint
+	if untrustedInput["maxStartRetries"] != nil {
+		maxStartRetries, err := voHelper.InterfaceToUint(untrustedInput["maxStartRetries"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "MaxStartRetriesMustBeUint")
+		}
+		maxStartRetriesPtr = &maxStartRetries
+	}
+
+	var logOutputPathPtr *valueObject.UnixFilePath
+	if untrustedInput["logOutputPath"] != nil {
+		logOutputPath, err := valueObject.NewUnixFilePath(untrustedInput["logOutputPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		logOutputPathPtr = &logOutputPath
+	}
+
+	var logErrorPathPtr *valueObject.UnixFilePath
+	if untrustedInput["logErrorPath"] != nil {
+		logErrorPath, err := valueObject.NewUnixFilePath(untrustedInput["logErrorPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		logErrorPathPtr = &logErrorPath
+	}
+
+	var avatarUrlPtr *valueObject.Url
+	if untrustedInput["avatarUrl"] != nil {
+		avatarUrl, err := valueObject.NewUrl(untrustedInput["avatarUrl"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		avatarUrlPtr = &avatarUrl
+	}
+
+	autoCreateMapping := true
+	if untrustedInput["autoCreateMapping"] != nil {
+		autoCreateMapping, err = voHelper.InterfaceToBool(untrustedInput["autoCreateMapping"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "AutoCreateMappingMustBeBool")
+		}
+	}
+
+	var mappingHostnamePtr *valueObject.Fqdn
+	if untrustedInput["mappingHostname"] != nil {
+		mappingHostname, err := valueObject.NewFqdn(untrustedInput["mappingHostname"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingHostnamePtr = &mappingHostname
+	}
+
+	var mappingPathPtr *valueObject.MappingPath
+	if untrustedInput["mappingPath"] != nil {
+		mappingPath, err := valueObject.NewMappingPath(untrustedInput["mappingPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingPathPtr = &mappingPath
+	}
+
+	var mappingUpgradeInsecureRequestsPtr *bool
+	if untrustedInput["mappingUpgradeInsecureRequests"] != nil {
+		mappingUpgradeInsecureRequests, err := voHelper.InterfaceToBool(
+			untrustedInput["mappingUpgradeInsecureRequests"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidMappingUpgradeInsecureRequests")
+		}
+		mappingUpgradeInsecureRequestsPtr = &mappingUpgradeInsecureRequests
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createCustomDto := dto.NewCreateCustomService(
+		name, svcType, startCmd, envs, portBindings, nil, nil, nil, nil, nil,
+		versionPtr, execUserPtr, nil, autoStartPtr, autoRestartPtr,
+		timeoutStartSecsPtr, maxStartRetriesPtr, logOutputPathPtr, logErrorPathPtr,
+		avatarUrlPtr, &autoCreateMapping, mappingHostnamePtr, mappingPathPtr,
+		mappingUpgradeInsecureRequestsPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbService)
+
+	err = useCase.CreateCustomService(
+		liaison.servicesQueryRepo, liaison.servicesCmdRepo, vhostQueryRepo,
+		liaison.mappingCmdRepo, liaison.activityRecordCmdRepo, createCustomDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "CustomServiceCreated")
+}
+
+func (liaison *ServicesLiaison) Update(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"name"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	name, err := valueObject.NewServiceName(untrustedInput["name"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var typePtr *valueObject.ServiceType
+	if untrustedInput["type"] != nil {
+		svcType, err := valueObject.NewServiceType(untrustedInput["type"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		typePtr = &svcType
+	}
+
+	var startCmdPtr *valueObject.UnixCommand
+	if untrustedInput["startCmd"] != nil {
+		startCmd, err := valueObject.NewUnixCommand(untrustedInput["startCmd"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		startCmdPtr = &startCmd
+	}
+
+	var statusPtr *valueObject.ServiceStatus
+	if untrustedInput["status"] != nil {
+		status, err := valueObject.NewServiceStatus(untrustedInput["status"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		statusPtr = &status
+	}
+
+	var versionPtr *valueObject.ServiceVersion
+	if untrustedInput["version"] != nil {
+		version, err := valueObject.NewServiceVersion(untrustedInput["version"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		versionPtr = &version
+	}
+
+	envs := []valueObject.ServiceEnv{}
+	if untrustedInput["envs"] != nil {
+		rawEnvs, assertOk := untrustedInput["envs"].([]string)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "EnvsMustBeStringArray")
+		}
+
+		for _, rawEnv := range rawEnvs {
+			env, err := valueObject.NewServiceEnv(rawEnv)
+			if err != nil {
+				slog.Debug(err.Error(), slog.String("env", rawEnv))
+				continue
+			}
+			envs = append(envs, env)
+		}
+	}
+
+	portBindings := []valueObject.PortBinding{}
+	if _, exists := untrustedInput["portBindings"]; exists {
+		rawPortBindings, assertOk := untrustedInput["portBindings"].([]string)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "PortBindingsMustBeStringArray")
+		}
+
+		for _, rawPortBinding := range rawPortBindings {
+			if len(rawPortBinding) == 0 {
+				continue
+			}
+
+			portBinding, err := valueObject.NewPortBinding(rawPortBinding)
+			if err != nil {
+				slog.Debug(err.Error(), slog.String("portBinding", rawPortBinding))
+				continue
+			}
+			portBindings = append(portBindings, portBinding)
+		}
+	}
+
+	var startupFilePtr *valueObject.UnixFilePath
+	if untrustedInput["startupFile"] != nil {
+		startupFile, err := valueObject.NewUnixFilePath(untrustedInput["startupFile"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		startupFilePtr = &startupFile
+	}
+
+	var autoStartPtr *bool
+	if untrustedInput["autoStart"] != nil {
+		autoStart, err := voHelper.InterfaceToBool(untrustedInput["autoStart"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		autoStartPtr = &autoStart
+	}
+
+	var autoRestartPtr *bool
+	if untrustedInput["autoRestart"] != nil {
+		autoRestart, err := voHelper.InterfaceToBool(untrustedInput["autoRestart"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		autoRestartPtr = &autoRestart
+	}
+
+	var timeoutStartSecsPtr *uint
+	if untrustedInput["timeoutStartSecs"] != nil {
+		timeoutStartSecs, err := voHelper.InterfaceToUint(untrustedInput["timeoutStartSecs"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		timeoutStartSecsPtr = &timeoutStartSecs
+	}
+
+	var maxStartRetriesPtr *uint
+	if untrustedInput["maxStartRetries"] != nil {
+		maxStartRetries, err := voHelper.InterfaceToUint(untrustedInput["maxStartRetries"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		maxStartRetriesPtr = &maxStartRetries
+	}
+
+	var logOutputPathPtr *valueObject.UnixFilePath
+	if untrustedInput["logOutputPath"] != nil {
+		logOutputPath, err := valueObject.NewUnixFilePath(untrustedInput["logOutputPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		logOutputPathPtr = &logOutputPath
+	}
+
+	var logErrorPathPtr *valueObject.UnixFilePath
+	if untrustedInput["logErrorPath"] != nil {
+		logErrorPath, err := valueObject.NewUnixFilePath(untrustedInput["logErrorPath"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		logErrorPathPtr = &logErrorPath
+	}
+
+	var avatarUrlPtr *valueObject.Url
+	if untrustedInput["avatarUrl"] != nil {
+		avatarUrl, err := valueObject.NewUrl(untrustedInput["avatarUrl"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		avatarUrlPtr = &avatarUrl
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateService(
+		name, typePtr, versionPtr, statusPtr, startCmdPtr, envs, portBindings, nil,
+		nil, nil, nil, nil, nil, nil, startupFilePtr, autoStartPtr, autoRestartPtr,
+		timeoutStartSecsPtr, maxStartRetriesPtr, logOutputPathPtr, logErrorPathPtr,
+		avatarUrlPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.UpdateService(
+		liaison.servicesQueryRepo, liaison.servicesCmdRepo, liaison.mappingQueryRepo,
+		liaison.mappingCmdRepo, liaison.activityRecordCmdRepo, updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "ServiceUpdated")
+}
+
+func (liaison *ServicesLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"name"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	name, err := valueObject.NewServiceName(untrustedInput["name"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteService(name, operatorAccountId, operatorIpAddress)
+
+	err = useCase.DeleteService(
+		liaison.servicesQueryRepo, liaison.servicesCmdRepo, liaison.mappingQueryRepo,
+		liaison.mappingCmdRepo, liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "ServiceDeleted")
+}

+ 313 - 0
src/presentation/liaison/ssl.go

@@ -0,0 +1,313 @@
+package liaison
+
+import (
+	"errors"
+	"strings"
+
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/entity"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	infraEnvs "github.com/goinfinite/os/src/infra/envs"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
+	sslInfra "github.com/goinfinite/os/src/infra/ssl"
+	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+)
+
+type SslLiaison struct {
+	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
+	sslQueryRepo          *sslInfra.SslQueryRepo
+	sslCmdRepo            *sslInfra.SslCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewSslLiaison(
+	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
+	transientDbSvc *internalDbInfra.TransientDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *SslLiaison {
+	return &SslLiaison{
+		persistentDbSvc:       persistentDbSvc,
+		sslQueryRepo:          sslInfra.NewSslQueryRepo(),
+		sslCmdRepo:            sslInfra.NewSslCmdRepo(persistentDbSvc, transientDbSvc),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *SslLiaison) SslPairReadRequestFactory(
+	untrustedInput map[string]any,
+	withMappings bool,
+) (readRequestDto dto.ReadSslPairsRequest, err error) {
+	if untrustedInput["sslPairId"] == nil && untrustedInput["id"] != nil {
+		untrustedInput["sslPairId"] = untrustedInput["id"]
+	}
+
+	var sslPairIdPtr *valueObject.SslPairId
+	if untrustedInput["sslPairId"] != nil {
+		sslPairId, err := valueObject.NewSslPairId(untrustedInput["sslPairId"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		sslPairIdPtr = &sslPairId
+	}
+
+	if untrustedInput["virtualHostHostname"] == nil && untrustedInput["hostname"] != nil {
+		untrustedInput["virtualHostHostname"] = untrustedInput["hostname"]
+	}
+
+	var vhostHostnamePtr *valueObject.Fqdn
+	if untrustedInput["virtualHostHostname"] != nil {
+		vhostHostname, err := valueObject.NewFqdn(untrustedInput["virtualHostHostname"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		vhostHostnamePtr = &vhostHostname
+	}
+
+	altNames := []valueObject.SslHostname{}
+	if untrustedInput["altNames"] != nil {
+		var assertOk bool
+		altNames, assertOk = untrustedInput["altNames"].([]valueObject.SslHostname)
+		if !assertOk {
+			return readRequestDto, errors.New("InvalidAltNamesStructure")
+		}
+	}
+
+	timeParamNames := []string{
+		"issuedBeforeAt", "issuedAfterAt", "expiresBeforeAt", "expiresAfterAt",
+	}
+	timeParamPtrs := liaisonHelper.TimeParamsParser(timeParamNames, untrustedInput)
+
+	requestPagination, err := liaisonHelper.PaginationParser(
+		untrustedInput, useCase.SslPairsDefaultPagination,
+	)
+	if err != nil {
+		return readRequestDto, err
+	}
+
+	return dto.ReadSslPairsRequest{
+		Pagination:          requestPagination,
+		SslPairId:           sslPairIdPtr,
+		VirtualHostHostname: vhostHostnamePtr,
+		AltNames:            altNames,
+		IssuedBeforeAt:      timeParamPtrs["issuedBeforeAt"],
+		IssuedAfterAt:       timeParamPtrs["issuedAfterAt"],
+		ExpiresBeforeAt:     timeParamPtrs["expiresBeforeAt"],
+		ExpiresAfterAt:      timeParamPtrs["expiresAfterAt"],
+	}, nil
+}
+
+func (liaison *SslLiaison) Read(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	readRequestDto, err := liaison.SslPairReadRequestFactory(untrustedInput, false)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	readResponseDto, err := useCase.ReadSslPairs(liaison.sslQueryRepo, readRequestDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, readResponseDto)
+}
+
+func (liaison *SslLiaison) Create(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"virtualHostsHostnames", "certificate", "key"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	vhostHostnames, assertOk := untrustedInput["virtualHostsHostnames"].([]valueObject.Fqdn)
+	if !assertOk {
+		return NewLiaisonOutput(UserError, errors.New("InvalidVirtualHostsStructure"))
+	}
+
+	certContent, err := valueObject.NewSslCertificateContent(untrustedInput["certificate"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+	certEntity, err := entity.NewSslCertificate(certContent)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var chainCertsPtr *entity.SslCertificate
+	if untrustedInput["chainCertificates"] != nil {
+		chainCertContent, err := valueObject.NewSslCertificateContent(untrustedInput["chainCertificates"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("SslCertificateChainContentError"))
+		}
+		chainCertEntity, err := entity.NewSslCertificate(chainCertContent)
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("SslCertificateChainParseError"))
+		}
+		chainCertsPtr = &chainCertEntity
+	}
+
+	privateKeyContent, err := valueObject.NewSslPrivateKey(untrustedInput["key"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateSslPair(
+		vhostHostnames, certEntity, chainCertsPtr, privateKeyContent,
+		operatorAccountId, operatorIpAddress,
+	)
+
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbSvc)
+
+	err = useCase.CreateSslPair(
+		vhostQueryRepo, liaison.sslCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "SslPairCreated")
+}
+
+func (liaison *SslLiaison) CreatePubliclyTrusted(
+	untrustedInput map[string]any,
+	shouldSchedule bool,
+) LiaisonOutput {
+	if untrustedInput["hostname"] != nil && untrustedInput["virtualHostHostname"] == nil {
+		untrustedInput["virtualHostHostname"] = untrustedInput["hostname"]
+	}
+
+	if untrustedInput["vhostHostname"] != nil && untrustedInput["virtualHostHostname"] == nil {
+		untrustedInput["virtualHostHostname"] = untrustedInput["vhostHostname"]
+	}
+
+	requiredParams := []string{"virtualHostHostname"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	vhostHostname, err := valueObject.NewFqdn(untrustedInput["virtualHostHostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	if shouldSchedule {
+		cliCmd := infraEnvs.InfiniteOsBinary + " ssl create-trusted"
+		installParams := []string{
+			"--hostname", vhostHostname.String(),
+		}
+		cliCmd += " " + strings.Join(installParams, " ")
+
+		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(liaison.persistentDbSvc)
+		taskName, _ := valueObject.NewScheduledTaskName("CreatePubliclyTrustedSslPair")
+		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
+		taskTag, _ := valueObject.NewScheduledTaskTag("ssl")
+		taskTags := []valueObject.ScheduledTaskTag{taskTag}
+		timeoutSecs := uint16(1800)
+
+		scheduledTaskCreateDto := dto.NewCreateScheduledTask(
+			taskName, taskCmd, taskTags, &timeoutSecs, nil,
+		)
+
+		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
+		if err != nil {
+			return NewLiaisonOutput(InfraError, err.Error())
+		}
+
+		return NewLiaisonOutput(Created, "PubliclyTrustedSslPairCreationScheduled")
+	}
+
+	createDto := dto.NewCreatePubliclyTrustedSslPair(
+		vhostHostname, operatorAccountId, operatorIpAddress,
+	)
+
+	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(liaison.persistentDbSvc)
+
+	_, err = useCase.CreatePubliclyTrustedSslPair(
+		vhostQueryRepo, liaison.sslCmdRepo, liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "PubliclyTrustedSslPairCreated")
+}
+
+func (liaison *SslLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	if untrustedInput["id"] == nil && untrustedInput["sslPairId"] != nil {
+		untrustedInput["id"] = untrustedInput["sslPairId"]
+	}
+
+	requiredParams := []string{"id"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	pairId, err := valueObject.NewSslPairId(untrustedInput["id"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	err = useCase.DeleteSslPair(
+		liaison.sslQueryRepo, liaison.sslCmdRepo, liaison.activityRecordCmdRepo,
+		dto.NewDeleteSslPair(pairId, operatorAccountId, operatorIpAddress),
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "SslPairDeleted")
+}

+ 994 - 0
src/presentation/liaison/virtualHost.go

@@ -0,0 +1,994 @@
+package liaison
+
+import (
+	"errors"
+
+	"github.com/goinfinite/os/src/domain/dto"
+	"github.com/goinfinite/os/src/domain/useCase"
+	"github.com/goinfinite/os/src/domain/valueObject"
+	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
+	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
+	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
+	servicesInfra "github.com/goinfinite/os/src/infra/services"
+	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
+	liaisonHelper "github.com/goinfinite/os/src/presentation/liaison/helper"
+
+	tkValueObject "github.com/goinfinite/tk/src/domain/valueObject"
+	tkVoUtil "github.com/goinfinite/tk/src/domain/valueObject/util"
+)
+
+type VirtualHostLiaison struct {
+	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
+	trailDbSvc            *internalDbInfra.TrailDatabaseService
+	vhostQueryRepo        *vhostInfra.VirtualHostQueryRepo
+	vhostCmdRepo          *vhostInfra.VirtualHostCmdRepo
+	mappingQueryRepo      *vhostInfra.MappingQueryRepo
+	mappingCmdRepo        *vhostInfra.MappingCmdRepo
+	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
+}
+
+func NewVirtualHostLiaison(
+	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
+	trailDbSvc *internalDbInfra.TrailDatabaseService,
+) *VirtualHostLiaison {
+	return &VirtualHostLiaison{
+		persistentDbSvc:       persistentDbSvc,
+		trailDbSvc:            trailDbSvc,
+		vhostQueryRepo:        vhostInfra.NewVirtualHostQueryRepo(persistentDbSvc),
+		vhostCmdRepo:          vhostInfra.NewVirtualHostCmdRepo(persistentDbSvc),
+		mappingQueryRepo:      vhostInfra.NewMappingQueryRepo(persistentDbSvc),
+		mappingCmdRepo:        vhostInfra.NewMappingCmdRepo(persistentDbSvc),
+		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
+	}
+}
+
+func (liaison *VirtualHostLiaison) VirtualHostReadRequestFactory(
+	untrustedInput map[string]any,
+	withMappings bool,
+) (readRequestDto dto.ReadVirtualHostsRequest, err error) {
+	var hostnamePtr *valueObject.Fqdn
+	if untrustedInput["hostname"] != nil {
+		hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		hostnamePtr = &hostname
+	}
+
+	var typePtr *valueObject.VirtualHostType
+	if untrustedInput["type"] != nil {
+		vhostType, err := valueObject.NewVirtualHostType(untrustedInput["type"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		typePtr = &vhostType
+	}
+
+	var rootDirectoryPtr *valueObject.UnixFilePath
+	if untrustedInput["rootDirectory"] != nil {
+		rootDirectory, err := valueObject.NewUnixFilePath(untrustedInput["rootDirectory"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		rootDirectoryPtr = &rootDirectory
+	}
+
+	var parentHostnamePtr *valueObject.Fqdn
+	if untrustedInput["parentHostname"] != nil {
+		parentHostname, err := valueObject.NewFqdn(untrustedInput["parentHostname"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		parentHostnamePtr = &parentHostname
+	}
+
+	if untrustedInput["withMappings"] != nil {
+		withMappings, err = voHelper.InterfaceToBool(untrustedInput["withMappings"])
+		if err != nil {
+			return readRequestDto, err
+		}
+	}
+
+	timeParamNames := []string{"createdBeforeAt", "createdAfterAt"}
+	timeParamPtrs := liaisonHelper.TimeParamsParser(timeParamNames, untrustedInput)
+
+	requestPagination, err := liaisonHelper.PaginationParser(
+		untrustedInput, useCase.VirtualHostsDefaultPagination,
+	)
+	if err != nil {
+		return readRequestDto, err
+	}
+
+	return dto.ReadVirtualHostsRequest{
+		Pagination:      requestPagination,
+		Hostname:        hostnamePtr,
+		VirtualHostType: typePtr,
+		RootDirectory:   rootDirectoryPtr,
+		ParentHostname:  parentHostnamePtr,
+		WithMappings:    &withMappings,
+		CreatedBeforeAt: timeParamPtrs["createdBeforeAt"],
+		CreatedAfterAt:  timeParamPtrs["createdAfterAt"],
+	}, nil
+}
+
+func (liaison *VirtualHostLiaison) Read(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	readRequestDto, err := liaison.VirtualHostReadRequestFactory(untrustedInput, false)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	readResponseDto, err := useCase.ReadVirtualHosts(liaison.vhostQueryRepo, readRequestDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, readResponseDto)
+}
+
+func (liaison *VirtualHostLiaison) Create(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"hostname"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	vhostType := valueObject.VirtualHostTypeTopLevel
+	if untrustedInput["type"] != nil {
+		vhostType, err = valueObject.NewVirtualHostType(untrustedInput["type"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	isWildcard := false
+	if untrustedInput["isWildcard"] != nil {
+		isWildcard, err = voHelper.InterfaceToBool(untrustedInput["isWildcard"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	var parentHostnamePtr *valueObject.Fqdn
+	if untrustedInput["parentHostname"] != nil {
+		parentHostname, err := valueObject.NewFqdn(untrustedInput["parentHostname"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		parentHostnamePtr = &parentHostname
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateVirtualHost(
+		hostname, vhostType, &isWildcard, parentHostnamePtr,
+		operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.CreateVirtualHost(
+		liaison.vhostQueryRepo, liaison.vhostCmdRepo, liaison.activityRecordCmdRepo,
+		createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "VirtualHostCreated")
+}
+
+func (liaison *VirtualHostLiaison) Update(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"hostname"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var isWildcardPtr *bool
+	if untrustedInput["isWildcard"] != nil {
+		isWildcard, err := voHelper.InterfaceToBool(untrustedInput["isWildcard"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidIsWildcard"))
+		}
+		isWildcardPtr = &isWildcard
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateVirtualHost(
+		hostname, isWildcardPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.UpdateVirtualHost(
+		liaison.vhostQueryRepo, liaison.vhostCmdRepo, liaison.activityRecordCmdRepo,
+		updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "VirtualHostUpdated")
+}
+
+func (liaison *VirtualHostLiaison) Delete(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"hostname"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteVirtualHost(hostname, operatorAccountId, operatorIpAddress)
+	err = useCase.DeleteVirtualHost(
+		liaison.vhostQueryRepo, liaison.vhostCmdRepo,
+		liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "VirtualHostDeleted")
+}
+
+func (liaison *VirtualHostLiaison) ReadWithMappings(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	readRequestDto, err := liaison.VirtualHostReadRequestFactory(untrustedInput, true)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	readResponseDto, err := useCase.ReadVirtualHosts(liaison.vhostQueryRepo, readRequestDto)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, readResponseDto)
+}
+
+func (liaison *VirtualHostLiaison) CreateMapping(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"hostname", "path", "targetType"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	hostname, err := valueObject.NewFqdn(untrustedInput["hostname"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	path, err := valueObject.NewMappingPath(untrustedInput["path"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	matchPattern := valueObject.MappingMatchPatternBeginsWith
+	if untrustedInput["matchPattern"] != nil {
+		matchPattern, err = valueObject.NewMappingMatchPattern(untrustedInput["matchPattern"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	targetType, err := valueObject.NewMappingTargetType(untrustedInput["targetType"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var targetValuePtr *valueObject.MappingTargetValue
+	if untrustedInput["targetValue"] != nil {
+		targetValue, err := valueObject.NewMappingTargetValue(
+			untrustedInput["targetValue"], targetType,
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		targetValuePtr = &targetValue
+	}
+
+	var targetHttpResponseCodePtr *valueObject.HttpResponseCode
+	if untrustedInput["targetHttpResponseCode"] != nil {
+		if untrustedInput["targetHttpResponseCode"] == "" {
+			untrustedInput["targetHttpResponseCode"] = 301
+		}
+		targetHttpResponseCode, err := valueObject.NewHttpResponseCode(
+			untrustedInput["targetHttpResponseCode"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		targetHttpResponseCodePtr = &targetHttpResponseCode
+	}
+
+	var shouldUpgradeInsecureRequestsPtr *bool
+	if untrustedInput["shouldUpgradeInsecureRequests"] != nil {
+		shouldUpgradeInsecureRequests, err := tkVoUtil.InterfaceToBool(
+			untrustedInput["shouldUpgradeInsecureRequests"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidShouldUpgradeInsecureRequests")
+		}
+		shouldUpgradeInsecureRequestsPtr = &shouldUpgradeInsecureRequests
+	}
+
+	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
+	if untrustedInput["mappingSecurityRuleId"] != nil && untrustedInput["mappingSecurityRuleId"] != "" {
+		mappingSecurityRuleId, err := valueObject.NewMappingSecurityRuleId(
+			untrustedInput["mappingSecurityRuleId"],
+		)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingSecurityRuleIdPtr = &mappingSecurityRuleId
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateMapping(
+		hostname, path, matchPattern, targetType, targetValuePtr,
+		targetHttpResponseCodePtr, shouldUpgradeInsecureRequestsPtr,
+		mappingSecurityRuleIdPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	servicesQueryRepo := servicesInfra.NewServicesQueryRepo(liaison.persistentDbSvc)
+
+	err = useCase.CreateMapping(
+		liaison.vhostQueryRepo, liaison.mappingCmdRepo, servicesQueryRepo,
+		liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "MappingCreated")
+}
+
+func (liaison *VirtualHostLiaison) DeleteMapping(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	if untrustedInput["mappingId"] == nil && untrustedInput["id"] != nil {
+		untrustedInput["mappingId"] = untrustedInput["id"]
+	}
+
+	requiredParams := []string{"mappingId"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	id, err := valueObject.NewMappingId(untrustedInput["mappingId"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteMapping(id, operatorAccountId, operatorIpAddress)
+	err = useCase.DeleteMapping(
+		liaison.mappingQueryRepo, liaison.mappingCmdRepo,
+		liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, "MappingDeleted")
+}
+
+func (liaison *VirtualHostLiaison) UpdateMapping(untrustedInput map[string]any) LiaisonOutput {
+	requiredParams := []string{"id"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	id, err := valueObject.NewMappingId(untrustedInput["id"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var pathPtr *valueObject.MappingPath
+	if untrustedInput["path"] != nil {
+		path, err := valueObject.NewMappingPath(untrustedInput["path"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		pathPtr = &path
+	}
+
+	var matchPatternPtr *valueObject.MappingMatchPattern
+	if untrustedInput["matchPattern"] != nil {
+		matchPattern, err := valueObject.NewMappingMatchPattern(untrustedInput["matchPattern"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		matchPatternPtr = &matchPattern
+	}
+
+	var targetTypePtr *valueObject.MappingTargetType
+	if untrustedInput["targetType"] != nil {
+		targetType, err := valueObject.NewMappingTargetType(untrustedInput["targetType"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		targetTypePtr = &targetType
+	}
+
+	var targetValuePtr *valueObject.MappingTargetValue
+	if untrustedInput["targetValue"] != nil {
+		if targetTypePtr == nil {
+			mappingEntity, err := liaison.mappingQueryRepo.ReadFirst(
+				dto.ReadMappingsRequest{MappingId: &id},
+			)
+			if err != nil {
+				return NewLiaisonOutput(InfraError, "ReadMappingEntityToRetrieveTargetTypeError")
+			}
+			targetTypePtr = &mappingEntity.TargetType
+		}
+
+		targetValue, err := valueObject.NewMappingTargetValue(untrustedInput["targetValue"], *targetTypePtr)
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		targetValuePtr = &targetValue
+	}
+
+	var targetHttpResponseCodePtr *valueObject.HttpResponseCode
+	if untrustedInput["targetHttpResponseCode"] != nil {
+		targetHttpResponseCode, err := valueObject.NewHttpResponseCode(untrustedInput["targetHttpResponseCode"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		targetHttpResponseCodePtr = &targetHttpResponseCode
+	}
+
+	var shouldUpgradeInsecureRequestsPtr *bool
+	if untrustedInput["shouldUpgradeInsecureRequests"] != nil {
+		shouldUpgradeInsecureRequests, err := tkVoUtil.InterfaceToBool(untrustedInput["shouldUpgradeInsecureRequests"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, errors.New("InvalidShouldUpgradeInsecureRequests"))
+		}
+		shouldUpgradeInsecureRequestsPtr = &shouldUpgradeInsecureRequests
+	}
+
+	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
+	if untrustedInput["mappingSecurityRuleId"] != nil && untrustedInput["mappingSecurityRuleId"] != "" {
+		mappingSecurityRuleId, err := valueObject.NewMappingSecurityRuleId(untrustedInput["mappingSecurityRuleId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		mappingSecurityRuleIdPtr = &mappingSecurityRuleId
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateMapping(
+		id, pathPtr, matchPatternPtr, targetTypePtr, targetValuePtr,
+		targetHttpResponseCodePtr, shouldUpgradeInsecureRequestsPtr,
+		mappingSecurityRuleIdPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.UpdateMapping(
+		liaison.mappingQueryRepo, liaison.mappingCmdRepo,
+		liaison.activityRecordCmdRepo, updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "MappingUpdated")
+}
+
+func (liaison *VirtualHostLiaison) MappingSecurityRuleReadRequestFactory(
+	untrustedInput map[string]any,
+) (readRequestDto dto.ReadMappingSecurityRulesRequest, err error) {
+	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
+	if untrustedInput["id"] != nil {
+		id, err := valueObject.NewMappingSecurityRuleId(untrustedInput["id"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		mappingSecurityRuleIdPtr = &id
+	}
+
+	var mappingSecurityRuleNamePtr *valueObject.MappingSecurityRuleName
+	if untrustedInput["name"] != nil {
+		name, err := valueObject.NewMappingSecurityRuleName(untrustedInput["name"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		mappingSecurityRuleNamePtr = &name
+	}
+
+	var allowedIpPtr *tkValueObject.CidrBlock
+	if untrustedInput["allowedIp"] != nil {
+		allowedIp, err := tkValueObject.NewCidrBlock(untrustedInput["allowedIp"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		allowedIpPtr = &allowedIp
+	}
+
+	var blockedIpPtr *tkValueObject.CidrBlock
+	if untrustedInput["blockedIp"] != nil {
+		blockedIp, err := tkValueObject.NewCidrBlock(untrustedInput["blockedIp"])
+		if err != nil {
+			return readRequestDto, err
+		}
+		blockedIpPtr = &blockedIp
+	}
+
+	timeParamNames := []string{"createdBeforeAt", "createdAfterAt"}
+	timeParamPtrs := liaisonHelper.TimeParamsParser(timeParamNames, untrustedInput)
+
+	requestPagination, err := liaisonHelper.PaginationParser(
+		untrustedInput, useCase.MappingSecurityRulesDefaultPagination,
+	)
+	if err != nil {
+		return readRequestDto, err
+	}
+
+	return dto.ReadMappingSecurityRulesRequest{
+		Pagination:              requestPagination,
+		MappingSecurityRuleId:   mappingSecurityRuleIdPtr,
+		MappingSecurityRuleName: mappingSecurityRuleNamePtr,
+		AllowedIp:               allowedIpPtr,
+		BlockedIp:               blockedIpPtr,
+		CreatedBeforeAt:         timeParamPtrs["createdBeforeAt"],
+		CreatedAfterAt:          timeParamPtrs["createdAfterAt"],
+	}, nil
+}
+
+func (liaison *VirtualHostLiaison) ReadMappingSecurityRules(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	readRequestDto, err := liaison.MappingSecurityRuleReadRequestFactory(untrustedInput)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	readResponseDto, err := useCase.ReadMappingSecurityRules(
+		liaison.mappingQueryRepo, readRequestDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, readResponseDto)
+}
+
+func (liaison *VirtualHostLiaison) CreateMappingSecurityRule(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"name"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	name, err := valueObject.NewMappingSecurityRuleName(untrustedInput["name"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var descriptionPtr *valueObject.MappingSecurityRuleDescription
+	if untrustedInput["description"] != nil {
+		description, err := valueObject.NewMappingSecurityRuleDescription(untrustedInput["description"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		descriptionPtr = &description
+	}
+
+	allowedIps := []tkValueObject.CidrBlock{}
+	if untrustedInput["allowedIps"] != nil {
+		allowedIpsInput, assertOk := untrustedInput["allowedIps"].([]tkValueObject.CidrBlock)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidAllowedIps")
+		}
+		allowedIps = allowedIpsInput
+	}
+
+	blockedIps := []tkValueObject.CidrBlock{}
+	if untrustedInput["blockedIps"] != nil {
+		blockedIpsInput, assertOk := untrustedInput["blockedIps"].([]tkValueObject.CidrBlock)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidBlockedIps")
+		}
+		blockedIps = blockedIpsInput
+	}
+
+	var rpsSoftLimitPerIpPtr *uint
+	if untrustedInput["rpsSoftLimitPerIp"] != nil && untrustedInput["rpsSoftLimitPerIp"] != "" {
+		softLimit, err := tkVoUtil.InterfaceToUint(untrustedInput["rpsSoftLimitPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidRpsSoftLimitPerIp")
+		}
+		rpsSoftLimitPerIpPtr = &softLimit
+	}
+
+	var rpsHardLimitPerIpPtr *uint
+	if untrustedInput["rpsHardLimitPerIp"] != nil && untrustedInput["rpsHardLimitPerIp"] != "" {
+		hardLimit, err := tkVoUtil.InterfaceToUint(untrustedInput["rpsHardLimitPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidRpsHardLimitPerIp")
+		}
+		rpsHardLimitPerIpPtr = &hardLimit
+	}
+
+	var responseCodeOnMaxRequestsPtr *uint
+	if untrustedInput["responseCodeOnMaxRequests"] != nil && untrustedInput["responseCodeOnMaxRequests"] != "" {
+		responseCode, err := tkVoUtil.InterfaceToUint(untrustedInput["responseCodeOnMaxRequests"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidResponseCodeOnMaxRequests")
+		}
+		responseCodeOnMaxRequestsPtr = &responseCode
+	}
+
+	var maxConnectionsPerIpPtr *uint
+	if untrustedInput["maxConnectionsPerIp"] != nil && untrustedInput["maxConnectionsPerIp"] != "" {
+		maxConns, err := tkVoUtil.InterfaceToUint(untrustedInput["maxConnectionsPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidMaxConnectionsPerIp")
+		}
+		maxConnectionsPerIpPtr = &maxConns
+	}
+
+	var bandwidthBpsLimitPerConnectionPtr *valueObject.Byte
+	if untrustedInput["bandwidthBpsLimitPerConnection"] != nil && untrustedInput["bandwidthBpsLimitPerConnection"] != "" {
+		bandwidthBpsLimit, err := valueObject.NewByte(untrustedInput["bandwidthBpsLimitPerConnection"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidBandwidthBpsLimitPerConnection")
+		}
+		bandwidthBpsLimitPerConnectionPtr = &bandwidthBpsLimit
+	}
+
+	var bandwidthLimitOnlyAfterBytesPtr *valueObject.Byte
+	if untrustedInput["bandwidthLimitOnlyAfterBytes"] != nil && untrustedInput["bandwidthLimitOnlyAfterBytes"] != "" {
+		bandwidthLimitOnlyAfterBytes, err := valueObject.NewByte(untrustedInput["bandwidthLimitOnlyAfterBytes"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidBandwidthLimitOnlyAfterBytes")
+		}
+		bandwidthLimitOnlyAfterBytesPtr = &bandwidthLimitOnlyAfterBytes
+	}
+
+	var responseCodeOnMaxConnectionsPtr *uint
+	if untrustedInput["responseCodeOnMaxConnections"] != nil && untrustedInput["responseCodeOnMaxConnections"] != "" {
+		responseCode, err := tkVoUtil.InterfaceToUint(untrustedInput["responseCodeOnMaxConnections"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidResponseCodeOnMaxConnections")
+		}
+		responseCodeOnMaxConnectionsPtr = &responseCode
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	createDto := dto.NewCreateMappingSecurityRule(
+		name, descriptionPtr, allowedIps, blockedIps, rpsSoftLimitPerIpPtr,
+		rpsHardLimitPerIpPtr, responseCodeOnMaxRequestsPtr, maxConnectionsPerIpPtr,
+		bandwidthBpsLimitPerConnectionPtr, bandwidthLimitOnlyAfterBytesPtr,
+		responseCodeOnMaxConnectionsPtr, operatorAccountId, operatorIpAddress,
+	)
+
+	mappingSecurityRuleId, err := useCase.CreateMappingSecurityRule(
+		liaison.mappingQueryRepo, liaison.mappingCmdRepo,
+		liaison.activityRecordCmdRepo, createDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Created, map[string]interface{}{
+		"id": mappingSecurityRuleId.Uint64(),
+	})
+}
+
+func (liaison *VirtualHostLiaison) UpdateMappingSecurityRule(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"id"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	id, err := valueObject.NewMappingSecurityRuleId(untrustedInput["id"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	var namePtr *valueObject.MappingSecurityRuleName
+	if untrustedInput["name"] != nil {
+		name, err := valueObject.NewMappingSecurityRuleName(untrustedInput["name"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		namePtr = &name
+	}
+
+	var descriptionPtr *valueObject.MappingSecurityRuleDescription
+	if untrustedInput["description"] != nil {
+		description, err := valueObject.NewMappingSecurityRuleDescription(untrustedInput["description"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+		descriptionPtr = &description
+	}
+
+	allowedIps := []tkValueObject.CidrBlock{}
+	if untrustedInput["allowedIps"] != nil {
+		var assertOk bool
+		allowedIps, assertOk = untrustedInput["allowedIps"].([]tkValueObject.CidrBlock)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidAllowedIps")
+		}
+	}
+
+	blockedIps := []tkValueObject.CidrBlock{}
+	if untrustedInput["blockedIps"] != nil {
+		var assertOk bool
+		blockedIps, assertOk = untrustedInput["blockedIps"].([]tkValueObject.CidrBlock)
+		if !assertOk {
+			return NewLiaisonOutput(UserError, "InvalidBlockedIps")
+		}
+	}
+
+	var rpsSoftLimitPerIpPtr *uint
+	if untrustedInput["rpsSoftLimitPerIp"] != nil && untrustedInput["rpsSoftLimitPerIp"] != "" {
+		softLimit, err := tkVoUtil.InterfaceToUint(untrustedInput["rpsSoftLimitPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidRpsSoftLimitPerIp")
+		}
+		rpsSoftLimitPerIpPtr = &softLimit
+	}
+
+	var rpsHardLimitPerIpPtr *uint
+	if untrustedInput["rpsHardLimitPerIp"] != nil && untrustedInput["rpsHardLimitPerIp"] != "" {
+		hardLimit, err := tkVoUtil.InterfaceToUint(untrustedInput["rpsHardLimitPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidRpsHardLimitPerIp")
+		}
+		rpsHardLimitPerIpPtr = &hardLimit
+	}
+
+	var responseCodeOnMaxRequestsPtr *uint
+	if untrustedInput["responseCodeOnMaxRequests"] != nil && untrustedInput["responseCodeOnMaxRequests"] != "" {
+		responseCode, err := tkVoUtil.InterfaceToUint(untrustedInput["responseCodeOnMaxRequests"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidResponseCodeOnMaxRequests")
+		}
+		responseCodeOnMaxRequestsPtr = &responseCode
+	}
+
+	var maxConnectionsPerIpPtr *uint
+	if untrustedInput["maxConnectionsPerIp"] != nil && untrustedInput["maxConnectionsPerIp"] != "" {
+		maxConns, err := tkVoUtil.InterfaceToUint(untrustedInput["maxConnectionsPerIp"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidMaxConnectionsPerIp")
+		}
+		maxConnectionsPerIpPtr = &maxConns
+	}
+
+	var bandwidthBpsLimitPerConnectionPtr *valueObject.Byte
+	if untrustedInput["bandwidthBpsLimitPerConnection"] != nil && untrustedInput["bandwidthBpsLimitPerConnection"] != "" {
+		bandwidthBpsLimit, err := valueObject.NewByte(untrustedInput["bandwidthBpsLimitPerConnection"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidBandwidthBpsLimitPerConnection")
+		}
+		bandwidthBpsLimitPerConnectionPtr = &bandwidthBpsLimit
+	}
+
+	var bandwidthLimitOnlyAfterBytesPtr *valueObject.Byte
+	if untrustedInput["bandwidthLimitOnlyAfterBytes"] != nil && untrustedInput["bandwidthLimitOnlyAfterBytes"] != "" {
+		bandwidthLimitOnlyAfterBytes, err := valueObject.NewByte(untrustedInput["bandwidthLimitOnlyAfterBytes"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidBandwidthLimitOnlyAfterBytes")
+		}
+		bandwidthLimitOnlyAfterBytesPtr = &bandwidthLimitOnlyAfterBytes
+	}
+
+	var responseCodeOnMaxConnectionsPtr *uint
+	if untrustedInput["responseCodeOnMaxConnections"] != nil && untrustedInput["responseCodeOnMaxConnections"] != "" {
+		responseCode, err := tkVoUtil.InterfaceToUint(untrustedInput["responseCodeOnMaxConnections"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, "InvalidResponseCodeOnMaxConnections")
+		}
+		responseCodeOnMaxConnectionsPtr = &responseCode
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	updateDto := dto.NewUpdateMappingSecurityRule(
+		id, namePtr, descriptionPtr, allowedIps, blockedIps,
+		rpsSoftLimitPerIpPtr, rpsHardLimitPerIpPtr, responseCodeOnMaxRequestsPtr,
+		maxConnectionsPerIpPtr, bandwidthBpsLimitPerConnectionPtr,
+		bandwidthLimitOnlyAfterBytesPtr, responseCodeOnMaxConnectionsPtr,
+		operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.UpdateMappingSecurityRule(
+		liaison.mappingQueryRepo, liaison.mappingCmdRepo,
+		liaison.activityRecordCmdRepo, updateDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "MappingSecurityRuleUpdated")
+}
+
+func (liaison *VirtualHostLiaison) DeleteMappingSecurityRule(
+	untrustedInput map[string]any,
+) LiaisonOutput {
+	requiredParams := []string{"id"}
+	err := liaisonHelper.RequiredParamsInspector(untrustedInput, requiredParams)
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	ruleId, err := valueObject.NewMappingSecurityRuleId(untrustedInput["id"])
+	if err != nil {
+		return NewLiaisonOutput(UserError, err.Error())
+	}
+
+	operatorAccountId := LocalOperatorAccountId
+	if untrustedInput["operatorAccountId"] != nil {
+		operatorAccountId, err = valueObject.NewAccountId(untrustedInput["operatorAccountId"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	operatorIpAddress := LocalOperatorIpAddress
+	if untrustedInput["operatorIpAddress"] != nil {
+		operatorIpAddress, err = valueObject.NewIpAddress(untrustedInput["operatorIpAddress"])
+		if err != nil {
+			return NewLiaisonOutput(UserError, err.Error())
+		}
+	}
+
+	deleteDto := dto.NewDeleteMappingSecurityRule(
+		ruleId, operatorAccountId, operatorIpAddress,
+	)
+
+	err = useCase.DeleteMappingSecurityRule(
+		liaison.mappingQueryRepo, liaison.mappingCmdRepo,
+		liaison.activityRecordCmdRepo, deleteDto,
+	)
+	if err != nil {
+		return NewLiaisonOutput(InfraError, err.Error())
+	}
+
+	return NewLiaisonOutput(Success, "MappingSecurityRuleDeleted")
+}

+ 0 - 415
src/presentation/service/account.go

@@ -1,415 +0,0 @@
-package service
-
-import (
-	"errors"
-
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
-	accountInfra "github.com/goinfinite/os/src/infra/account"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-)
-
-var LocalOperatorAccountId, _ = valueObject.NewAccountId(0)
-var LocalOperatorIpAddress = valueObject.IpAddressSystem
-
-type AccountService struct {
-	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
-	accountQueryRepo      *accountInfra.AccountQueryRepo
-	accountCmdRepo        *accountInfra.AccountCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewAccountService(
-	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *AccountService {
-	return &AccountService{
-		persistentDbSvc:       persistentDbSvc,
-		accountQueryRepo:      accountInfra.NewAccountQueryRepo(persistentDbSvc),
-		accountCmdRepo:        accountInfra.NewAccountCmdRepo(persistentDbSvc),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *AccountService) Read(input map[string]interface{}) ServiceOutput {
-	if input["id"] != nil {
-		input["accountId"] = input["id"]
-	}
-
-	var idPtr *valueObject.AccountId
-	if input["id"] != nil {
-		id, err := valueObject.NewAccountId(input["id"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		idPtr = &id
-	}
-
-	var usernamePtr *valueObject.Username
-	if input["name"] != nil {
-		username, err := valueObject.NewUsername(input["username"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		usernamePtr = &username
-	}
-
-	shouldIncludeSecureAccessPublicKeys := false
-	if input["shouldIncludeSecureAccessPublicKeys"] != nil {
-		var err error
-		shouldIncludeSecureAccessPublicKeys, err = voHelper.InterfaceToBool(
-			input["shouldIncludeSecureAccessPublicKeys"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-	}
-
-	paginationDto := useCase.MarketplaceDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
-		}
-		paginationDto.PageNumber = pageNumber
-	}
-
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
-		}
-		paginationDto.ItemsPerPage = itemsPerPage
-	}
-
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortBy = &sortBy
-	}
-
-	if input["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortDirection = &sortDirection
-	}
-
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.LastSeenId = &lastSeenId
-	}
-
-	readRequestDto := dto.ReadAccountsRequest{
-		Pagination:                          paginationDto,
-		AccountId:                           idPtr,
-		AccountUsername:                     usernamePtr,
-		ShouldIncludeSecureAccessPublicKeys: &shouldIncludeSecureAccessPublicKeys,
-	}
-
-	accountsList, err := useCase.ReadAccounts(service.accountQueryRepo, readRequestDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, accountsList)
-}
-
-func (service *AccountService) Create(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"username", "password"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	username, err := valueObject.NewUsername(input["username"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	password, err := valueObject.NewPassword(input["password"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	isSuperAdmin := false
-	if input["isSuperAdmin"] != nil {
-		isSuperAdmin, err = voHelper.InterfaceToBool(input["isSuperAdmin"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateAccount(
-		username, password, isSuperAdmin, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.CreateAccount(
-		service.accountQueryRepo, service.accountCmdRepo,
-		service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "AccountCreated")
-}
-
-func (service *AccountService) Update(input map[string]interface{}) ServiceOutput {
-	if input["id"] != nil {
-		input["accountId"] = input["id"]
-	}
-
-	requiredParams := []string{"accountId"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	accountId, err := valueObject.NewAccountId(input["accountId"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var passwordPtr *valueObject.Password
-	if input["password"] != nil && input["password"] != "" {
-		password, err := valueObject.NewPassword(input["password"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		passwordPtr = &password
-	}
-
-	var isSuperAdminPtr *bool
-	if input["isSuperAdmin"] != nil {
-		isSuperAdmin, err := voHelper.InterfaceToBool(input["isSuperAdmin"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		isSuperAdminPtr = &isSuperAdmin
-	}
-
-	var shouldUpdateApiKeyPtr *bool
-	if input["shouldUpdateApiKey"] != nil {
-		shouldUpdateApiKey, err := voHelper.InterfaceToBool(input["shouldUpdateApiKey"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		shouldUpdateApiKeyPtr = &shouldUpdateApiKey
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateAccount(
-		accountId, passwordPtr, isSuperAdminPtr, shouldUpdateApiKeyPtr,
-		operatorAccountId, operatorIpAddress,
-	)
-
-	if updateDto.ShouldUpdateApiKey != nil && *updateDto.ShouldUpdateApiKey {
-		newKey, err := useCase.UpdateAccountApiKey(
-			service.accountQueryRepo, service.accountCmdRepo,
-			service.activityRecordCmdRepo, updateDto,
-		)
-		if err != nil {
-			return NewServiceOutput(InfraError, err.Error())
-		}
-		return NewServiceOutput(Success, newKey)
-	}
-
-	err = useCase.UpdateAccount(
-		service.accountQueryRepo, service.accountCmdRepo,
-		service.activityRecordCmdRepo, updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "AccountUpdated")
-}
-
-func (service *AccountService) Delete(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"accountId"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	accountId, err := valueObject.NewAccountId(input["accountId"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteAccount(accountId, operatorAccountId, operatorIpAddress)
-
-	err = useCase.DeleteAccount(
-		service.accountQueryRepo, service.accountCmdRepo,
-		service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "AccountDeleted")
-}
-
-func (service *AccountService) CreateSecureAccessPublicKey(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"accountId", "content"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	keyContent, err := valueObject.NewSecureAccessPublicKeyContent(input["content"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	keyName, err := valueObject.NewSecureAccessPublicKeyName(input["name"])
-	if err != nil {
-		keyName, err = keyContent.ReadOnlyKeyName()
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	accountId, err := valueObject.NewAccountId(input["accountId"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateSecureAccessPublicKey(
-		accountId, keyContent, keyName, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.CreateSecureAccessPublicKey(
-		service.accountCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "SecureAccessPublicKeyCreated")
-}
-
-func (service *AccountService) DeleteSecureAccessPublicKey(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"secureAccessPublicKeyId"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	keyId, err := valueObject.NewSecureAccessPublicKeyId(
-		input["secureAccessPublicKeyId"],
-	)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteSecureAccessPublicKey(
-		keyId, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.DeleteSecureAccessPublicKey(
-		service.accountQueryRepo, service.accountCmdRepo,
-		service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "SecureAccessPublicKeyDeleted")
-}

+ 0 - 284
src/presentation/service/cron.go

@@ -1,284 +0,0 @@
-package service
-
-import (
-	"errors"
-
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	cronInfra "github.com/goinfinite/os/src/infra/cron"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-)
-
-type CronService struct {
-	cronQueryRepo         *cronInfra.CronQueryRepo
-	cronCmdRepo           *cronInfra.CronCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewCronService(
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *CronService {
-	return &CronService{
-		cronQueryRepo:         cronInfra.NewCronQueryRepo(),
-		cronCmdRepo:           cronInfra.NewCronCmdRepo(),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *CronService) Read(input map[string]interface{}) ServiceOutput {
-	var idPtr *valueObject.CronId
-	if input["id"] != nil {
-		id, err := valueObject.NewCronId(input["id"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		idPtr = &id
-	}
-
-	var commentPtr *valueObject.CronComment
-	if input["comment"] != nil {
-		slug, err := valueObject.NewCronComment(input["comment"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		commentPtr = &slug
-	}
-
-	paginationDto := useCase.MarketplaceDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
-		}
-		paginationDto.PageNumber = pageNumber
-	}
-
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
-		}
-		paginationDto.ItemsPerPage = itemsPerPage
-	}
-
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortBy = &sortBy
-	}
-
-	if input["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortDirection = &sortDirection
-	}
-
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.LastSeenId = &lastSeenId
-	}
-
-	readDto := dto.ReadCronsRequest{
-		Pagination:  paginationDto,
-		CronId:      idPtr,
-		CronComment: commentPtr,
-	}
-
-	cronsList, err := useCase.ReadCrons(service.cronQueryRepo, readDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, cronsList)
-}
-
-func (service *CronService) Create(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"schedule", "command"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	schedule, err := valueObject.NewCronSchedule(input["schedule"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	command, err := valueObject.NewUnixCommand(input["command"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var commentPtr *valueObject.CronComment
-	if input["comment"] != nil && input["comment"] != "" {
-		comment, err := valueObject.NewCronComment(input["comment"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		commentPtr = &comment
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateCron(
-		schedule, command, commentPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.CreateCron(
-		service.cronCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "CronCreated")
-}
-
-func (service *CronService) Update(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"id"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	id, err := valueObject.NewCronId(input["id"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var schedulePtr *valueObject.CronSchedule
-	if input["schedule"] != nil {
-		schedule, err := valueObject.NewCronSchedule(input["schedule"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		schedulePtr = &schedule
-	}
-
-	var commandPtr *valueObject.UnixCommand
-	if input["command"] != nil {
-		command, err := valueObject.NewUnixCommand(input["command"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		commandPtr = &command
-	}
-
-	var commentPtr *valueObject.CronComment
-	if input["comment"] != nil {
-		comment, err := valueObject.NewCronComment(input["comment"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		commentPtr = &comment
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateCron(
-		id, schedulePtr, commandPtr, commentPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.UpdateCron(
-		service.cronQueryRepo, service.cronCmdRepo, service.activityRecordCmdRepo,
-		updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "CronUpdated")
-}
-
-func (service *CronService) Delete(input map[string]interface{}) ServiceOutput {
-	var idPtr *valueObject.CronId
-	if input["cronId"] != nil {
-		id, err := valueObject.NewCronId(input["cronId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		idPtr = &id
-	}
-
-	var commentPtr *valueObject.CronComment
-	if input["comment"] != nil {
-		comment, err := valueObject.NewCronComment(input["comment"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		commentPtr = &comment
-	}
-
-	var err error
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteCron(
-		idPtr, commentPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.DeleteCron(
-		service.cronQueryRepo, service.cronCmdRepo, service.activityRecordCmdRepo,
-		deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "CronDeleted")
-}

+ 0 - 352
src/presentation/service/database.go

@@ -1,352 +0,0 @@
-package service
-
-import (
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	databaseInfra "github.com/goinfinite/os/src/infra/database"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
-)
-
-type DatabaseService struct {
-	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-	availabilityInspector *sharedHelper.ServiceAvailabilityInspector
-}
-
-func NewDatabaseService(
-	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *DatabaseService {
-	return &DatabaseService{
-		persistentDbSvc:       persistentDbSvc,
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-		availabilityInspector: sharedHelper.NewServiceAvailabilityInspector(
-			persistentDbSvc,
-		),
-	}
-}
-
-func (service *DatabaseService) Read(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"dbType"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbType, err := valueObject.NewDatabaseType(input["dbType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	serviceName, err := valueObject.NewServiceName(dbType.String())
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	requestPagination, err := serviceHelper.PaginationParser(
-		input, useCase.DatabasesDefaultPagination,
-	)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var databaseNamePtr *valueObject.DatabaseName
-	if input["name"] != nil {
-		databaseName, err := valueObject.NewDatabaseName(input["name"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		databaseNamePtr = &databaseName
-	}
-
-	var usernamePtr *valueObject.DatabaseUsername
-	if input["username"] != nil {
-		username, err := valueObject.NewDatabaseUsername(input["username"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		usernamePtr = &username
-	}
-
-	requestDto := dto.ReadDatabasesRequest{
-		Pagination:   requestPagination,
-		DatabaseName: databaseNamePtr,
-		DatabaseType: &dbType,
-		Username:     usernamePtr,
-	}
-
-	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
-
-	responseDto, err := useCase.ReadDatabases(databaseQueryRepo, requestDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, responseDto)
-}
-
-func (service *DatabaseService) Create(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"dbType", "dbName"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbType, err := valueObject.NewDatabaseType(input["dbType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbName, err := valueObject.NewDatabaseName(input["dbName"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	serviceName, err := valueObject.NewServiceName(dbType.String())
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateDatabase(dbName, operatorAccountId, operatorIpAddress)
-
-	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
-	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
-
-	err = useCase.CreateDatabase(
-		databaseQueryRepo, databaseCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "DatabaseCreated")
-}
-
-func (service *DatabaseService) Delete(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"dbType", "dbName"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbType, err := valueObject.NewDatabaseType(input["dbType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	serviceName, err := valueObject.NewServiceName(dbType.String())
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	dbName, err := valueObject.NewDatabaseName(input["dbName"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteDatabase(dbName, operatorAccountId, operatorIpAddress)
-
-	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
-	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
-
-	err = useCase.DeleteDatabase(
-		databaseQueryRepo, databaseCmdRepo, service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "DatabaseDeleted")
-}
-
-func (service *DatabaseService) CreateUser(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"dbType", "dbName", "username", "password"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbType, err := valueObject.NewDatabaseType(input["dbType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	serviceName, err := valueObject.NewServiceName(dbType.String())
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	dbName, err := valueObject.NewDatabaseName(input["dbName"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbUsername, err := valueObject.NewDatabaseUsername(input["username"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbPassword, err := valueObject.NewPassword(input["password"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbPrivileges := []valueObject.DatabasePrivilege{
-		valueObject.DatabasePrivilege("ALL"),
-	}
-	if input["privileges"] != nil {
-		var assertOk bool
-		dbPrivileges, assertOk = input["privileges"].([]valueObject.DatabasePrivilege)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidDatabasePrivileges")
-		}
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateDatabaseUser(
-		dbName, dbUsername, dbPassword, dbPrivileges, operatorAccountId,
-		operatorIpAddress,
-	)
-
-	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
-	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
-
-	err = useCase.CreateDatabaseUser(
-		databaseQueryRepo, databaseCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "DatabaseUserCreated")
-}
-
-func (service *DatabaseService) DeleteUser(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"dbType", "dbName", "dbUser"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbType, err := valueObject.NewDatabaseType(input["dbType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	serviceName, err := valueObject.NewServiceName(dbType.String())
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	dbName, err := valueObject.NewDatabaseName(input["dbName"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	dbUsername, err := valueObject.NewDatabaseUsername(input["dbUser"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteDatabaseUser(
-		dbName, dbUsername, operatorAccountId, operatorIpAddress,
-	)
-
-	databaseQueryRepo := databaseInfra.NewDatabaseQueryRepo(dbType)
-	databaseCmdRepo := databaseInfra.NewDatabaseCmdRepo(dbType)
-
-	err = useCase.DeleteDatabaseUser(
-		databaseQueryRepo, databaseCmdRepo, service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "DatabaseUserDeleted")
-}

+ 0 - 134
src/presentation/service/runtime.go

@@ -1,134 +0,0 @@
-package service
-
-import (
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/entity"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	runtimeInfra "github.com/goinfinite/os/src/infra/runtime"
-	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-	sharedHelper "github.com/goinfinite/os/src/presentation/shared/helper"
-)
-
-type RuntimeService struct {
-	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
-	availabilityInspector *sharedHelper.ServiceAvailabilityInspector
-	runtimeQueryRepo      runtimeInfra.RuntimeQueryRepo
-	runtimeCmdRepo        *runtimeInfra.RuntimeCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewRuntimeService(
-	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *RuntimeService {
-	return &RuntimeService{
-		persistentDbSvc: persistentDbSvc,
-		availabilityInspector: sharedHelper.NewServiceAvailabilityInspector(
-			persistentDbSvc,
-		),
-		runtimeQueryRepo:      runtimeInfra.RuntimeQueryRepo{},
-		runtimeCmdRepo:        runtimeInfra.NewRuntimeCmdRepo(persistentDbSvc),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *RuntimeService) ReadPhpConfigs(
-	input map[string]interface{},
-) ServiceOutput {
-	serviceName, _ := valueObject.NewServiceName("php-webserver")
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	phpConfigs, err := useCase.ReadPhpConfigs(service.runtimeQueryRepo, hostname)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, phpConfigs)
-}
-
-func (service *RuntimeService) UpdatePhpConfigs(
-	input map[string]interface{},
-) ServiceOutput {
-	serviceName, _ := valueObject.NewServiceName("php-webserver")
-	if !service.availabilityInspector.IsAvailable(serviceName) {
-		return NewServiceOutput(InfraError, sharedHelper.ServiceUnavailableError)
-	}
-
-	requiredParams := []string{"hostname", "version"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	phpVersion, err := valueObject.NewPhpVersion(input["version"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	phpModules := []entity.PhpModule{}
-	if _, exists := input["modules"]; exists {
-		var assertOk bool
-		phpModules, assertOk = input["modules"].([]entity.PhpModule)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidPhpModules")
-		}
-	}
-
-	phpSettings := []entity.PhpSetting{}
-	if _, exists := input["settings"]; exists {
-		var assertOk bool
-		phpSettings, assertOk = input["settings"].([]entity.PhpSetting)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidPhpSettings")
-		}
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdatePhpConfigs(
-		hostname, phpVersion, phpModules, phpSettings, operatorAccountId,
-		operatorIpAddress,
-	)
-
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbSvc)
-
-	err = useCase.UpdatePhpConfigs(
-		service.runtimeQueryRepo, service.runtimeCmdRepo, vhostQueryRepo,
-		service.activityRecordCmdRepo, updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "PhpConfigsUpdated")
-}

+ 0 - 937
src/presentation/service/services.go

@@ -1,937 +0,0 @@
-package service
-
-import (
-	"errors"
-	"log/slog"
-	"strconv"
-	"strings"
-
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	infraEnvs "github.com/goinfinite/os/src/infra/envs"
-	infraHelper "github.com/goinfinite/os/src/infra/helper"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
-	servicesInfra "github.com/goinfinite/os/src/infra/services"
-	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-)
-
-type ServicesService struct {
-	persistentDbService   *internalDbInfra.PersistentDatabaseService
-	servicesQueryRepo     *servicesInfra.ServicesQueryRepo
-	servicesCmdRepo       *servicesInfra.ServicesCmdRepo
-	mappingQueryRepo      *vhostInfra.MappingQueryRepo
-	mappingCmdRepo        *vhostInfra.MappingCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewServicesService(
-	persistentDbService *internalDbInfra.PersistentDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *ServicesService {
-	return &ServicesService{
-		persistentDbService:   persistentDbService,
-		servicesQueryRepo:     servicesInfra.NewServicesQueryRepo(persistentDbService),
-		servicesCmdRepo:       servicesInfra.NewServicesCmdRepo(persistentDbService),
-		mappingQueryRepo:      vhostInfra.NewMappingQueryRepo(persistentDbService),
-		mappingCmdRepo:        vhostInfra.NewMappingCmdRepo(persistentDbService),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *ServicesService) ReadInstalledItems(
-	input map[string]interface{},
-) ServiceOutput {
-	var namePtr *valueObject.ServiceName
-	if input["name"] != nil {
-		name, err := valueObject.NewServiceName(input["name"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		namePtr = &name
-	}
-
-	var naturePtr *valueObject.ServiceNature
-	if input["nature"] != nil {
-		nature, err := valueObject.NewServiceNature(input["nature"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		naturePtr = &nature
-	}
-
-	var statusPtr *valueObject.ServiceStatus
-	if input["status"] != nil {
-		status, err := valueObject.NewServiceStatus(input["status"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		statusPtr = &status
-	}
-
-	var typePtr *valueObject.ServiceType
-	if input["type"] != nil {
-		itemType, err := valueObject.NewServiceType(input["type"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		typePtr = &itemType
-	}
-
-	shouldIncludeMetrics := false
-	if input["shouldIncludeMetrics"] != nil {
-		var err error
-		shouldIncludeMetrics, err = voHelper.InterfaceToBool(input["shouldIncludeMetrics"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-	}
-
-	paginationDto := useCase.ServicesDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
-		}
-		paginationDto.PageNumber = pageNumber
-	}
-
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
-		}
-		paginationDto.ItemsPerPage = itemsPerPage
-	}
-
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortBy = &sortBy
-	}
-
-	if input["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortDirection = &sortDirection
-	}
-
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.LastSeenId = &lastSeenId
-	}
-
-	readDto := dto.ReadInstalledServicesItemsRequest{
-		Pagination:           paginationDto,
-		ServiceName:          namePtr,
-		ServiceNature:        naturePtr,
-		ServiceType:          typePtr,
-		ServiceStatus:        statusPtr,
-		ShouldIncludeMetrics: &shouldIncludeMetrics,
-	}
-
-	servicesList, err := useCase.ReadInstalledServices(
-		service.servicesQueryRepo, readDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, servicesList)
-}
-
-func (service *ServicesService) ReadInstallableItems(
-	input map[string]interface{},
-) ServiceOutput {
-	var namePtr *valueObject.ServiceName
-	if input["name"] != nil {
-		name, err := valueObject.NewServiceName(input["name"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		namePtr = &name
-	}
-
-	var naturePtr *valueObject.ServiceNature
-	if input["nature"] != nil {
-		nature, err := valueObject.NewServiceNature(input["nature"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		naturePtr = &nature
-	}
-
-	var typePtr *valueObject.ServiceType
-	if input["type"] != nil {
-		itemType, err := valueObject.NewServiceType(input["type"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		typePtr = &itemType
-	}
-
-	paginationDto := useCase.ServicesDefaultPagination
-	if input["pageNumber"] != nil {
-		pageNumber, err := voHelper.InterfaceToUint32(input["pageNumber"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidPageNumber"))
-		}
-		paginationDto.PageNumber = pageNumber
-	}
-
-	if input["itemsPerPage"] != nil {
-		itemsPerPage, err := voHelper.InterfaceToUint16(input["itemsPerPage"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidItemsPerPage"))
-		}
-		paginationDto.ItemsPerPage = itemsPerPage
-	}
-
-	if input["sortBy"] != nil {
-		sortBy, err := valueObject.NewPaginationSortBy(input["sortBy"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortBy = &sortBy
-	}
-
-	if input["sortDirection"] != nil {
-		sortDirection, err := valueObject.NewPaginationSortDirection(
-			input["sortDirection"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.SortDirection = &sortDirection
-	}
-
-	if input["lastSeenId"] != nil {
-		lastSeenId, err := valueObject.NewPaginationLastSeenId(input["lastSeenId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err)
-		}
-		paginationDto.LastSeenId = &lastSeenId
-	}
-
-	readDto := dto.ReadInstallableServicesItemsRequest{
-		Pagination:    paginationDto,
-		ServiceName:   namePtr,
-		ServiceNature: naturePtr,
-		ServiceType:   typePtr,
-	}
-
-	servicesList, err := useCase.ReadInstallableServices(
-		service.servicesQueryRepo, readDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, servicesList)
-}
-
-func (service *ServicesService) CreateInstallable(
-	input map[string]interface{},
-	shouldSchedule bool,
-) ServiceOutput {
-	requiredParams := []string{"name"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	name, err := valueObject.NewServiceName(input["name"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var versionPtr *valueObject.ServiceVersion
-	if input["version"] != nil {
-		version, err := valueObject.NewServiceVersion(input["version"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		versionPtr = &version
-	}
-
-	var startupFilePtr *valueObject.UnixFilePath
-	if input["startupFile"] != nil {
-		startupFile, err := valueObject.NewUnixFilePath(input["startupFile"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		startupFilePtr = &startupFile
-	}
-
-	var workingDirPtr *valueObject.UnixFilePath
-	if input["workingDir"] != nil {
-		workingDir, err := valueObject.NewUnixFilePath(input["workingDir"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		workingDirPtr = &workingDir
-	}
-
-	envs := []valueObject.ServiceEnv{}
-	if input["envs"] != nil {
-		var assertOk bool
-		envs, assertOk = input["envs"].([]valueObject.ServiceEnv)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidServiceEnvs")
-		}
-	}
-
-	portBindings := []valueObject.PortBinding{}
-	if input["portBindings"] != nil {
-		var assertOk bool
-		portBindings, assertOk = input["portBindings"].([]valueObject.PortBinding)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidPortBindings")
-		}
-	}
-
-	var autoStartPtr *bool
-	if input["autoStart"] != nil {
-		autoStart, err := voHelper.InterfaceToBool(input["autoStart"])
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoStartMustBeBool")
-		}
-		autoStartPtr = &autoStart
-	}
-
-	var timeoutStartSecsPtr *uint
-	if input["timeoutStartSecs"] != nil {
-		timeoutStartSecs, err := voHelper.InterfaceToUint(input["timeoutStartSecs"])
-		if err != nil {
-			return NewServiceOutput(UserError, "TimeoutStartSecsMustBeUint")
-		}
-		timeoutStartSecsPtr = &timeoutStartSecs
-	}
-
-	var autoRestartPtr *bool
-	if input["autoRestart"] != nil {
-		autoRestart, err := voHelper.InterfaceToBool(
-			input["autoRestart"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoRestartMustBeBool")
-		}
-		autoRestartPtr = &autoRestart
-	}
-
-	var maxStartRetriesPtr *uint
-	if input["maxStartRetries"] != nil {
-		maxStartRetries, err := voHelper.InterfaceToUint(input["maxStartRetries"])
-		if err != nil {
-			return NewServiceOutput(UserError, "MaxStartRetriesMustBeUint")
-		}
-		maxStartRetriesPtr = &maxStartRetries
-	}
-
-	autoCreateMapping := true
-	if input["autoCreateMapping"] != nil {
-		autoCreateMapping, err = voHelper.InterfaceToBool(input["autoCreateMapping"])
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoCreateMappingMustBeBool")
-		}
-	}
-
-	var mappingHostnamePtr *valueObject.Fqdn
-	if input["mappingHostname"] != nil {
-		mappingHostname, err := valueObject.NewFqdn(input["mappingHostname"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingHostnamePtr = &mappingHostname
-	}
-
-	var mappingPathPtr *valueObject.MappingPath
-	if input["mappingPath"] != nil {
-		mappingPath, err := valueObject.NewMappingPath(input["mappingPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingPathPtr = &mappingPath
-	}
-
-	var mappingUpgradeInsecureRequestsPtr *bool
-	if input["mappingUpgradeInsecureRequests"] != nil {
-		mappingUpgradeInsecureRequests, err := voHelper.InterfaceToBool(
-			input["mappingUpgradeInsecureRequests"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidMappingUpgradeInsecureRequests")
-		}
-		mappingUpgradeInsecureRequestsPtr = &mappingUpgradeInsecureRequests
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	if shouldSchedule {
-		cliCmd := infraEnvs.InfiniteOsBinary + " services create-installable"
-		installParams := []string{
-			"--name", name.String(),
-			"--auto-create-mapping", strconv.FormatBool(autoCreateMapping),
-		}
-
-		if len(envs) > 0 {
-			for _, env := range envs {
-				escapedField := infraHelper.ShellEscape{}.Quote(env.String())
-				installParams = append(installParams, "--envs", escapedField)
-			}
-		}
-
-		if len(portBindings) > 0 {
-			for _, portBinding := range portBindings {
-				escapedField := infraHelper.ShellEscape{}.Quote(portBinding.String())
-				installParams = append(installParams, "--port-bindings", escapedField)
-			}
-		}
-
-		if versionPtr != nil {
-			installParams = append(installParams, "--version", versionPtr.String())
-		}
-
-		if startupFilePtr != nil {
-			installParams = append(installParams, "--startup-file", startupFilePtr.String())
-		}
-
-		if workingDirPtr != nil {
-			installParams = append(installParams, "--working-dir", workingDirPtr.String())
-		}
-
-		if autoStartPtr != nil {
-			autoStartStr := strconv.FormatBool(*autoStartPtr)
-			installParams = append(installParams, "--auto-start", autoStartStr)
-		}
-
-		if timeoutStartSecsPtr != nil {
-			timeoutStartSecsStr := strconv.FormatUint(uint64(*timeoutStartSecsPtr), 10)
-			installParams = append(installParams, "--timeout-start-secs", timeoutStartSecsStr)
-		}
-
-		if autoRestartPtr != nil {
-			autoRestartStr := strconv.FormatBool(*autoRestartPtr)
-			installParams = append(installParams, "--auto-restart", autoRestartStr)
-		}
-
-		if maxStartRetriesPtr != nil {
-			maxStartRetriesStr := strconv.FormatUint(uint64(*maxStartRetriesPtr), 10)
-			installParams = append(installParams, "--max-start-retries", maxStartRetriesStr)
-		}
-
-		if mappingHostnamePtr != nil {
-			installParams = append(installParams, "--mapping-hostname", mappingHostnamePtr.String())
-		}
-
-		if mappingPathPtr != nil {
-			installParams = append(installParams, "--mapping-path", mappingPathPtr.String())
-		}
-
-		if mappingUpgradeInsecureRequestsPtr != nil {
-			installParams = append(
-				installParams,
-				"--mapping-upgrade-insecure-requests",
-				strconv.FormatBool(*mappingUpgradeInsecureRequestsPtr),
-			)
-		}
-
-		cliCmd += " " + strings.Join(installParams, " ")
-
-		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(service.persistentDbService)
-		taskName, _ := valueObject.NewScheduledTaskName("CreateInstallableService")
-		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
-		taskTag, _ := valueObject.NewScheduledTaskTag("services")
-		taskTags := []valueObject.ScheduledTaskTag{taskTag}
-		timeoutSecs := uint16(1800)
-
-		scheduledTaskCreateDto := dto.NewCreateScheduledTask(
-			taskName, taskCmd, taskTags, &timeoutSecs, nil,
-		)
-
-		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
-		if err != nil {
-			return NewServiceOutput(InfraError, err.Error())
-		}
-
-		return NewServiceOutput(Created, "CreateInstallableServiceScheduled")
-	}
-
-	createDto := dto.NewCreateInstallableService(
-		name, envs, portBindings, versionPtr, startupFilePtr, workingDirPtr,
-		autoStartPtr, timeoutStartSecsPtr, autoRestartPtr, maxStartRetriesPtr,
-		&autoCreateMapping, mappingHostnamePtr, mappingPathPtr,
-		mappingUpgradeInsecureRequestsPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbService)
-
-	err = useCase.CreateInstallableService(
-		service.servicesQueryRepo, service.servicesCmdRepo, vhostQueryRepo,
-		service.mappingCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "InstallableServiceCreated")
-}
-
-func (service *ServicesService) CreateCustom(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"name", "type", "startCmd"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	name, err := valueObject.NewServiceName(input["name"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	svcType, err := valueObject.NewServiceType(input["type"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	startCmd, err := valueObject.NewUnixCommand(input["startCmd"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var versionPtr *valueObject.ServiceVersion
-	if input["version"] != nil {
-		version, err := valueObject.NewServiceVersion(input["version"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		versionPtr = &version
-	}
-
-	var execUserPtr *valueObject.UnixUsername
-	if input["execUser"] != nil {
-		execUser, err := valueObject.NewUnixUsername(input["execUser"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		execUserPtr = &execUser
-	}
-
-	envs := []valueObject.ServiceEnv{}
-	if input["envs"] != nil {
-		var assertOk bool
-		envs, assertOk = input["envs"].([]valueObject.ServiceEnv)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidServiceEnvs")
-		}
-	}
-
-	portBindings := []valueObject.PortBinding{}
-	if input["portBindings"] != nil {
-		var assertOk bool
-		portBindings, assertOk = input["portBindings"].([]valueObject.PortBinding)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidPortBindings")
-		}
-	}
-
-	var autoStartPtr *bool
-	if input["autoStart"] != nil {
-		autoStart, err := voHelper.InterfaceToBool(input["autoStart"])
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoStartMustBeBool")
-		}
-		autoStartPtr = &autoStart
-	}
-
-	var timeoutStartSecsPtr *uint
-	if input["timeoutStartSecs"] != nil {
-		timeoutStartSecs, err := voHelper.InterfaceToUint(input["timeoutStartSecs"])
-		if err != nil {
-			return NewServiceOutput(UserError, "TimeoutStartSecsMustBeUint")
-		}
-		timeoutStartSecsPtr = &timeoutStartSecs
-	}
-
-	var autoRestartPtr *bool
-	if input["autoRestart"] != nil {
-		autoRestart, err := voHelper.InterfaceToBool(
-			input["autoRestart"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoRestartMustBeBool")
-		}
-		autoRestartPtr = &autoRestart
-	}
-
-	var maxStartRetriesPtr *uint
-	if input["maxStartRetries"] != nil {
-		maxStartRetries, err := voHelper.InterfaceToUint(input["maxStartRetries"])
-		if err != nil {
-			return NewServiceOutput(UserError, "MaxStartRetriesMustBeUint")
-		}
-		maxStartRetriesPtr = &maxStartRetries
-	}
-
-	var logOutputPathPtr *valueObject.UnixFilePath
-	if input["logOutputPath"] != nil {
-		logOutputPath, err := valueObject.NewUnixFilePath(input["logOutputPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		logOutputPathPtr = &logOutputPath
-	}
-
-	var logErrorPathPtr *valueObject.UnixFilePath
-	if input["logErrorPath"] != nil {
-		logErrorPath, err := valueObject.NewUnixFilePath(input["logErrorPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		logErrorPathPtr = &logErrorPath
-	}
-
-	var avatarUrlPtr *valueObject.Url
-	if input["avatarUrl"] != nil {
-		avatarUrl, err := valueObject.NewUrl(input["avatarUrl"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		avatarUrlPtr = &avatarUrl
-	}
-
-	autoCreateMapping := true
-	if input["autoCreateMapping"] != nil {
-		autoCreateMapping, err = voHelper.InterfaceToBool(input["autoCreateMapping"])
-		if err != nil {
-			return NewServiceOutput(UserError, "AutoCreateMappingMustBeBool")
-		}
-	}
-
-	var mappingHostnamePtr *valueObject.Fqdn
-	if input["mappingHostname"] != nil {
-		mappingHostname, err := valueObject.NewFqdn(input["mappingHostname"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingHostnamePtr = &mappingHostname
-	}
-
-	var mappingPathPtr *valueObject.MappingPath
-	if input["mappingPath"] != nil {
-		mappingPath, err := valueObject.NewMappingPath(input["mappingPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingPathPtr = &mappingPath
-	}
-
-	var mappingUpgradeInsecureRequestsPtr *bool
-	if input["mappingUpgradeInsecureRequests"] != nil {
-		mappingUpgradeInsecureRequests, err := voHelper.InterfaceToBool(
-			input["mappingUpgradeInsecureRequests"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidMappingUpgradeInsecureRequests")
-		}
-		mappingUpgradeInsecureRequestsPtr = &mappingUpgradeInsecureRequests
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createCustomDto := dto.NewCreateCustomService(
-		name, svcType, startCmd, envs, portBindings, nil, nil, nil, nil, nil,
-		versionPtr, execUserPtr, nil, autoStartPtr, autoRestartPtr,
-		timeoutStartSecsPtr, maxStartRetriesPtr, logOutputPathPtr, logErrorPathPtr,
-		avatarUrlPtr, &autoCreateMapping, mappingHostnamePtr, mappingPathPtr,
-		mappingUpgradeInsecureRequestsPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbService)
-
-	err = useCase.CreateCustomService(
-		service.servicesQueryRepo, service.servicesCmdRepo, vhostQueryRepo,
-		service.mappingCmdRepo, service.activityRecordCmdRepo, createCustomDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "CustomServiceCreated")
-}
-
-func (service *ServicesService) Update(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"name"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	name, err := valueObject.NewServiceName(input["name"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var typePtr *valueObject.ServiceType
-	if input["type"] != nil {
-		svcType, err := valueObject.NewServiceType(input["type"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		typePtr = &svcType
-	}
-
-	var startCmdPtr *valueObject.UnixCommand
-	if input["startCmd"] != nil {
-		startCmd, err := valueObject.NewUnixCommand(input["startCmd"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		startCmdPtr = &startCmd
-	}
-
-	var statusPtr *valueObject.ServiceStatus
-	if input["status"] != nil {
-		status, err := valueObject.NewServiceStatus(input["status"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		statusPtr = &status
-	}
-
-	var versionPtr *valueObject.ServiceVersion
-	if input["version"] != nil {
-		version, err := valueObject.NewServiceVersion(input["version"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		versionPtr = &version
-	}
-
-	envs := []valueObject.ServiceEnv{}
-	if input["envs"] != nil {
-		rawEnvs, assertOk := input["envs"].([]string)
-		if !assertOk {
-			return NewServiceOutput(UserError, "EnvsMustBeStringArray")
-		}
-
-		for _, rawEnv := range rawEnvs {
-			env, err := valueObject.NewServiceEnv(rawEnv)
-			if err != nil {
-				slog.Debug(err.Error(), slog.String("env", rawEnv))
-				continue
-			}
-			envs = append(envs, env)
-		}
-	}
-
-	portBindings := []valueObject.PortBinding{}
-	if _, exists := input["portBindings"]; exists {
-		rawPortBindings, assertOk := input["portBindings"].([]string)
-		if !assertOk {
-			return NewServiceOutput(UserError, "PortBindingsMustBeStringArray")
-		}
-
-		for _, rawPortBinding := range rawPortBindings {
-			if len(rawPortBinding) == 0 {
-				continue
-			}
-
-			portBinding, err := valueObject.NewPortBinding(rawPortBinding)
-			if err != nil {
-				slog.Debug(err.Error(), slog.String("portBinding", rawPortBinding))
-				continue
-			}
-			portBindings = append(portBindings, portBinding)
-		}
-	}
-
-	var startupFilePtr *valueObject.UnixFilePath
-	if input["startupFile"] != nil {
-		startupFile, err := valueObject.NewUnixFilePath(input["startupFile"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		startupFilePtr = &startupFile
-	}
-
-	var autoStartPtr *bool
-	if input["autoStart"] != nil {
-		autoStart, err := voHelper.InterfaceToBool(input["autoStart"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		autoStartPtr = &autoStart
-	}
-
-	var autoRestartPtr *bool
-	if input["autoRestart"] != nil {
-		autoRestart, err := voHelper.InterfaceToBool(input["autoRestart"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		autoRestartPtr = &autoRestart
-	}
-
-	var timeoutStartSecsPtr *uint
-	if input["timeoutStartSecs"] != nil {
-		timeoutStartSecs, err := voHelper.InterfaceToUint(input["timeoutStartSecs"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		timeoutStartSecsPtr = &timeoutStartSecs
-	}
-
-	var maxStartRetriesPtr *uint
-	if input["maxStartRetries"] != nil {
-		maxStartRetries, err := voHelper.InterfaceToUint(input["maxStartRetries"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		maxStartRetriesPtr = &maxStartRetries
-	}
-
-	var logOutputPathPtr *valueObject.UnixFilePath
-	if input["logOutputPath"] != nil {
-		logOutputPath, err := valueObject.NewUnixFilePath(input["logOutputPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		logOutputPathPtr = &logOutputPath
-	}
-
-	var logErrorPathPtr *valueObject.UnixFilePath
-	if input["logErrorPath"] != nil {
-		logErrorPath, err := valueObject.NewUnixFilePath(input["logErrorPath"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		logErrorPathPtr = &logErrorPath
-	}
-
-	var avatarUrlPtr *valueObject.Url
-	if input["avatarUrl"] != nil {
-		avatarUrl, err := valueObject.NewUrl(input["avatarUrl"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		avatarUrlPtr = &avatarUrl
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateService(
-		name, typePtr, versionPtr, statusPtr, startCmdPtr, envs, portBindings, nil,
-		nil, nil, nil, nil, nil, nil, startupFilePtr, autoStartPtr, autoRestartPtr,
-		timeoutStartSecsPtr, maxStartRetriesPtr, logOutputPathPtr, logErrorPathPtr,
-		avatarUrlPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.UpdateService(
-		service.servicesQueryRepo, service.servicesCmdRepo, service.mappingQueryRepo,
-		service.mappingCmdRepo, service.activityRecordCmdRepo, updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "ServiceUpdated")
-}
-
-func (service *ServicesService) Delete(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"name"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	name, err := valueObject.NewServiceName(input["name"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteService(name, operatorAccountId, operatorIpAddress)
-
-	err = useCase.DeleteService(
-		service.servicesQueryRepo, service.servicesCmdRepo, service.mappingQueryRepo,
-		service.mappingCmdRepo, service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "ServiceDeleted")
-}

+ 0 - 313
src/presentation/service/ssl.go

@@ -1,313 +0,0 @@
-package service
-
-import (
-	"errors"
-	"strings"
-
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/entity"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	infraEnvs "github.com/goinfinite/os/src/infra/envs"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	scheduledTaskInfra "github.com/goinfinite/os/src/infra/scheduledTask"
-	sslInfra "github.com/goinfinite/os/src/infra/ssl"
-	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-)
-
-type SslService struct {
-	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
-	sslQueryRepo          *sslInfra.SslQueryRepo
-	sslCmdRepo            *sslInfra.SslCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewSslService(
-	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-	transientDbSvc *internalDbInfra.TransientDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *SslService {
-	return &SslService{
-		persistentDbSvc:       persistentDbSvc,
-		sslQueryRepo:          sslInfra.NewSslQueryRepo(),
-		sslCmdRepo:            sslInfra.NewSslCmdRepo(persistentDbSvc, transientDbSvc),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *SslService) SslPairReadRequestFactory(
-	serviceInput map[string]interface{},
-	withMappings bool,
-) (readRequestDto dto.ReadSslPairsRequest, err error) {
-	if serviceInput["sslPairId"] == nil && serviceInput["id"] != nil {
-		serviceInput["sslPairId"] = serviceInput["id"]
-	}
-
-	var sslPairIdPtr *valueObject.SslPairId
-	if serviceInput["sslPairId"] != nil {
-		sslPairId, err := valueObject.NewSslPairId(serviceInput["sslPairId"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		sslPairIdPtr = &sslPairId
-	}
-
-	if serviceInput["virtualHostHostname"] == nil && serviceInput["hostname"] != nil {
-		serviceInput["virtualHostHostname"] = serviceInput["hostname"]
-	}
-
-	var vhostHostnamePtr *valueObject.Fqdn
-	if serviceInput["virtualHostHostname"] != nil {
-		vhostHostname, err := valueObject.NewFqdn(serviceInput["virtualHostHostname"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		vhostHostnamePtr = &vhostHostname
-	}
-
-	altNames := []valueObject.SslHostname{}
-	if serviceInput["altNames"] != nil {
-		var assertOk bool
-		altNames, assertOk = serviceInput["altNames"].([]valueObject.SslHostname)
-		if !assertOk {
-			return readRequestDto, errors.New("InvalidAltNamesStructure")
-		}
-	}
-
-	timeParamNames := []string{
-		"issuedBeforeAt", "issuedAfterAt", "expiresBeforeAt", "expiresAfterAt",
-	}
-	timeParamPtrs := serviceHelper.TimeParamsParser(timeParamNames, serviceInput)
-
-	requestPagination, err := serviceHelper.PaginationParser(
-		serviceInput, useCase.SslPairsDefaultPagination,
-	)
-	if err != nil {
-		return readRequestDto, err
-	}
-
-	return dto.ReadSslPairsRequest{
-		Pagination:          requestPagination,
-		SslPairId:           sslPairIdPtr,
-		VirtualHostHostname: vhostHostnamePtr,
-		AltNames:            altNames,
-		IssuedBeforeAt:      timeParamPtrs["issuedBeforeAt"],
-		IssuedAfterAt:       timeParamPtrs["issuedAfterAt"],
-		ExpiresBeforeAt:     timeParamPtrs["expiresBeforeAt"],
-		ExpiresAfterAt:      timeParamPtrs["expiresAfterAt"],
-	}, nil
-}
-
-func (service *SslService) Read(
-	serviceInput map[string]interface{},
-) ServiceOutput {
-	readRequestDto, err := service.SslPairReadRequestFactory(serviceInput, false)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	readResponseDto, err := useCase.ReadSslPairs(service.sslQueryRepo, readRequestDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, readResponseDto)
-}
-
-func (service *SslService) Create(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"virtualHostsHostnames", "certificate", "key"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	vhostHostnames, assertOk := input["virtualHostsHostnames"].([]valueObject.Fqdn)
-	if !assertOk {
-		return NewServiceOutput(UserError, errors.New("InvalidVirtualHostsStructure"))
-	}
-
-	certContent, err := valueObject.NewSslCertificateContent(input["certificate"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-	certEntity, err := entity.NewSslCertificate(certContent)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var chainCertsPtr *entity.SslCertificate
-	if input["chainCertificates"] != nil {
-		chainCertContent, err := valueObject.NewSslCertificateContent(input["chainCertificates"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("SslCertificateChainContentError"))
-		}
-		chainCertEntity, err := entity.NewSslCertificate(chainCertContent)
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("SslCertificateChainParseError"))
-		}
-		chainCertsPtr = &chainCertEntity
-	}
-
-	privateKeyContent, err := valueObject.NewSslPrivateKey(input["key"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateSslPair(
-		vhostHostnames, certEntity, chainCertsPtr, privateKeyContent,
-		operatorAccountId, operatorIpAddress,
-	)
-
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbSvc)
-
-	err = useCase.CreateSslPair(
-		vhostQueryRepo, service.sslCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "SslPairCreated")
-}
-
-func (service *SslService) CreatePubliclyTrusted(
-	input map[string]interface{},
-	shouldSchedule bool,
-) ServiceOutput {
-	if input["hostname"] != nil && input["virtualHostHostname"] == nil {
-		input["virtualHostHostname"] = input["hostname"]
-	}
-
-	if input["vhostHostname"] != nil && input["virtualHostHostname"] == nil {
-		input["virtualHostHostname"] = input["vhostHostname"]
-	}
-
-	requiredParams := []string{"virtualHostHostname"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	vhostHostname, err := valueObject.NewFqdn(input["virtualHostHostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	if shouldSchedule {
-		cliCmd := infraEnvs.InfiniteOsBinary + " ssl create-trusted"
-		installParams := []string{
-			"--hostname", vhostHostname.String(),
-		}
-		cliCmd += " " + strings.Join(installParams, " ")
-
-		scheduledTaskCmdRepo := scheduledTaskInfra.NewScheduledTaskCmdRepo(service.persistentDbSvc)
-		taskName, _ := valueObject.NewScheduledTaskName("CreatePubliclyTrustedSslPair")
-		taskCmd, _ := valueObject.NewUnixCommand(cliCmd)
-		taskTag, _ := valueObject.NewScheduledTaskTag("ssl")
-		taskTags := []valueObject.ScheduledTaskTag{taskTag}
-		timeoutSecs := uint16(1800)
-
-		scheduledTaskCreateDto := dto.NewCreateScheduledTask(
-			taskName, taskCmd, taskTags, &timeoutSecs, nil,
-		)
-
-		err = useCase.CreateScheduledTask(scheduledTaskCmdRepo, scheduledTaskCreateDto)
-		if err != nil {
-			return NewServiceOutput(InfraError, err.Error())
-		}
-
-		return NewServiceOutput(Created, "PubliclyTrustedSslPairCreationScheduled")
-	}
-
-	createDto := dto.NewCreatePubliclyTrustedSslPair(
-		vhostHostname, operatorAccountId, operatorIpAddress,
-	)
-
-	vhostQueryRepo := vhostInfra.NewVirtualHostQueryRepo(service.persistentDbSvc)
-
-	_, err = useCase.CreatePubliclyTrustedSslPair(
-		vhostQueryRepo, service.sslCmdRepo, service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "PubliclyTrustedSslPairCreated")
-}
-
-func (service *SslService) Delete(input map[string]interface{}) ServiceOutput {
-	if input["id"] == nil && input["sslPairId"] != nil {
-		input["id"] = input["sslPairId"]
-	}
-
-	requiredParams := []string{"id"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	pairId, err := valueObject.NewSslPairId(input["id"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	err = useCase.DeleteSslPair(
-		service.sslQueryRepo, service.sslCmdRepo, service.activityRecordCmdRepo,
-		dto.NewDeleteSslPair(pairId, operatorAccountId, operatorIpAddress),
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "SslPairDeleted")
-}

+ 0 - 994
src/presentation/service/virtualHost.go

@@ -1,994 +0,0 @@
-package service
-
-import (
-	"errors"
-
-	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/domain/useCase"
-	"github.com/goinfinite/os/src/domain/valueObject"
-	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
-	activityRecordInfra "github.com/goinfinite/os/src/infra/activityRecord"
-	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	servicesInfra "github.com/goinfinite/os/src/infra/services"
-	vhostInfra "github.com/goinfinite/os/src/infra/vhost"
-	serviceHelper "github.com/goinfinite/os/src/presentation/service/helper"
-
-	tkValueObject "github.com/goinfinite/tk/src/domain/valueObject"
-	tkVoUtil "github.com/goinfinite/tk/src/domain/valueObject/util"
-)
-
-type VirtualHostService struct {
-	persistentDbSvc       *internalDbInfra.PersistentDatabaseService
-	trailDbSvc            *internalDbInfra.TrailDatabaseService
-	vhostQueryRepo        *vhostInfra.VirtualHostQueryRepo
-	vhostCmdRepo          *vhostInfra.VirtualHostCmdRepo
-	mappingQueryRepo      *vhostInfra.MappingQueryRepo
-	mappingCmdRepo        *vhostInfra.MappingCmdRepo
-	activityRecordCmdRepo *activityRecordInfra.ActivityRecordCmdRepo
-}
-
-func NewVirtualHostService(
-	persistentDbSvc *internalDbInfra.PersistentDatabaseService,
-	trailDbSvc *internalDbInfra.TrailDatabaseService,
-) *VirtualHostService {
-	return &VirtualHostService{
-		persistentDbSvc:       persistentDbSvc,
-		trailDbSvc:            trailDbSvc,
-		vhostQueryRepo:        vhostInfra.NewVirtualHostQueryRepo(persistentDbSvc),
-		vhostCmdRepo:          vhostInfra.NewVirtualHostCmdRepo(persistentDbSvc),
-		mappingQueryRepo:      vhostInfra.NewMappingQueryRepo(persistentDbSvc),
-		mappingCmdRepo:        vhostInfra.NewMappingCmdRepo(persistentDbSvc),
-		activityRecordCmdRepo: activityRecordInfra.NewActivityRecordCmdRepo(trailDbSvc),
-	}
-}
-
-func (service *VirtualHostService) VirtualHostReadRequestFactory(
-	serviceInput map[string]interface{},
-	withMappings bool,
-) (readRequestDto dto.ReadVirtualHostsRequest, err error) {
-	var hostnamePtr *valueObject.Fqdn
-	if serviceInput["hostname"] != nil {
-		hostname, err := valueObject.NewFqdn(serviceInput["hostname"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		hostnamePtr = &hostname
-	}
-
-	var typePtr *valueObject.VirtualHostType
-	if serviceInput["type"] != nil {
-		vhostType, err := valueObject.NewVirtualHostType(serviceInput["type"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		typePtr = &vhostType
-	}
-
-	var rootDirectoryPtr *valueObject.UnixFilePath
-	if serviceInput["rootDirectory"] != nil {
-		rootDirectory, err := valueObject.NewUnixFilePath(serviceInput["rootDirectory"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		rootDirectoryPtr = &rootDirectory
-	}
-
-	var parentHostnamePtr *valueObject.Fqdn
-	if serviceInput["parentHostname"] != nil {
-		parentHostname, err := valueObject.NewFqdn(serviceInput["parentHostname"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		parentHostnamePtr = &parentHostname
-	}
-
-	if serviceInput["withMappings"] != nil {
-		withMappings, err = voHelper.InterfaceToBool(serviceInput["withMappings"])
-		if err != nil {
-			return readRequestDto, err
-		}
-	}
-
-	timeParamNames := []string{"createdBeforeAt", "createdAfterAt"}
-	timeParamPtrs := serviceHelper.TimeParamsParser(timeParamNames, serviceInput)
-
-	requestPagination, err := serviceHelper.PaginationParser(
-		serviceInput, useCase.VirtualHostsDefaultPagination,
-	)
-	if err != nil {
-		return readRequestDto, err
-	}
-
-	return dto.ReadVirtualHostsRequest{
-		Pagination:      requestPagination,
-		Hostname:        hostnamePtr,
-		VirtualHostType: typePtr,
-		RootDirectory:   rootDirectoryPtr,
-		ParentHostname:  parentHostnamePtr,
-		WithMappings:    &withMappings,
-		CreatedBeforeAt: timeParamPtrs["createdBeforeAt"],
-		CreatedAfterAt:  timeParamPtrs["createdAfterAt"],
-	}, nil
-}
-
-func (service *VirtualHostService) Read(
-	serviceInput map[string]interface{},
-) ServiceOutput {
-	readRequestDto, err := service.VirtualHostReadRequestFactory(serviceInput, false)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	readResponseDto, err := useCase.ReadVirtualHosts(service.vhostQueryRepo, readRequestDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, readResponseDto)
-}
-
-func (service *VirtualHostService) Create(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"hostname"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	vhostType := valueObject.VirtualHostTypeTopLevel
-	if input["type"] != nil {
-		vhostType, err = valueObject.NewVirtualHostType(input["type"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	isWildcard := false
-	if input["isWildcard"] != nil {
-		isWildcard, err = voHelper.InterfaceToBool(input["isWildcard"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	var parentHostnamePtr *valueObject.Fqdn
-	if input["parentHostname"] != nil {
-		parentHostname, err := valueObject.NewFqdn(input["parentHostname"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		parentHostnamePtr = &parentHostname
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateVirtualHost(
-		hostname, vhostType, &isWildcard, parentHostnamePtr,
-		operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.CreateVirtualHost(
-		service.vhostQueryRepo, service.vhostCmdRepo, service.activityRecordCmdRepo,
-		createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "VirtualHostCreated")
-}
-
-func (service *VirtualHostService) Update(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"hostname"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var isWildcardPtr *bool
-	if input["isWildcard"] != nil {
-		isWildcard, err := voHelper.InterfaceToBool(input["isWildcard"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidIsWildcard"))
-		}
-		isWildcardPtr = &isWildcard
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateVirtualHost(
-		hostname, isWildcardPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.UpdateVirtualHost(
-		service.vhostQueryRepo, service.vhostCmdRepo, service.activityRecordCmdRepo,
-		updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "VirtualHostUpdated")
-}
-
-func (service *VirtualHostService) Delete(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"hostname"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteVirtualHost(hostname, operatorAccountId, operatorIpAddress)
-	err = useCase.DeleteVirtualHost(
-		service.vhostQueryRepo, service.vhostCmdRepo,
-		service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "VirtualHostDeleted")
-}
-
-func (service *VirtualHostService) ReadWithMappings(
-	serviceInput map[string]interface{},
-) ServiceOutput {
-	readRequestDto, err := service.VirtualHostReadRequestFactory(serviceInput, true)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	readResponseDto, err := useCase.ReadVirtualHosts(service.vhostQueryRepo, readRequestDto)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, readResponseDto)
-}
-
-func (service *VirtualHostService) CreateMapping(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"hostname", "path", "targetType"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	hostname, err := valueObject.NewFqdn(input["hostname"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	path, err := valueObject.NewMappingPath(input["path"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	matchPattern := valueObject.MappingMatchPatternBeginsWith
-	if input["matchPattern"] != nil {
-		matchPattern, err = valueObject.NewMappingMatchPattern(input["matchPattern"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	targetType, err := valueObject.NewMappingTargetType(input["targetType"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var targetValuePtr *valueObject.MappingTargetValue
-	if input["targetValue"] != nil {
-		targetValue, err := valueObject.NewMappingTargetValue(
-			input["targetValue"], targetType,
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		targetValuePtr = &targetValue
-	}
-
-	var targetHttpResponseCodePtr *valueObject.HttpResponseCode
-	if input["targetHttpResponseCode"] != nil {
-		if input["targetHttpResponseCode"] == "" {
-			input["targetHttpResponseCode"] = 301
-		}
-		targetHttpResponseCode, err := valueObject.NewHttpResponseCode(
-			input["targetHttpResponseCode"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		targetHttpResponseCodePtr = &targetHttpResponseCode
-	}
-
-	var shouldUpgradeInsecureRequestsPtr *bool
-	if input["shouldUpgradeInsecureRequests"] != nil {
-		shouldUpgradeInsecureRequests, err := tkVoUtil.InterfaceToBool(
-			input["shouldUpgradeInsecureRequests"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidShouldUpgradeInsecureRequests")
-		}
-		shouldUpgradeInsecureRequestsPtr = &shouldUpgradeInsecureRequests
-	}
-
-	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
-	if input["mappingSecurityRuleId"] != nil && input["mappingSecurityRuleId"] != "" {
-		mappingSecurityRuleId, err := valueObject.NewMappingSecurityRuleId(
-			input["mappingSecurityRuleId"],
-		)
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingSecurityRuleIdPtr = &mappingSecurityRuleId
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateMapping(
-		hostname, path, matchPattern, targetType, targetValuePtr,
-		targetHttpResponseCodePtr, shouldUpgradeInsecureRequestsPtr,
-		mappingSecurityRuleIdPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	servicesQueryRepo := servicesInfra.NewServicesQueryRepo(service.persistentDbSvc)
-
-	err = useCase.CreateMapping(
-		service.vhostQueryRepo, service.mappingCmdRepo, servicesQueryRepo,
-		service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "MappingCreated")
-}
-
-func (service *VirtualHostService) DeleteMapping(
-	input map[string]interface{},
-) ServiceOutput {
-	if input["mappingId"] == nil && input["id"] != nil {
-		input["mappingId"] = input["id"]
-	}
-
-	requiredParams := []string{"mappingId"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	id, err := valueObject.NewMappingId(input["mappingId"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteMapping(id, operatorAccountId, operatorIpAddress)
-	err = useCase.DeleteMapping(
-		service.mappingQueryRepo, service.mappingCmdRepo,
-		service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, "MappingDeleted")
-}
-
-func (service *VirtualHostService) UpdateMapping(input map[string]interface{}) ServiceOutput {
-	requiredParams := []string{"id"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	id, err := valueObject.NewMappingId(input["id"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var pathPtr *valueObject.MappingPath
-	if input["path"] != nil {
-		path, err := valueObject.NewMappingPath(input["path"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		pathPtr = &path
-	}
-
-	var matchPatternPtr *valueObject.MappingMatchPattern
-	if input["matchPattern"] != nil {
-		matchPattern, err := valueObject.NewMappingMatchPattern(input["matchPattern"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		matchPatternPtr = &matchPattern
-	}
-
-	var targetTypePtr *valueObject.MappingTargetType
-	if input["targetType"] != nil {
-		targetType, err := valueObject.NewMappingTargetType(input["targetType"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		targetTypePtr = &targetType
-	}
-
-	var targetValuePtr *valueObject.MappingTargetValue
-	if input["targetValue"] != nil {
-		if targetTypePtr == nil {
-			mappingEntity, err := service.mappingQueryRepo.ReadFirst(
-				dto.ReadMappingsRequest{MappingId: &id},
-			)
-			if err != nil {
-				return NewServiceOutput(InfraError, "ReadMappingEntityToRetrieveTargetTypeError")
-			}
-			targetTypePtr = &mappingEntity.TargetType
-		}
-
-		targetValue, err := valueObject.NewMappingTargetValue(input["targetValue"], *targetTypePtr)
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		targetValuePtr = &targetValue
-	}
-
-	var targetHttpResponseCodePtr *valueObject.HttpResponseCode
-	if input["targetHttpResponseCode"] != nil {
-		targetHttpResponseCode, err := valueObject.NewHttpResponseCode(input["targetHttpResponseCode"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		targetHttpResponseCodePtr = &targetHttpResponseCode
-	}
-
-	var shouldUpgradeInsecureRequestsPtr *bool
-	if input["shouldUpgradeInsecureRequests"] != nil {
-		shouldUpgradeInsecureRequests, err := tkVoUtil.InterfaceToBool(input["shouldUpgradeInsecureRequests"])
-		if err != nil {
-			return NewServiceOutput(UserError, errors.New("InvalidShouldUpgradeInsecureRequests"))
-		}
-		shouldUpgradeInsecureRequestsPtr = &shouldUpgradeInsecureRequests
-	}
-
-	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
-	if input["mappingSecurityRuleId"] != nil && input["mappingSecurityRuleId"] != "" {
-		mappingSecurityRuleId, err := valueObject.NewMappingSecurityRuleId(input["mappingSecurityRuleId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		mappingSecurityRuleIdPtr = &mappingSecurityRuleId
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateMapping(
-		id, pathPtr, matchPatternPtr, targetTypePtr, targetValuePtr,
-		targetHttpResponseCodePtr, shouldUpgradeInsecureRequestsPtr,
-		mappingSecurityRuleIdPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.UpdateMapping(
-		service.mappingQueryRepo, service.mappingCmdRepo,
-		service.activityRecordCmdRepo, updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "MappingUpdated")
-}
-
-func (service *VirtualHostService) MappingSecurityRuleReadRequestFactory(
-	serviceInput map[string]interface{},
-) (readRequestDto dto.ReadMappingSecurityRulesRequest, err error) {
-	var mappingSecurityRuleIdPtr *valueObject.MappingSecurityRuleId
-	if serviceInput["id"] != nil {
-		id, err := valueObject.NewMappingSecurityRuleId(serviceInput["id"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		mappingSecurityRuleIdPtr = &id
-	}
-
-	var mappingSecurityRuleNamePtr *valueObject.MappingSecurityRuleName
-	if serviceInput["name"] != nil {
-		name, err := valueObject.NewMappingSecurityRuleName(serviceInput["name"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		mappingSecurityRuleNamePtr = &name
-	}
-
-	var allowedIpPtr *tkValueObject.CidrBlock
-	if serviceInput["allowedIp"] != nil {
-		allowedIp, err := tkValueObject.NewCidrBlock(serviceInput["allowedIp"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		allowedIpPtr = &allowedIp
-	}
-
-	var blockedIpPtr *tkValueObject.CidrBlock
-	if serviceInput["blockedIp"] != nil {
-		blockedIp, err := tkValueObject.NewCidrBlock(serviceInput["blockedIp"])
-		if err != nil {
-			return readRequestDto, err
-		}
-		blockedIpPtr = &blockedIp
-	}
-
-	timeParamNames := []string{"createdBeforeAt", "createdAfterAt"}
-	timeParamPtrs := serviceHelper.TimeParamsParser(timeParamNames, serviceInput)
-
-	requestPagination, err := serviceHelper.PaginationParser(
-		serviceInput, useCase.MappingSecurityRulesDefaultPagination,
-	)
-	if err != nil {
-		return readRequestDto, err
-	}
-
-	return dto.ReadMappingSecurityRulesRequest{
-		Pagination:              requestPagination,
-		MappingSecurityRuleId:   mappingSecurityRuleIdPtr,
-		MappingSecurityRuleName: mappingSecurityRuleNamePtr,
-		AllowedIp:               allowedIpPtr,
-		BlockedIp:               blockedIpPtr,
-		CreatedBeforeAt:         timeParamPtrs["createdBeforeAt"],
-		CreatedAfterAt:          timeParamPtrs["createdAfterAt"],
-	}, nil
-}
-
-func (service *VirtualHostService) ReadMappingSecurityRules(
-	serviceInput map[string]interface{},
-) ServiceOutput {
-	readRequestDto, err := service.MappingSecurityRuleReadRequestFactory(serviceInput)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	readResponseDto, err := useCase.ReadMappingSecurityRules(
-		service.mappingQueryRepo, readRequestDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, readResponseDto)
-}
-
-func (service *VirtualHostService) CreateMappingSecurityRule(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"name"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	name, err := valueObject.NewMappingSecurityRuleName(input["name"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var descriptionPtr *valueObject.MappingSecurityRuleDescription
-	if input["description"] != nil {
-		description, err := valueObject.NewMappingSecurityRuleDescription(input["description"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		descriptionPtr = &description
-	}
-
-	allowedIps := []tkValueObject.CidrBlock{}
-	if input["allowedIps"] != nil {
-		allowedIpsInput, assertOk := input["allowedIps"].([]tkValueObject.CidrBlock)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidAllowedIps")
-		}
-		allowedIps = allowedIpsInput
-	}
-
-	blockedIps := []tkValueObject.CidrBlock{}
-	if input["blockedIps"] != nil {
-		blockedIpsInput, assertOk := input["blockedIps"].([]tkValueObject.CidrBlock)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidBlockedIps")
-		}
-		blockedIps = blockedIpsInput
-	}
-
-	var rpsSoftLimitPerIpPtr *uint
-	if input["rpsSoftLimitPerIp"] != nil && input["rpsSoftLimitPerIp"] != "" {
-		softLimit, err := tkVoUtil.InterfaceToUint(input["rpsSoftLimitPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidRpsSoftLimitPerIp")
-		}
-		rpsSoftLimitPerIpPtr = &softLimit
-	}
-
-	var rpsHardLimitPerIpPtr *uint
-	if input["rpsHardLimitPerIp"] != nil && input["rpsHardLimitPerIp"] != "" {
-		hardLimit, err := tkVoUtil.InterfaceToUint(input["rpsHardLimitPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidRpsHardLimitPerIp")
-		}
-		rpsHardLimitPerIpPtr = &hardLimit
-	}
-
-	var responseCodeOnMaxRequestsPtr *uint
-	if input["responseCodeOnMaxRequests"] != nil && input["responseCodeOnMaxRequests"] != "" {
-		responseCode, err := tkVoUtil.InterfaceToUint(input["responseCodeOnMaxRequests"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidResponseCodeOnMaxRequests")
-		}
-		responseCodeOnMaxRequestsPtr = &responseCode
-	}
-
-	var maxConnectionsPerIpPtr *uint
-	if input["maxConnectionsPerIp"] != nil && input["maxConnectionsPerIp"] != "" {
-		maxConns, err := tkVoUtil.InterfaceToUint(input["maxConnectionsPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidMaxConnectionsPerIp")
-		}
-		maxConnectionsPerIpPtr = &maxConns
-	}
-
-	var bandwidthBpsLimitPerConnectionPtr *valueObject.Byte
-	if input["bandwidthBpsLimitPerConnection"] != nil && input["bandwidthBpsLimitPerConnection"] != "" {
-		bandwidthBpsLimit, err := valueObject.NewByte(input["bandwidthBpsLimitPerConnection"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidBandwidthBpsLimitPerConnection")
-		}
-		bandwidthBpsLimitPerConnectionPtr = &bandwidthBpsLimit
-	}
-
-	var bandwidthLimitOnlyAfterBytesPtr *valueObject.Byte
-	if input["bandwidthLimitOnlyAfterBytes"] != nil && input["bandwidthLimitOnlyAfterBytes"] != "" {
-		bandwidthLimitOnlyAfterBytes, err := valueObject.NewByte(input["bandwidthLimitOnlyAfterBytes"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidBandwidthLimitOnlyAfterBytes")
-		}
-		bandwidthLimitOnlyAfterBytesPtr = &bandwidthLimitOnlyAfterBytes
-	}
-
-	var responseCodeOnMaxConnectionsPtr *uint
-	if input["responseCodeOnMaxConnections"] != nil && input["responseCodeOnMaxConnections"] != "" {
-		responseCode, err := tkVoUtil.InterfaceToUint(input["responseCodeOnMaxConnections"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidResponseCodeOnMaxConnections")
-		}
-		responseCodeOnMaxConnectionsPtr = &responseCode
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	createDto := dto.NewCreateMappingSecurityRule(
-		name, descriptionPtr, allowedIps, blockedIps, rpsSoftLimitPerIpPtr,
-		rpsHardLimitPerIpPtr, responseCodeOnMaxRequestsPtr, maxConnectionsPerIpPtr,
-		bandwidthBpsLimitPerConnectionPtr, bandwidthLimitOnlyAfterBytesPtr,
-		responseCodeOnMaxConnectionsPtr, operatorAccountId, operatorIpAddress,
-	)
-
-	mappingSecurityRuleId, err := useCase.CreateMappingSecurityRule(
-		service.mappingQueryRepo, service.mappingCmdRepo,
-		service.activityRecordCmdRepo, createDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Created, map[string]interface{}{
-		"id": mappingSecurityRuleId.Uint64(),
-	})
-}
-
-func (service *VirtualHostService) UpdateMappingSecurityRule(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"id"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	id, err := valueObject.NewMappingSecurityRuleId(input["id"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	var namePtr *valueObject.MappingSecurityRuleName
-	if input["name"] != nil {
-		name, err := valueObject.NewMappingSecurityRuleName(input["name"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		namePtr = &name
-	}
-
-	var descriptionPtr *valueObject.MappingSecurityRuleDescription
-	if input["description"] != nil {
-		description, err := valueObject.NewMappingSecurityRuleDescription(input["description"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-		descriptionPtr = &description
-	}
-
-	allowedIps := []tkValueObject.CidrBlock{}
-	if input["allowedIps"] != nil {
-		var assertOk bool
-		allowedIps, assertOk = input["allowedIps"].([]tkValueObject.CidrBlock)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidAllowedIps")
-		}
-	}
-
-	blockedIps := []tkValueObject.CidrBlock{}
-	if input["blockedIps"] != nil {
-		var assertOk bool
-		blockedIps, assertOk = input["blockedIps"].([]tkValueObject.CidrBlock)
-		if !assertOk {
-			return NewServiceOutput(UserError, "InvalidBlockedIps")
-		}
-	}
-
-	var rpsSoftLimitPerIpPtr *uint
-	if input["rpsSoftLimitPerIp"] != nil && input["rpsSoftLimitPerIp"] != "" {
-		softLimit, err := tkVoUtil.InterfaceToUint(input["rpsSoftLimitPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidRpsSoftLimitPerIp")
-		}
-		rpsSoftLimitPerIpPtr = &softLimit
-	}
-
-	var rpsHardLimitPerIpPtr *uint
-	if input["rpsHardLimitPerIp"] != nil && input["rpsHardLimitPerIp"] != "" {
-		hardLimit, err := tkVoUtil.InterfaceToUint(input["rpsHardLimitPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidRpsHardLimitPerIp")
-		}
-		rpsHardLimitPerIpPtr = &hardLimit
-	}
-
-	var responseCodeOnMaxRequestsPtr *uint
-	if input["responseCodeOnMaxRequests"] != nil && input["responseCodeOnMaxRequests"] != "" {
-		responseCode, err := tkVoUtil.InterfaceToUint(input["responseCodeOnMaxRequests"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidResponseCodeOnMaxRequests")
-		}
-		responseCodeOnMaxRequestsPtr = &responseCode
-	}
-
-	var maxConnectionsPerIpPtr *uint
-	if input["maxConnectionsPerIp"] != nil && input["maxConnectionsPerIp"] != "" {
-		maxConns, err := tkVoUtil.InterfaceToUint(input["maxConnectionsPerIp"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidMaxConnectionsPerIp")
-		}
-		maxConnectionsPerIpPtr = &maxConns
-	}
-
-	var bandwidthBpsLimitPerConnectionPtr *valueObject.Byte
-	if input["bandwidthBpsLimitPerConnection"] != nil && input["bandwidthBpsLimitPerConnection"] != "" {
-		bandwidthBpsLimit, err := valueObject.NewByte(input["bandwidthBpsLimitPerConnection"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidBandwidthBpsLimitPerConnection")
-		}
-		bandwidthBpsLimitPerConnectionPtr = &bandwidthBpsLimit
-	}
-
-	var bandwidthLimitOnlyAfterBytesPtr *valueObject.Byte
-	if input["bandwidthLimitOnlyAfterBytes"] != nil && input["bandwidthLimitOnlyAfterBytes"] != "" {
-		bandwidthLimitOnlyAfterBytes, err := valueObject.NewByte(input["bandwidthLimitOnlyAfterBytes"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidBandwidthLimitOnlyAfterBytes")
-		}
-		bandwidthLimitOnlyAfterBytesPtr = &bandwidthLimitOnlyAfterBytes
-	}
-
-	var responseCodeOnMaxConnectionsPtr *uint
-	if input["responseCodeOnMaxConnections"] != nil && input["responseCodeOnMaxConnections"] != "" {
-		responseCode, err := tkVoUtil.InterfaceToUint(input["responseCodeOnMaxConnections"])
-		if err != nil {
-			return NewServiceOutput(UserError, "InvalidResponseCodeOnMaxConnections")
-		}
-		responseCodeOnMaxConnectionsPtr = &responseCode
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	updateDto := dto.NewUpdateMappingSecurityRule(
-		id, namePtr, descriptionPtr, allowedIps, blockedIps,
-		rpsSoftLimitPerIpPtr, rpsHardLimitPerIpPtr, responseCodeOnMaxRequestsPtr,
-		maxConnectionsPerIpPtr, bandwidthBpsLimitPerConnectionPtr,
-		bandwidthLimitOnlyAfterBytesPtr, responseCodeOnMaxConnectionsPtr,
-		operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.UpdateMappingSecurityRule(
-		service.mappingQueryRepo, service.mappingCmdRepo,
-		service.activityRecordCmdRepo, updateDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "MappingSecurityRuleUpdated")
-}
-
-func (service *VirtualHostService) DeleteMappingSecurityRule(
-	input map[string]interface{},
-) ServiceOutput {
-	requiredParams := []string{"id"}
-	err := serviceHelper.RequiredParamsInspector(input, requiredParams)
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	ruleId, err := valueObject.NewMappingSecurityRuleId(input["id"])
-	if err != nil {
-		return NewServiceOutput(UserError, err.Error())
-	}
-
-	operatorAccountId := LocalOperatorAccountId
-	if input["operatorAccountId"] != nil {
-		operatorAccountId, err = valueObject.NewAccountId(input["operatorAccountId"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	operatorIpAddress := LocalOperatorIpAddress
-	if input["operatorIpAddress"] != nil {
-		operatorIpAddress, err = valueObject.NewIpAddress(input["operatorIpAddress"])
-		if err != nil {
-			return NewServiceOutput(UserError, err.Error())
-		}
-	}
-
-	deleteDto := dto.NewDeleteMappingSecurityRule(
-		ruleId, operatorAccountId, operatorIpAddress,
-	)
-
-	err = useCase.DeleteMappingSecurityRule(
-		service.mappingQueryRepo, service.mappingCmdRepo,
-		service.activityRecordCmdRepo, deleteDto,
-	)
-	if err != nil {
-		return NewServiceOutput(InfraError, err.Error())
-	}
-
-	return NewServiceOutput(Success, "MappingSecurityRuleDeleted")
-}

+ 5 - 5
src/presentation/ui/presenter/accounts/presenter.go

@@ -5,13 +5,13 @@ import (
 
 	"github.com/goinfinite/os/src/domain/dto"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	"github.com/labstack/echo/v4"
 )
 
 type AccountsPresenter struct {
-	accountService *service.AccountService
+	accountLiaison *liaison.AccountLiaison
 }
 
 func NewAccountsPresenter(
@@ -19,17 +19,17 @@ func NewAccountsPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *AccountsPresenter {
 	return &AccountsPresenter{
-		accountService: service.NewAccountService(persistentDbSvc, trailDbSvc),
+		accountLiaison: liaison.NewAccountLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
 func (presenter *AccountsPresenter) Handler(c echo.Context) error {
-	responseOutput := presenter.accountService.Read(
+	responseOutput := presenter.accountLiaison.Read(
 		map[string]interface{}{
 			"shouldIncludeSecureAccessPublicKeys": true,
 		},
 	)
-	if responseOutput.Status != service.Success {
+	if responseOutput.Status != liaison.Success {
 		return nil
 	}
 

+ 5 - 5
src/presentation/ui/presenter/crons/presenter.go

@@ -5,26 +5,26 @@ import (
 
 	"github.com/goinfinite/os/src/domain/dto"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	"github.com/labstack/echo/v4"
 )
 
 type CronsPresenter struct {
-	cronService *service.CronService
+	cronLiaison *liaison.CronLiaison
 }
 
 func NewCronsPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *CronsPresenter {
 	return &CronsPresenter{
-		cronService: service.NewCronService(trailDbSvc),
+		cronLiaison: liaison.NewCronLiaison(trailDbSvc),
 	}
 }
 
 func (presenter *CronsPresenter) Handler(c echo.Context) error {
-	responseOutput := presenter.cronService.Read(map[string]interface{}{})
-	if responseOutput.Status != service.Success {
+	responseOutput := presenter.cronLiaison.Read(map[string]interface{}{})
+	if responseOutput.Status != liaison.Success {
 		return nil
 	}
 

+ 5 - 5
src/presentation/ui/presenter/databases/presenter.go

@@ -8,13 +8,13 @@ import (
 	"github.com/goinfinite/os/src/domain/entity"
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	"github.com/labstack/echo/v4"
 )
 
 type DatabasesPresenter struct {
-	databaseService *service.DatabaseService
+	databaseLiaison *liaison.DatabaseLiaison
 }
 
 func NewDatabasesPresenter(
@@ -22,7 +22,7 @@ func NewDatabasesPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *DatabasesPresenter {
 	return &DatabasesPresenter{
-		databaseService: service.NewDatabaseService(persistentDbSvc, trailDbSvc),
+		databaseLiaison: liaison.NewDatabaseLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -44,8 +44,8 @@ func (presenter *DatabasesPresenter) databaseOverviewFactory(
 		"dbType":       databaseType.String(),
 		"itemsPerPage": 1000,
 	}
-	responseOutput := presenter.databaseService.Read(requestBody)
-	if responseOutput.Status != service.Success {
+	responseOutput := presenter.databaseLiaison.Read(requestBody)
+	if responseOutput.Status != liaison.Success {
 		return databaseOverview, err
 	}
 

+ 9 - 9
src/presentation/ui/presenter/footer/footer.go

@@ -7,7 +7,7 @@ import (
 	"github.com/goinfinite/os/src/domain/dto"
 	"github.com/goinfinite/os/src/domain/entity"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	layoutFooter "github.com/goinfinite/os/src/presentation/ui/layout/footer"
 	"github.com/labstack/echo/v4"
 )
@@ -31,21 +31,21 @@ func NewFooterPresenter(
 }
 
 func (presenter *FooterPresenter) Handler(c echo.Context) error {
-	o11yService := service.NewO11yService(presenter.transientDbSvc)
+	o11yLiaison := liaison.NewO11yLiaison(presenter.transientDbSvc)
 
-	o11yServiceOutput := o11yService.ReadOverview()
-	if o11yServiceOutput.Status != service.Success {
+	o11yLiaisonOutput := o11yLiaison.ReadOverview()
+	if o11yLiaisonOutput.Status != liaison.Success {
 		slog.Debug("FooterPresenterReadOverviewFailure")
 		return nil
 	}
 
-	o11yOverviewEntity, assertOk := o11yServiceOutput.Body.(entity.O11yOverview)
+	o11yOverviewEntity, assertOk := o11yLiaisonOutput.Body.(entity.O11yOverview)
 	if !assertOk {
 		slog.Debug("FooterPresenterAssertOverviewFailure")
 		return nil
 	}
 
-	scheduledTaskService := service.NewScheduledTaskService(presenter.persistentDbSvc)
+	scheduledTaskLiaison := liaison.NewScheduledTaskLiaison(presenter.persistentDbSvc)
 
 	scheduledTaskReadRequestBody := map[string]interface{}{
 		"pageNumber":    0,
@@ -53,13 +53,13 @@ func (presenter *FooterPresenter) Handler(c echo.Context) error {
 		"sortBy":        "id",
 		"sortDirection": "desc",
 	}
-	scheduledTaskServiceOutput := scheduledTaskService.Read(scheduledTaskReadRequestBody)
-	if scheduledTaskServiceOutput.Status != service.Success {
+	scheduledTaskLiaisonOutput := scheduledTaskLiaison.Read(scheduledTaskReadRequestBody)
+	if scheduledTaskLiaisonOutput.Status != liaison.Success {
 		slog.Debug("FooterPresenterReadScheduledTaskFailure")
 		return nil
 	}
 
-	tasksResponseDto, assertOk := scheduledTaskServiceOutput.Body.(dto.ReadScheduledTasksResponse)
+	tasksResponseDto, assertOk := scheduledTaskLiaisonOutput.Body.(dto.ReadScheduledTasksResponse)
 	if !assertOk {
 		slog.Debug("FooterPresenterAssertScheduledTaskResponseFailure")
 		return nil

+ 6 - 6
src/presentation/ui/presenter/helper/readVirtualHostHostnames.go

@@ -6,7 +6,7 @@ import (
 	"github.com/goinfinite/os/src/domain/dto"
 	"github.com/goinfinite/os/src/domain/valueObject"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 )
 
 func ReadVirtualHostHostnames(
@@ -14,17 +14,17 @@ func ReadVirtualHostHostnames(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) ([]string, error) {
 	vhostHostnames := []string{}
-	virtualHostService := service.NewVirtualHostService(persistentDbSvc, trailDbSvc)
+	virtualHostLiaison := liaison.NewVirtualHostLiaison(persistentDbSvc, trailDbSvc)
 
-	vhostResponseServiceOutput := virtualHostService.Read(map[string]interface{}{
+	vhostResponseLiaisonOutput := virtualHostLiaison.Read(map[string]interface{}{
 		"itemsPerPage": 1000,
 		"withMappings": false,
 	})
-	if vhostResponseServiceOutput.Status != service.Success {
-		return vhostHostnames, errors.New("ReadVirtualHostServiceBadResponse")
+	if vhostResponseLiaisonOutput.Status != liaison.Success {
+		return vhostHostnames, errors.New("ReadVirtualHostLiaisonBadResponse")
 	}
 
-	vhostReadResponse, assertOk := vhostResponseServiceOutput.Body.(dto.ReadVirtualHostsResponse)
+	vhostReadResponse, assertOk := vhostResponseLiaisonOutput.Body.(dto.ReadVirtualHostsResponse)
 	if !assertOk {
 		return vhostHostnames, errors.New("AssertReadVirtualHostsResponseFailed")
 	}

+ 4 - 4
src/presentation/ui/presenter/helper/shouldEnableInitialSetup.go

@@ -2,12 +2,12 @@ package uiPresenterHelper
 
 import (
 	"github.com/goinfinite/os/src/domain/dto"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 )
 
-func ShouldEnableInitialSetup(accountService *service.AccountService) bool {
-	accountsServiceResponse := accountService.Read(map[string]interface{}{})
-	if accountsServiceResponse.Status != service.Success {
+func ShouldEnableInitialSetup(accountLiaison *liaison.AccountLiaison) bool {
+	accountsServiceResponse := accountLiaison.Read(map[string]interface{}{})
+	if accountsServiceResponse.Status != liaison.Success {
 		return false
 	}
 

+ 4 - 4
src/presentation/ui/presenter/login/login.go

@@ -7,14 +7,14 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	infraEnvs "github.com/goinfinite/os/src/infra/envs"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	layoutLogin "github.com/goinfinite/os/src/presentation/ui/layout/login"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type LoginPresenter struct {
-	accountService *service.AccountService
+	accountLiaison *liaison.AccountLiaison
 }
 
 func NewLoginPresenter(
@@ -22,12 +22,12 @@ func NewLoginPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *LoginPresenter {
 	return &LoginPresenter{
-		accountService: service.NewAccountService(persistentDbSvc, trailDbSvc),
+		accountLiaison: liaison.NewAccountLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
 func (presenter *LoginPresenter) Handler(c echo.Context) error {
-	if presenterHelper.ShouldEnableInitialSetup(presenter.accountService) {
+	if presenterHelper.ShouldEnableInitialSetup(presenter.accountLiaison) {
 		return c.Redirect(http.StatusFound, "/setup/")
 	}
 

+ 16 - 16
src/presentation/ui/presenter/mappings/presenter.go

@@ -7,7 +7,7 @@ import (
 
 	"github.com/goinfinite/os/src/domain/dto"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	componentMappings "github.com/goinfinite/os/src/presentation/ui/component/mappings"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	uiForm "github.com/goinfinite/ui/src/form"
@@ -30,20 +30,20 @@ func NewMappingsPresenter(
 }
 
 func (presenter *MappingsPresenter) readVirtualHostWithMappings() []dto.VirtualHostWithMappings {
-	virtualHostService := service.NewVirtualHostService(
+	virtualHostLiaison := liaison.NewVirtualHostLiaison(
 		presenter.persistentDbSvc, presenter.trailDbSvc,
 	)
-	readVirtualHostsServiceOutput := virtualHostService.ReadWithMappings(map[string]interface{}{
+	readVirtualHostsLiaisonOutput := virtualHostLiaison.ReadWithMappings(map[string]interface{}{
 		"itemsPerPage": 1000,
 	})
-	if readVirtualHostsServiceOutput.Status != service.Success {
-		slog.Debug("ReadMappingsServiceOutputBadStatus")
+	if readVirtualHostsLiaisonOutput.Status != liaison.Success {
+		slog.Debug("ReadMappingsLiaisonOutputBadStatus")
 		return nil
 	}
 
-	readVirtualHostsResponse, assertOk := readVirtualHostsServiceOutput.Body.(dto.ReadVirtualHostsResponse)
+	readVirtualHostsResponse, assertOk := readVirtualHostsLiaisonOutput.Body.(dto.ReadVirtualHostsResponse)
 	if !assertOk {
-		slog.Debug("ReadMappingsServiceOutputBodyAssertionFailed")
+		slog.Debug("ReadMappingsLiaisonOutputBodyAssertionFailed")
 		return nil
 	}
 
@@ -62,13 +62,13 @@ func (presenter *MappingsPresenter) extractVirtualHostHostnames(
 }
 
 func (presenter *MappingsPresenter) readInstalledServiceNames() []string {
-	servicesService := service.NewServicesService(
+	servicesLiaison := liaison.NewServicesLiaison(
 		presenter.persistentDbSvc, presenter.trailDbSvc,
 	)
-	installedServicesResponseOutput := servicesService.ReadInstalledItems(
+	installedServicesResponseOutput := servicesLiaison.ReadInstalledItems(
 		map[string]interface{}{"itemsPerPage": 1000},
 	)
-	if installedServicesResponseOutput.Status != service.Success {
+	if installedServicesResponseOutput.Status != liaison.Success {
 		slog.Debug("ReadInstalledItemsFailed", slog.Any("output", installedServicesResponseOutput))
 		return nil
 	}
@@ -92,21 +92,21 @@ func (presenter *MappingsPresenter) readInstalledServiceNames() []string {
 }
 
 func (presenter *MappingsPresenter) readSecRulesLabelValueOptions() []uiForm.SelectLabelValueOption {
-	virtualHostService := service.NewVirtualHostService(
+	virtualHostLiaison := liaison.NewVirtualHostLiaison(
 		presenter.persistentDbSvc, presenter.trailDbSvc,
 	)
-	readSecRulesServiceOutput := virtualHostService.ReadMappingSecurityRules(map[string]interface{}{
+	readSecRulesLiaisonOutput := virtualHostLiaison.ReadMappingSecurityRules(map[string]interface{}{
 		"itemsPerPage": 1000,
 	})
 
-	if readSecRulesServiceOutput.Status != service.Success {
-		slog.Debug("ReadSecRulesServiceOutputBadStatus")
+	if readSecRulesLiaisonOutput.Status != liaison.Success {
+		slog.Debug("ReadSecRulesLiaisonOutputBadStatus")
 		return nil
 	}
 
-	readSecRulesResponse, assertOk := readSecRulesServiceOutput.Body.(dto.ReadMappingSecurityRulesResponse)
+	readSecRulesResponse, assertOk := readSecRulesLiaisonOutput.Body.(dto.ReadMappingSecurityRulesResponse)
 	if !assertOk {
-		slog.Debug("ReadSecRulesServiceOutputBodyAssertionFailed")
+		slog.Debug("ReadSecRulesLiaisonOutputBodyAssertionFailed")
 		return nil
 	}
 

+ 5 - 5
src/presentation/ui/presenter/mappings/securityRulesPresenter.go

@@ -6,13 +6,13 @@ import (
 
 	"github.com/goinfinite/os/src/domain/dto"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	"github.com/labstack/echo/v4"
 )
 
 type MappingSecurityRulesPresenter struct {
-	virtualHostService *service.VirtualHostService
+	virtualHostLiaison *liaison.VirtualHostLiaison
 }
 
 func NewMappingSecurityRulesPresenter(
@@ -20,7 +20,7 @@ func NewMappingSecurityRulesPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *MappingSecurityRulesPresenter {
 	return &MappingSecurityRulesPresenter{
-		virtualHostService: service.NewVirtualHostService(persistentDbSvc, trailDbSvc),
+		virtualHostLiaison: liaison.NewVirtualHostLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -29,8 +29,8 @@ func (presenter *MappingSecurityRulesPresenter) Handler(c echo.Context) error {
 		"itemsPerPage": 1000,
 	}
 
-	secRulesServiceResponse := presenter.virtualHostService.ReadMappingSecurityRules(requestBody)
-	if secRulesServiceResponse.Status != service.Success {
+	secRulesServiceResponse := presenter.virtualHostLiaison.ReadMappingSecurityRules(requestBody)
+	if secRulesServiceResponse.Status != liaison.Success {
 		slog.Debug("SecRulesServiceBadOutput", slog.Any("output", secRulesServiceResponse))
 		return nil
 	}

+ 7 - 7
src/presentation/ui/presenter/marketplace/presenter.go

@@ -8,14 +8,14 @@ import (
 	"github.com/goinfinite/os/src/domain/dto"
 	"github.com/goinfinite/os/src/domain/entity"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type MarketplacePresenter struct {
-	marketplaceService *service.MarketplaceService
+	marketplaceLiaison *liaison.MarketplaceLiaison
 	persistentDbSvc    *internalDbInfra.PersistentDatabaseService
 	trailDbSvc         *internalDbInfra.TrailDatabaseService
 }
@@ -25,7 +25,7 @@ func NewMarketplacePresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *MarketplacePresenter {
 	return &MarketplacePresenter{
-		marketplaceService: service.NewMarketplaceService(persistentDbSvc, trailDbSvc),
+		marketplaceLiaison: liaison.NewMarketplaceLiaison(persistentDbSvc, trailDbSvc),
 		persistentDbSvc:    persistentDbSvc,
 		trailDbSvc:         trailDbSvc,
 	}
@@ -60,10 +60,10 @@ func (presenter *MarketplacePresenter) MarketplaceOverviewFactory(listType strin
 ) {
 	installedItemsList := []entity.MarketplaceInstalledItem{}
 	if listType == "installed" || listType == "all" {
-		responseOutput := presenter.marketplaceService.ReadInstalledItems(
+		responseOutput := presenter.marketplaceLiaison.ReadInstalledItems(
 			map[string]interface{}{},
 		)
-		if responseOutput.Status != service.Success {
+		if responseOutput.Status != liaison.Success {
 			return overview, errors.New("FailedToReadInstalledItems")
 		}
 
@@ -76,10 +76,10 @@ func (presenter *MarketplacePresenter) MarketplaceOverviewFactory(listType strin
 
 	catalogItemsList := []entity.MarketplaceCatalogItem{}
 	if listType == "catalog" || listType == "all" {
-		responseOutput := presenter.marketplaceService.ReadCatalog(
+		responseOutput := presenter.marketplaceLiaison.ReadCatalog(
 			map[string]interface{}{},
 		)
-		if responseOutput.Status != service.Success {
+		if responseOutput.Status != liaison.Success {
 			return overview, errors.New("FailedToReadCatalogItems")
 		}
 

+ 1 - 1
src/presentation/ui/presenter/overview/index.templ

@@ -632,7 +632,7 @@ templ InstallableServiceForm(
 			<div class="bg-os-400 flex w-full justify-center rounded-lg p-4">
 				<div x-show="selectedInstallableServiceType === 'runtime'">
 					@componentMisc.MultiItemCarousel(
-						"installableRuntimeServicesCarousel",
+						"installableRuntimeLiaisonsCarousel",
 						transformInstallableServicesIntoCarouselItems(installableServices.Runtime),
 						7,
 					)

+ 7 - 7
src/presentation/ui/presenter/overview/presenter.go

@@ -12,7 +12,7 @@ import (
 	voHelper "github.com/goinfinite/os/src/domain/valueObject/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
 	o11yInfra "github.com/goinfinite/os/src/infra/o11y"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	presenterMarketplace "github.com/goinfinite/os/src/presentation/ui/presenter/marketplace"
@@ -24,7 +24,7 @@ type OverviewPresenter struct {
 	transientDbSvc       *internalDbInfra.TransientDatabaseService
 	trailDbSvc           *internalDbInfra.TrailDatabaseService
 	marketplacePresenter *presenterMarketplace.MarketplacePresenter
-	servicesService      *service.ServicesService
+	servicesLiaison      *liaison.ServicesLiaison
 }
 
 func NewOverviewPresenter(
@@ -37,7 +37,7 @@ func NewOverviewPresenter(
 		transientDbSvc:       transientDbSvc,
 		trailDbSvc:           trailDbSvc,
 		marketplacePresenter: presenterMarketplace.NewMarketplacePresenter(persistentDbSvc, trailDbSvc),
-		servicesService:      service.NewServicesService(persistentDbSvc, trailDbSvc),
+		servicesLiaison:      liaison.NewServicesLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
@@ -116,10 +116,10 @@ func (presenter *OverviewPresenter) readInstalledServices(c echo.Context) (
 		readInstalledServicesRequestBody["status"] = statusQueryParam
 	}
 
-	installedItemsResponseOutput := presenter.servicesService.ReadInstalledItems(
+	installedItemsResponseOutput := presenter.servicesLiaison.ReadInstalledItems(
 		readInstalledServicesRequestBody,
 	)
-	if installedItemsResponseOutput.Status != service.Success {
+	if installedItemsResponseOutput.Status != liaison.Success {
 		return responseDto, errors.New("FailedToReadInstalledServices")
 	}
 
@@ -139,10 +139,10 @@ func (presenter *OverviewPresenter) servicesOverviewFactory(c echo.Context) (
 		return overview, err
 	}
 
-	installableItemsResponseOutput := presenter.servicesService.ReadInstallableItems(
+	installableItemsResponseOutput := presenter.servicesLiaison.ReadInstallableItems(
 		map[string]interface{}{},
 	)
-	if installableItemsResponseOutput.Status != service.Success {
+	if installableItemsResponseOutput.Status != liaison.Success {
 		return overview, errors.New("FailedToReadInstallableServices")
 	}
 

+ 5 - 5
src/presentation/ui/presenter/runtimes/presenter.go

@@ -8,14 +8,14 @@ import (
 	"github.com/goinfinite/os/src/domain/valueObject"
 	infraHelper "github.com/goinfinite/os/src/infra/helper"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type RuntimesPresenter struct {
-	runtimeService  *service.RuntimeService
+	runtimeLiaison  *liaison.RuntimeLiaison
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 	trailDbSvc      *internalDbInfra.TrailDatabaseService
 }
@@ -25,7 +25,7 @@ func NewRuntimesPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *RuntimesPresenter {
 	return &RuntimesPresenter{
-		runtimeService:  service.NewRuntimeService(persistentDbSvc, trailDbSvc),
+		runtimeLiaison:  liaison.NewRuntimeLiaison(persistentDbSvc, trailDbSvc),
 		persistentDbSvc: persistentDbSvc,
 		trailDbSvc:      trailDbSvc,
 	}
@@ -41,11 +41,11 @@ func (presenter *RuntimesPresenter) runtimeOverviewFactory(
 	var phpConfigsPtr *entity.PhpConfigs
 	if runtimeType.String() == "php" {
 		requestBody := map[string]interface{}{"hostname": selectedVhostHostname.String()}
-		responseOutput := presenter.runtimeService.ReadPhpConfigs(requestBody)
+		responseOutput := presenter.runtimeLiaison.ReadPhpConfigs(requestBody)
 
 		isInstalled = true
 		isVirtualHostUsingRuntime = true
-		if responseOutput.Status != service.Success {
+		if responseOutput.Status != liaison.Success {
 			isVirtualHostUsingRuntime = false
 			responseOutputBodyStr, assertOk := responseOutput.Body.(string)
 			if assertOk {

+ 4 - 4
src/presentation/ui/presenter/setup/setup.go

@@ -4,14 +4,14 @@ import (
 	"net/http"
 
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	layoutSetup "github.com/goinfinite/os/src/presentation/ui/layout/setup"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type SetupPresenter struct {
-	accountService *service.AccountService
+	accountLiaison *liaison.AccountLiaison
 }
 
 func NewSetupPresenter(
@@ -19,12 +19,12 @@ func NewSetupPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *SetupPresenter {
 	return &SetupPresenter{
-		accountService: service.NewAccountService(persistentDbSvc, trailDbSvc),
+		accountLiaison: liaison.NewAccountLiaison(persistentDbSvc, trailDbSvc),
 	}
 }
 
 func (presenter *SetupPresenter) Handler(c echo.Context) error {
-	if !presenterHelper.ShouldEnableInitialSetup(presenter.accountService) {
+	if !presenterHelper.ShouldEnableInitialSetup(presenter.accountLiaison) {
 		return c.Redirect(http.StatusFound, "/login/")
 	}
 

+ 6 - 6
src/presentation/ui/presenter/ssls/presenter.go

@@ -6,14 +6,14 @@ import (
 
 	"github.com/goinfinite/os/src/domain/dto"
 	internalDbInfra "github.com/goinfinite/os/src/infra/internalDatabase"
-	"github.com/goinfinite/os/src/presentation/service"
+	"github.com/goinfinite/os/src/presentation/liaison"
 	uiLayout "github.com/goinfinite/os/src/presentation/ui/layout"
 	presenterHelper "github.com/goinfinite/os/src/presentation/ui/presenter/helper"
 	"github.com/labstack/echo/v4"
 )
 
 type SslsPresenter struct {
-	sslService      *service.SslService
+	sslLiaison      *liaison.SslLiaison
 	persistentDbSvc *internalDbInfra.PersistentDatabaseService
 	trailDbSvc      *internalDbInfra.TrailDatabaseService
 }
@@ -24,22 +24,22 @@ func NewSslsPresenter(
 	trailDbSvc *internalDbInfra.TrailDatabaseService,
 ) *SslsPresenter {
 	return &SslsPresenter{
-		sslService:      service.NewSslService(persistentDbSvc, transientDbSvc, trailDbSvc),
+		sslLiaison:      liaison.NewSslLiaison(persistentDbSvc, transientDbSvc, trailDbSvc),
 		persistentDbSvc: persistentDbSvc,
 		trailDbSvc:      trailDbSvc,
 	}
 }
 
 func (presenter *SslsPresenter) Handler(c echo.Context) error {
-	sslPairsReadResponseServiceOutput := presenter.sslService.Read(map[string]interface{}{
+	sslPairsReadResponseLiaisonOutput := presenter.sslLiaison.Read(map[string]interface{}{
 		"itemsPerPage": 1000,
 	})
-	if sslPairsReadResponseServiceOutput.Status != service.Success {
+	if sslPairsReadResponseLiaisonOutput.Status != liaison.Success {
 		slog.Debug("SslPairsServiceBadOutput")
 		return nil
 	}
 
-	sslPairsReadResponse, assertOk := sslPairsReadResponseServiceOutput.Body.(dto.ReadSslPairsResponse)
+	sslPairsReadResponse, assertOk := sslPairsReadResponseLiaisonOutput.Body.(dto.ReadSslPairsResponse)
 	if !assertOk {
 		slog.Debug("ReadSslPairsResponseAssertionError")
 		return nil