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

(-)a/api/v1/swagger/definitions.json (+3 lines)
Lines 26-31 Link Here
26
  "item": {
26
  "item": {
27
    "$ref": "definitions/item.json"
27
    "$ref": "definitions/item.json"
28
  },
28
  },
29
  "order": {
30
    "$ref": "definitions/order.json"
31
  },
29
  "patron": {
32
  "patron": {
30
    "$ref": "definitions/patron.json"
33
    "$ref": "definitions/patron.json"
31
  },
34
  },
(-)a/api/v1/swagger/definitions/order.json (+295 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "order_id": {
5
      "type": "integer",
6
      "description": "Internally assigned order identifier"
7
    },
8
    "biblio_id": {
9
      "type": [
10
        "integer",
11
        "null"
12
      ],
13
      "description": "Identifier for the linked bibliographic record"
14
    },
15
    "created_by": {
16
        "type": "integer",
17
        "description": "Interal patron identifier of the order line creator"
18
    },
19
    "entry_date": {
20
      "type": [
21
        "string",
22
        "null"
23
      ],
24
      "format": "date",
25
      "description": "Date the bib was added to the basket"
26
    },
27
    "quantity": {
28
      "type": [
29
        "integer",
30
        "null"
31
      ],
32
      "description": "Ordered quantity"
33
    },
34
    "currency": {
35
      "type": [
36
        "string",
37
        "null"
38
      ],
39
      "description": "Currency used for the purchase"
40
    },
41
    "list_price": {
42
      "type": [
43
        "number",
44
        "null"
45
      ],
46
      "description": "Vendor price for the line item"
47
    },
48
    "replacement_price": {
49
        "type": [
50
          "number",
51
          "null"
52
        ],
53
        "description": "Replacement cost for this item"
54
    },
55
    "date_received": {
56
      "type": [
57
        "string",
58
        "null"
59
      ],
60
      "format": "date",
61
      "description": "Date the order was received"
62
    },
63
    "invoice_id": {
64
      "type": [
65
        "integer",
66
        "null"
67
      ],
68
      "description": "Id of the order invoice"
69
    },
70
    "shipping_cost": {
71
      "type": [
72
        "number",
73
        "null"
74
      ],
75
      "description": "Shipping cost"
76
    },
77
    "unit_price": {
78
      "type": [
79
        "number",
80
        "null"
81
      ],
82
      "description": "The actual cost entered when receiving this line item"
83
    },
84
    "unit_price_tax_excluded": {
85
      "type": [
86
        "number",
87
        "null"
88
      ],
89
      "description": "Unit price excluding tax (on receiving)"
90
    },
91
    "unit_price_tax_included": {
92
      "type": [
93
        "number",
94
        "null"
95
      ],
96
      "description": "Unit price including tax (on receiving)"
97
    },
98
    "quantity_received": {
99
      "type": "integer",
100
      "description": "Quantity received so far"
101
    },
102
    "cancellation_date": {
103
      "type": [
104
        "string",
105
        "null"
106
      ],
107
      "format": "date",
108
      "description": "Date the line item was deleted"
109
    },
110
    "cancellation_reason": {
111
      "type": [
112
        "string",
113
        "null"
114
      ],
115
      "description": "Reason of cancellation"
116
    },
117
    "internal_note": {
118
      "type": [
119
        "string",
120
        "null"
121
      ],
122
      "description": "Notes related to this order line, made for staff"
123
    },
124
    "vendor_note": {
125
      "type": [
126
        "string",
127
        "null"
128
      ],
129
      "description": "Notes related to this order line, made for vendor"
130
    },
131
    "basket_id": {
132
      "type": [
133
        "integer",
134
        "null"
135
      ],
136
      "description": "Basket this order is linked to"
137
    },
138
    "timestamp": {
139
      "type": "string",
140
      "format": "date-time",
141
      "description": "Date and time this order line was last modified"
142
    },
143
    "rrp": {
144
      "type": [
145
        "number",
146
        "null"
147
      ],
148
      "description": "Retail cost for this item"
149
    },
150
    "rrp_tax_excluded": {
151
      "type": [
152
        "number",
153
        "null"
154
      ],
155
      "description": "Replacement cost for this item (tax excluded)"
156
    },
157
    "rrp_tax_included": {
158
      "type": [
159
        "number",
160
        "null"
161
      ],
162
      "description": "Replacement cost for this item (tax included)"
163
    },
164
    "ecost": {
165
      "type": [
166
        "number",
167
        "null"
168
      ],
169
      "description": "Effective cost"
170
    },
171
    "ecost_tax_excluded": {
172
      "type": [
173
        "number",
174
        "null"
175
      ],
176
      "description": "Effective cost (tax excluded)"
177
    },
178
    "ecost_tax_included": {
179
      "type": [
180
        "number",
181
        "null"
182
      ],
183
      "description": "Effective cost (tax included)"
184
    },
185
    "tax_rate_on_ordering": {
186
      "type": [
187
        "number",
188
        "null"
189
      ],
190
      "description": "Tax rate on ordering (%)"
191
    },
192
    "tax_rate_on_receiving": {
193
      "type": [
194
        "number",
195
        "null"
196
      ],
197
      "description": "Tax rate on receiving (%)"
198
    },
199
    "tax_value_on_ordering": {
200
      "type": [
201
        "number",
202
        "null"
203
      ],
204
      "description": "Tax value on ordering"
205
    },
206
    "tax_value_on_receiving": {
207
      "type": [
208
        "number",
209
        "null"
210
      ],
211
      "description": "Tax value on receiving"
212
    },
213
    "discount_rate": {
214
      "type": [
215
        "number",
216
        "null"
217
      ],
218
      "description": "Discount rate"
219
    },
220
    "budget_id": {
221
      "type": "integer",
222
      "description": "The ID for the budget this order goes against"
223
    },
224
    "statistics_1": {
225
      "type": [
226
        "string",
227
        "null"
228
      ],
229
      "description": "Statistical field"
230
    },
231
    "statistics_2": {
232
      "type": [
233
        "string",
234
        "null"
235
      ],
236
      "description": "Statistical field (2)"
237
    },
238
    "statistics_1_authcat": {
239
      "type": [
240
        "string",
241
        "null"
242
      ],
243
      "description": "Statistical category for this order"
244
    },
245
    "statistics_2_authcat": {
246
      "type": [
247
        "string",
248
        "null"
249
      ],
250
      "description": "Statistical category for this order (2)"
251
    },
252
    "uncertain_price": {
253
      "type": "boolean",
254
      "description": "If this price was uncertain"
255
    },
256
    "claims_count": {
257
      "type": "integer",
258
      "description": "Generated claim letters count"
259
    },
260
    "last_claim_date": {
261
      "type": [
262
        "string",
263
        "null"
264
      ],
265
      "format": "date",
266
      "description": "Last date a claim letter was generated"
267
    },
268
    "subscription_id": {
269
      "type": [
270
        "integer",
271
        "null"
272
      ],
273
      "description": "Subscription ID linking the order to a subscription"
274
    },
275
    "parent_order_id": {
276
      "type": [
277
        "integer",
278
        "null"
279
      ],
280
      "description": "Order ID of parent order line if exists"
281
    },
282
    "status": {
283
      "type": "string",
284
      "enum": [
285
        "new",
286
        "ordered",
287
        "partial",
288
        "complete",
289
        "cancelled"
290
      ],
291
      "description": "The current order status"
292
    }
293
  },
