feat(dashboard,js-sdk,medusa): add ability to add outbound items to claim (#8502)

what:

- user can add/remove/update outbound items to a claim
- adds API to query variants

Note: There are several paths that are not implemented yet correctly, but have some code lying around. Those will be tackled in the followup PRs

https://github.com/user-attachments/assets/cadb3f7a-982f-44c7-8d7e-9f4f26949f4f

RESOLVES CC-330
RESOLVES CC-296
This commit is contained in:
Riqwan Thamir
2024-08-08 14:20:13 +02:00
committed by GitHub
parent 9cd66bc842
commit 85ed025705
20 changed files with 1052 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
import { Client } from "../client"
import { Claim } from "./claim"
import { Currency } from "./currency"
import { Customer } from "./customer"
import { Fulfillment } from "./fulfillment"
@@ -16,6 +17,7 @@ import { ProductCategory } from "./product-category"
import { ProductCollection } from "./product-collection"
import { ProductTag } from "./product-tag"
import { ProductType } from "./product-type"
import { ProductVariant } from "./product-variant"
import { Region } from "./region"
import { Return } from "./return"
import { ReturnReason } from "./return-reason"
@@ -28,7 +30,6 @@ import { TaxRate } from "./tax-rate"
import { TaxRegion } from "./tax-region"
import { Upload } from "./upload"
import { User } from "./user"
import { Claim } from "./claim"
export class Admin {
public invite: Invite
@@ -61,6 +62,7 @@ export class Admin {
public user: User
public currency: Currency
public payment: Payment
public productVariant: ProductVariant
constructor(client: Client) {
this.invite = new Invite(client)
@@ -93,5 +95,6 @@ export class Admin {
this.user = new User(client)
this.currency = new Currency(client)
this.payment = new Payment(client)
this.productVariant = new ProductVariant(client)
}
}

View File

@@ -0,0 +1,23 @@
import { HttpTypes } from "@medusajs/types"
import { Client } from "../client"
import { ClientHeaders } from "../types"
export class ProductVariant {
private client: Client
constructor(client: Client) {
this.client = client
}
async list(
queryParams?: HttpTypes.AdminProductVariantParams,
headers?: ClientHeaders
) {
return await this.client.fetch<HttpTypes.AdminProductVariantListResponse>(
`/admin/product-variants`,
{
headers,
query: queryParams,
}
)
}
}