Skip to content

Commit

Permalink
mapping payload and fixing between and outside of time range
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Imperio authored and Felipe Imperio committed Dec 7, 2024
1 parent c0017da commit 4eb4a54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/entities/activity/model/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ function mapConditionalLogic(dto: ConditionalLogicDto | null) {
updatedCondition.payload = { time: condition.payload.time };
break;

case 'OUTSIDE_OF_TIMES_RANGE':
case 'BETWEEN_TIMES_RANGE':
case 'BETWEEN_TIMES':
case 'OUTSIDE_OF_TIMES':
updatedCondition.payload = {
Expand All @@ -139,6 +137,15 @@ function mapConditionalLogic(dto: ConditionalLogicDto | null) {
};
break;

case 'OUTSIDE_OF_TIMES_RANGE':
case 'BETWEEN_TIMES_RANGE':
updatedCondition.payload = {
minTime: condition.payload.minTime,
maxTime: condition.payload.maxTime,
fieldName: condition.payload.fieldName,
};
break;

case 'GREATER_THAN_TIME_RANGE':
case 'LESS_THAN_TIME_RANGE':
case 'EQUAL_TO_TIME_RANGE':
Expand Down
4 changes: 2 additions & 2 deletions src/entities/conditional-logic/model/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export const isBetweenTimesRange = (

return (
selectedTimeInMinutes !== null &&
selectedTimeInMinutes >= timeToMinutes(minTime) &&
selectedTimeInMinutes <= timeToMinutes(maxTime)
selectedTimeInMinutes > timeToMinutes(minTime) &&
selectedTimeInMinutes < timeToMinutes(maxTime)
);
};

Expand Down

0 comments on commit 4eb4a54

Please sign in to comment.