swagger: "2.0"
info:
  version: '1.0.1'
  title: V-Circle Mobile API
  license:
    name: Proprietary
    url: http://www.adv-fusionex.com
host: 172.16.61.10:11000
basePath: /api/0.1 
schemes:
  - http
  - https
consumes:
  - application/json 
produces:
  - application/json
securityDefinitions:
  basicClient:
    type: basic
  appClient:
    type: apiKey
    name: client_id
    in: query
    description: Client ID of the application. Use 582188299ec25b1e6cf75fe8 for development purpose.
parameters:
  promotion_id:
    name: promotion_id
    in: path
    type: string
    required: true
    description: Object ID of the promotion
  merchant_profile_id:
    name: merchant_profile_id
    in: path
    description: ObjectID of the merchant profile
    type: string
    required: true
  merchant_profile_id_type:
    name: merchant_profile_id_type
    in: path
    description: type of merchant unique id
    type: string
    required: true
    enum:
      - id
      - merchant-number
      - account-id
  point_type_code:
    in: path
    name: point_type_code
    required: true
    type: string
    description: Loyalty point type code
  address_id:
    name: address_id
    in: path
    type: string
    required: true
    description: Object ID of the address
  currency_code:
    in: path
    name: currency_code
    required: true
    type: string
    description: Currency Code
  transaction_id:
    name: transaction_id
    in: path
    type: string
    required: true
    description: Object ID of the transaction
  merchandise_id_type:
    name: merchandise_id_type
    in: path
    type: string
    required: true
    description: Types of the unique identified of the merchandise
    enum:
      - id
      - code
  merchandise_id:
    name: merchandise_id
    in: path
    type: string
    required: true
    description: Object ID of the merchandise
  merchant_id:
    name: merchant_id
    in: path
    type: string
    required: true
    description: Object ID of the merchant
  member_referral_code:
    name: member_referral_code
    in: path
    type: string
    required: true
    description: member referral code
  external_provider_type:
    name: external_provider_type
    in: path
    description: Types of the supported external provider
    type: string
    required: true
    enum:
      - facebook
      - google
      - kakao
      - wechat
      - naver
      - apple
  voucher_code:
    name: voucher_code
    in: path
    type: string
    required: true
    description: Unique code of the voucher
  account_id:
    name: account_id
    in: path
    required: true
    type: string
    description: Account ID of the member profile
  config_id_type:
    name: config_id_type
    in: path
    required: true
    type: string
    enum:
      - name
      - id
    description: Program config filter type
  config_id:
    name: config_id
    in: path
    required: true
    type: string
    description: Program config filter value
  caseCategoryId:
    name: caseCategoryId
    in: path
    required: true
    type: string
    description: Case CategoryID of Customer Support
  caseSubCategoryId:
    name: caseSubCategoryId
    in: path
    required: true
    type: string
    description: Case SubCategoryID of Customer Support
  caseStatusId:
    name: caseStatusId
    in: path
    required: true
    type: string
    description: Case StatusID of Customer Support
  caseChannelId:
    name: caseChannelId
    in: path
    required: true
    type: string
    description: Case ChannelID of Customer Support
  caseId:
    name: caseId
    in: path
    required: true
    type: string
    description: Case ID of Customer Support
  caseActionId:
    name: caseActionId
    in: path
    required: true
    type: string
    description: Case Action ID of Customer Support
  merchantId:
    name: merchantId
    in: path
    type: string
    required: true
    description: Object ID of the Merchant
  referenceNumber:
    name: referenceNumber
    in: path
    required: true
    type: string 
  paymentTypeId:
    name: paymentTypeId
    in: path
    required: true
    type: string
    description: Types of the unique identifier of the payment transaction
    enum:
      - referenceNumber
      - merchantProfileId
      - customerId
      - gatewayProvider
  paymentTypeValue:
    name: paymentTypeValue
    in: path
    required: true
    type: string
  paymentGateway:
    name: paymentGateway
    in: path
    required: true
    type: string 
