@open-tender/utils 0.4.54 → 0.4.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,8 +126,7 @@ const makeRevenueCenterMsg = (revenueCenter, serviceType, requestedAt, statusMes
126
126
  exports.makeRevenueCenterMsg = makeRevenueCenterMsg;
127
127
  const isRevenueCenterOpen = (revenueCenter, serviceType) => {
128
128
  const { status, first_times, order_times } = revenueCenter;
129
- const tempClosed = status === 'CLOSED_TEMPORARILY';
130
- if (tempClosed)
129
+ if (status !== 'OPEN')
131
130
  return false;
132
131
  const serviceOrderTimes = order_times ? order_times[serviceType] : null;
133
132
  const serviceFirstTimes = first_times ? first_times[serviceType] : null;
@@ -137,10 +136,12 @@ const isRevenueCenterOpen = (revenueCenter, serviceType) => {
137
136
  };
138
137
  exports.isRevenueCenterOpen = isRevenueCenterOpen;
139
138
  const getRevenueCenterStatus = (revenueCenter, serviceType) => {
140
- const { first_times } = revenueCenter;
139
+ const { first_times, status } = revenueCenter;
141
140
  const isOpen = (0, exports.isRevenueCenterOpen)(revenueCenter, serviceType);
142
141
  if (isOpen)
143
142
  return 'Open Now';
143
+ if (status !== 'OPEN')
144
+ return 'Closed';
144
145
  const serviceFirstTimes = first_times ? first_times[serviceType] : null;
145
146
  if (!serviceFirstTimes)
146
147
  return 'Closed';
@@ -116,8 +116,7 @@ export const makeRevenueCenterMsg = (revenueCenter, serviceType, requestedAt, st
116
116
  };
117
117
  export const isRevenueCenterOpen = (revenueCenter, serviceType) => {
118
118
  const { status, first_times, order_times } = revenueCenter;
119
- const tempClosed = status === 'CLOSED_TEMPORARILY';
120
- if (tempClosed)
119
+ if (status !== 'OPEN')
121
120
  return false;
122
121
  const serviceOrderTimes = order_times ? order_times[serviceType] : null;
123
122
  const serviceFirstTimes = first_times ? first_times[serviceType] : null;
@@ -126,10 +125,12 @@ export const isRevenueCenterOpen = (revenueCenter, serviceType) => {
126
125
  return !isHasFirstTimes && !isHasOrderTime;
127
126
  };
128
127
  export const getRevenueCenterStatus = (revenueCenter, serviceType) => {
129
- const { first_times } = revenueCenter;
128
+ const { first_times, status } = revenueCenter;
130
129
  const isOpen = isRevenueCenterOpen(revenueCenter, serviceType);
131
130
  if (isOpen)
132
131
  return 'Open Now';
132
+ if (status !== 'OPEN')
133
+ return 'Closed';
133
134
  const serviceFirstTimes = first_times ? first_times[serviceType] : null;
134
135
  if (!serviceFirstTimes)
135
136
  return 'Closed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.4.54",
3
+ "version": "0.4.56",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",