-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pos.prepare-receipt.inject extension target #2597
Add pos.prepare-receipt.inject extension target #2597
Conversation
payments: { | ||
paymentMethod: PaymentMethod; | ||
amount: number; | ||
}[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@js-goupil This is something to align with checkout-complete
export enum PrepareReceiptAdditionalLineType { | ||
Header = 'Header', | ||
Text = 'Text', | ||
List = 'List', | ||
// eslint-disable-next-line @shopify/typescript/prefer-pascal-case-enums | ||
QRCode = 'QRCode', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is existing ComplianceLines that we can parse. (Except we now use type
to detect an error message
96ace32
to
e465645
Compare
import {TransactionCompleteInput} from './TransactionCompleteInput'; | ||
|
||
export interface PrepareReceiptInput { | ||
prepareReceipt: TransactionCompleteInput['transactionComplete']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uses the same input data as TransactionComplete
We still need separate interface to be flexible, and modify this interface without affecting CheckoutComplete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we opt for a PrepareReceiptInput extends TransactionCompleteInput
instead? Alternatively we can move the contents of TransactionCompleteInput
into a separate interface called PosCheckout
and both inputs can extend that and be empty for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
@@ -0,0 +1,19 @@ | |||
import {BaseIntent} from './BaseIntent'; | |||
|
|||
export enum PrepareReceiptAdditionalLineType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enums have caused us a lot of headaches with typescript when exporting/importing on the POS side. Can we switch to a type
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 'List' | ||
| 'QRCode' | ||
| 'Error'; | ||
export interface PrepareReceiptAdditionalLine { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a line above here please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can we add some inline documentation here? Or was this going to be a follow up task? Remember that the in line docs automatically get compiled into the developer docs, so it's super helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some inline doc with examples, but we will need a dedicated page with pictures to show how different lines look
62f2ea6
@@ -61,6 +61,21 @@ Refer to the [migration guide](/docs/api/pos-ui-extensions/migrating) for more i | |||
- Removed in POS version: N/A | |||
- Release day: 1/6/2025 | |||
### Features | |||
- Added support for the ${TargetLink.PosPrepareReceiptInject} target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been out of the loop for dates but shouldn't this be under the 2025.04 release? Also this addition is duplicated, we have two 2025.01 sections in the version doc now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you
Fixed
b3c23ad
to
a677b87
Compare
/shipit |
Background
Part 1/3 of https://github.com/Shopify/retail-hq-store-management/issues/743
Resolves https://github.com/Shopify/retail-hq-store-management/issues/744
Solution
Use this doc to add new event-initiated extension target
🎩
Checklist