Skip to content
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

Show the previous Status to DISPUTE in dispute message for solvers #571

Merged
merged 4 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bot/modules/dispute/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const dispute = async ctx => {
if (user._id == order.buyer_id) initiator = 'buyer';

order[`${initiator}_dispute`] = true;
order.previous_dispute_status = order.status
order.status = 'DISPUTE';
const sellerToken = Math.floor(Math.random() * 899 + 100);
const buyerToken = Math.floor(Math.random() * 899 + 100);
Expand Down
2 changes: 2 additions & 0 deletions locales/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ buy_sats: Kaufe Sats
order_detail: |
Id: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Status: ${status}

Ersteller: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ buy_sats: Buy satoshis
order_detail: |
ID: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Status: ${status}

Creator: @${creator || ''}
Expand Down
4 changes: 3 additions & 1 deletion locales/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ sell_sats: Vender satoshis
buy_sats: Comprar satoshis
order_detail: |
Id: `${order._id}`


Status previo a disputa: ${previousDisputeStatus}

Status: ${status}

Creador: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/fa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ buy_sats: خرید ساتوشی
order_detail: |
ID: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Status: ${status}

Creator: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ buy_sats: Achète des satoshis
order_detail: |
ID : `${order._id}`

Situation antérieure au litige: ${previousDisputeStatus}

Statut : ${status}

Créateur : @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ buy_sats: Compra satoshis
order_detail: |
Id: `${order._id}`

Stato precedente alla controversia: ${previousDisputeStatus}

Stato: ${status}

Creato da: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/ko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ buy_sats: 비트코인 구매
order_detail: |
ID: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

상태: ${status}

생성자: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/pt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ buy_sats: Compre Satoshis
order_detail: |
Id: `${order._id}`

Situação anterior ao litígio: ${previousDisputeStatus}

Status: ${status}

Criadora: @${creator || ''}
Expand Down
2 changes: 2 additions & 0 deletions locales/ru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ sell_sats: Продать сатоши
buy_sats: Купить сатоши
order_detail: |
Id: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Статус: ${status}

Expand Down
2 changes: 2 additions & 0 deletions locales/uk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ sell_sats: Продати сатоші
buy_sats: Купити сатоші
order_detail: |
Id: `${order._id}`

Status previous to dispute: ${previousDisputeStatus}

Статус: ${status}

Expand Down
8 changes: 8 additions & 0 deletions models/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface IOrder extends Document {
seller_cooperativecancel: boolean;
canceled_by: string
action_by: string
previous_dispute_status: string;
status: string;
type: string;
fiat_amount: number;
Expand Down Expand Up @@ -92,6 +93,13 @@ const orderSchema = new Schema<IOrder>({
seller_cooperativecancel: { type: Boolean, default: false },
canceled_by: { type: String },
action_by: { type: String },
previous_dispute_status: {
type: String,
enum: [
'ACTIVE', // order taken
'FIAT_SENT', // buyer indicates the fiat payment is already done
],
},
status: {
type: String,
enum: [
Expand Down
2 changes: 2 additions & 0 deletions util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ exports.getDetailedOrder = (i18n, order, buyer, seller) => {
let takenAt = order.taken_at ? order.taken_at.toISOString() : '';
createdAt = sanitizeMD(createdAt);
takenAt = sanitizeMD(takenAt);
const previousDisputeStatus = sanitizeMD(order.previous_dispute_status);
const status = sanitizeMD(order.status);
const fee = order.fee ? parseInt(order.fee) : '';
const creator =
Expand All @@ -376,6 +377,7 @@ exports.getDetailedOrder = (i18n, order, buyer, seller) => {
sellerUsername,
createdAt,
takenAt,
previousDisputeStatus,
status,
fee,
paymentMethod,
Expand Down
Loading