const app = require('vn-loopback/server/server'); module.exports = Self => { Self.observe('after save', async function() { await app.models.ZoneClosure.doRecalc(); }); Self.observe('after delete', async function() { await app.models.ZoneClosure.doRecalc(); }); };