View | Details | Raw Unified | Return to bug 17314
Collapse All | Expand All

(-)a/api/v1/swagger/definitions.json (+3 lines)
Lines 88-92 Link Here
88
  },
88
  },
89
  "smtp_server": {
89
  "smtp_server": {
90
    "$ref": "definitions/smtp_server.json"
90
    "$ref": "definitions/smtp_server.json"
91
  },
92
  "suggestion": {
93
    "$ref": "definitions/suggestion.json"
91
  }
94
  }
92
}
95
}
(-)a/api/v1/swagger/definitions/suggestion.json (+154 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "suggestion_id": {
5
      "type": "string",
6
      "readOnly": true,
7
      "description": "unique identifier assigned automatically by Koha"
8
    },
9
    "suggested_by": {
10
      "type": ["string", "null"],
11
      "description": "patron_id for the person making the suggestion, foreign key linking to the borrowers table"
12
    },
13
    "suggestion_date": {
14
      "type": ["string", "null"],
15
      "format": "date",
16
      "description": "the suggestion was submitted"
17
    },
18
    "managed_by": {
19
      "type": ["string", "null"],
20
      "description": "patron_id for the librarian managing the suggestion, foreign key linking to the borrowers table"
21
    },
22
    "managed_date": {
23
      "type": ["string", "null"],
24
      "format": "date",
25
      "description": "date the suggestion was updated"
26
    },
27
    "accepted_by": {
28
      "type": ["string", "null"],
29
      "description": "patron_id for the librarian who accepted the suggestion, foreign key linking to the borrowers table"
30
    },
31
    "accepted_date": {
32
      "type": ["string", "null"],
33
      "format": "date",
34
      "description": "date the suggestion was marked as accepted"
35
    },
36
    "rejected_by": {
37
      "type": ["string", "null"],
38
      "description": "patron_id for the librarian who rejected the suggestion, foreign key linking to the borrowers table"
39
    },
40
    "rejected_date": {
41
      "type": ["string", "null"],
42
      "format": "date",
43
      "description": "date the suggestion was marked as rejected"
44
    },
45
    "last_modification_by": {
46
      "type": ["string", "null"],
47
      "description": "patron the suggestion was last modified by"
48
    },
49
    "last_modification_date": {
50
      "type": ["string", "null"],
51
      "format": "date",
52
      "description": "date the suggestion was last modified"
53
    },
54
    "status": {
55
      "type": "string",
56
      "description": "Suggestion status",
57
      "enum": [
58
        "ASKED",
59
        "CHECKED",
60
        "ACCEPTED",
61
        "REJECTED"
62
      ]
63
    },
64
    "note": {
65
      "type": ["string", "null"],
66
      "description": "note entered on the suggestion"
67
    },
68
    "author": {
69
      "type": ["string", "null"],
70
      "description": "author of the suggested item"
71
    },
72
    "title": {
73
      "type": ["string", "null"],
74
      "description": "title of the suggested item"
75
    },
76
    "copyright_date": {
77
      "type": ["integer", "null"],
78
      "description": "copyright date of the suggested item"
79
    },
80
    "publisher_code": {
81
      "type": ["string", "null"],
82
      "description": "publisher of the suggested item"
83
    },
84
    "date_created": {
85
      "type": ["string", "null"],
86
      "description": "timestamp of date created"
87
    },
88
    "volume_desc": {
89
      "type": ["string", "null"],
90
      "description": "volume description"
91
    },
92
    "publication_year": {
93
      "type": ["string", "null"],
94
      "description": "year of publication"
95
    },
96
    "publication_place": {
97
      "type": ["string", "null"],
98
      "description": "publication place of the suggested item"
99
    },
100
    "isbn": {
101
      "type": ["string", "null"],
102
      "description": "isbn of the suggested item"
103
    },
104
    "biblio_id": {
105
      "type": ["string", "null"],
106
      "description": "foreign key linking the suggestion to the biblio table after the suggestion has been ordered"
107
    },
108
    "reason": {
109
      "type": ["string", "null"],
110
      "description": "reason for accepting or rejecting the suggestion"
111
    },
112
    "patron_reason": {
113
      "type": ["string", "null"],
114
      "description": "reason for making the suggestion"
115
    },
116
    "budget_id": {
117
      "type": ["string", "null"],
118
      "description": "foreign key linking the suggested budget to the aqbudgets table"
119
    },
120
    "library_id": {
121
      "type": ["string", "null"],
122
      "description": "foreign key linking the suggested branch to the branches table"
123
    },
124
    "collection_title": {
125
      "type": ["string", "null"],
126
      "description": "collection name for the suggested item"
127
    },
128
    "item_type": {
129
      "type": ["string", "null"],
130
      "description": "suggested item type"
131
    },
132
    "quantity": {
133
      "type": ["string", "null"],
134
      "description": "suggested quantity to be purchased"
135
    },
136
    "currency": {
137
      "type": ["string", "null"],
138
      "description": "suggested currency for the suggested price"
139
    },
140
    "item_price": {
141
      "type": ["number", "null"],
142
      "description": "suggested price"
143
    },
144
    "total_price": {
145
      "type": ["string", "null"],
146
      "description": "suggested total cost (price*quantity updated for currency)"
147
    },
148
    "archived": {
149
      "type": ["boolean", "null"],
150
      "description": "archived (processed) suggestion"
151
    }
152
  },
