-
Notifications
You must be signed in to change notification settings - Fork 0
/
architecture.rb
106 lines (90 loc) · 2.89 KB
/
architecture.rb
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
Domgen.repository(:Tide) do |repository|
repository.enable_facet(:jpa)
repository.enable_facet(:ejb)
repository.enable_facet(:jaxb)
repository.enable_facet(:jackson)
#repository.enable_facet(:jws)
repository.enable_facet(:imit)
repository.ee.base_package = 'au.com.stocksoftware.tide'
repository.ejb.base_package = 'au.com.stocksoftware.tide'
repository.jpa.base_package = 'au.com.stocksoftware.tide'
repository.gwt.package = 'au.com.stocksoftware.tide'
repository.data_module(:Core) do |data_module|
data_module.entity(:Client) do |t|
t.integer(:ID, :primary_key => true)
t.string(:Name, 255)
end
data_module.enumeration(:UserType, :integer, :values => {"STAFF" => 0 ,"ADMIN" => 1})
data_module.entity(:User) do |t|
t.integer(:ID, :primary_key => true)
t.string(:Login, 255)
t.string(:Name, 255)
t.string(:Email, 255)
t.string(:Password, 255)
t.enumeration(:UserType, :UserType)
t.unique_constraint([:Login])
t.unique_constraint([:Name])
end
data_module.struct(:UserDTO) do |s|
s.integer(:ID)
s.text(:Login)
s.text(:Name)
s.text(:Email)
s.enumeration(:UserType, :UserType)
end
data_module.entity(:Project) do |t|
t.integer(:ID, :primary_key => true)
t.string(:Name, 255)
t.unique_constraint([:Name])
end
data_module.struct(:ProjectDTO) do |s|
s.integer(:ID)
s.text(:Name)
end
data_module.service(:UserService) do |s|
s.method(:GetUsers) do |m|
m.returns(:struct, :referenced_struct => :UserDTO, :collection_type => :sequence)
end
s.method(:AddUser) do |m|
m.string(:Login, 255)
m.string(:Name, 255)
m.string(:Password, 255)
m.string(:Email, 255)
m.enumeration(:UserType, :UserType)
m.returns(:struct, :referenced_struct => :UserDTO)
end
s.method(:DeleteUser) do |m|
m.reference(:User)
end
s.method(:UpdateUser) do |m|
m.reference(:User)
m.string(:Login, 255)
m.string(:Name, 255)
m.string(:Email, 255)
m.enumeration(:UserType, :UserType)
m.returns(:struct, :referenced_struct => :UserDTO)
end
s.method(:SetPassword) do |m|
m.reference(:User)
m.string(:Password, 255)
end
end
data_module.service(:ProjectService) do |s|
s.method(:GetProjects) do |m|
m.returns(:struct, :referenced_struct => :ProjectDTO, :collection_type => :sequence)
end
s.method(:AddProject) do |m|
m.string(:Name, 255)
m.returns(:struct, :referenced_struct => :ProjectDTO)
end
s.method(:DeleteProject) do |m|
m.reference(:Project)
end
s.method(:UpdateProject) do |m|
m.reference(:Project)
m.string(:Name, 255)
m.returns(:struct, :referenced_struct => :ProjectDTO)
end
end
end
end