deploy
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
export const DELIVERY_CARRIERS = ['RUSSIAN_POST', 'OZON_PVZ', 'YANDEX_PVZ', 'FIVE_POST']
|
||||
|
||||
/**
|
||||
* @param {unknown} value
|
||||
* @returns {value is typeof DELIVERY_CARRIERS[number]}
|
||||
*/
|
||||
export function isDeliveryCarrier(value) {
|
||||
return typeof value === 'string' && DELIVERY_CARRIERS.includes(value)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
export const ORDER_STATUSES = [
|
||||
'DRAFT',
|
||||
'DELIVERY_FEE_ADJUSTMENT',
|
||||
'PENDING_PAYMENT',
|
||||
'PAYMENT_VERIFICATION',
|
||||
'PAID',
|
||||
@@ -22,6 +23,8 @@ export function canTransitionAdminOrderStatus(order, next) {
|
||||
switch (from) {
|
||||
case 'DRAFT':
|
||||
return next === 'PENDING_PAYMENT' || next === 'CANCELLED'
|
||||
case 'DELIVERY_FEE_ADJUSTMENT':
|
||||
return next === 'CANCELLED'
|
||||
case 'PENDING_PAYMENT':
|
||||
return next === 'CANCELLED'
|
||||
case 'PAYMENT_VERIFICATION':
|
||||
|
||||
Reference in New Issue
Block a user