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

(-)a/Koha/REST/V1/Patrons.pm (+2 lines)
Lines 400-405 our $to_api_mapping = { Link Here
400
    debarredcomment     => undef, # calculated, API consumers will use /restrictions instead
400
    debarredcomment     => undef, # calculated, API consumers will use /restrictions instead
401
    emailpro            => 'secondary_email',
401
    emailpro            => 'secondary_email',
402
    flags               => undef, # permissions manipulation handled in /permissions
402
    flags               => undef, # permissions manipulation handled in /permissions
403
    flgAnonymized       => 'anonymized',
403
    gonenoaddress       => 'incorrect_address',
404
    gonenoaddress       => 'incorrect_address',
404
    guarantorid         => 'guarantor_id',
405
    guarantorid         => 'guarantor_id',
405
    lastseen            => 'last_seen',
406
    lastseen            => 'last_seen',
Lines 443-448 our $to_api_mapping = { Link Here
443
444
444
our $to_model_mapping = {
445
our $to_model_mapping = {
445
    altaddress_notes         => 'contactnote',
446
    altaddress_notes         => 'contactnote',
447
    anonymized               => 'flgAnonymized',
446
    category_id              => 'categorycode',
448
    category_id              => 'categorycode',
447
    check_previous_checkout  => 'checkprevcheckout',
449
    check_previous_checkout  => 'checkprevcheckout',
448
    date_enrolled            => 'dateenrolled',
450
    date_enrolled            => 'dateenrolled',
(-)a/Koha/Schema/Result/Borrower.pm (-1 / +2 lines)
Lines 1545-1551 __PACKAGE__->belongs_to( Link Here
1545
);
1545
);
1546
1546
1547
__PACKAGE__->add_columns(
1547
__PACKAGE__->add_columns(
1548
    '+lost' => { is_boolean => 1 },
1548
    '+flgAnonymized' => { is_boolean => 1 },
1549
    '+lost'          => { is_boolean => 1 },
1549
    '+gonenoaddress' => { is_boolean => 1 }
1550
    '+gonenoaddress' => { is_boolean => 1 }
1550
);
1551
);
1551
1552
(-)a/api/v1/swagger/definitions/patron.json (+5 lines)
Lines 272-277 Link Here
272
    "overdrive_auth_token": {
272
    "overdrive_auth_token": {
273
      "type": ["string", "null"],
273
      "type": ["string", "null"],
274
      "description": "persist OverDrive auth token"
274
      "description": "persist OverDrive auth token"
275
    },
276
    "anonymized": {
277
        "type": "boolean",
278
        "readOnly": true,
279
        "description": "If the patron has been anonymized"
275
    }
280
    }
276
  },
281
  },
277
  "additionalProperties": false,
282
  "additionalProperties": false,
(-)a/t/db_dependent/api/v1/patrons.t (-1 / +3 lines)
Lines 143-148 subtest 'add() tests' => sub { Link Here
143
        # delete RO attributes
143
        # delete RO attributes
144
        delete $newpatron->{patron_id};
144
        delete $newpatron->{patron_id};
145
        delete $newpatron->{restricted};
145
        delete $newpatron->{restricted};
146
        delete $newpatron->{anonymized};
146
147
147
        # Create a library just to make sure its ID doesn't exist on the DB
148
        # Create a library just to make sure its ID doesn't exist on the DB
148
        my $library_to_delete = $builder->build_object({ class => 'Koha::Libraries' });
149
        my $library_to_delete = $builder->build_object({ class => 'Koha::Libraries' });
Lines 189-194 subtest 'add() tests' => sub { Link Here
189
        # delete RO attributes
190
        # delete RO attributes
190
        delete $newpatron->{patron_id};
191
        delete $newpatron->{patron_id};
191
        delete $newpatron->{restricted};
192
        delete $newpatron->{restricted};
193
        delete $newpatron->{anonymized};
192
        $patron_to_delete->delete;
194
        $patron_to_delete->delete;
193
195
194
        $tx = $t->ua->build_tx(POST => "/api/v1/patrons" => json => $newpatron);
196
        $tx = $t->ua->build_tx(POST => "/api/v1/patrons" => json => $newpatron);
Lines 235-240 subtest 'update() tests' => sub { Link Here
235
        # delete RO attributes
237
        # delete RO attributes
236
        delete $newpatron->{patron_id};
238
        delete $newpatron->{patron_id};
237
        delete $newpatron->{restricted};
239
        delete $newpatron->{restricted};
240
        delete $newpatron->{anonymized};
238
241
239
        my $tx = $t->ua->build_tx(PUT => "/api/v1/patrons/-1" => json => $newpatron );
242
        my $tx = $t->ua->build_tx(PUT => "/api/v1/patrons/-1" => json => $newpatron );
240
        $tx->req->cookies({name => 'CGISESSID', value => $session_id});
243
        $tx->req->cookies({name => 'CGISESSID', value => $session_id});
241
- 

Return to bug 21336