2023-08-22 14:05:26 +00:00
|
|
|
module data.list;
|
|
|
|
|
|
|
|
public import data.model : NoteList;
|
|
|
|
|
|
|
|
import std.typecons : Nullable;
|
|
|
|
|
|
|
|
interface NoteListDataSource {
|
|
|
|
NoteList[] getLists(string username);
|
|
|
|
Nullable!NoteList getList(string username, ulong id);
|
|
|
|
NoteList createNoteList(string username, string name, string description = null);
|
|
|
|
void deleteNoteList(string username, ulong id);
|
2023-11-16 20:29:36 +00:00
|
|
|
void deleteAllNotes(string username, ulong id);
|
2023-08-22 14:05:26 +00:00
|
|
|
NoteList updateNoteList(string username, ulong id, NoteList newData);
|
2023-08-24 19:37:25 +00:00
|
|
|
ulong countLists(string username);
|
2023-08-22 14:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static NoteListDataSource noteListDataSource;
|
|
|
|
static this() {
|
|
|
|
import data.impl.list;
|
|
|
|
noteListDataSource = new SqliteNoteListDataSource();
|
|
|
|
}
|