im creating an api for school project using node, typescript and moongose and i have a question about this:.
I have an agregate that have, as agregate root, the Entity "Path".
This path have some simple fields like name or whatever and an array ( or list) of "PathNodes"
PathNodes is an Entity inside this agregate but dont have an id ( teacher said that, whatever it means)
Path nodes have 2 Nodes, one inicial node and one final node -Node is the Entity of another agregate and is already implemented.
My question is how should i implement both the domain class of Path and PathNode and also how to implement the Schema for this ( i know i could use the schema as "domain" classes but teacher dont want that).
What do you think of this? im also confused becouse i have a repository for path, but not for pathnodes as path is the agregate root. Inside the repository if i do PathSchema.create(path) will it create the path document along with the pathnodes? Or do i need to PathNodeSchema.create(pathNode) first?
as Path have a list of PathNodes, maybe PathNode should reference the Path it belongs to instead of Path referencing many PathNodes? If yes how should i implement it?
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?