Bug 18120

Summary: CRUD endpoint for vendors
Product: Koha Reporter: Matthias Meusburger <matthias.meusburger>
Component: REST APIAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact:
Severity: new feature    
Priority: P5 - low CC: brendan, fridolin.somers, jonathan.druart, katrin.fischer, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18137, 19130    
Bug Blocks:    
Attachments: Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: (followup) Make operationId unique
Bug 18120: (followup) Make operationId unique
Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: (followup) Make operationId unique
Bug 18120 - Changes to some field descriptions
Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: REST api | /acquisitions/vendors unit tests
Bug 18120: REST api | Add a 'vendors' endpoint
Bug 18120: Update field descriptions
Bug 18120: (QA followup) 'vendors_manage' permission fits better than full acq
Bug 18120: /acquisitions/vendors unit tests
Bug 18120: Add '/acquisitions/vendors' endpoint
Bug 18120: Update field descriptions
Bug 18120: (QA followup) 'vendors_manage' permission fits better than full acq
Bug 18120: (QA followup) Add POD to controler class
Bug 18120: Tidy up

Description Matthias Meusburger 2017-02-15 07:57:35 UTC
Add an endpoint for handling vendors.
Comment 1 Tomás Cohen Arazi 2017-03-06 19:44:53 UTC
Created attachment 60851 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions
Comment 2 Tomás Cohen Arazi 2017-03-06 19:44:59 UTC
Created attachment 60852 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions
Comment 3 Tomás Cohen Arazi 2017-03-16 17:29:32 UTC
Created attachment 61182 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions
Comment 4 Tomás Cohen Arazi 2017-03-16 17:29:38 UTC
Created attachment 61183 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions
Comment 5 Tomás Cohen Arazi 2017-03-23 18:52:55 UTC
Created attachment 61587 [details] [review]
Bug 18120: (followup) Make operationId unique
Comment 6 Matthias Meusburger 2017-05-04 14:27:17 UTC
The last patch "Bug 18120: (followup) Make operationId unique" breaks the tests.

Without the last patch, I've tested the endpoint and ran the tests successfully.
Comment 7 Tomás Cohen Arazi 2017-05-04 18:07:16 UTC
Created attachment 63146 [details] [review]
Bug 18120: (followup) Make operationId unique

This patch renames the method names, and the operationID on the swagger spec
so they are unique.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Matthias Meusburger 2017-05-05 12:12:04 UTC
Created attachment 63163 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 9 Matthias Meusburger 2017-05-05 12:12:28 UTC
Created attachment 63164 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 10 Matthias Meusburger 2017-05-05 12:13:11 UTC
Created attachment 63165 [details] [review]
Bug 18120: (followup) Make operationId unique

This patch renames the method names, and the operationID on the swagger spec
so they are unique.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 11 Katrin Fischer 2017-08-15 21:59:49 UTC
Created attachment 66046 [details] [review]
Bug 18120 - Changes to some field descriptions

Trying to clarify some of the descriptions.
Comment 12 Katrin Fischer 2017-08-15 22:02:46 UTC
I have added a patch with some suggestions for rephrasing/changing the descriptions a bit.

Currently this endpoint seems to check for full acquisitions permission:

+        "permissions": {
+          "acquisition": "1"
+        }
+      }

I think we could make this less strict, as we have a separate permission for dealing with vendors:

  vendors_manage - Manage vendors 

This would also make it easier if you need the vendors for serials, but don't want to give more access than necessary:
Comment 13 Tomás Cohen Arazi 2017-08-22 17:08:00 UTC
Created attachment 66362 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 14 Tomás Cohen Arazi 2017-08-22 17:08:09 UTC
Created attachment 66363 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 15 Tomás Cohen Arazi 2017-08-22 17:09:17 UTC
Patches rebased on top of bug 18137 (OpenAPI). Test plan applies and tests pass.
Comment 16 Kyle M Hall 2017-08-24 14:01:33 UTC
Created attachment 66417 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall 2017-08-24 14:01:40 UTC
Created attachment 66418 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Katrin Fischer 2017-08-24 14:59:54 UTC
Had submitted a follow-up with suggestions - was lost in rebase :(
Comment 19 Tomás Cohen Arazi 2017-08-24 15:05:21 UTC
Created attachment 66427 [details] [review]
Bug 18120: REST api | /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 20 Tomás Cohen Arazi 2017-08-24 15:05:30 UTC
Created attachment 66428 [details] [review]
Bug 18120: REST api | Add a 'vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 21 Tomás Cohen Arazi 2017-08-24 15:05:40 UTC
Created attachment 66429 [details] [review]
Bug 18120: Update field descriptions

Trying to clarify some of the descriptions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 22 Tomás Cohen Arazi 2017-08-24 17:49:52 UTC
Created attachment 66430 [details] [review]
Bug 18120: (QA followup) 'vendors_manage' permission fits better than full acq

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 23 Jonathan Druart 2017-09-21 15:01:04 UTC
Please double check POD coverage.
Comment 24 Tomás Cohen Arazi 2017-09-22 18:39:11 UTC
Created attachment 67326 [details] [review]
Bug 18120: /acquisitions/vendors unit tests

This patch introduces unit tests that need to be passed by an
/acquisitions/vendors/ REST endpoint.

To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> FAIL: The endpoint is not present, should fail.

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 25 Tomás Cohen Arazi 2017-09-22 18:39:29 UTC
Created attachment 67327 [details] [review]
Bug 18120: Add '/acquisitions/vendors' endpoint

This patch introduces an /acquisitions/vendors endpoint.
To test:
- Apply the patch
- Run:
  $ sudo koha-shell kohadev
 k$ prove t/db_dependent/api/v1/acquisitions_vendors.t
=> SUCCESS: Tests pass
- Sign off :-D

Sponsored-by: ByWater Solutions

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 26 Tomás Cohen Arazi 2017-09-22 18:39:42 UTC
Created attachment 67328 [details] [review]
Bug 18120: Update field descriptions

Trying to clarify some of the descriptions.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 27 Tomás Cohen Arazi 2017-09-22 18:39:58 UTC
Created attachment 67329 [details] [review]
Bug 18120: (QA followup) 'vendors_manage' permission fits better than full acq

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 28 Tomás Cohen Arazi 2017-09-22 18:40:14 UTC
Created attachment 67330 [details] [review]
Bug 18120: (QA followup) Add POD to controler class

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 29 Jonathan Druart 2017-09-29 20:10:33 UTC
Created attachment 67490 [details] [review]
Bug 18120: Tidy up
Comment 30 Jonathan Druart 2017-09-29 20:17:28 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 31 Fridolin Somers 2017-10-27 12:41:16 UTC
New feature not pushed to 17.05.x