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

(-)a/api/v1/swagger/paths.json (+4 lines)
Lines 59-64 Link Here
59
  "/patrons/{patron_id}/account/credits": {
59
  "/patrons/{patron_id}/account/credits": {
60
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
60
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
61
  },
61
  },
62
  "/patrons/{patron_id}/checkouts": {
63
    "$ref": "paths/checkouts.json#/~1patrons~1{patron_id}~1checkouts"
64
  },
65
62
  "/patrons/{patron_id}/password": {
66
  "/patrons/{patron_id}/password": {
63
    "$ref": "paths/patrons_password.json#/~1patrons~1{patron_id}~1password"
67
    "$ref": "paths/patrons_password.json#/~1patrons~1{patron_id}~1password"
64
  },
68
  },
(-)a/api/v1/swagger/paths/checkouts.json (+39 lines)
Lines 135-139 Link Here
135
        }
135
        }
136
      }
136
      }
137
    }
137
    }
138
  },
139
  "/patrons/{patron_id}/checkouts": {
140
    "get": {
141
      "x-mojo-to": "Checkouts#list",
142
      "operationId": "listPatronsCheckouts",
143
      "tags": ["patrons", "checkouts"],
144
      "parameters": [{
145
        "$ref": "../parameters.json#/patron_id_pp"
146
      },{
147
        "name": "checked_in",
148
        "in": "query",
149
        "description": "By default, only current checkout are returned, when this is true, all checkouts (current and checked in) are returned as result.",
150
        "type": "boolean"
151
      }],
152
      "produces": [
153
        "application/json"
154
      ],
155
      "responses": {
156
        "200": {
157
          "description": "A list of checkouts",
158
          "schema": {
159
            "$ref": "../definitions.json#/checkouts"
160
          }
161
        },
162
        "403": {
163
          "description": "Access forbidden",
164
          "schema": { "$ref": "../definitions.json#/error" }
165
        },
166
        "404": {
167
          "description": "Patron not found",
168
          "schema": { "$ref": "../definitions.json#/error" }
169
        }
170
      },
171
      "x-koha-authorization": {
172
        "permissions": {
173
          "circulate": "circulate_remaining_permissions"
174
        }
175
      }
176
    }
138
  }
177
  }
139
}
178
}
(-)a/t/db_dependent/api/v1/checkouts.t (-2 / +11 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 93;
20
use Test::More tests => 102;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Mojo;
22
use Test::Mojo;
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 152-157 $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id&_per_pag Link Here
152
  ->json_is('/0/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
152
  ->json_is('/0/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
153
  ->json_hasnt('/1');
153
  ->json_hasnt('/1');
154
154
155
$t->get_ok( "//$userid:$password@/api/v1/patrons/$patron_id/checkouts")
156
  ->status_is(200)
157
  ->json_is('/0/patron_id' => $patron_id)
158
  ->json_is('/0/item_id' => $item1->itemnumber)
159
  ->json_is('/0/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due1 }) )
160
  ->json_is('/1/patron_id' => $patron_id)
161
  ->json_is('/1/item_id' => $item2->itemnumber)
162
  ->json_is('/1/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
163
  ->json_hasnt('/2');
164
155
$t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id)
165
$t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id)
156
  ->status_is(200)
166
  ->status_is(200)
157
  ->json_is('/patron_id' => $patron_id)
167
  ->json_is('/patron_id' => $patron_id)
158
- 

Return to bug 22613