@startuml



class Identity << (D,orchid) >> {
    currency: str (FK)
    uid: str
    pubkey: str (PK)
    blockstamp: BlockUID
    timestamp: int
    signature: str
    member: bool
    membership_buid: BlockUID
    membership_timestamp: int
}

class Certification << (D,orchid) >> {
    currency: str (FK)
    certifier: str
    certified: str
    blockstamp: BlockUID
    timestamp: int
    signature: str
}

class Transaction  << (D,orchid) >> {
    currency: str (FK)
    blockstamp: str
    locktime: int
    issuer: str
    recipient: str
    amount: int
    comment: str
    sha_hash: str (PK)
}

class Community  << (D,orchid) >> {
    profile: str (FK)
    pubkey: str (FK)
    currency: str (PK)
    c: float
    dt: int
    ud0: int
    sig_period: int
    sig_stock: int
    sig_window: int
    sig_validity: int
    sig_qty: int
    xpercent: float
    ms_validity: int
    step_max: int
    median_time_blocks: int
    avg_gen_time: int
    dt_diff_eval: int
    blocks_rot: int
    percent_rot: float
}

class Blockchain  << (D,orchid) >> {
    currency: str (PK)
    current_buid: BlockUID
    nb_members: int
    current_mass: int
    median_time: int
    last_ud: int
    last_ud_base: int
    previous_mass: int
}

class Node  << (D,orchid) >> {
    currency: str (FK)
    endpoints: str
    uid: str
    pubkey: str (PK)
    current_buid: BlockUID
    previous_buid: BlockUID
    state: int
    software: str
    version: str
    merkle_nodes: dict
}

class Key  << (D,orchid) >> {
    pubkey: str (PK)
    salt: str
}

class UserParameters  << (D,orchid) >> {
    profile: str (PK)
    lang: str
    ref: 0
    expert_mode: bool,
    digits_after_comma: int
    maximized: bool
    notifications: bool
    enable_proxy: bool
    proxy_type: int
    proxy_address: str
    proxy_port: 8080: int
    international_system_of_units: bool
    auto_refresh: bool
    forgetfulness: bool
}

class UserParametersRepo << (R,orange) >> {
    Create()
    Update()
    Save()
    Drop()
}


class KeyRepo << (R,orange) >>  {
    Create()
    Update()
    Save()
    Drop()
}


class NodeRepo << (R,orange) >>   {
    Create()
    Update()
    Save()
    Drop()
}

class BlockchainRepo << (R,orange) >>  {
    Create()
    Update()
    Save()
    Drop()
}
class CommunityRepo << (R,orange) >>  {
    Commit()
    Update()
    Save()
    Drop()
}
class TransactionRepo << (R,orange) >>  {
    Commit()
    Update()
    Save()
    Drop()
}
class CertificationRepo  << (R,orange) >> {
    Commit()
    Update()
    Save()
    Drop()
}
class IdentitiesRepo  << (R,orange) >>  {
    Commit()
    Update()
    Save()
    Drop()
}

IdentitiesRepo "1" --* "*" Identity

CertificationRepo "1" --* "*" Certification

TransactionRepo "1" --* "*" Transaction

CommunityRepo "1" --* "*" Community

BlockchainRepo "1" --* "*" Blockchain

NodeRepo "1" --* "*" Node

KeyRepo "1" --* "*" Key

UserParametersRepo "1" --* "*" UserParameters


@enduml