Carbon-Farm-Network / app-carbon-farm-network

GNU Affero General Public License v3.0
1 stars 0 forks source link

Delete validation on all deletable data #53

Open fosterlynn opened 1 year ago

fosterlynn commented 1 year ago

Add delete option on these. I think the methods are in hREA. I expect, but don't know, that there isn't validation. If there is, great!

Suggest in addition to the mutation, a method deletable which is a boolean. The delete mutation can then check if it can delete with that method. Also, it can be called from the UI, so the UI can display the delete button only if the object is in fact deletable.

Validation definitions are here. But I'm including the specifics below.

Agent:

deletable: only if no flows or processes reference the agent as provider or receiver, nothing references the agent as inScopeOf,the agent is not proposedTo and no economic resources reference the agent as the primaryAccountable; if only agent relationships reference the agent, then cascade the delete to the relationships or require the agent relationships to be deleted first

ResourceSpecification:

deletable: only if there are no related recipe resources, intents, economic resources, economic events, commitments, claims

Proposal:

deletable: always true

Deletion should cascade to the ProposedIntents

LeosPrograms commented 1 year ago

deletes possible, but does not check if deletable