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

(-)a/Koha/Subscription.pm (+20 lines)
Lines 194-199 sub get_sharable_info { Link Here
194
    return $sub_mana_info;
194
    return $sub_mana_info;
195
}
195
}
196
196
197
=head3 to_api_mapping
198
199
This method returns the mapping for representing a Koha::Subscription object
200
on the API.
201
202
=cut
203
204
sub to_api_mapping {
205
    return {
206
        subscriptionid           => 'id',
207
        biblionumber             => 'biblio_id',
208
        librarian                => undef,
209
        startdate                => 'start_date',
210
        aqbooksellerid           => 'vendor_id',
211
        aqbudgetid               => 'budget_id',
212
        weeklength               => 'length_in_weeks',
213
        monthlength              => 'length_in_months',
214
        numberlength             => 'length_in_issues',
215
    };
216
}
197
217
198
=head3 _type
218
=head3 _type
199
219
(-)a/api/v1/swagger/definitions/subscription.yaml (+45 lines)
Line 0 Link Here
1
---
2
type: object
3
properties:
4
  id:
5
    type: integer
6
    description: internally assigned subscription identifier
7
    readOnly: true
8
  biblio_id:
9
    type: integer
10
    description: Internal identifier for the linked bibliographic record
11
  start_date:
12
    type:
13
      - string
14
      - "null"
15
    format: date
16
    description: Start date of subscription
17
  vendor_id:
18
    type: integer
19
    description: Internal identifier for the vendor
20
  cost:
21
    type:
22
      - number
23
      - "null"
24
    description: The cost of this subscription
25
  budget_id:
26
    type:
27
      - number
28
      - "null"
29
    description: Internal identifier for the budget
30
  length_in_weeks:
31
    type:
32
      - number
33
      - "null"
34
    description: Length of subscription in weeks
35
  length_in_months:
36
    type:
37
      - number
38
      - "null"
39
    description: Length of subscription in months
40
  length_in_issues:
41
    type:
42
      - number
43
      - "null"
44
    description: Length of subscription in number of issues
45
additionalProperties: false
(-)a/api/v1/swagger/definitions/vendor.yaml (+5 lines)
Lines 119-124 properties: Link Here
119
    description: List of aliases
119
    description: List of aliases
120
    items:
120
    items:
121
      $ref: "vendor_alias.yaml"
121
      $ref: "vendor_alias.yaml"
122
  subscriptions:
123
    type: array
124
    description: List of subscriptions
125
    items:
126
      $ref: "subscription.yaml"
122
additionalProperties: false
127
additionalProperties: false
123
required:
128
required:
124
  - name
129
  - name
(-)a/api/v1/swagger/paths/acquisitions_vendors.yaml (-1 / +1 lines)
Lines 35-40 Link Here
35
          type: string
35
          type: string
36
          enum:
36
          enum:
37
            - aliases
37
            - aliases
38
            - subscriptions
38
        collectionFormat: csv
39
        collectionFormat: csv
39
    responses:
40
    responses:
40
      "200":
41
      "200":
41
- 

Return to bug 38389