2024-08-01 17:01:50 +00:00
|
|
|
module profile.data;
|
|
|
|
|
|
|
|
import handy_httpd.components.optional;
|
|
|
|
import profile.model;
|
|
|
|
|
2024-09-19 19:12:23 +00:00
|
|
|
/// Repository for interacting with the set of profiles belonging to a user.
|
2024-08-01 17:01:50 +00:00
|
|
|
interface ProfileRepository {
|
|
|
|
Optional!Profile findByName(string name);
|
|
|
|
Profile createProfile(string name);
|
|
|
|
Profile[] findAll();
|
|
|
|
void deleteByName(string name);
|
|
|
|
ProfileDataSource getDataSource(in Profile profile);
|
|
|
|
}
|
|
|
|
|
2024-09-11 20:15:53 +00:00
|
|
|
/// Repository for accessing the properties of a profile.
|
2024-08-01 17:01:50 +00:00
|
|
|
interface PropertiesRepository {
|
|
|
|
Optional!string findProperty(string propertyName);
|
|
|
|
void setProperty(string name, string value);
|
|
|
|
void deleteProperty(string name);
|
|
|
|
ProfileProperty[] findAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A data source for all data contained within a profile. This serves as the
|
|
|
|
* gateway for all data access operations for a profile.
|
|
|
|
*/
|
|
|
|
interface ProfileDataSource {
|
|
|
|
import account.data : AccountRepository;
|
|
|
|
|
|
|
|
PropertiesRepository getPropertiesRepository();
|
|
|
|
AccountRepository getAccountRepository();
|
|
|
|
}
|