153
  "additionalProperties": false
154
}
(-)a/api/v1/swagger/parameters.json (+3 lines)
Lines 119-123 Link Here
119
  },
119
  },
120
  "fundidPathParam": {
120
  "fundidPathParam": {
121
    "$ref": "parameters/fund.json#/fundidPathParam"
121
    "$ref": "parameters/fund.json#/fundidPathParam"
122
  },
123
  "suggestion_id_pp": {
124
    "$ref": "parameters/suggestion.json#/suggestion_id_pp"
122
  }
125
  }
123
}
126
}
(-)a/api/v1/swagger/parameters/suggestion.json (+9 lines)
Line 0 Link Here
1
{
2
  "suggestion_id_pp": {
3
    "name": "suggestion_id",
4
    "in": "path",
5
    "description": "Internal suggestion identifier",
6
    "required": true,
7
    "type": "integer"
8
  }
9
}
(-)a/api/v1/swagger/paths.json (+6 lines)
Lines 181-185 Link Here
181
  },
181
  },
182
  "/return_claims/{claim_id}": {
182
  "/return_claims/{claim_id}": {
183
    "$ref": "paths/return_claims.json#/~1return_claims~1{claim_id}"
183
    "$ref": "paths/return_claims.json#/~1return_claims~1{claim_id}"
184
  },
185
  "/suggestions": {
186
    "$ref": "paths/suggestions.json#/~1suggestions"
187
  },
188
  "/suggestions/{suggestion_id}": {
189
    "$ref": "paths/suggestions.json#/~1suggestions~1{suggestion_id}"
184
  }
190
  }
