Skip to content

golden path conventions relies on interfaces #271

@NTCoding

Description

@NTCoding

The golden path should provide extraction and enforcement for free. Currently it relies on interfaces in addition to the attributes. But the eslint rule only enforces the attributes it doesn't enforce the interfaces, so the component will be found but metadata extraction could fail if the user forgets to add these interfaces.

The golden path needs to be simpler and safer than this. No attribute + 2 interfaces per component.

import { EventHandlerContainer } from '@living-architecture/riviere-extract-conventions'
import type { EventHandlerDef, IEventHandler } from '@living-architecture/riviere-extract-conventions'
import { Order } from '../../domain/Order'
import type { InventoryReserved } from '../../infrastructure/events'
import { ConfirmOrderAfterInventoryUseCase } from './use-cases/confirm-order-after-inventory-use-case'

@EventHandlerContainer
export class InventoryReservedHandler implements EventHandlerDef, IEventHandler<InventoryReserved> {
  readonly subscribedEvents = ['InventoryReserved']
  constructor(private readonly useCase: ConfirmOrderAfterInventoryUseCase) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions