-
Notifications
You must be signed in to change notification settings - Fork 16
Dispute creation from order details in Active orders #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4913986
4dfe38c
362c57f
2b0bd0b
70d28a1
710d92f
d1ad4d0
e8ce6a2
673b78d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,10 +106,34 @@ | |
| "cooperativeCancelInitiatedByYou": "You have initiated the cancellation of the order ID: {id}. Your counterparty must agree. If they do not respond, you can open a dispute. Note that no administrator will contact you regarding this cancellation unless you open a dispute first.", | ||
| "cooperativeCancelInitiatedByPeer": "Your counterparty wants to cancel order ID: {id}. If you agree, please send me cancel-order-message. Note that no administrator will contact you regarding this cancellation unless you open a dispute first.", | ||
| "cooperativeCancelAccepted": "Order {id} has been successfully canceled!", | ||
| "disputeInitiatedByYou": "You have initiated a dispute for order Id: {id}. A solver will be assigned soon. Once assigned, I will share their npub with you, and only they will be able to assist you. Your dispute token is: {user_token}.", | ||
| "disputeInitiatedByPeer": "Your counterparty has initiated a dispute for order Id: {id}. A solver will be assigned soon. Once assigned, I will share their npub with you, and only they will be able to assist you. Your dispute token is: {user_token}.", | ||
| "disputeInitiatedByYou": "You have initiated a dispute for order ID: {id}. A solver will be assigned soon. Once assigned, I will share their npub with you, and only they will be able to assist you. Your dispute ID is: {dispute_id}.", | ||
| "@disputeInitiatedByYou": { | ||
| "placeholders": { | ||
| "id": { | ||
| "type": "String", | ||
| "example": "abc123" | ||
| }, | ||
| "dispute_id": { | ||
| "type": "String", | ||
| "example": "dispute-456" | ||
| } | ||
| } | ||
| }, | ||
| "disputeInitiatedByPeer": "Your counterparty has initiated a dispute for order ID: {id}. A solver will be assigned soon. Once assigned, I will share their npub with you, and only they will be able to assist you. Your dispute ID is: {dispute_id}.", | ||
| "@disputeInitiatedByPeer": { | ||
| "placeholders": { | ||
| "id": { | ||
| "type": "String", | ||
| "example": "abc123" | ||
| }, | ||
| "dispute_id": { | ||
| "type": "String", | ||
| "example": "dispute-456" | ||
| } | ||
| } | ||
| }, | ||
| "adminTookDisputeAdmin": "Here are the details of the dispute order you have taken: {details}. You need to determine which user is correct and decide whether to cancel or complete the order. Please note that your decision will be final and cannot be reversed.", | ||
| "adminTookDisputeUsers": "The solver {admin_npub} will handle your dispute. You can contact them directly, but if they reach out to you first, make sure to ask them for your dispute token.", | ||
| "adminTookDisputeUsers": "A dispute resolver has been assigned to handle your dispute. They will contact you through the app.", | ||
| "adminCanceledAdmin": "You have canceled the order ID: {id}.", | ||
| "adminCanceledUsers": "Admin has canceled the order ID: {id}.", | ||
| "adminSettledAdmin": "You have completed the order ID: {id}.", | ||
|
|
@@ -267,6 +291,16 @@ | |
| "orderIdCopiedMessage": "Order ID copied to clipboard", | ||
| "disputeTradeDialogTitle": "Start Dispute", | ||
| "disputeTradeDialogContent": "You are about to start a dispute with your counterparty. Do you want to continue?", | ||
| "disputeCreatedSuccessfully": "Dispute created successfully", | ||
| "disputeCreationFailed": "Failed to create dispute", | ||
| "disputeCreationErrorWithMessage": "Error creating dispute: {error}", | ||
| "@disputeCreationErrorWithMessage": { | ||
| "placeholders": { | ||
| "error": { | ||
| "type": "String" | ||
| } | ||
| } | ||
| }, | ||
|
Comment on lines
+294
to
+303
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainNew dispute-creation snackbar keys — LGTM; ensure locale parity Strings read well and the error placeholder is typed. Per guidelines, confirm these keys exist in intl_es.arb and intl_it.arb. Run to verify presence across locales and metadata health: 🏁 Script executed: #!/bin/bash
set -euo pipefail
files=(lib/l10n/intl_en.arb lib/l10n/intl_es.arb lib/l10n/intl_it.arb)
for f in "${files[@]}"; do
test -f "$f" || { echo "Missing $f"; exit 1; }
done
keys=('disputeCreatedSuccessfully' 'disputeCreationFailed' 'disputeCreationErrorWithMessage' 'disputeInitiatedByYou' 'disputeInitiatedByPeer' 'adminTookDisputeUsers')
for k in "${keys[@]}"; do
for f in "${files[@]}"; do
jq -e --arg k "$k" 'has($k)' "$f" >/dev/null || { echo "$f is missing key: $k"; exit 1; }
done
done
# EN-specific metadata checks
jq -e '.["@disputeCreationErrorWithMessage"].placeholders.error' lib/l10n/intl_en.arb >/dev/null || echo "Note: missing error placeholder metadata in en"
jq -e '.["@adminTookDisputeUsers"].placeholders.admin_npub' lib/l10n/intl_en.arb >/dev/null || echo "Note: add @adminTookDisputeUsers metadata with admin_npub placeholder in en"
for k in disputeInitiatedByYou disputeInitiatedByPeer; do
jq -e --arg k "$k" '.["@"+$k].placeholders.id and .["@"+$k].placeholders.dispute_id' lib/l10n/intl_en.arb >/dev/null \
|| echo "Note: ensure id and dispute_id placeholders are declared for $k in en"
done
echo "OK: localization keys present in en/es/it"Length of output: 3101 Add "@adminTookDisputeUsers": {
"placeholders": {
"admin_npub": { "type": "String" }
}
}🤖 Prompt for AI Agents |
||
| "typeToAdd": "Type to add...", | ||
| "noneSelected": "None selected", | ||
| "fiatCurrencies": "Fiat currencies", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Validate input: reject empty orderId upfront.
Prevents constructing/sending malformed events.
Future<bool> createDispute(String orderId) async { try { + if (orderId.trim().isEmpty) { + _logger.e('Empty orderId, cannot create dispute'); + return false; + } _logger.d('Creating dispute for order: $orderId');📝 Committable suggestion