294
  "additionalProperties": false
295
}
(-)a/api/v1/swagger/parameters.json (+3 lines)
Lines 23-28 Link Here
23
  "item_id_pp": {
23
  "item_id_pp": {
24
    "$ref": "parameters/item.json#/item_id_pp"
24
    "$ref": "parameters/item.json#/item_id_pp"
25
  },
25
  },
26
  "order_id_pp": {
27
    "$ref": "parameters/order.json#/order_id_pp"
28
  },
26
  "vendoridPathParam": {
29
  "vendoridPathParam": {
27
    "$ref": "parameters/vendor.json#/vendoridPathParam"
30
    "$ref": "parameters/vendor.json#/vendoridPathParam"
28
  },
31
  },
(-)a/api/v1/swagger/parameters/order.json (+9 lines)
Line 0 Link Here
1
{
2
    "order_id_pp": {
3
      "name": "order_id",
4
      "in": "path",
5
      "description": "Internally assigned order ID",
6
      "required": true,
7
      "type": "integer"
8
    }
9
}
(-)a/api/v1/swagger/paths.json (+6 lines)
Lines 2-7 Link Here
2
  "/oauth/token": {
2
  "/oauth/token": {
3
    "$ref": "paths/oauth.json#/~1oauth~1token"
3
    "$ref": "paths/oauth.json#/~1oauth~1token"
4
  },
4
  },
5
  "/acquisitions/orders": {
6
    "$ref": "paths/acquisitions_orders.json#/~1acquisitions~1orders"
7
  },
8
  "/acquisitions/orders/{order_id}": {
9
    "$ref": "paths/acquisitions_orders.json#/~1acquisitions~1orders~1{order_id}"
10
  },
