'use strict';
import { getUserId } from '../../../meta/server/auth/users/current-user-id-provider.js';
import { parseJsonBodyFromRequest } from '../../../../fd-toolbox/lib/utils.js';
import { checkResourceAccessPermission } from '../../utils/check-resource-access-permission.js';
import { resourceNames } from '../../../../fd-toolbox/resources/resource-names.js';
import { apiNoContentResponse } from '../../../meta/server/web/responses.js';
import { createSubscriptionForCurrentWorkspace } from '../../payments/subscriptions/subscriptions.js';
import { crudActions } from '../../../../fd-toolbox/enums/enums.js';

var __defProp=Object['defineProperty'],__name=(_0x22cc7f,_0x5bdba4)=>__defProp(_0x22cc7f,'name',{'value':_0x5bdba4,'configurable':!![]});async function subscriptionCreatePostRoute(_0x4c3592){const _0x5d5386=await getUserId(),{pricingId:_0xbe84de}=await parseJsonBodyFromRequest(_0x4c3592);return await checkResourceAccessPermission(_0x5d5386,resourceNames['subscription'],crudActions['create']),await createSubscriptionForCurrentWorkspace(_0xbe84de),apiNoContentResponse();}__name(subscriptionCreatePostRoute,'subscriptionCreatePostRoute');

export { subscriptionCreatePostRoute };
