@ibiliaze/global-vars 1.113.0 → 1.115.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.d.ts CHANGED
@@ -53,6 +53,7 @@ export interface GetOccupanceCategoryArgs<Id, TDate> {
53
53
  export interface GetCategoryArgs<Id, TDate> {
54
54
  where: WhereOf<Id, TDate>;
55
55
  fixtureCategories: FixtureCategoryOf<Id>[];
56
+ sectionId: Id;
56
57
  occupanceCategory: FixtureCategoryOf<Id> | undefined;
57
58
  sectionCategory: FixtureCategoryOf<Id> | undefined;
58
59
  }
package/dist/flows.js CHANGED
@@ -135,7 +135,7 @@ function makeSaleLogic() {
135
135
  return undefined;
136
136
  }
137
137
  }
138
- function getCategory({ where, fixtureCategories, occupanceCategory, sectionCategory, }) {
138
+ function getCategory({ where, sectionId, fixtureCategories, occupanceCategory, sectionCategory, }) {
139
139
  try {
140
140
  const occupanceCatOverride = !!occupanceCategory?.categoryId;
141
141
  const category = occupanceCatOverride ? occupanceCategory : sectionCategory;
@@ -149,14 +149,15 @@ function makeSaleLogic() {
149
149
  flows: category?.flows ?? [],
150
150
  sections: category?.sections ?? [],
151
151
  };
152
+ // If it isn't a seasonal seat, return the effective cat
152
153
  if (!isSeasonal)
153
154
  return effectiveCategory;
154
- if (where === 'Seasonal ticket')
155
- return effectiveCategory;
156
- if (where === 'Offline')
155
+ // If Return the effective category is Sale Channel is Seasonal or Offline
156
+ if (where === 'Seasonal ticket' || where === 'Offline')
157
157
  return effectiveCategory;
158
- const onlineFlowCategory = fixtureCategories?.find(link => link.flows?.some(flow => flow.type === 'Online'));
159
- return onlineFlowCategory;
158
+ // If sale channel is not seasonal but the seat is seasonal, return a default category
159
+ const defaultFlowCategory = fixtureCategories.find(cat => cat.sections?.some(sec => (0, exports.idsEqual)(sec.sectionId, sectionId)));
160
+ return defaultFlowCategory;
160
161
  }
161
162
  catch {
162
163
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiliaze/global-vars",
3
- "version": "1.113.0",
3
+ "version": "1.115.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.113.0 -m 'v1.113.0'; git push origin v1.113.0; git push",
25
+ "git": "git add .; git commit -m 'changes'; git tag -a v1.115.0 -m 'v1.115.0'; git push origin v1.115.0; git push",
26
26
  "push": "npm run build; npm run git; npm run pub"
27
27
  },
28
28
  "author": "Ibi Hasanli",