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

var __defProp=Object['defineProperty'],__name=(_0x220e97,_0x56a944)=>__defProp(_0x220e97,'name',{'value':_0x56a944,'configurable':!![]});async function subscriptionUpdatePostRoute(_0x5e6713){const _0xd38fda=await getUserId(),{subscriptionId:_0x165796,pricingId:_0x35b29e}=await parseJsonBodyFromRequest(_0x5e6713);return await checkResourceAccessPermission(_0xd38fda,resourceNames['subscription'],crudActions['update']),await updatePaymentPlan(_0x165796,_0x35b29e),apiNoContentResponse();}__name(subscriptionUpdatePostRoute,'subscriptionUpdatePostRoute');

export { subscriptionUpdatePostRoute };
