SaintAngeLs / distributed_minispace

Microservices-based social network built with .NET8 and ASP .NET Core Blazor WebAssembly, following distributed DDD principles. Scalable social media application CQRS distributed event-driven solution, utilizing SignalR, .NET ML. Features include choreographical Saga patterns, asynchronous messaging, outbox pattern and distributed event sourcing
https://itsharppro.com/case-study/distributed-astravent/
Apache License 2.0
13 stars 2 forks source link

Question with rootOrganizationId during creating new event #155

Closed an2508374 closed 4 months ago

an2508374 commented 4 months ago

There is a problem because GetOrganizerOrganizations query gives only IEnumerable where we have Id and Name for each organization, meanwhile AddEvent command in Events Service requires RootOrganizationId to validate organization by GetOrganization query. So there some update is needed, I think there are two options here:

  1. GetOrganizerOrganizations returns dtos with Id, Name and RootId.
  2. GetOrganization not requires RootId and checks all documents in organizations collection.

I think the first option would be better, but may be more complicated in implementation. Which way should we go?

eggwhat commented 4 months ago

I added RootId field to make queries faster, but maybe it just makes everything more complicated. For now i will quickly go with first option