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.yaml"
91
  }
94
  }
92
}
95
}
(-)a/api/v1/swagger/definitions/suggestion.yaml (+185 lines)
Line 0 Link Here
1
---
2
type: object
3
properties:
4
  suggestion_id:
5
    type: integer
6
    readOnly: true
7
    description: unique identifier assigned automatically by Koha
8
  suggested_by:
9
    type:
10
      - integer
11
      - "null"
12
    description: patron_id for the person making the suggestion, foreign key linking to the
13
      borrowers table
14
  suggestion_date:
15
    type: string
16
    format: date
17
    description: the suggestion was submitted
18
  managed_by:
19
    type:
20
      - integer
21
      - "null"
22
    description: patron_id for the librarian managing the suggestion, foreign key linking
23
      to the borrowers table
24
  managed_date:
25
    type:
26
      - string
27
      - "null"
28
    format: date
29
    description: date the suggestion was updated
30
  accepted_by:
31
    type:
32
      - integer
33
      - "null"
34
    description: patron_id for the librarian who accepted the suggestion, foreign key
35
      linking to the borrowers table
36
  accepted_date:
37
    type:
38
      - string
39
      - "null"
40
    format: date
41
    description: date the suggestion was marked as accepted
42
  rejected_by:
43
    type:
44
      - integer
45
      - "null"
46
    description: patron_id for the librarian who rejected the suggestion, foreign key
47
      linking to the borrowers table
48
  rejected_date:
49
    type:
50
      - string
51
      - "null"
52
    format: date
53
    description: date the suggestion was marked as rejected
54
  last_status_change_by:
55
    type:
56
      - integer
57
      - "null"
58
    description: patron the suggestion was last modified by
59
  last_status_change_date:
60
    type:
61
      - string
62
      - "null"
63
    format: date
64
    description: date the suggestion was last modified
65
  status:
66
    type: string
67
    description: Suggestion status
68
    enum:
69
      - ASKED
70
      - CHECKED
71
      - ACCEPTED
72
      - REJECTED
73
  note:
74
    type:
75
      - string
76
      - "null"
77
    description: note entered on the suggestion
78
  author:
79
    type:
80
      - string
81
      - "null"
82
    description: author of the suggested item
83
  title:
84
    type:
85
      - string
86
      - "null"
87
    description: title of the suggested item
88
  copyright_date:
89
    type:
90
      - integer
91
      - "null"
92
    description: copyright date of the suggested item
93
  publisher_code:
94
    type:
95
      - string
96
      - "null"
97
    description: publisher of the suggested item
98
  timestamp:
99
    type:
100
      - string
101
      - "null"
102
    format: date-time
103
    description: timestamp of date created
104
  volume_desc:
105
    type:
106
      - string
107
      - "null"
108
    description: volume description
109
  publication_year:
110
    type:
111
      - string
112
      - "null"
113
    description: year of publication
114
  publication_place:
115
    type:
116
      - string
117
      - "null"
118
    description: publication place of the suggested item
119
  isbn:
120
    type:
121
      - string
122
      - "null"
123
    description: isbn of the suggested item
124
  biblio_id:
125
    type:
126
      - integer
127
      - "null"
128
    description: foreign key linking the suggestion to the biblio table after the
129
      suggestion has been ordered
130
  reason:
131
    type:
132
      - string
133
      - "null"
134
    description: reason for accepting or rejecting the suggestion
135
  patron_reason:
136
    type:
137
      - string
138
      - "null"
139
    description: reason for making the suggestion
140
  budget_id:
141
    type:
142
      - integer
143
      - "null"
144
    description: foreign key linking the suggested budget to the aqbudgets table
145
  library_id:
146
    type:
147
      - string
148
      - "null"
149
    description: foreign key linking the suggested branch to the branches table
150
  collection_title:
151
    type:
152
      - string
153
      - "null"
154
    description: collection name for the suggested item
155
  item_type:
156
    type:
157
      - string
158
      - "null"
159
    description: suggested item type
