feat(tax): singular creates and deletes of regions, rates, rules (#6464)
**What** - Adds support for creating single rates, regions, rules. - Adds delete methods.
This commit is contained in:
@@ -3,6 +3,7 @@ export interface CreateTaxRateDTO {
|
||||
rate?: number | null
|
||||
code?: string | null
|
||||
name: string
|
||||
rules?: Omit<CreateTaxRateRuleDTO, "tax_rate_id">[]
|
||||
is_default?: boolean
|
||||
created_by?: string
|
||||
metadata?: Record<string, unknown>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FindConfig } from "../common"
|
||||
import { SoftDeleteReturn } from "../dal"
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
import { Context } from "../shared-context"
|
||||
import {
|
||||
@@ -48,22 +49,45 @@ export interface ITaxModuleService extends IModuleService {
|
||||
delete(taxRateIds: string[], sharedContext?: Context): Promise<void>
|
||||
delete(taxRateId: string, sharedContext?: Context): Promise<void>
|
||||
|
||||
createTaxRegions(
|
||||
data: CreateTaxRegionDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRegionDTO>
|
||||
createTaxRegions(
|
||||
data: CreateTaxRegionDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRegionDTO[]>
|
||||
|
||||
deleteTaxRegions(
|
||||
taxRegionIds: string[],
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
deleteTaxRegions(taxRegionId: string, sharedContext?: Context): Promise<void>
|
||||
|
||||
listTaxRegions(
|
||||
filters?: FilterableTaxRegionProps,
|
||||
config?: FindConfig<TaxRegionDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRegionDTO[]>
|
||||
|
||||
createTaxRateRules(
|
||||
data: CreateTaxRateRuleDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRateRuleDTO>
|
||||
createTaxRateRules(
|
||||
data: CreateTaxRateRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<TaxRateRuleDTO[]>
|
||||
|
||||
deleteTaxRateRules(
|
||||
taxRateRulePair: { tax_rate_id: string; reference_id: string },
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
deleteTaxRateRules(
|
||||
taxRateRulePair: { tax_rate_id: string; reference_id: string }[],
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
|
||||
listTaxRateRules(
|
||||
filters?: FilterableTaxRateRuleProps,
|
||||
config?: FindConfig<TaxRateRuleDTO>,
|
||||
|
||||
Reference in New Issue
Block a user