@@ -57,6 +57,8 @@ async function createLogistics(order: Order) {
5757 Math . ceil ( ( totalWeightInGrams / 1000 ) * 20 ) + ( needPickupPoint ? 150 : 75 ) ;
5858
5959 const branch = await StorageService . Branches . get ( order . branch ) ;
60+ console . log ( branch ) ;
61+ console . log ( branch . deliveryMethods ) ;
6062 return {
6163 fixedOptions : [
6264 ...( order . amount > 0 && branch . deliveryMethods ?. branch
@@ -75,19 +77,25 @@ async function createLogistics(order: Order) {
7577 } as const ,
7678 ]
7779 : [ ] ) ,
78- {
79- id : needPickupPoint ? "mail_pickup_point" : "mailbox" ,
80- amount : {
81- value : deliveryPrice * 100 ,
82- currency : "NOK" ,
83- } ,
84- brand : "POSTEN" ,
85- title : needPickupPoint ? "Pakke til hentested" : "Pakke i postkasse" ,
86- description : `Forventet levering om ${ APP_CONFIG . delivery . deliveryDays + 2 } dager` ,
87- type : needPickupPoint ? "PICKUP_POINT" : "MAILBOX" ,
88- priority : 1 ,
89- isDefault : order . amount === 0 ,
90- } as const ,
80+ ...( branch . deliveryMethods ?. byMail
81+ ? [
82+ {
83+ id : needPickupPoint ? "mail_pickup_point" : "mailbox" ,
84+ amount : {
85+ value : deliveryPrice * 100 ,
86+ currency : "NOK" ,
87+ } ,
88+ brand : "POSTEN" ,
89+ title : needPickupPoint
90+ ? "Pakke til hentested"
91+ : "Pakke i postkasse" ,
92+ description : `Forventet levering om ${ APP_CONFIG . delivery . deliveryDays + 2 } dager` ,
93+ type : needPickupPoint ? "PICKUP_POINT" : "MAILBOX" ,
94+ priority : 1 ,
95+ isDefault : order . amount === 0 ,
96+ } as const ,
97+ ]
98+ : [ ] ) ,
9199 ] ,
92100 } ;
93101}
0 commit comments