File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
packages/plugin-bm-api/src Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ export interface IOrderDocument extends IOrder, Document {
2424
2525const 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
3133const getEnum = ( ) : string [ ] => {
32- return STATUS_TYPES . map ( ( option ) => option . value ) ;
34+ return STATUS_TYPES . map ( option => option . value ) ;
3335} ;
3436
3537export const orderSchema = schemaHooksWrapper (
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments