social share up and running
This commit is contained in:
1 parent
000ebd388a
commit
b8779e5a35
22 files changed
+1935
-41
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { IsEnum, IsOptional, IsString, IsUUID } from 'class-validator';
|
||||
import type { SharePlatform } from './analytics.entity';
|
||||
|
||||
export class TrackShareDto {
|
||||
@IsUUID()
|
||||
articleId: string;
|
||||
|
||||
@IsEnum(['facebook', 'twitter', 'whatsapp', 'telegram', 'link'])
|
||||
platform: SharePlatform;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
userAgent?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
ipAddress?: string;
|
||||
}
|
||||
|
||||
export class GetShareStatsDto {
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
articleId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
startDate?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export class ShareStatsResponse {
|
||||
articleId: string;
|
||||
articleTitle: string;
|
||||
facebookShares: number;
|
||||
twitterShares: number;
|
||||
whatsappShares: number;
|
||||
telegramShares: number;
|
||||
linkShares: number;
|
||||
totalShares: number;
|
||||
views: number;
|
||||
shareRate: number;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
Reference in new issue
Block a user