feat(promotion, dashboard, core-flows, cart, types, utils, medusa): tax inclusive promotions (#12412)
* feat: tax inclusive promotions * feat: add a totals test case * feat: add integration test * chore: changeset * fix: typo * chore: refactor * fix: tests * fix: rest of buyget action tests * fix: cart spec * chore: expand integration test with item level totals * feat: add a few more test cases --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -998,6 +998,16 @@
|
||||
"nullable": false,
|
||||
"mappedType": "decimal"
|
||||
},
|
||||
"is_tax_inclusive": {
|
||||
"name": "is_tax_inclusive",
|
||||
"type": "boolean",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"default": "false",
|
||||
"mappedType": "boolean"
|
||||
},
|
||||
"provider_id": {
|
||||
"name": "provider_id",
|
||||
"type": "text",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20250508081553 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`alter table if exists "cart_line_item_adjustment" add column if not exists "is_tax_inclusive" boolean not null default false;`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`alter table if exists "cart_line_item_adjustment" drop column if exists "is_tax_inclusive";`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ const LineItemAdjustment = model
|
||||
description: model.text().nullable(),
|
||||
code: model.text().nullable(),
|
||||
amount: model.bigNumber(),
|
||||
is_tax_inclusive: model.boolean().default(false),
|
||||
provider_id: model.text().nullable(),
|
||||
promotion_id: model.text().nullable(),
|
||||
metadata: model.json().nullable(),
|
||||
|
||||
Reference in New Issue
Block a user