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 28-34 sub list { Link Here
28
28
29
    my $patrons = Koha::Patrons->search;
29
    my $patrons = Koha::Patrons->search;
30
30
31
    $c->$cb($patrons->unblessed, 200);
31
    $c->$cb($patrons->swaggerize, 200);
32
}
32
}
33
33
34
sub get {
34
sub get {
Lines 41-47 sub get { Link Here
41
        return $c->$cb({error => "Patron not found"}, 404);
41
        return $c->$cb({error => "Patron not found"}, 404);
42
    }
42
    }
43
43
44
    return $c->$cb($patron->unblessed, 200);
44
    return $c->$cb($patron->swaggerize, 200);
45
}
45
}
46
46
47
1;
47
1;
(-)a/api/v1/swagger/definitions/hold.json (+13 lines)
Lines 8-13 Link Here
8
      "$ref": "../x-primitives.json#/borrowernumber"
8
      "$ref": "../x-primitives.json#/borrowernumber"
9
    },
9
    },
10
    "reservedate": {
10
    "reservedate": {
11
      "type": ["string", "null"],
11
      "description": "the date the hold was placed"
12
      "description": "the date the hold was placed"
12
    },
13
    },
13
    "biblionumber": {
14
    "biblionumber": {
Lines 17-58 Link Here
17
      "$ref": "../x-primitives.json#/branchcode"
18
      "$ref": "../x-primitives.json#/branchcode"
18
    },
19
    },
19
    "notificationdate": {
20
    "notificationdate": {
21
      "type": ["string", "null"],
20
      "description": "currently unused"
22
      "description": "currently unused"
21
    },
23
    },
22
    "reminderdate": {
24
    "reminderdate": {
25
      "type": ["string", "null"],
23
      "description": "currently unused"
26
      "description": "currently unused"
24
    },
27
    },
25
    "cancellationdate": {
28
    "cancellationdate": {
29
      "type": ["string", "null"],
26
      "description": "the date the hold was cancelled"
30
      "description": "the date the hold was cancelled"
27
    },
31
    },
28
    "reservenotes": {
32
    "reservenotes": {
33
      "type": ["string", "null"],
29
      "description": "notes related to this hold"
34
      "description": "notes related to this hold"
30
    },
35
    },
31
    "priority": {
36
    "priority": {
37
      "type": ["integer", "null"],
32
      "description": "where in the queue the patron sits"
38
      "description": "where in the queue the patron sits"
33
    },
39
    },
34
    "found": {
40
    "found": {
41
      "type": ["string", "null"],
35
      "description": "a one letter code defining what the status of the hold is after it has been confirmed"
42
      "description": "a one letter code defining what the status of the hold is after it has been confirmed"
36
    },
43
    },
37
    "timestamp": {
44
    "timestamp": {
45
      "type": "string",
38
      "description": "date and time the hold was last updated"
46
      "description": "date and time the hold was last updated"
39
    },
47
    },
40
    "itemnumber": {
48
    "itemnumber": {
41
      "$ref": "../x-primitives.json#/itemnumber"
49
      "$ref": "../x-primitives.json#/itemnumber"
42
    },
50
    },
43
    "waitingdate": {
51
    "waitingdate": {
52
      "type": ["string", "null"],
44
      "description": "the date the item was marked as waiting for the patron at the library"
53
      "description": "the date the item was marked as waiting for the patron at the library"
45
    },
54
    },
46
    "expirationdate": {
55
    "expirationdate": {
56
      "type": ["string", "null"],
47
      "description": "the date the hold expires"
57
      "description": "the date the hold expires"
48
    },
58
    },
49
    "lowestPriority": {
59
    "lowestPriority": {
60
      "type": "integer",
50
      "description": ""
61
      "description": ""
51
    },
62
    },
52
    "suspend": {
63
    "suspend": {
64
      "type": "integer",
53
      "description": ""
65
      "description": ""
54
    },
66
    },
55
    "suspend_until": {
67
    "suspend_until": {
68
      "type": ["string", "null"],
56
      "description": ""
69
      "description": ""
57
    },
70
    },
58
    "itemtype": {
71
    "itemtype": {
(-)a/api/v1/swagger/definitions/patron.json (-7 / +11 lines)
Lines 139-149 Link Here
139
      "description": "date the patron's card is set to expire"
139
      "description": "date the patron's card is set to expire"
140
    },
140
    },
141
    "gonenoaddress": {
141
    "gonenoaddress": {
142
      "type": ["string", "null"],
142
      "type": ["integer", "null"],
143
      "description": "set to 1 if library marked this patron as having an unconfirmed address"
143
      "description": "set to 1 if library marked this patron as having an unconfirmed address"
144
    },
144
    },
