@finos/legend-application-query 5.0.1 → 5.0.2

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 (93) hide show
  1. package/lib/components/QueryBuilderExplorerPanel.d.ts.map +1 -1
  2. package/lib/components/QueryBuilderExplorerPanel.js +3 -1
  3. package/lib/components/QueryBuilderExplorerPanel.js.map +1 -1
  4. package/lib/components/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderFetchStructurePanel.js +39 -7
  6. package/lib/components/QueryBuilderFetchStructurePanel.js.map +1 -1
  7. package/lib/components/QueryBuilderFilterPanel.d.ts.map +1 -1
  8. package/lib/components/QueryBuilderFilterPanel.js +43 -12
  9. package/lib/components/QueryBuilderFilterPanel.js.map +1 -1
  10. package/lib/components/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderPostFilterPanel.js +12 -3
  12. package/lib/components/QueryBuilderPostFilterPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  14. package/lib/components/QueryBuilderPropertySearchPanel.js +2 -1
  15. package/lib/components/QueryBuilderPropertySearchPanel.js.map +1 -1
  16. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  17. package/lib/components/QueryBuilderResultPanel.js +11 -7
  18. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  19. package/lib/index.css +2 -2
  20. package/lib/index.css.map +1 -1
  21. package/lib/package.json +2 -2
  22. package/lib/stores/QueryBuilderExplorerState.d.ts +1 -1
  23. package/lib/stores/QueryBuilderExplorerState.d.ts.map +1 -1
  24. package/lib/stores/QueryBuilderExplorerState.js +13 -3
  25. package/lib/stores/QueryBuilderExplorerState.js.map +1 -1
  26. package/lib/stores/QueryBuilderFilterState.d.ts +7 -1
  27. package/lib/stores/QueryBuilderFilterState.d.ts.map +1 -1
  28. package/lib/stores/QueryBuilderFilterState.js +5 -0
  29. package/lib/stores/QueryBuilderFilterState.js.map +1 -1
  30. package/lib/stores/QueryBuilderOperatorsHelper.d.ts +1 -0
  31. package/lib/stores/QueryBuilderOperatorsHelper.d.ts.map +1 -1
  32. package/lib/stores/QueryBuilderOperatorsHelper.js +28 -1
  33. package/lib/stores/QueryBuilderOperatorsHelper.js.map +1 -1
  34. package/lib/stores/QueryBuilderProjectionState.d.ts +1 -0
  35. package/lib/stores/QueryBuilderProjectionState.d.ts.map +1 -1
  36. package/lib/stores/QueryBuilderProjectionState.js +11 -0
  37. package/lib/stores/QueryBuilderProjectionState.js.map +1 -1
  38. package/lib/stores/QueryBuilderPropertySearchPanelState.js +1 -1
  39. package/lib/stores/QueryBuilderPropertySearchPanelState.js.map +1 -1
  40. package/lib/stores/QueryBuilderResultState.d.ts +5 -2
  41. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  42. package/lib/stores/QueryBuilderResultState.js +19 -7
  43. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  44. package/lib/stores/QueryBuilderState.d.ts +1 -0
  45. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  46. package/lib/stores/QueryBuilderState.js +3 -0
  47. package/lib/stores/QueryBuilderState.js.map +1 -1
  48. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  49. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js +5 -31
  50. package/lib/stores/filterOperators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  51. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  52. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js +5 -31
  53. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  54. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  55. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js +5 -31
  56. package/lib/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  57. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  58. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js +5 -32
  59. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  60. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  61. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js +5 -31
  62. package/lib/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  63. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  64. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js +3 -29
  65. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  66. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  67. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js +4 -30
  68. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  69. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  70. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js +4 -30
  71. package/lib/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  72. package/package.json +9 -9
  73. package/src/components/QueryBuilderExplorerPanel.tsx +3 -1
  74. package/src/components/QueryBuilderFetchStructurePanel.tsx +44 -7
  75. package/src/components/QueryBuilderFilterPanel.tsx +70 -17
  76. package/src/components/QueryBuilderPostFilterPanel.tsx +22 -3
  77. package/src/components/QueryBuilderPropertySearchPanel.tsx +1 -0
  78. package/src/components/QueryBuilderResultPanel.tsx +70 -47
  79. package/src/stores/QueryBuilderExplorerState.ts +17 -3
  80. package/src/stores/QueryBuilderFilterState.ts +7 -0
  81. package/src/stores/QueryBuilderOperatorsHelper.ts +35 -0
  82. package/src/stores/QueryBuilderProjectionState.ts +15 -0
  83. package/src/stores/QueryBuilderPropertySearchPanelState.ts +1 -1
  84. package/src/stores/QueryBuilderResultState.ts +27 -9
  85. package/src/stores/QueryBuilderState.ts +4 -0
  86. package/src/stores/filterOperators/QueryBuilderFilterOperator_Equal.ts +6 -35
  87. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThan.ts +9 -35
  88. package/src/stores/filterOperators/QueryBuilderFilterOperator_GreaterThanEqual.ts +9 -35
  89. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThan.ts +9 -36
  90. package/src/stores/filterOperators/QueryBuilderFilterOperator_LessThanEqual.ts +9 -35
  91. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_Equal.ts +6 -33
  92. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_GreaterThan.ts +11 -36
  93. package/src/stores/postFilterOperators/QueryBuilderPostFilterOperator_LessThan.ts +11 -36
