"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEffectivelyClaimed = isEffectivelyClaimed;
exports.isAvailable = isAvailable;
/**
 * An escalation is "effectively claimed" when assigned_to is set
 * and assigned_until is in the future. Status remains 'pending'.
 */
function isEffectivelyClaimed(esc) {
    return !!(esc.assigned_to &&
        esc.assigned_until &&
        esc.assigned_until > new Date());
}
/**
 * An escalation is "available" when status is pending and
 * either unassigned or the assignment has expired.
 */
function isAvailable(esc) {
    return (esc.status === 'pending' &&
        (!esc.assigned_to || !esc.assigned_until || esc.assigned_until <= new Date()));
}
