-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
order module update: update order status api
- Loading branch information
1 parent
f16252c
commit d0ad36e
Showing
5 changed files
with
54 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import {TOrderLineItems} from "@/App/modules/Orders/order.types"; | ||
|
||
const processOrderAmountDetails = (payload:TOrderLineItems[])=>{ | ||
let total=0; | ||
let subTotal=0; | ||
let shippingCost =0; | ||
const processOrderAmountDetails = (payload: TOrderLineItems[]) => { | ||
|
||
for (const lineItem of payload){ | ||
subTotal+=Number(lineItem.price)*Number(lineItem.quantity) | ||
let subTotal = 0; | ||
let shippingCost = 0; | ||
|
||
for (const lineItem of payload) { | ||
subTotal += Number(lineItem.price) * Number(lineItem.quantity) | ||
} | ||
|
||
total= subTotal+shippingCost | ||
const total = subTotal + shippingCost | ||
|
||
return{ | ||
return { | ||
subTotal, | ||
shippingCost, | ||
total | ||
} | ||
} | ||
|
||
export const OrderUtils={ | ||
export const OrderUtils = { | ||
processOrderAmountDetails | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters