feat(dashboard,types,promotion,medusa): hide fields on promotions depending on templates (#7746)

**what:**

- hides different fields depending on the chosen template
- remove operator values API
- fixes to edit promotion rules
- make currency optional for promotion

RESOLVES CORE-2297
This commit is contained in:
Riqwan Thamir
2024-06-18 18:47:42 +02:00
committed by GitHub
parent 1451112f08
commit 0d04c548f5
24 changed files with 523 additions and 389 deletions

View File

@@ -0,0 +1,22 @@
import { Migration } from "@mikro-orm/migrations"
export class Migration20240617102917 extends Migration {
async up(): Promise<void> {
this.addSql(
'alter table "promotion_application_method" alter column "currency_code" type text using ("currency_code"::text);'
)
this.addSql(
'alter table "promotion_application_method" alter column "currency_code" drop not null;'
)
}
async down(): Promise<void> {
this.addSql(
'alter table "promotion_application_method" alter column "currency_code" type text using ("currency_code"::text);'
)
this.addSql(
'alter table "promotion_application_method" alter column "currency_code" set not null;'
)
}
}

View File

@@ -13,7 +13,7 @@ export interface CreateApplicationMethodDTO {
target_type: ApplicationMethodTargetTypeValues
allocation?: ApplicationMethodAllocationValues
value?: BigNumberInput
currency_code: string
currency_code?: string | null
promotion: Promotion | string | PromotionDTO
max_quantity?: BigNumberInput | null
buy_rules_min_quantity?: BigNumberInput | null
@@ -26,7 +26,7 @@ export interface UpdateApplicationMethodDTO {
target_type?: ApplicationMethodTargetTypeValues
allocation?: ApplicationMethodAllocationValues
value?: BigNumberInput
currency_code?: string
currency_code?: string | null
promotion?: Promotion | string | PromotionDTO
max_quantity?: BigNumberInput | null
buy_rules_min_quantity?: BigNumberInput | null