Adds relationships and loads secrets into the session details

This commit is contained in:
2025-05-28 15:42:49 -07:00
parent 73c7dac802
commit 65ac4852df
7 changed files with 269 additions and 6 deletions

View File

@@ -1,16 +1,18 @@
import type { RecordModel } from "pocketbase";
export type Id<T extends string> = string & { __type: T };
export type UserId = Id<"User">;
export type CampaignId = Id<"Campaign">;
export type DocumentId = Id<"Document">;
export type Campaign = {
export type Campaign = RecordModel & {
id: CampaignId;
name: string;
owner: UserId;
};
export type Document = {
export type Document = RecordModel & {
id: DocumentId;
campaign: Campaign;
data: {};
@@ -35,6 +37,12 @@ export type Secret = Document &
"secret",
{
text: string;
discoveredOn: ISO8601Date;
discoveredOn: ISO8601Date | null;
}
>;
export type Relationship = RecordModel & {
primary: DocumentId;
secondary: DocumentId[];
type: "plannedSecrets" | "discoveredIn";
};