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

(-)a/api/v1/swagger/definitions/patron.yaml (+5 lines)
Lines 383-388 properties: Link Here
383
    type:
383
    type:
384
      - boolean
384
      - boolean
385
    description: Protected status of the patron
385
    description: Protected status of the patron
386
  effective_name:
387
    type:
388
      - string
389
      - "null"
390
    description: The effective name to use based on configuration (x-koha-embed)
386
  _strings:
391
  _strings:
387
    type:
392
    type:
388
      - object
393
      - object
(-)a/api/v1/swagger/paths/patrons.yaml (+2 lines)
Lines 364-369 Link Here
364
        items:
364
        items:
365
          type: string
365
          type: string
366
          enum:
366
          enum:
367
            - effective_name
367
            - extended_attributes
368
            - extended_attributes
368
            - checkouts+count
369
            - checkouts+count
369
            - overdues+count
370
            - overdues+count
Lines 496-501 Link Here
496
          type: string
497
          type: string
497
          enum:
498
          enum:
498
            - +strings
499
            - +strings
500
            - effective_name
499
            - extended_attributes
501
            - extended_attributes
500
        collectionFormat: csv
502
        collectionFormat: csv
501
    produces:
503
    produces:
(-)a/t/db_dependent/api/v1/patrons.t (-3 / +22 lines)
Lines 81-87 subtest 'list() tests' => sub { Link Here
81
81
82
    subtest 'librarian access tests' => sub {
82
    subtest 'librarian access tests' => sub {
83
83
84
        plan tests => 21;
84
        plan tests => 22;
85
85
86
        $schema->storage->txn_begin;
86
        $schema->storage->txn_begin;
87
87
Lines 151-156 subtest 'list() tests' => sub { Link Here
151
              { 'x-koha-embed' => 'extended_attributes' } )
151
              { 'x-koha-embed' => 'extended_attributes' } )
152
          ->status_is( 200, "Works, doesn't explode" );
152
          ->status_is( 200, "Works, doesn't explode" );
153
153
154
        subtest "embedding 'effective_name'" => sub {
155
156
            plan tests => 3;
157
158
            $t->get_ok( "//$userid:$password@/api/v1/patrons?"
159
                    . 'q={"patron_id":"'
160
                    . $patron->id
161
                    . '"}' => { 'x-koha-embed' => 'effective_name' } )->status_is(200)
162
                ->json_is( '/0/effective_name' => $patron->effective_name );
163
        };
164
154
        subtest 'searching date and date-time fields' => sub {
165
        subtest 'searching date and date-time fields' => sub {
155
166
156
            plan tests => 12;
167
            plan tests => 12;
Lines 264-270 subtest 'get() tests' => sub { Link Here
264
    $schema->storage->txn_rollback;
275
    $schema->storage->txn_rollback;
265
276
266
    subtest 'librarian access tests' => sub {
277
    subtest 'librarian access tests' => sub {
267
        plan tests => 8;
278
279
        plan tests => 9;
268
280
269
        $schema->storage->txn_begin;
281
        $schema->storage->txn_begin;
270
282
Lines 314-319 subtest 'get() tests' => sub { Link Here
314
          ->json_is('/surname'          => $patron->surname)
326
          ->json_is('/surname'          => $patron->surname)
315
          ->json_is('/patron_card_lost' => Mojo::JSON->false );
327
          ->json_is('/patron_card_lost' => Mojo::JSON->false );
316
328
329
        subtest "embedding 'effective_name'" => sub {
330
331
            plan tests => 3;
332
333
            $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id => { 'x-koha-embed' => 'effective_name' } )
334
                ->status_is(200)->json_is( '/effective_name' => $patron->effective_name );
335
        };
336
317
        $schema->storage->txn_rollback;
337
        $schema->storage->txn_rollback;
318
    };
338
    };
319
339
320
- 

Return to bug 28633