5
  "/acquisitions/vendors": {
11
  "/acquisitions/vendors": {
6
    "$ref": "paths/acquisitions_vendors.json#/~1acquisitions~1vendors"
12
    "$ref": "paths/acquisitions_vendors.json#/~1acquisitions~1vendors"
7
  },
13
  },
(-)a/api/v1/swagger/paths/acquisitions_orders.json (-1 / +330 lines)
Line 0 Link Here
0
- 
1
{
2
  "/acquisitions/orders": {
3
    "get": {
4
      "x-mojo-to": "Acquisitions::Orders#list",
5
      "operationId": "listOrders",
6
      "tags": ["acquisitions","orders"],
7
      "produces": [
8
        "application/json"
9
      ],
10
      "parameters": [{
11
        "name": "biblio_id",
12
        "in": "query",
13
        "description": "Identifier for a linked bibliographic record",
14
        "required": false,
15
        "type": "integer"
16
      }, {
17
        "name": "basket_id",
18
        "in": "query",
19
        "description": "Identifier for a linked acquisition basket",
20
        "required": false,
21
        "type": "integer"
22
      }, {
23
        "name": "budget_id",
24
        "in": "query",
25
        "description": "Identifier for the budget the order goes against",
26
        "required": false,
27
        "type": "integer"
28
      }, {
29
        "name": "status",
30
        "in": "query",
31
        "description": "Current status for the order. Can be 'new', 'ordered', 'partial', 'complete' or 'cancelled'",
32
        "required": false,
33
        "type": "string"
34
      }, {
35
        "$ref": "../parameters.json#/match"
36
      }, {
37
        "$ref": "../parameters.json#/order_by"
38
      }, {
39
        "$ref": "../parameters.json#/page"
40
      }, {
41
        "$ref": "../parameters.json#/per_page"
42
      }],
43
      "responses": {
44
        "200": {
45
          "description": "A list of orders",
46
          "schema": {
47
            "type": "array",
48
            "items": {
49
              "$ref": "../definitions.json#/order"
50
            }
51
          }
52
        },
53
        "401": {
54
          "description": "Authentication required",
55
          "schema": {
56
            "$ref": "../definitions.json#/error"
57
          }
58
        },
59
        "403": {
60
          "description": "Access forbidden",
61
          "schema": {
62
            "$ref": "../definitions.json#/error"
63
          }
64
        },
65
        "404": {
66
          "description": "Order not found",
67
          "schema": {
68
            "$ref": "../definitions.json#/error"
69
          }
70
        },
71
        "500": {
72
          "description": "Internal server error",
73
          "schema": {
74
            "$ref": "../definitions.json#/error"
75
          }
76
        },
77
        "503": {
78
          "description": "Under maintenance",
79
          "schema": {
80
            "$ref": "../definitions.json#/error"
81
          }
82
        }
83
      },
84
      "x-koha-authorization": {
85
        "permissions": {
86
          "acquisition": "order_manage",
87
          "acquisition": "order_manage_all"
88
        }
89
      }
90
    },
91
    "post": {
92
      "x-mojo-to": "Acquisitions::Orders#add",
93
      "operationId": "addOrder",
94
      "tags": ["acquisitions","orders"],
95
      "parameters": [{
96
        "name": "body",
97
        "in": "body",
98
        "description": "A JSON object representing an order",
99
        "required": true,
100
        "schema": {
101
          "$ref": "../definitions.json#/order"
102
        }
103
      }],
104
      "produces": [
105
        "application/json"
106
      ],
107
      "responses": {
108
        "201": {
109
          "description": "Order added",
110
          "schema": {
111
            "$ref": "../definitions.json#/order"
112
          }
113
        },
114
        "400": {
115
          "description": "Bad request",
116
          "schema": {
117
            "$ref": "../definitions.json#/error"
118
          }
119
        },
120
        "401": {
121
          "description": "Authentication required",
122
          "schema": {
123
            "$ref": "../definitions.json#/error"
124
          }
125
        },
126
        "403": {
127
          "description": "Access forbidden",
128
          "schema": {
129
            "$ref": "../definitions.json#/error"
130
          }
131
        },
132
        "409": {
133
            "description": "Conflict in creating the resource",
134
            "schema": {
135
                "$ref": "../definitions.json#/error"
136
            }
137
        },
138
        "500": {
139
          "description": "Internal server error",
140
          "schema": {
141
            "$ref": "../definitions.json#/error"
142
          }
143
        },
144
        "503": {
145
          "description": "Under maintenance",
146
          "schema": {
147
            "$ref": "../definitions.json#/error"
148
          }
149
        }
150
      },
151
      "x-koha-authorization": {
152
        "permissions": {
153
          "acquisition": "order_manage"
154
        }
155
      }
156
    }
157
  },
158
  "/acquisitions/orders/{order_id}": {
159
    "get": {
160
      "x-mojo-to": "Acquisitions::Orders#get",
161
      "operationId": "getOrder",
162
      "tags": ["acquisitions","orders"],
163
      "parameters": [{
164
        "$ref": "../parameters.json#/order_id_pp"
165
      }],
166
      "produces": [
167
        "application/json"
168
      ],
169
      "responses": {
170
        "200": {
171
          "description": "An order",
172
          "schema": {
173
            "$ref": "../definitions.json#/order"
174
          }
175
        },
176
        "401": {
177
          "description": "Authentication required",
178
          "schema": {
179
            "$ref": "../definitions.json#/error"
180
          }
181
        },
182
        "403": {
183
          "description": "Access forbidden",
184
          "schema": {
185
            "$ref": "../definitions.json#/error"
186
          }
187
        },
188
        "404": {
189
          "description": "Order not found",
190
          "schema": {
191
            "$ref": "../definitions.json#/error"
192
          }
193
        },
194
        "500": {
195
          "description": "Internal server error",
196
          "schema": {
197
            "$ref": "../definitions.json#/error"
198
          }
199
        },
200
        "503": {
201
          "description": "Under maintenance",
202
          "schema": {
203
            "$ref": "../definitions.json#/error"
204
          }
205
        }
206
      },
207
      "x-koha-authorization": {
208
        "permissions": {
209
          "acquisition": "order_manage"
210
        }
211
      }
212
    },
213
    "put": {
214
      "x-mojo-to": "Acquisitions::Orders#update",
215
      "operationId": "updateOrder",
216
      "tags": ["acquisitions","orders"],
217
      "parameters": [{
218
        "$ref": "../parameters.json#/order_id_pp"
219
      }, {
220
        "name": "body",
221
        "in": "body",
222
        "description": "A JSON object representing an order",
223
        "required": true,
224
        "schema": {
225
          "$ref": "../definitions.json#/order"
226
        }
227
      }],
228
      "produces": [
229
        "application/json"
230
      ],
231
      "responses": {
232
        "200": {
233
          "description": "An order",
234
          "schema": {
235
            "$ref": "../definitions.json#/order"
236
          }
237
        },
238
        "401": {
239
          "description": "Authentication required",
240
          "schema": {
241
            "$ref": "../definitions.json#/error"
242
          }
243
        },
244
        "403": {
245
          "description": "Access forbidden",
246
          "schema": {
247
            "$ref": "../definitions.json#/error"
248
          }
249
        },
250
        "404": {
251
          "description": "Order not found",
252
          "schema": {
253
            "$ref": "../definitions.json#/error"
254
          }
255
        },
256
        "500": {
257
          "description": "Internal server error",
258
          "schema": {
259
            "$ref": "../definitions.json#/error"
260
          }
261
        },
262
        "503": {
263
          "description": "Under maintenance",
264
          "schema": {
265
            "$ref": "../definitions.json#/error"
266
          }
267
        }
268
      },
269
      "x-koha-authorization": {
270
        "permissions": {
271
          "acquisition": "order_manage"
272
        }
273
      }
274
    },
275
    "delete": {
276
      "x-mojo-to": "Acquisitions::Orders#delete",
277
      "operationId": "deleteOrder",
278
      "tags": ["acquisitions","orders"],
279
      "parameters": [{
280
        "$ref": "../parameters.json#/order_id_pp"
281
      }],
282
      "produces": [
283
        "application/json"
284
      ],
285
      "responses": {
286
        "204": {
287
          "description": "Order deleted",
288
          "schema": {
289
            "type": "string"
290
          }
291
        },
292
        "401": {
293
          "description": "Authentication required",
294
          "schema": {
295
            "$ref": "../definitions.json#/error"
296
          }
297
        },
298
        "403": {
299
          "description": "Access forbidden",
300
          "schema": {
301
            "$ref": "../definitions.json#/error"
302
          }
303
        },
304
        "404": {
305
          "description": "Order not found",
306
          "schema": {
307
            "$ref": "../definitions.json#/error"
308
          }
309
        },
310
        "500": {
311
          "description": "Internal server error",
312
          "schema": {
313
            "$ref": "../definitions.json#/error"
314
          }
315
        },
316
        "503": {
317
          "description": "Under maintenance",
318
          "schema": {
319
            "$ref": "../definitions.json#/error"
320
          }
321
        }
322
      },
323
      "x-koha-authorization": {
324
        "permissions": {
325
          "acquisition": "order_manage"
326
        }
327
      }
328
    }
329
  }
330
}

Return to bug 18731