dckntm / focus-backend

ASP.NET server code for https://github.com/dckntm/focus project
Apache License 2.0
2 stars 0 forks source link

get rid of misleading and inconsistent approaches in CQRS pipeline #133

Open katunilya opened 4 years ago

katunilya commented 4 years ago

Requested Changes

Currently we use command and queries in most cases as wrappers for some dto objects, which seems to be odd.

I believe that we should start distinguishing dtos for input and dtos for output. For input we will use pure commands, queries and events and for output old dtos.

Implementation Details

Unwrap all command, queries and events - as straightforward as it sounds

Additional Info

Provide any additional context info that can be useful during the development

katunilya commented 4 years ago

identity service

change use role command

Seems to be redundant - might be better to replace with several more specific and self describing commands like:

It will be worth thinking of necessity of this commands and their overall role in the process

create new organization

it might seem illogical to duplicate this entity but I think that we might just inherit it from Organization type for short and still build new entity of organization class to verify passed data is right.

seems to be a good point for issue - data validation and data flow design and structure

create new user

Again we can just inherit it from dto for easier setup or fully isolate in case dto will be different.

Good idea is to separate our input and our up data models

login user

Make setters public and get rid of additions entity in api layer

katunilya commented 4 years ago

constructor service

construct reports

good one, untouched

create report template

put some required fields to request and omit id to reduce request size a little

get report template

simplify for direct json binding