"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.accountEntities = exports.registerAccountEntity = void 0; const uuid_1 = require("oak-domain/lib/utils/uuid"); // 当注入一个新的account entity时,将withdrawChannel的删除与之相关联 function registerAccountEntity(entity) { exports.accountEntities.push(entity); } exports.registerAccountEntity = registerAccountEntity; exports.accountEntities = ['offlineAccount']; const triggers = [ ...exports.accountEntities.filter(ele => !!ele).map((entity) => [ { entity, action: 'remove', type: 'logical', checker: (operation, context) => { const { filter } = operation; return context.operate('withdrawChannel', { id: (0, uuid_1.generateNewId)(), action: 'remove', data: {}, filter: { [entity]: filter, } }, { dontCollect: true }); } }, ]).flat(), ]; exports.default = triggers;