Skip to content

Commit

Permalink
fix(types): fixes to HTTP types (#9189)
Browse files Browse the repository at this point in the history
* fix(types): fixes to HTTP types

* more fixes

* remove incorrect fields for tax regions
  • Loading branch information
shahednasser authored Sep 19, 2024
1 parent 07f25de commit 230a16a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
16 changes: 14 additions & 2 deletions packages/core/types/src/http/promotion/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,22 @@ export interface BaseRuleAttributeOptions {
id: string
value: string
label: string
/**
* @ignore
*/
field_type: string
/**
* @ignore
*/
required: boolean
disguised: boolean
/**
* @ignore
*/
disguised?: boolean
/**
* @ignore
*/
hydrate?: boolean
operators: BaseRuleOperatorOptions[]
}

Expand All @@ -63,7 +76,6 @@ export interface BaseRuleOperatorOptions {
}

export interface BaseRuleValueOptions {
id: string
value: string
label: string
}
4 changes: 3 additions & 1 deletion packages/core/types/src/http/region/admin/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ import {
BaseRegionCountry,
} from "../common"

export interface AdminRegion extends BaseRegion {}
export interface AdminRegion extends Omit<BaseRegion, "countries"> {
countries?: AdminRegionCountry[]
}
export interface AdminRegionCountry extends BaseRegionCountry {}
4 changes: 3 additions & 1 deletion packages/core/types/src/http/reservation/admin/entities.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { AdminInventoryItem } from "../../inventory"

export interface AdminReservation {
id: string
line_item_id: string | null
Expand All @@ -6,7 +8,7 @@ export interface AdminReservation {
external_id: string | null
description: string | null
inventory_item_id: string
inventory_item: Record<string, unknown> // TODO: add InventoryItemResponse
inventory_item?: AdminInventoryItem
metadata?: Record<string, unknown>
created_by?: string | null
deleted_at?: Date | string | null
Expand Down
4 changes: 3 additions & 1 deletion packages/core/types/src/http/return/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ReturnStatus } from "../../order"

export interface BaseReturnItem {
id: string
quantity: number
Expand All @@ -13,7 +15,7 @@ export interface BaseReturnItem {
export interface BaseReturn {
id: string
order_id: string
status?: string
status?: ReturnStatus
exchange_id?: string
location_id?: string
claim_id?: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RuleOperatorType } from "../../../common"
import { ShippingOptionPriceType } from "../../../fulfillment"
import { AdminFulfillmentProvider } from "../../fulfillment-provider"
import { AdminServiceZone } from "../../fulfillment-set"
Expand All @@ -18,7 +19,7 @@ export interface AdminShippingOptionType {
export interface AdminShippingOptionRule {
id: string
attribute: string
operator: string
operator: RuleOperatorType
value: string | string[] | null
shipping_option_id: string
created_at: string
Expand Down
6 changes: 0 additions & 6 deletions packages/core/types/src/http/tax-region/admin/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ import { AdminTaxRate } from "../../tax-rate"

export interface AdminTaxRegion {
id: string
rate: number | null
code: string | null
country_code: string | null
province_code: string | null
name: string
metadata: Record<string, unknown> | null
tax_region_id: string
is_combinable: boolean
is_default: boolean
parent_id: string | null
created_at: string
updated_at: string
Expand Down

0 comments on commit 230a16a

Please sign in to comment.