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

(-)a/Koha/Checkout.pm (-1 / +24 lines)
Lines 88-94 sub patron { Link Here
88
    return Koha::Patron->_new_from_dbic( $patron_rs );
88
    return Koha::Patron->_new_from_dbic( $patron_rs );
89
}
89
}
90
90
91
=head3 type
91
=head3 to_api_mapping
92
93
This method returns the mapping for representing a Koha::Checkout object
94
on the API.
95
96
=cut
97
98
sub to_api_mapping {
99
    return {
100
        issue_id        => 'checkout_id',
101
        borrowernumber  => 'patron_id',
102
        itemnumber      => 'item_id',
103
        date_due        => 'due_date',
104
        branchcode      => 'library_id',
105
        returndate      => 'checkin_date',
106
        lastreneweddate => 'last_renewed_date',
107
        issuedate       => 'checkout_date',
108
        notedate        => 'note_date',
109
    };
110
}
111
112
=head2 Internal methods
113
114
=head3 _type
92
115
93
=cut
116
=cut
94
117
(-)a/Koha/REST/V1/Checkouts.pm (-5 / +4 lines)
Lines 92-99 sub get { Link Here
92
    }
92
    }
93
93
94
    return $c->render(
94
    return $c->render(
95
        status => 200,
95
        status  => 200,
96
        openapi => _to_api($checkout->TO_JSON)
96
        openapi => $checkout->to_api
97
    );
97
    );
98
}
98
}
99
99
Lines 134-141 sub renew { Link Here
134
134
135
    $c->res->headers->location( $c->req->url->to_string );
135
    $c->res->headers->location( $c->req->url->to_string );
136
    return $c->render(
136
    return $c->render(
137
        status => 201,
137
        status  => 201,
138
        openapi => _to_api( $checkout->TO_JSON )
138
        openapi => $checkout->to_api
139
    );
139
    );
140
}
140
}
141
141
142
- 

Return to bug 23843