From 4622cad5dfef151deae07f49db6fb6ef550b7728 Mon Sep 17 00:00:00 2001
From: Alex Petraky <petraky@perx.ru>
Date: Thu, 14 Nov 2024 14:11:08 +0000
Subject: [PATCH] =?UTF-8?q?refactor:=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8?=
 =?UTF-8?q?=D0=B5=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE?=
 =?UTF-8?q?=D0=B2=20=D0=B2=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5?=
 =?UTF-8?q?=D0=B9=D1=81=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=B8=D1=81=D0=BF?=
 =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?=
 =?UTF-8?q?=D0=B2=20=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8?=
 =?UTF-8?q?=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=BE=D0=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 assets/templates/middleware/telemetry_content |   4 +-
 assets/templates/middleware/telemetry_default |   4 +-
 images/middleware/telemetry_middleware.go     |   4 +-
 logs/middleware/telemetry_middleware.go       |   8 +-
 .../middleware/telemetry_middleware.go        |  16 +--
 .../middleware/telemetry_middleware.go        |  12 +-
 .../middleware/access_logging_middleware.go   |  42 +++---
 .../middleware/caching_middleware.go          |  48 +++----
 .../middleware/logging_middleware.go          |  36 ++---
 .../middleware/recovering_middleware.go       |  22 +--
 .../middleware/telemetry_middleware.go        |  96 ++++++-------
 .../mocks/CollectionCreatedObserver.go        |   6 +-
 .../mocks/CollectionDeletedObserver.go        |   6 +-
 .../mocks/CollectionPreSetSchemaObserver.go   |  58 ++++++++
 .../mocks/CollectionPreUpdateObserver.go      |   6 +-
 .../mocks/CollectionSetSchemaObserver.go      |   6 +-
 .../mocks/CollectionUpdatedObserver.go        |   6 +-
 pkg/collections/mocks/Collections.go          |  78 ++++++----
 pkg/collections/mocks/Middleware.go           |   6 +-
 pkg/collections/mocks/Storage.go              |  30 +++-
 pkg/collections/mocks/spaceGetter.go          |  42 ++++++
 pkg/collections/service.go                    |  12 +-
 .../middleware/telemetry_middleware.go        |  18 +--
 .../middleware/access_logging_middleware.go   |  30 ++--
 .../middleware/caching_middleware.go          |  54 +++----
 .../middleware/error_logging_middleware.go    |  20 +--
 .../middleware/logging_middleware.go          |  32 ++---
 .../middleware/recovering_middleware.go       |  20 +--
 .../middleware/telemetry_middleware.go        |  48 +++----
 .../mocks/EnvironmentConfigurationObserver.go |   6 +-
 .../mocks/EnvironmentCreatedObserver.go       |   6 +-
 .../mocks/EnvironmentDeletedObserver.go       |   6 +-
 .../mocks/EnvironmentMigratedObserver.go      |   6 +-
 .../mocks/EnvironmentUpdatedObserver.go       |   6 +-
 pkg/environments/mocks/Environments.go        |  78 +++++++---
 pkg/environments/mocks/Middleware.go          |   6 +-
 pkg/environments/mocks/Storage.go             |  34 ++++-
 pkg/environments/mocks/spaceGetter.go         |  42 ++++++
 pkg/environments/service.go                   |  10 +-
 .../middleware/telemetry_middleware.go        |  18 +--
 pkg/files/middleware/telemetry_middleware.go  |  16 +--
 .../middleware/telemetry_middleware.go        |  12 +-
 .../middleware/access_logging_middleware.go   |  24 ++--
 pkg/items/middleware/caching_middleware.go    |  12 +-
 .../middleware/client_encode_middleware.go    |  16 +--
 pkg/items/middleware/logging_middleware.go    |  26 ++--
 pkg/items/middleware/recovering_middleware.go |  16 +--
 pkg/items/middleware/telemetry_middleware.go  |  62 ++++----
 pkg/items/mocks/Decoder.go                    |   6 +-
 pkg/items/mocks/Encoder.go                    |  12 +-
 pkg/items/mocks/Items.go                      |  50 +++----
 pkg/items/mocks/Middleware.go                 |   2 +-
 pkg/items/mocks/Storage.go                    |   2 +-
 pkg/items/mocks/spaceGetter.go                |  42 ++++++
 pkg/items/service.go                          |   8 +-
 .../middleware/access_logging_middleware.go   |   6 +-
 pkg/locales/middleware/caching_middleware.go  |   4 +-
 .../middleware/error_logging_middleware.go    |   4 +-
 pkg/locales/middleware/logging_middleware.go  |   8 +-
 .../middleware/recovering_middleware.go       |   4 +-
 .../middleware/telemetry_middleware.go        |  20 +--
 pkg/locales/mocks/LocaleCreatedObserver.go    |  57 ++++++++
 pkg/locales/mocks/LocaleDeletedObserver.go    |  57 ++++++++
 pkg/locales/mocks/LocaleUpdatedObserver.go    |  57 ++++++++
 pkg/locales/mocks/Locales.go                  |  10 +-
 pkg/locales/mocks/Middleware.go               |  15 +-
 pkg/locales/mocks/Storage.go                  |   2 +-
 pkg/locales/mocks/spaceGetter.go              |  42 ++++++
 pkg/locales/service.go                        |   2 +-
 .../middleware/telemetry_middleware.go        |  14 +-
 .../middleware/access_logging_middleware.go   |  12 +-
 .../middleware/caching_middleware.go          |  14 +-
 .../middleware/error_logging_middleware.go    |   8 +-
 .../middleware/logging_middleware.go          |  14 +-
 .../middleware/recovering_middleware.go       |   8 +-
 .../middleware/telemetry_middleware.go        |  28 ++--
 pkg/organizations/mocks/Middleware.go         |  15 +-
 pkg/organizations/mocks/Organizations.go      |  66 ++++++---
 pkg/organizations/mocks/Storage.go            |  59 ++++++--
 pkg/organizations/mocks/spaceGetter.go        |  42 ++++++
 pkg/organizations/service.go                  |   4 +-
 .../middleware/telemetry_middleware.go        |   6 +-
 .../middleware/access_logging_middleware.go   |  12 +-
 pkg/roles/middleware/caching_middleware.go    |  12 +-
 .../middleware/error_logging_middleware.go    |   8 +-
 pkg/roles/middleware/logging_middleware.go    |  14 +-
 pkg/roles/middleware/recovering_middleware.go |   8 +-
 pkg/roles/middleware/telemetry_middleware.go  |  24 ++--
 pkg/roles/mocks/Middleware.go                 |   6 +-
 pkg/roles/mocks/Roles.go                      |  42 ++++--
 pkg/roles/mocks/Storage.go                    |  22 ++-
 pkg/roles/mocks/spaceGetter.go                |  42 ++++++
 pkg/roles/service.go                          |   4 +-
 .../middleware/access_logging_middleware.go   |  42 +++---
 pkg/spaces/middleware/caching_middleware.go   |  56 ++++----
 .../middleware/error_logging_middleware.go    |  28 ++--
 pkg/spaces/middleware/logging_middleware.go   |  50 +++----
 .../middleware/recovering_middleware.go       |  28 ++--
 pkg/spaces/middleware/telemetry_middleware.go | 133 +++++++++++-------
 pkg/spaces/mocks/Middleware.go                |  15 +-
 pkg/spaces/mocks/Spaces.go                    |  62 ++++----
 pkg/spaces/mocks/Storage.go                   |   2 +-
 pkg/spaces/mocks/spaceGetter.go               |  42 ++++++
 pkg/spaces/service.go                         |  14 +-
 .../middleware/access_logging_middleware.go   |  28 ++--
 pkg/users/middleware/caching_middleware.go    |  12 +-
 .../middleware/error_logging_middleware.go    |  16 +--
 pkg/users/middleware/logging_middleware.go    |  16 +--
 pkg/users/middleware/recovering_middleware.go |  16 +--
 pkg/users/middleware/telemetry_middleware.go  |  52 +++----
 pkg/users/mocks/Middleware.go                 |   6 +-
 pkg/users/mocks/Storage.go                    |  26 +++-
 pkg/users/mocks/Users.go                      |  66 ++++++---
 pkg/users/mocks/spaceGetter.go                |  42 ++++++
 pkg/users/service.go                          |   8 +-
 115 files changed, 1880 insertions(+), 946 deletions(-)
 create mode 100644 pkg/collections/mocks/CollectionPreSetSchemaObserver.go
 create mode 100644 pkg/collections/mocks/spaceGetter.go
 create mode 100644 pkg/environments/mocks/spaceGetter.go
 create mode 100644 pkg/items/mocks/spaceGetter.go
 create mode 100644 pkg/locales/mocks/LocaleCreatedObserver.go
 create mode 100644 pkg/locales/mocks/LocaleDeletedObserver.go
 create mode 100644 pkg/locales/mocks/LocaleUpdatedObserver.go
 create mode 100644 pkg/locales/mocks/spaceGetter.go
 create mode 100644 pkg/organizations/mocks/spaceGetter.go
 create mode 100644 pkg/roles/mocks/spaceGetter.go
 create mode 100644 pkg/spaces/mocks/spaceGetter.go
 create mode 100644 pkg/users/mocks/spaceGetter.go

diff --git a/assets/templates/middleware/telemetry_content b/assets/templates/middleware/telemetry_content
index 7adcd36c..ba993954 100644
--- a/assets/templates/middleware/telemetry_content
+++ b/assets/templates/middleware/telemetry_content
@@ -5,7 +5,7 @@ import (
     "git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
     "go.opentelemetry.io/otel"
     "go.opentelemetry.io/otel/attribute"
-    oid "git.perx.ru/perxis/perxis-go/id"
+    pkgId "git.perx.ru/perxis/perxis-go/id"
     otelmetric "go.opentelemetry.io/otel/metric"
     "go.opentelemetry.io/otel/trace"
 )
@@ -98,7 +98,7 @@ func (_d {{$decorator}}) {{$method.Declaration}} {
     if spID != "" {
         att = append(att, attribute.String("spaceID", spID))
     }
-    caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+    caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
     if caller != nil {
         att = append(att, attribute.String("caller", caller.String()))
     }
diff --git a/assets/templates/middleware/telemetry_default b/assets/templates/middleware/telemetry_default
index 6616504f..1e67da29 100644
--- a/assets/templates/middleware/telemetry_default
+++ b/assets/templates/middleware/telemetry_default
@@ -5,7 +5,7 @@ import (
     "git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
     "go.opentelemetry.io/otel"
     "go.opentelemetry.io/otel/attribute"
-    oid "git.perx.ru/perxis/perxis-go/id"
+    pkgId "git.perx.ru/perxis/perxis-go/id"
     otelmetric "go.opentelemetry.io/otel/metric"
     "go.opentelemetry.io/otel/trace"
 )
@@ -63,7 +63,7 @@ func (_d {{$decorator}}) {{$method.Declaration}} {
 
   _d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-  caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+  caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
   if caller != nil {
     att = append(att, attribute.String("caller", caller.String()))
   }
diff --git a/images/middleware/telemetry_middleware.go b/images/middleware/telemetry_middleware.go
index 36d09a32..8eafa029 100644
--- a/images/middleware/telemetry_middleware.go
+++ b/images/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/images"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/files"
@@ -69,7 +69,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, source *files.File, opts
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/logs/middleware/telemetry_middleware.go b/logs/middleware/telemetry_middleware.go
index 37313863..c85083ee 100644
--- a/logs/middleware/telemetry_middleware.go
+++ b/logs/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/logs"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
@@ -69,7 +69,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, filter *logs.Filter) (
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -108,7 +108,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *logs.Filter, opt
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -149,7 +149,7 @@ func (_d telemetryMiddleware) Log(ctx context.Context, entries []*logs.Entry) (e
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/clients/middleware/telemetry_middleware.go b/pkg/clients/middleware/telemetry_middleware.go
index cbb21715..8925db9d 100644
--- a/pkg/clients/middleware/telemetry_middleware.go
+++ b/pkg/clients/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/clients"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -84,7 +84,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, client *clients.Client
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -129,7 +129,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, id str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -174,7 +174,7 @@ func (_d telemetryMiddleware) Enable(ctx context.Context, spaceId string, id str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -220,7 +220,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, id string
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -266,7 +266,7 @@ func (_d telemetryMiddleware) GetBy(ctx context.Context, spaceId string, params
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -312,7 +312,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string) (clients
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -368,7 +368,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, client *clients.Client
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/collaborators/middleware/telemetry_middleware.go b/pkg/collaborators/middleware/telemetry_middleware.go
index d4a6f56c..1e53c7e1 100644
--- a/pkg/collaborators/middleware/telemetry_middleware.go
+++ b/pkg/collaborators/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/collaborators"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -73,7 +73,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, subject s
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -119,7 +119,7 @@ func (_d telemetryMiddleware) ListCollaborators(ctx context.Context, spaceId str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -175,7 +175,7 @@ func (_d telemetryMiddleware) ListSpaces(ctx context.Context, subject string) (s
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -220,7 +220,7 @@ func (_d telemetryMiddleware) Remove(ctx context.Context, spaceId string, subjec
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -265,7 +265,7 @@ func (_d telemetryMiddleware) Set(ctx context.Context, spaceId string, subject s
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/collections/middleware/access_logging_middleware.go b/pkg/collections/middleware/access_logging_middleware.go
index 3624955b..0356fb8f 100644
--- a/pkg/collections/middleware/access_logging_middleware.go
+++ b/pkg/collections/middleware/access_logging_middleware.go
@@ -32,15 +32,15 @@ func AccessLoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *accessLoggingMiddleware) Create(ctx context.Context, collection *collections.Collection) (created *collections.Collection, err error) {
+func (m *accessLoggingMiddleware) Create(ctx context.Context, coll *collections.Collection) (created *collections.Collection, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Create.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("collection", collection),
+		zap.Reflect("coll", coll),
 	)
 
-	created, err = m.next.Create(ctx, collection)
+	created, err = m.next.Create(ctx, coll)
 
 	m.logger.Debug("Create.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -51,17 +51,17 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, collection *collec
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, envId string, collectionId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, envId string, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
-		zap.Reflect("collectionId", collectionId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, spaceId, envId, collectionId)
+	err = m.next.Delete(ctx, spaceId, envId, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -71,29 +71,29 @@ func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, en
 	return err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (collection *collections.Collection, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, id string, options ...*collections.GetOptions) (coll *collections.Collection, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
-		zap.Reflect("collectionId", collectionId),
+		zap.Reflect("id", id),
 		zap.Reflect("options", options),
 	)
 
-	collection, err = m.next.Get(ctx, spaceId, envId, collectionId, options...)
+	coll, err = m.next.Get(ctx, spaceId, envId, id, options...)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
-		zap.Reflect("collection", collection),
+		zap.Reflect("coll", coll),
 		zap.Error(err),
 	)
 
-	return collection, err
+	return coll, err
 }
 
-func (m *accessLoggingMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (collections []*collections.Collection, err error) {
+func (m *accessLoggingMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (colls []*collections.Collection, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("List.Request",
@@ -103,29 +103,29 @@ func (m *accessLoggingMiddleware) List(ctx context.Context, spaceId string, envI
 		zap.Reflect("filter", filter),
 	)
 
-	collections, err = m.next.List(ctx, spaceId, envId, filter)
+	colls, err = m.next.List(ctx, spaceId, envId, filter)
 
 	m.logger.Debug("List.Response",
 		zap.Duration("time", time.Since(begin)),
-		zap.Reflect("collections", collections),
+		zap.Reflect("colls", colls),
 		zap.Error(err),
 	)
 
-	return collections, err
+	return colls, err
 }
 
-func (m *accessLoggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, schema *schema.Schema) (err error) {
+func (m *accessLoggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, id string, schema *schema.Schema) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("SetSchema.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
-		zap.Reflect("collectionId", collectionId),
+		zap.Reflect("id", id),
 		zap.Reflect("schema", schema),
 	)
 
-	err = m.next.SetSchema(ctx, spaceId, envId, collectionId, schema)
+	err = m.next.SetSchema(ctx, spaceId, envId, id, schema)
 
 	m.logger.Debug("SetSchema.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -135,18 +135,18 @@ func (m *accessLoggingMiddleware) SetSchema(ctx context.Context, spaceId string,
 	return err
 }
 
-func (m *accessLoggingMiddleware) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) (err error) {
+func (m *accessLoggingMiddleware) SetState(ctx context.Context, spaceId string, envId string, id string, state *collections.StateInfo) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("SetState.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
-		zap.Reflect("collectionId", collectionId),
+		zap.Reflect("id", id),
 		zap.Reflect("state", state),
 	)
 
-	err = m.next.SetState(ctx, spaceId, envId, collectionId, state)
+	err = m.next.SetState(ctx, spaceId, envId, id, state)
 
 	m.logger.Debug("SetState.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/collections/middleware/caching_middleware.go b/pkg/collections/middleware/caching_middleware.go
index cb95d0d9..316121a3 100644
--- a/pkg/collections/middleware/caching_middleware.go
+++ b/pkg/collections/middleware/caching_middleware.go
@@ -35,18 +35,18 @@ type cachingMiddleware struct {
 	envs  envService.Environments
 }
 
-func (m cachingMiddleware) Create(ctx context.Context, collection *service.Collection) (coll *service.Collection, err error) {
-	return m.next.Create(ctx, collection)
+func (m cachingMiddleware) Create(ctx context.Context, coll *service.Collection) (created *service.Collection, err error) {
+	return m.next.Create(ctx, coll)
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*service.GetOptions) (coll *service.Collection, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, spaceId string, envId string, id string, options ...*service.GetOptions) (coll *service.Collection, err error) {
 
 	opts := service.MergeGetOptions(options...)
-	value, e := m.cache.Get(makeKey(spaceId, envId, collectionId, opts.DisableSchemaIncludes))
+	value, e := m.cache.Get(makeKey(spaceId, envId, id, opts.DisableSchemaIncludes))
 	if e == nil {
 		return value.(*service.Collection).Clone(), nil
 	}
-	coll, err = m.next.Get(ctx, spaceId, envId, collectionId, options...)
+	coll, err = m.next.Get(ctx, spaceId, envId, id, options...)
 	if err == nil {
 		env, err := m.envs.Get(ctx, coll.SpaceID, coll.EnvID)
 		if err != nil {
@@ -61,7 +61,7 @@ func (m cachingMiddleware) Get(ctx context.Context, spaceId string, envId string
 	return nil, err
 }
 
-func (m cachingMiddleware) List(ctx context.Context, spaceId, envId string, filter *service.Filter) (collections []*service.Collection, err error) {
+func (m cachingMiddleware) List(ctx context.Context, spaceId, envId string, filter *service.Filter) (colls []*service.Collection, err error) {
 	return m.next.List(ctx, spaceId, envId, filter)
 }
 
@@ -83,53 +83,53 @@ func (m cachingMiddleware) Update(ctx context.Context, coll *service.Collection)
 	return err
 }
 
-func (m cachingMiddleware) SetSchema(ctx context.Context, spaceId, envId, collectionId string, schema *schema.Schema) (err error) {
-	err = m.next.SetSchema(ctx, spaceId, envId, collectionId, schema)
+func (m cachingMiddleware) SetSchema(ctx context.Context, spaceId, envId, id string, schema *schema.Schema) (err error) {
+	err = m.next.SetSchema(ctx, spaceId, envId, id, schema)
 	if err == nil {
 		env, err := m.envs.Get(ctx, spaceId, envId)
 		if err != nil {
 			return err
 		}
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, true))
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, false))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, true))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, false))
 		for _, al := range env.Aliases {
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, true))
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, false))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, true))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, false))
 		}
 	}
 	return err
 }
 
-func (m cachingMiddleware) SetState(ctx context.Context, spaceId, envId, collectionId string, state *service.StateInfo) (err error) {
-	err = m.next.SetState(ctx, spaceId, envId, collectionId, state)
+func (m cachingMiddleware) SetState(ctx context.Context, spaceId, envId, id string, state *service.StateInfo) (err error) {
+	err = m.next.SetState(ctx, spaceId, envId, id, state)
 	if err == nil {
 		env, err := m.envs.Get(ctx, spaceId, envId)
 		if err != nil {
 			return err
 		}
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, true))
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, false))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, true))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, false))
 		for _, al := range env.Aliases {
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, true))
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, false))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, true))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, false))
 		}
 	}
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, envId string, collectionId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, envId string, id string) (err error) {
 
-	err = m.next.Delete(ctx, spaceId, envId, collectionId)
+	err = m.next.Delete(ctx, spaceId, envId, id)
 	if err == nil {
 		env, err := m.envs.Get(ctx, spaceId, envId)
 		if err != nil {
 			return err
 		}
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, true))
-		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, collectionId, false))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, true))
+		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID, id, false))
 		for _, al := range env.Aliases {
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, true))
-			_ = m.cache.Remove(makeKey(env.SpaceID, al, collectionId, false))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, true))
+			_ = m.cache.Remove(makeKey(env.SpaceID, al, id, false))
 		}
 	}
 	return err
diff --git a/pkg/collections/middleware/logging_middleware.go b/pkg/collections/middleware/logging_middleware.go
index 92e2811b..2d29c239 100644
--- a/pkg/collections/middleware/logging_middleware.go
+++ b/pkg/collections/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/collections"
 	"git.perx.ru/perxis/perxis-go/pkg/schema"
 	logzap "git.perx.ru/perxis/perxis-go/zap"
@@ -24,19 +24,19 @@ func LoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *loggingMiddleware) Create(ctx context.Context, collection *collections.Collection) (created *collections.Collection, err error) {
+func (m *loggingMiddleware) Create(ctx context.Context, coll *collections.Collection) (created *collections.Collection, err error) {
 	var spaceID string
-	if collection != nil {
-		spaceID = collection.SpaceID
+	if coll != nil {
+		spaceID = coll.SpaceID
 	}
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceID)),
 		logzap.Event(collections.EventCreate),
 	)
 
-	created, err = m.next.Create(ctx, collection)
+	created, err = m.next.Create(ctx, coll)
 	if err != nil {
-		logger.Error("Failed to create", zap.Error(err), logzap.Object(collection), logzap.Channels(logzap.Userlog, logzap.Syslog))
+		logger.Error("Failed to create", zap.Error(err), logzap.Object(coll), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
 	}
 
@@ -48,7 +48,7 @@ func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, envId st
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
 		logzap.Event(collections.EventDelete),
-		logzap.Object(id.NewCollectionId(spaceId, envId, collectionId)),
+		logzap.Object(pkgId.NewCollectionId(spaceId, envId, collectionId)),
 	)
 
 	err = m.next.Delete(ctx, spaceId, envId, collectionId)
@@ -61,42 +61,42 @@ func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, envId st
 	return err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (collection *collections.Collection, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId string, id string, options ...*collections.GetOptions) (coll *collections.Collection, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
 	)
 
-	collection, err = m.next.Get(ctx, spaceId, envId, collectionId, options...)
+	coll, err = m.next.Get(ctx, spaceId, envId, id, options...)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
 	}
 
-	return collection, err
+	return coll, err
 }
 
-func (m *loggingMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (collections []*collections.Collection, err error) {
+func (m *loggingMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (colls []*collections.Collection, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
 	)
 
-	collections, err = m.next.List(ctx, spaceId, envId, filter)
+	colls, err = m.next.List(ctx, spaceId, envId, filter)
 	if err != nil {
 		logger.Error("Failed to list", zap.Error(err))
 		return
 	}
 
-	return collections, err
+	return colls, err
 }
 
-func (m *loggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, schema *schema.Schema) (err error) {
+func (m *loggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, id string, schema *schema.Schema) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
 		logzap.Event(collections.EventSetSchema),
-		logzap.Object(id.NewCollectionId(spaceId, envId, collectionId)),
+		logzap.Object(pkgId.NewCollectionId(spaceId, envId, id)),
 	)
 
-	err = m.next.SetSchema(ctx, spaceId, envId, collectionId, schema)
+	err = m.next.SetSchema(ctx, spaceId, envId, id, schema)
 	if err != nil {
 		logger.Error("Failed to set schema", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -106,12 +106,12 @@ func (m *loggingMiddleware) SetSchema(ctx context.Context, spaceId string, envId
 	return err
 }
 
-func (m *loggingMiddleware) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) (err error) {
+func (m *loggingMiddleware) SetState(ctx context.Context, spaceId string, envId string, id string, state *collections.StateInfo) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
 	)
 
-	err = m.next.SetState(ctx, spaceId, envId, collectionId, state)
+	err = m.next.SetState(ctx, spaceId, envId, id, state)
 	if err != nil {
 		logger.Error("Failed to set state", zap.Error(err))
 		return
diff --git a/pkg/collections/middleware/recovering_middleware.go b/pkg/collections/middleware/recovering_middleware.go
index 6f5594bc..f72f48f6 100644
--- a/pkg/collections/middleware/recovering_middleware.go
+++ b/pkg/collections/middleware/recovering_middleware.go
@@ -31,7 +31,7 @@ func RecoveringMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *recoveringMiddleware) Create(ctx context.Context, collection *collections.Collection) (created *collections.Collection, err error) {
+func (m *recoveringMiddleware) Create(ctx context.Context, coll *collections.Collection) (created *collections.Collection, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -40,10 +40,10 @@ func (m *recoveringMiddleware) Create(ctx context.Context, collection *collectio
 		}
 	}()
 
-	return m.next.Create(ctx, collection)
+	return m.next.Create(ctx, coll)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, envId string, collectionId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, envId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -52,10 +52,10 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, envId
 		}
 	}()
 
-	return m.next.Delete(ctx, spaceId, envId, collectionId)
+	return m.next.Delete(ctx, spaceId, envId, id)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (collection *collections.Collection, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, id string, options ...*collections.GetOptions) (coll *collections.Collection, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -64,10 +64,10 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId st
 		}
 	}()
 
-	return m.next.Get(ctx, spaceId, envId, collectionId, options...)
+	return m.next.Get(ctx, spaceId, envId, id, options...)
 }
 
