/opt/mawid/apps/api/src/whatsapp
NameSizeModeActions
owner-notifier.service.ts17450644editdlrm
wa-core.module.ts13520644editdlrm
wa-http.client.ts17360644editdlrm
wa-inbound.service.spec.ts50660644editdlrm
wa-inbound.service.ts54310644editdlrm
wa-outbound.worker.ts27230644editdlrm
wa-queue.ts4470644editdlrm
wa-sender.service.ts49590644editdlrm
wa-signature.spec.ts12640644editdlrm
wa-signature.ts6620644editdlrm
wa-types.ts16830644editdlrm
wa-webhook.controller.spec.ts26840644editdlrm
wa-webhook.controller.ts23080644editdlrm
wa-window.spec.ts8600644editdlrm
wa-window.ts5090644editdlrm
whatsapp.module.ts5790644editdlrm
Edit: /opt/mawid/apps/api/src/whatsapp/wa-window.spec.ts (860B)
import { isWithinCustomerServiceWindow } from './wa-window'; describe('isWithinCustomerServiceWindow', () => { const now = new Date('2026-07-15T12:00:00Z'); it('is open just after an inbound message', () => { expect(isWithinCustomerServiceWindow(new Date('2026-07-15T11:59:00Z'), now)).toBe(true); }); it('is open 23h59m after the last inbound message', () => { expect(isWithinCustomerServiceWindow(new Date('2026-07-14T12:01:00Z'), now)).toBe(true); }); it('is closed exactly 24h after the last inbound message', () => { expect(isWithinCustomerServiceWindow(new Date('2026-07-14T12:00:00Z'), now)).toBe(false); }); it('is closed when there was never an inbound message', () => { expect(isWithinCustomerServiceWindow(null, now)).toBe(false); expect(isWithinCustomerServiceWindow(undefined, now)).toBe(false); }); });