finnow/finnow-api/source/profile/model.d

34 lines
817 B
D

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;
this(string name) {
this.name = name;
}
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;
}