# Expense Enquiry

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/expenses/enquiry:
    post:
      summary: Expense Enquiry
      deprecated: false
      description: ดึงข้อมูล expense หลายรายการ
      tags:
        - Venio/Expense
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: ''
          required: true
          example: <Your-Subscription-Key>
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expenseTypeId:
                  type: object
                  properties: {}
                  x-apidog-orders: []
                  description: |-
                    รหัสประเภทการใช้จ่าย
                    Accommodation = 1001,
                    Enterainment = 1002,
                    Fuel = 1003,
                    Other = 1004,
                    Training = 1005,
                    Travelling = 1006,
                    MeetingWithStaff = 1007,
                    MeetingWithSales = 1008,
                statusIds:
                  type: array
                  items:
                    type: string
                  description: รายการรหัสสถานะ
                  nullable: true
                staffCodes:
                  type: array
                  items:
                    type: string
                  description: รายการรหัสลูกค้า
                  nullable: true
                searchText:
                  type: string
                  description: text ค้นหา
                  nullable: true
                dateStart:
                  type: string
                  description: เวลาเริ่ม
                  nullable: true
                dateEnd:
                  type: string
                  description: เวลาสิ้นสุด
                  nullable: true
              x-apidog-orders:
                - expenseTypeId
                - statusIds
                - staffCodes
                - searchText
                - dateStart
                - dateEnd
              required:
                - expenseTypeId
            example:
              expenseTypeId: 1001
              statusIds:
                - string
              staffCodes:
                - string
              searchText: string
              dateStart: '2021-09-17T10:42:31.981Z'
              dateEnd: '2021-09-17T10:42:31.981Z'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  data:
                    type: object
                    properties:
                      value:
                        type: array
                        items:
                          type: object
                          properties:
                            statusId:
                              type: integer
                              description: รหัสสถานะ
                              nullable: true
                            statusName:
                              type: string
                              description: ชื่อสถานะ
                            expenses:
                              type: array
                              items:
                                type: object
                                properties:
                                  expenseId:
                                    type: integer
                                    description: รหัส idของexpense
                                  expenseNo:
                                    type: string
                                    description: รหัส expense
                                  companyId:
                                    type: integer
                                    description: รหัส id บริษัท
                                  teamId:
                                    type: integer
                                    description: รหัสidทีม
                                  userId:
                                    type: string
                                    description: รหัสuserid
                                  identityUserId:
                                    type: string
                                    description: รหัสยืนยันตัวตน
                                    nullable: true
                                  staffName:
                                    type: string
                                    description: ชื่อพนักงาน
                                  orgString:
                                    type: string
                                    description: โครงสร้างตามสายงาน
                                  orgLevel:
                                    type: integer
                                    description: ระดับองค์กร
                                  role:
                                    type: string
                                    description: หน้าที่
                                  companyName:
                                    type: string
                                    description: ชื่อบริษัท
                                  teamName:
                                    type: string
                                    description: ชื่อทีม
                                  statusId:
                                    type: integer
                                    description: รหัสสถานะ
                                  statusName:
                                    type: string
                                    description: ชื่อสถานะ
                                  expenseTypeIds:
                                    type: string
                                    description: รหัสประเภทexpense
                                    nullable: true
                                  expenseTypeNames:
                                    type: string
                                    description: ชื่อประเภทสถานะ
                                    nullable: true
                                  activityId:
                                    type: integer
                                    description: รหัสกิจกรรม
                                    nullable: true
                                  dateActivity:
                                    type: string
                                    description: เวลากิจกรรม
                                    nullable: true
                                  keyActivity:
                                    type: string
                                    description: กิจกรรมหลัก
                                    nullable: true
                                  keyActivityId:
                                    type: integer
                                    description: รหัสกิจกรรมหลัก
                                    nullable: true
                                  detailActivities:
                                    type: string
                                    description: รายละเอียดกิจกรรม
                                    nullable: true
                                  contactNames:
                                    type: string
                                    description: ชื่อผู้ติดต่อ
                                    nullable: true
                                  customerId:
                                    type: integer
                                    description: รหัสลูกค้า
                                    nullable: true
                                  customerName:
                                    type: string
                                    description: ชื่อลูกค้า
                                    nullable: true
                                  customerAlias:
                                    type: string
                                    description: นามแฝงลูกค้า
                                    nullable: true
                                  total:
                                    type: number
                                    description: ร่วมค่าใช้จ่ายทั้งหมด
                                  dateCreated:
                                    type: string
                                    description: เวลาสร้าง
                                  dateTransaction:
                                    type: string
                                    description: เวลาธุรกรรม
                                  dateProfileModified:
                                    type: string
                                    description: เวลาแก้ไขprofile
                                  hasAttachment:
                                    type: boolean
                                    description: มีเอกสารแนบหรือไหม
                                    nullable: true
                                  remark:
                                    type: string
                                    description: หมายเหตุ
                                    nullable: true
                                  dateApproved:
                                    type: string
                                    description: วันที่อนุมัติ
                                    nullable: true
                                  approveByUserId:
                                    type: string
                                    description: useridผู้อนุมัติ
                                    nullable: true
                                  approvedByFullname:
                                    type: string
                                    description: ชื่อเต็มผู้อนุมัติ
                                    nullable: true
                                  waitingApproveByUserId:
                                    type: string
                                    description: รหัสผู้รออนุมัติ
                                    nullable: true
                                  dateCheckout:
                                    type: string
                                    description: วันที่checkout
                                    nullable: true
                                  waitingApproveByRoleId:
                                    type: string
                                    description: roleIdผู้รออนุมัติ
                                    nullable: true
                                  reason:
                                    type: string
                                    description: เหตุผล
                                    nullable: true
                                  subject:
                                    type: string
                                    description: เรื่อง
                                  currencyCode:
                                    type: string
                                    description: >-
                                      สกุลเงิน เช่น "THB" , "USD" [ถ้าไม่ส่ง
                                      หรือ null ระบบจะหยิบ System Currency ของ
                                      Company นั้นๆให้] optional
                                    nullable: true
                                  exchangeRate:
                                    type: number
                                    description: อัตราแลกเปลี่ยน
                                    nullable: true
                                  pictureUrl:
                                    type: string
                                    description: url รูปภาพ
                                x-apidog-orders:
                                  - expenseId
                                  - expenseNo
                                  - companyId
                                  - teamId
                                  - userId
                                  - identityUserId
                                  - staffName
                                  - orgString
                                  - orgLevel
                                  - role
                                  - companyName
                                  - teamName
                                  - statusId
                                  - statusName
                                  - expenseTypeIds
                                  - expenseTypeNames
                                  - activityId
                                  - dateActivity
                                  - keyActivityId
                                  - keyActivity
                                  - detailActivities
                                  - contactNames
                                  - customerId
                                  - customerName
                                  - customerAlias
                                  - total
                                  - dateCreated
                                  - dateTransaction
                                  - dateProfileModified
                                  - hasAttachment
                                  - remark
                                  - dateApproved
                                  - approveByUserId
                                  - approvedByFullname
                                  - waitingApproveByUserId
                                  - dateCheckout
                                  - waitingApproveByRoleId
                                  - reason
                                  - subject
                                  - currencyCode
                                  - exchangeRate
                                  - pictureUrl
                                required:
                                  - expenseId
                                  - expenseNo
                                  - companyId
                                  - teamId
                                  - userId
                                  - staffName
                                  - companyName
                                  - teamName
                                  - statusId
                                  - statusName
                                  - dateCreated
                                  - dateTransaction
                                  - subject
                                  - pictureUrl
                                  - role
                                  - orgLevel
                                  - orgString
                                  - dateProfileModified
                                  - total
                          x-apidog-orders:
                            - statusId
                            - statusName
                            - expenses
                          required:
                            - statusName
                            - expenses
                      statusCode:
                        type: integer
                        description: >-
                          <p>สถานะ statusCode ของ httpเช่น<br>200 Ok<br>201
                          Created<br>400 BadRequest<br>401 Unauthorized<br>404
                          Record not found<br>500 Internal Server Error</p>
                    x-apidog-orders:
                      - value
                      - statusCode
                    required:
                      - value
                      - statusCode
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - data
                required:
                  - statusCode
                  - httpStatusCode
                  - data
              example:
                data:
                  value:
                    - statusId: 0
                      statusName: string
                      expenses:
                        - expenseId: 0
                          expenseNo: string
                          companyId: 0
                          teamId: 0
                          userId: string
                          staffName: string
                          orgString: string
                          orgLevel: 0
                          role: string
                          companyName: string
                          teamName: string
                          statusId: 0
                          statusName: string
                          expenseTypeIds: string
                          expenseTypeNames: string
                          activityId: 0
                          dateActivity: '2021-09-17T10:44:12.359Z'
                          keyActivityId: 0
                          keyActivity: string
                          detailActivities: string
                          contactNames: string
                          customerId: 0
                          customerName: string
                          customerAlias: string
                          total: 0
                          dateCreated: '2021-09-17T10:44:12.359Z'
                          dateTransaction: '2021-09-17T10:44:12.359Z'
                          dateProfileModified: '2021-09-17T10:44:12.359Z'
                          hasAttachment: true
                          remark: string
                          dateApproved: '2021-09-17T10:44:12.359Z'
                          approvedByUserId: string
                          approvedByFullname: string
                          waitingApproveByUserId: string
                          dateCheckout: '2021-09-17T10:44:12.359Z'
                          waitingApproveByRoleId: string
                          reason: string
                          subject: string
                  statusCode: 200
                statusCode: 1000
                httpStatusCode: 200
          headers: {}
          x-apidog-name: OK
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  message:
                    type: string
                    description: คำบรรยาย error
                x-apidog-orders:
                  - statusCode
                  - message
                required:
                  - statusCode
                  - message
              example:
                statusCode: 401
                message: >-
                  Access denied due to invalid subscription key. Make sure to
                  provide a valid key for an active subscription.
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ  code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  errorMessage:
                    type: string
                    description: คำอธิบายเกี่ยวกับ error
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไหม
                      true = มี
                      false = ไม่มี
                  data:
                    type: object
                    properties:
                      authenticationSchemes:
                        type: array
                        items:
                          type: string
                        description: ค่า Enum ของ authenticationSchemes
                    x-apidog-orders:
                      - authenticationSchemes
                    required:
                      - authenticationSchemes
                    description: |-
                      ข้อมูลที่จะแสดง ไม่จำกัดรูปแบบว่าจะเป็นเช่นไร 
                      ตอนเรียกออกมาสามารเป็น Array และ Object ได้
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                description: ' กรณีที่คนที่ดูไม่มี permission view data '
                required:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
          headers: {}
          x-apidog-name: Forbidden
        x-200:Bad Request:
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไม่
                      true = มี
                      false = ไม่มี
                  errorMessage:
                    type: string
                    description: คำบรรยายerror
                  validationErrors:
                    type: object
                    properties:
                      expenseTypeId:
                        type: string
                        description: error ที่เกี่ยวกับ expenseTypeId
                    description: รายการ error ที่เกิดจาก การ validationErrors
                    x-apidog-orders:
                      - expenseTypeId
                    required:
                      - expenseTypeId
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: "<p>สถานะ\_statusCode\_ของ\_httpเช่น<br>200\_Ok<br>201\_Created<br>400\_BadRequest<br>401\_Unauthorized<br>404\_Record\_not\_found<br>500\_Internal\_Server\_Error</p>"
                x-apidog-orders:
                  - hasError
                  - errorMessage
                  - validationErrors
                  - statusCode
                  - httpStatusCode
                required:
                  - hasError
                  - errorMessage
                  - validationErrors
                  - statusCode
                  - httpStatusCode
              example:
                hasError: true
                errorMessage: Invalid parameters entered
                validationErrors:
                  expenseTypeId: >-
                    Invalid parameters entered. (Accommodation = 1001,
                    Enterainment = 1002, Fuel = 1003, Other = 1004, Training =
                    1005, MeetingWithStaff = 1007, MeetingWithSales = 1008)
                statusCode: 1102
                httpStatusCode: 400
          headers: {}
          x-apidog-name: Bad Request
      security:
        - bearer: []
      x-apidog-folder: Venio/Expense
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3605021-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
