'use strict';
import { getItemsByUserId } from '../items/item-db.js';
import { resourceNames } from '../../../fd-toolbox/resources/resource-names.js';
import { toolboxUserConstants } from '../../meta/constants/toolbox-users.js';
import { crudDelete } from '../../meta/server/basic-crud/cruds.js';
import { checkUserPermission } from './edit-other-users.js';
import { userManagerDeleteUser } from './user-manager.js';
import { crudActions } from '../../../fd-toolbox/enums/enums.js';

var __defProp=Object['defineProperty'],__name=(_0x1f6106,_0x45accb)=>__defProp(_0x1f6106,'name',{'value':_0x45accb,'configurable':!![]});async function deleteUser(_0x28124b){checkUserPermission(crudActions['delete']);const _0x36b9a6=await getItemsByUserId(_0x28124b);for(const _0x320b75 of _0x36b9a6){const _0x543714={'resourceName':resourceNames['item'],'resourceId':_0x320b75['id'],'userId':toolboxUserConstants['workerBotId'],'ignoreDbUpdateConcurrencyException':![]};await crudDelete(_0x543714);}await userManagerDeleteUser(_0x28124b);}__name(deleteUser,'deleteUser');

export { deleteUser };
