Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Voucher Transaction Audit

Glossary

total_price is the total price for the voucher transaction total_charge is the total that user should pay (if the payment is not 1000 than the total price and total charge is not same)

VIM Transaction

VIM Transaction ID : xxxx

VIM transaction data (similar to booking data).

{
  "id"-> voucher transaction ID
  "user_id"-> user ID
  "email"-> user email
  "phone"-> user phone
  "active"-> voucher transaction status (true: active, false: not active)
  "quantity"-> voucher transaction quantity
  "cancelled_by"-> voucher transaction canceled by
  "created_by"-> voucher transaction created by
  "cc_provider"-> voucher transaction cc payment provider
  "promptpay_provider"-> voucher transaction promptpay payment provider
  "shopee_pay_provider"-> shopeepay payment not available now
  "true_wallet_provider"-> true wallet payment not available now
  "used_voucher_amount_by_hh_cents"-> still not used
  "used_voucher_amount_by_hh_currency"-> still not used
  "used_voucher_amount_by_restaurant_cents"-> still not used
  "used_voucher_amount_by_restaurant_currency"-> still not used
  "channel"-> channel number (you can see the list of channel on Admin Dashboard)
  "medium"-> voucher transaction medium(Web, Android, iOS, Vendor_app, Dashboard, Chatbot, unknown)
  "created_at"-> voucher transaction created at
  "updated_at"-> voucher transaction updated at
  "total_price_cents"-> voucher transaction total price in cents
  "total_price_currency"-> voucher transaction total price currency
  "charge_price_cents"-> voucher transaction charge price(the amount that user need to pay when checkout the VIM)
  "charge_price_currency"-> voucher transaction charge currency
  "guest_id"-> ID for guest user(when user booking without login, it will listed as guest user)
  "restaurant_id"-> restaurant ID
  "for_locking_system"-> for temporary booking (when user still picking the voucher)
  "session_id"-> we use session ID to prevent old Sidekiq Job to cancel the transaction. everytime user extend the transaction, we re-new the session ID, so the old job on Sidekiq would be invalid
}


Voucher (Generated voucher data)

Detail data of generated Voucher.

{
  "id" -> voucher ID
  "ticket_transaction_id" -> vim transaction ID
  "ticket_group_id" -> Voucher in Marketplace ID
  "custom_label_id" -> id of the custom label (used for storing frequently used icon data)
  "package_type_id" -> package type ID (AYCE, PP, XP)
  "ticket_code" -> voucher code
  "valid_start_date" -> voucher valid start date
  "valid_end_date" ->  voucher valid end date
  "amount_cents" -> price
  "amount_currency" -> currency
  "commision" -> % commision for restaurant
  "created_at" -> 
  "updated_at" -> 
  "redeemed_at" -> date when the voucher redeemed
  "user_id" -> user member id
  "guest_id" -> guest user id
  "active" -> voucher active status
  "name" -> user member name
  "phone" -> user member phone
  "guest_detail" -> guest user details
  "partner_ticket_code_id" -> partner voucher code
  "ticket_name" -> voucher name
  "ticket_name_th" -> voucher name in thai language
  "ticket_name_en" -> voucher name in english
}

