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

(-)a/api/v1/swagger/paths.json (+4 lines)
Lines 56-61 Link Here
56
  "/patrons/{patron_id}/account/credits": {
56
  "/patrons/{patron_id}/account/credits": {
57
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
57
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
58
  },
58
  },
59
  "/patrons/{patron_id}/checkouts": {
60
    "$ref": "paths/checkouts.json#/~1patrons~1{patron_id}~1checkouts"
61
  },
62
59
  "/patrons/{patron_id}/password": {
63
  "/patrons/{patron_id}/password": {
60
    "$ref": "paths/patrons_password.json#/~1patrons~1{patron_id}~1password"
64
    "$ref": "paths/patrons_password.json#/~1patrons~1{patron_id}~1password"
61
  },
65
  },
(-)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 => 73;
20
use Test::More tests => 82;
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 130-135 $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$patron_id") Link Here
130
  ->json_is('/1/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
130
  ->json_is('/1/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
131
  ->json_hasnt('/2');
131
  ->json_hasnt('/2');
132
132
133
$t->get_ok( "//$userid:$password@/api/v1/patrons/$patron_id/checkouts")
134
  ->status_is(200)
135
  ->json_is('/0/patron_id' => $patron_id)
136
  ->json_is('/0/item_id' => $item1->itemnumber)
137
  ->json_is('/0/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due1 }) )
138
  ->json_is('/1/patron_id' => $patron_id)
139
  ->json_is('/1/item_id' => $item2->itemnumber)
140
  ->json_is('/1/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due2 }) )
141
  ->json_hasnt('/2');
142
133
$t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id)
143
$t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id)
134
  ->status_is(200)
144
  ->status_is(200)
135
  ->json_is('/patron_id' => $patron_id)
145
  ->json_is('/patron_id' => $patron_id)
136
- 

Return to bug 22613