chore(legacy): relocate v1 dataconnect source
This commit is contained in:
175
legacy/dataconnect-v1/connector/activityLog/queries.gql
Normal file
175
legacy/dataconnect-v1/connector/activityLog/queries.gql
Normal file
@@ -0,0 +1,175 @@
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST ALL (admin/debug)
|
||||
# ----------------------------------------------------------
|
||||
query listActivityLogs(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
activityLogs(offset: $offset, limit: $limit) {
|
||||
id
|
||||
userId
|
||||
|
||||
date
|
||||
hourStart
|
||||
hourEnd
|
||||
totalhours
|
||||
iconType
|
||||
iconColor
|
||||
|
||||
title
|
||||
description
|
||||
isRead
|
||||
activityType
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# GET BY ID
|
||||
# ----------------------------------------------------------
|
||||
query getActivityLogById($id: UUID!) @auth(level: USER) {
|
||||
activityLog(id: $id) {
|
||||
id
|
||||
userId
|
||||
|
||||
date
|
||||
hourStart
|
||||
hourEnd
|
||||
totalhours
|
||||
iconType
|
||||
iconColor
|
||||
|
||||
title
|
||||
description
|
||||
isRead
|
||||
activityType
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST BY USER
|
||||
# ----------------------------------------------------------
|
||||
query listActivityLogsByUserId(
|
||||
$userId: String!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
activityLogs(
|
||||
where: { userId: { eq: $userId } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { date: DESC }
|
||||
) {
|
||||
id
|
||||
userId
|
||||
|
||||
date
|
||||
hourStart
|
||||
hourEnd
|
||||
totalhours
|
||||
iconType
|
||||
iconColor
|
||||
|
||||
title
|
||||
description
|
||||
isRead
|
||||
activityType
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST UNREAD BY USER (common for notifications UI)
|
||||
# ----------------------------------------------------------
|
||||
query listUnreadActivityLogsByUserId(
|
||||
$userId: String!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
activityLogs(
|
||||
where: {
|
||||
userId: { eq: $userId }
|
||||
isRead: { eq: false }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { date: DESC }
|
||||
) {
|
||||
id
|
||||
userId
|
||||
|
||||
date
|
||||
hourStart
|
||||
hourEnd
|
||||
totalhours
|
||||
iconType
|
||||
iconColor
|
||||
|
||||
title
|
||||
description
|
||||
isRead
|
||||
activityType
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# FILTER (user + date range + read status + type)
|
||||
# NOTE: Timestamp filter uses ge/le (NOT gte/lte)
|
||||
# ----------------------------------------------------------
|
||||
query filterActivityLogs(
|
||||
$userId: String
|
||||
$dateFrom: Timestamp
|
||||
$dateTo: Timestamp
|
||||
$isRead: Boolean
|
||||
$activityType: ActivityType
|
||||
$iconType: ActivityIconType
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
activityLogs(
|
||||
where: {
|
||||
userId: { eq: $userId }
|
||||
date: { ge: $dateFrom, le: $dateTo }
|
||||
isRead: { eq: $isRead }
|
||||
activityType: { eq: $activityType }
|
||||
iconType: { eq: $iconType }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { date: DESC }
|
||||
) {
|
||||
id
|
||||
userId
|
||||
|
||||
date
|
||||
hourStart
|
||||
hourEnd
|
||||
totalhours
|
||||
iconType
|
||||
iconColor
|
||||
|
||||
title
|
||||
description
|
||||
isRead
|
||||
activityType
|
||||
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user