Requisition List Events and Data
The Requisition List drop-in uses the event bus to emit and listen to events for communication between drop-ins and external integrations.
Events reference
Section titled “Events reference”| Event | Direction | Description |
|---|---|---|
| requisitionList/alert | Emits and listens | Emitted when an alert or notification is triggered. |
| requisitionList/data | Emits and listens | Emitted when data is available or changes. |
| requisitionList/initialized | Emits and listens | Emitted when the component completes initialization. |
| requisitionLists/data | Emits and listens | Emitted when data is available or changes. |
Event details
Section titled “Event details”The following sections provide detailed information about each event, including its direction, event payload, and usage examples.
requisitionList/alert (emits and listens)
Section titled “requisitionList/alert (emits and listens)”Emitted when the drop-in shows an alert or notification related to requisition list actions.
Event payload
Section titled “Event payload”RequisitionListActionPayloadSee RequisitionListActionPayload for full type definition.
Example
Section titled “Example”import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/alert', (payload) => { console.log('requisitionList/alert event received:', payload); // Add your custom logic here});requisitionList/data (emits and listens)
Section titled “requisitionList/data (emits and listens)”Triggered when data is available or changes. It emits and listens for updates to a single requisition list.
Event payload
Section titled “Event payload”RequisitionList | nullSee RequisitionList for full type definition.
Example
Section titled “Example”import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/data', (payload) => { console.log('requisitionList/data event received:', payload); // Add your custom logic here});requisitionList/initialized (emits and listens)
Section titled “requisitionList/initialized (emits and listens)”Triggered when the component completes initialization.
Event payload
Section titled “Event payload”Example
Section titled “Example”import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/initialized', (payload) => { console.log('requisitionList/initialized event received:', payload); // Add your custom logic here});requisitionLists/data (emits and listens)
Section titled “requisitionLists/data (emits and listens)”Triggered when data is available or changes. It emits and listens for updates to the collection of requisition lists.
Event payload
Section titled “Event payload”RequisitionList[] | nullSee RequisitionList for full type definition.
Example
Section titled “Example”import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionLists/data', (payload) => { console.log('requisitionLists/data event received:', payload); // Add your custom logic here});Data Models
Section titled “Data Models”The following data models are used in event payloads for this drop-in.
RequisitionList
Section titled “RequisitionList”Used in: requisitionList/data, requisitionLists/data.
interface RequisitionList { uid: string; name: string; description: string; updated_at: string; items_count: number; items: Item[]; page_info?: PageInfo;}RequisitionListActionPayload
Section titled “RequisitionListActionPayload”Used in: requisitionList/alert.
interface RequisitionListActionPayload { action: 'add' | 'delete' | 'update' | 'move'; type: 'success' | 'error'; context: 'product' | 'requisitionList'; skus?: string[]; // for product-related actions message?: string[]; // for uncontrolled/custom messages }