This patch makes the route set the 'updated_by' attribute as well, when
resolving a return claim through the API.
Tests are added for this behavior.
To test:
1. Apply this patch
2. Run:
$ kshell
k$ prove t/db_dependent/api/v1/return_claims.t
=> SUCCESS: Tests pass! updated_by is set correctly!
3. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
resolution => $resolution,
resolved_by => $resolved_by,
resolved_on => \'NOW()',
+ updated_by => $resolved_by,
}
)->store;
$claim->discard_changes;
subtest 'resolve_claim() tests' => sub {
- plan tests => 8;
+ plan tests => 9;
$schema->storage->txn_begin;
my $claim_id = $claim->id;
- $claim->created_by(undef)->store; # resolve the claim must work even if the created_by patron has been removed
+ $claim->set(
+ {
+ created_by => undef,
+ updated_by => undef,
+ }
+ )->store; # resolve the claim must work even if the created_by patron has been removed
# Resolve a claim
$t->put_ok(
$claim->discard_changes;
is( $claim->resolution, "FOUNDINLIB" );
is( $claim->resolved_by, $librarian->id );
+ is( $claim->updated_by, $librarian->id );
ok( $claim->resolved_on );
# Make sure the claim doesn't exist on the DB anymore