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

(-)a/api/v1/swagger/definitions.json (+3 lines)
Lines 17-22 Link Here
17
  "patron": {
17
  "patron": {
18
    "$ref": "definitions/patron.json"
18
    "$ref": "definitions/patron.json"
19
  },
19
  },
20
  "patron_account_credit": {
21
    "$ref": "definitions/patron_account_credit.json"
22
  },
20
  "patron_balance": {
23
  "patron_balance": {
21
    "$ref": "definitions/patron_balance.json"
24
    "$ref": "definitions/patron_balance.json"
22
  },
25
  },
(-)a/api/v1/swagger/definitions/patron_account_credit.json (+39 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "credit_type": {
5
      "type": "string",
6
      "description": "Type of credit ('credit', 'forgiven', 'lost_item_return', 'payment', 'writeoff' )"
7
    },
8
    "amount": {
9
      "type": "number",
10
      "minimum": 0,
11
      "description": "Credit amount"
12
    },
13
    "account_lines_ids": {
14
        "type": "array",
15
        "items": {
16
            "type": "integer"
17
        },
18
        "description": "List of account line ids the credit goes against (optional)"
19
    },
20
    "payment_type": {
21
        "type": "string",
22
        "description":  "Payment type (only applies when credit_type=payment)"
23
    },
24
    "date": {
25
      "type": "string",
26
      "format": "date",
27
      "description": "Date the credit was recorded (optional)"
28
    },
29
    "description": {
30
      "type": "string",
31
      "description": "Description"
32
    },
33
    "note": {
34
      "type": "string",
35
      "description": "Internal note"
36
    }
37
  },
38
  "required": [ "amount" ]
39
}
(-)a/api/v1/swagger/paths.json (+3 lines)
Lines 29-34 Link Here
29
  "/patrons/{patron_id}/account": {
29
  "/patrons/{patron_id}/account": {
30
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account"
30
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account"
31
  },
31
  },
32
  "/patrons/{patron_id}/account/credits": {
33
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
34
  },
32
  "/illrequests": {
35
  "/illrequests": {
33
    "$ref": "paths/illrequests.json#/~1illrequests"
36
    "$ref": "paths/illrequests.json#/~1illrequests"
34
  }
37
  }
(-)a/api/v1/swagger/paths/patrons_account.json (-1 / +69 lines)
Lines 61-65 Link Here
61
        }
61
        }
62
      }
62
      }
63
    }
63
    }
64
  },
65
  "/patrons/{patron_id}/account/credits": {
66
    "post": {
67
      "x-mojo-to": "Patrons::Account#add_credit",
68
      "operationId": "addPatronCredit",
69
      "tags": [
70
        "patron"
71
      ],
72
      "parameters": [
73
        {
74
          "$ref": "../parameters.json#/patron_id_pp"
75
        },
76
        {
77
          "name": "body",
78
          "in": "body",
79
          "description": "A JSON object containing credit information",
80
          "required": true,
81
          "schema": {
82
            "$ref": "../definitions.json#/patron_account_credit"
83
          }
84
        }
85
      ],
86
      "produces": [
87
        "application/json"
88
      ],
89
      "responses": {
90
        "200": {
91
          "description": "Credit added",
92
          "schema": {
93
            "type": "object"
94
          }
95
        },
96
        "401": {
97
          "description": "Authentication required",
98
          "schema": {
99
            "$ref": "../definitions.json#/error"
100
          }
101
        },
102
        "403": {
103
          "description": "Access forbidden",
104
          "schema": {
105
            "$ref": "../definitions.json#/error"
106
          }
107
        },
108
        "404": {
109
          "description": "Patron not found",
110
          "schema": {
111
            "$ref": "../definitions.json#/error"
112
          }
113
        },
114
        "500": {
115
          "description": "Internal server error",
116
          "schema": {
117
            "$ref": "../definitions.json#/error"
118
          }
119
        },
120
        "503": {
121
          "description": "Under maintenance",
122
          "schema": {
123
            "$ref": "../definitions.json#/error"
124
          }
125
        }
126
      },
127
      "x-koha-authorization": {
128
        "permissions": {
129
          "updatecharges": "remaining_permissions"
130
        }
131
      }
132
    }
64
  }
133
  }
65
}
134
}
66
- 

Return to bug 20944