Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3a6611

Browse files
batorshihorshih99
andauthored
fix: tourism update (#6543)
Co-authored-by: orshih <[email protected]>
1 parent d3448eb commit d3a6611

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/plugin-bm-api/src/models/definitions/order.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ export interface IOrderDocument extends IOrder, Document {
2424

2525
const STATUS_TYPES = [
2626
{ label: "paid", value: "paid" },
27-
{ label: "notPaid", value: "notPaid" },
28-
{ label: "somePaid", value: "somePaid" }
27+
{ label: "pending", value: "pending" },
28+
{ label: "prepaid", value: "prepaid" },
29+
{ label: "refunded", value: "refunded" },
30+
{ label: "cancelled", value: "cancelled" }
2931
];
3032

3133
const getEnum = (): string[] => {
32-
return STATUS_TYPES.map((option) => option.value);
34+
return STATUS_TYPES.map(option => option.value);
3335
};
3436

3537
export const orderSchema = schemaHooksWrapper(

packages/plugin-bm-api/src/payment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default {
1717
}
1818
const order = await models.Orders.findById(contentTypeId);
1919
if (!order) return;
20-
const oldInvoice = order?.invoices?.find((x) => x._id === _id);
21-
const restInvoices = order?.invoices?.filter((x) => x._id !== _id) || [];
20+
const oldInvoice = order?.invoices?.find(x => x._id === _id);
21+
const restInvoices = order?.invoices?.filter(x => x._id !== _id) || [];
2222
const restTotal = restInvoices?.reduce((a, b) => a + b.amount, 0) || 0;
2323
const total = (oldInvoice?.amount || 0) + restTotal;
2424
const branch = await models.BmsBranch.findById(order.branchId);
@@ -60,7 +60,7 @@ export default {
6060
{ _id: contentTypeId },
6161
{
6262
$set: {
63-
status: "halfPaid",
63+
status: "prepaid",
6464
invoices: [...restInvoices, { _id, amount }]
6565
}
6666
}

0 commit comments

Comments
 (0)