rez_core 5.0.69 → 5.0.70
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/package.json
CHANGED
|
@@ -955,13 +955,13 @@ export class FilterService {
|
|
|
955
955
|
// ============================================
|
|
956
956
|
case 'empty':
|
|
957
957
|
return {
|
|
958
|
-
query: `e.${attr} IS NULL
|
|
958
|
+
query: `e.${attr} IS NULL`,
|
|
959
959
|
params: {},
|
|
960
960
|
};
|
|
961
961
|
|
|
962
962
|
case 'not_empty':
|
|
963
963
|
return {
|
|
964
|
-
query: `e.${attr} IS NOT NULL
|
|
964
|
+
query: `e.${attr} IS NOT NULL`,
|
|
965
965
|
params: {},
|
|
966
966
|
};
|
|
967
967
|
|
|
@@ -977,7 +977,7 @@ export class FilterService {
|
|
|
977
977
|
|
|
978
978
|
const dayBefore = (() => {
|
|
979
979
|
const d = new Date();
|
|
980
|
-
d.setDate(d.getDate() -
|
|
980
|
+
d.setDate(d.getDate() - numVal);
|
|
981
981
|
return d.toISOString().split('T')[0];
|
|
982
982
|
})();
|
|
983
983
|
|
|
@@ -1128,6 +1128,66 @@ export class FilterService {
|
|
|
1128
1128
|
};
|
|
1129
1129
|
}
|
|
1130
1130
|
|
|
1131
|
+
// ============================================
|
|
1132
|
+
// IN LAST DAY (range: today to N days before)
|
|
1133
|
+
// ============================================
|
|
1134
|
+
case 'in_last_day': {
|
|
1135
|
+
if (isNaN(numVal)) {
|
|
1136
|
+
throw new BadRequestException(
|
|
1137
|
+
'Value must be a number for in_last_day',
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
const today = (() => {
|
|
1142
|
+
const d = new Date();
|
|
1143
|
+
return d.toISOString().split('T')[0];
|
|
1144
|
+
})();
|
|
1145
|
+
|
|
1146
|
+
const lastN = (() => {
|
|
1147
|
+
const d = new Date();
|
|
1148
|
+
d.setDate(d.getDate() - numVal);
|
|
1149
|
+
return d.toISOString().split('T')[0];
|
|
1150
|
+
})();
|
|
1151
|
+
|
|
1152
|
+
return {
|
|
1153
|
+
query: `${dateColumn} BETWEEN :${key}_start AND :${key}_end`,
|
|
1154
|
+
params: {
|
|
1155
|
+
[`${key}_start`]: lastN,
|
|
1156
|
+
[`${key}_end`]: today,
|
|
1157
|
+
},
|
|
1158
|
+
};
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// ============================================
|
|
1162
|
+
// IN NEXT DAY (range: today to N days after)
|
|
1163
|
+
// ============================================
|
|
1164
|
+
case 'in_next_day': {
|
|
1165
|
+
if (isNaN(numVal)) {
|
|
1166
|
+
throw new BadRequestException(
|
|
1167
|
+
'Value must be a number for in_next_day',
|
|
1168
|
+
);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
const today = (() => {
|
|
1172
|
+
const d = new Date();
|
|
1173
|
+
return d.toISOString().split('T')[0];
|
|
1174
|
+
})();
|
|
1175
|
+
|
|
1176
|
+
const nextN = (() => {
|
|
1177
|
+
const d = new Date();
|
|
1178
|
+
d.setDate(d.getDate() + numVal);
|
|
1179
|
+
return d.toISOString().split('T')[0];
|
|
1180
|
+
})();
|
|
1181
|
+
|
|
1182
|
+
return {
|
|
1183
|
+
query: `${dateColumn} BETWEEN :${key}_start AND :${key}_end`,
|
|
1184
|
+
params: {
|
|
1185
|
+
[`${key}_start`]: today,
|
|
1186
|
+
[`${key}_end`]: nextN,
|
|
1187
|
+
},
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1131
1191
|
default:
|
|
1132
1192
|
throw new BadRequestException(`Unsupported operator for date: ${op}`);
|
|
1133
1193
|
}
|