'use strict';
import { getResourcesWithOData } from '../../meta/server/db/db.js';
import { resourceNames } from '../../../fd-toolbox/resources/resource-names.js';
import { leadToLeadGroupProps } from '../../common/leads/props/lead-to-lead-group-props.js';
import { oDataOperators } from '../../../fd-toolbox/enums/enums.js';
import { oDataFilterTypes, oDataComparisonTypes } from '../../../fd-toolbox/odata/odata-enums.js';
import { getODataBuilder } from '../../../fd-toolbox/odata/odata-builder-funcs.js';
import { updateLeadGroupCount } from './lead-to-lead-group.handlers.js';

var __defProp=Object['defineProperty'],__name=(_0x601991,_0x863239)=>__defProp(_0x601991,'name',{'value':_0x863239,'configurable':!![]});async function preDelete(_0x1b73b0){const _0x25bff3=_0x1b73b0['deleteResource'],_0x17a935=getODataBuilder()['filter'](leadToLeadGroupProps['leadId'],_0x25bff3['id'],oDataOperators['equal'],{'comparisonType':oDataComparisonTypes['equal'],'type':oDataFilterTypes['guid']})['select'](leadToLeadGroupProps['leadGroupId'])['build'](),_0x4f030c=await getResourcesWithOData(resourceNames['leadToLeadGroup'],_0x17a935);for(const _0x4ab488 of _0x4f030c){await updateLeadGroupCount(_0x4ab488['leadGroupId'],![]);}}__name(preDelete,'preDelete');

export { preDelete };
