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

Return to bug 17008