Bug 37639 - items.stack ( shelving control number ) not included in items API endpoint
Summary: items.stack ( shelving control number ) not included in items API endpoint
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 37637
  Show dependency treegraph
 
Reported: 2024-08-13 21:00 UTC by Lucas Gass
Modified: 2024-08-27 20:01 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37639: Add items.stack to items endpoint (1.54 KB, patch)
2024-08-13 21:03 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37639: Add items.stack to items endpoint (1.56 KB, patch)
2024-08-14 19:24 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37639: (follow-up) Remove stack from API mapping (923 bytes, patch)
2024-08-14 19:25 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37639: Add items.stack to items endpoint (1.62 KB, patch)
2024-08-15 16:14 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37639: (follow-up) Remove stack from API mapping (983 bytes, patch)
2024-08-15 16:14 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37639: Add unit tests (6.41 KB, patch)
2024-08-16 16:01 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 37639: Map items.stack as shelving_control_number in API (1.37 KB, patch)
2024-08-27 20:01 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2024-08-13 21:00:53 UTC
items.stack is not included at /api/v1/items/

I think it should be
Comment 1 Lucas Gass 2024-08-13 21:03:44 UTC
Created attachment 170299 [details] [review]
Bug 37639: Add items.stack to items endpoint

To test:
1. Apply patch and restart_all
2. Check the items endpoint for items.stack ( http://localhost:8081/api/v1/items/144 )
3. The data is there, and correct.
Comment 2 Lucas Gass 2024-08-14 19:24:00 UTC
Created attachment 170328 [details] [review]
Bug 37639: Add items.stack to items endpoint

To test:
1. Apply patch and restart_all, and yarn api:bundle
2. Check the items endpoint for items.stack ( http://localhost:8081/api/v1/items/144 )
3. The data is there, and correct.
Comment 3 Lucas Gass 2024-08-14 19:25:45 UTC
Created attachment 170329 [details] [review]
Bug 37639: (follow-up) Remove stack from API mapping

Shouldn't need to define stack in to_api_mapping because the name isn't changing.
Comment 4 Paul Derscheid 2024-08-15 16:14:35 UTC
Created attachment 170396 [details] [review]
Bug 37639: Add items.stack to items endpoint

To test:
1. Apply patch and restart_all, and yarn api:bundle
2. Check the items endpoint for items.stack ( http://localhost:8081/api/v1/items/144 )
3. The data is there, and correct.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 5 Paul Derscheid 2024-08-15 16:14:37 UTC
Created attachment 170397 [details] [review]
Bug 37639: (follow-up) Remove stack from API mapping

Shouldn't need to define stack in to_api_mapping because the name isn't changing.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 6 Paul Derscheid 2024-08-15 16:16:11 UTC
Why is items.stack the only column in items that doesn't have a comment in kohastructure.pl?
Comment 7 Lucas Gass 2024-08-15 17:52:24 UTC
(In reply to Paul Derscheid from comment #6)
> Why is items.stack the only column in items that doesn't have a comment in
> kohastructure.pl?

It's a good question. There should be more info. on what it is. I had to ask around to find out.

It is also one of the only ones without POD in Koha/Schema/Result/Item.pm
Comment 8 Lucas Gass 2024-08-15 19:14:32 UTC
(In reply to Paul Derscheid from comment #6)
> Why is items.stack the only column in items that doesn't have a comment in
> kohastructure.pl?

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37653
Comment 9 Marcel de Rooy 2024-08-16 06:26:29 UTC
Just feeling that it would be better to list it (skip 2nd patch).
Also note:
        withdrawn                => 'withdrawn',
        timestamp                => 'timestamp',
        location                 => 'location',
        uri                      => 'uri',

Is it possible to add a tiny test to prove the result of this change?
Comment 10 Lucas Gass 2024-08-16 16:01:23 UTC
Created attachment 170458 [details] [review]
Bug 37639: Add unit tests
Comment 11 Lucas Gass 2024-08-16 16:03:26 UTC
> Is it possible to add a tiny test to prove the result of this change?

I don't know how to write a test for my change only, so I added some for all the to_api_mappiings in Item.pm
Comment 12 Martin Renvoize 2024-08-21 08:30:59 UTC
OK.. we add it to the mapping... As people are confused about 'stack'.. should we not actually map it to something more meaningful for the API field?

control_number perhaps?
Comment 13 Katrin Fischer 2024-08-21 13:22:12 UTC
(In reply to Martin Renvoize from comment #12)
> OK.. we add it to the mapping... As people are confused about 'stack'..
> should we not actually map it to something more meaningful for the API field?
> 
> control_number perhaps?

I think control_number might also be a bit difficult as it reminds of the MARC 001 label. shelving_control_number maybe?
Comment 14 Lucas Gass 2024-08-23 15:51:22 UTC
(In reply to Katrin Fischer from comment #13)
> (In reply to Martin Renvoize from comment #12)
> > OK.. we add it to the mapping... As people are confused about 'stack'..
> > should we not actually map it to something more meaningful for the API field?
> > 
> > control_number perhaps?
> 
> I think control_number might also be a bit difficult as it reminds of the
> MARC 001 label. shelving_control_number maybe?

I'm happy to change the patch. Is 'shelving_control_number' agreed upon?
Comment 15 Katrin Fischer 2024-08-23 15:54:45 UTC
I think Martin is not around for a few days. If you agree, maybe move on with it.
Comment 16 Paul Derscheid 2024-08-23 15:58:36 UTC
Sorry, but what exactly is this referring to?
Comment 17 Katrin Fischer 2024-08-23 15:59:57 UTC
Exposing items.stacks as shelving_control_number in the API (I believe).
Comment 18 Paul Derscheid 2024-08-23 16:03:53 UTC
Alright, I also think shelving_control_number sounds reasonable.
Comment 19 Martin Renvoize 2024-08-23 16:06:42 UTC
Sounds great to me.. it's a tiny ask but I think that would poke it into PQA for me ﷐[U+1F600]﷑
Comment 20 Lucas Gass 2024-08-27 20:01:30 UTC
Created attachment 170782 [details] [review]
Bug 37639: Map items.stack as shelving_control_number in API