|
| 1 | +{ |
| 2 | + "metadata.root": { |
| 3 | + "package": "acme::studio", |
| 4 | + "children": [ |
| 5 | + { |
| 6 | + "object.entity": { |
| 7 | + "name": "Member", |
| 8 | + "children": [ |
| 9 | + { |
| 10 | + "source.rdb": { |
| 11 | + "@table": "members" |
| 12 | + } |
| 13 | + }, |
| 14 | + { |
| 15 | + "field.long": { |
| 16 | + "name": "id" |
| 17 | + } |
| 18 | + }, |
| 19 | + { |
| 20 | + "field.string": { |
| 21 | + "name": "firstName", |
| 22 | + "@required": true |
| 23 | + } |
| 24 | + }, |
| 25 | + { |
| 26 | + "field.decimal": { |
| 27 | + "name": "weeklyCapacityHours", |
| 28 | + "@required": true, |
| 29 | + "@precision": 6, |
| 30 | + "@scale": 2 |
| 31 | + } |
| 32 | + }, |
| 33 | + { |
| 34 | + "identity.primary": { |
| 35 | + "name": "id", |
| 36 | + "@fields": [ |
| 37 | + "id" |
| 38 | + ] |
| 39 | + } |
| 40 | + } |
| 41 | + ] |
| 42 | + } |
| 43 | + }, |
| 44 | + { |
| 45 | + "object.entity": { |
| 46 | + "name": "Project", |
| 47 | + "children": [ |
| 48 | + { |
| 49 | + "source.rdb": { |
| 50 | + "@table": "projects" |
| 51 | + } |
| 52 | + }, |
| 53 | + { |
| 54 | + "field.long": { |
| 55 | + "name": "id" |
| 56 | + } |
| 57 | + }, |
| 58 | + { |
| 59 | + "field.string": { |
| 60 | + "name": "name", |
| 61 | + "@required": true |
| 62 | + } |
| 63 | + }, |
| 64 | + { |
| 65 | + "field.decimal": { |
| 66 | + "name": "budget", |
| 67 | + "@precision": 12, |
| 68 | + "@scale": 2 |
| 69 | + } |
| 70 | + }, |
| 71 | + { |
| 72 | + "identity.primary": { |
| 73 | + "name": "id", |
| 74 | + "@fields": [ |
| 75 | + "id" |
| 76 | + ] |
| 77 | + } |
| 78 | + } |
| 79 | + ] |
| 80 | + } |
| 81 | + }, |
| 82 | + { |
| 83 | + "object.entity": { |
| 84 | + "name": "TimeEntry", |
| 85 | + "children": [ |
| 86 | + { |
| 87 | + "source.rdb": { |
| 88 | + "@table": "time_entries" |
| 89 | + } |
| 90 | + }, |
| 91 | + { |
| 92 | + "field.long": { |
| 93 | + "name": "id" |
| 94 | + } |
| 95 | + }, |
| 96 | + { |
| 97 | + "field.long": { |
| 98 | + "name": "memberId", |
| 99 | + "@required": true |
| 100 | + } |
| 101 | + }, |
| 102 | + { |
| 103 | + "field.long": { |
| 104 | + "name": "projectId", |
| 105 | + "@required": true |
| 106 | + } |
| 107 | + }, |
| 108 | + { |
| 109 | + "field.decimal": { |
| 110 | + "name": "hours", |
| 111 | + "@required": true, |
| 112 | + "@precision": 6, |
| 113 | + "@scale": 2 |
| 114 | + } |
| 115 | + }, |
| 116 | + { |
| 117 | + "field.decimal": { |
| 118 | + "name": "cost", |
| 119 | + "@precision": 12, |
| 120 | + "@scale": 2 |
| 121 | + } |
| 122 | + }, |
| 123 | + { |
| 124 | + "field.boolean": { |
| 125 | + "name": "billable", |
| 126 | + "@required": true |
| 127 | + } |
| 128 | + }, |
| 129 | + { |
| 130 | + "field.date": { |
| 131 | + "name": "workedOn", |
| 132 | + "@required": true |
| 133 | + } |
| 134 | + }, |
| 135 | + { |
| 136 | + "identity.primary": { |
| 137 | + "name": "id", |
| 138 | + "@fields": [ |
| 139 | + "id" |
| 140 | + ] |
| 141 | + } |
| 142 | + }, |
| 143 | + { |
| 144 | + "identity.reference": { |
| 145 | + "name": "fkMember", |
| 146 | + "@references": "Member", |
| 147 | + "@fields": [ |
| 148 | + "memberId" |
| 149 | + ] |
| 150 | + } |
| 151 | + }, |
| 152 | + { |
| 153 | + "identity.reference": { |
| 154 | + "name": "fkProject", |
| 155 | + "@references": "Project", |
| 156 | + "@fields": [ |
| 157 | + "projectId" |
| 158 | + ] |
| 159 | + } |
| 160 | + }, |
| 161 | + { |
| 162 | + "relationship.association": { |
| 163 | + "name": "member", |
| 164 | + "@objectRef": "Member", |
| 165 | + "@cardinality": "one" |
| 166 | + } |
| 167 | + }, |
| 168 | + { |
| 169 | + "relationship.association": { |
| 170 | + "name": "project", |
| 171 | + "@objectRef": "Project", |
| 172 | + "@cardinality": "one" |
| 173 | + } |
| 174 | + }, |
| 175 | + { |
| 176 | + "dimension.attribute": { |
| 177 | + "name": "memberId", |
| 178 | + "@of": "Member.id", |
| 179 | + "@via": "TimeEntry.member" |
| 180 | + } |
| 181 | + }, |
| 182 | + { |
| 183 | + "dimension.attribute": { |
| 184 | + "name": "memberName", |
| 185 | + "@of": "Member.firstName", |
| 186 | + "@via": "TimeEntry.member" |
| 187 | + } |
| 188 | + }, |
| 189 | + { |
| 190 | + "dimension.attribute": { |
| 191 | + "name": "weeklyCapacityHours", |
| 192 | + "@of": "Member.weeklyCapacityHours", |
| 193 | + "@via": "TimeEntry.member" |
| 194 | + } |
| 195 | + }, |
| 196 | + { |
| 197 | + "dimension.attribute": { |
| 198 | + "name": "projectId", |
| 199 | + "@of": "Project.id", |
| 200 | + "@via": "TimeEntry.project" |
| 201 | + } |
| 202 | + }, |
| 203 | + { |
| 204 | + "dimension.attribute": { |
| 205 | + "name": "projectBudget", |
| 206 | + "@of": "Project.budget", |
| 207 | + "@via": "TimeEntry.project" |
| 208 | + } |
| 209 | + }, |
| 210 | + { |
| 211 | + "dimension.time": { |
| 212 | + "name": "workedOn", |
| 213 | + "@of": "TimeEntry.workedOn", |
| 214 | + "@grains": [ |
| 215 | + "month" |
| 216 | + ] |
| 217 | + } |
| 218 | + }, |
| 219 | + { |
| 220 | + "measure.aggregate": { |
| 221 | + "name": "totalHours", |
| 222 | + "@agg": "sum", |
| 223 | + "@of": "TimeEntry.hours", |
| 224 | + "@default": 0 |
| 225 | + } |
| 226 | + }, |
| 227 | + { |
| 228 | + "measure.aggregate": { |
| 229 | + "name": "billableHours", |
| 230 | + "@agg": "sum", |
| 231 | + "@of": "TimeEntry.hours", |
| 232 | + "@filter": { |
| 233 | + "billable": true |
| 234 | + }, |
| 235 | + "@default": 0 |
| 236 | + } |
| 237 | + }, |
| 238 | + { |
| 239 | + "measure.aggregate": { |
| 240 | + "name": "cost", |
| 241 | + "@agg": "sum", |
| 242 | + "@of": "TimeEntry.cost" |
| 243 | + } |
| 244 | + }, |
| 245 | + { |
| 246 | + "dimension.attribute": { |
| 247 | + "name": "hours", |
| 248 | + "@of": "TimeEntry.hours" |
| 249 | + } |
| 250 | + }, |
| 251 | + { |
| 252 | + "measure.aggregate": { |
| 253 | + "name": "hours", |
| 254 | + "@agg": "max", |
| 255 | + "@of": "TimeEntry.hours" |
| 256 | + } |
| 257 | + }, |
| 258 | + { |
| 259 | + "measure.derived": { |
| 260 | + "name": "doubled", |
| 261 | + "@expr": { |
| 262 | + "fn": "multiply", |
| 263 | + "args": [ |
| 264 | + { |
| 265 | + "field": "hours" |
| 266 | + }, |
| 267 | + { |
| 268 | + "value": 2 |
| 269 | + } |
| 270 | + ] |
| 271 | + } |
| 272 | + } |
| 273 | + } |
| 274 | + ] |
| 275 | + } |
| 276 | + } |
| 277 | + ] |
| 278 | + } |
| 279 | +} |
0 commit comments