Inbox: a customer question counts for the trader whatever the state (check it before the state rules)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Yashas 2026-10-28 11:39:11 +05:30
parent fe0b6c4fc7
commit 0140856583

View File

@ -8,9 +8,10 @@ import { Badge, Empty, ErrorNote, StateBadge, qtyText } from '../components/ui';
/** Which enquiries are waiting on THIS user. */ /** Which enquiries are waiting on THIS user. */
function needsMe(e: Enquiry, has: (...r: string[]) => boolean): boolean { function needsMe(e: Enquiry, has: (...r: string[]) => boolean): boolean {
// A customer question waits for a trader whatever the state, so it is checked first.
if (e.awaiting_trader_reply === 'yes') return has('bunker_trader', 'trading_head');
if (e.current_state_name === 'Awaiting Ops Input') return has('bunker_ops', 'trading_head'); if (e.current_state_name === 'Awaiting Ops Input') return has('bunker_ops', 'trading_head');
if (e.current_state_name === 'Awaiting Offer') return has('bunker_trader', 'trading_head'); if (e.current_state_name === 'Awaiting Offer') return has('bunker_trader', 'trading_head');
if (e.awaiting_trader_reply === 'yes') return has('bunker_trader', 'trading_head');
if (e.current_state_name === 'Offer Sent' && e.customer_decision === 'query') return has('bunker_trader', 'trading_head'); if (e.current_state_name === 'Offer Sent' && e.customer_decision === 'query') return has('bunker_trader', 'trading_head');
if (e.current_state_name === 'Confirmed') return has('bunker_ops', 'trading_head'); if (e.current_state_name === 'Confirmed') return has('bunker_ops', 'trading_head');
return false; return false;