feat: event aggregator (#6218)
What: - Event Aggregator Util - Preparation for normalizing event in a new format (backward compatible with the current format) - GQL Schema to joiner config and some Entities configured - Link modules emmiting events
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
PriceSet,
|
||||
PriceSetMoneyAmount,
|
||||
} from "@models"
|
||||
import schema from "./schema"
|
||||
|
||||
export const LinkableKeys = {
|
||||
money_amount_id: MoneyAmount.name,
|
||||
@@ -32,45 +33,30 @@ export const joinerConfig: ModuleJoinerConfig = {
|
||||
serviceName: Modules.PRICING,
|
||||
primaryKeys: ["id"],
|
||||
linkableKeys: LinkableKeys,
|
||||
schema,
|
||||
alias: [
|
||||
{
|
||||
name: "price_set",
|
||||
name: ["price_set", "price_sets"],
|
||||
args: {
|
||||
entity: "PriceSet",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "price_sets",
|
||||
},
|
||||
{
|
||||
name: "money_amount",
|
||||
name: ["money_amount", "money_amounts"],
|
||||
args: {
|
||||
methodSuffix: "MoneyAmounts",
|
||||
entity: "MoneyAmount",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "money_amounts",
|
||||
args: {
|
||||
methodSuffix: "MoneyAmounts",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "currency",
|
||||
name: ["currency", "currencies"],
|
||||
args: {
|
||||
methodSuffix: "Currencies",
|
||||
entity: "Currency",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "currencies",
|
||||
args: {
|
||||
methodSuffix: "Currencies",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "price_list",
|
||||
args: {
|
||||
methodSuffix: "PriceLists",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "price_lists",
|
||||
name: ["price_list", "price_lists"],
|
||||
args: {
|
||||
methodSuffix: "PriceLists",
|
||||
},
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
export const schema = `
|
||||
type PriceSet {
|
||||
id: String!
|
||||
money_amounts: [MoneyAmount]
|
||||
}
|
||||
|
||||
type MoneyAmount {
|
||||
id: String!
|
||||
currency_code: String
|
||||
currency: Currency
|
||||
amount: Float
|
||||
min_quantity: Float
|
||||
max_quantity: Float
|
||||
}
|
||||
`
|
||||
|
||||
export default schema
|
||||
Reference in New Issue
Block a user