|
| 1 | +-- WidgetDemo: self-contained domain model (no external dependencies) |
| 2 | +-- Provides entities and enumerations for the widget showcase page. |
| 3 | + |
| 4 | +CREATE MODULE WidgetDemo; |
| 5 | +CREATE MODULE ROLE WidgetDemo.User; |
| 6 | + |
| 7 | +CREATE ENUMERATION WidgetDemo.ENUM_Priority ( |
| 8 | + LOW 'Low', |
| 9 | + MEDIUM 'Medium', |
| 10 | + HIGH 'High', |
| 11 | + CRITICAL 'Critical' |
| 12 | +); |
| 13 | + |
| 14 | +CREATE ENUMERATION WidgetDemo.ENUM_Status ( |
| 15 | + DRAFT 'Draft', |
| 16 | + ACTIVE 'Active', |
| 17 | + COMPLETED 'Completed', |
| 18 | + ARCHIVED 'Archived' |
| 19 | +); |
| 20 | + |
| 21 | +CREATE ENUMERATION WidgetDemo.ENUM_Category ( |
| 22 | + GENERAL 'General', |
| 23 | + INPUT 'Input', |
| 24 | + DISPLAY 'Display', |
| 25 | + STRUCTURE 'Structure', |
| 26 | + DATA_DISPLAY 'Data Display' |
| 27 | +); |
| 28 | + |
| 29 | +CREATE PERSISTENT ENTITY WidgetDemo.DemoItem ( |
| 30 | + Title: String(unlimited) NOT NULL, |
| 31 | + Description: String(unlimited), |
| 32 | + Code: String(unlimited), |
| 33 | + Category: Enumeration(WidgetDemo.ENUM_Category) DEFAULT WidgetDemo.ENUM_Category.GENERAL, |
| 34 | + Priority: Enumeration(WidgetDemo.ENUM_Priority) DEFAULT WidgetDemo.ENUM_Priority.MEDIUM, |
| 35 | + ItemStatus: Enumeration(WidgetDemo.ENUM_Status) DEFAULT WidgetDemo.ENUM_Status.DRAFT, |
| 36 | + IsActive: Boolean DEFAULT true, |
| 37 | + Score: Integer DEFAULT 0, |
| 38 | + Amount: Decimal DEFAULT 0, |
| 39 | + DateCreated: DateTime, |
| 40 | + DueDate: DateTime, |
| 41 | + Progress: Decimal DEFAULT 0, |
| 42 | + Rating: Integer DEFAULT 3, |
| 43 | + Notes: String(unlimited), |
| 44 | + ImageUrl: String(unlimited) |
| 45 | +); |
| 46 | + |
| 47 | +CREATE NON-PERSISTENT ENTITY WidgetDemo.Helper ( |
| 48 | + Attribute: Enumeration(WidgetDemo.ENUM_Category) DEFAULT WidgetDemo.ENUM_Category.GENERAL |
| 49 | +); |
| 50 | + |
| 51 | +CREATE ASSOCIATION WidgetDemo.Helper_DemoItem ( |
| 52 | + FROM WidgetDemo.Helper TO WidgetDemo.DemoItem, |
| 53 | + Type: ReferenceSet |
| 54 | +); |
| 55 | + |
| 56 | +GRANT WidgetDemo.User ON WidgetDemo.DemoItem (CREATE, DELETE, READ *, WRITE *); |
0 commit comments