Skip to content

feat: Added FilterLogEntriesByDateQueryHandler#44

Open
ashikka wants to merge 9 commits intomainfrom
feat/filter-log-entries-by-date
Open

feat: Added FilterLogEntriesByDateQueryHandler#44
ashikka wants to merge 9 commits intomainfrom
feat/filter-log-entries-by-date

Conversation

@ashikka
Copy link
Copy Markdown
Contributor

@ashikka ashikka commented Aug 31, 2021

No description provided.

@dgraciac
Copy link
Copy Markdown
Member

dgraciac commented Sep 2, 2021

@ashikka a general consideration. I believe this task is about searching log entries by two dates (from, to). The client sends two dates as queryparams (?filter[time_gtOrEq]=123378244&filter[time_ltOrEq]=1231234834) and the backend respond all log entries whose time are between filter[time_gtOrEq] and filter[time_ltOrEq].

@ashikka
Copy link
Copy Markdown
Contributor Author

ashikka commented Sep 2, 2021

@ashikka a general consideration. I believe this task is about searching log entries by two dates (from, to). The client sends two dates as queryparams (?filter[time_gtOrEq]=123378244&filter[time_ltOrEq]=1231234834) and the backend respond all log entries whose time are between filter[time_gtOrEq] and filter[time_ltOrEq].

Oh alright. I did not consider that.

@dgraciac
Copy link
Copy Markdown
Member

dgraciac commented Sep 6, 2021

Now, we have changed the time type to ZonedDateTime, we have to adapt data.sql to use the new SQL type:

Before:

INSERT INTO log_entry
VALUES(
    '93acd93f-cc03-49ab-b761-b2b2810ad505',
    '5ee62461-adb8-4618-a110-06290a787223',
    1625814857
);

After:

INSERT INTO log_entry
VALUES(
    '93acd93f-cc03-49ab-b761-b2b2810ad505',
    '5ee62461-adb8-4618-a110-06290a787223',
    '2018-01-02 13:14:15+01' (for example)
);

@dgraciac
Copy link
Copy Markdown
Member

dgraciac commented Sep 6, 2021

In container tests, now we have to wrap the time field with "" in order to avoid serialization issues:

                        "attributes": {
                            "childId": "${childId.value}",
                            "time": "$time",
                            "duration": $duration
                        },

@dgraciac
Copy link
Copy Markdown
Member

dgraciac commented Sep 6, 2021

After doing the comments above, tests will still fail because the expected time is not equal to actual time.

@dgraciac
Copy link
Copy Markdown
Member

Hi @ashikka . In order to use same date format through all katydid service use this code to serialize all dates:

val unifiedFormat: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'")
fun ZonedDateTime.toUnifiedFormat(): String = this.format(unifiedFormat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants