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

(-)a/Koha/REST/V1/Hold.pm (-6 / +6 lines)
Lines 34-42 sub list { Link Here
34
    foreach my $key (keys %$params) {
34
    foreach my $key (keys %$params) {
35
        delete $params->{$key} unless grep { $key eq $_ } @valid_params;
35
        delete $params->{$key} unless grep { $key eq $_ } @valid_params;
36
    }
36
    }
37
    my $holds = Koha::Holds->search($params)->unblessed;
37
    my $holds = Koha::Holds->search($params);
38
38
39
    return $c->$cb($holds, 200);
39
    return $c->$cb($holds->swaggerize, 200);
40
}
40
}
41
41
42
sub add {
42
sub add {
Lines 106-114 sub add { Link Here
106
        }, 500);
106
        }, 500);
107
    }
107
    }
108
108
109
    my $reserve = C4::Reserves::GetReserve($reserve_id);
109
    my $reserve = Koha::Holds->find($reserve_id);
110
110
111
    return $c->$cb($reserve, 201);
111
    return $c->$cb($reserve->swaggerize, 201);
112
}
112
}
113
113
114
sub edit {
114
sub edit {
Lines 138-146 sub edit { Link Here
138
        suspend_until => $suspend_until,
138
        suspend_until => $suspend_until,
139
    };
139
    };
140
    C4::Reserves::ModReserve($params);
140
    C4::Reserves::ModReserve($params);
141
    $reserve = C4::Reserves::GetReserve($reserve_id);
141
    $reserve = Koha::Holds->find($reserve_id);
142
142
143
    return $c->$cb($reserve, 200);
143
    return $c->$cb($reserve->swaggerize, 200);
144
}
144
}
145
145
146
sub delete {
146
sub delete {
(-)a/Koha/REST/V1/Patron.pm (-2 / +2 lines)
Lines 32-38 sub list { Link Here
32
32
33
    my $patrons = Koha::Patrons->search;
33
    my $patrons = Koha::Patrons->search;
34
34
35
    $c->$cb($patrons->unblessed, 200);
35
    $c->$cb($patrons->swaggerize, 200);
36
}
36
}
37
37
38
sub get {
38
sub get {
Lines 52-58 sub get { Link Here
52
        return $c->$cb({error => "Patron not found"}, 404);
52
        return $c->$cb({error => "Patron not found"}, 404);
53
    }
53
    }
54
54
55
    return $c->$cb($patron->unblessed, 200);
55
    return $c->$cb($patron->swaggerize, 200);
56
}
56
}
57
57
58
1;
58
1;
(-)a/api/v1/definitions/hold.json (-3 / +17 lines)
Lines 2-18 Link Here
2
    "type": "object",
2
    "type": "object",
3
    "properties": {
3
    "properties": {
4
        "reserve_id": {
4
        "reserve_id": {
5
            "type": "integer",
5
            "description": "Internal hold identifier"
6
            "description": "Internal hold identifier"
6
        },
7
        },
7
        "borrowernumber": {
8
        "borrowernumber": {
8
            "type": "string",
9
            "type": "integer",
9
            "description": "internally assigned user identifier"
10
            "description": "internally assigned user identifier"
10
        },
11
        },
11
        "reservedate": {
12
        "reservedate": {
13
            "type": ["string", "null"],
12
            "description": "the date the hold was placed"
14
            "description": "the date the hold was placed"
13
        },
15
        },
14
        "biblionumber": {
16
        "biblionumber": {
15
            "type": "string",
17
            "type": "integer",
16
            "description": "internally assigned biblio identifier"
18
            "description": "internally assigned biblio identifier"
17
        },
19
        },
18
        "branchcode": {
20
        "branchcode": {
Lines 20-62 Link Here
20
            "description": "internally assigned branch identifier"
22
            "description": "internally assigned branch identifier"
21
        },
23
        },
22
        "notificationdate": {
24
        "notificationdate": {
25
            "type": ["string", "null"],
23
            "description": "currently unused"
26
            "description": "currently unused"
24
        },
27
        },
25
        "reminderdate": {
28
        "reminderdate": {
29
            "type": ["string", "null"],
26
            "description": "currently unused"
30
            "description": "currently unused"
27
        },
31
        },
28
        "cancellationdate": {
32
        "cancellationdate": {
33
            "type": ["string", "null"],
29
            "description": "the date the hold was cancelled"
34
            "description": "the date the hold was cancelled"
30
        },
35
        },
31
        "reservenotes": {
36
        "reservenotes": {
37
            "type": ["string", "null"],
32
            "description": "notes related to this hold"
38
            "description": "notes related to this hold"
33
        },
39
        },
34
        "priority": {
40
        "priority": {
41
            "type": ["integer", "null"],
35
            "description": "where in the queue the patron sits"
42
            "description": "where in the queue the patron sits"
36
        },
43
        },
37
        "found": {
44
        "found": {
45
            "type": ["string", "null"],
38
            "description": "a one letter code defining what the status of the hold is after it has been confirmed"
46
            "description": "a one letter code defining what the status of the hold is after it has been confirmed"
39
        },
47
        },
40
        "timestamp": {
48
        "timestamp": {
49
            "type": "string",
41
            "description": "date and time the hold was last updated"
50
            "description": "date and time the hold was last updated"
42
        },
51
        },
43
        "itemnumber": {
52
        "itemnumber": {
44
            "type": ["string", "null"],
53
            "type": ["integer", "null"],
45
            "description": "internally assigned item identifier"
54
            "description": "internally assigned item identifier"
46
        },
55
        },
47
        "waitingdate": {
56
        "waitingdate": {
57
            "type": ["string", "null"],
48
            "description": "the date the item was marked as waiting for the patron at the library"
58
            "description": "the date the item was marked as waiting for the patron at the library"
49
        },
59
        },
50
        "expirationdate": {
60
        "expirationdate": {
61
            "type": ["string", "null"],
51
            "description": "the date the hold expires"
62
            "description": "the date the hold expires"
52
        },
63
        },
53
        "lowestPriority": {
64
        "lowestPriority": {
65
            "type": "integer",
54
            "description": ""
66
            "description": ""
55
        },
67
        },
56
        "suspend": {
68
        "suspend": {
69
            "type": "integer",
57
            "description": ""
70
            "description": ""
58
        },
71
        },
59
        "suspend_until": {
72
        "suspend_until": {
73
            "type": ["string", "null"],
60
            "description": ""
74
            "description": ""
61
        },
75
        },
62
        "itemtype": {
76
        "itemtype": {
(-)a/api/v1/definitions/patron.json (-9 / +8 lines)
Lines 2-8 Link Here
2
      "type": "object",
2
      "type": "object",
3
      "properties": {
3
      "properties": {
4
        "borrowernumber": {
4
        "borrowernumber": {
5
          "type": "string",
5
          "type": "integer",
6
          "description": "internally assigned user identifier"
6
          "description": "internally assigned user identifier"
7
        },
7
        },
8
        "cardnumber": {
8
        "cardnumber": {
Lines 146-156 Link Here
146
          "description": "date the patron's card is set to expire"
146
          "description": "date the patron's card is set to expire"
147
        },
147
        },
148
        "gonenoaddress": {
148
        "gonenoaddress": {
149
          "type": ["string", "null"],
149
          "type": ["integer", "null"],
150
          "description": "set to 1 if library marked this patron as having an unconfirmed address"
150
          "description": "set to 1 if library marked this patron as having an unconfirmed address"
151
        },
151
        },
152
        "lost": {
152
        "lost": {
153
          "type": ["string", "null"],
153
          "type": ["integer", "null"],
154
          "description": "set to 1 if library marked this patron as having lost his card"
154
          "description": "set to 1 if library marked this patron as having lost his card"
155
        },
155
        },
156
        "debarred": {
156
        "debarred": {
Lines 174-180 Link Here
174
          "description": "used for children to include title of guarantor"
174
          "description": "used for children to include title of guarantor"
175
        },
175
        },
176
        "guarantorid": {
176
        "guarantorid": {
177
          "type": ["string", "null"],
177
          "type": ["integer", "null"],
178
          "description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
178
          "description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
179
        },
179
        },
180
        "borrowernotes": {
180
        "borrowernotes": {
Lines 194-200 Link Here
194
          "description": "patron's encrypted password"
194
          "description": "patron's encrypted password"
195
        },
195
        },
196
        "flags": {
196
        "flags": {
197
          "type": ["string", "null"],
197
          "type": ["integer", "null"],
198
          "description": "a number associated with the patron's permissions"
198
          "description": "a number associated with the patron's permissions"
199
        },
199
        },
200
        "userid": {
200
        "userid": {
Lines 258-272 Link Here
258
          "description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
258
          "description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
259
        },
259
        },
260
        "sms_provider_id": {
260
        "sms_provider_id": {
261
          "type": ["string", "null"],
261
          "type": ["integer", "null"],
262
          "description": "the provider of the mobile phone number defined in smsalertnumber"
262
          "description": "the provider of the mobile phone number defined in smsalertnumber"
263
        },
263
        },
264
        "privacy": {
264
        "privacy": {
265
          "type": "string",
265
          "type": "integer",
266
          "description": "patron's privacy settings related to their reading history"
266
          "description": "patron's privacy settings related to their reading history"
267
        },
267
        },
268
        "privacy_guarantor_checkouts": {
268
        "privacy_guarantor_checkouts": {
269
          "type": "string",
269
          "type": "integer",
270
          "description": "controls if relatives can see this patron's checkouts"
270
          "description": "controls if relatives can see this patron's checkouts"
271
        },
271
        },
272
        "checkprevcheckout": {
272
        "checkprevcheckout": {
273
- 

Return to bug 17008