-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.cds
114 lines (102 loc) · 2.53 KB
/
schema.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
namespace inventory;
using
{
Country,
Currency,
Language,
User,
cuid,
extensible,
managed,
temporal,
sap.common.CodeList
}
from '@sap/cds/common';
annotate Aval_Status
{
name;
descr;
}
entity Categories
{
key name : String(100);
type : String(100) not null;
category : String(100) not null;
generic_items : Composition of many Generic_Items on generic_items.category = $self;
cable_Parent : Association to many Cable_Parent on cable_Parent.categories = $self;
mixer_Parent : Association to many Mixer_Parent on mixer_Parent.categories = $self;
lamp_Parent : Association to many Lamp_Parent on lamp_Parent.categories = $self;
}
entity Cables
{
key ID : UUID
@Core.Computed;
shielding : String(100);
msrp : Decimal(5,2) not null;
aval_Status : Association to one Aval_Status;
cable_Parent : Association to one Cable_Parent;
}
entity Lamps
{
key ID : UUID
@Core.Computed;
lamp_Parent : Association to one Lamp_Parent;
operating_hours : Integer;
serial_number : String(100);
model_name : String(100) not null;
manufacturer_name : String(100) not null;
faults : String(100);
msrp : String(100);
description : String(100);
aval_Status : Association to one Aval_Status;
}
entity Mixers
{
key ID : UUID
@Core.Computed;
operating_hours : Integer;
serial_number : String(100);
model_name : String(100) not null;
manufacturer_name : String(100) not null;
faults : String(100);
msrp : Decimal(7,2);
aval_Status : Association to one Aval_Status;
mixer_Parent : Association to one Mixer_Parent;
}
entity Generic_Items
{
key ID : UUID
@Core.Computed;
name : String(100) not null;
description : String(1000);
aval_Status : Association to one Aval_Status;
category : Association to one Categories;
}
entity Aval_Status : CodeList
{
key status : String enum
{
Available = 'A';
In_Use = 'U';
Broken = 'B';
} default 'A';
criticality : Integer;
}
entity Cable_Parent
{
key name : String;
categories : Association to one Categories;
cables : Composition of many Cables on cables.cable_Parent = $self;
}
entity Mixer_Parent
{
key name : String;
mixers : Composition of many Mixers on mixers.mixer_Parent = $self;
categories : Association to one Categories;
}
entity Lamp_Parent
{
key name : String;
lamps : Composition of many Lamps on lamps.lamp_Parent = $self;
categories : Association to one Categories;
}