-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cash tracking session event targets.
- Loading branch information
Showing
8 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...ces/point-of-sale/reference/targets/pos.cash-tracking-session-cancel.event.observe.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
15 changes: 15 additions & 0 deletions
15
...s/point-of-sale/reference/targets/pos.cash-tracking-session-complete.event.observe.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
15 changes: 15 additions & 0 deletions
15
...aces/point-of-sale/reference/targets/pos.cash-tracking-session-start.event.observe.doc.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/ui-extensions/src/surfaces/point-of-sale/event/input/CashTrackingSessionInput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
15 changes: 14 additions & 1 deletion
15
packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |