RIDDL Specification For improving.app
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ActiveOrganizationHandler: Handler

ItemValue
BrieflyBrief description missing.
Definition PathImprovingApp.OrganizationContext.Organization.EstablishedOrganization.ActiveOrganizationHandler
View Source Linkorganization.riddl(237:21)

OnMessageClause command ImprovingApp.OrganizationContext.EstablishOrganization

Statements

\nerror "Organization already established"\n

OnMessageClause command ImprovingApp.OrganizationContext.EditOrganizationInfo

Statements

\nset field EstablishedOrganizationState.info to "OrganizationContext.Info"set field EstablishedOrganizationState.orgMeta to "OrganizationContext.MetaInfo"send event OrganizationInfoEdited to outlet OrganizationEventsSource.Source\n

OnMessageClause command ImprovingApp.OrganizationContext.UpdateParent

Statements

{
  error "EditingMember is not authorized to make this change."
} else {
  if "newParent exists below organizationId (child, grandchild, etc.) in the organizational hierarchy" then
{
  error "New Parent cannot be a generational child of the organization being modified"
} else {
  if "newParent exists outside the bounds of the root organization that contains organizationId" then
{
  error "Organization cannot leave the bounds of the root organization that it belongs to"
} else {
  "set Active Organization's parent to the organizationId provided in UpdateParent"
  "set MetaInfo to capture change data"
  "yield event ParentUpdated"
}

}

}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.AddMembersToOrganization_

#### Statements
```\nif "Member does not meet qualifictions to join organization" then
{
  "Place rejected member in dead letter queue and process remaining members"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "organizationId is a private organization and updatingMember is not an admin for organizationId" then
{
  error "Only Admins for organizationId can admit new members"
  scall ${func.format}
}
if "Member in newMembers list is in state suspended" then
{
  "place suspended member in dead letter queue and process remaining members"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "editingMember is not Authorized" then
{
  error "EditingMember is not authorized to make this change."
} else {
  "Merge new members into the member list. Duplicates not allowed."
  "set MetaInfo to capture change data"
  "emit MembersAddedToOrganization event"
}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.RemoveMembersFromOrganization_

#### Statements
```\nif "editingMember is not Authorized" then
{
  error "EditingMember is not authorized to make this change."
  scall ${func.format}
} else {
  "membersToRemove are purged from memberList"
  "set MetaInfo to capture change data"
  "yield MembersRemovedFromOrganization()"
  //TODO

}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.AddOwnersToOrganization_

#### Statements
```\nif "Member in ownersToAdd is not in memberList of organizationId" then
{
  "Place non-member owner in dead letter queue and finish processing remaining member owners"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "Member in ownersToAdd is in state Suspended" then
{
  "Place suspended owner in dead letter queue and finish processing remaining member owners"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
//Only members of type ________ can be owners of an organization???
if "Member in ownersToAdd is a type that is not allowed to be an owner" then
{
  "Place non-compliant owner in dead letter queue and finish processing remaining member owners"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "editingMember is not Authorized" then
{
  error "EditingMember is not authorized to make this change."
} else {
  "Merge new owners into the owner list. Duplicates not allowed."
  "set MetaInfo to capture change data"
  "emit OwnersAddedToOrganization event"
}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.RemoveOwnersFromOrganization_

#### Statements
```\nif "editingMember is not Authorized" then
{
  error "EditingMember is not authorized to make this change."
} else {
  "ownersToRemove are purged from memberList"
  "set MetaInfo to capture change data"
  "yield OwnersRemovedFromOrganization()"
  //TODO

}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.UpdateOrganizationContacts_

#### Statements
```\nif "Member in contactsToAdd is not in memberList of organizationId" then
{
  "Place non-member contact in dead letter queue and finish processing remaining member contacts"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "Member in contactsToAdd is in state Suspended" then
{
  "Place suspended contact in dead letter queue and finish processing remaining member owners"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
//Only members of type ________ can be contacts for an organization???
if "Member in contactsToAdd is a type that is not allowed to be a contact" then
{
  "Place non-compliant contact in dead letter queue and finish processing remaining member contacts"
  "Consider how to notify of partial success"
  //TODO: discuss how this might work

  scall ${func.format}
}
if "editingMember is not Authorized" then
{
  error "EditingMember is not authorized to make this change."
} else {
  "Merge new contacts into the contacts list. Duplicates not allowed."
  "set MetaInfo to capture change data"
  "emit ContactsAddedToOrganization event"
}
```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.SuspendOrganization_

#### Statements
```\nset field EstablishedOrganizationState.orgMeta to "OrganizationContext.MetaInfo"send event OrganizationSuspended to outlet OrganizationEventsSource.Sourcebecome entity ImprovingApp.OrganizationContext.Organization to handler SuspendedOrganizationHandler```\n
### _OnMessageClause command ImprovingApp.OrganizationContext.TerminateOrganization_

#### Statements
```\nset field EstablishedOrganizationState.orgMeta to "OrganizationContext.MetaInfo"morph entity ImprovingApp.OrganizationContext.Organization to state ImprovingApp.OrganizationContext.Organization.TerminatedOrganization with record TerminatedOrganizationState//(lastMeta = @EstablishedOrganizationState.orgMeta)
```\n
### _OnMessageClause query GetOrganizationInfo_

#### Statements
```\nreply result OrganizationInfo```\n
### _OnMessageClause query GetOrganizationParent_

#### Statements
```\nreply result OrganizationParent```\n
### _OnMessageClause query GetOrganizationMembers_

#### Statements
```\nreply result OrganizationMembers```\n
### _OnMessageClause query GetOrganizationOwners_

#### Statements
```\nreply result OrganizationOwners```\n
### _OnMessageClause query GetOrganizationContacts_

#### Statements
```\nreply result OrganizationContacts```\n
### _OnMessageClause query GetOrganizationMeta_

#### Statements
```\nreply result OrganizationMeta```\n
### _OnMessageClause query GetOrganizationState_

#### Statements
```\nreply result OrganizationState```\n
### _On Other_

#### Statements
```\nerror "No other commands allowed in Active state"```\n
## *Used By*
* [OnMessageClause 'On command ActivateOrganization'](/improvingapp/organizationcontext/organization/establishedorganization/suspendedorganizationhandler#on-command-activateorganization) in [Handler 'SuspendedOrganizationHandler'](/improvingapp/organizationcontext/organization/establishedorganization/suspendedorganizationhandler)

## *Uses Nothing*