Skip to content

Commit 49697a8

Browse files
bryanjnelsonCarsonF
authored andcommitted
Create Budget and BudgetRecord schemas
1 parent 3e98048 commit 49697a8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

dbschema/budget.esdl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module default {
2+
type Budget extending Project::Child {
3+
required status: Budget::Status {
4+
default := Budget::Status.Pending;
5+
};
6+
7+
universalTemplate: File;
8+
9+
records := .<budget[is Budget::Record];
10+
}
11+
}
12+
13+
module Budget {
14+
type Record extending Project::Child {
15+
constraint exclusive on ((.budget, .fiscalYear, .organization));
16+
17+
required fiscalYear: int16 {
18+
readonly := true;
19+
};
20+
21+
amount: float32;
22+
23+
required budget: default::Budget {
24+
readonly := true;
25+
on target delete delete source;
26+
};
27+
28+
required organization: default::Organization {
29+
readonly := true;
30+
on target delete delete source;
31+
};
32+
}
33+
34+
scalar type Status extending enum<
35+
Pending,
36+
Current,
37+
Superceded,
38+
Rejected
39+
>;
40+
}

0 commit comments

Comments
 (0)