modular-monolith-with-ddd icon indicating copy to clipboard operation
modular-monolith-with-ddd copied to clipboard

Check for MeetingGroupProposal status to be accepted before creating MeetingGroup

Open shamil-sadigov opened this issue 3 years ago • 1 comments

First of all, thank you for this masterpiece, I gained a lot of insights and knowledge from this repo!

Don't you think we should add a rule check to make sure that proposal has been accepted by the Administration module?

https://github.com/kgrzybek/modular-monolith-with-ddd/blob/37de06228f3f6f49de20a510d5349c784903b01f/src/Modules/Meetings/Domain/MeetingGroupProposals/MeetingGroupProposal.cs#L27-L30

I mean something like this

public MeetingGroup CreateMeetingGroup()
{
    CheckRule(new MeetingGroupProposalMustBeAcceptedRule(_status));
    return MeetingGroup.CreateBasedOnProposal(Id, _name, _description, _location, _proposalUserId);
}

PS: I may create a PR. But just wanted to be sure that I understand business logic correctly 😅

shamil-sadigov avatar Apr 28 '21 00:04 shamil-sadigov

@shamil-sadigov yes, you are right.

Even from the current implementation of the Application layer this kind of situation is not possible, it might be possible in the future so this rule should be checked.

kgrzybek avatar Jun 08 '21 20:06 kgrzybek