digraph "Reservation System - Account Load" {
    // General graph settings
    graph [
        rankdir="TB",
        splines=ortho,
        nodesep=0.0,
        ranksep=1.0,
        fontname="Times New Roman",
        fontsize=14,
        label="Reservation System - Account Loading"
    ];

    // General node and edge settings
    node [
        shape=record,
        style=filled,
        fillcolor=lightyellow,
        fontname="Times New Roman",
        fontsize=10
    ];
    edge [
        fontname="Arial",
        fontsize=9
    ];

    // Packages
    subgraph cluster_reservationsystem {
        label="lodge.reservationsystem";
        style=filled;
        color=lightgrey;

        AccomodationManager [label="{AccomodationManager|+ AccomodationManager(home: String)\l+ newAccount(phone: String, addr: Address, email: EmailAddress): Account\l+ AddAccount(acct: Account)\l+ UpdateAccount(acct: Account)\l+ showAccountList()\l}"];
        DataRepository [label="{DataRepository (Singleton)|- directoryPath: String\l- instance: DataRepository\l|+ getInstance(): DataRepository\l+ setDataStoreRoot(path: String)\l+ getPath(): String\l+ LoadAccount(file: Path): Account\l}"];
    }

    subgraph cluster_datamodel {
        label="lodge.datamodel";
        style=filled;
        color=lightblue;

        Account [label="{Account|+ Account()\l+ Account(phone: String, mailAddr: Address, email: EmailAddress)\l+ Write(acct: Account)\l+ checkValid()\l}"];
        AccountList [label="{AccountList|+ add(acct: Account)\l+ save(acct: Account)\l+ find(account_number: String): Account\l+ showAccountList()\l}"];
        Address [label="{Address|+ Address(street: String, city: String, state: String, zip: String)\l}"];
        EmailAddress [label="{EmailAddress|+ EmailAddress(email: String)\l}"];
        DuplicateObjectException [label="<<exception>>\nDuplicateObjectException"];
        IllegalArgumentException [label="<<exception>>\nIllegalArgumentException"];
    }

    // Class Relationships

    AccomodationManager -> AccountList [arrowhead=diamond,label="manages 1"];
    AccomodationManager -> DataRepository [label="uses"];
    AccomodationManager -> Account [label="creates/updates"];
    
    AccountList -> Account [arrowhead=odiamond, label="0..*"];

    Account -> Address [label="has mailing"];
    Account -> EmailAddress [label="has"];
    Account -> DataRepository [label="uses for persistence"];
    
    DataRepository -> Account [label="loads"];

    // Exception Relationships
    edge [color=red, style=dashed, arrowhead=open];
    AccomodationManager -> Exception [label="<<throws>>"];
    AccountList -> DuplicateObjectException [label="<<throws>>"];
    Account -> IllegalArgumentException [label="<<throws>>"];
    Account -> IOException [label="<<throws>>"];
    DataRepository -> IOException [label="<<throws>>"];
}
