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

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

Personal profile, agent relationships #31

Open fosterlynn opened 1 year ago

fosterlynn commented 1 year ago

We decided that for the first release we could just leave the "user" as the organization, and leave permissions for later. So there currently isn't the ability to have both a person agent and an organization agent, e.g. Laura and NY Textile Lab as separate agents. For this we will also need actual agent relationships, and can move the current organizational role into an agent relationship role.

pospi commented 1 year ago

Note that we may bump into an issue once planning-related features are implemented: the Holochain agent through which the application interacts is not yet bound to a Valueflows Agent and so has no presence as the "provider" or "receiver" of Intents, Commitments and EconomicEvents.

To enable this linkage, a component should call the following mutation:

export interface AgentAssociationResponse {
  associateMyAgent: boolean
}

export const ProfileAssociateMutation = gql`
mutation AssociateMyAgent($agentId: ID!) {
  associateMyAgent(agentId: $agentId)
}
`

Otherwise, components could be coded to simply provide dropdowns listing all the stored Agent records for populating these fields, and leave the operating Holochain agent unassigned. This will not present an issue unless components need to display data about record revisions- but if they do, resolvers for Revision.author will throw errors until the (Holochain) agent responsible specifies an association with associateMyAgent().