21 lines
592 B
JavaScript
21 lines
592 B
JavaScript
const app = require('vn-loopback/server/server');
|
|
|
|
module.exports = Self => {
|
|
require('../methods/zone/clone')(Self);
|
|
require('../methods/zone/getLeaves')(Self);
|
|
require('../methods/zone/getEvents')(Self);
|
|
require('../methods/zone/toggleIsIncluded')(Self);
|
|
|
|
Self.validatesPresenceOf('agencyModeFk', {
|
|
message: `Agency cannot be blank`
|
|
});
|
|
|
|
Self.observe('after save', async function() {
|
|
await app.models.ZoneClosure.doRecalc();
|
|
});
|
|
|
|
Self.observe('after delete', async function() {
|
|
await app.models.ZoneClosure.doRecalc();
|
|
});
|
|
};
|