fix(SPG-1270): Pada Invoice/ tagihan booking tambahkan kode booking nya dan informasi booking date dan jumlah yang harus dibayarkan

pull/142/head 1.6.25-alpha.1
shancheas 2025-06-25 15:19:59 +07:00
parent 23b3c31810
commit 7be4c26ef2
2 changed files with 25 additions and 1 deletions

View File

@ -57,6 +57,7 @@ export class CreateBookingManager extends CreateTransactionManager {
time: this.data.booking_date,
id: this.data.id,
},
this.data.payment_total,
`snap/v4/redirection/${this.data.payment_midtrans_token}`,
);
}

View File

@ -324,10 +324,23 @@ export class WhatsappService {
);
}
async bookingRegister(data: WhatsappBookingCreate, paymentUrl: string) {
async bookingRegister(
data: WhatsappBookingCreate,
total: number,
paymentUrl: string,
) {
const momentDate = moment(data.time);
const fallbackValue = momentDate.locale('id').format('dddd, DD MMMM YYYY');
const formattedTotal = new Intl.NumberFormat('id-ID', {
style: 'currency',
currency: 'IDR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
.format(total)
.replace('IDR', 'Rp');
const payload = {
messaging_product: 'whatsapp',
to: phoneNumberOnly(data.phone), // recipient's phone number
@ -351,6 +364,16 @@ export class WhatsappService {
parameter_name: 'booking_date',
text: fallbackValue,
},
{
type: 'text',
parameter_name: 'booking_code',
text: data.code,
},
{
type: 'text',
parameter_name: 'total',
text: formattedTotal,
},
],
},
{