-func (m *recoveringMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (collections []*collections.Collection, err error) {
+func (m *recoveringMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (colls []*collections.Collection, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -79,7 +79,7 @@ func (m *recoveringMiddleware) List(ctx context.Context, spaceId string, envId s
 	return m.next.List(ctx, spaceId, envId, filter)
 }
 
-func (m *recoveringMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, schema *schema.Schema) (err error) {
+func (m *recoveringMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, id string, schema *schema.Schema) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -88,10 +88,10 @@ func (m *recoveringMiddleware) SetSchema(ctx context.Context, spaceId string, en
 		}
 	}()
 
-	return m.next.SetSchema(ctx, spaceId, envId, collectionId, schema)
+	return m.next.SetSchema(ctx, spaceId, envId, id, schema)
 }
 
-func (m *recoveringMiddleware) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) (err error) {
+func (m *recoveringMiddleware) SetState(ctx context.Context, spaceId string, envId string, id string, state *collections.StateInfo) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -100,7 +100,7 @@ func (m *recoveringMiddleware) SetState(ctx context.Context, spaceId string, env
 		}
 	}()
 
-	return m.next.SetState(ctx, spaceId, envId, collectionId, state)
+	return m.next.SetState(ctx, spaceId, envId, id, state)
 }
 
 func (m *recoveringMiddleware) Update(ctx context.Context, coll *collections.Collection) (err error) {
diff --git a/pkg/collections/middleware/telemetry_middleware.go b/pkg/collections/middleware/telemetry_middleware.go
index c189a7be..dba2f343 100644
--- a/pkg/collections/middleware/telemetry_middleware.go
+++ b/pkg/collections/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/collections"
 	"git.perx.ru/perxis/perxis-go/pkg/schema"
@@ -54,7 +54,7 @@ func TelemetryMiddleware(base collections.Collections, instance string, spanDeco
 }
 
 // Create implements collections.Collections
-func (_d telemetryMiddleware) Create(ctx context.Context, collection *collections.Collection) (created *collections.Collection, err error) {
+func (_d telemetryMiddleware) Create(ctx context.Context, coll *collections.Collection) (created *collections.Collection, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "Create"),
@@ -65,12 +65,12 @@ func (_d telemetryMiddleware) Create(ctx context.Context, collection *collection
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.Create")
 	defer _span.End()
 
-	created, err = _d.Collections.Create(ctx, collection)
+	created, err = _d.Collections.Create(ctx, coll)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	params := []interface{}{ctx, collection, created, err}
+	params := []interface{}{ctx, coll, created, err}
 	for _, p := range params {
 		if p == nil {
 			continue
@@ -85,7 +85,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, collection *collection
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -94,8 +94,8 @@ func (_d telemetryMiddleware) Create(ctx context.Context, collection *collection
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":        ctx,
-			"collection": collection}, map[string]interface{}{
+			"ctx":  ctx,
+			"coll": coll}, map[string]interface{}{
 			"created": created,
 			"err":     err})
 	} else if err != nil {
@@ -110,7 +110,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, collection *collection
 }
 
 // Delete implements collections.Collections
-func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId string, collectionId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId string, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "Delete"),
@@ -121,7 +121,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.Delete")
 	defer _span.End()
 
-	err = _d.Collections.Delete(ctx, spaceId, envId, collectionId)
+	err = _d.Collections.Delete(ctx, spaceId, envId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -130,7 +130,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -139,10 +139,10 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":          ctx,
-			"spaceId":      spaceId,
-			"envId":        envId,
-			"collectionId": collectionId}, map[string]interface{}{
+			"ctx":     ctx,
+			"spaceId": spaceId,
+			"envId":   envId,
+			"id":      id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -156,7 +156,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 }
 
 // Get implements collections.Collections
-func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (collection *collections.Collection, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, id string, options ...*collections.GetOptions) (coll *collections.Collection, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "Get"),
@@ -167,7 +167,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.Get")
 	defer _span.End()
 
-	collection, err = _d.Collections.Get(ctx, spaceId, envId, collectionId, options...)
+	coll, err = _d.Collections.Get(ctx, spaceId, envId, id, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -176,7 +176,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -185,13 +185,13 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":          ctx,
-			"spaceId":      spaceId,
-			"envId":        envId,
-			"collectionId": collectionId,
-			"options":      options}, map[string]interface{}{
-			"collection": collection,
-			"err":        err})
+			"ctx":     ctx,
+			"spaceId": spaceId,
+			"envId":   envId,
+			"id":      id,
+			"options": options}, map[string]interface{}{
+			"coll": coll,
+			"err":  err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
 
@@ -200,11 +200,11 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 		_span.SetAttributes(attribute.String("message", err.Error()))
 	}
 
-	return collection, err
+	return coll, err
 }
 
 // List implements collections.Collections
-func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (collections []*collections.Collection, err error) {
+func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) (colls []*collections.Collection, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "List"),
@@ -215,7 +215,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId st
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.List")
 	defer _span.End()
 
-	collections, err = _d.Collections.List(ctx, spaceId, envId, filter)
+	colls, err = _d.Collections.List(ctx, spaceId, envId, filter)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -224,7 +224,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId st
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -237,8 +237,8 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId st
 			"spaceId": spaceId,
 			"envId":   envId,
 			"filter":  filter}, map[string]interface{}{
-			"collections": collections,
-			"err":         err})
+			"colls": colls,
+			"err":   err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
 
@@ -247,11 +247,11 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string, envId st
 		_span.SetAttributes(attribute.String("message", err.Error()))
 	}
 
-	return collections, err
+	return colls, err
 }
 
 // SetSchema implements collections.Collections
-func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, schema *schema.Schema) (err error) {
+func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, envId string, id string, schema *schema.Schema) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "SetSchema"),
@@ -262,7 +262,7 @@ func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, env
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.SetSchema")
 	defer _span.End()
 
-	err = _d.Collections.SetSchema(ctx, spaceId, envId, collectionId, schema)
+	err = _d.Collections.SetSchema(ctx, spaceId, envId, id, schema)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -271,7 +271,7 @@ func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, env
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -280,11 +280,11 @@ func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, env
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":          ctx,
-			"spaceId":      spaceId,
-			"envId":        envId,
-			"collectionId": collectionId,
-			"schema":       schema}, map[string]interface{}{
+			"ctx":     ctx,
+			"spaceId": spaceId,
+			"envId":   envId,
+			"id":      id,
+			"schema":  schema}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -298,7 +298,7 @@ func (_d telemetryMiddleware) SetSchema(ctx context.Context, spaceId string, env
 }
 
 // SetState implements collections.Collections
