@ibiliaze/global-vars 1.125.0 → 1.126.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 -5
  2. package/package.json +2 -2
package/dist/flows.js CHANGED
@@ -35,9 +35,10 @@ function makeSaleLogic() {
35
35
  return 'Online';
36
36
  }
37
37
  }
38
- const guestSeesSeasonalAndOnline = (flow) => flow.type === 'Seasonal ticket' || flow.type === 'Online';
38
+ const guestSeesOnline = (flow) => flow.type === 'Online';
39
+ const guestSeesSeasonal = (flow) => flow.type === 'Seasonal ticket';
39
40
  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);
41
+ const cashierSeesOffline = (flow, staffFlowIds) => flow.type === 'Offline' && (0, exports.arrayHasId)(staffFlowIds, flow.flowId);
41
42
  const comesFromSpecialLink = (flow, signedFlowId) => flow.type === 'Special link' && (0, exports.idsEqual)(flow.flowId, signedFlowId);
42
43
  const authoriser = ({ who, where, effectiveFlows, signedFlowId, staffFlowIds, }) => {
43
44
  // Guest
@@ -47,9 +48,9 @@ function makeSaleLogic() {
47
48
  if (where === 'Special link')
48
49
  return effectiveFlows.some(f => comesFromSpecialLink(f, signedFlowId));
49
50
  if (where === 'Online')
50
- return effectiveFlows.some(f => guestSeesSeasonalAndOnline(f));
51
+ return effectiveFlows.some(f => guestSeesOnline(f));
51
52
  if (where === 'Seasonal ticket')
52
- return effectiveFlows.some(f => f.type === 'Seasonal ticket');
53
+ return effectiveFlows.some(f => guestSeesSeasonal(f));
53
54
  }
54
55
  // Cashier
55
56
  if (who === 'cashier') {
@@ -60,7 +61,7 @@ function makeSaleLogic() {
60
61
  if (where === 'Special link')
61
62
  return false;
62
63
  if (where === 'Offline')
63
- return effectiveFlows.some(f => cashierSeesSeasonalAndOffline(f, staffFlowIds));
64
+ return effectiveFlows.some(f => cashierSeesOffline(f, staffFlowIds));
64
65
  if (where === 'Seasonal ticket')
65
66
  return effectiveFlows.some(f => cashierSeesSeasonal(f, staffFlowIds));
66
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiliaze/global-vars",
3
- "version": "1.125.0",
3
+ "version": "1.126.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.125.0 -m 'v1.125.0'; git push origin v1.125.0; git push",
25
+ "git": "git add .; git commit -m 'changes'; git tag -a v1.126.0 -m 'v1.126.0'; git push origin v1.126.0; git push",
26
26
  "push": "npm run build; npm run git; npm run pub"
27
27
  },
28
28
  "author": "Ibi Hasanli",