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:
Carlos R. L. Rodrigues
2024-02-05 11:59:10 +00:00
committed by GitHub
parent 73fd92a1af
commit 884428a1b5
66 changed files with 1407 additions and 749 deletions
@@ -6,9 +6,11 @@ import {
DeleteDateColumn,
Entity,
Index,
OneToMany,
PrimaryColumn,
UpdateDateColumn,
} from "typeorm"
import { InventoryLevel } from "./inventory-level"
@Entity()
export class InventoryItem {
@@ -67,6 +69,12 @@ export class InventoryItem {
@Column({ type: "jsonb", nullable: true })
metadata: Record<string, unknown> | null
@OneToMany(
() => InventoryLevel,
(inventoryLevel) => inventoryLevel.inventory_item
)
inventory_levels!: InventoryLevel[]
@BeforeInsert()
private beforeInsert(): void {
this.id = generateEntityId(this.id, "iitem")
@@ -6,9 +6,12 @@ import {
DeleteDateColumn,
Entity,
Index,
JoinColumn,
ManyToOne,
PrimaryColumn,
UpdateDateColumn,
} from "typeorm"
import { InventoryItem } from "./inventory-item"
@Entity()
@Index(["inventory_item_id", "location_id"], { unique: true })
@@ -45,6 +48,10 @@ export class InventoryLevel {
@Column({ type: "jsonb", nullable: true })
metadata: Record<string, unknown> | null
@ManyToOne(() => InventoryItem)
@JoinColumn({ name: "inventory_item_id" })
inventory_item: InventoryItem
@BeforeInsert()
private beforeInsert(): void {
this.id = generateEntityId(this.id, "ilev")