paths:
  #security#
  /members:
    x-swagger-router-controller: MemberRouter
    post:
      operationId: signupMember
      security:
        - appClient: []
      description: Signup New Member
      tags:
        - Member
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - firstName
            properties:
              firstName:
                type: string
              lastName:
                type: string
              email:
                type: string
              password:
                type: string
                format: password
              gender:
                type: string
                enum:
                  - male
                  - female
              dateOfBirth:
                type: string
                format: date
              title:
                type: string
              mobile:
                type: object
                properties:
                  countryCode:
                    type: string
                  callingCode:
                    type: string
                  number:
                    type: string
              referrer:
                type: string
                description: Referral Code of the Referrer
              nationality:
                type: string
              passportNumber:
                type: string
              optIn:
                type: object
                properties:
                  email:
                    type: boolean
                  directMail: 
                    type: boolean
                  sms: 
                    type: boolean
                  telephone:
                    type: boolean
                  pushNotification:
                    type: boolean
              pdpas:
                type: object
              external:
                type: object
                properties:
                  providerType:
                    type: string
                    enum:
                      - facebook
                      - google
                      - kakao
                      - wechat
                      - naver
                      - apple
                    description: Type of external provider 
                  providerAccountId:
                    type: string
                    description: External provider ID
                  refreshToken:
                    type: string
                    description: refresh Token
                  accessToken:
                    type: string
                    description: access token
                  rawProviderData:
                    type: string
              preference:
                type: object
                properties:
                  languageCode:
                    type: string
              creationChannel:
                type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Member-Profile'
        400:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
        default:
          description: Unknown Error.
          schema:
            $ref: '#/definitions/Error'
  #otp
  /security/otp/send:
    x-swagger-router-controller: SecurityRouter
    post:
      operationId: otpSend
      description: send OTP.
      security:
        - appClient: []
      tags:
        - verification
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - trans_type
              - otp_type
              - tran_id
            properties:
              trans_type:
                type: string
              otp_type:
                type: string
                enum:
                  - email
                  - sms
              tran_id:
                type: string  
      responses:
        200:
          description: OTP Sent successfully.
          schema:
            type: object
            properties:
              response_oject:
                type: object
                description: object to be processed.
              message:
                type: string
                description: Message to the user.              
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'

  /security/otp/verify:
    x-swagger-router-controller: SecurityRouter
    post:
      operationId: otpVerification
      description: send OTP.
      security:
        - appClient: []
      tags:
        - verification
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - tran_id
              - otp
              - trans_type
            properties:
              tran_id:
                type: string                
              otp:
                type: string
              otp_type:
                type: string
                enum:
                  - email
                  - sms                
              data:
                type: string
              trans_type:
                type: string
      responses:
        200:
          description: OTP Verified successfully.
          schema:
            type: object
            properties:
              response_object:
                type: object
                description: object to be processed.
              message:
                type: string
                description: Message to the user.              
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
  
 
  /members/verification/resend:
    x-swagger-router-controller: MemberRouter
    post:
      operationId: resendMemberVerificationCode
      security:
        - appClient: []
      description: Request to resend member verification code
      tags:
        - Security
        - Member
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - email
            properties:
              email:
                type: string
                description: Email address of the member use in sign up process.
      responses:
        200:
          description: Sent.
          schema:
            type: object
            properties:
              email:
                type: string
                description: The recipient email of the resend verification code.
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'

  /members/verification/otp:
    x-swagger-router-controller: MemberRouter
    post:
      operationId: verificationByOTP
      description: send OTP.
      security:
        - basicClient: []        
      tags:
        - verification
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object            
            properties:
              data:
                type: string              
      responses:
        200:
          description: OTP Verified successfully.
          schema:
            type: object
            properties:
              response_oject:
                type: object
                description: object to be processed.
              message:
                type: string
                description: Message to the user.              
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error' 
            
  /members/profile:
    x-swagger-router-controller: MemberRouter
    get:
      operationId: getMemberProfile
      security:
        - basicClient: []
      description: Get full details of the member profile
      tags:
        - Member
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Member-Profile'
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
    patch:
      operationId: updateMemberProfile
      security:
        - basicClient: []
      description: Update member profile
      tags:
        - Member
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            properties:
              firstName:
                type: string
              lastName:
                type: string
              identityNumber:
                type: string
              passportNumber:
                type: string
              foreignIdentityNumber:
                type: string
              title:
                type: string
              gender:
                type: string
                enum:
                  - male
                  - female
                  - ''
              dateOfBirth:
                type: string
                format: date
              address:
                type: object
                properties:
                  addressLine1:
                    type: string
                  addressLine2:
                    type: string
                  postCode:
                    type: string
                  city:
                    type: string
                  state:
                    type: string
                  country:
                    type: string
              nationality:
                type: string
              home:
                type: object
                properties:
                  countryCode:
                    type: string
                  callingCode:
                    type: string
                  number:
                    type: string
              fax:
                type: object
                properties:
                  countryCode:
                    type: string
                  callingCode:
                    type: string
                  number:
                    type: string
              mobile:
                type: object
                properties:
                  countryCode:
                    type: string
                  callingCode:
                    type: string
                  number:
                    type: string
              profession:
                type: string
              designation:
                type: string
              race:
                type: string
              optIn:
                type: object
                properties:
                  email:
                    type: boolean
                  directMail:
                    type: boolean
                  sms:
                    type: boolean
                  telephone:
                    type: boolean
                  pushNotification:
                    type: boolean
              preference:
                type: object
                properties:
                  languageCode:
                    type: string
              companyName:
                type: string
              employeeNumber:
                type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Member-Profile'
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'

  /members/targetProfile:
    x-swagger-router-controller: MemberRouter
    get:
      operationId: getTargetMemberProfile
      security:
        - basicClient: []
      description: Get full details of the target member profile using member number
      tags:
        - Member
      parameters:
        - in: query
          name: memberNumber
          required: true
          type: string    
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Member-Profile'
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
  
  /members/profile/image:
    x-swagger-router-controller: MemberRouter
    put:
      operationId: putProfileImage
      security:
        - basicClient: []
      tags:
        - Member
      description: upload member profile image
      consumes:
        - multipart/form-data
      produces:
        - application/json
      parameters:
        - in: formData
          name: data
          required: true
          type: file
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              url:
                type: string
                description: image url
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
    post:
      operationId: postProfileImage
      security:
        - basicClient: []
      tags:
        - Member
      description: upload member profile image
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - base64
              - mimetype
            properties:
              base64:
                type: string
                format: byte
              mimetype:
                type: string
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              url:
                type: string
                description: image url
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'

  /members/email:
    x-swagger-router-controller: MemberRouter
    get:
      operationId: getOwnEmail
      security:
        - basicClient: []
      description: Get own member profile email
      tags:
        - Member
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              email:
                type: string
              pendingVerifiedEmail:
                type: string
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
    patch:
      operationId: updateOwnEmail
      security:
        - basicClient: []
      tags:
        - Member
        - Security
      description: update own email
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - newEmail
            properties:
              newEmail:
                type: string
      responses:
        200:
          description: An email will send to the new email for verification.
          schema:
            type: object
            properties:
              currentEmail:
                type: string
                description: Current member email. This email will remain valid before new email is verified.
              newEmail:
                type: string
                description: The requested change email.
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
    
  /members/email/verification:
    x-swagger-router-controller: MemberRouter
    post:
      operationId: verifyMemberEmail
      security:
        - basicClient: []
      description: This end point used to do verification of the member email
      tags:
        - Security
        - Member
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - code
            properties:
              code:
                type: string
                description: verification code
      responses:
        204:
          description: Verified.
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
  
  /members/email/verification/resend:
    x-swagger-router-controller: MemberRouter
    post:
      operationId: resendMemberEmailVerificationCode
      security:
        - basicClient: []
      description: Request to resend member email verification code
      tags:
        - Security
        - Member
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - email
            properties:
              email:
                type: string
                description: Unverified new Email address of the member
      responses:
        200:
          description: Sent.
          schema:
            type: object
            properties:
              email:
                type: string
                description: The recipient email of the resend verification code.
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
  
  /members/pin:
    x-swagger-router-controller: MemberRouter
    patch:
      operationId: updateOwnPin
      security:
        - basicClient: []
      tags:
        - Member
        - Security
      description: update own pin
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - newPin
            properties:
              newPin:
                type: string
                format: password
                minLength: 4
                maxLength: 6
      responses:
        204:
          description: OK
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
            
  #merchant#
  /merchants/profiles/{merchant_profile_id_type}/{merchant_profile_id}:
  
    x-swagger-router-controller: MerchantRouter
    parameters:
      - $ref: '#/parameters/merchant_profile_id_type'
      - $ref: '#/parameters/merchant_profile_id'
    get:
      operationId: getMerchantProfile
      security: [{ basicClient: [] }, { appClient: [] }]
      description: Get full details of the merchant profile
      tags:
        - Merchant
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Merchant-Profile'
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
                   
  /merchant-affiliates/{merchantId}:
    x-swagger-router-controller: MerchantAffiliateRouter
    parameters:
      - $ref: '#/parameters/merchantId'
    get:
      operationId: getMerchantAffiliates
      tags:
        - Merchant Affiliates
      security:
        - appClient: []
      description: Get Merchant Affiliates
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Merchant-Affiliate"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'       
         
  #payment#
  /payment/initiateMemberTopUp:
    x-swagger-router-controller: PaymentRouter
    post:
      operationId: initiateMemberTopUp
      tags: 
       - Payment
      security:
        - basicClient: []      
      description: |
        Initiate Member TopUp Payment
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - memberAccountId
              - merchantProfileId              
              - currencyCode
              - point
              - amount              
              - paymentGateway
            properties:
              memberAccountId:
                type: string
              merchantProfileId:
                type: string                
              pointTypeCode:
                type: string
              currencyCode:
                type: string
              paymentGateway:
                type: string
                enum:
                  - ADYEN
                  - STRIPE
                default: STRIPE
              point:
                type: number
              amount:
                type: number              
              conversion:
                type: object
                properties:
                  from:
                    type: object
                    required:
                      - type
                      - code
                      - amount
                    properties:
                      type:
                        type: string
                        enum:
                          - money
                          - point
                      code:
                        type: string
                      amount:
                        type: number
                  to:
                    type: object
                    required:
                      - type
                      - code
                      - amount
                    properties:
                      type:
                        type: string
                        enum:
                          - money
                          - point
                      code:
                        type: string
                      amount:
                        type: number
                  rate:
                    type: number
                    format: float
              customerId:
                type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/PaymentTransaction'
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'

  /payment/{referenceNumber}:
    x-swagger-router-controller: PaymentRouter
    parameters:
      - in: query
        name: accountId
        type: string
        required: true
      - $ref: '#/parameters/referenceNumber'
    get:
      operationId: getPaymentByReferenceNumber
      tags:
        - Payment
      security:
        - basicClient: []
      description: Get Payment Details
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/PaymentTransaction"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
    patch:
      operationId: updatePayment
      tags:
        - Payment
      security:
        - basicClient: []
      description: Update payment
      parameters:
        - in: body
          name: body
          required: true
          description: The Payment fields that need to be updated
          schema:
            type: object
            properties:
              externalDocumentNumber:
                type: string
              paymentMethod:
                type: string
              customerId:
                type: string
              isFromExternal:
                type: boolean
                default: false
              status:
                type: string
              other_info:
                type: object
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/PaymentTransaction'
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /payment/view/methods/{paymentGateway}:
    x-swagger-router-controller: PaymentRouter
    parameters:
      - $ref: '#/parameters/paymentGateway'
    get:
      operationId: getPaymentMethods
      tags:
        - Payment
      security:
        - basicClient: []
      description: Get Payment Methods
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/PaymentTransaction"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /payment/account/autotopup/{account_id}:
    x-swagger-router-controller: PaymentRouter
    parameters:
      - $ref: '#/parameters/account_id'
    get:
      operationId: getAutoTopup
      tags:
        - Payment
      security:
        - basicClient: []
      description: Get Auto-Topup setup
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/AutoTopup"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
    patch:
      operationId: updateAutoTopup
      tags: 
       - Payment
      security:
        - basicClient: []
      description: |
        Update Auto-Topup setup
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            properties:
              activateAutoTopUp:
                type: boolean
              autoTopUp:
                type: array
                items:
                  type: object
                  properties:
                    currencyCode:
                      type: string
                    pointType:
                      type: string
                    pointThreshold:
                      type: number
                    amountTopUp:
                      type: number                    
                    paymentMethod:
                      type: string
                    gateWayProvider:
                      type: string
                      enum:
                        - ADYEN
                        - STRIPE
                      default: STRIPE
                    last4:
                      type: string
                    brand:
                      type: string
                    status:
                      type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/AutoTopup'
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /payment/card/setup/new/{paymentGateway}:
    x-swagger-router-controller: PaymentRouter
    parameters:
      - $ref: '#/parameters/paymentGateway'
    get:
      operationId: getCardSetupSession
      tags:
        - Payment
      security:
        - basicClient: []
      description: Get Card Session setup
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              sessionId:
                type: string
                description: Card setup session id
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'

  #point#      
  /config/point-types:
    x-swagger-router-controller: PointRouter
    parameters:
      - in: query
        name: merchantProfileId
        type: string
        required: false      
    get:
      operationId: getPointTypeList
      security: [{ basicClient: [] }, { appClient: [] }]
      tags:
        - Config
        - Point
      description: Get list of point type
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/Point-Type'
              totalCount:
                type: number
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error' 
            
  /points/{point_type_code}/balance:
    x-swagger-router-controller: PointRouter
    parameters:
      - $ref: '#/parameters/point_type_code'
    get:
      operationId: getPointBalance
      security:
        - basicClient: []
      description: Get member point balance
      tags:
        - Point
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              pointTypeCode:
                type: string
              pointBalance:
                type: number
                format: float
                description: Total point balance to date.
        default:
          description: Unknown Error.
          schema:
            $ref: '#/definitions/Error'
  
  /points-topup:
    x-swagger-router-controller: PaymentRouter
    post:
      operationId: getTopUpPointsConversion
      description: Get Top-up Points Conversion
      security:
        - basicClient: []
      tags:
        - Payment        
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - pointTypeCode
              - currencyCode
              - amount
            properties:
              pointTypeCode:
                type: string
              currencyCode:
                type: string            
              amount:
                type: number
                format: float
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Points-Topup"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /points-topup/{currency_code}/{merchant_profile_id}:
    x-swagger-router-controller: PaymentRouter
    parameters:      
      - $ref: '#/parameters/currency_code'
      - $ref: '#/parameters/merchant_profile_id'
    get:
      operationId: getTopUpCurrency
      tags:
        - Payment
      security:
        - basicClient: []
      description: Get Top-up Currency
      responses:
        200:
          description: OK
          schema:
            $ref: "#/definitions/Currency-Topup"
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'   
        
  /points/transactions:
    x-swagger-router-controller: PointRouter
    get:
      operationId: getTransactionList
      security:
        - basicClient: []
      description: Get a list of point transaction record
      tags:
        - Point
      parameters:
        - in: query
          name: merchantProfileId
          type: string
          required: false
        - in: query
          name: pointTypeCode
          type: string
          required: false
        - in: query
          name: type
          type: string
          required: false
          enum:
            - award
            - redeem
            - adjustment-addition
            - adjustment-deduction
            - award-on-redeem
        - in: query
          name: types
          type: array
          required: false
          description: Filter - exact match
          items:
            type: string
            enum:
              - award
              - redeem
              - adjustment-addition
              - adjustment-deduction
              - award-on-redeem
        - in: query
          name: status
          type: string
          required: false
          enum:
            - active
            - voided
            - rejected
        - in: query
          name: transactionDateTimeFrom
          type: string
          format: date-time
          required: false
          description: Filter - range match
        - in: query
          name: transactionDateTimeTo
          type: string
          format: date-time
          required: false
          description: Filter - range match      
        - in: query
          name: sortBy
          type: string
          required: false
          default: transactionDateTime
          description: Pagination support.
          enum:
            - type
            - transactionDateTime
            - pointTypeCode
            - point
            - status
            - createdAt
            - sales.currency
            - sales.amount
        - in: query
          name: sortDir
          type: string
          default: desc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: limit
          description: Pagination parameters. Number of record to return.
          required: false
          type: number
          default: 1000
        - in: query
          name: nextPageToken
          description: Pagination parameters. The token to get the next 'limit' of record.
          required: false
          type: string
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/Point-Transaction-Mini'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
        default:
          description: Unknown Error.
          schema:
            $ref: '#/definitions/Error'

  /points/transactions/{transaction_id}:
    x-swagger-router-controller: PointRouter
    parameters:
      - $ref: '#/parameters/transaction_id'
    get:
      operationId: getTransaction
      security:
        - basicClient: []
      description: Get active point transaction detail
      tags:
        - Point
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/Point-Transaction'
        default:
          description: Unknown Error.
          schema:
            $ref: '#/definitions/Error'
  
  /points/transaction/transfer:
    x-swagger-router-controller: PointRouter
    post:
      operationId: createPointTransfer
      security:
        - basicClient: []
      description: Handles member point transfer request
      tags:
        - Member
        - Point
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - fromMemberAccountId
              - toMemberAccountId
              - pointTypeCode
              - point
              - remark
            properties:
              fromMemberAccountId:
                type: string
                description: User account that give point.
              toMemberAccountId:
                type: string
                description: User account that accept point.    
              pointTypeCode:
                type: string
                description: Point Type.
              point:
                type: number
                description: Amount of point to during the transaction.
              remark:
                type: string
                description: Remark for the point transfer.
              transactionDateTime:
                type: string
                format: date-time
                description: If this field is ignore, system to use current server date time.      
              PIN:
                type: string
                description: transaction PIN.
      responses:
        200:
          description: OK.
          schema:
            type: object
            properties:
              pointTypeCode:
                type: string
              transferredPoint:
                type: number
                description: Total transferred amount
              newPointBalance:
                type: string
                format: date-time
              expiryDate:
                type: string
                description: Approval Code of the redeem transaction
        default:
          description: Bad Request.
          schema:
            $ref: '#/definitions/Error'
  
  /points/transactions/redeem-with-award:
    x-swagger-router-controller: PointRouter
    post:
      operationId: createRedeemWithAwardTransaction
      security:
        - basicClient: []
      description: Create point redemption transaction with Points Awarding
      tags:
        - Point
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - merchantProfileId
              - pointTypeCode
              - currencyCode
              - redeemAmount
            properties:
              externalDocumentNumber:
                type: string
                description: An external document number for audit purpose (i.e. Receipt Number)
              merchantProfileId:
                type: string
                description: User account that accept the point redemption request. (i.e. merchnat)
              pointTypeCode:
                type: string
                description: Point Type
              currencyCode:
                type: string
                description: Point Type
              redeemAmount:
                type: number
                format: double
                description: redeem amount in money value.
              salesAmount:
                type: number
                format: double
                description: Transaction Sales Amount.
              secureCode:
                type: string
                description: If present, system to perform validity checking.
              transactionDateTime:
                type: string
                format: date-time
                description: System to use server datetime if no provided.
              remark:
                type: string
                description: Transaction remark
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              pointTypeCode:
                type: string
                description: Redeemed point type
              redeemedPoint:
                type: number
                format: double
                description: Redeemed Point
              currency:
                type: string
              redeemedAmount:
                type: number
                format: double
                description: Redeemed Amount
              pointBalance:
                type: number
                format: double
                description: Total point balance.
              approvalCode:
                type: string
                description: Approval Code of the redeem transaction
              secureCode:
                type: string
              transactionDateTime:
                type: string
                format: date-time
        default:
          description: Unknown Error.
          schema:
            $ref: '#/definitions/Error'

  /multi-points/transactions/redeems:
    x-swagger-router-controller: PointRouter
    post:
      operationId: createMultiRedeemTransaction
      security:
        - basicClient: []
      description: Create multi point type redemption transaction
      tags:
        - Point
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - merchantProfileId
              - currencyCode
            properties:
              externalDocumentNumber:
                type: string
                description: An external document number for audit purpose (i.e. Receipt Number)
              merchantProfileId:
                type: string
                description: merchant profile.              
              pointTypeCode:
                type: string
              currencyCode:
                type: string
              redeemAmount:
                type: number
                format: float
                description: i.e. Sales amount excluding tax amunt (Default to sales amount)              
              salesAmount:
                type: number
                format: double
                description: Transaction Sales Amount.                            
              secureCode:
                type: string
                description: If present, system to perform validity checking.
              transactionDateTime:
                type: string
                format: date-time
                description: If this field is ignore, system to use current server date time.
              remark:
                type: string
                description: Transaction remark.
              redeems:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - amount
                    - pointTypeCode
                  properties:
                    amount:
                      type: number
                      format: double
                    pointTypeCode:
                      type: string              
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              currency:
                type: string
              totalRedeemedAmount:
                type: number
                format: double
                description: Total redeemed amount
              transactionDateTime:
                type: string
                format: date-time
              approvalCode:
                type: string
                description: Approval Code of the redeem transaction
              transactions:
                type: array
                items:
                  type: object
                  properties:
                    _id:
                      type: string
                      description: Transaction ID
                    documentNumber:
                      type: string
                      description: Transaction reference number
                    pointTypeCode:
                      type: string
                      description: Redeemed point type
                    redeemedPoint:
                      type: number
                      format: double
                      description: Redeemed Point
                    redeemedAmount:
                      type: number
                      format: double
                      description: Redeemed amount
                    pointBalance:
                      type: number
                      format: double
                      description: Total point balance
             
  #promotions#
  /promotions:
    x-swagger-router-controller: PromotionRouter
    get:
      operationId: getPromotionList
      description: Get a list of active promotion.
      tags:
        - Promotion
      parameters:
        - name: code
          type: string
          in: query
          required: false
        - in: query
          name: merchant.accountId
          type: string
          required: false
          description: Filter - exact match
        - in: query
          name: merchant.accountNumber
          type: string
          required: false
          description: Filter - exact match
        - in: query
          name: merchant.profileId
          type: string
          required: false
          description: Filter - exact match
        - in: query
          name: merchant.profileNumber
          type: string
          required: false
          description: Filter - exact match
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: startDate
          enum:
            - code
            - name
            - startDate
            - endDate
            - displayDate
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: desc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/Promotion-Mini'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
 
  # Customer Support
  /caseCategory:
    x-swagger-router-controller: CustomerSupportRouter
    get:
      operationId: getCaseCategoryList
      description: Get a list of Case Category
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      parameters:
        - in: query
          name: pagingMode
          type: string
          required: false
          enum:
            - continuous
            - page
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: order          
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: asc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
        - in: query
          name: page
          required: false
          type: string
          description: Pagination Support. The page number
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/CaseCategory'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
              totalPage:
                type: number
                description: Only available for page mode.
              currentPage:
                type: number
                description: Only available for page mode.
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /caseSubCategory:
    x-swagger-router-controller: CustomerSupportRouter
    get:
      operationId: getCaseSubCategoryList
      description: Get a list of Case SubCategory
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      parameters:
        - in: query
          name: caseCategoryId
          type: string
          required: false
        - in: query
          name: pagingMode
          type: string
          required: false
          enum:
            - continuous
            - page
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: order          
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: asc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
        - in: query
          name: page
          required: false
          type: string
          description: Pagination Support. The page number
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/CaseCategory'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
              totalPage:
                type: number
                description: Only available for page mode.
              currentPage:
                type: number
                description: Only available for page mode.
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
  
  /caseStatus:
    x-swagger-router-controller: CustomerSupportRouter
    get:
      operationId: getCaseStatusList
      description: Get a list of Case Status
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      parameters:
        - in: query
          name: pagingMode
          type: string
          required: false
          enum:
            - continuous
            - page
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: order          
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: asc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
        - in: query
          name: page
          required: false
          type: string
          description: Pagination Support. The page number
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/CaseStatus'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
              totalPage:
                type: number
                description: Only available for page mode.
              currentPage:
                type: number
                description: Only available for page mode.
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'
 
  
  /supportCase:
    x-swagger-router-controller: CustomerSupportRouter
    post:
      operationId: createSupportCase
      description: Create Support Case
      security:
        - basicClient: []
      tags:
        - CustomerSupport
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - caseCategoryId
              - caseSubCategoryId              
              - title
              - description
            properties:
              caseCategoryId:
                type: string
              caseSubCategoryId:
                type: string
              title:
                type: string
              description:
                type: string
              memberName:
                type: string
              memberNumber:
                type: string
              contactNumber:
                type: string
              emailAddress:
                type: string
              attachment:
                type: string
                format: byte
              mimetype:
                type: string
              other_info:
                type: object
      responses:
        200:
          description: Customer Case created.
          schema:
            type: object
            properties:
              response_oject:
                type: object
                description: object to be processed.
              message:
                type: string
                description: Message to the user.
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
    get:
      operationId: getCaseList
      description: Get a list of Cases
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      parameters:
        - in: query
          name: caseNumber
          type: string
          required: false
        - in: query
          name: memberProfileId
          type: string
          required: false
        - in: query
          name: memberProfileIds
          type: array
          items:
            type: string
          required: false
        - in: query
          name: caseCategoryId
          type: string
          required: false
        - in: query
          name: caseCategoryIds
          type: array
          items:
            type: string
          required: false
        - in: query
          name: caseSubCategoryId
          type: string
          required: false
        - in: query
          name: caseSubCategoryIds
          type: array
          items:
            type: string
          required: false
        - in: query
          name: caseChannelId
          type: string
          required: false
        - in: query
          name: caseChannelIds
          type: array
          items:
            type: string
          required: false
        - in: query
          name: title
          type: string
          required: false
        - in: query
          name: caseStatusId
          type: string
          required: false
        - in: query
          name: caseStatusIds
          type: array
          items:
            type: string
          required: false
          description: Filter - multiple matches
        - in: query
          name: caseStartDateFrom
          type: string
          format: date
          required: false
          description: filter - range match
        - in: query
          name: caseStartDateTo
          type: string
          format: date
          required: false
          description: filter - range match
        - in: query
          name: updatedAtFrom
          type: string
          format: date-time
          required: false
        - in: query
          name: updatedAtTo
          type: string
          format: date-time
          required: false
        - in: query
          name: assignedTo
          type: string
          required: false
        - in: query
          name: assignedToName
          type: string
          required: false
        - in: query
          name: includeActions
          type: boolean
          default: true
          required: false
        - in: query
          name: pagingMode
          type: string
          required: false
          enum:
            - continuous
            - page
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: caseStartDateTime
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: desc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
        - in: query
          name: page
          required: false
          type: string
          description: Pagination Support. The page number
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/SupportCase'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
              totalPage:
                type: number
                description: Only available for page mode.
              currentPage:
                type: number
                description: Only available for page mode.
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'

  /supportCase/{caseId}:
    x-swagger-router-controller: CustomerSupportRouter
    parameters:
      - $ref: '#/parameters/caseId'
    get:
      operationId: getCaseDetail
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      description: Get Case Detail
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SupportCase'
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'

  /supportCase/action:
    x-swagger-router-controller: CustomerSupportRouter
    post:
      operationId: createSupportCaseAction
      description: Create Support Case Action
      security:
        - basicClient: []
      tags:
        - CustomerSupport
      parameters:
        - in: body
          name: body
          required: true
          schema:
            type: object
            required:
              - caseId
              - description
            properties:
              caseId:
                type: string               
              description:
                type: string
              caseStatusId:
                 type: string
              attachment:
                type: string
                format: byte
              mimetype:
                type: string
              other_info:
                type: object
      responses:
        200:
          description: Customer Case Action created.
          schema:
            type: object
            properties:
              response_oject:
                type: object
                description: object to be processed.
              message:
                type: string
                description: Message to the user.
        default:
          description: Unknown error
          schema:
            $ref: '#/definitions/Error'
    get:
      operationId: getCaseActionList
      description: Get a list of Cases
      tags:
        - CustomerSupport
      security:
        - basicClient: []
      parameters:
        - in: query
          name: caseId
          type: string
          required: false
        - in: query
          name: actionTakenBy
          type: string
          required: false
        - in: query
          name: isActionTakenByAgent
          type: boolean
          required: false        
        - in: query
          name: caseStatusId
          type: string
          required: false
        - in: query
          name: actionDateFrom
          type: string
          format: date
          required: false
          description: filter - range match
        - in: query
          name: actionDateTo
          type: string
          format: date
          required: false
          description: filter - range match
        - in: query
          name: pagingMode
          type: string
          required: false
          enum:
            - continuous
            - page
        - in: query
          name: limit
          type: number
          required: false
          description: Pagination support. number of record to return
        - in: query
          name: sortBy
          type: string
          required: false
          default: actionDateTime
          description: Pagination support. Sorted field.
        - in: query
          name: sortDir
          type: string
          default: desc
          required: false
          enum:
            - asc
            - desc
          description: Pagination support. Sorting direction.
        - in: query
          name: nextPageToken
          required: false
          type: string
          description: Pagination Support. Token to get next 'limit' of the record
        - in: query
          name: page
          required: false
          type: string
          description: Pagination Support. The page number
      responses:
        200:
          description: OK
          schema:
            type: object
            properties:
              results:
                type: array
                items:
                  $ref: '#/definitions/SupportCaseAction'
              nextPageToken:
                type: string
                description: Only available for continuous mode. if nextPageToken is empty, means no more result to load.
              totalCount:
                type: number
              totalPage:
                type: number
                description: Only available for page mode.
              currentPage:
                type: number
                description: Only available for page mode.
        default:
          description: Bad Request
          schema:
            $ref: '#/definitions/Error'  
      
            
