@ibiliaze/global-vars 1.116.0 → 1.118.0
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.
- package/dist/flows.js +8 -9
- package/package.json +2 -2
package/dist/flows.js
CHANGED
|
@@ -35,8 +35,9 @@ function makeSaleLogic() {
|
|
|
35
35
|
return 'Online';
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const guestSeesSeasonalAndOnline = (flow) => flow.type === 'Seasonal ticket' || flow.type === 'Online';
|
|
39
39
|
const cashierSeesSeasonal = (flow, staffFlowIds) => flow.type === 'Seasonal ticket' && (0, exports.arrayHasId)(staffFlowIds, flow.flowId);
|
|
40
|
+
const cashierSeesSeasonalAndOffline = (flow, staffFlowIds) => (flow.type === 'Seasonal ticket' || flow.type === 'Offline') && (0, exports.arrayHasId)(staffFlowIds, flow.flowId);
|
|
40
41
|
const comesFromSpecialLink = (flow, signedFlowId) => flow.type === 'Special link' && (0, exports.idsEqual)(flow.flowId, signedFlowId);
|
|
41
42
|
const authoriser = ({ who, where, effectiveFlows, signedFlowId, staffFlowIds, }) => {
|
|
42
43
|
// Guest
|
|
@@ -46,7 +47,7 @@ function makeSaleLogic() {
|
|
|
46
47
|
if (where === 'Special link')
|
|
47
48
|
return effectiveFlows.some(f => comesFromSpecialLink(f, signedFlowId));
|
|
48
49
|
if (where === 'Online')
|
|
49
|
-
return effectiveFlows.some(f =>
|
|
50
|
+
return effectiveFlows.some(f => guestSeesSeasonalAndOnline(f));
|
|
50
51
|
if (where === 'Seasonal ticket')
|
|
51
52
|
return effectiveFlows.some(f => f.type === 'Seasonal ticket');
|
|
52
53
|
}
|
|
@@ -58,12 +59,10 @@ function makeSaleLogic() {
|
|
|
58
59
|
return false;
|
|
59
60
|
if (where === 'Special link')
|
|
60
61
|
return false;
|
|
61
|
-
if (where === 'Offline')
|
|
62
|
-
return effectiveFlows.some(f => f
|
|
63
|
-
|
|
64
|
-
if (where === 'Seasonal ticket') {
|
|
62
|
+
if (where === 'Offline')
|
|
63
|
+
return effectiveFlows.some(f => cashierSeesSeasonalAndOffline(f, staffFlowIds));
|
|
64
|
+
if (where === 'Seasonal ticket')
|
|
65
65
|
return effectiveFlows.some(f => cashierSeesSeasonal(f, staffFlowIds));
|
|
66
|
-
}
|
|
67
66
|
}
|
|
68
67
|
return false;
|
|
69
68
|
};
|
|
@@ -152,8 +151,8 @@ function makeSaleLogic() {
|
|
|
152
151
|
// If it isn't a seasonal seat, return the effective cat
|
|
153
152
|
if (!isSeasonal)
|
|
154
153
|
return effectiveCategory;
|
|
155
|
-
//
|
|
156
|
-
if (where === 'Seasonal ticket'
|
|
154
|
+
// Return the effective category is Sale Channel is Seasonal
|
|
155
|
+
if (where === 'Seasonal ticket')
|
|
157
156
|
return effectiveCategory;
|
|
158
157
|
// If sale channel is not seasonal but the seat is seasonal, return a default category
|
|
159
158
|
const defaultFlowCategory = fixtureCategories.find(cat => cat.sections?.some(sec => (0, exports.idsEqual)(sec.sectionId, sectionId)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiliaze/global-vars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.118.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc",
|
|
24
24
|
"pub": "npm publish --access public",
|
|
25
|
-
"git": "git add .; git commit -m 'changes'; git tag -a v1.
|
|
25
|
+
"git": "git add .; git commit -m 'changes'; git tag -a v1.118.0 -m 'v1.118.0'; git push origin v1.118.0; git push",
|
|
26
26
|
"push": "npm run build; npm run git; npm run pub"
|
|
27
27
|
},
|
|
28
28
|
"author": "Ibi Hasanli",
|