-
Notifications
You must be signed in to change notification settings - Fork 0
Feat analytics filter #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
laxman-aqw
commented
Oct 31, 2025
- Added os column in url analytics
- Added url filter service and end points
- updated the url record clicks service to fetch browser, device and os
- updated the url endpoint from url to urls
- added DeleteDateColumn and updated to soft delete
|
|
||
| export class FilterAnalyticsRequestData { | ||
| @IsOptional() | ||
| browser?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| browser?: string; | |
| browser?: string | null; |
do this for other as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| export class UrlAnalytics { | ||
| @PrimaryGeneratedColumn('uuid') | ||
| readonly id: string; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add @Index here. plus explore separately what does it do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
src/analytics/analytics.entity.ts
Outdated
| readonly urlId: string; | ||
|
|
||
| @Column({ type: 'varchar', length: 40, nullable: true, name: 'country' }) | ||
| readonly country: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| readonly country?: string | null; |
do this for others as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
src/analytics/analytics.entity.ts
Outdated
| readonly browser: string; | ||
|
|
||
| @Column({ type: 'varchar', length: 100, nullable: true, name: 'ip' }) | ||
| readonly ip: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ipAddress or ip_address would be better name here
| } | ||
| ).parse(userAgent); | ||
|
|
||
| const deviceMatch = parsed.source.match(/\(([^;]+);/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does that regex expression do? It's better to add in comment about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
src/analytics/analytics.service.ts
Outdated
| start: requestData.startDate, | ||
| end: requestData.endDate, | ||
| }); | ||
| } else if (requestData.startDate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use else if stick with using if statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
| "os" VARCHAR(40) , | ||
| "device" VARCHAR(50), | ||
| "browser" VARCHAR(40) , | ||
| "user_agent" VARCHAR(200), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user agents might exceed 200 character limit