@ibiliaze/global-vars 1.116.0 → 1.117.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.
Files changed (2) hide show
  1. package/dist/flows.js +6 -7
  2. 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 isOnlineOrSeasonal = (flow) => flow.type === 'Seasonal ticket' || flow.type === 'Online';
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 => isOnlineOrSeasonal(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.type === 'Offline' && (0, exports.arrayHasId)(staffFlowIds, f.flowId));
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiliaze/global-vars",
3
- "version": "1.116.0",
3
+ "version": "1.117.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.116.0 -m 'v1.116.0'; git push origin v1.116.0; git push",
25
+ "git": "git add .; git commit -m 'changes'; git tag -a v1.117.0 -m 'v1.117.0'; git push origin v1.117.0; git push",
26
26
  "push": "npm run build; npm run git; npm run pub"
27
27
  },
28
28
  "author": "Ibi Hasanli",