-func (_d telemetryMiddleware) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) (err error) {
+func (_d telemetryMiddleware) SetState(ctx context.Context, spaceId string, envId string, id string, state *collections.StateInfo) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Collections"),
 		attribute.String("method", "SetState"),
@@ -309,7 +309,7 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceId string, envI
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Collections.SetState")
 	defer _span.End()
 
-	err = _d.Collections.SetState(ctx, spaceId, envId, collectionId, state)
+	err = _d.Collections.SetState(ctx, spaceId, envId, id, state)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -318,7 +318,7 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceId string, envI
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -327,11 +327,11 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceId string, envI
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":          ctx,
-			"spaceId":      spaceId,
-			"envId":        envId,
-			"collectionId": collectionId,
-			"state":        state}, map[string]interface{}{
+			"ctx":     ctx,
+			"spaceId": spaceId,
+			"envId":   envId,
+			"id":      id,
+			"state":   state}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -376,7 +376,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, coll *collections.Coll
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/collections/mocks/CollectionCreatedObserver.go b/pkg/collections/mocks/CollectionCreatedObserver.go
index 55b38993..608a1834 100644
--- a/pkg/collections/mocks/CollectionCreatedObserver.go
+++ b/pkg/collections/mocks/CollectionCreatedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type CollectionCreatedObserver struct {
 func (_m *CollectionCreatedObserver) OnCollectionCreated(ctx context.Context, coll *collections.Collection) (string, error) {
 	ret := _m.Called(ctx, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionCreated")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (string, error)); ok {
diff --git a/pkg/collections/mocks/CollectionDeletedObserver.go b/pkg/collections/mocks/CollectionDeletedObserver.go
index a529def5..be29d3e0 100644
--- a/pkg/collections/mocks/CollectionDeletedObserver.go
+++ b/pkg/collections/mocks/CollectionDeletedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type CollectionDeletedObserver struct {
 func (_m *CollectionDeletedObserver) OnCollectionDeleted(ctx context.Context, coll *collections.Collection) (string, error) {
 	ret := _m.Called(ctx, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionDeleted")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (string, error)); ok {
diff --git a/pkg/collections/mocks/CollectionPreSetSchemaObserver.go b/pkg/collections/mocks/CollectionPreSetSchemaObserver.go
new file mode 100644
index 00000000..fe9c6159
--- /dev/null
+++ b/pkg/collections/mocks/CollectionPreSetSchemaObserver.go
@@ -0,0 +1,58 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import (
+	context "context"
+
+	collections "git.perx.ru/perxis/perxis-go/pkg/collections"
+
+	mock "github.com/stretchr/testify/mock"
+)
+
+// CollectionPreSetSchemaObserver is an autogenerated mock type for the CollectionPreSetSchemaObserver type
+type CollectionPreSetSchemaObserver struct {
+	mock.Mock
+}
+
+// OnCollectionPreSetSchema provides a mock function with given fields: ctx, before, coll
+func (_m *CollectionPreSetSchemaObserver) OnCollectionPreSetSchema(ctx context.Context, before *collections.Collection, coll *collections.Collection) (string, error) {
+	ret := _m.Called(ctx, before, coll)
+
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionPreSetSchema")
+	}
+
+	var r0 string
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
+		return rf(ctx, before, coll)
+	}
+	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) string); ok {
+		r0 = rf(ctx, before, coll)
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *collections.Collection) error); ok {
+		r1 = rf(ctx, before, coll)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
+// NewCollectionPreSetSchemaObserver creates a new instance of CollectionPreSetSchemaObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewCollectionPreSetSchemaObserver(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *CollectionPreSetSchemaObserver {
+	mock := &CollectionPreSetSchemaObserver{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/collections/mocks/CollectionPreUpdateObserver.go b/pkg/collections/mocks/CollectionPreUpdateObserver.go
index 6d1fa2f2..38c4f55f 100644
--- a/pkg/collections/mocks/CollectionPreUpdateObserver.go
+++ b/pkg/collections/mocks/CollectionPreUpdateObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type CollectionPreUpdateObserver struct {
 func (_m *CollectionPreUpdateObserver) OnCollectionPreUpdate(ctx context.Context, before *collections.Collection, coll *collections.Collection) (string, error) {
 	ret := _m.Called(ctx, before, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionPreUpdate")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
diff --git a/pkg/collections/mocks/CollectionSetSchemaObserver.go b/pkg/collections/mocks/CollectionSetSchemaObserver.go
index 5453aef6..5b7e9d9a 100644
--- a/pkg/collections/mocks/CollectionSetSchemaObserver.go
+++ b/pkg/collections/mocks/CollectionSetSchemaObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type CollectionSetSchemaObserver struct {
 func (_m *CollectionSetSchemaObserver) OnCollectionSetSchema(ctx context.Context, before *collections.Collection, coll *collections.Collection) (string, error) {
 	ret := _m.Called(ctx, before, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionSetSchema")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
diff --git a/pkg/collections/mocks/CollectionUpdatedObserver.go b/pkg/collections/mocks/CollectionUpdatedObserver.go
index 4a0dc34d..79593e37 100644
--- a/pkg/collections/mocks/CollectionUpdatedObserver.go
+++ b/pkg/collections/mocks/CollectionUpdatedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type CollectionUpdatedObserver struct {
 func (_m *CollectionUpdatedObserver) OnCollectionUpdated(ctx context.Context, before *collections.Collection, after *collections.Collection) (string, error) {
 	ret := _m.Called(ctx, before, after)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnCollectionUpdated")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
diff --git a/pkg/collections/mocks/Collections.go b/pkg/collections/mocks/Collections.go
index 9a0a67f6..33c6af54 100644
--- a/pkg/collections/mocks/Collections.go
+++ b/pkg/collections/mocks/Collections.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -17,17 +17,21 @@ type Collections struct {
 	mock.Mock
 }
 
-// Create provides a mock function with given fields: ctx, collection
-func (_m *Collections) Create(ctx context.Context, collection *collections.Collection) (*collections.Collection, error) {
-	ret := _m.Called(ctx, collection)
+// Create provides a mock function with given fields: ctx, coll
+func (_m *Collections) Create(ctx context.Context, coll *collections.Collection) (*collections.Collection, error) {
+	ret := _m.Called(ctx, coll)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
 
 	var r0 *collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (*collections.Collection, error)); ok {
-		return rf(ctx, collection)
+		return rf(ctx, coll)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok {
-		r0 = rf(ctx, collection)
+		r0 = rf(ctx, coll)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*collections.Collection)
@@ -35,7 +39,7 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
-		r1 = rf(ctx, collection)
+		r1 = rf(ctx, coll)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -43,13 +47,17 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, spaceId, envId, collectionId
-func (_m *Collections) Delete(ctx context.Context, spaceId string, envId string, collectionId string) error {
-	ret := _m.Called(ctx, spaceId, envId, collectionId)
+// Delete provides a mock function with given fields: ctx, spaceId, envId, id
+func (_m *Collections) Delete(ctx context.Context, spaceId string, envId string, id string) error {
+	ret := _m.Called(ctx, spaceId, envId, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId)
+		r0 = rf(ctx, spaceId, envId, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -57,24 +65,28 @@ func (_m *Collections) Delete(ctx context.Context, spaceId string, envId string,
 	return r0
 }
 
-// Get provides a mock function with given fields: ctx, spaceId, envId, collectionId, options
-func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (*collections.Collection, error) {
+// Get provides a mock function with given fields: ctx, spaceId, envId, id, options
+func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, id string, options ...*collections.GetOptions) (*collections.Collection, error) {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId, collectionId)
+	_ca = append(_ca, ctx, spaceId, envId, id)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
+
 	var r0 *collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) (*collections.Collection, error)); ok {
-		return rf(ctx, spaceId, envId, collectionId, options...)
+		return rf(ctx, spaceId, envId, id, options...)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) *collections.Collection); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, options...)
+		r0 = rf(ctx, spaceId, envId, id, options...)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*collections.Collection)
@@ -82,7 +94,7 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...*collections.GetOptions) error); ok {
-		r1 = rf(ctx, spaceId, envId, collectionId, options...)
+		r1 = rf(ctx, spaceId, envId, id, options...)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -94,6 +106,10 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co
 func (_m *Collections) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) ([]*collections.Collection, error) {
 	ret := _m.Called(ctx, spaceId, envId, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for List")
+	}
+
 	var r0 []*collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) ([]*collections.Collection, error)); ok {
@@ -116,13 +132,17 @@ func (_m *Collections) List(ctx context.Context, spaceId string, envId string, f
 	return r0, r1
 }
 
-// SetSchema provides a mock function with given fields: ctx, spaceId, envId, collectionId, _a4
-func (_m *Collections) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, _a4 *schema.Schema) error {
-	ret := _m.Called(ctx, spaceId, envId, collectionId, _a4)
+// SetSchema provides a mock function with given fields: ctx, spaceId, envId, id, _a4
+func (_m *Collections) SetSchema(ctx context.Context, spaceId string, envId string, id string, _a4 *schema.Schema) error {
+	ret := _m.Called(ctx, spaceId, envId, id, _a4)
+
+	if len(ret) == 0 {
+		panic("no return value specified for SetSchema")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *schema.Schema) error); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, _a4)
+		r0 = rf(ctx, spaceId, envId, id, _a4)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -130,13 +150,17 @@ func (_m *Collections) SetSchema(ctx context.Context, spaceId string, envId stri
 	return r0
 }
 
-// SetState provides a mock function with given fields: ctx, spaceId, envId, collectionId, state
-func (_m *Collections) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) error {
-	ret := _m.Called(ctx, spaceId, envId, collectionId, state)
+// SetState provides a mock function with given fields: ctx, spaceId, envId, id, state
+func (_m *Collections) SetState(ctx context.Context, spaceId string, envId string, id string, state *collections.StateInfo) error {
+	ret := _m.Called(ctx, spaceId, envId, id, state)
+
+	if len(ret) == 0 {
+		panic("no return value specified for SetState")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *collections.StateInfo) error); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, state)
+		r0 = rf(ctx, spaceId, envId, id, state)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -148,6 +172,10 @@ func (_m *Collections) SetState(ctx context.Context, spaceId string, envId strin
 func (_m *Collections) Update(ctx context.Context, coll *collections.Collection) error {
 	ret := _m.Called(ctx, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) error); ok {
 		r0 = rf(ctx, coll)
diff --git a/pkg/collections/mocks/Middleware.go b/pkg/collections/mocks/Middleware.go
index 761a6f46..6f2cfa5d 100644
--- a/pkg/collections/mocks/Middleware.go
+++ b/pkg/collections/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -17,6 +17,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 collections.Collections) collections.Collections {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 collections.Collections
 	if rf, ok := ret.Get(0).(func(collections.Collections) collections.Collections); ok {
 		r0 = rf(_a0)
diff --git a/pkg/collections/mocks/Storage.go b/pkg/collections/mocks/Storage.go
index 7e4bdb4a..e5c05c6b 100644
--- a/pkg/collections/mocks/Storage.go
+++ b/pkg/collections/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -19,6 +19,10 @@ type Storage struct {
 func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*collections.Collection, error) {
 	ret := _m.Called(ctx, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (*collections.Collection, error)); ok {
@@ -45,6 +49,10 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*c
 func (_m *Storage) Delete(ctx context.Context, spaceId string, envId string, collectionId string) error {
 	ret := _m.Called(ctx, spaceId, envId, collectionId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
 		r0 = rf(ctx, spaceId, envId, collectionId)
@@ -59,6 +67,10 @@ func (_m *Storage) Delete(ctx context.Context, spaceId string, envId string, col
 func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collectionId string) (*collections.Collection, error) {
 	ret := _m.Called(ctx, spaceId, envId, collectionId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
+
 	var r0 *collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*collections.Collection, error)); ok {
@@ -85,6 +97,10 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collec
 func (_m *Storage) Init(ctx context.Context, spaceID string, envID string) error {
 	ret := _m.Called(ctx, spaceID, envID)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Init")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
 		r0 = rf(ctx, spaceID, envID)
@@ -99,6 +115,10 @@ func (_m *Storage) Init(ctx context.Context, spaceID string, envID string) error
 func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) ([]*collections.Collection, error) {
 	ret := _m.Called(ctx, spaceId, envId, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for List")
+	}
+
 	var r0 []*collections.Collection
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) ([]*collections.Collection, error)); ok {
@@ -125,6 +145,10 @@ func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filte
 func (_m *Storage) Reset(ctx context.Context, spaceId string, envId string) error {
 	ret := _m.Called(ctx, spaceId, envId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Reset")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
 		r0 = rf(ctx, spaceId, envId)
@@ -139,6 +163,10 @@ func (_m *Storage) Reset(ctx context.Context, spaceId string, envId string) erro
 func (_m *Storage) Update(ctx context.Context, coll *collections.Collection) (int, int, error) {
 	ret := _m.Called(ctx, coll)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 int
 	var r1 int
 	var r2 error
diff --git a/pkg/collections/mocks/spaceGetter.go b/pkg/collections/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/collections/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/collections/service.go b/pkg/collections/service.go
index 362c9dc7..6c65f3f1 100644
--- a/pkg/collections/service.go
+++ b/pkg/collections/service.go
@@ -10,15 +10,15 @@ import (
 // @protobuf git.perx.ru/perxis/perxis-go/proto/collections
 // @grpc-addr content.collections.Collections
 type Collections interface {
-	Create(ctx context.Context, collection *Collection) (created *Collection, err error)
-	Get(ctx context.Context, spaceId, envId, collectionId string, options ...*GetOptions) (collection *Collection, err error)
-	List(ctx context.Context, spaceId, envId string, filter *Filter) (collections []*Collection, err error)
+	Create(ctx context.Context, coll *Collection) (created *Collection, err error)
+	Get(ctx context.Context, spaceId, envId, id string, options ...*GetOptions) (coll *Collection, err error)
+	List(ctx context.Context, spaceId, envId string, filter *Filter) (colls []*Collection, err error)
 	Update(ctx context.Context, coll *Collection) (err error)
-	SetSchema(ctx context.Context, spaceId, envId, collectionId string, schema *schema.Schema) (err error)
+	SetSchema(ctx context.Context, spaceId, envId, id string, schema *schema.Schema) (err error)
 
 	// @microgen -
-	SetState(ctx context.Context, spaceId, envId, collectionId string, state *StateInfo) (err error)
-	Delete(ctx context.Context, spaceId, envId, collectionId string) (err error)
+	SetState(ctx context.Context, spaceId, envId, id string, state *StateInfo) (err error)
+	Delete(ctx context.Context, spaceId, envId, id string) (err error)
 }
 
 type Filter struct {
diff --git a/pkg/delivery/middleware/telemetry_middleware.go b/pkg/delivery/middleware/telemetry_middleware.go
index 600b6a61..276d3f62 100644
--- a/pkg/delivery/middleware/telemetry_middleware.go
+++ b/pkg/delivery/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/collections"
 	"git.perx.ru/perxis/perxis-go/pkg/delivery"
@@ -77,7 +77,7 @@ func (_d telemetryMiddleware) Aggregate(ctx context.Context, spaceId string, env
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -126,7 +126,7 @@ func (_d telemetryMiddleware) FindItems(ctx context.Context, spaceId string, env
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -176,7 +176,7 @@ func (_d telemetryMiddleware) GetCollection(ctx context.Context, spaceId string,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -223,7 +223,7 @@ func (_d telemetryMiddleware) GetEnvironment(ctx context.Context, spaceId string
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -269,7 +269,7 @@ func (_d telemetryMiddleware) GetItem(ctx context.Context, spaceId string, envId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -318,7 +318,7 @@ func (_d telemetryMiddleware) ListCollections(ctx context.Context, spaceId strin
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -364,7 +364,7 @@ func (_d telemetryMiddleware) ListEnvironments(ctx context.Context, spaceId stri
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -409,7 +409,7 @@ func (_d telemetryMiddleware) ListLocales(ctx context.Context, spaceId string) (
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/environments/middleware/access_logging_middleware.go b/pkg/environments/middleware/access_logging_middleware.go
index e357e2ec..dd4f27bf 100644
--- a/pkg/environments/middleware/access_logging_middleware.go
+++ b/pkg/environments/middleware/access_logging_middleware.go
@@ -50,16 +50,16 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, env *environments.
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("envId", envId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, spaceId, envId)
+	err = m.next.Delete(ctx, spaceId, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -69,16 +69,16 @@ func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, en
 	return err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string) (env *environments.Environment, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, id string) (env *environments.Environment, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("envId", envId),
+		zap.Reflect("id", id),
 	)
 
-	env, err = m.next.Get(ctx, spaceId, envId)
+	env, err = m.next.Get(ctx, spaceId, id)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -108,17 +108,17 @@ func (m *accessLoggingMiddleware) List(ctx context.Context, spaceId string) (env
 	return envs, err
 }
 
-func (m *accessLoggingMiddleware) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) (err error) {
+func (m *accessLoggingMiddleware) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Migrate.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("envId", envId),
+		zap.Reflect("id", id),
 		zap.Reflect("options", options),
 	)
 
-	err = m.next.Migrate(ctx, spaceId, envId, options...)
+	err = m.next.Migrate(ctx, spaceId, id, options...)
 
 	m.logger.Debug("Migrate.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -128,17 +128,17 @@ func (m *accessLoggingMiddleware) Migrate(ctx context.Context, spaceId string, e
 	return err
 }
 
-func (m *accessLoggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *accessLoggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("RemoveAlias.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("envId", envId),
+		zap.Reflect("id", id),
 		zap.Reflect("alias", alias),
 	)
 
-	err = m.next.RemoveAlias(ctx, spaceId, envId, alias)
+	err = m.next.RemoveAlias(ctx, spaceId, id, alias)
 
 	m.logger.Debug("RemoveAlias.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -148,17 +148,17 @@ func (m *accessLoggingMiddleware) RemoveAlias(ctx context.Context, spaceId strin
 	return err
 }
 
-func (m *accessLoggingMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *accessLoggingMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("SetAlias.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("envId", envId),
+		zap.Reflect("id", id),
 		zap.Reflect("alias", alias),
 	)
 
-	err = m.next.SetAlias(ctx, spaceId, envId, alias)
+	err = m.next.SetAlias(ctx, spaceId, id, alias)
 
 	m.logger.Debug("SetAlias.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/environments/middleware/caching_middleware.go b/pkg/environments/middleware/caching_middleware.go
index c53f45e8..ffcd85b8 100644
--- a/pkg/environments/middleware/caching_middleware.go
+++ b/pkg/environments/middleware/caching_middleware.go
@@ -27,42 +27,42 @@ type cachingMiddleware struct {
 	next  service.Environments
 }
 
-func (m cachingMiddleware) Create(ctx context.Context, env *service.Environment) (environment *service.Environment, err error) {
+func (m cachingMiddleware) Create(ctx context.Context, env *service.Environment) (created *service.Environment, err error) {
 
-	environment, err = m.next.Create(ctx, env)
+	created, err = m.next.Create(ctx, env)
 	if err == nil {
-		_ = m.cache.Remove(environment.SpaceID)
+		_ = m.cache.Remove(created.SpaceID)
 	}
-	return environment, err
+	return created, err
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, spaceId string, envId string) (environment *service.Environment, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, spaceId string, id string) (env *service.Environment, err error) {
 
-	value, e := m.cache.Get(makeKey(spaceId, envId))
+	value, e := m.cache.Get(makeKey(spaceId, id))
 	if e == nil {
 		return value.(*service.Environment).Clone(), nil
 	}
-	environment, err = m.next.Get(ctx, spaceId, envId)
+	env, err = m.next.Get(ctx, spaceId, id)
 	if err == nil {
-		_ = m.cache.Set(makeKey(spaceId, environment.ID), environment)
-		for _, a := range environment.Aliases {
-			_ = m.cache.Set(makeKey(spaceId, a), environment)
+		_ = m.cache.Set(makeKey(spaceId, env.ID), env)
+		for _, a := range env.Aliases {
+			_ = m.cache.Set(makeKey(spaceId, a), env)
 		}
-		return environment.Clone(), nil
+		return env.Clone(), nil
 	}
 	return nil, err
 }
 
-func (m cachingMiddleware) List(ctx context.Context, spaceId string) (environments []*service.Environment, err error) {
+func (m cachingMiddleware) List(ctx context.Context, spaceId string) (envs []*service.Environment, err error) {
 
 	value, e := m.cache.Get(spaceId)
 	if e == nil {
 		return data.CloneSlice(value.([]*service.Environment)), nil
 	}
-	environments, err = m.next.List(ctx, spaceId)
+	envs, err = m.next.List(ctx, spaceId)
 	if err == nil {
-		_ = m.cache.Set(spaceId, environments)
-		return data.CloneSlice(environments), nil
+		_ = m.cache.Set(spaceId, envs)
+		return data.CloneSlice(envs), nil
 	}
 	return nil, err
 }
@@ -84,11 +84,11 @@ func (m cachingMiddleware) Update(ctx context.Context, env *service.Environment)
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 
-	err = m.next.Delete(ctx, spaceId, envId)
+	err = m.next.Delete(ctx, spaceId, id)
 	if err == nil {
-		value, e := m.cache.Get(makeKey(spaceId, envId))
+		value, e := m.cache.Get(makeKey(spaceId, id))
 		if e == nil {
 			env := value.(*service.Environment)
 			_ = m.cache.Remove(makeKey(env.SpaceID, env.ID))
@@ -101,9 +101,9 @@ func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, envId str
 	return err
 }
 
-func (m cachingMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m cachingMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 
-	err = m.next.SetAlias(ctx, spaceId, envId, alias)
+	err = m.next.SetAlias(ctx, spaceId, id, alias)
 	if err == nil {
 		value, e := m.cache.Get(makeKey(spaceId, alias))
 		if e == nil {
@@ -114,7 +114,7 @@ func (m cachingMiddleware) SetAlias(ctx context.Context, spaceId string, envId s
 			}
 		}
 
-		value, e = m.cache.Get(makeKey(spaceId, envId))
+		value, e = m.cache.Get(makeKey(spaceId, id))
 		if e == nil {
 			env := value.(*service.Environment)
 			_ = m.cache.Remove(makeKey(env.SpaceID, env.ID))
@@ -127,9 +127,9 @@ func (m cachingMiddleware) SetAlias(ctx context.Context, spaceId string, envId s
 	return err
 }
 
-func (m cachingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m cachingMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 
-	err = m.next.RemoveAlias(ctx, spaceId, envId, alias)
+	err = m.next.RemoveAlias(ctx, spaceId, id, alias)
 	if err == nil {
 		_ = m.cache.Remove(spaceId)
 		value, e := m.cache.Get(makeKey(spaceId, alias))
@@ -141,7 +141,7 @@ func (m cachingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envI
 			}
 		}
 
-		value, e = m.cache.Get(makeKey(spaceId, envId))
+		value, e = m.cache.Get(makeKey(spaceId, id))
 		if e == nil {
 			env := value.(*service.Environment)
 			_ = m.cache.Remove(makeKey(env.SpaceID, env.ID))
@@ -153,11 +153,11 @@ func (m cachingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envI
 	return err
 }
 
-func (m cachingMiddleware) Migrate(ctx context.Context, spaceId, envId string, options ...*service.MigrateOptions) (err error) {
-	err = m.next.Migrate(ctx, spaceId, envId, options...)
+func (m cachingMiddleware) Migrate(ctx context.Context, spaceId, id string, options ...*service.MigrateOptions) (err error) {
+	err = m.next.Migrate(ctx, spaceId, id, options...)
 
 	// значение из кэша удалить вне зависимости от наличия ошибки, поскольку состояние окружения могло измениться
-	value, e := m.cache.Get(makeKey(spaceId, envId))
+	value, e := m.cache.Get(makeKey(spaceId, id))
 	if e == nil {
 		env := value.(*service.Environment)
 		_ = m.cache.Remove(makeKey(env.SpaceID, env.ID))
diff --git a/pkg/environments/middleware/error_logging_middleware.go b/pkg/environments/middleware/error_logging_middleware.go
index 812de403..4a5656e2 100644
--- a/pkg/environments/middleware/error_logging_middleware.go
+++ b/pkg/environments/middleware/error_logging_middleware.go
@@ -39,24 +39,24 @@ func (m *errorLoggingMiddleware) Create(ctx context.Context, env *environments.E
 	return m.next.Create(ctx, env)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, spaceId, envId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
-func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string) (env *environments.Environment, err error) {
+func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, id string) (env *environments.Environment, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Get(ctx, spaceId, envId)
+	return m.next.Get(ctx, spaceId, id)
 }
 
 func (m *errorLoggingMiddleware) List(ctx context.Context, spaceId string) (envs []*environments.Environment, err error) {
@@ -69,34 +69,34 @@ func (m *errorLoggingMiddleware) List(ctx context.Context, spaceId string) (envs
 	return m.next.List(ctx, spaceId)
 }
 
-func (m *errorLoggingMiddleware) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) (err error) {
+func (m *errorLoggingMiddleware) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Migrate(ctx, spaceId, envId, options...)
+	return m.next.Migrate(ctx, spaceId, id, options...)
 }
 
-func (m *errorLoggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *errorLoggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.RemoveAlias(ctx, spaceId, envId, alias)
+	return m.next.RemoveAlias(ctx, spaceId, id, alias)
 }
 
-func (m *errorLoggingMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *errorLoggingMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.SetAlias(ctx, spaceId, envId, alias)
+	return m.next.SetAlias(ctx, spaceId, id, alias)
 }
 
 func (m *errorLoggingMiddleware) Update(ctx context.Context, env *environments.Environment) (err error) {
diff --git a/pkg/environments/middleware/logging_middleware.go b/pkg/environments/middleware/logging_middleware.go
index 2cb01129..86a73c2a 100644
--- a/pkg/environments/middleware/logging_middleware.go
+++ b/pkg/environments/middleware/logging_middleware.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"fmt"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/environments"
 
 	logzap "git.perx.ru/perxis/perxis-go/zap"
@@ -42,14 +42,14 @@ func (m *loggingMiddleware) Create(ctx context.Context, env *environments.Enviro
 	return created, err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(environments.EventDelete),
-		logzap.Object(id.NewEnvironmentId(spaceId, envId)),
+		logzap.Object(pkgId.NewEnvironmentId(spaceId, id)),
 	)
 
-	err = m.next.Delete(ctx, spaceId, envId)
+	err = m.next.Delete(ctx, spaceId, id)
 	if err != nil {
 		logger.Error("Failed to delete", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -60,13 +60,13 @@ func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string, envId st
 	return err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId string) (env *environments.Environment, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, id string) (env *environments.Environment, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewEnvironmentId(spaceId, envId)),
+		logzap.Object(pkgId.NewEnvironmentId(spaceId, id)),
 	)
 
-	env, err = m.next.Get(ctx, spaceId, envId)
+	env, err = m.next.Get(ctx, spaceId, id)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
@@ -89,14 +89,14 @@ func (m *loggingMiddleware) List(ctx context.Context, spaceId string) (envs []*e
 	return envs, err
 }
 
-func (m *loggingMiddleware) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) (err error) {
+func (m *loggingMiddleware) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(environments.EventMigrate),
-		logzap.Object(id.NewEnvironmentId(spaceId, envId)),
+		logzap.Object(pkgId.NewEnvironmentId(spaceId, id)),
 	)
 
-	err = m.next.Migrate(ctx, spaceId, envId, options...)
+	err = m.next.Migrate(ctx, spaceId, id, options...)
 	if err != nil {
 		logger.Error("Failed to migrate", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -107,14 +107,14 @@ func (m *loggingMiddleware) Migrate(ctx context.Context, spaceId string, envId s
 	return err
 }
 
-func (m *loggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *loggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(environments.EventUpdate),
-		logzap.Object(id.NewEnvironmentId(spaceId, envId)),
+		logzap.Object(pkgId.NewEnvironmentId(spaceId, id)),
 	)
 
-	err = m.next.RemoveAlias(ctx, spaceId, envId, alias)
+	err = m.next.RemoveAlias(ctx, spaceId, id, alias)
 	if err != nil {
 		logger.Error(fmt.Sprintf("Failed to remove alias '%s'", alias), zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -124,14 +124,14 @@ func (m *loggingMiddleware) RemoveAlias(ctx context.Context, spaceId string, env
 	return err
 }
 
-func (m *loggingMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *loggingMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(environments.EventUpdate),
-		logzap.Object(id.NewEnvironmentId(spaceId, envId)),
+		logzap.Object(pkgId.NewEnvironmentId(spaceId, id)),
 	)
 
-	err = m.next.SetAlias(ctx, spaceId, envId, alias)
+	err = m.next.SetAlias(ctx, spaceId, id, alias)
 	if err != nil {
 		logger.Error(fmt.Sprintf("Failed to set alias '%s'", alias), zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
diff --git a/pkg/environments/middleware/recovering_middleware.go b/pkg/environments/middleware/recovering_middleware.go
index 57a59406..6e07a879 100644
--- a/pkg/environments/middleware/recovering_middleware.go
+++ b/pkg/environments/middleware/recovering_middleware.go
@@ -42,7 +42,7 @@ func (m *recoveringMiddleware) Create(ctx context.Context, env *environments.Env
 	return m.next.Create(ctx, env)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -51,10 +51,10 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, envId
 		}
 	}()
 
-	return m.next.Delete(ctx, spaceId, envId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string) (env *environments.Environment, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, id string) (env *environments.Environment, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -63,7 +63,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId st
 		}
 	}()
 
-	return m.next.Get(ctx, spaceId, envId)
+	return m.next.Get(ctx, spaceId, id)
 }
 
 func (m *recoveringMiddleware) List(ctx context.Context, spaceId string) (envs []*environments.Environment, err error) {
@@ -78,7 +78,7 @@ func (m *recoveringMiddleware) List(ctx context.Context, spaceId string) (envs [
 	return m.next.List(ctx, spaceId)
 }
 
-func (m *recoveringMiddleware) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) (err error) {
+func (m *recoveringMiddleware) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -87,10 +87,10 @@ func (m *recoveringMiddleware) Migrate(ctx context.Context, spaceId string, envI
 		}
 	}()
 
-	return m.next.Migrate(ctx, spaceId, envId, options...)
+	return m.next.Migrate(ctx, spaceId, id, options...)
 }
 
-func (m *recoveringMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *recoveringMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -99,10 +99,10 @@ func (m *recoveringMiddleware) RemoveAlias(ctx context.Context, spaceId string,
 		}
 	}()
 
-	return m.next.RemoveAlias(ctx, spaceId, envId, alias)
+	return m.next.RemoveAlias(ctx, spaceId, id, alias)
 }
 
-func (m *recoveringMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (m *recoveringMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -111,7 +111,7 @@ func (m *recoveringMiddleware) SetAlias(ctx context.Context, spaceId string, env
 		}
 	}()
 
-	return m.next.SetAlias(ctx, spaceId, envId, alias)
+	return m.next.SetAlias(ctx, spaceId, id, alias)
 }
 
 func (m *recoveringMiddleware) Update(ctx context.Context, env *environments.Environment) (err error) {
diff --git a/pkg/environments/middleware/telemetry_middleware.go b/pkg/environments/middleware/telemetry_middleware.go
index f1fb94c7..94c90c2f 100644
--- a/pkg/environments/middleware/telemetry_middleware.go
+++ b/pkg/environments/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/environments"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -84,7 +84,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, env *environments.Envi
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -109,7 +109,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, env *environments.Envi
 }
 
 // Delete implements environments.Environments
-func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Environments"),
 		attribute.String("method", "Delete"),
@@ -120,7 +120,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Environments.Delete")
 	defer _span.End()
 
-	err = _d.Environments.Delete(ctx, spaceId, envId)
+	err = _d.Environments.Delete(ctx, spaceId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -129,7 +129,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -140,7 +140,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"envId":   envId}, map[string]interface{}{
+			"id":      id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -154,7 +154,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, envId
 }
 
 // Get implements environments.Environments
-func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string) (env *environments.Environment, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, id string) (env *environments.Environment, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Environments"),
 		attribute.String("method", "Get"),
@@ -165,7 +165,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Environments.Get")
 	defer _span.End()
 
-	env, err = _d.Environments.Get(ctx, spaceId, envId)
+	env, err = _d.Environments.Get(ctx, spaceId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -174,7 +174,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -185,7 +185,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"envId":   envId}, map[string]interface{}{
+			"id":      id}, map[string]interface{}{
 			"env": env,
 			"err": err})
 	} else if err != nil {
@@ -220,7 +220,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string) (envs []
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -245,7 +245,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string) (envs []
 }
 
 // Migrate implements environments.Environments
-func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) (err error) {
+func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Environments"),
 		attribute.String("method", "Migrate"),
@@ -256,7 +256,7 @@ func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, envId
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Environments.Migrate")
 	defer _span.End()
 
-	err = _d.Environments.Migrate(ctx, spaceId, envId, options...)
+	err = _d.Environments.Migrate(ctx, spaceId, id, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -265,7 +265,7 @@ func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, envId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -276,7 +276,7 @@ func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, envId
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"envId":   envId,
+			"id":      id,
 			"options": options}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
@@ -291,7 +291,7 @@ func (_d telemetryMiddleware) Migrate(ctx context.Context, spaceId string, envId
 }
 
 // RemoveAlias implements environments.Environments
-func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Environments"),
 		attribute.String("method", "RemoveAlias"),
@@ -302,7 +302,7 @@ func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, e
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Environments.RemoveAlias")
 	defer _span.End()
 
-	err = _d.Environments.RemoveAlias(ctx, spaceId, envId, alias)
+	err = _d.Environments.RemoveAlias(ctx, spaceId, id, alias)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -311,7 +311,7 @@ func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, e
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -322,7 +322,7 @@ func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, e
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"envId":   envId,
+			"id":      id,
 			"alias":   alias}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
@@ -337,7 +337,7 @@ func (_d telemetryMiddleware) RemoveAlias(ctx context.Context, spaceId string, e
 }
 
 // SetAlias implements environments.Environments
-func (_d telemetryMiddleware) SetAlias(ctx context.Context, spaceId string, envId string, alias string) (err error) {
+func (_d telemetryMiddleware) SetAlias(ctx context.Context, spaceId string, id string, alias string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Environments"),
 		attribute.String("method", "SetAlias"),
@@ -348,7 +348,7 @@ func (_d telemetryMiddleware) SetAlias(ctx context.Context, spaceId string, envI
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Environments.SetAlias")
 	defer _span.End()
 
-	err = _d.Environments.SetAlias(ctx, spaceId, envId, alias)
+	err = _d.Environments.SetAlias(ctx, spaceId, id, alias)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -357,7 +357,7 @@ func (_d telemetryMiddleware) SetAlias(ctx context.Context, spaceId string, envI
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -368,7 +368,7 @@ func (_d telemetryMiddleware) SetAlias(ctx context.Context, spaceId string, envI
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"envId":   envId,
+			"id":      id,
 			"alias":   alias}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
@@ -414,7 +414,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, env *environments.Envi
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/environments/mocks/EnvironmentConfigurationObserver.go b/pkg/environments/mocks/EnvironmentConfigurationObserver.go
index 32c8efd8..fc3518c4 100644
--- a/pkg/environments/mocks/EnvironmentConfigurationObserver.go
+++ b/pkg/environments/mocks/EnvironmentConfigurationObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type EnvironmentConfigurationObserver struct {
 func (_m *EnvironmentConfigurationObserver) OnEnvironmentConfiguration(ctx context.Context, before *environments.Environment, after *environments.Environment) error {
 	ret := _m.Called(ctx, before, after)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnEnvironmentConfiguration")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment, *environments.Environment) error); ok {
 		r0 = rf(ctx, before, after)
diff --git a/pkg/environments/mocks/EnvironmentCreatedObserver.go b/pkg/environments/mocks/EnvironmentCreatedObserver.go
index 6bed116a..0420cff2 100644
--- a/pkg/environments/mocks/EnvironmentCreatedObserver.go
+++ b/pkg/environments/mocks/EnvironmentCreatedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type EnvironmentCreatedObserver struct {
 func (_m *EnvironmentCreatedObserver) OnEnvironmentCreated(ctx context.Context, env *environments.Environment) (string, error) {
 	ret := _m.Called(ctx, env)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnEnvironmentCreated")
+	}
+
 	var r0 string
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) (string, error)); ok {
diff --git a/pkg/environments/mocks/EnvironmentDeletedObserver.go b/pkg/environments/mocks/EnvironmentDeletedObserver.go
index 1a101f04..3f559b8e 100644
--- a/pkg/environments/mocks/EnvironmentDeletedObserver.go
+++ b/pkg/environments/mocks/EnvironmentDeletedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type EnvironmentDeletedObserver struct {
 func (_m *EnvironmentDeletedObserver) OnEnvironmentDeleted(ctx context.Context, env *environments.Environment) error {
 	ret := _m.Called(ctx, env)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnEnvironmentDeleted")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) error); ok {
 		r0 = rf(ctx, env)
diff --git a/pkg/environments/mocks/EnvironmentMigratedObserver.go b/pkg/environments/mocks/EnvironmentMigratedObserver.go
index c529a8b8..c1a01bd8 100644
--- a/pkg/environments/mocks/EnvironmentMigratedObserver.go
+++ b/pkg/environments/mocks/EnvironmentMigratedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type EnvironmentMigratedObserver struct {
 func (_m *EnvironmentMigratedObserver) OnEnvironmentMigrated(ctx context.Context, env *environments.Environment) error {
 	ret := _m.Called(ctx, env)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnEnvironmentMigrated")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) error); ok {
 		r0 = rf(ctx, env)
diff --git a/pkg/environments/mocks/EnvironmentUpdatedObserver.go b/pkg/environments/mocks/EnvironmentUpdatedObserver.go
index 75073188..4d9493a0 100644
--- a/pkg/environments/mocks/EnvironmentUpdatedObserver.go
+++ b/pkg/environments/mocks/EnvironmentUpdatedObserver.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type EnvironmentUpdatedObserver struct {
 func (_m *EnvironmentUpdatedObserver) OnEnvironmentUpdated(ctx context.Context, before *environments.Environment, after *environments.Environment) error {
 	ret := _m.Called(ctx, before, after)
 
+	if len(ret) == 0 {
+		panic("no return value specified for OnEnvironmentUpdated")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment, *environments.Environment) error); ok {
 		r0 = rf(ctx, before, after)
diff --git a/pkg/environments/mocks/Environments.go b/pkg/environments/mocks/Environments.go
index 22da5d02..0f22798e 100644
--- a/pkg/environments/mocks/Environments.go
+++ b/pkg/environments/mocks/Environments.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type Environments struct {
 func (_m *Environments) Create(ctx context.Context, env *environments.Environment) (*environments.Environment, error) {
 	ret := _m.Called(ctx, env)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) (*environments.Environment, error)); ok {
@@ -40,13 +44,17 @@ func (_m *Environments) Create(ctx context.Context, env *environments.Environmen
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, spaceId, envId
-func (_m *Environments) Delete(ctx context.Context, spaceId string, envId string) error {
-	ret := _m.Called(ctx, spaceId, envId)
+// Delete provides a mock function with given fields: ctx, spaceId, id
+func (_m *Environments) Delete(ctx context.Context, spaceId string, id string) error {
+	ret := _m.Called(ctx, spaceId, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
-		r0 = rf(ctx, spaceId, envId)
+		r0 = rf(ctx, spaceId, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -54,17 +62,21 @@ func (_m *Environments) Delete(ctx context.Context, spaceId string, envId string
 	return r0
 }
 
-// Get provides a mock function with given fields: ctx, spaceId, envId
-func (_m *Environments) Get(ctx context.Context, spaceId string, envId string) (*environments.Environment, error) {
-	ret := _m.Called(ctx, spaceId, envId)
+// Get provides a mock function with given fields: ctx, spaceId, id
+func (_m *Environments) Get(ctx context.Context, spaceId string, id string) (*environments.Environment, error) {
+	ret := _m.Called(ctx, spaceId, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
 
 	var r0 *environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*environments.Environment, error)); ok {
-		return rf(ctx, spaceId, envId)
+		return rf(ctx, spaceId, id)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) *environments.Environment); ok {
-		r0 = rf(ctx, spaceId, envId)
+		r0 = rf(ctx, spaceId, id)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*environments.Environment)
@@ -72,7 +84,7 @@ func (_m *Environments) Get(ctx context.Context, spaceId string, envId string) (
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
-		r1 = rf(ctx, spaceId, envId)
+		r1 = rf(ctx, spaceId, id)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -84,6 +96,10 @@ func (_m *Environments) Get(ctx context.Context, spaceId string, envId string) (
 func (_m *Environments) List(ctx context.Context, spaceId string) ([]*environments.Environment, error) {
 	ret := _m.Called(ctx, spaceId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for List")
+	}
+
 	var r0 []*environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) ([]*environments.Environment, error)); ok {
@@ -106,20 +122,24 @@ func (_m *Environments) List(ctx context.Context, spaceId string) ([]*environmen
 	return r0, r1
 }
 
-// Migrate provides a mock function with given fields: ctx, spaceId, envId, options
-func (_m *Environments) Migrate(ctx context.Context, spaceId string, envId string, options ...*environments.MigrateOptions) error {
+// Migrate provides a mock function with given fields: ctx, spaceId, id, options
+func (_m *Environments) Migrate(ctx context.Context, spaceId string, id string, options ...*environments.MigrateOptions) error {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId)
+	_ca = append(_ca, ctx, spaceId, id)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Migrate")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, ...*environments.MigrateOptions) error); ok {
-		r0 = rf(ctx, spaceId, envId, options...)
+		r0 = rf(ctx, spaceId, id, options...)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -127,13 +147,17 @@ func (_m *Environments) Migrate(ctx context.Context, spaceId string, envId strin
 	return r0
 }
 
-// RemoveAlias provides a mock function with given fields: ctx, spaceId, envId, alias
-func (_m *Environments) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) error {
-	ret := _m.Called(ctx, spaceId, envId, alias)
+// RemoveAlias provides a mock function with given fields: ctx, spaceId, id, alias
+func (_m *Environments) RemoveAlias(ctx context.Context, spaceId string, id string, alias string) error {
+	ret := _m.Called(ctx, spaceId, id, alias)
+
+	if len(ret) == 0 {
+		panic("no return value specified for RemoveAlias")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
-		r0 = rf(ctx, spaceId, envId, alias)
+		r0 = rf(ctx, spaceId, id, alias)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -141,13 +165,17 @@ func (_m *Environments) RemoveAlias(ctx context.Context, spaceId string, envId s
 	return r0
 }
 
-// SetAlias provides a mock function with given fields: ctx, spaceId, envId, alias
-func (_m *Environments) SetAlias(ctx context.Context, spaceId string, envId string, alias string) error {
-	ret := _m.Called(ctx, spaceId, envId, alias)
+// SetAlias provides a mock function with given fields: ctx, spaceId, id, alias
+func (_m *Environments) SetAlias(ctx context.Context, spaceId string, id string, alias string) error {
+	ret := _m.Called(ctx, spaceId, id, alias)
+
+	if len(ret) == 0 {
+		panic("no return value specified for SetAlias")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
-		r0 = rf(ctx, spaceId, envId, alias)
+		r0 = rf(ctx, spaceId, id, alias)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -159,6 +187,10 @@ func (_m *Environments) SetAlias(ctx context.Context, spaceId string, envId stri
 func (_m *Environments) Update(ctx context.Context, env *environments.Environment) error {
 	ret := _m.Called(ctx, env)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) error); ok {
 		r0 = rf(ctx, env)
diff --git a/pkg/environments/mocks/Middleware.go b/pkg/environments/mocks/Middleware.go
index e88e67e9..1dded44d 100644
--- a/pkg/environments/mocks/Middleware.go
+++ b/pkg/environments/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -17,6 +17,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 environments.Environments) environments.Environments {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 environments.Environments
 	if rf, ok := ret.Get(0).(func(environments.Environments) environments.Environments); ok {
 		r0 = rf(_a0)
diff --git a/pkg/environments/mocks/Storage.go b/pkg/environments/mocks/Storage.go
index 37b8f6e5..3a8671cd 100644
--- a/pkg/environments/mocks/Storage.go
+++ b/pkg/environments/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type Storage struct {
 func (_m *Storage) Create(ctx context.Context, create *environments.Environment) (*environments.Environment, error) {
 	ret := _m.Called(ctx, create)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *environments.Environment) (*environments.Environment, error)); ok {
@@ -44,6 +48,10 @@ func (_m *Storage) Create(ctx context.Context, create *environments.Environment)
 func (_m *Storage) Delete(ctx context.Context, spaceId string, envId string) error {
 	ret := _m.Called(ctx, spaceId, envId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
 		r0 = rf(ctx, spaceId, envId)
@@ -58,6 +66,10 @@ func (_m *Storage) Delete(ctx context.Context, spaceId string, envId string) err
 func (_m *Storage) Get(ctx context.Context, spaceId string, envId string) (*environments.Environment, error) {
 	ret := _m.Called(ctx, spaceId, envId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
+
 	var r0 *environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*environments.Environment, error)); ok {
@@ -84,6 +96,10 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string) (*envi
 func (_m *Storage) Init(ctx context.Context, spaceID string) error {
 	ret := _m.Called(ctx, spaceID)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Init")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
 		r0 = rf(ctx, spaceID)
@@ -98,6 +114,10 @@ func (_m *Storage) Init(ctx context.Context, spaceID string) error {
 func (_m *Storage) List(ctx context.Context, spaceId string) ([]*environments.Environment, error) {
 	ret := _m.Called(ctx, spaceId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for List")
+	}
+
 	var r0 []*environments.Environment
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) ([]*environments.Environment, error)); ok {
@@ -124,6 +144,10 @@ func (_m *Storage) List(ctx context.Context, spaceId string) ([]*environments.En
 func (_m *Storage) RemoveAlias(ctx context.Context, spaceId string, envId string, alias string) error {
 	ret := _m.Called(ctx, spaceId, envId, alias)
 
+	if len(ret) == 0 {
+		panic("no return value specified for RemoveAlias")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
 		r0 = rf(ctx, spaceId, envId, alias)
@@ -143,6 +167,10 @@ func (_m *Storage) Reset(ctx context.Context, spaceId string) {
 func (_m *Storage) SetAlias(ctx context.Context, spaceId string, envId string, alias string) error {
 	ret := _m.Called(ctx, spaceId, envId, alias)
 
+	if len(ret) == 0 {
+		panic("no return value specified for SetAlias")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
 		r0 = rf(ctx, spaceId, envId, alias)
@@ -164,6 +192,10 @@ func (_m *Storage) Update(ctx context.Context, up *environments.Environment, opt
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 int
 	var r1 int
 	var r2 error
diff --git a/pkg/environments/mocks/spaceGetter.go b/pkg/environments/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/environments/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/environments/service.go b/pkg/environments/service.go
index 920fc043..c4c3a9a5 100644
--- a/pkg/environments/service.go
+++ b/pkg/environments/service.go
@@ -15,13 +15,13 @@ import (
 // @grpc-addr content.environments.Environments
 type Environments interface {
 	Create(ctx context.Context, env *Environment) (created *Environment, err error)
-	Get(ctx context.Context, spaceId, envId string) (env *Environment, err error)
+	Get(ctx context.Context, spaceId, id string) (env *Environment, err error)
 	List(ctx context.Context, spaceId string) (envs []*Environment, err error)
 	Update(ctx context.Context, env *Environment) (err error)
-	Delete(ctx context.Context, spaceId, envId string) (err error)
-	SetAlias(ctx context.Context, spaceId, envId, alias string) (err error)
-	RemoveAlias(ctx context.Context, spaceId, envId, alias string) (err error)
-	Migrate(ctx context.Context, spaceId, envId string, options ...*MigrateOptions) (err error)
+	Delete(ctx context.Context, spaceId, id string) (err error)
+	SetAlias(ctx context.Context, spaceId, id, alias string) (err error)
+	RemoveAlias(ctx context.Context, spaceId, id, alias string) (err error)
+	Migrate(ctx context.Context, spaceId, id string, options ...*MigrateOptions) (err error)
 }
 
 const (
diff --git a/pkg/extension/middleware/telemetry_middleware.go b/pkg/extension/middleware/telemetry_middleware.go
index 7302cab3..10349b31 100644
--- a/pkg/extension/middleware/telemetry_middleware.go
+++ b/pkg/extension/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/extension"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -68,7 +68,7 @@ func (_d telemetryMiddleware) Action(ctx context.Context, in *extension.ActionRe
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -108,7 +108,7 @@ func (_d telemetryMiddleware) Check(ctx context.Context, in *extension.CheckRequ
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -147,7 +147,7 @@ func (_d telemetryMiddleware) Install(ctx context.Context, in *extension.Install
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -186,7 +186,7 @@ func (_d telemetryMiddleware) ListExtensions(ctx context.Context, space string,
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -228,7 +228,7 @@ func (_d telemetryMiddleware) ListRegisteredExtensions(ctx context.Context, exte
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -268,7 +268,7 @@ func (_d telemetryMiddleware) RegisterExtensions(ctx context.Context, ext ...*ex
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -307,7 +307,7 @@ func (_d telemetryMiddleware) Uninstall(ctx context.Context, in *extension.Unins
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -346,7 +346,7 @@ func (_d telemetryMiddleware) UnregisterExtensions(ctx context.Context, ext ...*
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/files/middleware/telemetry_middleware.go b/pkg/files/middleware/telemetry_middleware.go
index e2e482a6..156f9d8b 100644
--- a/pkg/files/middleware/telemetry_middleware.go
+++ b/pkg/files/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/files"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -68,7 +68,7 @@ func (_d telemetryMiddleware) AbortUpload(ctx context.Context, upload *files.Mul
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -107,7 +107,7 @@ func (_d telemetryMiddleware) CompleteUpload(ctx context.Context, upload *files.
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -147,7 +147,7 @@ func (_d telemetryMiddleware) DeleteFile(ctx context.Context, file *files.File)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -186,7 +186,7 @@ func (_d telemetryMiddleware) GetFile(ctx context.Context, file *files.File) (f
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -226,7 +226,7 @@ func (_d telemetryMiddleware) MoveUpload(ctx context.Context, upload *files.Mult
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -266,7 +266,7 @@ func (_d telemetryMiddleware) StartUpload(ctx context.Context, upload *files.Mul
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -306,7 +306,7 @@ func (_d telemetryMiddleware) Upload(ctx context.Context, file *files.File) (u *
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/invitations/middleware/telemetry_middleware.go b/pkg/invitations/middleware/telemetry_middleware.go
index 1696f81a..a80140c1 100644
--- a/pkg/invitations/middleware/telemetry_middleware.go
+++ b/pkg/invitations/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/invitations"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
@@ -85,7 +85,7 @@ func (_d telemetryMiddleware) Accept(ctx context.Context, invitationId string, u
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -141,7 +141,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, invitation *invitation
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -197,7 +197,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, invitationId string) (
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -252,7 +252,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *invitations.Filt
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -310,7 +310,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, invitationId string) (inv
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/items/middleware/access_logging_middleware.go b/pkg/items/middleware/access_logging_middleware.go
index 2342a6d9..e8c68bd4 100644
--- a/pkg/items/middleware/access_logging_middleware.go
+++ b/pkg/items/middleware/access_logging_middleware.go
@@ -208,7 +208,7 @@ func (m *accessLoggingMiddleware) FindPublished(ctx context.Context, spaceId str
 	return items, total, err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetOptions) (item *items.Item, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetOptions) (item *items.Item, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
@@ -216,11 +216,11 @@ func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
 		zap.Reflect("collectionId", collectionId),
-		zap.Reflect("itemId", itemId),
+		zap.Reflect("id", id),
 		zap.Reflect("options", options),
 	)
 
-	item, err = m.next.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = m.next.Get(ctx, spaceId, envId, collectionId, id, options...)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -231,7 +231,7 @@ func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, envId
 	return item, err
 }
 
-func (m *accessLoggingMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
+func (m *accessLoggingMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("GetPublished.Request",
@@ -239,11 +239,11 @@ func (m *accessLoggingMiddleware) GetPublished(ctx context.Context, spaceId stri
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
 		zap.Reflect("collectionId", collectionId),
-		zap.Reflect("itemId", itemId),
+		zap.Reflect("id", id),
 		zap.Reflect("options", options),
 	)
 
-	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, id, options...)
 
 	m.logger.Debug("GetPublished.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -254,7 +254,7 @@ func (m *accessLoggingMiddleware) GetPublished(ctx context.Context, spaceId stri
 	return item, err
 }
 
-func (m *accessLoggingMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
+func (m *accessLoggingMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, id string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("GetRevision.Request",
@@ -262,12 +262,12 @@ func (m *accessLoggingMiddleware) GetRevision(ctx context.Context, spaceId strin
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
 		zap.Reflect("collectionId", collectionId),
-		zap.Reflect("itemId", itemId),
+		zap.Reflect("id", id),
 		zap.Reflect("revisionId", revisionId),
 		zap.Reflect("options", options),
 	)
 
-	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 
 	m.logger.Debug("GetRevision.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -299,7 +299,7 @@ func (m *accessLoggingMiddleware) Introspect(ctx context.Context, item *items.It
 	return itm, sch, err
 }
 
-func (m *accessLoggingMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
+func (m *accessLoggingMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("ListRevisions.Request",
@@ -307,11 +307,11 @@ func (m *accessLoggingMiddleware) ListRevisions(ctx context.Context, spaceId str
 		zap.Reflect("spaceId", spaceId),
 		zap.Reflect("envId", envId),
 		zap.Reflect("collectionId", collectionId),
-		zap.Reflect("itemId", itemId),
+		zap.Reflect("id", id),
 		zap.Reflect("options", options),
 	)
 
-	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, itemId, options...)
+	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, id, options...)
 
 	m.logger.Debug("ListRevisions.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/items/middleware/caching_middleware.go b/pkg/items/middleware/caching_middleware.go
index 60d3bf80..b140e611 100644
--- a/pkg/items/middleware/caching_middleware.go
+++ b/pkg/items/middleware/caching_middleware.go
@@ -33,7 +33,7 @@ type cachingMiddleware struct {
 	service.Items
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*service.GetOptions) (itm *service.Item, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, spaceId, envId, collectionId, id string, options ...*service.GetOptions) (itm *service.Item, err error) {
 	opts := service.MergeGetOptions(options...)
 	localeID := opts.LocaleID
 	if localeID == "" {
@@ -45,7 +45,7 @@ func (m cachingMiddleware) Get(ctx context.Context, spaceId, envId, collectionId
 	// нечастый запрос и содержание кэша с разными переводами себя не оправдывает
 	var value = make(map[string]*service.Item)
 	if len(opts.TranslationsIDs) == 0 {
-		val, e := m.cache.Get(makeKey(spaceId, envId, collectionId, itemId))
+		val, e := m.cache.Get(makeKey(spaceId, envId, collectionId, id))
 		if e == nil {
 			value = val.(map[string]*service.Item)
 			if i, ok := value[localeID]; ok {
@@ -54,7 +54,7 @@ func (m cachingMiddleware) Get(ctx context.Context, spaceId, envId, collectionId
 		}
 	}
 
-	itm, err = m.Items.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+	itm, err = m.Items.Get(ctx, spaceId, envId, collectionId, id, options...)
 	if err == nil {
 		env, err := m.envs.Get(ctx, itm.SpaceID, itm.EnvID)
 		if err != nil {
@@ -123,7 +123,7 @@ func (m cachingMiddleware) Unpublish(ctx context.Context, item *service.Item, op
 	return m.invalidateCache(ctx, item)
 }
 
-func (m cachingMiddleware) GetPublished(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*service.GetPublishedOptions) (itm *service.Item, err error) {
+func (m cachingMiddleware) GetPublished(ctx context.Context, spaceId, envId, collectionId, id string, options ...*service.GetPublishedOptions) (itm *service.Item, err error) {
 	opts := service.MergeGetPublishedOptions(options...)
 	localeID := opts.LocaleID
 	if localeID == "" {
@@ -135,7 +135,7 @@ func (m cachingMiddleware) GetPublished(ctx context.Context, spaceId, envId, col
 	// нечастый запрос и содержание кэша с разными переводами себя не оправдывает
 	var value = make(map[string]*service.Item)
 	if len(opts.TranslationsIDs) == 0 {
-		val, e := m.cachePublished.Get(makeKey(spaceId, envId, collectionId, itemId))
+		val, e := m.cachePublished.Get(makeKey(spaceId, envId, collectionId, id))
 		if e == nil {
 			value = val.(map[string]*service.Item)
 			if i, ok := value[localeID]; ok {
@@ -144,7 +144,7 @@ func (m cachingMiddleware) GetPublished(ctx context.Context, spaceId, envId, col
 		}
 	}
 
-	itm, err = m.Items.GetPublished(ctx, spaceId, envId, collectionId, itemId, opts)
+	itm, err = m.Items.GetPublished(ctx, spaceId, envId, collectionId, id, opts)
 	if err == nil {
 		env, err := m.envs.Get(ctx, itm.SpaceID, itm.EnvID)
 		if err != nil {
diff --git a/pkg/items/middleware/client_encode_middleware.go b/pkg/items/middleware/client_encode_middleware.go
index 873a0e97..13c6e0df 100644
--- a/pkg/items/middleware/client_encode_middleware.go
+++ b/pkg/items/middleware/client_encode_middleware.go
@@ -111,8 +111,8 @@ func (m *encodeDecodeMiddleware) Find(ctx context.Context, spaceId, envId, colle
 	return
 }
 
-func (m *encodeDecodeMiddleware) Get(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*items.GetOptions) (item *items.Item, err error) {
-	item, err = m.next.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+func (m *encodeDecodeMiddleware) Get(ctx context.Context, spaceId, envId, collectionId, id string, options ...*items.GetOptions) (item *items.Item, err error) {
+	item, err = m.next.Get(ctx, spaceId, envId, collectionId, id, options...)
 	if err == nil && item != nil {
 		col, err := m.colls.Get(ctx, spaceId, envId, collectionId)
 		if err != nil {
@@ -157,8 +157,8 @@ func (m *encodeDecodeMiddleware) Unpublish(ctx context.Context, item *items.Item
 	return m.next.Unpublish(ctx, item, opts...)
 }
 
-func (m *encodeDecodeMiddleware) GetPublished(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
-	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, itemId, options...)
+func (m *encodeDecodeMiddleware) GetPublished(ctx context.Context, spaceId, envId, collectionId, id string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
+	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, id, options...)
 	if err == nil && item != nil {
 		col, err := m.colls.Get(ctx, spaceId, envId, collectionId)
 		if err != nil {
@@ -192,8 +192,8 @@ func (m *encodeDecodeMiddleware) FindPublished(ctx context.Context, spaceId, env
 	return
 }
 
-func (m *encodeDecodeMiddleware) GetRevision(ctx context.Context, spaceId, envId, collectionId, itemId, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
-	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+func (m *encodeDecodeMiddleware) GetRevision(ctx context.Context, spaceId, envId, collectionId, id, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
+	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 	if err == nil && item != nil {
 		col, err := m.colls.Get(ctx, spaceId, envId, collectionId)
 		if err != nil {
@@ -208,8 +208,8 @@ func (m *encodeDecodeMiddleware) GetRevision(ctx context.Context, spaceId, envId
 	return
 }
 
-func (m *encodeDecodeMiddleware) ListRevisions(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
-	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, itemId, options...)
+func (m *encodeDecodeMiddleware) ListRevisions(ctx context.Context, spaceId, envId, collectionId, id string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
+	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, id, options...)
 	if err == nil && len(items) > 0 {
 		col, err := m.colls.Get(ctx, spaceId, envId, collectionId)
 		if err != nil {
diff --git a/pkg/items/middleware/logging_middleware.go b/pkg/items/middleware/logging_middleware.go
index 1178719e..4ac01fd5 100644
--- a/pkg/items/middleware/logging_middleware.go
+++ b/pkg/items/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/items"
 	"git.perx.ru/perxis/perxis-go/pkg/schema"
 	logzap "git.perx.ru/perxis/perxis-go/zap"
@@ -157,13 +157,13 @@ func (m *loggingMiddleware) FindPublished(ctx context.Context, spaceId string, e
 	return items, total, err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetOptions) (item *items.Item, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetOptions) (item *items.Item, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
-		logzap.Object(id.NewItemId(spaceId, envId, collectionId, itemId)),
+		logzap.Object(pkgId.NewItemId(spaceId, envId, collectionId, id)),
 	)
 
-	item, err = m.next.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = m.next.Get(ctx, spaceId, envId, collectionId, id, options...)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
@@ -172,13 +172,13 @@ func (m *loggingMiddleware) Get(ctx context.Context, spaceId string, envId strin
 	return item, err
 }
 
-func (m *loggingMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
+func (m *loggingMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
-		logzap.Object(id.NewItemId(spaceId, envId, collectionId, itemId)),
+		logzap.Object(pkgId.NewItemId(spaceId, envId, collectionId, id)),
 	)
 
-	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = m.next.GetPublished(ctx, spaceId, envId, collectionId, id, options...)
 	if err != nil {
 		logger.Error("Failed to get published", zap.Error(err))
 		return
@@ -187,13 +187,13 @@ func (m *loggingMiddleware) GetPublished(ctx context.Context, spaceId string, en
 	return item, err
 }
 
-func (m *loggingMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
+func (m *loggingMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, id string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
-		logzap.Object(id.NewItemId(spaceId, envId, collectionId, itemId)),
+		logzap.Object(pkgId.NewItemId(spaceId, envId, collectionId, id)),
 	)
 
-	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+	item, err = m.next.GetRevision(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 	if err != nil {
 		logger.Error("Failed to get revision", zap.Error(err))
 		return
@@ -221,13 +221,13 @@ func (m *loggingMiddleware) Introspect(ctx context.Context, item *items.Item, op
 	return itm, sch, err
 }
 
-func (m *loggingMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
+func (m *loggingMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx, logzap.WithSpace(spaceId)),
-		logzap.Object(id.NewItemId(spaceId, envId, collectionId, itemId)),
+		logzap.Object(pkgId.NewItemId(spaceId, envId, collectionId, id)),
 	)
 
-	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, itemId, options...)
+	items, err = m.next.ListRevisions(ctx, spaceId, envId, collectionId, id, options...)
 	if err != nil {
 		logger.Error("Failed to list revisions", zap.Error(err))
 		return
diff --git a/pkg/items/middleware/recovering_middleware.go b/pkg/items/middleware/recovering_middleware.go
index d719dd11..8db90e7f 100644
--- a/pkg/items/middleware/recovering_middleware.go
+++ b/pkg/items/middleware/recovering_middleware.go
@@ -127,7 +127,7 @@ func (m *recoveringMiddleware) FindPublished(ctx context.Context, spaceId string
 	return m.next.FindPublished(ctx, spaceId, envId, collectionId, filter, options...)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetOptions) (item *items.Item, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetOptions) (item *items.Item, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -136,10 +136,10 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, envId st
 		}
 	}()
 
-	return m.next.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+	return m.next.Get(ctx, spaceId, envId, collectionId, id, options...)
 }
 
-func (m *recoveringMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
+func (m *recoveringMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -148,10 +148,10 @@ func (m *recoveringMiddleware) GetPublished(ctx context.Context, spaceId string,
 		}
 	}()
 
-	return m.next.GetPublished(ctx, spaceId, envId, collectionId, itemId, options...)
+	return m.next.GetPublished(ctx, spaceId, envId, collectionId, id, options...)
 }
 
-func (m *recoveringMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
+func (m *recoveringMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, id string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -160,7 +160,7 @@ func (m *recoveringMiddleware) GetRevision(ctx context.Context, spaceId string,
 		}
 	}()
 
-	return m.next.GetRevision(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+	return m.next.GetRevision(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 }
 
 func (m *recoveringMiddleware) Introspect(ctx context.Context, item *items.Item, opts ...*items.IntrospectOptions) (itm *items.Item, sch *schema.Schema, err error) {
@@ -175,7 +175,7 @@ func (m *recoveringMiddleware) Introspect(ctx context.Context, item *items.Item,
 	return m.next.Introspect(ctx, item, opts...)
 }
 
-func (m *recoveringMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
+func (m *recoveringMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -184,7 +184,7 @@ func (m *recoveringMiddleware) ListRevisions(ctx context.Context, spaceId string
 		}
 	}()
 
-	return m.next.ListRevisions(ctx, spaceId, envId, collectionId, itemId, options...)
+	return m.next.ListRevisions(ctx, spaceId, envId, collectionId, id, options...)
 }
 
 func (m *recoveringMiddleware) Publish(ctx context.Context, item *items.Item, options ...*items.PublishOptions) (err error) {
diff --git a/pkg/items/middleware/telemetry_middleware.go b/pkg/items/middleware/telemetry_middleware.go
index da626aa5..08ff9751 100644
--- a/pkg/items/middleware/telemetry_middleware.go
+++ b/pkg/items/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/items"
 	"git.perx.ru/perxis/perxis-go/pkg/schema"
@@ -74,7 +74,7 @@ func (_d telemetryMiddleware) Aggregate(ctx context.Context, spaceId string, env
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -123,7 +123,7 @@ func (_d telemetryMiddleware) AggregatePublished(ctx context.Context, spaceId st
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -183,7 +183,7 @@ func (_d telemetryMiddleware) Archive(ctx context.Context, item *items.Item, opt
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -239,7 +239,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, item *items.Item, opts
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -296,7 +296,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, item *items.Item, opti
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -341,7 +341,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, spaceId string, envId st
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -391,7 +391,7 @@ func (_d telemetryMiddleware) FindArchived(ctx context.Context, spaceId string,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -441,7 +441,7 @@ func (_d telemetryMiddleware) FindPublished(ctx context.Context, spaceId string,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -471,7 +471,7 @@ func (_d telemetryMiddleware) FindPublished(ctx context.Context, spaceId string,
 }
 
 // Get implements items.Items
-func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetOptions) (item *items.Item, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetOptions) (item *items.Item, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Items"),
 		attribute.String("method", "Get"),
@@ -482,7 +482,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Items.Get")
 	defer _span.End()
 
-	item, err = _d.Items.Get(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = _d.Items.Get(ctx, spaceId, envId, collectionId, id, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -491,7 +491,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -504,7 +504,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 			"spaceId":      spaceId,
 			"envId":        envId,
 			"collectionId": collectionId,
-			"itemId":       itemId,
+			"id":           id,
 			"options":      options}, map[string]interface{}{
 			"item": item,
 			"err":  err})
@@ -520,7 +520,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 }
 
 // GetPublished implements items.Items
-func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
+func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetPublishedOptions) (item *items.Item, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Items"),
 		attribute.String("method", "GetPublished"),
@@ -531,7 +531,7 @@ func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string,
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Items.GetPublished")
 	defer _span.End()
 
-	item, err = _d.Items.GetPublished(ctx, spaceId, envId, collectionId, itemId, options...)
+	item, err = _d.Items.GetPublished(ctx, spaceId, envId, collectionId, id, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -540,7 +540,7 @@ func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -553,7 +553,7 @@ func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string,
 			"spaceId":      spaceId,
 			"envId":        envId,
 			"collectionId": collectionId,
-			"itemId":       itemId,
+			"id":           id,
 			"options":      options}, map[string]interface{}{
 			"item": item,
 			"err":  err})
@@ -569,7 +569,7 @@ func (_d telemetryMiddleware) GetPublished(ctx context.Context, spaceId string,
 }
 
 // GetRevision implements items.Items
-func (_d telemetryMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
+func (_d telemetryMiddleware) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, id string, revisionId string, options ...*items.GetRevisionOptions) (item *items.Item, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Items"),
 		attribute.String("method", "GetRevision"),
@@ -580,7 +580,7 @@ func (_d telemetryMiddleware) GetRevision(ctx context.Context, spaceId string, e
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Items.GetRevision")
 	defer _span.End()
 
-	item, err = _d.Items.GetRevision(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+	item, err = _d.Items.GetRevision(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -589,7 +589,7 @@ func (_d telemetryMiddleware) GetRevision(ctx context.Context, spaceId string, e
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -602,7 +602,7 @@ func (_d telemetryMiddleware) GetRevision(ctx context.Context, spaceId string, e
 			"spaceId":      spaceId,
 			"envId":        envId,
 			"collectionId": collectionId,
-			"itemId":       itemId,
+			"id":           id,
 			"revisionId":   revisionId,
 			"options":      options}, map[string]interface{}{
 			"item": item,
@@ -650,7 +650,7 @@ func (_d telemetryMiddleware) Introspect(ctx context.Context, item *items.Item,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -677,7 +677,7 @@ func (_d telemetryMiddleware) Introspect(ctx context.Context, item *items.Item,
 }
 
 // ListRevisions implements items.Items
-func (_d telemetryMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
+func (_d telemetryMiddleware) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.ListRevisionsOptions) (items []*items.Item, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Items"),
 		attribute.String("method", "ListRevisions"),
@@ -688,7 +688,7 @@ func (_d telemetryMiddleware) ListRevisions(ctx context.Context, spaceId string,
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Items.ListRevisions")
 	defer _span.End()
 
-	items, err = _d.Items.ListRevisions(ctx, spaceId, envId, collectionId, itemId, options...)
+	items, err = _d.Items.ListRevisions(ctx, spaceId, envId, collectionId, id, options...)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -697,7 +697,7 @@ func (_d telemetryMiddleware) ListRevisions(ctx context.Context, spaceId string,
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -710,7 +710,7 @@ func (_d telemetryMiddleware) ListRevisions(ctx context.Context, spaceId string,
 			"spaceId":      spaceId,
 			"envId":        envId,
 			"collectionId": collectionId,
-			"itemId":       itemId,
+			"id":           id,
 			"options":      options}, map[string]interface{}{
 			"items": items,
 			"err":   err})
@@ -757,7 +757,7 @@ func (_d telemetryMiddleware) Publish(ctx context.Context, item *items.Item, opt
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -813,7 +813,7 @@ func (_d telemetryMiddleware) Unarchive(ctx context.Context, item *items.Item, o
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -869,7 +869,7 @@ func (_d telemetryMiddleware) Undelete(ctx context.Context, item *items.Item, op
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -925,7 +925,7 @@ func (_d telemetryMiddleware) Unpublish(ctx context.Context, item *items.Item, o
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -981,7 +981,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, item *items.Item, opti
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/items/mocks/Decoder.go b/pkg/items/mocks/Decoder.go
index fcc4d502..1d3208d2 100644
--- a/pkg/items/mocks/Decoder.go
+++ b/pkg/items/mocks/Decoder.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -13,7 +13,7 @@ type Decoder struct {
 }
 
 // Decode provides a mock function with given fields: value, item
-func (_m *Decoder) Decode(value interface{}, item *items.Item) error {
+func (_m *Decoder) Decode(value any, item *items.Item) error {
 	ret := _m.Called(value, item)
 
 	if len(ret) == 0 {
@@ -21,7 +21,7 @@ func (_m *Decoder) Decode(value interface{}, item *items.Item) error {
 	}
 
 	var r0 error
-	if rf, ok := ret.Get(0).(func(interface{}, *items.Item) error); ok {
+	if rf, ok := ret.Get(0).(func(any, *items.Item) error); ok {
 		r0 = rf(value, item)
 	} else {
 		r0 = ret.Error(0)
diff --git a/pkg/items/mocks/Encoder.go b/pkg/items/mocks/Encoder.go
index cd2dd5c9..6af2b841 100644
--- a/pkg/items/mocks/Encoder.go
+++ b/pkg/items/mocks/Encoder.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -13,23 +13,23 @@ type Encoder struct {
 }
 
 // Encode provides a mock function with given fields: item
-func (_m *Encoder) Encode(item *items.Item) (interface{}, error) {
+func (_m *Encoder) Encode(item *items.Item) (any, error) {
 	ret := _m.Called(item)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Encode")
 	}
 
-	var r0 interface{}
+	var r0 any
 	var r1 error
-	if rf, ok := ret.Get(0).(func(*items.Item) (interface{}, error)); ok {
+	if rf, ok := ret.Get(0).(func(*items.Item) (any, error)); ok {
 		return rf(item)
 	}
-	if rf, ok := ret.Get(0).(func(*items.Item) interface{}); ok {
+	if rf, ok := ret.Get(0).(func(*items.Item) any); ok {
 		r0 = rf(item)
 	} else {
 		if ret.Get(0) != nil {
-			r0 = ret.Get(0).(interface{})
+			r0 = ret.Get(0).(any)
 		}
 	}
 
diff --git a/pkg/items/mocks/Items.go b/pkg/items/mocks/Items.go
index e134822e..4a073fce 100644
--- a/pkg/items/mocks/Items.go
+++ b/pkg/items/mocks/Items.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -309,14 +309,14 @@ func (_m *Items) FindPublished(ctx context.Context, spaceId string, envId string
 	return r0, r1, r2
 }
 
-// Get provides a mock function with given fields: ctx, spaceId, envId, collectionId, itemId, options
-func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetOptions) (*items.Item, error) {
+// Get provides a mock function with given fields: ctx, spaceId, envId, collectionId, id, options
+func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetOptions) (*items.Item, error) {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId, collectionId, itemId)
+	_ca = append(_ca, ctx, spaceId, envId, collectionId, id)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
@@ -327,10 +327,10 @@ func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collecti
 	var r0 *items.Item
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetOptions) (*items.Item, error)); ok {
-		return rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		return rf(ctx, spaceId, envId, collectionId, id, options...)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetOptions) *items.Item); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r0 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*items.Item)
@@ -338,7 +338,7 @@ func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collecti
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetOptions) error); ok {
-		r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r1 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -346,14 +346,14 @@ func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collecti
 	return r0, r1
 }
 
-// GetPublished provides a mock function with given fields: ctx, spaceId, envId, collectionId, itemId, options
-func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.GetPublishedOptions) (*items.Item, error) {
+// GetPublished provides a mock function with given fields: ctx, spaceId, envId, collectionId, id, options
+func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.GetPublishedOptions) (*items.Item, error) {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId, collectionId, itemId)
+	_ca = append(_ca, ctx, spaceId, envId, collectionId, id)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
@@ -364,10 +364,10 @@ func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string,
 	var r0 *items.Item
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) (*items.Item, error)); ok {
-		return rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		return rf(ctx, spaceId, envId, collectionId, id, options...)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) *items.Item); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r0 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*items.Item)
@@ -375,7 +375,7 @@ func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string,
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) error); ok {
-		r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r1 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -383,14 +383,14 @@ func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string,
 	return r0, r1
 }
 
-// GetRevision provides a mock function with given fields: ctx, spaceId, envId, collectionId, itemId, revisionId, options
-func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, revisionId string, options ...*items.GetRevisionOptions) (*items.Item, error) {
+// GetRevision provides a mock function with given fields: ctx, spaceId, envId, collectionId, id, revisionId, options
+func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string, collectionId string, id string, revisionId string, options ...*items.GetRevisionOptions) (*items.Item, error) {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId, collectionId, itemId, revisionId)
+	_ca = append(_ca, ctx, spaceId, envId, collectionId, id, revisionId)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
@@ -401,10 +401,10 @@ func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string,
 	var r0 *items.Item
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) (*items.Item, error)); ok {
-		return rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+		return rf(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) *items.Item); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+		r0 = rf(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*items.Item)
@@ -412,7 +412,7 @@ func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string,
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) error); ok {
-		r1 = rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...)
+		r1 = rf(ctx, spaceId, envId, collectionId, id, revisionId, options...)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -466,14 +466,14 @@ func (_m *Items) Introspect(ctx context.Context, item *items.Item, opts ...*item
 	return r0, r1, r2
 }
 
-// ListRevisions provides a mock function with given fields: ctx, spaceId, envId, collectionId, itemId, options
-func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, itemId string, options ...*items.ListRevisionsOptions) ([]*items.Item, error) {
+// ListRevisions provides a mock function with given fields: ctx, spaceId, envId, collectionId, id, options
+func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string, collectionId string, id string, options ...*items.ListRevisionsOptions) ([]*items.Item, error) {
 	_va := make([]interface{}, len(options))
 	for _i := range options {
 		_va[_i] = options[_i]
 	}
 	var _ca []interface{}
-	_ca = append(_ca, ctx, spaceId, envId, collectionId, itemId)
+	_ca = append(_ca, ctx, spaceId, envId, collectionId, id)
 	_ca = append(_ca, _va...)
 	ret := _m.Called(_ca...)
 
@@ -484,10 +484,10 @@ func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string
 	var r0 []*items.Item
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) ([]*items.Item, error)); ok {
-		return rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		return rf(ctx, spaceId, envId, collectionId, id, options...)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) []*items.Item); ok {
-		r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r0 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).([]*items.Item)
@@ -495,7 +495,7 @@ func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) error); ok {
-		r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
+		r1 = rf(ctx, spaceId, envId, collectionId, id, options...)
 	} else {
 		r1 = ret.Error(1)
 	}
diff --git a/pkg/items/mocks/Middleware.go b/pkg/items/mocks/Middleware.go
index 0bebef84..92a5017f 100644
--- a/pkg/items/mocks/Middleware.go
+++ b/pkg/items/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
diff --git a/pkg/items/mocks/Storage.go b/pkg/items/mocks/Storage.go
index 4ce04d02..f1c6e1bb 100644
--- a/pkg/items/mocks/Storage.go
+++ b/pkg/items/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.45.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
diff --git a/pkg/items/mocks/spaceGetter.go b/pkg/items/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/items/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/items/service.go b/pkg/items/service.go
index 1f4f2867..dba76011 100644
--- a/pkg/items/service.go
+++ b/pkg/items/service.go
@@ -16,7 +16,7 @@ import (
 type Items interface {
 	Create(ctx context.Context, item *Item, opts ...*CreateOptions) (created *Item, err error)
 	Introspect(ctx context.Context, item *Item, opts ...*IntrospectOptions) (itm *Item, sch *schema.Schema, err error)
-	Get(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*GetOptions) (item *Item, err error)
+	Get(ctx context.Context, spaceId, envId, collectionId, id string, options ...*GetOptions) (item *Item, err error)
 	Find(ctx context.Context, spaceId, envId, collectionId string, filter *Filter, options ...*FindOptions) (items []*Item, total int, err error)
 	Update(ctx context.Context, item *Item, options ...*UpdateOptions) (err error)
 
@@ -30,11 +30,11 @@ type Items interface {
 
 	Publish(ctx context.Context, item *Item, options ...*PublishOptions) (err error)
 	Unpublish(ctx context.Context, item *Item, options ...*UnpublishOptions) (err error)
-	GetPublished(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*GetPublishedOptions) (item *Item, err error)
+	GetPublished(ctx context.Context, spaceId, envId, collectionId, id string, options ...*GetPublishedOptions) (item *Item, err error)
 	FindPublished(ctx context.Context, spaceId, envId, collectionId string, filter *Filter, options ...*FindPublishedOptions) (items []*Item, total int, err error)
 
-	GetRevision(ctx context.Context, spaceId, envId, collectionId, itemId, revisionId string, options ...*GetRevisionOptions) (item *Item, err error)
-	ListRevisions(ctx context.Context, spaceId, envId, collectionId, itemId string, options ...*ListRevisionsOptions) (items []*Item, err error)
+	GetRevision(ctx context.Context, spaceId, envId, collectionId, id, revisionId string, options ...*GetRevisionOptions) (item *Item, err error)
+	ListRevisions(ctx context.Context, spaceId, envId, collectionId, id string, options ...*ListRevisionsOptions) (items []*Item, err error)
 
 	Archive(ctx context.Context, item *Item, options ...*ArchiveOptions) (err error)
 	FindArchived(ctx context.Context, spaceId, envId, collectionId string, filter *Filter, options ...*FindArchivedOptions) (items []*Item, total int, err error)
diff --git a/pkg/locales/middleware/access_logging_middleware.go b/pkg/locales/middleware/access_logging_middleware.go
index ab31fc8c..bf2b6619 100644
--- a/pkg/locales/middleware/access_logging_middleware.go
+++ b/pkg/locales/middleware/access_logging_middleware.go
@@ -50,16 +50,16 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, locale *locales.Lo
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, localeId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("localeId", localeId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, spaceId, localeId)
+	err = m.next.Delete(ctx, spaceId, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/locales/middleware/caching_middleware.go b/pkg/locales/middleware/caching_middleware.go
index 64f82bc2..f993a80a 100644
--- a/pkg/locales/middleware/caching_middleware.go
+++ b/pkg/locales/middleware/caching_middleware.go
@@ -54,9 +54,9 @@ func (m cachingMiddleware) List(ctx context.Context, spaceId string) (locales []
 	return nil, err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, localeId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 
-	err = m.next.Delete(ctx, spaceId, localeId)
+	err = m.next.Delete(ctx, spaceId, id)
 	if err == nil {
 		_ = m.cache.Remove(spaceId)
 	}
diff --git a/pkg/locales/middleware/error_logging_middleware.go b/pkg/locales/middleware/error_logging_middleware.go
index 0dd4ae2e..74f4ce72 100644
--- a/pkg/locales/middleware/error_logging_middleware.go
+++ b/pkg/locales/middleware/error_logging_middleware.go
@@ -39,14 +39,14 @@ func (m *errorLoggingMiddleware) Create(ctx context.Context, locale *locales.Loc
 	return m.next.Create(ctx, locale)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, localeId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, spaceId, localeId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
 func (m *errorLoggingMiddleware) List(ctx context.Context, spaceId string) (locales []*locales.Locale, err error) {
diff --git a/pkg/locales/middleware/logging_middleware.go b/pkg/locales/middleware/logging_middleware.go
index 2b6bfea5..22ea6a82 100644
--- a/pkg/locales/middleware/logging_middleware.go
+++ b/pkg/locales/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/locales"
 	logzap "git.perx.ru/perxis/perxis-go/zap"
 	"go.uber.org/zap"
@@ -70,14 +70,14 @@ func (m *loggingMiddleware) List(ctx context.Context, spaceId string) (locales [
 	return locales, err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, spaceId, localeId string) (err error) {
+func (m *loggingMiddleware) Delete(ctx context.Context, spaceId, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(locales.EventDelete),
-		logzap.Object(id.NewLocaleId(spaceId, localeId)),
+		logzap.Object(pkgId.NewLocaleId(spaceId, id)),
 	)
 
-	err = m.next.Delete(ctx, spaceId, localeId)
+	err = m.next.Delete(ctx, spaceId, id)
 	if err != nil {
 		logger.Error("Failed to delete", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
diff --git a/pkg/locales/middleware/recovering_middleware.go b/pkg/locales/middleware/recovering_middleware.go
index 85f14bdb..586e2305 100644
--- a/pkg/locales/middleware/recovering_middleware.go
+++ b/pkg/locales/middleware/recovering_middleware.go
@@ -42,7 +42,7 @@ func (m *recoveringMiddleware) Create(ctx context.Context, locale *locales.Local
 	return m.next.Create(ctx, locale)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, localeId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -51,7 +51,7 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, local
 		}
 	}()
 
-	return m.next.Delete(ctx, spaceId, localeId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
 func (m *recoveringMiddleware) List(ctx context.Context, spaceId string) (locales []*locales.Locale, err error) {
diff --git a/pkg/locales/middleware/telemetry_middleware.go b/pkg/locales/middleware/telemetry_middleware.go
index 709a6bab..8016481d 100644
--- a/pkg/locales/middleware/telemetry_middleware.go
+++ b/pkg/locales/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/locales"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -84,7 +84,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, locale *locales.Locale
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -109,7 +109,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, locale *locales.Locale
 }
 
 // Delete implements locales.Locales
-func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, localeId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Locales"),
 		attribute.String("method", "Delete"),
@@ -120,7 +120,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, locale
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Locales.Delete")
 	defer _span.End()
 
-	err = _d.Locales.Delete(ctx, spaceId, localeId)
+	err = _d.Locales.Delete(ctx, spaceId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -129,7 +129,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, locale
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -138,9 +138,9 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, locale
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":      ctx,
-			"spaceId":  spaceId,
-			"localeId": localeId}, map[string]interface{}{
+			"ctx":     ctx,
+			"spaceId": spaceId,
+			"id":      id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -174,7 +174,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string) (locales
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -230,7 +230,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, locale *locales.Locale
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/locales/mocks/LocaleCreatedObserver.go b/pkg/locales/mocks/LocaleCreatedObserver.go
new file mode 100644
index 00000000..8c917066
--- /dev/null
+++ b/pkg/locales/mocks/LocaleCreatedObserver.go
@@ -0,0 +1,57 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import (
+	context "context"
+
+	locales "git.perx.ru/perxis/perxis-go/pkg/locales"
+	mock "github.com/stretchr/testify/mock"
+)
+
+// LocaleCreatedObserver is an autogenerated mock type for the LocaleCreatedObserver type
+type LocaleCreatedObserver struct {
+	mock.Mock
+}
+
+// OnLocaleCreated provides a mock function with given fields: ctx, locale
+func (_m *LocaleCreatedObserver) OnLocaleCreated(ctx context.Context, locale *locales.Locale) (string, error) {
+	ret := _m.Called(ctx, locale)
+
+	if len(ret) == 0 {
+		panic("no return value specified for OnLocaleCreated")
+	}
+
+	var r0 string
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale) (string, error)); ok {
+		return rf(ctx, locale)
+	}
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale) string); ok {
+		r0 = rf(ctx, locale)
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	if rf, ok := ret.Get(1).(func(context.Context, *locales.Locale) error); ok {
+		r1 = rf(ctx, locale)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
+// NewLocaleCreatedObserver creates a new instance of LocaleCreatedObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewLocaleCreatedObserver(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *LocaleCreatedObserver {
+	mock := &LocaleCreatedObserver{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/locales/mocks/LocaleDeletedObserver.go b/pkg/locales/mocks/LocaleDeletedObserver.go
new file mode 100644
index 00000000..f5862d9b
--- /dev/null
+++ b/pkg/locales/mocks/LocaleDeletedObserver.go
@@ -0,0 +1,57 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import (
+	context "context"
+
+	locales "git.perx.ru/perxis/perxis-go/pkg/locales"
+	mock "github.com/stretchr/testify/mock"
+)
+
+// LocaleDeletedObserver is an autogenerated mock type for the LocaleDeletedObserver type
+type LocaleDeletedObserver struct {
+	mock.Mock
+}
+
+// OnLocaleDeleted provides a mock function with given fields: ctx, locale
+func (_m *LocaleDeletedObserver) OnLocaleDeleted(ctx context.Context, locale *locales.Locale) (string, error) {
+	ret := _m.Called(ctx, locale)
+
+	if len(ret) == 0 {
+		panic("no return value specified for OnLocaleDeleted")
+	}
+
+	var r0 string
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale) (string, error)); ok {
+		return rf(ctx, locale)
+	}
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale) string); ok {
+		r0 = rf(ctx, locale)
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	if rf, ok := ret.Get(1).(func(context.Context, *locales.Locale) error); ok {
+		r1 = rf(ctx, locale)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
+// NewLocaleDeletedObserver creates a new instance of LocaleDeletedObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewLocaleDeletedObserver(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *LocaleDeletedObserver {
+	mock := &LocaleDeletedObserver{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/locales/mocks/LocaleUpdatedObserver.go b/pkg/locales/mocks/LocaleUpdatedObserver.go
new file mode 100644
index 00000000..1e3b395c
--- /dev/null
+++ b/pkg/locales/mocks/LocaleUpdatedObserver.go
@@ -0,0 +1,57 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import (
+	context "context"
+
+	locales "git.perx.ru/perxis/perxis-go/pkg/locales"
+	mock "github.com/stretchr/testify/mock"
+)
+
+// LocaleUpdatedObserver is an autogenerated mock type for the LocaleUpdatedObserver type
+type LocaleUpdatedObserver struct {
+	mock.Mock
+}
+
+// OnLocaleUpdated provides a mock function with given fields: ctx, before, locale
+func (_m *LocaleUpdatedObserver) OnLocaleUpdated(ctx context.Context, before *locales.Locale, locale *locales.Locale) (string, error) {
+	ret := _m.Called(ctx, before, locale)
+
+	if len(ret) == 0 {
+		panic("no return value specified for OnLocaleUpdated")
+	}
+
+	var r0 string
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale, *locales.Locale) (string, error)); ok {
+		return rf(ctx, before, locale)
+	}
+	if rf, ok := ret.Get(0).(func(context.Context, *locales.Locale, *locales.Locale) string); ok {
+		r0 = rf(ctx, before, locale)
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	if rf, ok := ret.Get(1).(func(context.Context, *locales.Locale, *locales.Locale) error); ok {
+		r1 = rf(ctx, before, locale)
+	} else {
+		r1 = ret.Error(1)
+	}
+
+	return r0, r1
+}
+
+// NewLocaleUpdatedObserver creates a new instance of LocaleUpdatedObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewLocaleUpdatedObserver(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *LocaleUpdatedObserver {
+	mock := &LocaleUpdatedObserver{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/locales/mocks/Locales.go b/pkg/locales/mocks/Locales.go
index 6519e3cc..7f17c386 100644
--- a/pkg/locales/mocks/Locales.go
+++ b/pkg/locales/mocks/Locales.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -44,9 +44,9 @@ func (_m *Locales) Create(ctx context.Context, locale *locales.Locale) (*locales
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, spaceId, localeId
-func (_m *Locales) Delete(ctx context.Context, spaceId string, localeId string) error {
-	ret := _m.Called(ctx, spaceId, localeId)
+// Delete provides a mock function with given fields: ctx, spaceId, id
+func (_m *Locales) Delete(ctx context.Context, spaceId string, id string) error {
+	ret := _m.Called(ctx, spaceId, id)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Delete")
@@ -54,7 +54,7 @@ func (_m *Locales) Delete(ctx context.Context, spaceId string, localeId string)
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
-		r0 = rf(ctx, spaceId, localeId)
+		r0 = rf(ctx, spaceId, id)
 	} else {
 		r0 = ret.Error(0)
 	}
diff --git a/pkg/locales/mocks/Middleware.go b/pkg/locales/mocks/Middleware.go
index bab6711d..11136a3b 100644
--- a/pkg/locales/mocks/Middleware.go
+++ b/pkg/locales/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.15.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -17,6 +17,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 locales.Locales) locales.Locales {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 locales.Locales
 	if rf, ok := ret.Get(0).(func(locales.Locales) locales.Locales); ok {
 		r0 = rf(_a0)
@@ -29,13 +33,12 @@ func (_m *Middleware) Execute(_a0 locales.Locales) locales.Locales {
 	return r0
 }
 
-type mockConstructorTestingTNewMiddleware interface {
+// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewMiddleware(t interface {
 	mock.TestingT
 	Cleanup(func())
-}
-
-// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
+}) *Middleware {
 	mock := &Middleware{}
 	mock.Mock.Test(t)
 
diff --git a/pkg/locales/mocks/Storage.go b/pkg/locales/mocks/Storage.go
index 42946781..af42d883 100644
--- a/pkg/locales/mocks/Storage.go
+++ b/pkg/locales/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.43.2. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
diff --git a/pkg/locales/mocks/spaceGetter.go b/pkg/locales/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/locales/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/locales/service.go b/pkg/locales/service.go
index ba303e13..1c1f136e 100644
--- a/pkg/locales/service.go
+++ b/pkg/locales/service.go
@@ -11,5 +11,5 @@ type Locales interface {
 	Create(ctx context.Context, locale *Locale) (created *Locale, err error)
 	Update(ctx context.Context, locale *Locale) (err error)
 	List(ctx context.Context, spaceId string) (locales []*Locale, err error)
-	Delete(ctx context.Context, spaceId, localeId string) (err error)
+	Delete(ctx context.Context, spaceId, id string) (err error)
 }
diff --git a/pkg/members/middleware/telemetry_middleware.go b/pkg/members/middleware/telemetry_middleware.go
index bf339f3f..04dc47d3 100644
--- a/pkg/members/middleware/telemetry_middleware.go
+++ b/pkg/members/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/members"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -68,7 +68,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, orgId string, userId stri
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -109,7 +109,7 @@ func (_d telemetryMiddleware) ListMembers(ctx context.Context, orgId string) (me
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -149,7 +149,7 @@ func (_d telemetryMiddleware) ListOrganizations(ctx context.Context, userId stri
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -189,7 +189,7 @@ func (_d telemetryMiddleware) Remove(ctx context.Context, orgId string, userId s
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -229,7 +229,7 @@ func (_d telemetryMiddleware) RemoveAll(ctx context.Context, orgId string) (err
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -268,7 +268,7 @@ func (_d telemetryMiddleware) Set(ctx context.Context, orgId string, userId stri
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/organizations/middleware/access_logging_middleware.go b/pkg/organizations/middleware/access_logging_middleware.go
index be6e937d..ec70800a 100644
--- a/pkg/organizations/middleware/access_logging_middleware.go
+++ b/pkg/organizations/middleware/access_logging_middleware.go
@@ -51,15 +51,15 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, org *organizations
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("orgId", orgId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, orgId)
+	err = m.next.Delete(ctx, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -90,15 +90,15 @@ func (m *accessLoggingMiddleware) Find(ctx context.Context, filter *organization
 	return orgs, total, err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, orgId string) (org *organizations.Organization, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, id string) (org *organizations.Organization, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("orgId", orgId),
+		zap.Reflect("id", id),
 	)
 
-	org, err = m.next.Get(ctx, orgId)
+	org, err = m.next.Get(ctx, id)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/organizations/middleware/caching_middleware.go b/pkg/organizations/middleware/caching_middleware.go
index c6503200..7343b000 100644
--- a/pkg/organizations/middleware/caching_middleware.go
+++ b/pkg/organizations/middleware/caching_middleware.go
@@ -26,15 +26,15 @@ func (m cachingMiddleware) Create(ctx context.Context, org *service.Organization
 	return m.next.Create(ctx, org)
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, orgId string) (organization *service.Organization, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, id string) (organization *service.Organization, err error) {
 
-	value, e := m.cache.Get(orgId)
+	value, e := m.cache.Get(id)
 	if e == nil {
 		return value.(*service.Organization).Clone(), nil
 	}
-	organization, err = m.next.Get(ctx, orgId)
+	organization, err = m.next.Get(ctx, id)
 	if err == nil {
-		_ = m.cache.Set(orgId, organization)
+		_ = m.cache.Set(id, organization)
 		return organization.Clone(), nil
 	}
 	return nil, err
@@ -49,11 +49,11 @@ func (m cachingMiddleware) Update(ctx context.Context, org *service.Organization
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, id string) (err error) {
 
-	err = m.next.Delete(ctx, orgId)
+	err = m.next.Delete(ctx, id)
 	if err == nil {
-		_ = m.cache.Remove(orgId)
+		_ = m.cache.Remove(id)
 	}
 	return err
 }
diff --git a/pkg/organizations/middleware/error_logging_middleware.go b/pkg/organizations/middleware/error_logging_middleware.go
index 2d6db819..145e15f0 100644
--- a/pkg/organizations/middleware/error_logging_middleware.go
+++ b/pkg/organizations/middleware/error_logging_middleware.go
@@ -40,14 +40,14 @@ func (m *errorLoggingMiddleware) Create(ctx context.Context, org *organizations.
 	return m.next.Create(ctx, org)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, orgId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *organizations.Filter, opts *options.FindOptions) (orgs []*organizations.Organization, total int, err error) {
@@ -60,14 +60,14 @@ func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *organizations
 	return m.next.Find(ctx, filter, opts)
 }
 
-func (m *errorLoggingMiddleware) Get(ctx context.Context, orgId string) (org *organizations.Organization, err error) {
+func (m *errorLoggingMiddleware) Get(ctx context.Context, id string) (org *organizations.Organization, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Get(ctx, orgId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) Update(ctx context.Context, org *organizations.Organization) (err error) {
diff --git a/pkg/organizations/middleware/logging_middleware.go b/pkg/organizations/middleware/logging_middleware.go
index bda7f54f..ae3481ae 100644
--- a/pkg/organizations/middleware/logging_middleware.go
+++ b/pkg/organizations/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/organizations"
 
 	"git.perx.ru/perxis/perxis-go/pkg/options"
@@ -42,14 +42,14 @@ func (m *loggingMiddleware) Create(ctx context.Context, org *organizations.Organ
 	return created, err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (m *loggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(organizations.EventDelete),
-		logzap.Object(id.NewOrganizationId(orgId)),
+		logzap.Object(pkgId.NewOrganizationId(id)),
 	)
 
-	err = m.next.Delete(ctx, orgId)
+	err = m.next.Delete(ctx, id)
 	if err != nil {
 		logger.Error("Failed to delete", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -74,13 +74,13 @@ func (m *loggingMiddleware) Find(ctx context.Context, filter *organizations.Filt
 	return orgs, total, err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, orgId string) (org *organizations.Organization, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, id string) (org *organizations.Organization, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewOrganizationId(orgId)),
+		logzap.Object(pkgId.NewOrganizationId(id)),
 	)
 
-	org, err = m.next.Get(ctx, orgId)
+	org, err = m.next.Get(ctx, id)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
diff --git a/pkg/organizations/middleware/recovering_middleware.go b/pkg/organizations/middleware/recovering_middleware.go
index d598f1da..88ff8592 100644
--- a/pkg/organizations/middleware/recovering_middleware.go
+++ b/pkg/organizations/middleware/recovering_middleware.go
@@ -43,7 +43,7 @@ func (m *recoveringMiddleware) Create(ctx context.Context, org *organizations.Or
 	return m.next.Create(ctx, org)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -52,7 +52,7 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, orgId string) (err er
 		}
 	}()
 
-	return m.next.Delete(ctx, orgId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *recoveringMiddleware) Find(ctx context.Context, filter *organizations.Filter, opts *options.FindOptions) (orgs []*organizations.Organization, total int, err error) {
@@ -67,7 +67,7 @@ func (m *recoveringMiddleware) Find(ctx context.Context, filter *organizations.F
 	return m.next.Find(ctx, filter, opts)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, orgId string) (org *organizations.Organization, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, id string) (org *organizations.Organization, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -76,7 +76,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, orgId string) (org *orga
 		}
 	}()
 
-	return m.next.Get(ctx, orgId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *recoveringMiddleware) Update(ctx context.Context, org *organizations.Organization) (err error) {
diff --git a/pkg/organizations/middleware/telemetry_middleware.go b/pkg/organizations/middleware/telemetry_middleware.go
index 1cb79328..ae945b47 100644
--- a/pkg/organizations/middleware/telemetry_middleware.go
+++ b/pkg/organizations/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
 	"git.perx.ru/perxis/perxis-go/pkg/organizations"
@@ -69,7 +69,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, org *organizations.Org
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -94,7 +94,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, org *organizations.Org
 }
 
 // Delete implements organizations.Organizations
-func (_d telemetryMiddleware) Delete(ctx context.Context, orgId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Organizations"),
 		attribute.String("method", "Delete"),
@@ -105,11 +105,11 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, orgId string) (err err
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Organizations.Delete")
 	defer _span.End()
 
-	err = _d.Organizations.Delete(ctx, orgId)
+	err = _d.Organizations.Delete(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -118,8 +118,8 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, orgId string) (err err
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":   ctx,
-			"orgId": orgId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -148,7 +148,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *organizations.Fi
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -175,7 +175,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *organizations.Fi
 }
 
 // Get implements organizations.Organizations
-func (_d telemetryMiddleware) Get(ctx context.Context, orgId string) (org *organizations.Organization, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, id string) (org *organizations.Organization, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Organizations"),
 		attribute.String("method", "Get"),
@@ -186,11 +186,11 @@ func (_d telemetryMiddleware) Get(ctx context.Context, orgId string) (org *organ
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Organizations.Get")
 	defer _span.End()
 
-	org, err = _d.Organizations.Get(ctx, orgId)
+	org, err = _d.Organizations.Get(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -199,8 +199,8 @@ func (_d telemetryMiddleware) Get(ctx context.Context, orgId string) (org *organ
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":   ctx,
-			"orgId": orgId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"org": org,
 			"err": err})
 	} else if err != nil {
@@ -230,7 +230,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, org *organizations.Org
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/organizations/mocks/Middleware.go b/pkg/organizations/mocks/Middleware.go
index 5ff2ac9d..cb33c249 100644
--- a/pkg/organizations/mocks/Middleware.go
+++ b/pkg/organizations/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.15.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,6 +16,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 organizations.Organizations) organizations.Organizations {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 organizations.Organizations
 	if rf, ok := ret.Get(0).(func(organizations.Organizations) organizations.Organizations); ok {
 		r0 = rf(_a0)
@@ -28,13 +32,12 @@ func (_m *Middleware) Execute(_a0 organizations.Organizations) organizations.Org
 	return r0
 }
 
-type mockConstructorTestingTNewMiddleware interface {
+// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewMiddleware(t interface {
 	mock.TestingT
 	Cleanup(func())
-}
-
-// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
+}) *Middleware {
 	mock := &Middleware{}
 	mock.Mock.Test(t)
 
diff --git a/pkg/organizations/mocks/Organizations.go b/pkg/organizations/mocks/Organizations.go
index ec0015ae..d00bcf2f 100644
--- a/pkg/organizations/mocks/Organizations.go
+++ b/pkg/organizations/mocks/Organizations.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.15.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -20,7 +20,15 @@ type Organizations struct {
 func (_m *Organizations) Create(ctx context.Context, org *organizations.Organization) (*organizations.Organization, error) {
 	ret := _m.Called(ctx, org)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *organizations.Organization
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) (*organizations.Organization, error)); ok {
+		return rf(ctx, org)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) *organizations.Organization); ok {
 		r0 = rf(ctx, org)
 	} else {
@@ -29,7 +37,6 @@ func (_m *Organizations) Create(ctx context.Context, org *organizations.Organiza
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Organization) error); ok {
 		r1 = rf(ctx, org)
 	} else {
@@ -39,13 +46,17 @@ func (_m *Organizations) Create(ctx context.Context, org *organizations.Organiza
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, orgId
-func (_m *Organizations) Delete(ctx context.Context, orgId string) error {
-	ret := _m.Called(ctx, orgId)
+// Delete provides a mock function with given fields: ctx, id
+func (_m *Organizations) Delete(ctx context.Context, id string) error {
+	ret := _m.Called(ctx, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
-		r0 = rf(ctx, orgId)
+		r0 = rf(ctx, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -57,7 +68,16 @@ func (_m *Organizations) Delete(ctx context.Context, orgId string) error {
 func (_m *Organizations) Find(ctx context.Context, filter *organizations.Filter, opts *options.FindOptions) ([]*organizations.Organization, int, error) {
 	ret := _m.Called(ctx, filter, opts)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Find")
+	}
+
 	var r0 []*organizations.Organization
+	var r1 int
+	var r2 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter, *options.FindOptions) ([]*organizations.Organization, int, error)); ok {
+		return rf(ctx, filter, opts)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter, *options.FindOptions) []*organizations.Organization); ok {
 		r0 = rf(ctx, filter, opts)
 	} else {
@@ -66,14 +86,12 @@ func (_m *Organizations) Find(ctx context.Context, filter *organizations.Filter,
 		}
 	}
 
-	var r1 int
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Filter, *options.FindOptions) int); ok {
 		r1 = rf(ctx, filter, opts)
 	} else {
 		r1 = ret.Get(1).(int)
 	}
 
-	var r2 error
 	if rf, ok := ret.Get(2).(func(context.Context, *organizations.Filter, *options.FindOptions) error); ok {
 		r2 = rf(ctx, filter, opts)
 	} else {
@@ -83,22 +101,29 @@ func (_m *Organizations) Find(ctx context.Context, filter *organizations.Filter,
 	return r0, r1, r2
 }
 
-// Get provides a mock function with given fields: ctx, orgId
-func (_m *Organizations) Get(ctx context.Context, orgId string) (*organizations.Organization, error) {
-	ret := _m.Called(ctx, orgId)
+// Get provides a mock function with given fields: ctx, id
+func (_m *Organizations) Get(ctx context.Context, id string) (*organizations.Organization, error) {
+	ret := _m.Called(ctx, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
 
 	var r0 *organizations.Organization
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, string) (*organizations.Organization, error)); ok {
+		return rf(ctx, id)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, string) *organizations.Organization); ok {
-		r0 = rf(ctx, orgId)
+		r0 = rf(ctx, id)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*organizations.Organization)
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
-		r1 = rf(ctx, orgId)
+		r1 = rf(ctx, id)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -110,6 +135,10 @@ func (_m *Organizations) Get(ctx context.Context, orgId string) (*organizations.
 func (_m *Organizations) Update(ctx context.Context, org *organizations.Organization) error {
 	ret := _m.Called(ctx, org)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) error); ok {
 		r0 = rf(ctx, org)
@@ -120,13 +149,12 @@ func (_m *Organizations) Update(ctx context.Context, org *organizations.Organiza
 	return r0
 }
 
-type mockConstructorTestingTNewOrganizations interface {
+// NewOrganizations creates a new instance of Organizations. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewOrganizations(t interface {
 	mock.TestingT
 	Cleanup(func())
-}
-
-// NewOrganizations creates a new instance of Organizations. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewOrganizations(t mockConstructorTestingTNewOrganizations) *Organizations {
+}) *Organizations {
 	mock := &Organizations{}
 	mock.Mock.Test(t)
 
diff --git a/pkg/organizations/mocks/Storage.go b/pkg/organizations/mocks/Storage.go
index 6b2b7176..fb12d461 100644
--- a/pkg/organizations/mocks/Storage.go
+++ b/pkg/organizations/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.15.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -20,7 +20,15 @@ type Storage struct {
 func (_m *Storage) Create(ctx context.Context, org *organizations.Organization) (*organizations.Organization, error) {
 	ret := _m.Called(ctx, org)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *organizations.Organization
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) (*organizations.Organization, error)); ok {
+		return rf(ctx, org)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) *organizations.Organization); ok {
 		r0 = rf(ctx, org)
 	} else {
@@ -29,7 +37,6 @@ func (_m *Storage) Create(ctx context.Context, org *organizations.Organization)
 		}
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Organization) error); ok {
 		r1 = rf(ctx, org)
 	} else {
@@ -43,14 +50,21 @@ func (_m *Storage) Create(ctx context.Context, org *organizations.Organization)
 func (_m *Storage) Delete(ctx context.Context, filter *organizations.Filter) (int, error) {
 	ret := _m.Called(ctx, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
+
 	var r0 int
+	var r1 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter) (int, error)); ok {
+		return rf(ctx, filter)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter) int); ok {
 		r0 = rf(ctx, filter)
 	} else {
 		r0 = ret.Get(0).(int)
 	}
 
-	var r1 error
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Filter) error); ok {
 		r1 = rf(ctx, filter)
 	} else {
@@ -64,7 +78,16 @@ func (_m *Storage) Delete(ctx context.Context, filter *organizations.Filter) (in
 func (_m *Storage) Find(ctx context.Context, filter *organizations.Filter, opts *options.FindOptions) ([]*organizations.Organization, int, error) {
 	ret := _m.Called(ctx, filter, opts)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Find")
+	}
+
 	var r0 []*organizations.Organization
+	var r1 int
+	var r2 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter, *options.FindOptions) ([]*organizations.Organization, int, error)); ok {
+		return rf(ctx, filter, opts)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter, *options.FindOptions) []*organizations.Organization); ok {
 		r0 = rf(ctx, filter, opts)
 	} else {
@@ -73,14 +96,12 @@ func (_m *Storage) Find(ctx context.Context, filter *organizations.Filter, opts
 		}
 	}
 
-	var r1 int
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Filter, *options.FindOptions) int); ok {
 		r1 = rf(ctx, filter, opts)
 	} else {
 		r1 = ret.Get(1).(int)
 	}
 
-	var r2 error
 	if rf, ok := ret.Get(2).(func(context.Context, *organizations.Filter, *options.FindOptions) error); ok {
 		r2 = rf(ctx, filter, opts)
 	} else {
@@ -94,6 +115,10 @@ func (_m *Storage) Find(ctx context.Context, filter *organizations.Filter, opts
 func (_m *Storage) Init(ctx context.Context) error {
 	ret := _m.Called(ctx)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Init")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
 		r0 = rf(ctx)
@@ -108,6 +133,10 @@ func (_m *Storage) Init(ctx context.Context) error {
 func (_m *Storage) Reset(ctx context.Context) error {
 	ret := _m.Called(ctx)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Reset")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
 		r0 = rf(ctx)
@@ -122,21 +151,28 @@ func (_m *Storage) Reset(ctx context.Context) error {
 func (_m *Storage) Update(ctx context.Context, update *organizations.Organization, filter *organizations.Filter) (int, int, error) {
 	ret := _m.Called(ctx, update, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 int
+	var r1 int
+	var r2 error
+	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization, *organizations.Filter) (int, int, error)); ok {
+		return rf(ctx, update, filter)
+	}
 	if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization, *organizations.Filter) int); ok {
 		r0 = rf(ctx, update, filter)
 	} else {
 		r0 = ret.Get(0).(int)
 	}
 
-	var r1 int
 	if rf, ok := ret.Get(1).(func(context.Context, *organizations.Organization, *organizations.Filter) int); ok {
 		r1 = rf(ctx, update, filter)
 	} else {
 		r1 = ret.Get(1).(int)
 	}
 
-	var r2 error
 	if rf, ok := ret.Get(2).(func(context.Context, *organizations.Organization, *organizations.Filter) error); ok {
 		r2 = rf(ctx, update, filter)
 	} else {
@@ -146,13 +182,12 @@ func (_m *Storage) Update(ctx context.Context, update *organizations.Organizatio
 	return r0, r1, r2
 }
 
-type mockConstructorTestingTNewStorage interface {
+// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewStorage(t interface {
 	mock.TestingT
 	Cleanup(func())
-}
-
-// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewStorage(t mockConstructorTestingTNewStorage) *Storage {
+}) *Storage {
 	mock := &Storage{}
 	mock.Mock.Test(t)
 
diff --git a/pkg/organizations/mocks/spaceGetter.go b/pkg/organizations/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/organizations/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/organizations/service.go b/pkg/organizations/service.go
index 9ba3b9a9..2b058e4f 100644
--- a/pkg/organizations/service.go
+++ b/pkg/organizations/service.go
@@ -12,9 +12,9 @@ import (
 type Organizations interface {
 	Create(ctx context.Context, org *Organization) (created *Organization, err error)
 
-	Get(ctx context.Context, orgId string) (org *Organization, err error)
+	Get(ctx context.Context, id string) (org *Organization, err error)
 	Update(ctx context.Context, org *Organization) (err error)
-	Delete(ctx context.Context, orgId string) (err error)
+	Delete(ctx context.Context, id string) (err error)
 	Find(ctx context.Context, filter *Filter, opts *options.FindOptions) (orgs []*Organization, total int, err error)
 }
 
diff --git a/pkg/references/middleware/telemetry_middleware.go b/pkg/references/middleware/telemetry_middleware.go
index 3e8fbb77..76eab9b3 100644
--- a/pkg/references/middleware/telemetry_middleware.go
+++ b/pkg/references/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/items"
 	"git.perx.ru/perxis/perxis-go/pkg/references"
@@ -74,7 +74,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, envId str
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -123,7 +123,7 @@ func (_d telemetryMiddleware) Publish(ctx context.Context, spaceId string, envId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/roles/middleware/access_logging_middleware.go b/pkg/roles/middleware/access_logging_middleware.go
index 310cdeda..e99ecd7b 100644
--- a/pkg/roles/middleware/access_logging_middleware.go
+++ b/pkg/roles/middleware/access_logging_middleware.go
@@ -50,16 +50,16 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, role *roles.Role)
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, roleId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("roleId", roleId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, spaceId, roleId)
+	err = m.next.Delete(ctx, spaceId, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -69,16 +69,16 @@ func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string, ro
 	return err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, roleId string) (role *roles.Role, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string, id string) (role *roles.Role, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
 		zap.Reflect("spaceId", spaceId),
-		zap.Reflect("roleId", roleId),
+		zap.Reflect("id", id),
 	)
 
-	role, err = m.next.Get(ctx, spaceId, roleId)
+	role, err = m.next.Get(ctx, spaceId, id)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/roles/middleware/caching_middleware.go b/pkg/roles/middleware/caching_middleware.go
index 2bcb04d3..40108b39 100644
--- a/pkg/roles/middleware/caching_middleware.go
+++ b/pkg/roles/middleware/caching_middleware.go
@@ -35,13 +35,13 @@ func (m cachingMiddleware) Create(ctx context.Context, role *service.Role) (rl *
 	return rl, err
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, spaceId string, roleId string) (rl *service.Role, err error) {
-	key := makeKey(spaceId, roleId)
+func (m cachingMiddleware) Get(ctx context.Context, spaceId string, id string) (rl *service.Role, err error) {
+	key := makeKey(spaceId, id)
 	value, e := m.cache.Get(key)
 	if e == nil {
 		return value.(*service.Role).Clone(), nil
 	}
-	rl, err = m.next.Get(ctx, spaceId, roleId)
+	rl, err = m.next.Get(ctx, spaceId, id)
 	if err == nil {
 		_ = m.cache.Set(key, rl)
 		return rl.Clone(), nil
@@ -72,10 +72,10 @@ func (m cachingMiddleware) Update(ctx context.Context, role *service.Role) (err
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, roleId string) (err error) {
-	err = m.next.Delete(ctx, spaceId, roleId)
+func (m cachingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
+	err = m.next.Delete(ctx, spaceId, id)
 	if err == nil {
-		key := makeKey(spaceId, roleId)
+		key := makeKey(spaceId, id)
 		_ = m.cache.Remove(key)
 		_ = m.cache.Remove(spaceId)
 	}
diff --git a/pkg/roles/middleware/error_logging_middleware.go b/pkg/roles/middleware/error_logging_middleware.go
index bb6073d1..cd120497 100644
--- a/pkg/roles/middleware/error_logging_middleware.go
+++ b/pkg/roles/middleware/error_logging_middleware.go
@@ -39,24 +39,24 @@ func (m *errorLoggingMiddleware) Create(ctx context.Context, role *roles.Role) (
 	return m.next.Create(ctx, role)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, roleId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, spaceId, roleId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
-func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, roleId string) (role *roles.Role, err error) {
+func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string, id string) (role *roles.Role, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Get(ctx, spaceId, roleId)
+	return m.next.Get(ctx, spaceId, id)
 }
 
 func (m *errorLoggingMiddleware) List(ctx context.Context, spaceId string) (roles []*roles.Role, err error) {
diff --git a/pkg/roles/middleware/logging_middleware.go b/pkg/roles/middleware/logging_middleware.go
index 9221265d..ed480ab7 100644
--- a/pkg/roles/middleware/logging_middleware.go
+++ b/pkg/roles/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/roles"
 	logzap "git.perx.ru/perxis/perxis-go/zap"
 	"go.uber.org/zap"
@@ -40,13 +40,13 @@ func (m *loggingMiddleware) Create(ctx context.Context, role *roles.Role) (creat
 	return created, err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, spaceId, roleId string) (role *roles.Role, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, spaceId, id string) (role *roles.Role, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewRoleId(spaceId, roleId)),
+		logzap.Object(pkgId.NewRoleId(spaceId, id)),
 	)
 
-	role, err = m.next.Get(ctx, spaceId, roleId)
+	role, err = m.next.Get(ctx, spaceId, id)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
@@ -87,14 +87,14 @@ func (m *loggingMiddleware) Update(ctx context.Context, role *roles.Role) (err e
 	return err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, spaceId, roleId string) (err error) {
+func (m *loggingMiddleware) Delete(ctx context.Context, spaceId, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(roles.EventDelete),
-		logzap.Object(id.NewRoleId(spaceId, roleId)),
+		logzap.Object(pkgId.NewRoleId(spaceId, id)),
 	)
 
-	err = m.next.Delete(ctx, spaceId, roleId)
+	err = m.next.Delete(ctx, spaceId, id)
 	if err != nil {
 		logger.Error("Failed to delete", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
diff --git a/pkg/roles/middleware/recovering_middleware.go b/pkg/roles/middleware/recovering_middleware.go
index cb30a49b..bb390972 100644
--- a/pkg/roles/middleware/recovering_middleware.go
+++ b/pkg/roles/middleware/recovering_middleware.go
@@ -42,7 +42,7 @@ func (m *recoveringMiddleware) Create(ctx context.Context, role *roles.Role) (cr
 	return m.next.Create(ctx, role)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, roleId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -51,10 +51,10 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string, roleI
 		}
 	}()
 
-	return m.next.Delete(ctx, spaceId, roleId)
+	return m.next.Delete(ctx, spaceId, id)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, roleId string) (role *roles.Role, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, id string) (role *roles.Role, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -63,7 +63,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string, roleId s
 		}
 	}()
 
-	return m.next.Get(ctx, spaceId, roleId)
+	return m.next.Get(ctx, spaceId, id)
 }
 
 func (m *recoveringMiddleware) List(ctx context.Context, spaceId string) (roles []*roles.Role, err error) {
diff --git a/pkg/roles/middleware/telemetry_middleware.go b/pkg/roles/middleware/telemetry_middleware.go
index 74035752..cf5fe951 100644
--- a/pkg/roles/middleware/telemetry_middleware.go
+++ b/pkg/roles/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/roles"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -84,7 +84,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, role *roles.Role) (cre
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -109,7 +109,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, role *roles.Role) (cre
 }
 
 // Delete implements roles.Roles
-func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, roleId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Roles"),
 		attribute.String("method", "Delete"),
@@ -120,7 +120,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, roleId
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Roles.Delete")
 	defer _span.End()
 
-	err = _d.Roles.Delete(ctx, spaceId, roleId)
+	err = _d.Roles.Delete(ctx, spaceId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -129,7 +129,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, roleId
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -140,7 +140,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, roleId
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"roleId":  roleId}, map[string]interface{}{
+			"id":      id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -154,7 +154,7 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string, roleId
 }
 
 // Get implements roles.Roles
-func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, roleId string) (role *roles.Role, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, id string) (role *roles.Role, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Roles"),
 		attribute.String("method", "Get"),
@@ -165,7 +165,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, roleId st
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Roles.Get")
 	defer _span.End()
 
-	role, err = _d.Roles.Get(ctx, spaceId, roleId)
+	role, err = _d.Roles.Get(ctx, spaceId, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
@@ -174,7 +174,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, roleId st
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -185,7 +185,7 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string, roleId st
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":     ctx,
 			"spaceId": spaceId,
-			"roleId":  roleId}, map[string]interface{}{
+			"id":      id}, map[string]interface{}{
 			"role": role,
 			"err":  err})
 	} else if err != nil {
@@ -220,7 +220,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, spaceId string) (roles [
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -276,7 +276,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, role *roles.Role) (err
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
diff --git a/pkg/roles/mocks/Middleware.go b/pkg/roles/mocks/Middleware.go
index 507b3715..ed5837a4 100644
--- a/pkg/roles/mocks/Middleware.go
+++ b/pkg/roles/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,6 +16,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 roles.Roles) roles.Roles {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 roles.Roles
 	if rf, ok := ret.Get(0).(func(roles.Roles) roles.Roles); ok {
 		r0 = rf(_a0)
diff --git a/pkg/roles/mocks/Roles.go b/pkg/roles/mocks/Roles.go
index 08c523e0..d37c9a56 100644
--- a/pkg/roles/mocks/Roles.go
+++ b/pkg/roles/mocks/Roles.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -18,6 +18,10 @@ type Roles struct {
 func (_m *Roles) Create(ctx context.Context, role *roles.Role) (*roles.Role, error) {
 	ret := _m.Called(ctx, role)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *roles.Role
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *roles.Role) (*roles.Role, error)); ok {
@@ -40,13 +44,17 @@ func (_m *Roles) Create(ctx context.Context, role *roles.Role) (*roles.Role, err
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, spaceId, roleId
-func (_m *Roles) Delete(ctx context.Context, spaceId string, roleId string) error {
-	ret := _m.Called(ctx, spaceId, roleId)
+// Delete provides a mock function with given fields: ctx, spaceId, id
+func (_m *Roles) Delete(ctx context.Context, spaceId string, id string) error {
+	ret := _m.Called(ctx, spaceId, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
-		r0 = rf(ctx, spaceId, roleId)
+		r0 = rf(ctx, spaceId, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -54,17 +62,21 @@ func (_m *Roles) Delete(ctx context.Context, spaceId string, roleId string) erro
 	return r0
 }
 
-// Get provides a mock function with given fields: ctx, spaceId, roleId
-func (_m *Roles) Get(ctx context.Context, spaceId string, roleId string) (*roles.Role, error) {
-	ret := _m.Called(ctx, spaceId, roleId)
+// Get provides a mock function with given fields: ctx, spaceId, id
+func (_m *Roles) Get(ctx context.Context, spaceId string, id string) (*roles.Role, error) {
+	ret := _m.Called(ctx, spaceId, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
 
 	var r0 *roles.Role
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*roles.Role, error)); ok {
-		return rf(ctx, spaceId, roleId)
+		return rf(ctx, spaceId, id)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) *roles.Role); ok {
-		r0 = rf(ctx, spaceId, roleId)
+		r0 = rf(ctx, spaceId, id)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*roles.Role)
@@ -72,7 +84,7 @@ func (_m *Roles) Get(ctx context.Context, spaceId string, roleId string) (*roles
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
-		r1 = rf(ctx, spaceId, roleId)
+		r1 = rf(ctx, spaceId, id)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -84,6 +96,10 @@ func (_m *Roles) Get(ctx context.Context, spaceId string, roleId string) (*roles
 func (_m *Roles) List(ctx context.Context, spaceId string) ([]*roles.Role, error) {
 	ret := _m.Called(ctx, spaceId)
 
+	if len(ret) == 0 {
+		panic("no return value specified for List")
+	}
+
 	var r0 []*roles.Role
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) ([]*roles.Role, error)); ok {
@@ -110,6 +126,10 @@ func (_m *Roles) List(ctx context.Context, spaceId string) ([]*roles.Role, error
 func (_m *Roles) Update(ctx context.Context, role *roles.Role) error {
 	ret := _m.Called(ctx, role)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *roles.Role) error); ok {
 		r0 = rf(ctx, role)
diff --git a/pkg/roles/mocks/Storage.go b/pkg/roles/mocks/Storage.go
index dc01f165..e1a73b7c 100644
--- a/pkg/roles/mocks/Storage.go
+++ b/pkg/roles/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -20,6 +20,10 @@ type Storage struct {
 func (_m *Storage) Create(ctx context.Context, role *roles.Role) (*roles.Role, error) {
 	ret := _m.Called(ctx, role)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *roles.Role
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *roles.Role) (*roles.Role, error)); ok {
@@ -46,6 +50,10 @@ func (_m *Storage) Create(ctx context.Context, role *roles.Role) (*roles.Role, e
 func (_m *Storage) Delete(ctx context.Context, spaceID string, roleID string) error {
 	ret := _m.Called(ctx, spaceID, roleID)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
 		r0 = rf(ctx, spaceID, roleID)
@@ -60,6 +68,10 @@ func (_m *Storage) Delete(ctx context.Context, spaceID string, roleID string) er
 func (_m *Storage) Find(ctx context.Context, spaceID string, f *roles.Filter, opts *options.FindOptions) ([]*roles.Role, int, error) {
 	ret := _m.Called(ctx, spaceID, f, opts)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Find")
+	}
+
 	var r0 []*roles.Role
 	var r1 int
 	var r2 error
@@ -93,6 +105,10 @@ func (_m *Storage) Find(ctx context.Context, spaceID string, f *roles.Filter, op
 func (_m *Storage) Reset(ctx context.Context, spaceID string) error {
 	ret := _m.Called(ctx, spaceID)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Reset")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
 		r0 = rf(ctx, spaceID)
@@ -107,6 +123,10 @@ func (_m *Storage) Reset(ctx context.Context, spaceID string) error {
 func (_m *Storage) Update(ctx context.Context, role *roles.Role) (int, int, error) {
 	ret := _m.Called(ctx, role)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 int
 	var r1 int
 	var r2 error
diff --git a/pkg/roles/mocks/spaceGetter.go b/pkg/roles/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/roles/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/roles/service.go b/pkg/roles/service.go
index b003008b..17d04aa8 100644
--- a/pkg/roles/service.go
+++ b/pkg/roles/service.go
@@ -9,8 +9,8 @@ import (
 // @grpc-addr content.roles.Roles
 type Roles interface {
 	Create(ctx context.Context, role *Role) (created *Role, err error)
-	Get(ctx context.Context, spaceId, roleId string) (role *Role, err error)
+	Get(ctx context.Context, spaceId, id string) (role *Role, err error)
 	List(ctx context.Context, spaceId string) (roles []*Role, err error)
 	Update(ctx context.Context, role *Role) (err error)
-	Delete(ctx context.Context, spaceId, roleId string) (err error)
+	Delete(ctx context.Context, spaceId, id string) (err error)
 }
diff --git a/pkg/spaces/middleware/access_logging_middleware.go b/pkg/spaces/middleware/access_logging_middleware.go
index d155ee1f..bfcc12f7 100644
--- a/pkg/spaces/middleware/access_logging_middleware.go
+++ b/pkg/spaces/middleware/access_logging_middleware.go
@@ -32,15 +32,15 @@ func AccessLoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *accessLoggingMiddleware) AbortTransfer(ctx context.Context, spaceID string) (err error) {
+func (m *accessLoggingMiddleware) AbortTransfer(ctx context.Context, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("AbortTransfer.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceID", spaceID),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.AbortTransfer(ctx, spaceID)
+	err = m.next.AbortTransfer(ctx, id)
 
 	m.logger.Debug("AbortTransfer.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -69,15 +69,15 @@ func (m *accessLoggingMiddleware) Create(ctx context.Context, space *spaces.Spac
 	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceId", spaceId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, spaceId)
+	err = m.next.Delete(ctx, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -108,15 +108,15 @@ func (m *accessLoggingMiddleware) Find(ctx context.Context, filter *spaces.Filte
 	return spaces, total, err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, spaceId string) (space *spaces.Space, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, id string) (space *spaces.Space, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceId", spaceId),
+		zap.Reflect("id", id),
 	)
 
-	space, err = m.next.Get(ctx, spaceId)
+	space, err = m.next.Get(ctx, id)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -165,16 +165,16 @@ func (m *accessLoggingMiddleware) ListTransfers(ctx context.Context, orgID strin
 	return spaces, err
 }
 
-func (m *accessLoggingMiddleware) Move(ctx context.Context, spaceID string, orgID string) (err error) {
+func (m *accessLoggingMiddleware) Move(ctx context.Context, id string, orgID string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Move.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceID", spaceID),
+		zap.Reflect("id", id),
 		zap.Reflect("orgID", orgID),
 	)
 
-	err = m.next.Move(ctx, spaceID, orgID)
+	err = m.next.Move(ctx, id, orgID)
 
 	m.logger.Debug("Move.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -184,16 +184,16 @@ func (m *accessLoggingMiddleware) Move(ctx context.Context, spaceID string, orgI
 	return err
 }
 
-func (m *accessLoggingMiddleware) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) (err error) {
+func (m *accessLoggingMiddleware) SetState(ctx context.Context, id string, state *spaces.StateInfo) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("SetState.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceID", spaceID),
+		zap.Reflect("id", id),
 		zap.Reflect("state", state),
 	)
 
-	err = m.next.SetState(ctx, spaceID, state)
+	err = m.next.SetState(ctx, id, state)
 
 	m.logger.Debug("SetState.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -203,16 +203,16 @@ func (m *accessLoggingMiddleware) SetState(ctx context.Context, spaceID string,
 	return err
 }
 
-func (m *accessLoggingMiddleware) Transfer(ctx context.Context, spaceID string, transferToOrg string) (err error) {
+func (m *accessLoggingMiddleware) Transfer(ctx context.Context, id string, transferToOrg string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Transfer.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceID", spaceID),
+		zap.Reflect("id", id),
 		zap.Reflect("transferToOrg", transferToOrg),
 	)
 
-	err = m.next.Transfer(ctx, spaceID, transferToOrg)
+	err = m.next.Transfer(ctx, id, transferToOrg)
 
 	m.logger.Debug("Transfer.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -240,16 +240,16 @@ func (m *accessLoggingMiddleware) Update(ctx context.Context, space *spaces.Spac
 	return err
 }
 
-func (m *accessLoggingMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) (err error) {
+func (m *accessLoggingMiddleware) UpdateConfig(ctx context.Context, id string, config *spaces.Config) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("UpdateConfig.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("spaceId", spaceId),
+		zap.Reflect("id", id),
 		zap.Reflect("config", config),
 	)
 
-	err = m.next.UpdateConfig(ctx, spaceId, config)
+	err = m.next.UpdateConfig(ctx, id, config)
 
 	m.logger.Debug("UpdateConfig.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/spaces/middleware/caching_middleware.go b/pkg/spaces/middleware/caching_middleware.go
index c7f35de1..f87ba81d 100644
--- a/pkg/spaces/middleware/caching_middleware.go
+++ b/pkg/spaces/middleware/caching_middleware.go
@@ -36,15 +36,15 @@ func (m cachingMiddleware) Create(ctx context.Context, space *service.Space) (sp
 	return sp, err
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, spaceId string) (sp *service.Space, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, id string) (sp *service.Space, err error) {
 
-	value, e := m.cache.Get(spaceId)
+	value, e := m.cache.Get(id)
 	if e == nil {
 		return value.(*service.Space).Clone(), nil
 	}
-	sp, err = m.next.Get(ctx, spaceId)
+	sp, err = m.next.Get(ctx, id)
 	if err == nil {
-		_ = m.cache.Set(spaceId, sp)
+		_ = m.cache.Set(id, sp)
 		return sp.Clone(), nil
 	}
 	return nil, err
@@ -85,73 +85,73 @@ func (m cachingMiddleware) Update(ctx context.Context, space *service.Space) (er
 	return err
 }
 
-func (m cachingMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *service.Config) (err error) {
+func (m cachingMiddleware) UpdateConfig(ctx context.Context, id string, config *service.Config) (err error) {
 
-	err = m.next.UpdateConfig(ctx, spaceId, config)
+	err = m.next.UpdateConfig(ctx, id, config)
 	if err == nil {
-		value, e := m.cache.Get(spaceId)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 		}
-		_ = m.cache.Remove(spaceId)
+		_ = m.cache.Remove(id)
 	}
 	return err
 }
 
-func (m cachingMiddleware) SetState(ctx context.Context, spaceID string, state *service.StateInfo) (err error) {
+func (m cachingMiddleware) SetState(ctx context.Context, id string, state *service.StateInfo) (err error) {
 
-	err = m.next.SetState(ctx, spaceID, state)
+	err = m.next.SetState(ctx, id, state)
 	if err == nil {
-		value, e := m.cache.Get(spaceID)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 		}
-		_ = m.cache.Remove(spaceID)
+		_ = m.cache.Remove(id)
 	}
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, id string) (err error) {
 
-	err = m.next.Delete(ctx, spaceId)
+	err = m.next.Delete(ctx, id)
 	if err == nil {
-		value, e := m.cache.Get(spaceId)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 		}
-		_ = m.cache.Remove(spaceId)
+		_ = m.cache.Remove(id)
 	}
 	return err
 }
 
-func (m cachingMiddleware) Transfer(ctx context.Context, spaceID, transferToOrg string) error {
-	err := m.next.Transfer(ctx, spaceID, transferToOrg)
+func (m cachingMiddleware) Transfer(ctx context.Context, id, transferToOrg string) error {
+	err := m.next.Transfer(ctx, id, transferToOrg)
 	if err == nil {
-		value, e := m.cache.Get(spaceID)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 			_ = m.cache.Remove(orgKey(space.TransferToOrg))
 		}
-		_ = m.cache.Remove(spaceID)
+		_ = m.cache.Remove(id)
 		_ = m.cache.Remove(transferToOrg)
 	}
 	return err
 }
 
-func (m cachingMiddleware) AbortTransfer(ctx context.Context, spaceID string) error {
-	err := m.next.AbortTransfer(ctx, spaceID)
+func (m cachingMiddleware) AbortTransfer(ctx context.Context, id string) error {
+	err := m.next.AbortTransfer(ctx, id)
 	if err == nil {
-		value, e := m.cache.Get(spaceID)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 			_ = m.cache.Remove(orgKey(space.TransferToOrg))
 		}
-		_ = m.cache.Remove(spaceID)
+		_ = m.cache.Remove(id)
 	}
 	return err
 }
@@ -160,16 +160,16 @@ func (m cachingMiddleware) ListTransfers(ctx context.Context, orgID string) (spa
 	return m.next.ListTransfers(ctx, orgID)
 }
 
-func (m cachingMiddleware) Move(ctx context.Context, spaceID, orgID string) error {
-	err := m.next.Move(ctx, spaceID, orgID)
+func (m cachingMiddleware) Move(ctx context.Context, id, orgID string) error {
+	err := m.next.Move(ctx, id, orgID)
 	if err == nil {
-		value, e := m.cache.Get(spaceID)
+		value, e := m.cache.Get(id)
 		if e == nil {
 			space := value.(*service.Space)
 			_ = m.cache.Remove(orgKey(space.OrgID))
 			_ = m.cache.Remove(orgKey(space.TransferToOrg))
 		}
-		_ = m.cache.Remove(spaceID)
+		_ = m.cache.Remove(id)
 		_ = m.cache.Remove(orgID)
 	}
 	return err
diff --git a/pkg/spaces/middleware/error_logging_middleware.go b/pkg/spaces/middleware/error_logging_middleware.go
index 677b4836..7e26fcc1 100644
--- a/pkg/spaces/middleware/error_logging_middleware.go
+++ b/pkg/spaces/middleware/error_logging_middleware.go
@@ -30,14 +30,14 @@ func ErrorLoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *errorLoggingMiddleware) AbortTransfer(ctx context.Context, spaceID string) (err error) {
+func (m *errorLoggingMiddleware) AbortTransfer(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.AbortTransfer(ctx, spaceID)
+	return m.next.AbortTransfer(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) Create(ctx context.Context, space *spaces.Space) (created *spaces.Space, err error) {
@@ -50,14 +50,14 @@ func (m *errorLoggingMiddleware) Create(ctx context.Context, space *spaces.Space
 	return m.next.Create(ctx, space)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, spaceId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *spaces.Filter, fo *options.FindOptions) (spaces []*spaces.Space, total int, err error) {
@@ -70,14 +70,14 @@ func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *spaces.Filter
 	return m.next.Find(ctx, filter, fo)
 }
 
-func (m *errorLoggingMiddleware) Get(ctx context.Context, spaceId string) (space *spaces.Space, err error) {
+func (m *errorLoggingMiddleware) Get(ctx context.Context, id string) (space *spaces.Space, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Get(ctx, spaceId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) List(ctx context.Context, orgId string) (spaces []*spaces.Space, err error) {
@@ -100,34 +100,34 @@ func (m *errorLoggingMiddleware) ListTransfers(ctx context.Context, orgID string
 	return m.next.ListTransfers(ctx, orgID)
 }
 
-func (m *errorLoggingMiddleware) Move(ctx context.Context, spaceID string, orgID string) (err error) {
+func (m *errorLoggingMiddleware) Move(ctx context.Context, id string, orgID string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Move(ctx, spaceID, orgID)
+	return m.next.Move(ctx, id, orgID)
 }
 
-func (m *errorLoggingMiddleware) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) (err error) {
+func (m *errorLoggingMiddleware) SetState(ctx context.Context, id string, state *spaces.StateInfo) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.SetState(ctx, spaceID, state)
+	return m.next.SetState(ctx, id, state)
 }
 
-func (m *errorLoggingMiddleware) Transfer(ctx context.Context, spaceID string, transferToOrg string) (err error) {
+func (m *errorLoggingMiddleware) Transfer(ctx context.Context, id string, transferToOrg string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Transfer(ctx, spaceID, transferToOrg)
+	return m.next.Transfer(ctx, id, transferToOrg)
 }
 
 func (m *errorLoggingMiddleware) Update(ctx context.Context, space *spaces.Space) (err error) {
@@ -140,12 +140,12 @@ func (m *errorLoggingMiddleware) Update(ctx context.Context, space *spaces.Space
 	return m.next.Update(ctx, space)
 }
 
-func (m *errorLoggingMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) (err error) {
+func (m *errorLoggingMiddleware) UpdateConfig(ctx context.Context, id string, config *spaces.Config) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.UpdateConfig(ctx, spaceId, config)
+	return m.next.UpdateConfig(ctx, id, config)
 }
diff --git a/pkg/spaces/middleware/logging_middleware.go b/pkg/spaces/middleware/logging_middleware.go
index a45ec2df..b2167627 100644
--- a/pkg/spaces/middleware/logging_middleware.go
+++ b/pkg/spaces/middleware/logging_middleware.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"fmt"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
 	"git.perx.ru/perxis/perxis-go/pkg/spaces"
 
@@ -26,14 +26,14 @@ func LoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *loggingMiddleware) AbortTransfer(ctx context.Context, spaceID string) (err error) {
+func (m *loggingMiddleware) AbortTransfer(ctx context.Context, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventAbortTransfer),
-		logzap.Object(id.NewSpaceId(spaceID)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
-	err = m.next.AbortTransfer(ctx, spaceID)
+	err = m.next.AbortTransfer(ctx, id)
 	if err != nil {
 		logger.Error("Failed to abort transfer", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -61,8 +61,8 @@ func (m *loggingMiddleware) Create(ctx context.Context, space *spaces.Space) (cr
 	return created, err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
-	space, err := m.Get(ctx, spaceId)
+func (m *loggingMiddleware) Delete(ctx context.Context, id string) (err error) {
+	space, err := m.Get(ctx, id)
 	if err != nil {
 		return err
 	}
@@ -70,27 +70,27 @@ func (m *loggingMiddleware) Delete(ctx context.Context, spaceId string) (err err
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventDelete),
-		logzap.Object(id.NewOrganizationId(space.OrgID)),
+		logzap.Object(pkgId.NewOrganizationId(space.OrgID)),
 	)
 
-	err = m.next.Delete(ctx, spaceId)
+	err = m.next.Delete(ctx, id)
 	if err != nil {
-		logger.Error(fmt.Sprintf("Failed to delete space '%s'", spaceId), zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
+		logger.Error(fmt.Sprintf("Failed to delete space '%s'", id), zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
 	}
 
-	logger.Info(fmt.Sprintf("Space '%s' deleted", spaceId), logzap.Channels(logzap.Userlog))
+	logger.Info(fmt.Sprintf("Space '%s' deleted", id), logzap.Channels(logzap.Userlog))
 
 	return err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, spaceId string) (space *spaces.Space, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, id string) (space *spaces.Space, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewSpaceId(spaceId)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
-	space, err = m.next.Get(ctx, spaceId)
+	space, err = m.next.Get(ctx, id)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
@@ -141,14 +141,14 @@ func (m *loggingMiddleware) ListTransfers(ctx context.Context, orgID string) (sp
 	return spaces, err
 }
 
-func (m *loggingMiddleware) Move(ctx context.Context, spaceID string, orgID string) (err error) {
+func (m *loggingMiddleware) Move(ctx context.Context, id string, orgID string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventMove),
-		logzap.Object(id.NewSpaceId(spaceID)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
-	err = m.next.Move(ctx, spaceID, orgID)
+	err = m.next.Move(ctx, id, orgID)
 	if err != nil {
 		logger.Error("Failed to move", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -159,14 +159,14 @@ func (m *loggingMiddleware) Move(ctx context.Context, spaceID string, orgID stri
 	return err
 }
 
-func (m *loggingMiddleware) Transfer(ctx context.Context, spaceID string, transferToOrg string) (err error) {
+func (m *loggingMiddleware) Transfer(ctx context.Context, id string, transferToOrg string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventTransfer),
-		logzap.Object(id.NewSpaceId(spaceID)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
-	err = m.next.Transfer(ctx, spaceID, transferToOrg)
+	err = m.next.Transfer(ctx, id, transferToOrg)
 	if err != nil {
 		logger.Error("Failed to transfer", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -195,11 +195,11 @@ func (m *loggingMiddleware) Update(ctx context.Context, space *spaces.Space) (er
 	return err
 }
 
-func (m *loggingMiddleware) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) (err error) {
+func (m *loggingMiddleware) SetState(ctx context.Context, id string, state *spaces.StateInfo) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventUpdate),
-		logzap.Object(id.NewSpaceId(spaceID)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
 	var st spaces.State
@@ -207,7 +207,7 @@ func (m *loggingMiddleware) SetState(ctx context.Context, spaceID string, state
 		st = state.State
 	}
 
-	err = m.next.SetState(ctx, spaceID, state)
+	err = m.next.SetState(ctx, id, state)
 	if err != nil {
 		logger.Error(fmt.Sprintf("Failed to set state '%s' to space", st), zap.Error(err))
 		return
@@ -217,14 +217,14 @@ func (m *loggingMiddleware) SetState(ctx context.Context, spaceID string, state
 	return err
 }
 
-func (m *loggingMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) (err error) {
+func (m *loggingMiddleware) UpdateConfig(ctx context.Context, id string, config *spaces.Config) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(spaces.EventUpdateConfig),
-		logzap.Object(id.NewSpaceId(spaceId)),
+		logzap.Object(pkgId.NewSpaceId(id)),
 	)
 
-	err = m.next.UpdateConfig(ctx, spaceId, config)
+	err = m.next.UpdateConfig(ctx, id, config)
 	if err != nil {
 		logger.Error("Failed to update config", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
diff --git a/pkg/spaces/middleware/recovering_middleware.go b/pkg/spaces/middleware/recovering_middleware.go
index cca581b6..3ad5b9c3 100644
--- a/pkg/spaces/middleware/recovering_middleware.go
+++ b/pkg/spaces/middleware/recovering_middleware.go
@@ -31,7 +31,7 @@ func RecoveringMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *recoveringMiddleware) AbortTransfer(ctx context.Context, spaceID string) (err error) {
+func (m *recoveringMiddleware) AbortTransfer(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -40,7 +40,7 @@ func (m *recoveringMiddleware) AbortTransfer(ctx context.Context, spaceID string
 		}
 	}()
 
-	return m.next.AbortTransfer(ctx, spaceID)
+	return m.next.AbortTransfer(ctx, id)
 }
 
 func (m *recoveringMiddleware) Create(ctx context.Context, space *spaces.Space) (created *spaces.Space, err error) {
@@ -55,7 +55,7 @@ func (m *recoveringMiddleware) Create(ctx context.Context, space *spaces.Space)
 	return m.next.Create(ctx, space)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -64,7 +64,7 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, spaceId string) (err
 		}
 	}()
 
-	return m.next.Delete(ctx, spaceId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *recoveringMiddleware) Find(ctx context.Context, filter *spaces.Filter, fo *options.FindOptions) (spaces []*spaces.Space, total int, err error) {
@@ -79,7 +79,7 @@ func (m *recoveringMiddleware) Find(ctx context.Context, filter *spaces.Filter,
 	return m.next.Find(ctx, filter, fo)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string) (space *spaces.Space, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, id string) (space *spaces.Space, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -88,7 +88,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, spaceId string) (space *
 		}
 	}()
 
-	return m.next.Get(ctx, spaceId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *recoveringMiddleware) List(ctx context.Context, orgId string) (spaces []*spaces.Space, err error) {
@@ -115,7 +115,7 @@ func (m *recoveringMiddleware) ListTransfers(ctx context.Context, orgID string)
 	return m.next.ListTransfers(ctx, orgID)
 }
 
-func (m *recoveringMiddleware) Move(ctx context.Context, spaceID string, orgID string) (err error) {
+func (m *recoveringMiddleware) Move(ctx context.Context, id string, orgID string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -124,10 +124,10 @@ func (m *recoveringMiddleware) Move(ctx context.Context, spaceID string, orgID s
 		}
 	}()
 
-	return m.next.Move(ctx, spaceID, orgID)
+	return m.next.Move(ctx, id, orgID)
 }
 
-func (m *recoveringMiddleware) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) (err error) {
+func (m *recoveringMiddleware) SetState(ctx context.Context, id string, state *spaces.StateInfo) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -136,10 +136,10 @@ func (m *recoveringMiddleware) SetState(ctx context.Context, spaceID string, sta
 		}
 	}()
 
-	return m.next.SetState(ctx, spaceID, state)
+	return m.next.SetState(ctx, id, state)
 }
 
-func (m *recoveringMiddleware) Transfer(ctx context.Context, spaceID string, transferToOrg string) (err error) {
+func (m *recoveringMiddleware) Transfer(ctx context.Context, id string, transferToOrg string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -148,7 +148,7 @@ func (m *recoveringMiddleware) Transfer(ctx context.Context, spaceID string, tra
 		}
 	}()
 
-	return m.next.Transfer(ctx, spaceID, transferToOrg)
+	return m.next.Transfer(ctx, id, transferToOrg)
 }
 
 func (m *recoveringMiddleware) Update(ctx context.Context, space *spaces.Space) (err error) {
@@ -163,7 +163,7 @@ func (m *recoveringMiddleware) Update(ctx context.Context, space *spaces.Space)
 	return m.next.Update(ctx, space)
 }
 
-func (m *recoveringMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) (err error) {
+func (m *recoveringMiddleware) UpdateConfig(ctx context.Context, id string, config *spaces.Config) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -172,5 +172,5 @@ func (m *recoveringMiddleware) UpdateConfig(ctx context.Context, spaceId string,
 		}
 	}()
 
-	return m.next.UpdateConfig(ctx, spaceId, config)
+	return m.next.UpdateConfig(ctx, id, config)
 }
diff --git a/pkg/spaces/middleware/telemetry_middleware.go b/pkg/spaces/middleware/telemetry_middleware.go
index 84c90bd6..0901e3b3 100644
--- a/pkg/spaces/middleware/telemetry_middleware.go
+++ b/pkg/spaces/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
 	"git.perx.ru/perxis/perxis-go/pkg/spaces"
@@ -54,7 +54,7 @@ func TelemetryMiddleware(base spaces.Spaces, instance string, spanDecorator ...f
 }
 
 // AbortTransfer implements spaces.Spaces
-func (_d telemetryMiddleware) AbortTransfer(ctx context.Context, spaceID string) (err error) {
+func (_d telemetryMiddleware) AbortTransfer(ctx context.Context, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "AbortTransfer"),
@@ -65,12 +65,12 @@ func (_d telemetryMiddleware) AbortTransfer(ctx context.Context, spaceID string)
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.AbortTransfer")
 	defer _span.End()
 
-	err = _d.Spaces.AbortTransfer(ctx, spaceID)
+	err = _d.Spaces.AbortTransfer(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	params := []interface{}{ctx, spaceID, err}
+	params := []interface{}{ctx, id, err}
 	for _, p := range params {
 		if p == nil {
 			continue
@@ -85,7 +85,7 @@ func (_d telemetryMiddleware) AbortTransfer(ctx context.Context, spaceID string)
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -94,8 +94,8 @@ func (_d telemetryMiddleware) AbortTransfer(ctx context.Context, spaceID string)
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceID": spaceID}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -140,7 +140,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, space *spaces.Space) (
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -165,7 +165,7 @@ func (_d telemetryMiddleware) Create(ctx context.Context, space *spaces.Space) (
 }
 
 // Delete implements spaces.Spaces
-func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "Delete"),
@@ -176,16 +176,27 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string) (err e
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.Delete")
 	defer _span.End()
 
-	err = _d.Spaces.Delete(ctx, spaceId)
+	err = _d.Spaces.Delete(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	spID = spaceId
+	params := []interface{}{ctx, id, err}
+	for _, p := range params {
+		if p == nil {
+			continue
+		}
+		if sg, ok := p.(spaceGetter); ok {
+			spID = sg.GetSpaceID()
+			if spID != "" {
+				break
+			}
+		}
+	}
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -194,8 +205,8 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, spaceId string) (err e
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceId": spaceId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -240,7 +251,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *spaces.Filter, f
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -267,7 +278,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *spaces.Filter, f
 }
 
 // Get implements spaces.Spaces
-func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string) (space *spaces.Space, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, id string) (space *spaces.Space, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "Get"),
@@ -278,16 +289,27 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string) (space *s
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.Get")
 	defer _span.End()
 
-	space, err = _d.Spaces.Get(ctx, spaceId)
+	space, err = _d.Spaces.Get(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	spID = spaceId
+	params := []interface{}{ctx, id, space, err}
+	for _, p := range params {
+		if p == nil {
+			continue
+		}
+		if sg, ok := p.(spaceGetter); ok {
+			spID = sg.GetSpaceID()
+			if spID != "" {
+				break
+			}
+		}
+	}
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -296,8 +318,8 @@ func (_d telemetryMiddleware) Get(ctx context.Context, spaceId string) (space *s
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceId": spaceId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"space": space,
 			"err":   err})
 	} else if err != nil {
@@ -343,7 +365,7 @@ func (_d telemetryMiddleware) List(ctx context.Context, orgId string) (spaces []
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -399,7 +421,7 @@ func (_d telemetryMiddleware) ListTransfers(ctx context.Context, orgID string) (
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -424,7 +446,7 @@ func (_d telemetryMiddleware) ListTransfers(ctx context.Context, orgID string) (
 }
 
 // Move implements spaces.Spaces
-func (_d telemetryMiddleware) Move(ctx context.Context, spaceID string, orgID string) (err error) {
+func (_d telemetryMiddleware) Move(ctx context.Context, id string, orgID string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "Move"),
@@ -435,12 +457,12 @@ func (_d telemetryMiddleware) Move(ctx context.Context, spaceID string, orgID st
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.Move")
 	defer _span.End()
 
-	err = _d.Spaces.Move(ctx, spaceID, orgID)
+	err = _d.Spaces.Move(ctx, id, orgID)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	params := []interface{}{ctx, spaceID, orgID, err}
+	params := []interface{}{ctx, id, orgID, err}
 	for _, p := range params {
 		if p == nil {
 			continue
@@ -455,7 +477,7 @@ func (_d telemetryMiddleware) Move(ctx context.Context, spaceID string, orgID st
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -464,9 +486,9 @@ func (_d telemetryMiddleware) Move(ctx context.Context, spaceID string, orgID st
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceID": spaceID,
-			"orgID":   orgID}, map[string]interface{}{
+			"ctx":   ctx,
+			"id":    id,
+			"orgID": orgID}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -480,7 +502,7 @@ func (_d telemetryMiddleware) Move(ctx context.Context, spaceID string, orgID st
 }
 
 // SetState implements spaces.Spaces
-func (_d telemetryMiddleware) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) (err error) {
+func (_d telemetryMiddleware) SetState(ctx context.Context, id string, state *spaces.StateInfo) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "SetState"),
@@ -491,12 +513,12 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceID string, stat
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.SetState")
 	defer _span.End()
 
-	err = _d.Spaces.SetState(ctx, spaceID, state)
+	err = _d.Spaces.SetState(ctx, id, state)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	params := []interface{}{ctx, spaceID, state, err}
+	params := []interface{}{ctx, id, state, err}
 	for _, p := range params {
 		if p == nil {
 			continue
@@ -511,7 +533,7 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceID string, stat
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -520,9 +542,9 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceID string, stat
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceID": spaceID,
-			"state":   state}, map[string]interface{}{
+			"ctx":   ctx,
+			"id":    id,
+			"state": state}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -536,7 +558,7 @@ func (_d telemetryMiddleware) SetState(ctx context.Context, spaceID string, stat
 }
 
 // Transfer implements spaces.Spaces
-func (_d telemetryMiddleware) Transfer(ctx context.Context, spaceID string, transferToOrg string) (err error) {
+func (_d telemetryMiddleware) Transfer(ctx context.Context, id string, transferToOrg string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "Transfer"),
@@ -547,12 +569,12 @@ func (_d telemetryMiddleware) Transfer(ctx context.Context, spaceID string, tran
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.Transfer")
 	defer _span.End()
 
-	err = _d.Spaces.Transfer(ctx, spaceID, transferToOrg)
+	err = _d.Spaces.Transfer(ctx, id, transferToOrg)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	params := []interface{}{ctx, spaceID, transferToOrg, err}
+	params := []interface{}{ctx, id, transferToOrg, err}
 	for _, p := range params {
 		if p == nil {
 			continue
@@ -567,7 +589,7 @@ func (_d telemetryMiddleware) Transfer(ctx context.Context, spaceID string, tran
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -577,7 +599,7 @@ func (_d telemetryMiddleware) Transfer(ctx context.Context, spaceID string, tran
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
 			"ctx":           ctx,
-			"spaceID":       spaceID,
+			"id":            id,
 			"transferToOrg": transferToOrg}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
@@ -623,7 +645,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, space *spaces.Space) (
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -647,7 +669,7 @@ func (_d telemetryMiddleware) Update(ctx context.Context, space *spaces.Space) (
 }
 
 // UpdateConfig implements spaces.Spaces
-func (_d telemetryMiddleware) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) (err error) {
+func (_d telemetryMiddleware) UpdateConfig(ctx context.Context, id string, config *spaces.Config) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Spaces"),
 		attribute.String("method", "UpdateConfig"),
@@ -658,16 +680,27 @@ func (_d telemetryMiddleware) UpdateConfig(ctx context.Context, spaceId string,
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Spaces.UpdateConfig")
 	defer _span.End()
 
-	err = _d.Spaces.UpdateConfig(ctx, spaceId, config)
+	err = _d.Spaces.UpdateConfig(ctx, id, config)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
 	var spID string
-	spID = spaceId
+	params := []interface{}{ctx, id, config, err}
+	for _, p := range params {
+		if p == nil {
+			continue
+		}
+		if sg, ok := p.(spaceGetter); ok {
+			spID = sg.GetSpaceID()
+			if spID != "" {
+				break
+			}
+		}
+	}
 	if spID != "" {
 		att = append(att, attribute.String("spaceID", spID))
 	}
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -676,9 +709,9 @@ func (_d telemetryMiddleware) UpdateConfig(ctx context.Context, spaceId string,
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":     ctx,
-			"spaceId": spaceId,
-			"config":  config}, map[string]interface{}{
+			"ctx":    ctx,
+			"id":     id,
+			"config": config}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
diff --git a/pkg/spaces/mocks/Middleware.go b/pkg/spaces/mocks/Middleware.go
index 0979e72e..d3d69efc 100644
--- a/pkg/spaces/mocks/Middleware.go
+++ b/pkg/spaces/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.15.0. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,6 +16,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 spaces.Spaces) spaces.Spaces {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 spaces.Spaces
 	if rf, ok := ret.Get(0).(func(spaces.Spaces) spaces.Spaces); ok {
 		r0 = rf(_a0)
@@ -28,13 +32,12 @@ func (_m *Middleware) Execute(_a0 spaces.Spaces) spaces.Spaces {
 	return r0
 }
 
-type mockConstructorTestingTNewMiddleware interface {
+// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewMiddleware(t interface {
 	mock.TestingT
 	Cleanup(func())
-}
-
-// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
-func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
+}) *Middleware {
 	mock := &Middleware{}
 	mock.Mock.Test(t)
 
diff --git a/pkg/spaces/mocks/Spaces.go b/pkg/spaces/mocks/Spaces.go
index 76121895..85a8c35b 100644
--- a/pkg/spaces/mocks/Spaces.go
+++ b/pkg/spaces/mocks/Spaces.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,9 +16,9 @@ type Spaces struct {
 	mock.Mock
 }
 
-// AbortTransfer provides a mock function with given fields: ctx, spaceID
-func (_m *Spaces) AbortTransfer(ctx context.Context, spaceID string) error {
-	ret := _m.Called(ctx, spaceID)
+// AbortTransfer provides a mock function with given fields: ctx, id
+func (_m *Spaces) AbortTransfer(ctx context.Context, id string) error {
+	ret := _m.Called(ctx, id)
 
 	if len(ret) == 0 {
 		panic("no return value specified for AbortTransfer")
@@ -26,7 +26,7 @@ func (_m *Spaces) AbortTransfer(ctx context.Context, spaceID string) error {
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
-		r0 = rf(ctx, spaceID)
+		r0 = rf(ctx, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -64,9 +64,9 @@ func (_m *Spaces) Create(ctx context.Context, space *spaces.Space) (*spaces.Spac
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, spaceId
-func (_m *Spaces) Delete(ctx context.Context, spaceId string) error {
-	ret := _m.Called(ctx, spaceId)
+// Delete provides a mock function with given fields: ctx, id
+func (_m *Spaces) Delete(ctx context.Context, id string) error {
+	ret := _m.Called(ctx, id)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Delete")
@@ -74,7 +74,7 @@ func (_m *Spaces) Delete(ctx context.Context, spaceId string) error {
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
-		r0 = rf(ctx, spaceId)
+		r0 = rf(ctx, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -119,9 +119,9 @@ func (_m *Spaces) Find(ctx context.Context, filter *spaces.Filter, fo *options.F
 	return r0, r1, r2
 }
 
-// Get provides a mock function with given fields: ctx, spaceId
-func (_m *Spaces) Get(ctx context.Context, spaceId string) (*spaces.Space, error) {
-	ret := _m.Called(ctx, spaceId)
+// Get provides a mock function with given fields: ctx, id
+func (_m *Spaces) Get(ctx context.Context, id string) (*spaces.Space, error) {
+	ret := _m.Called(ctx, id)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Get")
@@ -130,10 +130,10 @@ func (_m *Spaces) Get(ctx context.Context, spaceId string) (*spaces.Space, error
 	var r0 *spaces.Space
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) (*spaces.Space, error)); ok {
-		return rf(ctx, spaceId)
+		return rf(ctx, id)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string) *spaces.Space); ok {
-		r0 = rf(ctx, spaceId)
+		r0 = rf(ctx, id)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*spaces.Space)
@@ -141,7 +141,7 @@ func (_m *Spaces) Get(ctx context.Context, spaceId string) (*spaces.Space, error
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
-		r1 = rf(ctx, spaceId)
+		r1 = rf(ctx, id)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -209,9 +209,9 @@ func (_m *Spaces) ListTransfers(ctx context.Context, orgID string) ([]*spaces.Sp
 	return r0, r1
 }
 
-// Move provides a mock function with given fields: ctx, spaceID, orgID
-func (_m *Spaces) Move(ctx context.Context, spaceID string, orgID string) error {
-	ret := _m.Called(ctx, spaceID, orgID)
+// Move provides a mock function with given fields: ctx, id, orgID
+func (_m *Spaces) Move(ctx context.Context, id string, orgID string) error {
+	ret := _m.Called(ctx, id, orgID)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Move")
@@ -219,7 +219,7 @@ func (_m *Spaces) Move(ctx context.Context, spaceID string, orgID string) error
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
-		r0 = rf(ctx, spaceID, orgID)
+		r0 = rf(ctx, id, orgID)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -227,9 +227,9 @@ func (_m *Spaces) Move(ctx context.Context, spaceID string, orgID string) error
 	return r0
 }
 
-// SetState provides a mock function with given fields: ctx, spaceID, state
-func (_m *Spaces) SetState(ctx context.Context, spaceID string, state *spaces.StateInfo) error {
-	ret := _m.Called(ctx, spaceID, state)
+// SetState provides a mock function with given fields: ctx, id, state
+func (_m *Spaces) SetState(ctx context.Context, id string, state *spaces.StateInfo) error {
+	ret := _m.Called(ctx, id, state)
 
 	if len(ret) == 0 {
 		panic("no return value specified for SetState")
@@ -237,7 +237,7 @@ func (_m *Spaces) SetState(ctx context.Context, spaceID string, state *spaces.St
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, *spaces.StateInfo) error); ok {
-		r0 = rf(ctx, spaceID, state)
+		r0 = rf(ctx, id, state)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -245,9 +245,9 @@ func (_m *Spaces) SetState(ctx context.Context, spaceID string, state *spaces.St
 	return r0
 }
 
-// Transfer provides a mock function with given fields: ctx, spaceID, transferToOrg
-func (_m *Spaces) Transfer(ctx context.Context, spaceID string, transferToOrg string) error {
-	ret := _m.Called(ctx, spaceID, transferToOrg)
+// Transfer provides a mock function with given fields: ctx, id, transferToOrg
+func (_m *Spaces) Transfer(ctx context.Context, id string, transferToOrg string) error {
+	ret := _m.Called(ctx, id, transferToOrg)
 
 	if len(ret) == 0 {
 		panic("no return value specified for Transfer")
@@ -255,7 +255,7 @@ func (_m *Spaces) Transfer(ctx context.Context, spaceID string, transferToOrg st
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
-		r0 = rf(ctx, spaceID, transferToOrg)
+		r0 = rf(ctx, id, transferToOrg)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -281,9 +281,9 @@ func (_m *Spaces) Update(ctx context.Context, space *spaces.Space) error {
 	return r0
 }
 
-// UpdateConfig provides a mock function with given fields: ctx, spaceId, config
-func (_m *Spaces) UpdateConfig(ctx context.Context, spaceId string, config *spaces.Config) error {
-	ret := _m.Called(ctx, spaceId, config)
+// UpdateConfig provides a mock function with given fields: ctx, id, config
+func (_m *Spaces) UpdateConfig(ctx context.Context, id string, config *spaces.Config) error {
+	ret := _m.Called(ctx, id, config)
 
 	if len(ret) == 0 {
 		panic("no return value specified for UpdateConfig")
@@ -291,7 +291,7 @@ func (_m *Spaces) UpdateConfig(ctx context.Context, spaceId string, config *spac
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string, *spaces.Config) error); ok {
-		r0 = rf(ctx, spaceId, config)
+		r0 = rf(ctx, id, config)
 	} else {
 		r0 = ret.Error(0)
 	}
diff --git a/pkg/spaces/mocks/Storage.go b/pkg/spaces/mocks/Storage.go
index 078993ce..8435ef98 100644
--- a/pkg/spaces/mocks/Storage.go
+++ b/pkg/spaces/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.40.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
diff --git a/pkg/spaces/mocks/spaceGetter.go b/pkg/spaces/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/spaces/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/spaces/service.go b/pkg/spaces/service.go
index 24922169..833d7142 100644
--- a/pkg/spaces/service.go
+++ b/pkg/spaces/service.go
@@ -26,26 +26,26 @@ type Spaces interface {
 	// ErrUnavailable
 
 	Create(ctx context.Context, space *Space) (created *Space, err error)
-	Get(ctx context.Context, spaceId string) (space *Space, err error)
+	Get(ctx context.Context, id string) (space *Space, err error)
 	List(ctx context.Context, orgId string) (spaces []*Space, err error)
 	Find(ctx context.Context, filter *Filter, fo *options.FindOptions) (spaces []*Space, total int, err error)
 	Update(ctx context.Context, space *Space) (err error)
-	UpdateConfig(ctx context.Context, spaceId string, config *Config) (err error)
+	UpdateConfig(ctx context.Context, id string, config *Config) (err error)
 
 	// @microgen -
-	SetState(ctx context.Context, spaceID string, state *StateInfo) (err error)
-	Delete(ctx context.Context, spaceId string) (err error)
+	SetState(ctx context.Context, id string, state *StateInfo) (err error)
+	Delete(ctx context.Context, id string) (err error)
 
 	// Transfer устанавливает для пространства значение поля RequestedMoveTo. После этого пространство
 	// будет отображаться в списке входящих запросов на перемещение в организации `orgID` (запрос ListIncoming)
 	// С пространством можно продолжать работу в текущей организации, пока запрос на перемещение не будет
 	// принят в целевой организации
 	// Перенос может быть инициирован только владельцем организации, которой принадлежит пространство
-	Transfer(ctx context.Context, spaceID, transferToOrg string) (err error)
+	Transfer(ctx context.Context, id, transferToOrg string) (err error)
 
 	// AbortTransfer - отменить перемещение пространства в другую организацию. Может быть вызван как
 	// владельцем пространства-инициатора, там и владельцем принимающего пространства
-	AbortTransfer(ctx context.Context, spaceID string) (err error)
+	AbortTransfer(ctx context.Context, id string) (err error)
 
 	// ListTransfers возвращает список пространств, перемещение которых было запрошено в текущую организацию
 	ListTransfers(ctx context.Context, orgID string) (spaces []*Space, err error)
@@ -55,7 +55,7 @@ type Spaces interface {
 	// исходной организации.
 	// В случае, если запрос осуществляется с системным уровнем доступа и передан параметр `orgID`, то перенос будет
 	// осуществлен вне зависимости от того, был он инициирован через метод `Transfer` или нет
-	Move(ctx context.Context, spaceID, orgID string) (err error)
+	Move(ctx context.Context, id, orgID string) (err error)
 }
 
 const (
diff --git a/pkg/users/middleware/access_logging_middleware.go b/pkg/users/middleware/access_logging_middleware.go
index dd8d4a14..fa830272 100644
--- a/pkg/users/middleware/access_logging_middleware.go
+++ b/pkg/users/middleware/access_logging_middleware.go
@@ -32,34 +32,34 @@ func AccessLoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *accessLoggingMiddleware) Create(ctx context.Context, create *users.User) (user *users.User, err error) {
+func (m *accessLoggingMiddleware) Create(ctx context.Context, user *users.User) (created *users.User, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Create.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("create", create),
+		zap.Reflect("user", user),
 	)
 
-	user, err = m.next.Create(ctx, create)
+	created, err = m.next.Create(ctx, user)
 
 	m.logger.Debug("Create.Response",
 		zap.Duration("time", time.Since(begin)),
-		zap.Reflect("user", user),
+		zap.Reflect("created", created),
 		zap.Error(err),
 	)
 
-	return user, err
+	return created, err
 }
 
-func (m *accessLoggingMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (m *accessLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Delete.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("userId", userId),
+		zap.Reflect("id", id),
 	)
 
-	err = m.next.Delete(ctx, userId)
+	err = m.next.Delete(ctx, id)
 
 	m.logger.Debug("Delete.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -90,15 +90,15 @@ func (m *accessLoggingMiddleware) Find(ctx context.Context, filter *users.Filter
 	return users, total, err
 }
 
-func (m *accessLoggingMiddleware) Get(ctx context.Context, userId string) (user *users.User, err error) {
+func (m *accessLoggingMiddleware) Get(ctx context.Context, id string) (user *users.User, err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Get.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("userId", userId),
+		zap.Reflect("id", id),
 	)
 
-	user, err = m.next.Get(ctx, userId)
+	user, err = m.next.Get(ctx, id)
 
 	m.logger.Debug("Get.Response",
 		zap.Duration("time", time.Since(begin)),
@@ -128,15 +128,15 @@ func (m *accessLoggingMiddleware) GetByIdentity(ctx context.Context, identity st
 	return user, err
 }
 
-func (m *accessLoggingMiddleware) Update(ctx context.Context, update *users.User) (err error) {
+func (m *accessLoggingMiddleware) Update(ctx context.Context, user *users.User) (err error) {
 	begin := time.Now()
 
 	m.logger.Debug("Update.Request",
 		zap.Reflect("principal", auth.GetPrincipal(ctx)),
-		zap.Reflect("update", update),
+		zap.Reflect("user", user),
 	)
 
-	err = m.next.Update(ctx, update)
+	err = m.next.Update(ctx, user)
 
 	m.logger.Debug("Update.Response",
 		zap.Duration("time", time.Since(begin)),
diff --git a/pkg/users/middleware/caching_middleware.go b/pkg/users/middleware/caching_middleware.go
index 825da6a2..966da731 100644
--- a/pkg/users/middleware/caching_middleware.go
+++ b/pkg/users/middleware/caching_middleware.go
@@ -26,13 +26,13 @@ func (m cachingMiddleware) Create(ctx context.Context, create *service.User) (us
 	return m.next.Create(ctx, create)
 }
 
-func (m cachingMiddleware) Get(ctx context.Context, userId string) (user *service.User, err error) {
+func (m cachingMiddleware) Get(ctx context.Context, id string) (user *service.User, err error) {
 
-	value, e := m.cache.Get(userId)
+	value, e := m.cache.Get(id)
 	if e == nil {
 		return value.(*service.User).Clone(), nil
 	}
-	user, err = m.next.Get(ctx, userId)
+	user, err = m.next.Get(ctx, id)
 	if err == nil {
 		_ = m.cache.Set(user.ID, user)
 		for _, i := range user.Identities {
@@ -61,10 +61,10 @@ func (m cachingMiddleware) Update(ctx context.Context, update *service.User) (er
 	return err
 }
 
-func (m cachingMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (m cachingMiddleware) Delete(ctx context.Context, id string) (err error) {
 
-	err = m.next.Delete(ctx, userId)
-	value, e := m.cache.Get(userId)
+	err = m.next.Delete(ctx, id)
+	value, e := m.cache.Get(id)
 	if err == nil && e == nil {
 		usr := value.(*service.User)
 		_ = m.cache.Remove(usr.ID)
diff --git a/pkg/users/middleware/error_logging_middleware.go b/pkg/users/middleware/error_logging_middleware.go
index c499b9f3..b8abb51a 100644
--- a/pkg/users/middleware/error_logging_middleware.go
+++ b/pkg/users/middleware/error_logging_middleware.go
@@ -30,24 +30,24 @@ func ErrorLoggingMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *errorLoggingMiddleware) Create(ctx context.Context, create *users.User) (user *users.User, err error) {
+func (m *errorLoggingMiddleware) Create(ctx context.Context, user *users.User) (created *users.User, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Create(ctx, create)
+	return m.next.Create(ctx, user)
 }
 
-func (m *errorLoggingMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (m *errorLoggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Delete(ctx, userId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *users.Filter, options *options.FindOptions) (users []*users.User, total int, err error) {
@@ -60,14 +60,14 @@ func (m *errorLoggingMiddleware) Find(ctx context.Context, filter *users.Filter,
 	return m.next.Find(ctx, filter, options)
 }
 
-func (m *errorLoggingMiddleware) Get(ctx context.Context, userId string) (user *users.User, err error) {
+func (m *errorLoggingMiddleware) Get(ctx context.Context, id string) (user *users.User, err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Get(ctx, userId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *errorLoggingMiddleware) GetByIdentity(ctx context.Context, identity string) (user *users.User, err error) {
@@ -80,12 +80,12 @@ func (m *errorLoggingMiddleware) GetByIdentity(ctx context.Context, identity str
 	return m.next.GetByIdentity(ctx, identity)
 }
 
-func (m *errorLoggingMiddleware) Update(ctx context.Context, update *users.User) (err error) {
+func (m *errorLoggingMiddleware) Update(ctx context.Context, user *users.User) (err error) {
 	logger := m.logger
 	defer func() {
 		if err != nil {
 			logger.Warn("response error", zap.Error(err))
 		}
 	}()
-	return m.next.Update(ctx, update)
+	return m.next.Update(ctx, user)
 }
diff --git a/pkg/users/middleware/logging_middleware.go b/pkg/users/middleware/logging_middleware.go
index 3350d36d..f6a0b9b6 100644
--- a/pkg/users/middleware/logging_middleware.go
+++ b/pkg/users/middleware/logging_middleware.go
@@ -3,7 +3,7 @@ package middleware
 import (
 	"context"
 
-	"git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
 	"git.perx.ru/perxis/perxis-go/pkg/users"
 	logzap "git.perx.ru/perxis/perxis-go/zap"
@@ -41,13 +41,13 @@ func (m *loggingMiddleware) Create(ctx context.Context, create *users.User) (use
 	return user, err
 }
 
-func (m *loggingMiddleware) Get(ctx context.Context, userId string) (user *users.User, err error) {
+func (m *loggingMiddleware) Get(ctx context.Context, id string) (user *users.User, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewUserId(userId)),
+		logzap.Object(pkgId.NewUserId(id)),
 	)
 
-	user, err = m.next.Get(ctx, userId)
+	user, err = m.next.Get(ctx, id)
 	if err != nil {
 		logger.Error("Failed to get", zap.Error(err))
 		return
@@ -88,14 +88,14 @@ func (m *loggingMiddleware) Update(ctx context.Context, update *users.User) (err
 	return err
 }
 
-func (m *loggingMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (m *loggingMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
 		logzap.Event(users.EventDelete),
-		logzap.Object(id.NewUserId(userId)),
+		logzap.Object(pkgId.NewUserId(id)),
 	)
 
-	err = m.next.Delete(ctx, userId)
+	err = m.next.Delete(ctx, id)
 	if err != nil {
 		logger.Error("Failed to delete", zap.Error(err), logzap.Channels(logzap.Userlog, logzap.Syslog))
 		return
@@ -109,7 +109,7 @@ func (m *loggingMiddleware) Delete(ctx context.Context, userId string) (err erro
 func (m *loggingMiddleware) GetByIdentity(ctx context.Context, identity string) (user *users.User, err error) {
 	logger := m.logger.With(
 		logzap.Caller(ctx),
-		logzap.Object(id.NewUserId(identity)),
+		logzap.Object(pkgId.NewUserId(identity)),
 	)
 
 	user, err = m.next.GetByIdentity(ctx, identity)
diff --git a/pkg/users/middleware/recovering_middleware.go b/pkg/users/middleware/recovering_middleware.go
index 7dac51f0..e58c5b91 100644
--- a/pkg/users/middleware/recovering_middleware.go
+++ b/pkg/users/middleware/recovering_middleware.go
@@ -31,7 +31,7 @@ func RecoveringMiddleware(logger *zap.Logger) Middleware {
 	}
 }
 
-func (m *recoveringMiddleware) Create(ctx context.Context, create *users.User) (user *users.User, err error) {
+func (m *recoveringMiddleware) Create(ctx context.Context, user *users.User) (created *users.User, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -40,10 +40,10 @@ func (m *recoveringMiddleware) Create(ctx context.Context, create *users.User) (
 		}
 	}()
 
-	return m.next.Create(ctx, create)
+	return m.next.Create(ctx, user)
 }
 
-func (m *recoveringMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (m *recoveringMiddleware) Delete(ctx context.Context, id string) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -52,7 +52,7 @@ func (m *recoveringMiddleware) Delete(ctx context.Context, userId string) (err e
 		}
 	}()
 
-	return m.next.Delete(ctx, userId)
+	return m.next.Delete(ctx, id)
 }
 
 func (m *recoveringMiddleware) Find(ctx context.Context, filter *users.Filter, options *options.FindOptions) (users []*users.User, total int, err error) {
@@ -67,7 +67,7 @@ func (m *recoveringMiddleware) Find(ctx context.Context, filter *users.Filter, o
 	return m.next.Find(ctx, filter, options)
 }
 
-func (m *recoveringMiddleware) Get(ctx context.Context, userId string) (user *users.User, err error) {
+func (m *recoveringMiddleware) Get(ctx context.Context, id string) (user *users.User, err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -76,7 +76,7 @@ func (m *recoveringMiddleware) Get(ctx context.Context, userId string) (user *us
 		}
 	}()
 
-	return m.next.Get(ctx, userId)
+	return m.next.Get(ctx, id)
 }
 
 func (m *recoveringMiddleware) GetByIdentity(ctx context.Context, identity string) (user *users.User, err error) {
@@ -91,7 +91,7 @@ func (m *recoveringMiddleware) GetByIdentity(ctx context.Context, identity strin
 	return m.next.GetByIdentity(ctx, identity)
 }
 
-func (m *recoveringMiddleware) Update(ctx context.Context, update *users.User) (err error) {
+func (m *recoveringMiddleware) Update(ctx context.Context, user *users.User) (err error) {
 	logger := m.logger
 	defer func() {
 		if r := recover(); r != nil {
@@ -100,5 +100,5 @@ func (m *recoveringMiddleware) Update(ctx context.Context, update *users.User) (
 		}
 	}()
 
-	return m.next.Update(ctx, update)
+	return m.next.Update(ctx, user)
 }
diff --git a/pkg/users/middleware/telemetry_middleware.go b/pkg/users/middleware/telemetry_middleware.go
index 8ad677e7..25088bfd 100644
--- a/pkg/users/middleware/telemetry_middleware.go
+++ b/pkg/users/middleware/telemetry_middleware.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"time"
 
-	oid "git.perx.ru/perxis/perxis-go/id"
+	pkgId "git.perx.ru/perxis/perxis-go/id"
 	"git.perx.ru/perxis/perxis-go/pkg/auth"
 	"git.perx.ru/perxis/perxis-go/pkg/options"
 	"git.perx.ru/perxis/perxis-go/pkg/telemetry/metrics"
@@ -54,7 +54,7 @@ func TelemetryMiddleware(base users.Users, instance string, spanDecorator ...fun
 }
 
 // Create implements users.Users
-func (_d telemetryMiddleware) Create(ctx context.Context, create *users.User) (user *users.User, err error) {
+func (_d telemetryMiddleware) Create(ctx context.Context, user *users.User) (created *users.User, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Users"),
 		attribute.String("method", "Create"),
@@ -65,11 +65,11 @@ func (_d telemetryMiddleware) Create(ctx context.Context, create *users.User) (u
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Users.Create")
 	defer _span.End()
 
-	user, err = _d.Users.Create(ctx, create)
+	created, err = _d.Users.Create(ctx, user)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -78,10 +78,10 @@ func (_d telemetryMiddleware) Create(ctx context.Context, create *users.User) (u
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":    ctx,
-			"create": create}, map[string]interface{}{
-			"user": user,
-			"err":  err})
+			"ctx":  ctx,
+			"user": user}, map[string]interface{}{
+			"created": created,
+			"err":     err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
 
@@ -90,11 +90,11 @@ func (_d telemetryMiddleware) Create(ctx context.Context, create *users.User) (u
 		_span.SetAttributes(attribute.String("message", err.Error()))
 	}
 
-	return user, err
+	return created, err
 }
 
 // Delete implements users.Users
-func (_d telemetryMiddleware) Delete(ctx context.Context, userId string) (err error) {
+func (_d telemetryMiddleware) Delete(ctx context.Context, id string) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Users"),
 		attribute.String("method", "Delete"),
@@ -105,11 +105,11 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, userId string) (err er
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Users.Delete")
 	defer _span.End()
 
-	err = _d.Users.Delete(ctx, userId)
+	err = _d.Users.Delete(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -118,8 +118,8 @@ func (_d telemetryMiddleware) Delete(ctx context.Context, userId string) (err er
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":    ctx,
-			"userId": userId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
@@ -148,7 +148,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *users.Filter, op
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -175,7 +175,7 @@ func (_d telemetryMiddleware) Find(ctx context.Context, filter *users.Filter, op
 }
 
 // Get implements users.Users
-func (_d telemetryMiddleware) Get(ctx context.Context, userId string) (user *users.User, err error) {
+func (_d telemetryMiddleware) Get(ctx context.Context, id string) (user *users.User, err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Users"),
 		attribute.String("method", "Get"),
@@ -186,11 +186,11 @@ func (_d telemetryMiddleware) Get(ctx context.Context, userId string) (user *use
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Users.Get")
 	defer _span.End()
 
-	user, err = _d.Users.Get(ctx, userId)
+	user, err = _d.Users.Get(ctx, id)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -199,8 +199,8 @@ func (_d telemetryMiddleware) Get(ctx context.Context, userId string) (user *use
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":    ctx,
-			"userId": userId}, map[string]interface{}{
+			"ctx": ctx,
+			"id":  id}, map[string]interface{}{
 			"user": user,
 			"err":  err})
 	} else if err != nil {
@@ -230,7 +230,7 @@ func (_d telemetryMiddleware) GetByIdentity(ctx context.Context, identity string
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -255,7 +255,7 @@ func (_d telemetryMiddleware) GetByIdentity(ctx context.Context, identity string
 }
 
 // Update implements users.Users
-func (_d telemetryMiddleware) Update(ctx context.Context, update *users.User) (err error) {
+func (_d telemetryMiddleware) Update(ctx context.Context, user *users.User) (err error) {
 	var att = []attribute.KeyValue{
 		attribute.String("service", "Users"),
 		attribute.String("method", "Update"),
@@ -266,11 +266,11 @@ func (_d telemetryMiddleware) Update(ctx context.Context, update *users.User) (e
 	ctx, _span := otel.Tracer(_d._instance).Start(ctx, "Users.Update")
 	defer _span.End()
 
-	err = _d.Users.Update(ctx, update)
+	err = _d.Users.Update(ctx, user)
 
 	_d.requestMetrics.DurationMilliseconds.Record(ctx, time.Since(start).Milliseconds(), attributes)
 
-	caller, _ := oid.NewObjectId(auth.GetPrincipal(ctx))
+	caller, _ := pkgId.NewObjectId(auth.GetPrincipal(ctx))
 	if caller != nil {
 		att = append(att, attribute.String("caller", caller.String()))
 	}
@@ -279,8 +279,8 @@ func (_d telemetryMiddleware) Update(ctx context.Context, update *users.User) (e
 
 	if _d._spanDecorator != nil {
 		_d._spanDecorator(_span, map[string]interface{}{
-			"ctx":    ctx,
-			"update": update}, map[string]interface{}{
+			"ctx":  ctx,
+			"user": user}, map[string]interface{}{
 			"err": err})
 	} else if err != nil {
 		_d.requestMetrics.FailedTotal.Add(ctx, 1, attributes)
diff --git a/pkg/users/mocks/Middleware.go b/pkg/users/mocks/Middleware.go
index 63d457eb..4e544b86 100644
--- a/pkg/users/mocks/Middleware.go
+++ b/pkg/users/mocks/Middleware.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,6 +16,10 @@ type Middleware struct {
 func (_m *Middleware) Execute(_a0 users.Users) users.Users {
 	ret := _m.Called(_a0)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Execute")
+	}
+
 	var r0 users.Users
 	if rf, ok := ret.Get(0).(func(users.Users) users.Users); ok {
 		r0 = rf(_a0)
diff --git a/pkg/users/mocks/Storage.go b/pkg/users/mocks/Storage.go
index a1001d78..2f21f086 100644
--- a/pkg/users/mocks/Storage.go
+++ b/pkg/users/mocks/Storage.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -20,6 +20,10 @@ type Storage struct {
 func (_m *Storage) Create(ctx context.Context, create *users.User) (*users.User, error) {
 	ret := _m.Called(ctx, create)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
+
 	var r0 *users.User
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *users.User) (*users.User, error)); ok {
@@ -46,6 +50,10 @@ func (_m *Storage) Create(ctx context.Context, create *users.User) (*users.User,
 func (_m *Storage) Delete(ctx context.Context, filter *users.Filter) (int, error) {
 	ret := _m.Called(ctx, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
+
 	var r0 int
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *users.Filter) (int, error)); ok {
@@ -70,6 +78,10 @@ func (_m *Storage) Delete(ctx context.Context, filter *users.Filter) (int, error
 func (_m *Storage) Find(ctx context.Context, filter *users.Filter, opts *options.FindOptions) ([]*users.User, int, error) {
 	ret := _m.Called(ctx, filter, opts)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Find")
+	}
+
 	var r0 []*users.User
 	var r1 int
 	var r2 error
@@ -103,6 +115,10 @@ func (_m *Storage) Find(ctx context.Context, filter *users.Filter, opts *options
 func (_m *Storage) Init(ctx context.Context) error {
 	ret := _m.Called(ctx)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Init")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
 		r0 = rf(ctx)
@@ -117,6 +133,10 @@ func (_m *Storage) Init(ctx context.Context) error {
 func (_m *Storage) Reset(ctx context.Context) error {
 	ret := _m.Called(ctx)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Reset")
+	}
+
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
 		r0 = rf(ctx)
@@ -131,6 +151,10 @@ func (_m *Storage) Reset(ctx context.Context) error {
 func (_m *Storage) Update(ctx context.Context, update *users.User, filter *users.Filter) (int, int, error) {
 	ret := _m.Called(ctx, update, filter)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
+
 	var r0 int
 	var r1 int
 	var r2 error
diff --git a/pkg/users/mocks/Users.go b/pkg/users/mocks/Users.go
index 4db80b6d..989c6e68 100644
--- a/pkg/users/mocks/Users.go
+++ b/pkg/users/mocks/Users.go
@@ -1,4 +1,4 @@
-// Code generated by mockery v2.33.3. DO NOT EDIT.
+// Code generated by mockery v2.46.3. DO NOT EDIT.
 
 package mocks
 
@@ -16,17 +16,21 @@ type Users struct {
 	mock.Mock
 }
 
-// Create provides a mock function with given fields: ctx, create
-func (_m *Users) Create(ctx context.Context, create *users.User) (*users.User, error) {
-	ret := _m.Called(ctx, create)
+// Create provides a mock function with given fields: ctx, user
+func (_m *Users) Create(ctx context.Context, user *users.User) (*users.User, error) {
+	ret := _m.Called(ctx, user)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Create")
+	}
 
 	var r0 *users.User
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, *users.User) (*users.User, error)); ok {
-		return rf(ctx, create)
+		return rf(ctx, user)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, *users.User) *users.User); ok {
-		r0 = rf(ctx, create)
+		r0 = rf(ctx, user)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*users.User)
@@ -34,7 +38,7 @@ func (_m *Users) Create(ctx context.Context, create *users.User) (*users.User, e
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, *users.User) error); ok {
-		r1 = rf(ctx, create)
+		r1 = rf(ctx, user)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -42,13 +46,17 @@ func (_m *Users) Create(ctx context.Context, create *users.User) (*users.User, e
 	return r0, r1
 }
 
-// Delete provides a mock function with given fields: ctx, userId
-func (_m *Users) Delete(ctx context.Context, userId string) error {
-	ret := _m.Called(ctx, userId)
+// Delete provides a mock function with given fields: ctx, id
+func (_m *Users) Delete(ctx context.Context, id string) error {
+	ret := _m.Called(ctx, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Delete")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
-		r0 = rf(ctx, userId)
+		r0 = rf(ctx, id)
 	} else {
 		r0 = ret.Error(0)
 	}
@@ -60,6 +68,10 @@ func (_m *Users) Delete(ctx context.Context, userId string) error {
 func (_m *Users) Find(ctx context.Context, filter *users.Filter, _a2 *options.FindOptions) ([]*users.User, int, error) {
 	ret := _m.Called(ctx, filter, _a2)
 
+	if len(ret) == 0 {
+		panic("no return value specified for Find")
+	}
+
 	var r0 []*users.User
 	var r1 int
 	var r2 error
@@ -89,17 +101,21 @@ func (_m *Users) Find(ctx context.Context, filter *users.Filter, _a2 *options.Fi
 	return r0, r1, r2
 }
 
-// Get provides a mock function with given fields: ctx, userId
-func (_m *Users) Get(ctx context.Context, userId string) (*users.User, error) {
-	ret := _m.Called(ctx, userId)
+// Get provides a mock function with given fields: ctx, id
+func (_m *Users) Get(ctx context.Context, id string) (*users.User, error) {
+	ret := _m.Called(ctx, id)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Get")
+	}
 
 	var r0 *users.User
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) (*users.User, error)); ok {
-		return rf(ctx, userId)
+		return rf(ctx, id)
 	}
 	if rf, ok := ret.Get(0).(func(context.Context, string) *users.User); ok {
-		r0 = rf(ctx, userId)
+		r0 = rf(ctx, id)
 	} else {
 		if ret.Get(0) != nil {
 			r0 = ret.Get(0).(*users.User)
@@ -107,7 +123,7 @@ func (_m *Users) Get(ctx context.Context, userId string) (*users.User, error) {
 	}
 
 	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
-		r1 = rf(ctx, userId)
+		r1 = rf(ctx, id)
 	} else {
 		r1 = ret.Error(1)
 	}
@@ -119,6 +135,10 @@ func (_m *Users) Get(ctx context.Context, userId string) (*users.User, error) {
 func (_m *Users) GetByIdentity(ctx context.Context, identity string) (*users.User, error) {
 	ret := _m.Called(ctx, identity)
 
+	if len(ret) == 0 {
+		panic("no return value specified for GetByIdentity")
+	}
+
 	var r0 *users.User
 	var r1 error
 	if rf, ok := ret.Get(0).(func(context.Context, string) (*users.User, error)); ok {
@@ -141,13 +161,17 @@ func (_m *Users) GetByIdentity(ctx context.Context, identity string) (*users.Use
 	return r0, r1
 }
 
-// Update provides a mock function with given fields: ctx, update
-func (_m *Users) Update(ctx context.Context, update *users.User) error {
-	ret := _m.Called(ctx, update)
+// Update provides a mock function with given fields: ctx, user
+func (_m *Users) Update(ctx context.Context, user *users.User) error {
+	ret := _m.Called(ctx, user)
+
+	if len(ret) == 0 {
+		panic("no return value specified for Update")
+	}
 
 	var r0 error
 	if rf, ok := ret.Get(0).(func(context.Context, *users.User) error); ok {
-		r0 = rf(ctx, update)
+		r0 = rf(ctx, user)
 	} else {
 		r0 = ret.Error(0)
 	}
diff --git a/pkg/users/mocks/spaceGetter.go b/pkg/users/mocks/spaceGetter.go
new file mode 100644
index 00000000..0dfa462e
--- /dev/null
+++ b/pkg/users/mocks/spaceGetter.go
@@ -0,0 +1,42 @@
+// Code generated by mockery v2.46.3. DO NOT EDIT.
+
+package mocks
+
+import mock "github.com/stretchr/testify/mock"
+
+// spaceGetter is an autogenerated mock type for the spaceGetter type
+type spaceGetter struct {
+	mock.Mock
+}
+
+// GetSpaceID provides a mock function with given fields:
+func (_m *spaceGetter) GetSpaceID() string {
+	ret := _m.Called()
+
+	if len(ret) == 0 {
+		panic("no return value specified for GetSpaceID")
+	}
+
+	var r0 string
+	if rf, ok := ret.Get(0).(func() string); ok {
+		r0 = rf()
+	} else {
+		r0 = ret.Get(0).(string)
+	}
+
+	return r0
+}
+
+// newSpaceGetter creates a new instance of spaceGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func newSpaceGetter(t interface {
+	mock.TestingT
+	Cleanup(func())
+}) *spaceGetter {
+	mock := &spaceGetter{}
+	mock.Mock.Test(t)
+
+	t.Cleanup(func() { mock.AssertExpectations(t) })
+
+	return mock
+}
diff --git a/pkg/users/service.go b/pkg/users/service.go
index d64a5cec..a244c517 100644
--- a/pkg/users/service.go
+++ b/pkg/users/service.go
@@ -10,11 +10,11 @@ import (
 // @protobuf git.perx.ru/perxis/perxis-go/proto/users
 // @grpc-addr account.users.Users
 type Users interface {
-	Create(ctx context.Context, create *User) (user *User, err error)
-	Get(ctx context.Context, userId string) (user *User, err error)
+	Create(ctx context.Context, user *User) (created *User, err error)
+	Get(ctx context.Context, id string) (user *User, err error)
 	Find(ctx context.Context, filter *Filter, options *options.FindOptions) (users []*User, total int, err error)
-	Update(ctx context.Context, update *User) (err error)
-	Delete(ctx context.Context, userId string) (err error)
+	Update(ctx context.Context, user *User) (err error)
+	Delete(ctx context.Context, id string) (err error)
 	GetByIdentity(ctx context.Context, identity string) (user *User, err error)
 }
 
-- 
GitLab