chore(legacy): relocate v1 dataconnect source

This commit is contained in:
zouantchaw
2026-03-18 15:04:18 +01:00
parent c9e917bed5
commit 1d850811c4
164 changed files with 55 additions and 26 deletions

View File

@@ -0,0 +1,185 @@
# ----------------------------------------------------------
# LIST ALL (admin/debug)
# ----------------------------------------------------------
query listClientFeedbacks(
$offset: Int
$limit: Int
) @auth(level: USER) {
clientFeedbacks(offset: $offset, limit: $limit) {
id
businessId
vendorId
rating
comment
date
createdAt
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# GET BY ID
# ----------------------------------------------------------
query getClientFeedbackById($id: UUID!) @auth(level: USER) {
clientFeedback(id: $id) {
id
businessId
vendorId
rating
comment
date
createdAt
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# LIST BY BUSINESS
# ----------------------------------------------------------
query listClientFeedbacksByBusinessId(
$businessId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
clientFeedbacks(
where: { businessId: { eq: $businessId } }
offset: $offset
limit: $limit
orderBy: { date: DESC }
) {
id
businessId
vendorId
rating
comment
date
createdAt
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# LIST BY VENDOR
# ----------------------------------------------------------
query listClientFeedbacksByVendorId(
$vendorId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
clientFeedbacks(
where: { vendorId: { eq: $vendorId } }
offset: $offset
limit: $limit
orderBy: { date: DESC }
) {
id
businessId
vendorId
rating
comment
date
createdAt
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# LIST BY BUSINESS + VENDOR (pair)
# ----------------------------------------------------------
query listClientFeedbacksByBusinessAndVendor(
$businessId: UUID!
$vendorId: UUID!
$offset: Int
$limit: Int
) @auth(level: USER) {
clientFeedbacks(
where: {
businessId: { eq: $businessId }
vendorId: { eq: $vendorId }
}
offset: $offset
limit: $limit
orderBy: { date: DESC }
) {
id
businessId
vendorId
rating
comment
date
createdAt
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# FILTER (rating + date range)
# NOTE: using Timestamp ops: ge/le
# ----------------------------------------------------------
query filterClientFeedbacks(
$businessId: UUID
$vendorId: UUID
$ratingMin: Int
$ratingMax: Int
$dateFrom: Timestamp
$dateTo: Timestamp
$offset: Int
$limit: Int
) @auth(level: USER) {
clientFeedbacks(
where: {
businessId: { eq: $businessId }
vendorId: { eq: $vendorId }
rating: { ge: $ratingMin, le: $ratingMax }
date: { ge: $dateFrom, le: $dateTo }
}
offset: $offset
limit: $limit
orderBy: { date: DESC }
) {
id
businessId
vendorId
rating
comment
date
business { id businessName }
vendor { id companyName }
}
}
# ----------------------------------------------------------
# QUICK KPI: average rating for a vendor (client-side aggregate)
# You fetch rows; Flutter/web computes avg.
# ----------------------------------------------------------
query listClientFeedbackRatingsByVendorId(
$vendorId: UUID!
$dateFrom: Timestamp
$dateTo: Timestamp
) @auth(level: USER) {
clientFeedbacks(
where: {
vendorId: { eq: $vendorId }
date: { ge: $dateFrom, le: $dateTo }
}
orderBy: { date: DESC }
) {
id
rating
comment
date
business { id businessName }
vendor { id companyName }
}
}