definitions:
  OAuthToken:
    type: object
    properties:
      token_type:
        type: string
        enum:
          - bearer
      access_token:
        type: string
      expires_in:
        type: number
        format: int32
      refresh_token:
        type: string
      userRole:
        type: string
      scopes:
        type: array
        items:
          type: string

  Member-Address:
    type: object
    properties:
      addressLine1:
        type: string
      addressLine2:
        type: string
      postCode:
        type: string
      city:
        type: string
      state:
        type: string
      country:
       type: string
  
  Member-Profile:
    type: object
    properties:
      _id:
        type: string
      firstName:
        type: string
      lastName:
        type: string
      fullName:
        type: string
      memberNumber:
        type: string
      referralCode:
        type: string
      email: 
        type: string
      identityNumber:
        type: string
      passportNumber:
        type: string
      foreignIdentityNumber:
        type: string
      status:
        type: string
      title:
        type: string
      gender:
        type: string  
        enum:
          - male
          - female
      dateOfBirth:
        type: string
        format: date
      address:
        type: object
        properties:
          addressLine1:
            type: string
          addressLine2:
            type: string
          postCode:
            type: string
          city:
            type: string
          state:
            type: string
          country:
            type: string  
      nationality:
        type: string  
      mobile:
        type: object
        properties:
          countryCode:
            type: string
          callingCode:
            type: string
          number:
            type: string
      registrationDateTime:
        type: string
        format: date-time
      profileImageUrl:
        type: string
      profession:
        type: string
      designation:
        type: string
      race:
        type: string
      optIn:
        type: object
        properties:
          email:
            type: boolean
          directMail: 
            type: boolean
          sms: 
            type: boolean
          telephone: 
            type: boolean
          pushNotification: 
            type: boolean
      accountId:
        type: string
      verified:
        type: boolean
      memberTierCode:
        type: string
      memberTierName:
        type: string
      memberTierColor:
        type: object
        properties:
          r:
            type: number
            format: int32
          g:
            type: number
            format: int32
          b:
            type: number
            format: int32
      externals:
        type: array
        items:
          type: object
          properties:
            code:
              type: string
            id:
              type: string
      gamingPatronNumber:
        type: string
      gamingPatronTierCode:
        type: string
      referrer:
        type: string
      referrerFullName:
        type: string
        
  Member-Face-Profile:
    type: object
    properties:
      group :
        type : object      
  
  Merchant-Profile:
    type: object
    properties:
      _id:
        type: string
        description: Object ID of the merchant profile
      name:
        type: string
      merchantNumber:
        type: string
      category:
        type: string
      industry:
        type: string
      location:
        type: string
      logoImageUrl:
        type: string
      address:
        type: object
        properties:
          addressLine1:
            type: string
          addressLine2:
            type: string
          postCode:
            type: string
          city:
            type: string
          state:
            type: string
          country:
            type: string
      companyName:
        type: string
      phone:
        type: object
        properties:
          callingCode:
            type: string
          countryCode:
            type: string
          number:
            type: string
      fax:
        type: object
        properties:
          callingCode:
            type: string
          countryCode:
            type: string
          number:
            type: string
      accountId:
        type: string
      accountNumber:
        type: string
      currencies:
        type: array
        items:
          type: string
      pointTypes:
        type: array
        items:
          type: string
          
  Merchant-Profile-Mini:
    type: object
    properties:
      _id:
        type: string
        description: Object ID of the merchant profile
      name:
        type: string
      merchantNumber:
        type: string
      category:
        type: string
      industry:
        type: string
      location:
        type: string
      logoImageUrl:
        type: string
      address:
        type: object
        properties:
          addressLine1:
            type: string
          addressLine2:
            type: string
          postCode:
            type: string
          city:
            type: string
          state:
            type: string
          country:
            type: string
      companyName:
        type: string
      phone:
        type: object
        properties:
          callingCode:
            type: string
          countryCode:
            type: string
          number:
            type: string
      fax:
        type: object
        properties:
          callingCode:
            type: string
          countryCode:
            type: string
          number:
            type: string
       
  Nearest-Merchant:
    type: object
    properties:
      _id:
        type: string
        description: Object ID of the merchant profile
      name:
        type: string
      merchantNumber:
        type: string    
      Latitude:
        type: number
        format: float
      Longtiude:
        type: number
        format: float      
      distance:
        type: number
        format: float
    
  Promotion:
    properties:
      _id:
        type: string
        description: Object ID of the promotion
      code:
        type: string
      name:
        type: string
      title:
        type: string
      summary:
        type: string
      description:
        type: string
      termAndCondition:
        type: string
      bannerImageUrl:
        type: string
      summaryImageUrl:
        type: string
      detailImageUrls:
        type: array
        items:
          type: string
      effectiveDate:
        type: object
        properties:
          start: 
            type: string
          end:
            type: string
      merchant:
        type: object
        properties:
          id:
            type: string
            description: merchant profile id
          name:
            type: string
      share:
        type: object
        properties:
          message:
            type: string
          imageUrl:
            type: string
          targetUrl:
            type: string
      status:
        type: string
      lang:
        type: string
      translations:
        type: array
        items:
          type: object
          properties:
            name:
              type: string
            title:
              type: string
            summary:
              type: string
            description:
              type: string
            termAndCondition:
              type: string
            bannerImageUrl:
              type: string
            summaryImageUrl:
              type: string
            detailImageUrls:
              type: array
              items:
                type: string
            share:
              type: object
              properties:
                message:
                  type: string
                imageUrl:
                  type: string
                targetUrl:
                  type: string
            lang:
              type: string
  
  Promotion-Mini:
    type: object
    properties:
      _id:
        type: string
        description: Object ID of the promotion
      code:
        type: string
      name:
        type: string
      title:
        type: string
      summary:
        type: string
      description:
        type: string
      bannerImageUrl:
        type: string
      summaryImageUrl:
        type: string
      effectiveDate:
        type: object
        properties:
          start: 
            type: string
          end:
            type: string
      status:
        type: string
      merchantName:
        type: string
      lang:
        type: string
      translations:
        type: array
        items:
          type: object
          properties:
            name:
              type: string
            title:
              type: string
            summary:
              type: string
            description:
              type: string
            bannerImageUrl:
              type: string
            summaryImageUrl:
              type: string
            lang:
              type: string
  
  Point-Transaction:
    type: object
    properties:
      _id:
        type: string
      externalDocumentNumber:
        type: string
      merchant:
        type: object
        properties:
          profileId:
            type: string
          profileNumber:
            type: string
          accountId:
            type: string
          name:
            type: string
          location:
            type: string
          logoImageUrl:
            type: string
          address:
            type: object
            properties:
              addressLine1:
                type: string
              addressLine2:
                type: string
              postCode:
                type: string
              city:
                type: string
              state:
                type: string
              country:
                type: string   
      transactionDateTime:
        type: string
        format: date-time
      type:
        type: string
        enum:
          - award
          - redeem
      point:
        type: number
        format: float
      pointTypeCode:
        type: string
      amount:
        type: number
        format: float
        description: |
          if type = award, then indicate as award amount
          if type = redeem, then indicate as redeem amount
      currency:
        type: string
        description: The currency of the transaction amount. i.e. myr / usd / etc
      salesAmount:
        type: number
        format: float
      approvalCode:
        type: string
        description: Approval Code of a redeem transaction
      secureCode:
        type: string
      status:
        type: string
      remark:
        type: string
  
  Point-Transaction-Mini:
    type: object
    properties:
      _id:
        type: string
      externalDocumentNumber:
        type: string
      merchant:
        type: object
        properties:
          profileId:
            type: string
          profileNumber:
            type: string
          accountId:
            type: string
          name:
            type: string
          logoImageUrl:
            type: string
      transactionDateTime:
        type: string
        format: date-time
      type:
        type: string
        enum:
          - award
          - redeem
      status:
        type: string
        enum:
          - active
          - voided
          - rejected
      point:
        type: number
        format: float
      pointTypeCode:
        type: string
      amount:
        type: number
        format: float
        description: |
          if type = award, then indicate as award amount
          if type = redeem, then indicate as redeem amount
      currency:
        type: string
        description: The currency of the transaction amount. i.e. myr / usd / etc
      salesAmount:
        type: number
        format: float
  
  Point-Type:
    properties:
      name:
        type: string
      code:
        type: string
      description:
        type: string
      decimalPlace:
        type: number
        format: int32
  
  Voucher:
    type: object
    properties:
      _id:
        type: string
      code:
        type: string
      masterVoucher:
        type: object
        properties:
          id: 
            type: string
          code:
            type: string
          name: 
            type: string
          description:
            type: string
          termAndCondition:
            type: string
          webImageUrl:
            type: string
          mobileImageUrl:
            type: string
          lang:
            type: string
          translations:
            type: array
            items:
              type: object
              properties:
                name: 
                  type: string
                description:
                  type: string
                termAndCondition:
                  type: string
                webImageUrl:
                  type: string
                mobileImageUrl:
                  type: string
                lang:
                  type: string
      effectiveDate:
        type: string
        format: date
      expiryDate:
        type: string
        format: date
      value:
        type: object
        properties:
          type:
            type: string
            enum:
              - cash
              - point
              - non-cash
              - discount
          currency:
            type: string
          amount: 
            type: number
            format: float
          pointTypeCode:
            type: string
          point:
            type: number
            format: float
          discountType:
            type: string
            enum:
              - percentage
              - fixed-amount
          percentage:
            type: number
            format: double
      utilizedAt:
        type: string
        format: date
      voidedAt: 
        type: string
        format: date
      actualStatus:
        type: string
        enum:
          - active
          - expired
          - utilized
          - void
          
  Merchandise-Category-Tree:
    type: object
    properties:
      name:
        type: string
      key:
        type: string
      children:
        type: array
        items:
          type: object
          $ref: '#/definitions/Merchandise-Category-Tree'
  
  Merchandise-Mini:
    type: object
    properties:
      _id:
        type: string
      code:
        type: string
      name:
        type: string
      description:
        type: string
      point:
        type: number
        format: float
      pointTypeCode:
        type: string
      merchandiseImageUrl:
        type: string
      allowShipping:
        type: boolean
      balance:
        type: number
        format: float
        description: value -1 indicates unlimited stock
  
  Merchandise:
    type: object
    properties:
      id:
        type: string
      code:
        type: string
      name:
        type: string
      description:
        type: string
      startDate:
        type: string
        format: date
      endDate:
        type: string
        format: date
      categories:
        type: array
        items:
          type: string
      point:
        type: number
        format: float
      pointTypeCode:
        type: string
      amount:
        type: string
      gst:
        type: number
        format: float
      currency:
        type: string
      termAndCondition:
        type: string
      merchandiseImageUrl:
        type: string
      allowShipping:
        type: boolean
      balance:
        type: number
        format: float
        description: value -1 indicates unlimited stock
  
  Merchandise-Cart:
    type: object
    properties:
      merchandiseId:
        type: string
      merchandise:
        type: object
        properties:
          _id:
            type: string
          code:
            type: string
          name:
            type: string
          description:
            type: string
          point:
            type: number
            format: float
          pointTypeCode:
            type: string
          merchandiseImageUrl:
            type: string
          allowShipping:
            type: boolean
      quantity:
        type: number
        format: int32
    
  Merchandise-Rating:
    type: object
    properties:
      _id:
        type: string
      merchandiseId:
        type: string
      userId:
        type: string
      rating:
        type: string

  Merchandise-Feedback:
    type: object
    properties:
      merchandiseId:
        type: string
      userId:
        type: string      
      createdAt:
        type: string
        format: date-time
      comment:
        type: string

  Merchandise-Feedback-Mini:
    type: object
    properties:
      userId: 
        type: string
      createdAt:
        type: string
        format: date-time
      fullName:
        type: string
      imageUrl:
        type: string
      comment:
        type: string
        
  Merchandise-Feedback-Rating-Mini:
    type: object
    properties:
      userId: 
        type: string
      createdAt:
        type: string
        format: date-time
      fullName:
        type: string
      imageUrl:
        type: string
      comment:
        type: string
      rating:
        type: number
        
  Merchandise-Favourite:
    type: object
    properties:
      _id:
        type: string
      merchandiseId:
        type: string
      userId:
        type: string      
      isLike:
        type: boolean      
    
  Program-Supported-Language:
    type: object
    properties:
      code:
        type: string
      name:
        type: string
    
  ProgramConfig:
    type: object
    properties:
      name:
        type: string 
      description:
        type: string
      value:
        type: object    
  
  Member-Card:
    type: object
    properties:
      cardMasterId:
        type: string
        description: Unique ID of the Card Master
      cardMasterName:
        type: string
        description: Card Master name
      cardMasterCode:
        type: string
        description: Card Master Code
      displayName:
        type: string
      cardNumber:
        type: string
      issuanceDateTime:
        type: string
        format: date-time
      expiryDate:
        type: string
        format: date
        description: Expiry date of the card. If empty indicate that the card will never expired.
      actualstatus:
        type: string
        enum:
          - active
          - inactive
          - terminated
          - blacklisted
          - expired
        description: Card actual status. All status is same with status field, except active. Active status can be either active or expired.
      cardType:
        type: string
        enum:
          - main
          - supplementary
      frontImageUrl:
        type: string
      backImageUrl:
        type: string

  User-Login-Log:
    type: object
    properties:
      profileId:
        type: string
      latestLoginAt:
        type: string
        format: date-time
      latestLoginChannel:
        type: string

  User-Transaction-Log:
    type: object
    properties:
      accountId:
        type: string
      transactionDateTime:
        type: string
        format: date-time
      type:
        type: string
      pointTypeCode:
        type: string
      pointBalance:
        type: number
    
  Merchant-Profile-Rating:
    type: object
    properties:
      _id:
        type: string
      merchantId:
        type: string
      userId:
        type: string
      rating:
        type: string

  Merchant-Profile-Feedback:
    type: object
    properties:
      merchantId:
        type: string
      userId:
        type: string      
      createdAt:
        type: string
        format: date-time
      comment:
        type: string

  Merchant-Profile-Feedback-Mini:
    type: object
    properties:
      userId: 
        type: string
      createdAt:
        type: string
        format: date-time
      fullName:
        type: string
      imageUrl:
        type: string
      comment:
        type: string
        
  Merchant-Profile-Feedback-Rating-Mini:
    type: object
    properties:
      userId: 
        type: string
      createdAt:
        type: string
        format: date-time
      fullName:
        type: string
      imageUrl:
        type: string
      comment:
        type: string
      rating:
        type: number
        
  Merchant-Profile-Favourite:
    type: object
    properties:
      _id:
        type: string
      merchantId:
        type: string
      userId:
        type: string      
      isLike:
        type: boolean

  Recommend-Product:
    type: object
    properties:
      confidence:
        type: number
      item_id:
        type: string
      merchandise:
        type: object
        properties:
          _id:
            type: string
          code:
            type: string
          name:
            type: string
          description:
            type: string
          merchandiseImageUrl:
            type: string
          lang:
            type: string
  
  CaseCategory:
    type: object
    properties:
      casecategoryId:
        type: string
      code:
        type: string
      name:
        type: string
      shortName:
        type: string
      remark:
        type: string
      order:
        type: string
      status:
        type: string
      isSystem:
        type: boolean
      isDelete:
        type: boolean
      webImage:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost: 
            type: string
      mobileImage:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost: 
            type: string

  CaseSubCategory:
    type: object
    properties:      
      categoryId:
        type: string
      code:
        type: string
      name:
        type: string
      shortName:
        type: string
      remark:
        type: string
      status:
        type: string
      isSystem:
        type: boolean
      isDelete:
        type: boolean
      webImage:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost: 
            type: string
      mobileImage:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost: 
            type: string

  CaseStatus:
    type: object
    properties:      
      code:
        type: string
      name:
        type: string
      shortName:
        type: string
      remark:
        type: string
      color:
        type: string
      order:
        type: number
      status:
        type: string
      isSystem:
        type: boolean
      isDeleted:
        type: boolean
      other_info:
        type: object

  CaseChannel:
    type: object
    properties:      
      code:
        type: string
      name:
        type: string
      shortName:
        type: string
      remark:
        type: string
      order:
        type: number
      status:
        type: string
      isSystem:
        type: boolean
      isDeleted:
        type: boolean
      other_info:
        type: object

  SupportCase:
    type: object
    properties:      
      categoryId:
        type: string
      subcategoryId:
        type: string
      memberProfileId:
        type: string
      caseNumber:
        type: string
      title:
        type: string
      description:
        type: string
      status:
        type: string
      caseStartDateTime:
        type: string
      caseEnDateTime:
        type: string
      isDelete:
        type: boolean

  SupportCaseAction:
    type: object
    properties:      
      caseId:
        type: string
      description:
        type: string
      actionTakenBy:
        type: string
      isActionTakenByAgent:
        type: boolean
      actionDateTime:
        type: string
        format: date
      attachment:
        type: object
        properties:
          mimetype:
            type: string
          url:
            type: string
          metadata:
            type: object
          filehost:
            type: string
      caseStatusId:
        type: string
      other_info:
        type: object
      isDeleted:
        type: boolean

  Merchant-Affiliate:
    type: object
    properties:
      programId:
        type: string
      merchantId:
        type: string
      name:
        type: string
      affiliates:
        type: array
        items:
          type: object
          properties:
            merchantId:
              type: string
            name:
              type: string
            logoImageUrl:
              type: string
      other_info:
        type: object

  Merchandise-360-View-Image:
    type: object
    properties:
      imageSetId: 
        type: string
      order: 
        type: number
      imagePath:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost:
            type: string

  Merchandise-360-View:
    type: object
    properties:
      programId:
        type: string
      merchandiseId:
        type: string
      status:
        type: string
      title: 
        type: string
      imageOrder:
        type: array
        items:
          type: string

  Merchandise-Panorama:
    type: object
    properties:
      programId:
        type: string
      merchandiseId:
        type: string
      status:
        type: string
      title: 
        type: string
      imagePath:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost:
            type: string

  Merchant-Panorama:
    type: object
    properties:
      _id:
        type: string
      programId:
        type: string
      merchantId:
        type: string
      imagePath:
        type: object
        properties:
          mimeType: 
            type: string
          url:
            type: string
          metadata:
            type: object
            additionalProperties: true
          filehost: 
            type: string
      status:
        type: string
      title:
        type: string

  PaymentTransaction:
    type: object
    properties:
      referenceNumber:
        type: string
      externalDocumentNumber:
        type: string
      gateWayProvider:
        type: string
      source:
        type: string
      type:
        type: string
        enum:
          - customer-topup
          - merchant-topup
      transactionDateTime:
        type: string
        format: date-time
      pointTypeCode:
        type: string
      currencyCode:
        type: string
      point:
        type: number
        format: double
      amount:
        type: number
        format: double
      conversion:
        type: object
        properties:
          from:
            type: object
            properties:
              type:
                type: string
              code:
                type: string
              amount:
                type: number
                format: double
          to:
            type: object
            properties:
              type:
                type: string
              code:
                type: string
              amount:
                type: number
                format: double
          rate:
            type: number
            format: float
      customerId:
        type: string
      status:
        type: string
        enum:
          - initiate
          - rejected
          - cancelled
          - approved
      other_info:
        type: object

  Points-Topup:
    type: object
    properties:
      pointTypeCode:
        type: string
      currencyCode:
        type: string
      amount:
        type: number
        format: float

  Currency-Topup:
    type: object
    properties:      
      currencyCode:
        type: string
      amount:
        type: number
        format: float

  Currency:
    type: object
    properties:
      name:
        type: string
      code:
        type: string
      symbol:
        type: string
      decimalPlace:
        type: integer
        format: int32

  AutoTopup:
    type: object
    properties:      
      activateAutoTopUp:
        type: boolean
      autoTopUp:
        type: array
        items:
          type: object
          properties:
            pointType:
              type: string
            pointThreshold:
              type: number
            amountTopUp:
              type: number
            cardNumber:
              type: string
            cardType:
              type: string
            status:
              type: string

  Points-Conversion:
    type: object
    properties:
      fromPointType:
        type: string
      toPointType:
        type: string
      globalPointType:
        type: string
      points:
        type: number
        format: float

  Ads:
    type: object
    properties:
      pointType:
        type: string
      videoUrl:
        type: string
      duration:
        type: number
      points:
        type: number
        format: float
      schedule:
        type: string
      title:
        type: string

  Error:
    type: object
    properties:
      type:
        type: string
      code:
        type: string
      message:
        type: string