Slide 26
Slide 26 text
Future executeUseCase(Transaction tx, PickingId pickingId) async {
// 1. リポジトリから対象の集約を取得
final picking = await repository.get(tx, pickingId);
// 2. ドメインロジックの実行(状態遷移)
final updated = picking.pick();
// 3. イベント、状態の保存
await repository.store(tx, updated);
// 4. 発生したドメインイベントを順次処理
for (final evt in updated.occurredEvents) {
await eventHandler.execute(evt, transaction: tx);
}
}
Order
への反映: (Phase 1:
同期実行)
ALL RIGHTS RESERVED BY 10X, INC. 26