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

(-)a/api/v1/swagger/definitions.json (+3 lines)
Lines 14-19 Link Here
14
  "patron": {
14
  "patron": {
15
    "$ref": "definitions/patron.json"
15
    "$ref": "definitions/patron.json"
16
  },
16
  },
17
  "patronstatus": {
18
    "$ref": "definitions/patronstatus.json"
19
  },
17
  "holds": {
20
  "holds": {
18
    "$ref": "definitions/holds.json"
21
    "$ref": "definitions/holds.json"
19
  },
22
  },
(-)a/api/v1/swagger/definitions/patronstatus.json (+79 lines)
Line 0 Link Here
1
{
2
  "type": "object",
3
  "allOf": [
4
    { "$ref": "../definitions.json#/patron" },
5
    {
6
    "type": "object",
7
    "properties": {
8
      "blocks": {
9
        "type": "object",
10
        "properties": {
11
        "Patron::CardExpired": {
12
          "description": "Patron's card has been expired.",
13
          "type": "object",
14
          "properties": {
15
            "expiration_date": {
16
              "type": ["string", "null"]
17
            }
18
          }
19
        },
20
        "Patron::CardLost": {
21
          "description": "Patron's card has been marked as lost.",
22
          "type": "object",
23
          "properties": {}
24
        },
25
        "Patron::Debarred": {
26
          "description": "Patron is debarred.",
27
          "type": "object",
28
          "properties": {
29
            "expiration_date": {
30
              "type": ["string", "null"]
31
            },
32
            "comment": {
33
              "type": ["string", "null"]
34
            }
35
          }
36
        },
37
        "Patron::DebarredOverdue": {
38
          "description": "Patron has overdues and is debarred.",
39
          "type": "object",
40
          "properties": {
41
            "number_of_overdues": {
42
              "type": ["integer", "null"]
43
            }
44
          }
45
        },
46
        "Patron::Debt": {
47
          "description": "Patron's debts exceed maximum allowed amount.",
48
          "type": "object",
49
          "properties": {
50
            "max_outstanding":{
51
              "type": ["number", "null"]
52
            },
53
            "current_outstanding": {
54
              "type": ["number", "null"]
55
            }
56
          }
57
        },
58
        "Patron::DebtGuarantees": {
59
          "description": "Patron's guarantees' debts exceed maximum allowed amount.",
60
          "type": "object",
61
          "properties": {
62
            "max_outstanding":{
63
              "type": ["number", "null"]
64
            },
65
            "current_outstanding": {
66
              "type": ["number", "null"]
67
            }
68
          }
69
        },
70
        "Patron::GoneNoAddress": {
71
          "type": "object",
72
          "properties": {}
73
        }
74
      }
75
      }
76
    }
77
    }
78
  ]
79
}
(-)a/api/v1/swagger/paths.json (+3 lines)
Lines 31-35 Link Here
31
  },
31
  },
32
  "/patrons/{borrowernumber}": {
32
  "/patrons/{borrowernumber}": {
33
    "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}"
33
    "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}"
34
  },
35
  "/patrons/{borrowernumber}/status": {
36
    "$ref": "paths/patrons.json#/~1patrons~1{borrowernumber}~1status"
34
  }
37
  }
35
}
38
}
(-)a/api/v1/swagger/paths/patrons.json (-1 / +46 lines)
Lines 69-73 Link Here
69
        }
69
        }
70
      }
70
      }
71
    }
71
    }
72
  },
73
  "/patrons/{borrowernumber}/status": {
74
    "get": {
75
      "operationId": "getstatusPatron",
76
      "tags": ["patrons"],
77
      "parameters": [{
78
          "$ref": "../parameters.json#/borrowernumberPathParam"
79
        }
80
      ],
81
      "produces": [
82
          "application/json"
83
      ],
84
      "responses": {
85
        "200": {
86
          "description": "A patron",
87
          "schema": {
88
            "$ref": "../definitions.json#/patronstatus"
89
          }
90
        },
91
        "403": {
92
          "description": "Access forbidden",
93
          "schema": {
94
            "$ref": "../definitions.json#/error"
95
          }
96
        },
97
        "404": {
98
          "description": "Patron not found",
99
          "schema": {
100
            "$ref": "../definitions.json#/error"
101
          }
102
        },
103
        "500": {
104
          "description": "Internal server error",
105
          "schema": {
106
            "$ref": "../definitions.json#/error"
107
          }
108
        }
109
      },
110
      "x-koha-authorization": {
111
        "allow-owner": true,
112
        "allow-guarantor": true,
113
        "permissions": {
114
          "borrowers": "1"
115
        }
116
      }
117
    }
72
  }
118
  }
73
}
119
}
74
- 

Return to bug 18103