'use strict';
import { oDataComparisonTypes, oDataFilterTypes } from '../../../fd-toolbox/odata/odata-enums.js';
import { resourceNames } from '../../../fd-toolbox/resources/resource-names.js';
import { getResources } from '../../meta/server/services/resource-provider.js';
import { roleIds } from '../../common/auth/roles/role-ids.js';
import { orderProps } from '../../common/orders/order-props.js';
import { getUserId } from '../../meta/server/auth/users/current-user-id-provider.js';
import { first } from '../../../fd-toolbox/server/collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0xbe5910,_0x2d1785)=>__defProp(_0xbe5910,'name',{'value':_0x2d1785,'configurable':!![]});async function get(_0x32b659){const _0x147e5a=await getUserId(),_0x296728=await getResources(resourceNames['userRole'],_0x147e5a),_0x152bee=_0x296728['find'](_0x4067d8=>_0x4067d8['userId']===_0x147e5a)?.['roleId'];if(_0x152bee!==roleIds['customerRoleId'])return;const _0x53db40=await getResources(resourceNames['customer'],_0x147e5a),_0x4e507c=first(_0x53db40)['id'],_0xea950b={'type':oDataFilterTypes['guid'],'comparisonType':oDataComparisonTypes['equal'],'leftSide':orderProps['customerId'],'rightSide':_0x4e507c};if(_0x32b659['filters'])_0x32b659['filters']['push'](_0xea950b);else _0x32b659['filters']=[_0xea950b];}__name(get,'get');

export { get as getOrders };
