feat(medusa,dashboard,tax): added tax rates and regions UI (#7026)

whats missing:

- make rules required for overrides
- conditions for other rules
- populating condition reference ids with labels on update

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
Riqwan Thamir
2024-04-16 08:26:12 +00:00
committed by GitHub
co-authored by Adrien de Peretti
parent 92b633d1cb
commit 00e6b21bb5
77 changed files with 3654 additions and 104 deletions
@@ -1 +1,2 @@
export * from "./tax-rates"
export * from "./tax-regions"
@@ -0,0 +1,39 @@
import { PaginatedResponse } from "../../../common"
import { TaxRegionResponse } from "./tax-regions"
/**
* @experimental
*/
export interface TaxRateResponse {
id: string
rate: number | null
code: string | null
name: string
metadata: Record<string, unknown> | null
tax_region_id: string
is_combinable: boolean
is_default: boolean
created_at: string | Date
updated_at: string | Date
deleted_at: Date | null
created_by: string | null
tax_region: TaxRegionResponse
rules: {
reference: string
reference_id: string
}[]
}
/**
* @experimental
*/
export interface AdminTaxRateResponse {
tax_rate: TaxRateResponse
}
/**
* @experimental
*/
export interface AdminTaxRateListResponse extends PaginatedResponse {
tax_rates: TaxRateResponse[]
}
@@ -1,21 +1,29 @@
import { PaginatedResponse } from "../../../common"
import { TaxRateResponse } from "./tax-rates"
/**
* @experimental
*/
interface TaxRegionResponse {
export interface TaxRegionResponse {
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 | Date
updated_at: string | Date
deleted_at: Date | null
created_by: string | null
tax_rates: TaxRateResponse[]
parent: TaxRegionResponse
}
/**