feat: Line Items API Routes (#6478)

**What**
- `POST /store/carts/:id/line-items`
- `POST /store/carts/:id/line-items/:id`
- `DELETE /store/carts/:id/line-items/:id`

**Outstanding**
- Integration tests
- Module integrations: Payment, Fulfillment, Promotions

Depends on #6475 and #6449.
This commit is contained in:
Oli Juhl
2024-02-27 12:47:00 +00:00
committed by GitHub
parent f5c2256286
commit 3ee0f599c1
30 changed files with 937 additions and 208 deletions
+4
View File
@@ -400,6 +400,10 @@ export interface CartLineItemDTO extends CartLineItemTotalsDTO {
* When the line item was updated.
*/
updated_at?: Date
/**
* When the line item was deleted.
*/
deleted_at?: Date
}
export interface CartDTO {
+1
View File
@@ -189,6 +189,7 @@ export interface UpdateLineItemDTO
title?: string
quantity?: number
unit_price?: number
metadata?: Record<string, unknown> | null
tax_lines?: UpdateTaxLineDTO[] | CreateTaxLineDTO[]
adjustments?: UpdateAdjustmentDTO[] | CreateAdjustmentDTO[]
+8 -1
View File
@@ -1,4 +1,5 @@
import { CartDTO } from "./common"
import { CartDTO, CartLineItemDTO } from "./common"
import { UpdateLineItemDTO } from "./mutations"
export interface CreateCartCreateLineItemDTO {
quantity: number
@@ -32,6 +33,12 @@ export interface CreateCartCreateLineItemDTO {
metadata?: Record<string, unknown>
}
export interface UpdateLineItemInCartWorkflowInputDTO {
cart: CartDTO
item: CartLineItemDTO
update: Partial<UpdateLineItemDTO>
}
export interface CreateCartAddressDTO {
first_name?: string
last_name?: string