move api/server to api/edge/bff
This commit is contained in:
23
api/edge/bff/internal/server/papitemplate/db.go
Normal file
23
api/edge/bff/internal/server/papitemplate/db.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package papitemplate
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/tech/sendico/pkg/db/repository/builder"
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
type ProtectedDB[T any] interface {
|
||||
Create(ctx context.Context, accountRef, organizationRef bson.ObjectID, object *T) error
|
||||
Get(ctx context.Context, accountRef, objectRef bson.ObjectID, result *T) error
|
||||
Update(ctx context.Context, accountRef bson.ObjectID, object *T) error
|
||||
Delete(ctx context.Context, accountRef, objectRef bson.ObjectID) error
|
||||
DeleteCascadeAuth(ctx context.Context, accountRef, objectRef bson.ObjectID) error
|
||||
SetArchived(ctx context.Context, accountRef, organizationRef, objectRef bson.ObjectID, isArchived, cascade bool) error
|
||||
List(ctx context.Context, accountRef, organizationRef, parentRef bson.ObjectID, cursor *model.ViewCursor) ([]T, error)
|
||||
}
|
||||
|
||||
type ReorderDB interface {
|
||||
Reorder(ctx context.Context, accountRef, objectRef bson.ObjectID, newIndex int, filter builder.Query) error
|
||||
}
|
||||
Reference in New Issue
Block a user