Adds manual transaction processing feature
Implements functionality to manually process specific Lamassu transactions by ID, bypassing dispense checks. This allows administrators to handle transactions that may have failed due to dispense issues or were settled manually outside of the automated process. The feature includes a new UI dialog for entering the transaction ID and an API endpoint to fetch and process the transaction, crediting wallets and distributing funds according to the DCA configuration.
This commit is contained in:
parent
bd7a72f3c0
commit
9c2a1f7d4a
4 changed files with 272 additions and 17 deletions
|
|
@ -335,21 +335,32 @@
|
|||
>
|
||||
Test Connection
|
||||
</q-btn>
|
||||
<q-btn
|
||||
<q-btn
|
||||
v-if="lamassuConfig"
|
||||
size="sm"
|
||||
color="secondary"
|
||||
@click="manualPoll"
|
||||
size="sm"
|
||||
color="secondary"
|
||||
@click="manualPoll"
|
||||
:loading="runningManualPoll"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
Manual Poll
|
||||
</q-btn>
|
||||
<q-btn
|
||||
<q-btn
|
||||
v-if="lamassuConfig"
|
||||
size="sm"
|
||||
color="deep-orange"
|
||||
@click="openManualTransactionDialog"
|
||||
class="q-ml-sm"
|
||||
icon="build"
|
||||
>
|
||||
<q-tooltip>Process specific transaction by ID (bypasses dispense checks)</q-tooltip>
|
||||
Manual TX
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="lamassuConfig && lamassuConfig.source_wallet_id"
|
||||
size="sm"
|
||||
color="warning"
|
||||
@click="testTransaction"
|
||||
size="sm"
|
||||
color="warning"
|
||||
@click="testTransaction"
|
||||
:loading="runningTestTransaction"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
|
|
@ -690,7 +701,7 @@
|
|||
<q-dialog v-model="distributionDialog.show" position="top" maximized>
|
||||
<q-card class="q-pa-lg">
|
||||
<div class="text-h6 q-mb-md">Transaction Distribution Details</div>
|
||||
|
||||
|
||||
<div v-if="distributionDialog.transaction" class="q-mb-lg">
|
||||
<q-list>
|
||||
<q-item>
|
||||
|
|
@ -709,7 +720,7 @@
|
|||
<q-item-section>
|
||||
<q-item-label caption>Total Amount</q-item-label>
|
||||
<q-item-label>
|
||||
${ formatCurrency(distributionDialog.transaction.fiat_amount) }
|
||||
${ formatCurrency(distributionDialog.transaction.fiat_amount) }
|
||||
(${ formatSats(distributionDialog.transaction.crypto_amount) })
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
|
@ -718,7 +729,7 @@
|
|||
<q-item-section>
|
||||
<q-item-label caption>Commission</q-item-label>
|
||||
<q-item-label>
|
||||
${ (distributionDialog.transaction.commission_percentage * 100).toFixed(1) }%
|
||||
${ (distributionDialog.transaction.commission_percentage * 100).toFixed(1) }%
|
||||
<span v-if="distributionDialog.transaction.discount > 0">
|
||||
(with ${ distributionDialog.transaction.discount }% discount = ${ (distributionDialog.transaction.effective_commission * 100).toFixed(1) }% effective)
|
||||
</span>
|
||||
|
|
@ -740,11 +751,11 @@
|
|||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
|
||||
<q-separator class="q-my-md"></q-separator>
|
||||
|
||||
|
||||
<div class="text-h6 q-mb-md">Client Distributions</div>
|
||||
|
||||
|
||||
<q-table
|
||||
dense
|
||||
flat
|
||||
|
|
@ -771,12 +782,71 @@
|
|||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
|
||||
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!--/////////////////////////////////////////////////-->
|
||||
<!--//////////////MANUAL TRANSACTION DIALOG///////////-->
|
||||
<!--/////////////////////////////////////////////////-->
|
||||
|
||||
<q-dialog v-model="manualTransactionDialog.show" position="top">
|
||||
<q-card class="q-pa-lg q-pt-xl" style="width: 500px; max-width: 90vw">
|
||||
<div class="text-h6 q-mb-md">Process Specific Transaction</div>
|
||||
|
||||
<q-banner class="bg-orange-1 text-orange-9 q-mb-md">
|
||||
<template v-slot:avatar>
|
||||
<q-icon name="warning" color="orange" />
|
||||
</template>
|
||||
<div class="text-caption">
|
||||
<strong>Use with caution:</strong> This bypasses all dispense status checks and will process the transaction even if dispense_confirmed is false. Only use this for manually settled transactions.
|
||||
</div>
|
||||
</q-banner>
|
||||
|
||||
<q-form @submit="processSpecificTransaction" class="q-gutter-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.trim="manualTransactionDialog.transactionId"
|
||||
label="Lamassu Transaction ID *"
|
||||
placeholder="e.g., 82746dfb-674d-4d7e-b008-7507caa02773"
|
||||
hint="Enter the transaction/session ID from Lamassu database"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="receipt" />
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<div class="text-caption text-grey-7">
|
||||
This will:
|
||||
<ul class="q-my-sm">
|
||||
<li>Fetch the transaction from Lamassu regardless of dispense status</li>
|
||||
<li>Process it through the normal DCA distribution flow</li>
|
||||
<li>Credit the source wallet and distribute to clients</li>
|
||||
<li>Send commission to the commission wallet (if configured)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn
|
||||
unelevated
|
||||
color="deep-orange"
|
||||
type="submit"
|
||||
:loading="processingSpecificTransaction"
|
||||
:disable="!manualTransactionDialog.transactionId"
|
||||
>
|
||||
Process Transaction
|
||||
</q-btn>
|
||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto">
|
||||
Cancel
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue