File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,16 @@ export const ConfirmCheckoutInputSchema = z.object({
7272 * Customer data provided at confirm time.
7373 */
7474 customer : CustomerInputSchema . optional ( ) ,
75+ /**
76+ * The selected product ID from the checkout's available products.
77+ * In the selector model, multiple products represent options to choose from,
78+ * and the user selects ONE product at confirm time.
79+ */
80+ productId : z . string ( ) . optional ( ) ,
81+ /**
82+ * Products array for CUSTOM pricing amounts only.
83+ * Use productId for standard product selection.
84+ */
7585 products : z
7686 . array (
7787 z . object ( {
Original file line number Diff line number Diff line change @@ -57,7 +57,18 @@ const BaseCheckoutSchema = z.object({
5757 */
5858 customer : CustomerOutputSchema . nullable ( ) ,
5959 customerBillingAddress : z . record ( z . any ( ) ) . nullable ( ) ,
60+ /**
61+ * Available product options for this checkout.
62+ * In the selector model, these represent choices the user can pick from.
63+ * The user selects ONE product, which is then stored in productId.
64+ */
6065 products : z . array ( CheckoutProductSchema ) . nullable ( ) ,
66+ /**
67+ * The selected product ID (set after confirm).
68+ * In the selector model, this indicates which product the user chose
69+ * from the available products array.
70+ */
71+ productId : z . string ( ) . nullable ( ) ,
6172 providedAmount : z . number ( ) . nullable ( ) ,
6273 totalAmount : z . number ( ) . nullable ( ) ,
6374 discountAmount : z . number ( ) . nullable ( ) ,
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ describe('API Contract Index', () => {
6060 currency : 'USD' ,
6161 } ] ,
6262 } ] ,
63+ productId : null ,
6364 providedAmount : null ,
6465 totalAmount : null ,
6566 discountAmount : null ,
@@ -191,4 +192,4 @@ describe('API Contract Index', () => {
191192 expect ( contract . checkout . paymentReceived ) . toBeDefined ( ) ;
192193 } ) ;
193194 } ) ;
194- } ) ;
195+ } ) ;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const baseCheckoutData = {
2323 customer : null ,
2424 customerBillingAddress : null ,
2525 products : null ,
26+ productId : null ,
2627 providedAmount : null ,
2728 totalAmount : null ,
2829 discountAmount : null ,
@@ -383,4 +384,4 @@ describe('CheckoutSchema', () => {
383384 expect ( result . success ) . toBe ( false ) ;
384385 } ) ;
385386 } ) ;
386- } ) ;
387+ } ) ;
You can’t perform that action at this time.
0 commit comments