@pisell/pisellos 3.0.15 → 3.0.16
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.
|
@@ -110,7 +110,10 @@ var checkCapacity = function checkCapacity(_ref) {
|
|
|
110
110
|
resource = _ref.resource,
|
|
111
111
|
_ref$currentCount = _ref.currentCount,
|
|
112
112
|
currentCount = _ref$currentCount === void 0 ? 1 : _ref$currentCount;
|
|
113
|
-
|
|
113
|
+
// 单个预约:如果当前资源容量不足以满足需求的容量,且当前资源是没有被占用的,返回资源不可用标记,但在外部运算会通过 reason=capacityOnly 来处理组合资源可用
|
|
114
|
+
// 多个预约:只需判断容量是否足够
|
|
115
|
+
var isMultipleBooking = resource.resourceType === 'multiple';
|
|
116
|
+
if (currentCount > resource.capacity && (isMultipleBooking || !isMultipleBooking && event_list.length === 0)) {
|
|
114
117
|
return {
|
|
115
118
|
status: false,
|
|
116
119
|
capacity: resource.capacity,
|
|
@@ -82,7 +82,8 @@ var checkCapacity = ({
|
|
|
82
82
|
resource,
|
|
83
83
|
currentCount = 1
|
|
84
84
|
}) => {
|
|
85
|
-
|
|
85
|
+
const isMultipleBooking = resource.resourceType === "multiple";
|
|
86
|
+
if (currentCount > resource.capacity && (isMultipleBooking || !isMultipleBooking && event_list.length === 0)) {
|
|
86
87
|
return {
|
|
87
88
|
status: false,
|
|
88
89
|
capacity: resource.capacity,
|