Koha/api/v1/swagger/definitions/fund.json
Tomas Cohen Arazi 1b9f3621df
Bug 23843: Add mapping to Koha::Acquisition::Fund
This patch adds a to_api_mapping method to the class. This in effect
enables calling ->to_api on the object. The mapping is borrowed from the
API controller. It is not removed from the controller so we are able to
verify (through the tests) that there is no behavior change.
Once this is pushed we need to implement the counter-wise methods and
clean the controllers.
To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat (1)
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-10-23 18:03:24 +01:00

105 lines
2.2 KiB
JSON

{
"type": "object",
"properties": {
"fund_id": {
"$ref": "../x-primitives.json#/fund_id"
},
"code": {
"type": [
"string",
"null"
],
"description": "Code assigned to the fund by the user"
},
"name": {
"type": [
"string",
"null"
],
"description": "Name assigned to the fund by the user"
},
"library_id": {
"type": [
"string",
"null"
],
"description": "Internal identifier for the library that this fund belongs to"
},
"total_amount": {
"type": [
"number",
"null"
],
"description": "Total amount for this fund"
},
"warn_at_percentage": {
"type": [
"number",
"null"
],
"description": "Warning at percentage"
},
"warn_at_amount": {
"type": [
"number",
"null"
],
"description": "Warning at amount"
},
"notes": {
"type": [
"string",
"null"
],
"description": "Notes related to this fund"
},
"budget_id": {
"type": [
"number",
"null"
],
"description": "Internal identifier for the budget"
},
"timestamp": {
"type": [
"string"
],
"format": "date-time",
"description": "Timestamp"
},
"fund_owner_id": {
"type": [
"number",
"null"
],
"description": "Internal identifier for the fund owner"
},
"fund_access": {
"type": [
"number",
"null"
],
"description": "Level of permission for this fund (1: owner, 2: owner, users and library, 3: owner and users)"
},
"parent_fund_id": {
"type": [ "integer", "null" ],
"description": "Internal identifier for parent fund"
},
"statistic1_auth_value_category": {
"type": [
"string",
"null"
],
"description": "Statistical category for this fund"
},
"statistic2_auth_value_category": {
"type": [
"string",
"null"
],
"description": "Second statistical category for this fund"
}
},
"additionalProperties": false,
"required": ["name"]
}