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

(-)a/api/v1/swagger/definitions.json (-2 / +5 lines)
Lines 1-4 Link Here
1
{
1
{
2
  "account_line": {
3
    "$ref": "definitions/account_line.json"
4
  },
2
  "city": {
5
  "city": {
3
    "$ref": "definitions/city.json"
6
    "$ref": "definitions/city.json"
4
  },
7
  },
Lines 14-21 Link Here
14
  "patron": {
17
  "patron": {
15
    "$ref": "definitions/patron.json"
18
    "$ref": "definitions/patron.json"
16
  },
19
  },
17
  "error": {
20
  "patron_balance": {
18
    "$ref": "definitions/error.json"
21
    "$ref": "definitions/patron_balance.json"
19
  },
22
  },
20
  "vendor": {
23
  "vendor": {
21
    "$ref": "definitions/vendor.json"
24
    "$ref": "definitions/vendor.json"
(-)a/api/v1/swagger/definitions/account_line.json (+81 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "account_line_id": {
5
      "type": "integer",
6
      "description": "Internal account line identifier"
7
    },
8
    "checkout_id": {
9
      "type": [
10
        "integer",
11
        "null"
12
      ],
13
      "description": "Internal identifier for the checkout the account line is related to"
14
    },
15
    "patron_id": {
16
      "type": "integer",
17
      "description": "Internal identifier for the patron the account line belongs to"
18
    },
19
    "item_id": {
20
      "type": [
21
        "integer",
22
        "null"
23
      ],
24
      "description": "Internal identifier for the item the account line is related to"
25
    },
26
    "date": {
27
      "type": "string",
28
      "format": "date",
29
      "description": "Date the account line was created"
30
    },
31
    "amount": {
32
      "type": "number",
33
      "description": "Account line amount"
34
    },
35
    "description": {
36
      "type": [
37
        "string",
38
        "null"
39
      ],
40
      "description": "Account line description"
41
    },
42
    "account_type": {
43
      "type": "string",
44
      "description": "Account line type"
45
    },
46
    "payment_type": {
47
      "type": [
48
        "string",
49
        "null"
50
      ],
51
      "description": "Payment type"
52
    },
53
    "amount_outstanding": {
54
      "type": "number",
55
      "description": "Outstanding amount"
56
    },
57
    "last_increment": {
58
      "type": [
59
        "number",
60
        "null"
61
      ],
62
      "description": "The amount the line was increased last time"
63
    },
64
    "timestamp": {
65
      "type": "string",
66
      "format": "date-time",
67
      "description": "Timestamp for the latest line update"
68
    },
69
    "internal_note": {
70
      "type": [
71
        "string",
72
        "null"
73
      ],
74
      "description": "Internal note"
75
    },
76
    "staff_id": {
77
      "type": "integer",
78
      "description": "Internal patron identifier for the staff member that introduced the account line"
79
    }
80
  }
81
}
(-)a/api/v1/swagger/definitions/patron_balance.json (+19 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "properties": {
4
    "balance": {
5
      "type": "number",
6
      "description": "Signed decimal number"
7
    },
8
    "outstanding_lines": {
9
      "type": "array",
10
      "items": {
11
        "$ref": "account_line.json"
12
      }
13
    }
14
  },
15
  "additionalProperties": false,
16
  "required": [
17
    "balance"
18
  ]
19
}
(-)a/api/v1/swagger/paths.json (+3 lines)
Lines 26-31 Link Here
26
  "/patrons/{patron_id}": {
26
  "/patrons/{patron_id}": {
27
    "$ref": "paths/patrons.json#/~1patrons~1{patron_id}"
27
    "$ref": "paths/patrons.json#/~1patrons~1{patron_id}"
28
  },
28
  },
29
  "/patrons/{patron_id}/account": {
30
    "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account"
31
  },
29
  "/illrequests": {
32
  "/illrequests": {
30
    "$ref": "paths/illrequests.json#/~1illrequests"
33
    "$ref": "paths/illrequests.json#/~1illrequests"
31
  }
34
  }
(-)a/api/v1/swagger/paths/patrons_account.json (-1 / +65 lines)
Line 0 Link Here
0
- 
1
{
2
  "/patrons/{patron_id}/account": {
3
    "get": {
4
      "x-mojo-to": "Patrons::Account#get",
5
      "operationId": "getPatronAccount",
6
      "tags": [
7
        "patron"
8
      ],
9
      "parameters": [
10
        {
11
          "$ref": "../parameters.json#/patron_id_pp"
12
        }
13
      ],
14
      "produces": [
15
        "application/json"
16
      ],
17
      "responses": {
18
        "200": {
19
          "description": "Patron's account balance",
20
          "schema": {
21
            "$ref": "../definitions.json#/patron_balance"
22
          }
23
        },
24
        "401": {
25
          "description": "Authentication required",
26
          "schema": {
27
            "$ref": "../definitions.json#/error"
28
          }
29
        },
30
        "403": {
31
          "description": "Access forbidden",
32
          "schema": {
33
            "$ref": "../definitions.json#/error"
34
          }
35
        },
36
        "404": {
37
          "description": "Patron not found",
38
          "schema": {
39
            "$ref": "../definitions.json#/error"
40
          }
41
        },
42
        "500": {
43
          "description": "Internal server error",
44
          "schema": {
45
            "$ref": "../definitions.json#/error"
46
          }
47
        },
48
        "503": {
49
          "description": "Under maintenance",
50
          "schema": {
51
            "$ref": "../definitions.json#/error"
52
          }
53
        }
54
      },
55
      "x-koha-authorization": {
56
        "allow-owner": true,
57
        "allow-guarantor": true,
58
        "permissions": {
59
          "borrowers": "edit_borrowers",
60
          "updatecharges": "remaining_permissions"
61
        }
62
      }
63
    }
64
  }
65
}

Return to bug 20942