Audit data:

  •   *   Version: X  [Log: x](https://logs.hungryhub.com/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-20m,to:now))&_a=(columns:!(_source),filters:!(),index:d6a2eff0-a07e-11ee-9925-0323ed948260,interval:auto,query:(language:kuery,query:'custom_payload.request_id%20:%20%22b7f24c0a-18b6-419f-9bfd-64346b3af3d1%22%20'),sort:!()))xx (Show audit version number and log number (request ID from [logs.hungryhub.com](http://logs.hungryhub.com/) ))
    
    When Admin Update the Voucher, it will recorded here. The audit version can be more than 1 version.
{
  "id" -> voucher ID
  "ticket_transaction_id" -> vim transaction ID
  "ticket_group_id" -> Vouche in Marketplace ID
  "custom_label_id" -> id of the custom label (used for storing frequently used icon data)
  "package_type_id" -> package type ID (AYCE, PP, XP)
  "ticket_code" -> voucher code
  "valid_start_date" -> voucher valid start date
  "valid_end_date" -> > voucher valid end date
  "amount_cents" -> price
  "amount_currency" -> currency
  "commision" -> % commision for restaurant
  "created_at" -> 
  "updated_at" -> 
  "redeemed_at" -> date when the voucher redeemed
  "user_id" -> user member id
  "guest_id" -> guest user id
  "active" -> voucher active status
  "name" -> user member name
  "phone" -> user member phone
  "guest_detail" -> guest user details
  "partner_ticket_code_id" -> partner voucher code
  "ticket_name" -> VIM name (https://app.clickup.com/9003122396/v/dc/8ca1fpw-31876/8ca1fpw-39416?block=block-5f3ac50f-634b-442c-a58d-8fc64f449c37)
  "ticket_name_th" -> VIM name in thai language
  "ticket_name_en" -> VIM name in english
}

VIM Bundle (Summary of VIM transaction data)

VIM bundle is the data summarize for the voucher transaction until how many voucher generated

{
  "id" -> vim bundle id
  "ticket_group_bundle_id" -> not used
  "ticket_group_id" -> Voucher in Marketplace id
  "ticket_transaction_id" -> vim transaction id
  "quantity" -> the quantity of the voucher 
  "discount_percent" -> how many discount in %
  "total_price_cents" -> voucher transaction total price in cents
  "total_price_currency" -> voucher transaction total price currency
  "created_at" -> 
  "updated_at" -> 
  "price_per_ticket_cents" -> price per voucher in cents
  "price_per_ticket_currency" -> currency for voucher 
  "package_type_id" -> package type id
  "booked_quantity" -> redis key for quota witness
  "name" -> VIM name (duplicate the VIM name that user buy to this attribute)
  "description" -> VIM description (duplicate the VIM description that user buy to this attribute)
  "name_th" -> VIM name in thai language
  "name_en" -> VIM name in english language
  "description_th" -> VIM description in thai language
  "description_en" -> VIM description in english language
}

VIM Bundle Audit data:

"null"

VIM Group Bundle (remove this)

This feature isn't ready yet, it's still buggy. if the admin uses this feature, the user won't be able to book the VIM.


Package Type

{
  "id" -> pacakage type ID
  "title" -> package name
  "cover_img" -> {
    "url" -> package image
  },
  "color_code" -> package colour code
  "package_type_code" -> package type code name
  "created_at" -> package type created at
  "updated_at" -> 
  "active" -> package type status (active, inactive)
  "description" -> package type description
  "alt_text" -> not used
  "description_th" -> package type description in thai language
  "description_en" -> package type description in english language
  "alt_text_th" -> not used
  "alt_text_en" -> not used
}

Voucher In Marketplace

Voucher in Marketplace data (act as package on booking).

{
  "id" -> VIM id
  "custom_label_id" -> id of the custom label (used for storing frequently used icon data)
  "package_type_id" -> package type id
  "selling_start_date" -> vim start selling date
  "selling_end_date" -> vim end selling date
  "valid_start_date" -> vim start valid date
  "valid_end_date" -> vim end valid date
  "price_cents" -> vim original price in cents
  "price_currency" -> vim original price currency
  "discount_price_cents" -> vim discount price in cents
  "discount_price_currency" -> vim discount price currency
  "quantity" -> vim quantity (how many voucher can be generated from each vim)
  "limit_per_order" -> limit per order
  "commision" -> vim commisioin
  "accept_voucher" -> indicates whether VIM can be purchased with a voucher. (true or false)
  "full_prepayment" -> to show whether the voucher was 100% prepaid or not
  "allow_mix" -> NOT WORKING
  "total_orders" -> how many vim sold
  "has_ticket_bundle" -> NOT WORKING
  "created_at" ->
  "updated_at" -> 
  "country_id" -> VIM country id
  "url_link" -> NOT WORKING
  "image_cover" -> {
    "url" -> image url link
  }
  "limit_user" -> to show if the vim using limit per user (true or false) 
  "limit_qty_per_user" -> limit quantity per user
  "partner_ticket_enabled" -> 
  "visibility" -> indicates whether the voucher was visible to user
  "party_size" -> calculating price per person
  "price_per_person_cents" -> price per person in cents
  "price_per_person_currency" -> price per person currency
  "name" -> VIM name
  "description" -> vim description
  "name_th" -> VIM name in thai language
  "name_en" -> VIM name in english
  "description_th" -> VIM description in thai language
  "description_en" -> VIM description in english language
}

Voucher In Marketplace Audit data

Version: 164 Log:xxxx (shows audit version and log number(request ID from logs.hungryhub.com ))

  {
    "id" -> VIM audit data id
    "auditable_id" -> VIM id
    "auditable_type" -> VIM table name
    "associated_id" -> not used
    "associated_type" -> not used
    "user_id" -> VIM transaction user id
    "user_type" ->
    "username" ->
    "action" -> type of action (Create, Update, Delete)
    "audited_changes": {}  -> list of the edited data
    "version" -> version data
    "comment" -> audit comment
    "remote_address" -> ip address
    "created_at" -> 
    "request_uuid" -> request uid
  }

Charges

Private (https://app.clickup.com/9003122396/docs/8ca1fpw-31876/8ca1fpw-39856)

Reward

{
  "id": reward id
  "user_id": vim transaction user id
  "reservation_id": null,
  "points_total": total point reward
  "points_pending": total pending point 
  "description": reward description
  "created_at": 
  "updated_at": 
  "restaurant_id": vim restaurant id
  "redeemed": indicates whether the voucher was redeemed
  "bank_name": 
  "bank_acc_number": 
  "bank_acc_name": 
  "upcoming_reservation_id": 
  "early_bird_reservation_id": 
  "reward_type": reward type
  "expiry_date": reward expiry date
  "extendable": indicates whether the reward was extendable or not
  "ticket_transaction_id": vim transaction id, see https://app.clickup.com/9003122396/v/dc/8ca1fpw-31876/8ca1fpw-39416?block=block-1d5217e2-d340-472c-9d3e-b7aae30a920d for more detail
  "note": null,
  "points_bonus": point bonus
  "journal_entry": {} -> list of the history point of the user
  }
}