feat(core-flows,medusa,types): add automatic-taxes to region + generate tax lines endpoint (#6667)
what: - endpoint to generate tax lines - update workflows to force calculate tax lines with a flag - added automatic_taxes to region
This commit is contained in:
@@ -20,9 +20,10 @@ ALTER TABLE "region" DROP CONSTRAINT IF EXISTS "FK_3bdd5896ec93be2f1c62a3309a5";
|
||||
ALTER TABLE "region" DROP CONSTRAINT IF EXISTS "FK_91f88052197680f9790272aaf5b";
|
||||
${generatePostgresAlterColummnIfExistStatement(
|
||||
"region",
|
||||
["tax_rate", "gift_cards_taxable", "automatic_taxes", "includes_tax"],
|
||||
["tax_rate", "gift_cards_taxable", "includes_tax"],
|
||||
"DROP NOT NULL"
|
||||
)}
|
||||
ALTER TABLE "region" ADD COLUMN IF NOT EXISTS "automatic_taxes" BOOLEAN NOT NULL DEFAULT TRUE;
|
||||
CREATE INDEX IF NOT EXISTS "IDX_region_deleted_at" ON "region" ("deleted_at") WHERE "deleted_at" IS NOT NULL;
|
||||
-- Create or update "region_country" table
|
||||
CREATE TABLE IF NOT EXISTS "region_country" (
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Entity,
|
||||
Filter,
|
||||
Index,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OneToMany,
|
||||
OptionalProps,
|
||||
@@ -31,6 +30,9 @@ export default class Region {
|
||||
@Property({ columnType: "text" })
|
||||
currency_code: string
|
||||
|
||||
@Property({ columnType: "boolean" })
|
||||
automatic_taxes = true
|
||||
|
||||
@OneToMany(() => Country, (country) => country.region)
|
||||
countries = new Collection<Country>(this)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user