@medusajs/types
Version:
Medusa Types definition
262 lines • 6.13 kB
TypeScript
import { MetadataType } from "../common";
import { BaseFilterable } from "../dal";
import { OperatorMap } from "../dal";
import { TaxProviderDTO } from "./common";
/**
* The tax rate to be created.
*/
export interface CreateTaxRateDTO {
/**
* The associated tax region's ID.
*/
tax_region_id: string;
/**
* The rate to charge.
*
* @example
* 10
*/
rate?: number | null;
/**
* The code of the tax rate.
*/
code?: string | null;
/**
* The name of the tax rate.
*/
name: string;
/**
* The rules of the tax rate.
*/
rules?: Omit<CreateTaxRateRuleDTO, "tax_rate_id">[];
/**
* Whether the tax rate is default.
*/
is_default?: boolean;
/**
* Who created the tax rate. For example, the ID of the user
* that created the tax rate.
*/
created_by?: string;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
}
/**
* The tax provider to be created.
*/
export interface CreateTaxProviderDTO {
/**
* The provider's ID.
*/
id: string;
/**
* Whether the provider is enabled.
*/
is_enabled?: boolean;
}
/**
* The filters to apply on the retrieved tax providers.
*/
export interface FilterableTaxProviderProps extends BaseFilterable<TaxProviderDTO> {
/**
* The IDs to filter the tax provider by.
*/
id?: string | string[] | OperatorMap<string | string[]>;
/**
* Filter by whether the tax provider is enabled.
*/
is_enabled?: boolean;
}
/**
* The attributes in the tax rate to be created or updated.
*/
export interface UpsertTaxRateDTO {
/**
* The ID of the tax rate. If not provided, the tax rate
* is created.
*/
id?: string;
/**
* The rate to charge
*
* @example
* 10
*/
rate?: number | null;
/**
* The code of the tax rate.
*/
code?: string | null;
/**
* The name of the tax rate.
*/
name?: string;
/**
* Whether the tax rate is default.
*/
is_default?: boolean;
/**
* Who created the tax rate. For example, the
* ID of the user that created it.
*/
created_by?: string | null;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
}
/**
* The attributes to update in the tax rate.
*/
export interface UpdateTaxRateDTO {
/**
* The rate to charge.
*
* @example
* 10
*/
rate?: number | null;
/**
* The code of the tax rate.
*/
code?: string | null;
/**
* The name of the tax rate.
*/
name?: string;
/**
* The rules of the tax rate.
*/
rules?: Omit<CreateTaxRateRuleDTO, "tax_rate_id">[];
/**
* Whether the tax rate is default.
*/
is_default?: boolean;
/**
* Whether the tax rate is combinable.
*
* Learn more [here](https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules#combinable-tax-rates).
*/
is_combinable?: boolean;
/**
* @ignore
*
* @privateRemarks
* This should be `created_by`.
*/
updated_by?: string;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
}
/**
* The tax region to be created.
*/
export interface CreateTaxRegionDTO {
/**
* The ISO 3 character country code of the tax region.
*/
country_code: string;
/**
* The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) province or state code of the tax region.
*/
province_code?: string | null;
/**
* The ID of the tax region's parent.
*/
parent_id?: string | null;
/**
* The ID of the tax provider for the region.
*/
provider_id?: string | null;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
/**
* Who created the tax region. For example, the ID of
* the user that created the tax region.
*/
created_by?: string;
/**
* The default tax rate of the tax region.
*/
default_tax_rate?: {
/**
* The rate to charge.
*
* @example
* 10
*/
rate?: number | null;
/**
* The code of the tax rate.
*/
code?: string | null;
/**
* The name of the tax rate.
*/
name: string;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
};
}
/**
* The tax region to be updated.
*/
export interface UpdateTaxRegionDTO {
/**
* The id of the tax region to update
*/
id: string;
/**
* The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) province or state code of the tax region.
*/
province_code?: string | null;
/**
* The ID of the tax provider for the region.
*/
provider_id?: string | null;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
}
/**
* The tax rate rule to be created.
*/
export interface CreateTaxRateRuleDTO {
/**
* The snake-case name of the data model that the tax rule references.
* For example, `product`.
*
* Learn more in [this guide](https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules#override-tax-rates-with-rules).
*/
reference: string;
/**
* The ID of the record of the data model that the tax rule references.
* For example, `prod_123`.
*
* Learn more in [this guide](https://docs.medusajs.com/resources/commerce-modules/tax/tax-rates-and-rules#override-tax-rates-with-rules).
*/
reference_id: string;
/**
* The associated tax rate's ID.
*/
tax_rate_id: string;
/**
* Holds custom data in key-value pairs.
*/
metadata?: MetadataType;
/**
* Who created the tax rate rule. For example, the ID of the
* user that created it.
*/
created_by?: string | null;
}
//# sourceMappingURL=mutations.d.ts.map