Skip to content

feat: Added FilterLogEntriesByDateQueryHandler#44

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

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

Conversation

@ashikka

@ashikka ashikka commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@dgraciac

dgraciac commented Sep 2, 2021

Copy link
Copy Markdown
Member

@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

ashikka commented Sep 2, 2021

Copy link
Copy Markdown
Contributor Author

@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

dgraciac commented Sep 6, 2021

Copy link
Copy Markdown
Member

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

dgraciac commented Sep 6, 2021

Copy link
Copy Markdown
Member

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

dgraciac commented Sep 6, 2021

Copy link
Copy Markdown
Member

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