# 醫院/企業單位管理
### (OK)[管理] 查看醫院/企業單位
Request:
GET /organization?$queryParams
[Query Params:](Untitled%208/Query%20Params.csv)
Response (成功):
```json=
{
"success": true,
"total": "總數量 <number>",
"data": [
{
"id" : "單位編號 <string>",
"tax": "統一編號 <number>",
"active" : "啟用狀態 <boolean>",
"type" : "類型 <string> enum: [prov(醫院), bus(企業)]",
"name" : "單位名稱 <string>",
"planId": "方案編號 <string>",
"planName": "方案名稱 <string>",
"planStartDate": "方案起始日 <timestamp>",
"planExpirationDate": "方案到期日 <timestamp>",
"planUse": "當前使用人數 <number>",
"planLimit": "授權人數 <number>",
"telecomName": "聯絡人姓名 <string>",
"telecomUserId": "聯絡人帳號 <string>",
"telecomNationality": "國籍 <string> 參考 ISO 3166-1 二位字母代號",
"telecomEmail": "主要聯絡人信箱 <string>",
"telecomSubEmail": "次要聯絡人信箱 <string>",
"address": "地址,號碼 <string>"
"comment": "備註 <string>",
"partOf" : "企業的所屬單位 ID",
"updatedAt": "更新時間 <number, bigint>"
},
...
]
}
```
### (OK)[管理] 新增醫院/企業單位
Request:
POST /organization
Header:
```json=
{
"Authorization": "Bearer Owicare::<token>"
}
```
Response (成功):
```json=
{
"success": true,
"data": {
"tax": "統一編號 <string>",
"active" : "啟用狀態 <boolean>",
"type" : "類型 <string> enum: [prov(醫院), bus(企業)]",
"name" : "單位名稱 <string>",
"planId": "方案編號 <string>",
"planExpirationDate": "方案到期日 <timestamp>",
"planUse": "方案當前使用人數 <number>",
"planLimit": "方案人數限制 <number>",
"telecomName": "聯絡人姓名 <string>",
"telecomUserId": "聯絡人帳號 <string>",
"telecomNationality": "國籍 <string> 參考 ISO 3166-1 二位字母代號",
"telecomEmail": "主要聯絡人信箱 <string>",
"telecomSubEmail": "次要聯絡人信箱 <string>",
"address": "地址,號碼 <string>"
"comment": "備註 <string>",
"partOf" : "企業的所屬單位 ID"
}
}
```
### (OK)[管理] 編輯醫院/企業單位
Request:
PUT /organization/$id
Payload:
```json=
{
"tax": "統一編號 <string>",
"name" : "單位名稱 <string>",
"telecomName": "聯絡人姓名 <string>",
"telecomUserId": "聯絡人帳號 <string>",
"telecomNationality": "國籍 <string> 參考 ISO 3166-1 二位字母代號",
"telecomEmail": "主要聯絡人信箱 <string>",
"telecomSubEmail": "次要聯絡人信箱 <string>",
"address": "地址,號碼 <string>"
"comment": "備註 <string>"
}
```
Response (成功):
```json=
{
"success": true,
"data": {
"tax": "統一編號 <number>",
"name" : "單位名稱 <string>",
"telecomName": "聯絡人姓名 <string>",
"telecomUserId": "聯絡人帳號 <string>",
"telecomNationality": "國籍 <string> 參考 ISO 3166-1 二位字母代號",
"telecomEmail": "主要聯絡人信箱 <string>",
"telecomSubEmail": "次要聯絡人信箱 <string>",
"address": "地址,號碼 <string>"
"comment": "備註 <string>"
}
}
```
### (OK)[管理] 移除醫院/企業單位
Request:
DEL /organization/$id
Response (成功):
```json=
{
"success": true,
"data": {}
}
```
### [管理] 啟用/停用醫院/企業單位
Request:
PUT /organization/$id/activate
Payload:
```json=
{
"active": "是否啟用<boolean>"
}
```
Response (成功):
```json=
{
"success": true,
"data": {}
}
```