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

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

Return to bug 18731