"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseTenantContextService = void 0;
const request_context_1 = require("../../../request-context/request-context");
class BaseTenantContextService {
    tenantService;
    constructor(tenantService) {
        this.tenantService = tenantService;
    }
    isEnabled() {
        return true;
    }
    async getCurrentTenantId() {
        const tenantId = request_context_1.RequestContext.currentTenantId();
        return tenantId ?? null;
    }
    async getCurrentTenant() {
        const id = await this.getCurrentTenantId();
        return id ? this.tenantService.getTenantById(id) : null;
    }
    async getCurrentAccess() {
        return request_context_1.RequestContext.currentUserAccess();
    }
}
exports.BaseTenantContextService = BaseTenantContextService;
//# sourceMappingURL=base-tenant-context.service.js.map