Feat: Add tax inclusivity to admin (#8003)
* feat: Add price preference to sdk * feat: Plug tax inclusivity settings for region in UI * feat: Add price inclusivity indicator to variant and shipping price table columns * fix: Rename price title to correct variable name * feat: Add support for tax inclusive crud on region * fix: Use the region endpoint for updating tax inclusivity * chore: Factor out price columns from hooks
This commit is contained in:
@@ -7,6 +7,7 @@ import { InventoryItem } from "./inventory-item"
|
||||
import { Invite } from "./invite"
|
||||
import { Order } from "./order"
|
||||
import { PriceList } from "./price-list"
|
||||
import { PricePreference } from "./price-preference"
|
||||
import { Product } from "./product"
|
||||
import { ProductCategory } from "./product-category"
|
||||
import { ProductCollection } from "./product-collection"
|
||||
@@ -27,6 +28,7 @@ export class Admin {
|
||||
public productCollection: ProductCollection
|
||||
public productCategory: ProductCategory
|
||||
public priceList: PriceList
|
||||
public pricePreference: PricePreference
|
||||
public product: Product
|
||||
public productType: ProductType
|
||||
public upload: Upload
|
||||
@@ -50,6 +52,7 @@ export class Admin {
|
||||
this.productCollection = new ProductCollection(client)
|
||||
this.productCategory = new ProductCategory(client)
|
||||
this.priceList = new PriceList(client)
|
||||
this.pricePreference = new PricePreference(client)
|
||||
this.product = new Product(client)
|
||||
this.productType = new ProductType(client)
|
||||
this.upload = new Upload(client)
|
||||
|
||||
83
packages/core/js-sdk/src/admin/price-preference.ts
Normal file
83
packages/core/js-sdk/src/admin/price-preference.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { Client } from "../client"
|
||||
import { ClientHeaders } from "../types"
|
||||
|
||||
export class PricePreference {
|
||||
private client: Client
|
||||
|
||||
constructor(client: Client) {
|
||||
this.client = client
|
||||
}
|
||||
|
||||
async retrieve(
|
||||
id: string,
|
||||
query?: HttpTypes.AdminPricePreferenceParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return this.client.fetch<HttpTypes.AdminPricePreferenceResponse>(
|
||||
`/admin/price-preferences/${id}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async list(
|
||||
query?: HttpTypes.AdminPricePreferenceListParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return this.client.fetch<HttpTypes.AdminPricePreferenceListResponse>(
|
||||
`/admin/price-preferences`,
|
||||
{
|
||||
method: "GET",
|
||||
headers,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async create(
|
||||
body: HttpTypes.AdminCreatePricePreference,
|
||||
query?: HttpTypes.AdminPricePreferenceParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return this.client.fetch<HttpTypes.AdminPricePreferenceResponse>(
|
||||
`/admin/price-preferences`,
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async update(
|
||||
id: string,
|
||||
body: HttpTypes.AdminUpdatePricePreference,
|
||||
query?: HttpTypes.AdminPricePreferenceParams,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return this.client.fetch<HttpTypes.AdminPricePreferenceResponse>(
|
||||
`/admin/price-preferences/${id}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body,
|
||||
query,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async delete(id: string, headers?: ClientHeaders) {
|
||||
return this.client.fetch<HttpTypes.AdminPricePreferenceDeleteResponse>(
|
||||
`/admin/price-preferences/${id}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user