package crm

import (
	"context"

	"apps/backend/internal/middleware"
	"apps/backend/internal/response"
)

func ownerUID(ctx context.Context) (int64, error) {
	uid, ok := middleware.UIDFrom(ctx)
	if !ok || uid <= 0 {
		return 0, response.Biz(401, 401001, "missing authorization")
	}
	return uid, nil
}
