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

(-)a/Koha/REST/V1/Acquisitions/Baskets.pm (+24 lines)
Lines 59-62 sub list_managers { Link Here
59
    };
59
    };
60
}
60
}
61
61
62
=head3 list
63
64
Return a list of baskets
65
66
=cut
67
68
sub list {
69
    my $c = shift->openapi->valid_input or return;
70
71
    return try {
72
73
        my $baskets_rs = Koha::Acquisition::Baskets->new;
74
        my $baskets    = $c->objects->search( $baskets_rs );
75
76
        return $c->render(
77
            status  => 200,
78
            openapi => $baskets
79
        );
80
    }
81
    catch {
82
        $c->unhandled_exception($_);
83
    };
84
}
85
62
1;
86
1;
(-)a/api/v1/swagger/definitions/basket.yaml (-6 / +21 lines)
Lines 5-11 properties: Link Here
5
    type: integer
5
    type: integer
6
    description: Internal identifier for the basket
6
    description: Internal identifier for the basket
7
  name:
7
  name:
8
    type: string
8
    type:
9
      - string
10
      - "null"
9
    description: Basket name
11
    description: Basket name
10
  internal_note:
12
  internal_note:
11
    type:
13
    type:
Lines 18-24 properties: Link Here
18
      - "null"
20
      - "null"
19
    description: Vendor note
21
    description: Vendor note
20
  contract_id:
22
  contract_id:
21
    type: integer
23
    type:
24
      - integer
25
      - "null"
22
    description: Internal identifier of the linked contract
26
    description: Internal identifier of the linked contract
23
  creation_date:
27
  creation_date:
24
    type:
28
    type:
Lines 35-41 properties: Link Here
35
  vendor_id:
39
  vendor_id:
36
    type: integer
40
    type: integer
37
    description: Internal identifier for the vendor
41
    description: Internal identifier for the vendor
38
  authorised_by:
42
  creator_id:
39
    type:
43
    type:
40
      - integer
44
      - integer
41
      - "null"
45
      - "null"
Lines 45-56 properties: Link Here
45
      - integer
49
      - integer
46
      - "null"
50
      - "null"
47
    description: links this basket to its group (aqbasketgroups.id)
51
    description: links this basket to its group (aqbasketgroups.id)
48
  delivery_library:
52
  delivery_library_id:
49
    type:
53
    type:
50
      - string
54
      - string
51
      - "null"
55
      - "null"
52
    description: basket delivery place
56
    description: basket delivery place
53
  billing_library:
57
  billing_library_id:
54
    type:
58
    type:
55
      - string
59
      - string
56
      - "null"
60
      - "null"
Lines 63-74 properties: Link Here
63
  standing:
67
  standing:
64
    type: boolean
68
    type: boolean
65
    description: If the orders in this basket are standing
69
    description: If the orders in this basket are standing
70
  closed:
71
    type: boolean
72
    description: Is the basket closed
73
  note:
74
    type:
75
      - string
76
      - "null"
77
    description: basket notes
66
  create_items:
78
  create_items:
67
    type: string
79
    type:
80
      - string
81
      - "null"
68
    enum:
82
    enum:
69
      - ordering
83
      - ordering
70
      - receiving
84
      - receiving
71
      - cataloguing
85
      - cataloguing
86
      - null
72
    description: "When items should be created for orders in this basket (Options:
87
    description: "When items should be created for orders in this basket (Options:
73
      'ordering', 'receiving', 'cataloguing'. Null means system wide config)"
88
      'ordering', 'receiving', 'cataloguing'. Null means system wide config)"
74
additionalProperties: false
89
additionalProperties: false
(-)a/api/v1/swagger/paths/acquisitions_baskets.yaml (+49 lines)
Lines 1-4 Link Here
1
---
1
---
2
/acquisitions/baskets:
3
  get:
4
    x-mojo-to: Acquisitions::Baskets#list
5
    operationId: listBaskets
6
    description: This resource returns a list of baskets
7
    summary: List of baskets
8
    tags:
9
      - baskets
10
    parameters:
11
      - $ref: "../swagger.yaml#/parameters/match"
12
      - $ref: "../swagger.yaml#/parameters/order_by"
13
      - $ref: "../swagger.yaml#/parameters/page"
14
      - $ref: "../swagger.yaml#/parameters/per_page"
15
      - $ref: "../swagger.yaml#/parameters/q_param"
16
      - $ref: "../swagger.yaml#/parameters/q_body"
17
    produces:
18
      - application/json
19
    responses:
20
      "200":
21
        description: A list of baskets
22
        schema:
23
          type: array
24
          items:
25
            $ref: "../swagger.yaml#/definitions/basket"
26
      "400":
27
        description: |
28
          Bad request. Possible `error_code` attribute values:
29
30
            * `invalid_query`
31
        schema:
32
          $ref: "../swagger.yaml#/definitions/error"
33
      "403":
34
        description: Access forbidden
35
        schema:
36
          $ref: "../swagger.yaml#/definitions/error"
37
      "500":
38
        description: |
39
          Internal server error. Possible `error_code` attribute values:
40
41
          * `internal_server_error`
42
        schema:
43
          $ref: "../swagger.yaml#/definitions/error"
44
      "503":
45
        description: Under maintenance
46
        schema:
47
          $ref: "../swagger.yaml#/definitions/error"
48
    x-koha-authorization:
49
      permissions:
50
        acquisition: order_manage
2
/acquisitions/baskets/managers:
51
/acquisitions/baskets/managers:
3
  get:
52
  get:
4
    x-mojo-to: Acquisitions::Baskets#list_managers
53
    x-mojo-to: Acquisitions::Baskets#list_managers
(-)a/api/v1/swagger/swagger.yaml (-1 / +2 lines)
Lines 185-190 definitions: Link Here
185
  vendor_issue:
185
  vendor_issue:
186
    $ref: ./definitions/vendor_issue.yaml
186
    $ref: ./definitions/vendor_issue.yaml
187
paths:
187
paths:
188
  /acquisitions/baskets:
189
    $ref: ./paths/acquisitions_baskets.yaml#/~1acquisitions~1baskets
188
  /acquisitions/baskets/managers:
190
  /acquisitions/baskets/managers:
189
    $ref: ./paths/acquisitions_baskets.yaml#/~1acquisitions~1baskets~1managers
191
    $ref: ./paths/acquisitions_baskets.yaml#/~1acquisitions~1baskets~1managers
190
  /acquisitions/edifiles:
192
  /acquisitions/edifiles:
191
- 

Return to bug 38204