diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-cancel.event.observe.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-cancel.event.observe.doc.ts new file mode 100644 index 0000000000..b17d3e1f5c --- /dev/null +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-cancel.event.observe.doc.ts @@ -0,0 +1,15 @@ +import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; +import {ExtensionTargetType} from '../types/ExtensionTargetType'; + +const data: ReferenceEntityTemplateSchema = { + name: ExtensionTargetType.PosCashTrackingSessionStartObserve, + description: + 'An event extension target that observes when cash tracking session is canceled', + category: 'Targets', + subCategory: 'Cash tracking', + isVisualComponent: false, + related: [], + type: 'Target', +}; + +export default data; diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-complete.event.observe.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-complete.event.observe.doc.ts new file mode 100644 index 0000000000..6c5aad9d9c --- /dev/null +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-complete.event.observe.doc.ts @@ -0,0 +1,15 @@ +import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; +import {ExtensionTargetType} from '../types/ExtensionTargetType'; + +const data: ReferenceEntityTemplateSchema = { + name: ExtensionTargetType.PosCashTrackingSessionStartObserve, + description: + 'An event extension target that observes when cash tracking session completes', + category: 'Targets', + subCategory: 'Cash tracking', + isVisualComponent: false, + related: [], + type: 'Target', +}; + +export default data; diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-start.event.observe.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-start.event.observe.doc.ts new file mode 100644 index 0000000000..dc8ccc4e20 --- /dev/null +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.cash-tracking-session-start.event.observe.doc.ts @@ -0,0 +1,15 @@ +import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; +import {ExtensionTargetType} from '../types/ExtensionTargetType'; + +const data: ReferenceEntityTemplateSchema = { + name: ExtensionTargetType.PosCashTrackingSessionStartObserve, + description: + 'An event extension target that observes when cash tracking session starts', + category: 'Targets', + subCategory: 'Cash tracking', + isVisualComponent: false, + related: [], + type: 'Target', +}; + +export default data; diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.transaction-completed.observe.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.transaction-completed.event.observe.doc.ts similarity index 100% rename from packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.transaction-completed.observe.doc.ts rename to packages/ui-extensions/docs/surfaces/point-of-sale/reference/targets/pos.transaction-completed.event.observe.doc.ts diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/types/ExtensionTargetType.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/types/ExtensionTargetType.ts index c371fed92f..137e993037 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/types/ExtensionTargetType.ts +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/types/ExtensionTargetType.ts @@ -16,7 +16,10 @@ export enum ExtensionTargetType { PosDraftOrderDetailsActionMenuItemRender = 'pos.draft-order-details.action.menu-item.render', PosDraftOrderDetailsActionRender = 'pos.draft-order-details.action.render', PosDraftOrderDetailsBlockRender = 'pos.draft-order-details.block.render', - PosTransactionCompletedObserve = 'pos.transaction-completed.observe', + PosTransactionCompletedObserve = 'pos.transaction-completed.event.observe', + PosCashTrackingSessionStartObserve = 'pos.cash-tracking-session-start.event.observe', + PosCashTrackingSessionCancelObserve = 'pos.cash-tracking-session-cancel.event.observe', + PosCashTrackingSessionCompleteObserver = 'pos.cash-tracking-session-complete.event.observe', } export enum TargetLink { @@ -37,5 +40,8 @@ export enum TargetLink { PosDraftOrderDetailsActionMenuItemRender = '[pos.draft-order-details.action.menu-item.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-menu-item-render)', PosDraftOrderDetailsActionRender = '[pos.draft-order-details.action.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-action-render)', PosDraftOrderDetailsBlockRender = '[pos.draft-order-details.block.render](/docs/api/pos-ui-extensions/targets/draft-order-details/pos-draft-order-details-block-render)', - PosTransactionCompletedObserve = '[pos.transaction-completed.observe](/docs/api/pos-ui-extensions/targets/post-purchase/pos-transaction-completed-observe)', + PosTransactionCompletedObserve = '[pos.transaction-completed.event.observe](/docs/api/pos-ui-extensions/targets/post-purchase/pos-transaction-completed-observe)', + PosCashTrackingSessionStartObserve = '[pos.cash-tracking-session-start.event.observe](/docs/api/pos-ui-extensions/targets/cash-tracking/pos-cash-tracking-session-start-observe)', + PosCashTrackingSessionCancelObserve = '[pos.cash-tracking-session-cancel.event.observe](/docs/api/pos-ui-extensions/targets/cash-tracking/pos-cash-tracking-session-cancel-observe)', + PosCashTrackingSessionCompleteObserver = '[pos.cash-tracking-session-complete.event.observe](/docs/api/pos-ui-extensions/targets/cash-tracking/pos-cash-tracking-session-complete-observe)', } diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/versions.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/versions.doc.ts index e5ce7b77ed..696f349f15 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/versions.doc.ts +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/versions.doc.ts @@ -49,6 +49,7 @@ Refer to the [migration guide](/docs/api/pos-ui-extensions/migrating) for more i ### Features - Added support for the ${TargetLink.PosTransactionCompletedObserve} target. +- Added support for cash tracking session. ${TargetLink.PosCashTrackingSessionStartObserve}, ${TargetLink.PosCashTrackingSessionCancelObserve}, ${TargetLink.PosCashTrackingSessionCompleteObserver} targets. `, }, { diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/input/CashTrackingSessionInput.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/input/CashTrackingSessionInput.ts new file mode 100644 index 0000000000..fd8cb5910d --- /dev/null +++ b/packages/ui-extensions/src/surfaces/point-of-sale/event/input/CashTrackingSessionInput.ts @@ -0,0 +1,11 @@ +import {BaseInput} from './BaseInput'; + +export interface CashTrackingSessionStartInput extends BaseInput { + id: string; + openingTime: string; +} + +export interface CashTrackingSessionEndInput extends BaseInput { + id: string; + closingTime: string; +} diff --git a/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts b/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts index 3ad30ecc08..145bd1d916 100644 --- a/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts +++ b/packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts @@ -1,10 +1,23 @@ import {BaseIntent} from '../intent'; +import { + CashTrackingSessionStartInput, + CashTrackingSessionEndInput, +} from './input/CashTrackingSessionInput'; import {PurchaseCompleteInput} from './input/PurchaseCompleteInput'; export interface EventExtensionTargets { - 'pos.transaction-completed.observe': ( + 'pos.transaction-completed.event.observe': ( input: PurchaseCompleteInput, ) => BaseIntent; + 'pos.cash-tracking-session-start.event.observe': ( + input: CashTrackingSessionStartInput, + ) => BaseIntent; + 'pos.cash-tracking-session-cancel.event.observe': ( + input: CashTrackingSessionEndInput, + ) => BaseIntent; + 'pos.cash-tracking-session-complete.event.observe': ( + input: CashTrackingSessionEndInput, + ) => BaseIntent; } export type EventExtensionTarget = keyof EventExtensionTargets;