Skip to content

Odoo Ticket Router Rule

Overview

This document describes the process of handling ticket routing rules in Odoo, including setting up a ticket based on predefined rules and sending the ticket to WhatsApp after processing.

Ticket Routing Rules

1. Ticket Categorization and Processing

  • Tickets are categorized based on destination city, payment method, and request type.

  • Specific processing rules apply depending on these categories, ensuring accurate handling.

  • A system-driven validation check determines if a similar ticket already exists before processing a new one.

2. Specify Destination City

  • If the destination city falls under predefined categories (e.g., USDT or ASIA ilimits USDT) or if the payment method is CRP, then the comment field is automatically set to the key address.

  • For Vodafone transactions, the comment is assigned the Vodafone number for reference.

3. Country Identification and Flag Assignment

  • The destination country is checked against a predefined database.

  • If the country exists, its flag is assigned for reference; otherwise, a default flag is used.

4. Payment Type and Method Determination

  • The payment type is identified, and if it does not exist in the system, it is created.

  • The payment method is also verified and registered in the database if not previously available.

5. Client and Location Handling

  • Clients are checked against existing records and added if necessary.

  • Destination country and city are assigned systematically, ensuring a structured geographical hierarchy.

6. Currency and Operating Unit Management

  • The ticket currency and local currency are identified and created if they do not already exist.

  • The operating unit responsible for processing the ticket is set, linking it to the relevant commission structure.

7. Ticket Creation and Status Assignment

  • A structured Ticket Data Transfer Object (DTO) is created with key attributes such as:

    • Ticket status set to WAITING APPROVAL.

    • Timestamp of when the ticket was received.

    • Assigned user responsible for managing the ticket.

    • Country, client, payment method, city, and currency associations.

8. Request Type-Based Ticket Processing

  • If the request type is payout, a payout ticket is processed under the Payout USD Ticket category.
  • If the request type is deposit, a deposit ticket is processed under the Deposit USD Ticket category.
  • If the request type does not match these options, the system defaults to creating a Withdrawal Ticket.
  • The exchange rate is calculated based on the local currency amount and ticket amount.

9. Ticket Processing Execution

  • Once all conditions are met, the ticket is processed following predefined workflows.

  • The system ensures that notifications and assignments are completed as per operational requirements.

10. Sending Ticket to WhatsApp

After processing, the ticket is sent to WhatsApp based on the associated chats.

Determine Target WhatsApp Chats:

The system collects WhatsApp chats from matched ticket routing rules.

Check Auto-Withdrawal Status:

If auto-withdrawal is enabled and the ticket meets the routing rules and crypto payment method requirements, a request is sent to the Vision-pay server to process the payment automatically. The server then returns a transaction hash and preview url, which is replied to the ticket and sent via WhatsApp.

Trigger WhatsApp Notification:

The sendTicket function is invoked to dispatch the ticket details to WhatsApp chats.

Conclusion

This process ensures that tickets are routed and dispatched efficiently, integrating with WhatsApp for communication and notifications.