145
    "lost": {
145
    "lost": {
146
      "type": ["string", "null"],
146
      "type": ["integer", "null"],
147
      "description": "set to 1 if library marked this patron as having lost his card"
147
      "description": "set to 1 if library marked this patron as having lost his card"
148
    },
148
    },
149
    "debarred": {
149
    "debarred": {
Lines 167-173 Link Here
167
      "description": "used for children to include title of guarantor"
167
      "description": "used for children to include title of guarantor"
168
    },
168
    },
169
    "guarantorid": {
169
    "guarantorid": {
170
      "type": ["string", "null"],
170
      "type": ["integer", "null"],
171
      "description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
171
      "description": "borrowernumber used for children or professionals to link them to guarantor or organizations"
172
    },
172
    },
173
    "borrowernotes": {
173
    "borrowernotes": {
Lines 187-193 Link Here
187
      "description": "patron's encrypted password"
187
      "description": "patron's encrypted password"
188
    },
188
    },
189
    "flags": {
189
    "flags": {
190
      "type": ["string", "null"],
190
      "type": ["integer", "null"],
191
      "description": "a number associated with the patron's permissions"
191
      "description": "a number associated with the patron's permissions"
192
    },
192
    },
193
    "userid": {
193
    "userid": {
Lines 251-265 Link Here
251
      "description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
251
      "description": "the mobile phone number where the patron would like to receive notices (if SMS turned on)"
252
    },
252
    },
253
    "sms_provider_id": {
253
    "sms_provider_id": {
254
      "type": ["string", "null"],
254
      "type": ["integer", "null"],
255
      "description": "the provider of the mobile phone number defined in smsalertnumber"
255
      "description": "the provider of the mobile phone number defined in smsalertnumber"
256
    },
256
    },
257
    "privacy": {
257
    "privacy": {
258
      "type": "string",
258
      "type": "integer",
259
      "description": "patron's privacy settings related to their reading history"
259
      "description": "patron's privacy settings related to their reading history"
260
    },
260
    },
261
    "privacy_guarantor_checkouts": {
261
    "privacy_guarantor_checkouts": {
262
      "type": "string",
262
      "type": "integer",
263
      "description": "controls if relatives can see this patron's checkouts"
263
      "description": "controls if relatives can see this patron's checkouts"
264
    },
264
    },
265
    "checkprevcheckout": {
265
    "checkprevcheckout": {
Lines 269-274 Link Here
269
    "updated_on": {
269
    "updated_on": {
270
      "type": "string",
270
      "type": "string",
271
      "description": "time of last change could be useful for synchronization with external systems (among others)"
271
      "description": "time of last change could be useful for synchronization with external systems (among others)"
272
    },
273
    "lastseen": {
274
      "type": ["string", "null"],
275
      "description": "last time a patron has been seed (connected at the OPAC or staff interface)"
272
    }
276
    }
273
  }
277
  }
274
}
278
}
(-)a/api/v1/swagger/x-primitives.json (-4 / +4 lines)
Lines 1-10 Link Here
1
{
1
{
2
  "biblionumber": {
2
  "biblionumber": {
3
    "type": "string",
3
    "type": "integer",
4
    "description": "internally assigned biblio identifier"
4
    "description": "internally assigned biblio identifier"
5
  },
5
  },
6
  "borrowernumber": {
6
  "borrowernumber": {
7
    "type": "string",
7
    "type": "integer",
8
    "description": "internally assigned user identifier"
8
    "description": "internally assigned user identifier"
9
  },
9
  },
10
  "branchcode": {
10
  "branchcode": {
Lines 24-30 Link Here
24
    "description": "patron's first name"
24
    "description": "patron's first name"
25
  },
25
  },
26
  "itemnumber": {
26
  "itemnumber": {
27
    "type": ["string", "null"],
27
    "type": ["integer", "null"],
28
    "description": "internally assigned item identifier"
28
    "description": "internally assigned item identifier"
29
  },
29
  },
30
  "phone": {
30
  "phone": {
Lines 32-37 Link Here
32
    "description": "primary phone number for patron's primary address"
32
    "description": "primary phone number for patron's primary address"
33
  },
33
  },
34
  "reserve_id": {
34
  "reserve_id": {
35
    "type": "integer",
35
    "description": "Internal hold identifier"
36
    "description": "Internal hold identifier"
36
  },
37
  },
37
  "surname": {
38
  "surname": {
38
- 

Return to bug 17008