Add factory creation ports and owner initialization contracts
This commit is contained in:
Vendored
+3
-3
@@ -98,8 +98,8 @@ export async function queryWorkspaceFixture(options: { live?: boolean } = {}) {
|
||||
);
|
||||
const implementation = (atom: string) => `conform ${atom} as TaskFacts id "${atom}-facts" {
|
||||
private state Title${atom} id "${atom}:title" on ${atom} : string policy crdt(string) default "Untitled";
|
||||
private state Done${atom} id "${atom}:done" on ${atom} : bool policy optimistic-register default false;
|
||||
private state Rank${atom} id "${atom}:rank" on ${atom} : int64 policy optimistic-register default 0;
|
||||
private state Done${atom} id "${atom}:done" on ${atom} : bool policy register default false;
|
||||
private state Rank${atom} id "${atom}:rank" on ${atom} : int64 policy register default 0;
|
||||
private edge Assignee${atom} id "${atom}:assignee" {
|
||||
atom ${atom} projection assignee id "${atom}:assignee:forward" optional-one;
|
||||
interface PersonFacts projection tasks id "${atom}:assignee:inverse" many;
|
||||
@@ -114,7 +114,7 @@ export async function queryWorkspaceFixture(options: { live?: boolean } = {}) {
|
||||
import interface PersonFacts; import interface TaskFacts; import interface Collection; import package Queries;
|
||||
atom Task id "Task"; atom Reminder id "Reminder"; atom Person id "Person"; atom Tasks id "Tasks";
|
||||
conform Person as PersonFacts id "person-facts" {
|
||||
private state Name id "person:name" on Person : string policy optimistic-register default "Nobody";
|
||||
private state Name id "person:name" on Person : string policy register default "Nobody";
|
||||
bind name to state Name;
|
||||
}
|
||||
${implementation("Task")} ${implementation("Reminder")}
|
||||
|
||||
Reference in New Issue
Block a user