feat(tax): add support for updating tax rates (#6516)

**What**
- Adds update
This commit is contained in:
Sebastian Rindom
2024-02-27 09:55:22 +00:00
committed by GitHub
parent d03b72ecdd
commit ca463ae9a9
4 changed files with 137 additions and 0 deletions
+9
View File
@@ -9,6 +9,15 @@ export interface CreateTaxRateDTO {
metadata?: Record<string, unknown>
}
export interface UpdateTaxRateDTO {
rate?: number | null
code?: string | null
name?: string
is_default?: boolean
created_by?: string
metadata?: Record<string, unknown>
}
export interface CreateTaxRegionDTO {
country_code: string
province_code?: string | null
+17
View File
@@ -19,6 +19,7 @@ import {
CreateTaxRateRuleDTO,
CreateTaxRateDTO,
CreateTaxRegionDTO,
UpdateTaxRateDTO,
} from "./mutations"
export interface ITaxModuleService extends IModuleService {
@@ -46,6 +47,22 @@ export interface ITaxModuleService extends IModuleService {
): Promise<TaxRateDTO[]>
create(data: CreateTaxRateDTO, sharedContext?: Context): Promise<TaxRateDTO>
update(
taxRateId: string,
data: UpdateTaxRateDTO,
sharedContext?: Context
): Promise<TaxRateDTO>
update(
taxRateIds: string[],
data: UpdateTaxRateDTO,
sharedContext?: Context
): Promise<TaxRateDTO[]>
update(
selector: FilterableTaxRateProps,
data: UpdateTaxRateDTO,
sharedContext?: Context
): Promise<TaxRateDTO[]>
delete(taxRateIds: string[], sharedContext?: Context): Promise<void>
delete(taxRateId: string, sharedContext?: Context): Promise<void>