160
  quantity:
161
    type:
162
      - string
163
      - "null"
164
    description: suggested quantity to be purchased
165
  currency:
166
    type:
167
      - string
168
      - "null"
169
    description: suggested currency for the suggested price
170
  item_price:
171
    type:
172
      - number
173
      - "null"
174
    description: suggested price
175
  total_price:
176
    type:
177
      - string
178
      - "null"
179
    description: suggested total cost (price*quantity updated for currency)
180
  archived:
181
    type:
182
      - boolean
183
      - "null"
184
    description: archived (processed) suggestion
185
additionalProperties: false
(-)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 187-191 Link Here
187
  },
187
  },
188
  "/return_claims/{claim_id}": {
188
  "/return_claims/{claim_id}": {
189
    "$ref": "paths/return_claims.json#/~1return_claims~1{claim_id}"
189
    "$ref": "paths/return_claims.json#/~1return_claims~1{claim_id}"
190
  },
191
  "/suggestions": {
192
    "$ref": "paths/suggestions.yaml#/~1suggestions"
193
  },
194
  "/suggestions/{suggestion_id}": {
195
    "$ref": "paths/suggestions.yaml#/~1suggestions~1{suggestion_id}"
190
  }
196
  }
191
}
197
}
(-)a/api/v1/swagger/paths/suggestions.yaml (+201 lines)
Line 0 Link Here
1
---
2
/suggestions:
3
  get:
4
    x-mojo-to: Suggestions#list
5
    operationId: listSuggestions
6
    description: This resource returns a list of purchase suggestions
7
    summary: List purchase suggestions
8
    tags:
9
      - suggestions
10
    parameters:
11
      - $ref: ../parameters.json#/match
12
      - $ref: ../parameters.json#/order_by
13
      - $ref: ../parameters.json#/page
14
      - $ref: ../parameters.json#/per_page
15
      - $ref: ../parameters.json#/q_param
16
      - $ref: ../parameters.json#/q_body
17
      - $ref: ../parameters.json#/q_header
18
    produces:
19
      - application/json
20
    responses:
21
      "200":
22
        description: A list of suggestions
23
        schema:
24
          type: array
25
          items:
26
            $ref: ../definitions.json#/suggestion
27
      "403":
28
        description: Access forbidden
29
        schema:
30
          $ref: ../definitions.json#/error
31
      "500":
32
        description: Internal error
33
        schema:
34
          $ref: ../definitions.json#/error
35
      "503":
36
        description: Under maintenance
37
        schema:
38
          $ref: ../definitions.json#/error
39
    x-koha-authorization:
40
      permissions:
41
        suggestions: suggestions_manage
42
  post:
43
    x-mojo-to: Suggestions#add
44
    operationId: addSuggestions
45
    description: This resource accepts a new purchase suggestion and creates it
46
    summary: Add a purchase suggestion
47
    tags:
48
      - suggestions
49
    parameters:
50
      - name: body
51
        in: body
52
        description: A JSON object containing informations about the new suggestion
53
        required: true
54
        schema:
55
          $ref: ../definitions.json#/suggestion
56
    produces:
57
      - application/json
58
    responses:
59
      "201":
60
        description: Suggestion added
61
        schema:
62
          $ref: ../definitions.json#/suggestion
63
      "400":
64
        description: Bad request
65
        schema:
66
          $ref: ../definitions.json#/error
67
      "403":
68
        description: Access forbidden
69
        schema:
70
          $ref: ../definitions.json#/error
71
      "500":
72
        description: Internal error
73
        schema:
74
          $ref: ../definitions.json#/error
75
      "503":
76
        description: Under maintenance
77
        schema:
78
          $ref: ../definitions.json#/error
79
    x-koha-authorization:
80
      permissions:
81
        suggestions: suggestions_manage
82
"/suggestions/{suggestion_id}":
83
  get:
84
    x-mojo-to: Suggestions#get
85
    operationId: getSuggestion
86
    description: This resource gives access to a specific purchase suggestion
