---
# System prepended metadata

title: 服務項目api
tags: [進階房價]

---

# 服務項目api
###### tags:  `進階房價`
* api實作部分有新增、修改、刪除。
  1. 新增時，要取出此rate_cod的服務項目的最大seq並+1
  2. 在單筆做修改時，打修改
  3. 刪除單筆時，打刪除
* 需注意!有服務項目的計價方式(rate_prop)如下，也就是說**以時計價**沒有，其他的都有
    1. GR:以天計價 
    2. HU:HOUSE USE 
    3. CMP:COMPLIMENT
    4. DR:浮動房價 
    5. DU:Day use
    6. PKG:PACKAGE 
    7. MON:以月計價
    8. NST:不統計，功能與以天計價相同

## 新增範例
```jsonld=
{
  "prg_id": "PMS0810230",
  "socket_id": "uAW3dsoeyF-kRoksAAAM",
  "athena_id": 1,
  "ins_usr": "cio",
  "session_id": 3284131,
  "func_id": "1041",
  "params": {},
  "locale": "zh_TW",
  "trans_log_id": "20200213083959413",
  "mac": "",
  "comp_cod": "ZZATHENA",
  "hotel_cod": "01",
  "server_ip": "",
  "reve_code": "PMS0810230",
  "client_ip": "",
  "upd_usr": "cio",
  "user": "cio",
  "table": {
    "service_dt" :
    [
      {
        "action_cod": "C",
        "athena_id": 1,
        "hotel_cod": "01",
        "rate_cod": "NBA",
        "seq_nos" : 1,
        "room_cods" :"****",
        "charg_typ" : "I",
        "command_option" : "HH,HN,HW",
        "item_nos" : "1101",
        "unit_amt" : 1000,
        "item_qnt_rule" : "BY_ADULT",
        "serv_way" : "D",
        "ins_usr": "cio",
        "upd_usr": "cio"
      },
      {
        "action_cod": "C",
        "athena_id": 1,
        "hotel_cod": "01",
        "rate_cod": "NBA",
        "seq_nos" : 2,
        "room_cods" :"SD,SDT",
        "charg_typ" : "I",
        "command_option" : "HH,HN,HW",
        "item_nos" : "1102",
        "unit_amt" : 500,
        "item_qnt_rule" : "BY_ADULT",
        "serv_way" : "D",
        "ins_usr": "cio",
        "upd_usr": "cio"
      }
    ]
  },
  "event_time": "2020-02-13T08:39:59+08:00"
}
```
## 修改即刪除範例
```jsonld=
{
  "prg_id": "PMS0810230",
  "socket_id": "uAW3dsoeyF-kRoksAAAM",
  "athena_id": 1,
  "ins_usr": "cio",
  "session_id": 3284131,
  "func_id": "1041",
  "params": {},
  "locale": "zh_TW",
  "trans_log_id": "20200213083959413",
  "mac": "",
  "comp_cod": "ZZATHENA",
  "hotel_cod": "01",
  "server_ip": "",
  "reve_code": "PMS0810230",
  "client_ip": "",
  "upd_usr": "cio",
  "user": "cio",
  "table": {
    "service_dt" :
    [
      {
        "action_cod": "U",
        "athena_id": 1,
        "hotel_cod": "01",
        "room_cods" :"****",
        "charg_typ" : "I",
        "command_option" : "HH,HN",
        "item_nos" : "1101",
        "unit_amt" : 999,
        "item_qnt_rule" : "BY_ADULT",
        "serv_way" : "D",
        "upd_usr": "cio",
        "condition":[
         {
            "field" : "athena_id",
            "value" : "1",
            "operator" : "equal"
         },
         {
            "field" : "hotel_cod",
            "value" : "01",
            "operator" : "equal"
         },
         {
            "field" : "rate_cod",
            "value" : "NBA",
            "operator" : "equal"
         },
         {
            "field" : "seq_nos",
            "value" : "1",
            "operator" : "equal"
         }
        ]
      },
      {
        "action_cod": "D",
        "athena_id": 1,
        "hotel_cod": "01",
        "upd_usr": "cio",
        "condition":[
         {
            "field" : "athena_id",
            "value" : "1",
            "operator" : "equal"
         },
         {
            "field" : "hotel_cod",
            "value" : "01",
            "operator" : "equal"
         },
         {
            "field" : "rate_cod",
            "value" : "NBA",
            "operator" : "equal"
         },
         {
            "field" : "seq_nos",
            "value" : "2",
            "operator" : "equal"
         }
        ]
      }
    ]
  },
  "event_time": "2020-02-13T08:39:59+08:00"
}