-
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 transaction complete event types #2577
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -34,6 +34,7 @@ export interface LineItem { | |||
vendor?: string; | |||
properties: {[key: string]: string}; | |||
isGiftCard: boolean; | |||
attributedUserId?: 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.
attributedStaff is known as attributedUserId as defined in the POS model CheckoutLineItem
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.
Nice, we'll have to map this value over for the cart api as well just fyi
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
@@ -107,3 +108,84 @@ export interface Address { | |||
provinceCode?: string; | |||
countryCode?: CountryCode; | |||
} | |||
|
|||
export type ShippingLine = |
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.
POS model of ShippingLine
Retail = 'RETAIL', | ||
} | ||
|
||
export interface TaxLine { |
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.
POS model of TaxLine
packages/ui-extensions/src/surfaces/point-of-sale/event/input/PurchaseCompleteInput.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/point-of-sale/event/input/PurchaseCompleteInput.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
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.
Looks good, just minor comments and moving a couple things into some other files.
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/point-of-sale/types/cart.ts
Outdated
Show resolved
Hide resolved
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.
code lgtm!
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.
Small fixes then ship it!
packages/ui-extensions/src/surfaces/point-of-sale/event/input/TransactionCompleteInput.ts
Show resolved
Hide resolved
lineItems: LineItem[]; | ||
orderId: number; | ||
paymentMethods: PaymentMethod[]; | ||
shippingLines: ShippingLine; |
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 think this is also optional
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 optional values for
- orderId - checkout interface
- shippingLines - checkout interface
- taxLines - checkout interface
|
||
interface CreditPayment extends BasePayment { | ||
type: 'CreditCard'; | ||
lastDigits: string; |
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.
let's remove this field until we're sure we need it. cc @Alex-Palad
packages/ui-extensions/src/surfaces/point-of-sale/event/targets.ts
Outdated
Show resolved
Hide resolved
Add changeset Fix optionals and remove last digits
90f01bf
to
5074ca0
Compare
Resolves https://github.com/Shopify/pos-next-react-native/issues/51358
Background
This PR adds proper typing to each property for a transaction complete input. It also encapsulates all the properties in a object to improve usability and seperation from the BaseInput properties. You can find the file for POS
CheckoutState
hereBefore:
After:
Solution
I just copied a lot of the checkout types over. We will need to refactor and remove some definitions. Please help me align with what exact properties we want to define in each of our types of
TaxLines
,ShippingLine
andPaymentMethod