87
    summary: Get purchase suggestion
88
    tags:
89
      - suggestions
90
    parameters:
91
      - $ref: ../parameters.json#/suggestion_id_pp
92
    produces:
93
      - application/json
94
    responses:
95
      "200":
96
        description: A suggestion
97
        schema:
98
          $ref: ../definitions.json#/suggestion
99
      "403":
100
        description: Access forbidden
101
        schema:
102
          $ref: ../definitions.json#/error
103
      "404":
104
        description: Suggestion not found
105
        schema:
106
          $ref: ../definitions.json#/error
107
      "500":
108
        description: Internal error
109
        schema:
110
          $ref: ../definitions.json#/error
111
      "503":
112
        description: Under maintenance
113
        schema:
114
          $ref: ../definitions.json#/error
115
    x-koha-authorization:
116
      permissions:
117
        suggestions: suggestions_manage
118
  put:
119
    x-mojo-to: Suggestions#update
120
    operationId: updateSuggestion
121
    description: This resource allows updating an existing purchase suggestion
122
    summary: Update purchase suggestion
123
    tags:
124
      - suggestions
125
    parameters:
126
      - $ref: ../parameters.json#/suggestion_id_pp
127
      - name: body
128
        in: body
129
        description: A JSON object containing informations about the new hold
130
        required: true
131
        schema:
132
          $ref: ../definitions.json#/suggestion
133
    produces:
134
      - application/json
135
    responses:
136
      "200":
137
        description: A suggestion
138
        schema:
139
          $ref: ../definitions.json#/suggestion
140
      "400":
141
        description: Bad request
142
        schema:
143
          $ref: ../definitions.json#/error
144
      "403":
145
        description: Access forbidden
146
        schema:
147
          $ref: ../definitions.json#/error
148
      "404":
149
        description: Suggestion not found
150
        schema:
151
          $ref: ../definitions.json#/error
152
      "500":
153
        description: Internal error
154
        schema:
155
          $ref: ../definitions.json#/error
156
      "503":
157
        description: Under maintenance
158
        schema:
159
          $ref: ../definitions.json#/error
160
    x-koha-authorization:
161
      permissions:
162
        suggestions: suggestions_manage
163
  delete:
164
    x-mojo-to: Suggestions#delete
165
    operationId: deleteSuggestion
166
    description: This resource deletes an existing purchase suggestion
167
    summary: Delete purchase suggestion
168
    tags:
169
      - suggestions
170
    parameters:
171
      - $ref: ../parameters.json#/suggestion_id_pp
172
    produces:
173
      - application/json
174
    responses:
175
      "204":
176
        description: Suggestion deleted
177
        schema:
178
          type: string
179
      "401":
180
        description: Authentication required
181
        schema:
182
          $ref: ../definitions.json#/error
183
      "403":
184
        description: Access forbidden
185
        schema:
186
          $ref: ../definitions.json#/error
187
      "404":
188
        description: Suggestion not found
189
        schema:
190
          $ref: ../definitions.json#/error
191
      "500":
192
        description: Internal error
193
        schema:
194
          $ref: ../definitions.json#/error
195
      "503":
196
        description: Under maintenance
197
        schema:
198
          $ref: ../definitions.json#/error
199
    x-koha-authorization:
200
      permissions:
201
        suggestions: suggestions_manage
(-)a/api/v1/swagger/swagger.yaml (-1 / +4 lines)
Lines 115-120 tags: Link Here
115
    x-displayName: Transfer limits
115
    x-displayName: Transfer limits
116
    description: |
116
    description: |
117
      Manage transfer limits
117
      Manage transfer limits
118
  - name: "suggestions"
119
    x-displayName: "Purchase suggestions"
120
    description: |
121
      Manage purchase suggestions
118
  - name: "vendors"
122
  - name: "vendors"
119
    x-displayName: "Vendors"
123
    x-displayName: "Vendors"
120
    description: |
124
    description: |
121
- 

Return to bug 17314