On which project layer with DDD concept, should I create a function or routine for the reorganization of portions of a receivable?

Asked

Viewed 32 times

1

I have an Asp.Net Core MVC project in which I am developing an Accounts Receivable. The whole project uses the DDD concept.

I need to create a function to reorder the sequence of parcel records in the database, when a certain parcel is deleted in the database. Should I create, in the infrastructure layer, a function (eg bool reorder Patches(int id)) similar to the ones that already exist in CRUD (eg: Ienumerable Getall(), Getbyid()) or should create this in the Domain layer (eg: Commandhandler)?

Thank you :)

I’m following Eduardo Pires' model: link

  • Man, I believe that creating a new command is the right one, but it depends a lot, in the reorganization roll rules of business? Sometimes it is not worth creating a new command if it is just to call an update. (Thinking that delete you already have a command)

  • Well thought @ Marccus Zavadzki! By making the exclusion, I can do the reorganization from there, because I will already be in Command anyway! If I need to create some function to perform this routine later, then yes, it would be feasible to create a command :)

  • This, I understand that there is never a certain, everything depends on the context, as Eduardo Pires himself says

  • I fully agree! As the system grows, several needs arise and doubts increase. It was really nice to exchange that idea with you. Thank you :)

  • Comments as an answer that I will define as a solution to the question :)

  • I say the same! It’s always good to discuss structures... I answered here!

Show 1 more comment

1 answer

1


Depends!

If business rules happen within the reorganization of installments, it is more certain to create a command for this, but, thinking that it is only a query to be executed, as you are already in a command in delete, sometimes it is not worth creating another just for an update...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.