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

(-)a/api/v1/swagger/definitions/hold.json (-2 / +2 lines)
Lines 11-17 Link Here
11
    },
11
    },
12
    "hold_date": {
12
    "hold_date": {
13
      "type": ["string", "null"],
13
      "type": ["string", "null"],
14
      "format": "date",
14
      "format": "date-time",
15
      "description": "The date the hold was placed"
15
      "description": "The date the hold was placed"
16
    },
16
    },
17
    "biblio_id": {
17
    "biblio_id": {
Lines 55-61 Link Here
55
    },
55
    },
56
    "expiration_date": {
56
    "expiration_date": {
57
      "type": ["string", "null"],
57
      "type": ["string", "null"],
58
      "format": "date",
58
      "format": "date-time",
59
      "description": "The date the hold expires"
59
      "description": "The date the hold expires"
60
    },
60
    },
61
    "lowest_priority": {
61
    "lowest_priority": {
(-)a/api/v1/swagger/paths/holds.json (-1 / +1 lines)
Lines 198-204 Link Here
198
              "expiration_date": {
198
              "expiration_date": {
199
                "description": "Hold end date",
199
                "description": "Hold end date",
200
                "type": ["string", "null"],
200
                "type": ["string", "null"],
201
                "format": "date"
201
                "format": "date-time"
202
              },
202
              },
203
              "notes": {
203
              "notes": {
204
                "description": "Notes related to this hold",
204
                "description": "Notes related to this hold",
(-)a/t/db_dependent/api/v1/holds.t (-8 / +7 lines)
Lines 157-163 my $post_data = { Link Here
157
    biblio_id => int($biblio_1->biblionumber),
157
    biblio_id => int($biblio_1->biblionumber),
158
    item_id => int($item_1->itemnumber),
158
    item_id => int($item_1->itemnumber),
159
    pickup_library_id => $branchcode,
159
    pickup_library_id => $branchcode,
160
    expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 }),
160
    expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339' }),
161
    priority => 2,
161
    priority => 2,
162
};
162
};
163
my $put_data = {
163
my $put_data = {
Lines 273-279 subtest "Test endpoints with permission" => sub { Link Here
273
    $t->get_ok( "//$userid_1:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber )
273
    $t->get_ok( "//$userid_1:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber )
274
      ->status_is(200)
274
      ->status_is(200)
275
      ->json_is('/0/hold_id', $reserve_id)
275
      ->json_is('/0/hold_id', $reserve_id)
276
      ->json_is('/0/expiration_date', output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 }))
276
      ->json_is('/0/expiration_date', output_pref({ dt => $expiration_date, dateformat => 'rfc3339' }))
277
      ->json_is('/0/pickup_library_id', $branchcode);
277
      ->json_is('/0/pickup_library_id', $branchcode);
278
278
279
    $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data )
279
    $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data )
Lines 342-349 subtest 'test AllowHoldDateInFuture' => sub { Link Here
342
        biblio_id => int($biblio_1->biblionumber),
342
        biblio_id => int($biblio_1->biblionumber),
343
        item_id => int($item_1->itemnumber),
343
        item_id => int($item_1->itemnumber),
344
        pickup_library_id => $branchcode,
344
        pickup_library_id => $branchcode,
345
        expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339', dateonly => 1 }),
345
        expiration_date => output_pref({ dt => $expiration_date, dateformat => 'rfc3339' }),
346
        hold_date => output_pref({ dt => $future_hold_date, dateformat => 'rfc3339', dateonly => 1 }),
346
        hold_date => output_pref({ dt => $future_hold_date, dateformat => 'rfc3339' }),
347
        priority => 2,
347
        priority => 2,
348
    };
348
    };
349
349
Lines 357-363 subtest 'test AllowHoldDateInFuture' => sub { Link Here
357
357
358
    $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data )
358
    $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data )
359
      ->status_is(201)
359
      ->status_is(201)
360
      ->json_is('/hold_date', output_pref({ dt => $future_hold_date, dateformat => 'rfc3339', dateonly => 1 }));
360
      ->json_is('/hold_date', output_pref({ dt => $future_hold_date, dateformat => 'rfc3339' }));
361
};
361
};
362
362
363
subtest 'test AllowHoldPolicyOverride' => sub {
363
subtest 'test AllowHoldPolicyOverride' => sub {
Lines 425-431 subtest 'suspend and resume tests' => sub { Link Here
425
    my $end_date = output_pref({
425
    my $end_date = output_pref({
426
      dt         => dt_from_string( undef ),
426
      dt         => dt_from_string( undef ),
427
      dateformat => 'rfc3339',
427
      dateformat => 'rfc3339',
428
      dateonly   => 1
428
      dateonly => 1
429
    });
429
    });
430
430
431
    $t->post_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" => json => { end_date => $end_date } );
431
    $t->post_ok( "//$userid:$password@/api/v1/holds/" . $hold->id . "/suspension" => json => { end_date => $end_date } );
Lines 438-444 subtest 'suspend and resume tests' => sub { Link Here
438
      output_pref({
438
      output_pref({
439
        dt         => dt_from_string( $hold->suspend_until ),
439
        dt         => dt_from_string( $hold->suspend_until ),
440
        dateformat => 'rfc3339',
440
        dateformat => 'rfc3339',
441
        dateonly   => 1
441
        dateonly => 1
442
      }),
442
      }),
443
      'Hold suspension has correct end date'
443
      'Hold suspension has correct end date'
444
    );
444
    );
445
- 

Return to bug 24718