@@ -24,7 +24,6 @@ import {
24
24
  type ValueSpecification,
25
25
  type SimpleFunctionExpression,
26
26
  type AbstractPropertyExpression,
27
- isSuperType,
28
27
  SUPPORTED_FUNCTIONS,
29
28
  buildPrimitiveInstanceValue,
30
29
  } from '@finos/legend-graph';
@@ -35,7 +34,10 @@ import {
35
34
  } from './QueryBuilderFilterOperatorHelper.js';
36
35
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
37
36
  import { generateDefaultValueForPrimitiveType } from '../QueryBuilderValueSpecificationBuilderHelper.js';
38
- import { getNonCollectionValueSpecificationType } from '../QueryBuilderOperatorsHelper.js';
37
+ import {
38
+ getNonCollectionValueSpecificationType,
39
+ isTypeCompatibleWithConditionValueType,
40
+ } from '../QueryBuilderOperatorsHelper.js';
39
41
 
40
42
  export class QueryBuilderFilterOperator_LessThan extends QueryBuilderFilterOperator {
41
43
  getLabel(filterConditionState: FilterConditionState): string {
@@ -64,41 +66,12 @@ export class QueryBuilderFilterOperator_LessThan extends QueryBuilderFilterOpera
64
66
  isCompatibleWithFilterConditionValue(
65
67
  filterConditionState: FilterConditionState,
66
68
  ): boolean {
67
- const propertyType =
69
+ return isTypeCompatibleWithConditionValueType(
70
+ filterConditionState.value
71
+ ? getNonCollectionValueSpecificationType(filterConditionState.value)
72
+ : undefined,
68
73
  filterConditionState.propertyExpressionState.propertyExpression.func
69
- .genericType.value.rawType;
70
- const type = filterConditionState.value
71
- ? getNonCollectionValueSpecificationType(filterConditionState.value)
72
- : undefined;
73
- const NUMERIC_PRIMITIVE_TYPES = [
74
- PRIMITIVE_TYPE.NUMBER,
75
- PRIMITIVE_TYPE.INTEGER,
76
- PRIMITIVE_TYPE.DECIMAL,
77
- PRIMITIVE_TYPE.FLOAT,
78
- ] as string[];
79
-
80
- const DATE_PRIMITIVE_TYPES = [
81
- PRIMITIVE_TYPE.DATE,
82
- PRIMITIVE_TYPE.DATETIME,
83
- PRIMITIVE_TYPE.STRICTDATE,
84
- PRIMITIVE_TYPE.LATESTDATE,
85
- ] as string[];
86
-
87
- // When changing the return type for LHS, the RHS value should be adjusted accordingly.
88
- return (
89
- type !== undefined &&
90
- // Numeric value is handled loosely because of autoboxing
91
- // e.g. LHS (integer) = RHS (float) is acceptable
92
- ((NUMERIC_PRIMITIVE_TYPES.includes(type.path) &&
93
- NUMERIC_PRIMITIVE_TYPES.includes(propertyType.path)) ||
94
- // Date value is handled loosely as well if the LHS is of type DateTime
95
- // This is because we would simulate auto-boxing for date by altering the
96
- // Pure function used for the operation
97
- // e.g. LHS(DateTime) = RHS(Date) -> we use isOnDay() instead of is()
98
- (propertyType.path === PRIMITIVE_TYPE.DATETIME &&
99
- DATE_PRIMITIVE_TYPES.includes(type.path)) ||
100
- type === propertyType ||
101
- isSuperType(propertyType, type))
74
+ .genericType.value.rawType,
102
75
  );
103
76
  }
104
77
 
@@ -24,7 +24,6 @@ import {
24
24
  type ValueSpecification,
25
25
  type SimpleFunctionExpression,
26
26
  type AbstractPropertyExpression,
27
- isSuperType,
28
27
  SUPPORTED_FUNCTIONS,
29
28
  buildPrimitiveInstanceValue,
30
29
  } from '@finos/legend-graph';
@@ -35,7 +34,10 @@ import {
35
34
  } from './QueryBuilderFilterOperatorHelper.js';
36
35
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
37
36
  import { generateDefaultValueForPrimitiveType } from '../QueryBuilderValueSpecificationBuilderHelper.js';
38
- import { getNonCollectionValueSpecificationType } from '../QueryBuilderOperatorsHelper.js';
37
+ import {
38
+ getNonCollectionValueSpecificationType,
39
+ isTypeCompatibleWithConditionValueType,
40
+ } from '../QueryBuilderOperatorsHelper.js';
39
41
 
40
42
  export class QueryBuilderFilterOperator_LessThanEqual extends QueryBuilderFilterOperator {
41
43
  getLabel(filterConditionState: FilterConditionState): string {
@@ -64,40 +66,12 @@ export class QueryBuilderFilterOperator_LessThanEqual extends QueryBuilderFilter
64
66
  isCompatibleWithFilterConditionValue(
65
67
  filterConditionState: FilterConditionState,
66
68
  ): boolean {
67
- const propertyType =
69
+ return isTypeCompatibleWithConditionValueType(
70
+ filterConditionState.value
71
+ ? getNonCollectionValueSpecificationType(filterConditionState.value)
72
+ : undefined,
68
73
  filterConditionState.propertyExpressionState.propertyExpression.func
69
- .genericType.value.rawType;
70
- const type = filterConditionState.value
71
- ? getNonCollectionValueSpecificationType(filterConditionState.value)
72
- : undefined;
73
- const NUMERIC_PRIMITIVE_TYPES = [
74
- PRIMITIVE_TYPE.NUMBER,
75
- PRIMITIVE_TYPE.INTEGER,
76
- PRIMITIVE_TYPE.DECIMAL,
77
- PRIMITIVE_TYPE.FLOAT,
78
- ] as string[];
79
-
80
- const DATE_PRIMITIVE_TYPES = [
81
- PRIMITIVE_TYPE.DATE,
82
- PRIMITIVE_TYPE.DATETIME,
83
- PRIMITIVE_TYPE.STRICTDATE,
84
- PRIMITIVE_TYPE.LATESTDATE,
85
- ] as string[];
86
-
87
- // When changing the return type for LHS, the RHS value should be adjusted accordingly.
88
- return (
89
- type !== undefined &&
90
- // Numeric value is handled loosely because of autoboxing
91
- // e.g. LHS (integer) = RHS (float) is acceptable
92
- ((NUMERIC_PRIMITIVE_TYPES.includes(type.path) &&
93
- NUMERIC_PRIMITIVE_TYPES.includes(propertyType.path)) ||
94
- // Date value is handled loosely as well if the LHS is of type DateTime
95
- // This is because we would simulate auto-boxing for date by altering the
96
- // Pure function used for the operation
97
- // e.g. LHS(DateTime) = RHS(Date) -> we use isOnDay() instead of is()
98
- DATE_PRIMITIVE_TYPES.includes(type.path) ||
99
- type === propertyType ||
100
- isSuperType(propertyType, type))
74
+ .genericType.value.rawType,
101
75
  );
102
76
  }
103
77
 
@@ -28,7 +28,6 @@ import {
28
28
  GenericTypeExplicitReference,
29
29
  PRIMITIVE_TYPE,
30
30
  TYPICAL_MULTIPLICITY_TYPE,
31
- isSuperType,
32
31
  SUPPORTED_FUNCTIONS,
33
32
  buildPrimitiveInstanceValue,
34
33
  } from '@finos/legend-graph';
@@ -40,6 +39,7 @@ import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
40
39
  import {
41
40
  buildNotExpression,
42
41
  getNonCollectionValueSpecificationType,
42
+ isTypeCompatibleWithConditionValueType,
43
43
  unwrapNotExpression,
44
44
  } from '../QueryBuilderOperatorsHelper.js';
45
45
  import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
@@ -79,40 +79,13 @@ export class QueryBuilderPostFilterOperator_Equal extends QueryBuilderPostFilter
79
79
  isCompatibleWithConditionValue(
80
80
  postFilterConditionState: PostFilterConditionState,
81
81
  ): boolean {
82
- const lhsType = guaranteeNonNullable(
83
- postFilterConditionState.columnState.getReturnType(),
84
- );
85
82
  const valueSpecification = postFilterConditionState.value;
86
83
  if (valueSpecification) {
87
- const type = getNonCollectionValueSpecificationType(valueSpecification);
88
- const NUMERIC_PRIMITIVE_TYPES = [
89
- PRIMITIVE_TYPE.NUMBER,
90
- PRIMITIVE_TYPE.INTEGER,
91
- PRIMITIVE_TYPE.DECIMAL,
92
- PRIMITIVE_TYPE.FLOAT,
93
- ] as string[];
94
-
95
- const DATE_PRIMITIVE_TYPES = [
96
- PRIMITIVE_TYPE.DATE,
97
- PRIMITIVE_TYPE.DATETIME,
98
- PRIMITIVE_TYPE.STRICTDATE,
99
- PRIMITIVE_TYPE.LATESTDATE,
100
- ] as string[];
101
-
102
- // When changing the return type for LHS, the RHS value should be adjusted accordingly.
103
- return (
104
- type !== undefined &&
105
- // Numeric value is handled loosely because of autoboxing
106
- // e.g. LHS (integer) = RHS (float) is acceptable
107
- ((NUMERIC_PRIMITIVE_TYPES.includes(type.path) &&
108
- NUMERIC_PRIMITIVE_TYPES.includes(lhsType.path)) ||
109
- // Date value is handled loosely as well if the LHS is of type DateTime
110
- // This is because we would simulate auto-boxing for date by altering the
111
- // Pure function used for the operation
112
- // e.g. LHS(DateTime) = RHS(Date) -> we use isOnDay() instead of is()
113
- DATE_PRIMITIVE_TYPES.includes(type.path) ||
114
- type === lhsType ||
115
- isSuperType(lhsType, type))
84
+ return isTypeCompatibleWithConditionValueType(
85
+ getNonCollectionValueSpecificationType(valueSpecification),
86
+ guaranteeNonNullable(
87
+ postFilterConditionState.columnState.getReturnType(),
88
+ ),
116
89
  );
117
90
  }
118
91
  return false;
@@ -20,7 +20,6 @@ import {
20
20
  type FunctionExpression,
21
21
  AbstractPropertyExpression,
22
22
  PRIMITIVE_TYPE,
23
- isSuperType,
24
23
  SUPPORTED_FUNCTIONS,
25
24
  buildPrimitiveInstanceValue,
26
25
  } from '@finos/legend-graph';
@@ -29,7 +28,10 @@ import {
29
28
  UnsupportedOperationError,
30
29
  } from '@finos/legend-shared';
31
30
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
32
- import { getNonCollectionValueSpecificationType } from '../QueryBuilderOperatorsHelper.js';
31
+ import {
32
+ getNonCollectionValueSpecificationType,
33
+ isTypeCompatibleWithConditionValueType,
34
+ } from '../QueryBuilderOperatorsHelper.js';
33
35
  import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
34
36
  import { buildPostFilterConditionState } from '../QueryBuilderPostFilterProcessor.js';
35
37
  import type {
@@ -61,40 +63,13 @@ export class QueryBuilderPostFilterOperator_GreaterThan extends QueryBuilderPost
61
63
  isCompatibleWithConditionValue(
62
64
  postFilterConditionState: PostFilterConditionState,
63
65
  ): boolean {
64
- const lhsType = guaranteeNonNullable(
65
- postFilterConditionState.columnState.getReturnType(),
66
- );
67
- const type = postFilterConditionState.value
68
- ? getNonCollectionValueSpecificationType(postFilterConditionState.value)
69
- : undefined;
70
- const NUMERIC_PRIMITIVE_TYPES = [
71
- PRIMITIVE_TYPE.NUMBER,
72
- PRIMITIVE_TYPE.INTEGER,
73
- PRIMITIVE_TYPE.DECIMAL,
74
- PRIMITIVE_TYPE.FLOAT,
75
- ] as string[];
76
-
77
- const DATE_PRIMITIVE_TYPES = [
78
- PRIMITIVE_TYPE.DATE,
79
- PRIMITIVE_TYPE.DATETIME,
80
- PRIMITIVE_TYPE.STRICTDATE,
81
- PRIMITIVE_TYPE.LATESTDATE,
82
- ] as string[];
83
-
84
- // When changing the return type for LHS, the RHS value should be adjusted accordingly.
85
- return (
86
- type !== undefined &&
87
- // Numeric value is handled loosely because of autoboxing
88
- // e.g. LHS (integer) = RHS (float) is acceptable
89
- ((NUMERIC_PRIMITIVE_TYPES.includes(type.path) &&
90
- NUMERIC_PRIMITIVE_TYPES.includes(lhsType.path)) ||
91
- // Date value is handled loosely as well if the LHS is of type DateTime
92
- // This is because we would simulate auto-boxing for date by altering the
93
- // Pure function used for the operation
94
- // e.g. LHS(DateTime) = RHS(Date) -> we use isOnDay() instead of is()
95
- DATE_PRIMITIVE_TYPES.includes(type.path) ||
96
- type === lhsType ||
97
- isSuperType(lhsType, type))
66
+ return isTypeCompatibleWithConditionValueType(
67
+ postFilterConditionState.value
68
+ ? getNonCollectionValueSpecificationType(postFilterConditionState.value)
69
+ : undefined,
70
+ guaranteeNonNullable(
71
+ postFilterConditionState.columnState.getReturnType(),
72
+ ),
98
73
  );
99
74
  }
100
75
 
@@ -21,7 +21,6 @@ import {
21
21
  type FunctionExpression,
22
22
  PRIMITIVE_TYPE,
23
23
  SUPPORTED_FUNCTIONS,
24
- isSuperType,
25
24
  buildPrimitiveInstanceValue,
26
25
  } from '@finos/legend-graph';
27
26
  import {
@@ -29,7 +28,10 @@ import {
29
28
  UnsupportedOperationError,
30
29
  } from '@finos/legend-shared';
31
30
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../QueryBuilder_Const.js';
32
- import { getNonCollectionValueSpecificationType } from '../QueryBuilderOperatorsHelper.js';
31
+ import {
32
+ getNonCollectionValueSpecificationType,
33
+ isTypeCompatibleWithConditionValueType,
34
+ } from '../QueryBuilderOperatorsHelper.js';
33
35
  import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
34
36
  import { buildPostFilterConditionState } from '../QueryBuilderPostFilterProcessor.js';
35
37
  import type {
@@ -61,40 +63,13 @@ export class QueryBuilderPostFilterOperator_LessThan extends QueryBuilderPostFil
61
63
  isCompatibleWithConditionValue(
62
64
  postFilterConditionState: PostFilterConditionState,
63
65
  ): boolean {
64
- const lhsType = guaranteeNonNullable(
65
- postFilterConditionState.columnState.getReturnType(),
66
- );
67
- const type = postFilterConditionState.value
68
- ? getNonCollectionValueSpecificationType(postFilterConditionState.value)
69
- : undefined;
70
- const NUMERIC_PRIMITIVE_TYPES = [
71
- PRIMITIVE_TYPE.NUMBER,
72
- PRIMITIVE_TYPE.INTEGER,
73
- PRIMITIVE_TYPE.DECIMAL,
74
- PRIMITIVE_TYPE.FLOAT,
75
- ] as string[];
76
-
77
- const DATE_PRIMITIVE_TYPES = [
78
- PRIMITIVE_TYPE.DATE,
79
- PRIMITIVE_TYPE.DATETIME,
80
- PRIMITIVE_TYPE.STRICTDATE,
81
- PRIMITIVE_TYPE.LATESTDATE,
82
- ] as string[];
83
-
84
- // When changing the return type for LHS, the RHS value should be adjusted accordingly.
85
- return (
86
- type !== undefined &&
87
- // Numeric value is handled loosely because of autoboxing
88
- // e.g. LHS (integer) = RHS (float) is acceptable
89
- ((NUMERIC_PRIMITIVE_TYPES.includes(type.path) &&
90
- NUMERIC_PRIMITIVE_TYPES.includes(lhsType.path)) ||
91
- // Date value is handled loosely as well if the LHS is of type DateTime
92
- // This is because we would simulate auto-boxing for date by altering the
93
- // Pure function used for the operation
94
- // e.g. LHS(DateTime) = RHS(Date) -> we use isOnDay() instead of is()
95
- DATE_PRIMITIVE_TYPES.includes(type.path) ||
96
- type === lhsType ||
97
- isSuperType(lhsType, type))
66
+ return isTypeCompatibleWithConditionValueType(
67
+ postFilterConditionState.value
68
+ ? getNonCollectionValueSpecificationType(postFilterConditionState.value)
69
+ : undefined,
70
+ guaranteeNonNullable(
71
+ postFilterConditionState.columnState.getReturnType(),
72
+ ),
98
73
  );
99
74
  }
100
75