File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ # REST API Data Model
2+
3+ No formal definition, just some examples, to have some reference for discussion
4+
5+ The idea is that this is what the API will return, but it also serves as a
6+ guideline for variable naming in the code.
7+
8+ In general:
9+
10+ * All 'reputation' values are expressed as fractions of the total reputaiton of the system
11+ * Tokens are just absolute values (not fractions)
12+
13+ ## User
14+
15+ A user has tokens and reputatation:
16+
17+ {
18+ 'id': 123,
19+ 'tokens': 11.3,
20+ 'reputation': 0.03, /* the fraction of the user' rep
21+ wrt the total_repution */
22+ }
23+
24+
25+ ## Contribution
26+
27+ {
28+ 'id': 12345,
29+ 'contributor' : {
30+ /* user structure */
31+ ...
32+ },
33+ 'score': 0.30,
34+ /* score = the sum of the reputation
35+ of the 'up votes' as a fraction of total_reputation (and in general sum(evalutor.reputation * evaluation.score)) */
36+ 'engaged_reputation': 0.4,
37+ /* the sum of the reputation of all evaluators of this contribution */
38+ }
39+
40+
41+ * in the present API, 'score' is an absolute value, and 'scorePercentage' the
42+ fraction of the 'score' relative to total_repuation. I think this is confusing.
43+ * question, ore: why do you have 'score' and 'scorePercentage'?
44+
45+
46+ ## Evaluation
47+
48+ {
49+ 'id': 1234545,
50+ 'value': 1.0,
51+ 'evaluator' : {
52+ /* user structure */
53+ ...
54+ }
55+ 'contribution': {
56+ ...
57+ },
58+ }
You can’t perform that action at this time.
0 commit comments