185
}
191
}
(-)a/api/v1/swagger/paths/suggestions.json (-1 / +290 lines)
Line 0 Link Here
0
- 
1
{
2
  "/suggestions": {
3
    "get": {
4
      "x-mojo-to": "Suggestions#list",
5
      "operationId" : "list",
6
      "tags": ["patrons", "suggestions"],
7
      "parameters": [
8
        {
9
          "$ref": "../parameters.json#/match"
10
        },
11
        {
12
          "$ref": "../parameters.json#/order_by"
13
        },
14
        {
15
          "$ref": "../parameters.json#/page"
16
        },
17
        {
18
          "$ref": "../parameters.json#/per_page"
19
        },
20
        {
21
          "$ref": "../parameters.json#/q_param"
22
        },
23
        {
24
          "$ref": "../parameters.json#/q_body"
25
        },
26
        {
27
          "$ref": "../parameters.json#/q_header"
28
        }
29
      ],
30
      "produces": [
31
          "application/json"
32
      ],
33
      "responses": {
34
        "200": {
35
          "description": "A list of suggestions",
36
          "schema": {
37
            "type": "array",
38
            "items": {
39
              "$ref": "../definitions.json#/suggestion"
40
            }
41
          }
42
        },
43
        "403": {
44
          "description": "Access forbidden",
45
          "schema": {
46
            "$ref": "../definitions.json#/error"
47
          }
48
        },
49
        "500": {
50
          "description": "Internal error",
51
          "schema": {
52
            "$ref": "../definitions.json#/error"
53
          }
54
        },
55
        "503": {
56
          "description": "Under maintenance",
57
          "schema": {
58
            "$ref": "../definitions.json#/error"
59
          }
60
        }
61
      },
62
      "x-koha-authorization": {
63
        "permissions": {
64
          "suggestions": "suggestions_manage"
65
        }
66
      }
67
    },
68
    "post": {
69
      "x-mojo-to": "Suggestions#add",
70
      "operationId": "add",
71
      "tags": ["patrons", "suggestions"],
72
      "parameters": [{
73
        "name": "body",
74
        "in": "body",
75
        "description": "A JSON object containing informations about the new suggestion",
76
        "required": true,
77
        "schema": {
78
          "$ref": "../definitions.json#/suggestion"
79
        }
80
      }],
81
      "produces": [
82
        "application/json"
83
      ],
84
      "responses": {
85
        "201": {
86
          "description": "Suggestion added",
87
          "schema": {
88
            "$ref": "../definitions.json#/suggestion"
89
          }
90
        },
91
        "400": {
92
          "description": "Bad request",
93
          "schema": {
94
            "$ref": "../definitions.json#/error"
95
          }
96
        },
97
        "403": {
98
          "description": "Access forbidden",
99
          "schema": {
100
            "$ref": "../definitions.json#/error"
101
          }
102
        },
103
        "500": {
104
          "description": "Internal error",
105
          "schema": {
106
            "$ref": "../definitions.json#/error"
107
          }
108
        },
109
        "503": {
110
          "description": "Under maintenance",
111
          "schema": {
112
            "$ref": "../definitions.json#/error"
113
          }
114
        }
115
      },
116
      "x-koha-authorization": {
117
        "permissions": {
118
          "suggestions": "suggestions_manage"
119
        }
120
      }
121
    }
122
  },
123
  "/suggestions/{suggestion_id}": {
124
    "get": {
125
      "x-mojo-to": "Suggestions#get",
126
      "operationId": "getSuggestions",
127
      "tags": ["patrons", "suggestions"],
128
      "parameters": [{
129
          "$ref": "../parameters.json#/suggestion_id_pp"
130
        }
131
      ],
132
      "produces": [
133
          "application/json"
134
      ],
135
      "responses": {
136
        "200": {
137
          "description": "A suggestion",
138
          "schema": {
139
            "$ref": "../definitions.json#/suggestion"
140
          }
141
        },
142
        "403": {
143
          "description": "Access forbidden",
144
          "schema": {
145
            "$ref": "../definitions.json#/error"
146
          }
147
        },
148
        "404": {
149
          "description": "Suggestion not found",
150
          "schema": {
151
            "$ref": "../definitions.json#/error"
152
          }
153
        },
154
        "500": {
155
          "description": "Internal error",
156
          "schema": {
157
            "$ref": "../definitions.json#/error"
158
          }
159
        },
160
        "503": {
161
          "description": "Under maintenance",
162
          "schema": {
163
            "$ref": "../definitions.json#/error"
164
          }
165
        }
166
      },
167
      "x-koha-authorization": {
168
        "permissions": {
169
          "suggestions": "suggestions_manage"
170
        }
171
      }
172
    },
173
    "put": {
174
      "x-mojo-to": "Suggestions#update",
175
      "operationId": "update",
176
      "tags": ["patrons", "suggestions"],
177
      "parameters": [{
178
        "$ref": "../parameters.json#/suggestion_id_pp"
179
      }, {
180
        "name": "body",
181
        "in": "body",
182
        "description": "A JSON object containing informations about the new hold",
183
        "required": true,
184
        "schema": {
185
          "$ref": "../definitions.json#/suggestion"
186
        }
187
      }],
188
      "produces": [
189
        "application/json"
190
      ],
191
      "responses": {
192
        "200": {
193
          "description": "A suggestion",
194
          "schema": {
195
            "$ref": "../definitions.json#/suggestion"
196
          }
197
        },
198
        "400": {
199
          "description": "Bad request",
200
          "schema": {
201
            "$ref": "../definitions.json#/error"
202
          }
203
        },
204
        "403": {
205
          "description": "Access forbidden",
206
          "schema": {
207
            "$ref": "../definitions.json#/error"
208
          }
209
        },
210
        "404": {
211
          "description": "Suggestion not found",
212
          "schema": {
213
            "$ref": "../definitions.json#/error"
214
          }
215
        },
216
        "500": {
217
          "description": "Internal error",
218
          "schema": {
219
            "$ref": "../definitions.json#/error"
220
          }
221
        },
222
        "503": {
223
          "description": "Under maintenance",
224
          "schema": {
225
            "$ref": "../definitions.json#/error"
226
          }
227
        }
228
      },
229
      "x-koha-authorization": {
230
        "permissions": {
231
          "suggestions": "suggestions_manage"
232
        }
233
      }
234
    },
235
    "delete": {
236
      "x-mojo-to": "Suggestions#delete",
237
      "operationId": "delete",
238
      "tags": ["patrons", "suggestions"],
239
      "parameters": [{
240
        "$ref": "../parameters.json#/suggestion_id_pp"
241
      }],
242
      "produces": [
243
        "application/json"
244
      ],
245
      "responses": {
246
        "204": {
247
          "description": "Suggestion deleted",
248
          "schema": {
249
            "type": "string"
250
          }
251
        },
252
        "401": {
253
          "description": "Authentication required",
254
          "schema": {
255
            "$ref": "../definitions.json#/error"
256
          }
257
        },
258
        "403": {
259
          "description": "Access forbidden",
260
          "schema": {
261
            "$ref": "../definitions.json#/error"
262
          }
263
        },
264
        "404": {
265
          "description": "Suggestion not found",
266
          "schema": {
267
            "$ref": "../definitions.json#/error"
268
          }
269
        },
270
        "500": {
271
          "description": "Internal error",
272
          "schema": {
273
            "$ref": "../definitions.json#/error"
274
          }
275
        },
276
        "503": {
277
          "description": "Under maintenance",
278
          "schema": {
279
            "$ref": "../definitions.json#/error"
280
          }
281
        }
282
      },
283
      "x-koha-authorization": {
284
        "permissions": {
285
          "suggestions": "suggestions_manage"
286
        }
287
      }
288
    }
289
  }
290
}

Return to bug 17314