ordercloud-api / ordercloud-seed

CLI and library to Import and export serialized representations of full marketplaces
MIT License
9 stars 9 forks source link

Clarify the data in OCResourceDirectory.ts #25

Open oliverheywood451 opened 1 year ago

oliverheywood451 commented 1 year ago

To understand the motivation here, imagine a UI where a marketplace is built by dragging and dropping OC resources and connecting them up visually in a diagram. Maybe assignments are arrows. This library could help support such a tool by providing insight into what what types of resources are available and how they are allowed to connect with each other.

This issue is really about improving the declarative definition of the relationships between OC resources in OCResourceDirectory.ts. There are two types of relationships - parent/child and foreign key.

oliverheywood451 commented 1 year ago

About foreign keys - a lot of the custom validation functions boil down to what company (buyer, supplier, marketplace) a user belongs to. Look at impersonation config as an example.

oliverheywood451 commented 1 year ago

Should foreign key relationships be bi-directional as well? In other words should a resource have a list of resources that can point to its ID?