Class Diagram

classDiagram
    class Permissions {
        +String name
    }
    class Schema {
        +String name
        +HashSet<Field> fields
        +SchemaFee schema_fee
    }
    class FieldFee {
        +float multiplier
        +float base_fee
    }
    class SchemaFee {
        +float multiplier
        +float base_fee
    }
    class Field {
        +String name
        +String atomref_uuid
        +Permissions permissions
        +List<FieldMapper> field_mappers
        +FieldFee field_fee
    }
    class FieldMapper {
        +String source_schema
        +String source_field_name
    }
    class AtomRef {
        +String uuid
        +String atom_uuid
    }
    class Atom {
        +String uuid
        +String content
        +String previous_atom_uuid
        +String source_schema
        +String source_public_key
        +String created_at
    }
    class FoldDb {
        -HashSet<AtomRef> atom_refs
        -HashSet<Schema> schemas
        -HashSet<Atom> atoms

        +LoadSchema(schema_name: String)
        +EnableSchema(schema_name: String)
        +DisableSchema(schema_name: String)
        
        +Query(query: String)
        +Mutate(mutation: String)
    }
    class FoldNode {
        -FoldDb fold_db
        -String public_key
        -String private_key
        -String node_id
        -HashSet<App> apps
        -HashSet<TrustedNode> trusted_nodes

        +AddTrustedNode(trusted_node: TrustedNode)
        +RemoveTrustedNode(trusted_node: TrustedNode)
        +GetTrustDistance(node_id: String)
        +GetNodeInfo()
        +LoadApp(app_id: String)
    }
    class App {
        +String app_id
        +String app_name
        +String app_description
    }
    class TrustedNode {
        -String node_id
        -String public_key
        -String private_key
        -String trust_distance
    }

    FoldNode "1" -- "0..*" TrustedNode
    FoldNode "1" -- "1" FoldDb
    FoldDb "1" -- "0..*" App

    FieldFee "1" -- "1" Field
    SchemaFee "1" -- "1" Schema

    Field "1" -- "1" Permissions
    Schema "1" -- "0..*" Field
    Field "1" -- "1" AtomRef
    Field "1" -- "0..*" FieldMapper
    AtomRef "1" -- "1" Atom
    FoldDb "1" -- "0..*" AtomRef
    FoldDb "1" -- "0..*" Schema
    FoldDb "1" -- "0..*" Atom