module profile.model;

import profile.data;

/**
 * A profile is a complete set of Finnow financial data, all stored in one
 * single database file. The profile's name is used to lookup the database
 * partition for its data. A user may own multiple profiles.
 */
class Profile {
    string name;
    string username;

    this(string name, string username) {
        this.name = name;
        this.username = username;
    }

    override int opCmp(Object other) const {
        if (Profile p = cast(Profile) other) {
            return this.name < p.name;
        }
        return 1;
    }
}

/**
 * A string-based key-value-pair used to store an arbitrary piece of
 * information in a profile's database, intended for settings and other one-off
 * data that a normal table would be overkill for.
 */
struct ProfileProperty {
    immutable string property;
    immutable string value;
}
