You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.6 KiB
43 lines
1.6 KiB
import {Condition, ConditionJTD} from "./Condition.js";
|
|
import {GuidedEmpathy, GuidedEmpathyJTD} from "./GuidedEmpathy.js";
|
|
import {Suicidality, SuicidalityJTD} from "./Suicidality.js";
|
|
import {schema} from "../schemata/SchemaData.js";
|
|
import {SleepRecord, SleepRecordListJTD} from "./SleepRecord.js";
|
|
|
|
export interface Entry {
|
|
readonly startedAt: Date
|
|
readonly finishedAt: Date
|
|
readonly condition?: Condition
|
|
readonly summary?: string
|
|
readonly journalEntry?: string
|
|
readonly guidedEmpathy?: readonly GuidedEmpathy[]
|
|
readonly sleepRecords?: readonly SleepRecord[]
|
|
// readonly needs?: Needs
|
|
// readonly music?: readonly string[]
|
|
// readonly rpg?: RPGStats
|
|
// readonly personas?: Personas
|
|
// readonly activities?: readonly Activity[]
|
|
readonly suicidality?: Suicidality
|
|
// readonly recoveries?: readonly Recovery[]
|
|
}
|
|
export type EntryJTD = typeof EntryJTD
|
|
export const EntryJTD = schema({
|
|
schema: {
|
|
properties: {
|
|
startedAt: { type: "timestamp" },
|
|
finishedAt: { type: "timestamp" },
|
|
},
|
|
optionalProperties: {
|
|
condition: ConditionJTD.reference,
|
|
summary: { type: "string" },
|
|
journalEntry: { type: "string" },
|
|
guidedEmpathy: { elements: GuidedEmpathyJTD.reference },
|
|
suicidality: SuicidalityJTD.reference,
|
|
sleepRecords: SleepRecordListJTD.reference,
|
|
}
|
|
},
|
|
typeHint: null as Entry|null,
|
|
key: "entry",
|
|
references: [ConditionJTD, GuidedEmpathyJTD, SuicidalityJTD, SleepRecordListJTD, ...SleepRecordListJTD.requiredReferences, ...GuidedEmpathyJTD.requiredReferences]
|
|
})
|
|
|
|
|