GroupsReducer

org.sigilaris.core.application.feature.group.module.GroupsReducer
See theGroupsReducer companion object

Groups state reducer (path-agnostic).

Implements transaction logic for group management:

  • CreateGroup
  • DisbandGroup
  • AddAccounts
  • RemoveAccounts
  • ReplaceCoordinator

Signature verification follows ADR-0012 protocol: All group management transactions require coordinator signature. Named account verification requires access to AccountsBP's nameKey table.

DEPENDENCY: This reducer depends on AccountsSchema for Named account key verification. The Needs type parameter includes the accounts tables.

Type parameters

F

the effect type

Attributes

Companion
object
Source
GroupsBlueprint.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def apply[T <: Tx](signedTx: Signed[T])(using requiresReads: Requires[signedTx.value.Reads, Entry["groups", GroupId, GroupData] *: Entry["groupAccounts", (GroupId, Account), Unit] *: GroupsNeeds], requiresWrites: Requires[signedTx.value.Writes, Entry["groups", GroupId, GroupData] *: Entry["groupAccounts", (GroupId, Account), Unit] *: GroupsNeeds], ownsTables: Tables[F, GroupsSchema], provider: TablesProvider[F, GroupsNeeds]): StoreF[F][(signedTx.value.Result, List[signedTx.value.Event])]

Apply a signed transaction to produce a result and events.

Apply a signed transaction to produce a result and events.

ADR-0012: All transactions must be wrapped in Signed[T] to ensure cryptographic signatures are present at compile time.

The reducer is polymorphic over the transaction type T, requiring only that T's read and write requirements are satisfied by this reducer's combined schema (Owns ++ Needs).

The reducer receives:

  • ownsTables: Tables[F, Owns] - tables owned by this module
  • provider: TablesProvider[F, Needs] - provider for external tables

Type parameters

T

the transaction type

Value parameters

ownsTables

the owned tables

provider

the provider for needed external tables

requiresReads

evidence that T's read requirements are in Owns ++ Needs

requiresWrites

evidence that T's write requirements are in Owns ++ Needs

signedTx

the signed transaction to apply (ADR-0012)

Attributes

Returns

a stateful computation returning the result and list of events

Source
GroupsBlueprint.scala