server / graphql /schema.js
Mark-Lasfar
Add GraphQL
5697548
Raw
History Blame Contribute Delete
73 kB
// graphql/schema.js
const { gql } = require('graphql-tag');
const typeDefs = gql`
# ============================================
# 🔹 Scalars مخصصة
# ============================================
scalar Date
scalar JSON
scalar Upload
scalar FileUpload
# ============================================
# 🔹 INPUT TYPES
# ============================================
input UserProfileInput {
nickname: String
avatar: String
coverImage: String
jobTitle: String
bio: String
phone: String
location: String
industry: String
gender: String
showGender: Boolean
isPublic: Boolean
avatarDisplayType: String
svgColor: String
status: String
portfolioName: String
pdfFormat: String
resumeUrl: String
showEmail: Boolean
socialLinks: SocialLinksInput
education: [EducationInput]
experience: [ExperienceInput]
certificates: [CertificateInput]
skills: [SkillInput]
projects: [ProjectInput]
interests: [String]
customSections: [CustomSectionInput]
sectionNames: SectionNamesInput
sectionVisibility: SectionVisibilityInput
sectionOrder: [SectionOrderItemInput!]
sectionStyleSettings: SectionStyleSettingsInput
designSettings: DesignSettingsInput
aiBot: AIBotInput
theme: ThemeInput
layout: LayoutInput
header: HeaderInput
footer: FooterInput
seo: SEOInput
schema: SchemaInput
audio: AudioInput
}
input SocialLinksInput {
linkedin: String
github: String
behance: String
whatsapp: String
instagram: String
facebook: String
twitter: String
tiktok: String
youtube: String
telegram: String
}
input EducationInput {
institution: String!
degree: String!
year: String!
grade: String
}
input ExperienceInput {
company: String!
role: String!
duration: String!
}
input CertificateInput {
name: String!
issuer: String!
year: String!
}
input SkillInput {
name: String!
percentage: Int!
icon: String
}
input ProjectInput {
_id: ID
title: String!
description: String
image: String
rating: String
stars: Int
links: [ProjectLinkInput!]
isPublic: Boolean
githubData: JSON
importedFrom: String
githubId: String
createdAt: Date
}
input ProjectLinkInput {
option: String!
value: String!
isPrivate: Boolean
}
input CustomSectionInput {
_id: ID
name: String!
type: String!
content: JSON!
isVisible: Boolean
settings: JSON
}
input DesignSettingsInput {
primaryColor: String
secondaryColor: String
fontFamily: String
borderRadius: Int
zoomLevel: Int
shadowType: String
animationType: String
glassEffect: Boolean
backgroundType: String
backgroundValue: String
customCss: String
}
input AIBotInput {
enabled: Boolean
provider: String
customApiKey: String
customModel: String
temperature: Float
maxTokens: Int
systemPrompt: String
}
input AudioInput {
url: String
title: String
delay: Float
loop: Boolean
volume: Int
}
# ============================================
# 🔹 USER TYPES
# ============================================
type User {
_id: ID!
username: String!
email: String!
isAdmin: Boolean!
emailVerified: Boolean!
profile: Profile!
interactionsSettings: InteractionsSettings
createdAt: Date!
updatedAt: Date!
# حسابية
followersCount: Int
followingCount: Int
postsCount: Int
projectsCount: Int
jobsCount: Int
totalLikes: Int
store: Store
subscription: UserSubscription
permissions: UserPermissions
hasStory: Boolean
}
type UserPermissions {
canCreateStore: Boolean!
canCreateProducts: Boolean!
}
type Profile {
nickname: String
avatar: String
coverImage: String
jobTitle: String
bio: String
phone: String
location: String
industry: String
gender: String
showGender: Boolean
isPublic: Boolean
avatarDisplayType: String
svgColor: String
status: String
portfolioName: String
pdfFormat: String
resumeUrl: String
showEmail: Boolean
socialLinks: SocialLinks!
education: [Education!]!
experience: [Experience!]!
certificates: [Certificate!]!
skills: [Skill!]!
projects: [Project!]!
interests: [String!]!
customSections: [CustomSection!]!
sectionNames: SectionNames
sectionVisibility: SectionVisibility
sectionOrder: [SectionOrderItem!]!
sectionStyleSettings: SectionStyleSettings
designSettings: DesignSettings
aiBot: AIBot
theme: Theme
layout: Layout
header: Header
footer: Footer
seo: SEO
schema: SchemaType
audio: Audio
storeEnabled: Boolean
averageRating: Float
totalRatings: Int
hasStory: Boolean
}
# ============================================
# 🔹 PROFILE PAGE QUERY (جديد)
# ============================================
type ProfilePageResult {
profile: User!
stats: UserStats!
ratings: RatingsResult!
interactions: [UserInteraction!]!
jobApplications: JobApplicationsResult!
contributionGraph: ContributionGraphResult!
notifications: NotificationsResult!
analytics: ProfileAnalytics
aiStatus: AIStatus!
followStatus: FollowStatus
alsoViewed: [User!]!
pageSuggestions: [PageSuggestion!]!
unreadCount: Int!
storeSettings: StoreSettingsResult
subscriptionStatus: SubscriptionStatus!
}
type UserInteraction {
_id: ID!
commentId: ID
projectId: ID
projectTitle: String
projectNickname: String
projectImage: String
rating: Int!
text: String!
timestamp: Date!
replies: [UserInteraction!]!
likes: [String!]!
isEdited: Boolean!
parentCommentId: ID
visibility: String!
}
type ContributionGraphResult {
total: Int!
weeks: [[ContributionDay!]!]!
year: Int!
months: [String!]!
weekDays: [String!]!
}
type ContributionDay {
date: String!
count: Int!
level: Int!
activities: [ContributionActivity!]!
}
type ContributionActivity {
type: String!
id: ID!
projectId: ID
postId: ID
jobId: ID
}
type PageSuggestion {
_id: ID!
name: String!
logo: String
followersCount: Int!
isFollowing: Boolean!
url: String!
}
type ProfileAnalytics {
views: Int!
uniqueViews: Int!
weeklyViews: Int!
impressions: Int!
searches: Int!
lastUpdated: Date!
}
type SubscriptionStatus {
hasActiveSubscription: Boolean!
canCreateStore: Boolean!
message: String
planName: String
daysLeft: Int
}
# ============================================
# 🔹 PROFILE SUB-TYPES (جديدة)
# ============================================
type SectionNames {
about: String
experience: String
education: String
certificates: String
skills: String
projects: String
interests: String
contactInfo: String
activity: String
contributionGraph: String
alsoViewed: String
suggestions: String
pages: String
analytics: String
jobApplications: String
}
type SectionVisibility {
about: Boolean!
experience: Boolean!
education: Boolean!
certificates: Boolean!
skills: Boolean!
projects: Boolean!
interests: Boolean!
contactInfo: Boolean!
socialLinks: Boolean!
stats: Boolean!
activity: Boolean!
contributionGraph: Boolean!
alsoViewed: Boolean!
suggestions: Boolean!
pages: Boolean!
jobApplications: Boolean!
analytics: Boolean!
}
type SectionOrderItem {
id: String!
column: String
}
type SectionStyleSettings {
padding: String
margin: String
background: String
textColor: String
borderRadius: String
shadow: String
}
type Theme {
id: String!
primaryColor: String!
secondaryColor: String!
fontFamily: String!
borderRadius: String!
}
type Layout {
type: String!
columns: Int!
showProjectImages: Boolean!
showProjectDescriptions: Boolean!
showProjectRatings: Boolean!
showProjectLinks: Boolean!
}
type Header {
showAvatar: Boolean!
showJobTitle: Boolean!
showBio: Boolean!
showContactInfo: Boolean!
showSocialLinks: Boolean!
layout: String!
}
type Footer {
showCopyright: Boolean!
customText: String!
}
type SEO {
title: String
description: String
keywords: String
ogImage: String
ogTitle: String
ogDescription: String
twitterCard: String
twitterSite: String
canonicalUrl: String
noindex: Boolean
nofollow: Boolean
}
type SchemaType {
type: String
name: String
description: String
image: String
sameAs: [String!]!
jobTitle: String
worksFor: String
alumniOf: [String!]!
knowsAbout: [String!]!
}
type SocialLinks {
linkedin: String
github: String
behance: String
whatsapp: String
instagram: String
facebook: String
twitter: String
tiktok: String
youtube: String
telegram: String
}
type Education {
_id: ID
institution: String
degree: String
year: String
grade: String
}
type Experience {
_id: ID
company: String!
role: String!
duration: String!
}
type Certificate {
_id: ID
name: String!
issuer: String!
year: String!
}
type Skill {
_id: ID!
name: String!
percentage: Int!
icon: String
}
type Project {
_id: ID!
title: String!
description: String
image: String
rating: String
stars: Int
links: [ProjectLink!]!
isPublic: Boolean
userId: User!
githubData: JSON
importedFrom: String
githubId: String
createdAt: Date!
updatedAt: Date!
}
type ProjectLink {
option: String!
value: String!
isPrivate: Boolean
}
type CustomSection {
_id: ID!
name: String!
type: String!
content: JSON!
isVisible: Boolean!
settings: JSON
createdAt: Date!
updatedAt: Date!
}
# ============================================
# 🔹 STORY TYPES
# ============================================
type StoryViewer {
userId: User!
viewedAt: Date!
}
type StoryViewersResult {
data: [StoryViewer!]!
total: Int!
pagination: Pagination!
}
type DesignSettings {
primaryColor: String
secondaryColor: String
fontFamily: String
borderRadius: Int
zoomLevel: Int
shadowType: String
animationType: String
glassEffect: Boolean
backgroundType: String
backgroundValue: String
customCss: String
}
type AIBot {
enabled: Boolean!
provider: String!
customModel: String
temperature: Float
maxTokens: Int
totalQueries: Int
lastQueryAt: Date
}
type Audio {
url: String
title: String
delay: Float
loop: Boolean
volume: Int
}
type InteractionsSettings {
showToPublic: Boolean!
showToLoggedIn: Boolean!
showOnlyToOwner: Boolean!
showToSpecificUsers: [String!]!
hideProjects: [String!]!
hideComments: [String!]!
}
type UserStats {
posts: Int!
projects: Int!
jobs: Int!
followers: Int!
following: Int!
applications: Int!
savedPosts: Int!
savedJobs: Int!
totalLikes: Int!
}
# ============================================
# 🔹 POST TYPES
# ============================================
type Post {
_id: ID!
userId: User!
content: String!
images: [PostImage!]!
video: PostVideo
likes: [Like!]!
comments: [Comment!]!
shares: [Share!]!
saves: [Save!]!
visibility: String!
tags: [String!]!
mentions: [Mention!]!
sharedFrom: SharedFrom
pinned: Boolean!
pinnedAt: Date
isEdited: Boolean!
editedAt: Date
createdAt: Date!
updatedAt: Date!
# حسابية
likesCount: Int!
commentsCount: Int!
sharesCount: Int!
savesCount: Int!
isLiked: Boolean
isSaved: Boolean
}
type PostImage {
url: String!
publicId: String
width: Int
height: Int
}
type PostVideo {
url: String!
publicId: String
duration: Int
}
type Like {
userId: User!
likedAt: Date!
}
type Comment {
_id: ID!
userId: User!
text: String!
createdAt: Date!
likes: [User!]!
edited: Boolean!
editedAt: Date
reports: [Report!]!
reportCount: Int!
hidden: Boolean!
projectId: Project!
projectOwnerId: User!
rating: Int!
timestamp: Date!
parentCommentId: Comment
replies: [Comment!]!
isEdited: Boolean!
visibility: String!
notified: Boolean!
updatedAt: Date!
# حسابية
repliesCount: Int!
likesCount: Int!
isLiked: Boolean
}
type CommentReport {
userId: User!
reporterUsername: String
reason: String!
reportedAt: Date!
resolved: Boolean!
resolvedAt: Date
resolvedBy: User
adminNote: String
}
# ============================================
# 🔹 POST COMMENT TYPES (لتعليقات المنشورات)
# ============================================
type PostComment {
_id: ID!
userId: User!
text: String!
createdAt: Date!
likes: [User!]!
edited: Boolean!
editedAt: Date
reports: [PostCommentReport!]!
reportCount: Int!
hidden: Boolean!
# حسابية
likesCount: Int!
isLiked: Boolean
}
type PostCommentReport {
userId: User!
reason: String!
reportedAt: Date!
}
type Share {
userId: User!
sharedAt: Date!
}
type Save {
userId: User!
savedAt: Date!
}
type Mention {
userId: User!
username: String
position: Int
}
type SharedFrom {
originalPostId: ID
originalAuthorId: ID
originalAuthorName: String
originalAuthorAvatar: String
originalAuthorJobTitle: String
originalContent: String
originalImages: [PostImage!]
originalVideo: PostVideo
originalCreatedAt: Date
originalLikesCount: Int
originalCommentsCount: Int
originalSharesCount: Int
sharedAt: Date
}
# ============================================
# 🔹 STORY TYPES
# ============================================
type Story {
_id: ID!
userId: User!
media: StoryMedia
text: String!
backgroundColor: String!
textColor: String!
textStyle: TextStyle!
views: [StoryView!]!
reactions: [StoryReaction!]!
visibility: String!
createdAt: Date!
expiresAt: Date!
# حسابية
viewsCount: Int!
reactionsCount: Int!
hasViewed: Boolean
}
type TextStyle {
fontSize: Int!
fontFamily: String!
fontWeight: String!
textAlign: String!
position: TextPosition!
rotation: Int!
opacity: Float!
textShadow: String!
background: String!
padding: String!
borderRadius: String!
maxWidth: Int!
}
type TextPosition {
x: Int!
y: Int!
}
type StoryMedia {
url: String
publicId: String
type: String
}
type StoryView {
userId: User!
viewedAt: Date!
}
type StoryReaction {
userId: User!
type: String!
createdAt: Date!
}
type StoryGroup {
user: User!
stories: [Story!]!
isFollowing: Boolean
isCurrentUser: Boolean
}
type StoryStats {
totalStories: Int!
myStories: Int!
followingStories: Int!
discoverStories: Int!
followingCount: Int!
}
# ============================================
# 🔹 JOB TYPES
# ============================================
type Job {
_id: ID!
employerId: User!
title: String!
description: String!
requirements: String!
responsibilities: String
category: String!
jobType: String!
experienceLevel: String!
location: String!
isRemote: Boolean!
salaryMin: Float
salaryMax: Float
salaryCurrency: String!
isSalaryNegotiable: Boolean!
requiredSkills: [String!]!
educationLevel: String!
vacancies: Int!
postedAt: Date!
deadline: Date!
status: String!
views: Int!
applicationsCount: Int!
isFeatured: Boolean!
featuredUntil: Date
companyName: String
companyLogo: String
companyWebsite: String
createdAt: Date!
updatedAt: Date!
# حسابية
hasApplied: Boolean
applicationStatus: String
isSaved: Boolean
}
type JobApplication {
_id: ID!
jobId: Job!
applicantId: User!
fullName: String!
email: String!
phone: String
resume: FileUpload
coverLetter: String
portfolio: String
linkedin: String
github: String
answers: [JobAnswer!]!
status: String!
employerNotes: String
rating: Int
interviews: [Interview!]!
appliedAt: Date!
updatedAt: Date!
}
type JobAnswer {
question: String!
answer: String!
}
type Interview {
scheduledAt: Date!
type: String!
meetingLink: String
notes: String
status: String!
}
type JobCategory {
_id: ID!
name: String!
nameAr: String
displayName: String
icon: String
color: String
order: Int!
isActive: Boolean!
count: Int
}
type JobStats {
totalJobs: Int!
totalCompanies: Int!
remoteJobs: Int!
topCategories: [JobCategoryCount!]!
}
type JobCategoryCount {
category: String!
count: Int!
}
# ============================================
# 🔹 STORE TYPES
# ============================================
type Store {
_id: ID!
userId: User!
storeName: String
storeLogo: String
storeBanner: String
storeDescription: String
contactEmail: String
enabled: Boolean!
currency: String!
currencySymbol: String!
productsCount: Int!
followersCount: Int!
averageRating: Float!
totalSales: Float!
totalOrders: Int!
createdAt: Date!
updatedAt: Date!
}
type StoreProduct {
_id: ID!
userId: User!
type: String!
title: String!
description: String!
price: Float!
currency: String!
fileUrl: String
fileSize: Int
deliveryTime: String
images: [String!]!
tags: [String!]!
isActive: Boolean!
salesCount: Int!
averageRating: Float!
reviews: [ProductReview!]!
createdAt: Date!
updatedAt: Date!
}
type ProductReview {
_id: ID!
userId: User!
rating: Int!
comment: String
createdAt: Date!
}
type Order {
_id: ID!
orderNumber: String!
buyerId: User!
sellerId: User!
items: [OrderItem!]!
subtotal: Float!
totalAmount: Float!
currency: String!
status: String!
paymentMethod: String
paymentDetails: JSON
buyerNotes: String
sellerNotes: String
deliveredAt: Date
cancelledAt: Date
cancellationReason: String
downloadableFiles: [DownloadableFile!]!
createdAt: Date!
updatedAt: Date!
}
type OrderItem {
productId: ID!
productType: String!
title: String!
quantity: Int!
price: Float!
fileUrl: String
downloadCount: Int
fileName: String
fileSize: Int
fileType: String
uploadedAt: Date
}
type DownloadableFile {
fileName: String!
fileUrl: String!
expiresAt: Date
downloadCount: Int!
}
type Cart {
userId: User!
stores: [CartStore!]!
totalItems: Int!
totalStores: Int!
updatedAt: Date!
}
type CartStore {
storeId: ID!
storeName: String!
storeLogo: String
items: [CartItem!]!
subtotal: Float!
itemCount: Int!
updatedAt: Date!
}
type CartItem {
productId: ID!
title: String!
price: Float!
quantity: Int!
image: String
productType: String!
}
type Coupon {
_id: ID!
code: String!
discountType: String!
discountValue: Float!
minPurchase: Float!
maxDiscount: Float
validFrom: Date!
validUntil: Date
usageLimit: Int
usageCount: Int!
isActive: Boolean!
applicableProducts: [ID!]!
createdAt: Date!
}
type CouponValidation {
valid: Boolean!
discount: Float!
finalTotal: Float!
message: String
coupon: Coupon
}
# ============================================
# 🔹 PAGE TYPES
# ============================================
type Page {
_id: ID!
storeId: User!
slug: String!
title: String!
content: String!
rawContent: String
css: String!
js: String!
type: String!
isDefault: Boolean!
isEnabled: Boolean!
order: Int!
uploadedFile: UploadedFile
thumbnail: String
hasShortcodes: Boolean!
shortcodesList: [ShortcodeUsage!]!
seo: PageSEO
structuredData: JSON
tags: [String!]!
visibility: String!
permissions: PagePermissions
settings: PageSettings
scheduledAt: Date
expiresAt: Date
schemaVersion: String
versions: [PageVersion!]!
lockedBy: User
lockedAt: Date
createdBy: User
updatedBy: User
stats: PageStats!
referrers: [PageReferrer!]!
uniqueVisitors: [UniqueVisitor!]!
createdAt: Date!
updatedAt: Date!
# حسابية
url: String!
isLocked: Boolean!
}
type UploadedFile {
filename: String!
originalName: String!
fileUrl: String
fileSize: Int
mimeType: String
uploadedAt: Date!
}
type ShortcodeUsage {
name: String!
count: Int!
}
type PageSEO {
title: String
description: String
keywords: String
ogImage: String
noindex: Boolean
nofollow: Boolean
}
type PagePermissions {
canEdit: [User!]!
canView: [User!]!
}
type PageSettings {
showInNav: Boolean!
showInFooter: Boolean!
openInNewTab: Boolean!
requireAuth: Boolean!
passwordProtected: Boolean!
}
type PageVersion {
version: Int!
content: String!
css: String!
js: String!
createdAt: Date!
}
type PageStats {
views: Int!
uniqueViews: Int!
lastViewedAt: Date
avgTimeOnPage: Float!
bounceRate: Float!
shares: Int!
}
type PageReferrer {
source: String!
count: Int!
lastVisit: Date
}
type UniqueVisitor {
ip: String!
timestamp: Date!
}
# ============================================
# 🔹 VIDEO TYPES
# ============================================
type VideoPost {
_id: ID!
userId: User!
content: String!
video: PostVideo!
images: [PostImage!]!
likes: [Like!]!
comments: [Comment!]!
shares: [Share!]!
saves: [Save!]!
visibility: String!
tags: [String!]!
createdAt: Date!
updatedAt: Date!
# حسابية
likesCount: Int!
commentsCount: Int!
sharesCount: Int!
savesCount: Int!
viewsCount: Int!
isLiked: Boolean
isSaved: Boolean
isFollowing: Boolean
}
type VideosResult {
data: [VideoPost!]!
pagination: Pagination!
trending: [VideoPost!]!
}
# ============================================
# 🔹 THEME TYPES
# ============================================
type StoreTheme {
_id: ID!
userId: User!
name: String!
isActive: Boolean!
version: String!
layout: String!
customTemplates: CustomTemplates!
uploadedTheme: UploadedTheme
settings: ThemeSettings!
colors: ThemeColors!
typography: ThemeTypography!
customAssets: CustomAssets!
seo: ThemeSEO!
stats: ThemeStats!
isDeleted: Boolean!
deletedAt: Date
createdAt: Date!
updatedAt: Date!
# حسابية
isCustomTheme: Boolean!
themeUrl: String!
}
type CustomTemplates {
header: String
footer: String
sidebar: String
productCard: String
categoryCard: String
}
type UploadedTheme {
filename: String
originalName: String
fileUrl: String
fileSize: Int
fileHash: String
mimeType: String
uploadedAt: Date
extractedFiles: ExtractedFiles
}
type ExtractedFiles {
htmlFiles: [ExtractedFile!]!
cssFiles: [ExtractedFile!]!
jsFiles: [ExtractedFile!]!
imageFiles: [ExtractedImage!]!
}
type ExtractedFile {
name: String!
size: Int!
}
type ExtractedImage {
name: String!
size: Int!
url: String
}
type ThemeSettings {
containerWidth: String!
containerPadding: String!
showBreadcrumb: Boolean!
stickyHeader: Boolean!
backToTop: Boolean!
showSearchBar: Boolean!
showCategories: Boolean!
productsPerRow: Int!
productsPerPage: Int!
enableLazyLoad: Boolean!
enableAnimations: Boolean!
}
type ThemeColors {
primary: String!
secondary: String!
accent: String!
background: String!
text: String!
textLight: String!
border: String!
success: String!
error: String!
warning: String!
}
type ThemeTypography {
fontFamily: String!
headingFont: String!
baseFontSize: String!
enableGoogleFonts: Boolean!
}
type CustomAssets {
css: String
js: String
headHtml: String
bodyHtml: String
}
type ThemeSEO {
metaTitle: String
metaDescription: String
metaKeywords: String
ogImage: String
twitterCard: String
canonicalUrl: String
structuredData: JSON
}
type ThemeStats {
views: Int!
lastUsed: Date
templateChanges: Int!
lastChangeAt: Date
}
type StoreStatus {
enabled: Boolean!
}
# ============================================
# 🔹 SUBSCRIPTION TYPES
# ============================================
type SubscriptionPlan {
_id: ID!
name: String!
nameAr: String
description: String
descriptionAr: String
price: Float!
currency: String!
currencySymbol: String!
duration: String!
durationDays: Int!
features: PlanFeatures!
hasFreeTrial: Boolean!
freeTrialDays: Int!
badge: String
badgeColor: String
icon: String!
isActive: Boolean!
order: Int!
customPermissions: JSON
createdAt: Date!
updatedAt: Date!
}
type PlanFeatures {
storeEnabled: Boolean!
maxProducts: Int!
maxDigitalProducts: Int!
maxProjects: Int!
maxServices: Int!
pageBuilderEnabled: Boolean!
customDomain: Boolean!
analyticsEnabled: Boolean!
prioritySupport: Boolean!
removeBranding: Boolean!
teamMembers: Int!
apiAccess: Boolean!
customCss: Boolean!
advancedAnalytics: Boolean!
exportData: Boolean!
}
type UserSuggestion {
_id: ID!
username: String!
followersCount: Int!
profile: SuggestionProfile!
}
type SuggestionProfile {
nickname: String
avatar: String
jobTitle: String
bio: String
}
type UserSubscription {
_id: ID!
userId: User!
planId: SubscriptionPlan!
status: String!
startDate: Date
endDate: Date
isTrial: Boolean!
trialEndDate: Date
paymentMethod: String
paymentDetails: JSON
paymentProof: String
amount: Float
currency: String
transactionId: String
adminNotes: String
approvedBy: User
approvedAt: Date
autoRenew: Boolean!
cancelledAt: Date
cancellationReason: String
createdAt: Date!
updatedAt: Date!
}
type SubscriptionStats {
total: Int!
active: Int!
pending: Int!
expired: Int!
cancelled: Int!
totalRevenue: Float!
monthlyEarnings: [MonthlyEarnings!]!
}
type MonthlyEarnings {
month: String!
total: Float!
count: Int!
}
# ============================================
# 🔹 NOTIFICATION TYPES
# ============================================
type Notification {
_id: ID!
userId: User!
type: String!
actorId: User
actorName: String
actorAvatar: String
targetId: String
targetType: String
content: String!
read: Boolean!
link: String
createdAt: Date!
}
# ============================================
# 🔹 FOLLOW TYPES
# ============================================
type Follow {
_id: ID!
followerId: User!
followingId: User!
status: String!
createdAt: Date!
}
type FollowRequest {
_id: ID!
requester: User!
requestedAt: Date!
}
# ============================================
# 🔹 REPORT TYPES
# ============================================
type Report {
_id: ID!
reporterId: User!
targetType: String!
targetId: ID!
reason: String!
details: String
status: String!
adminNotes: String
resolvedBy: User
resolvedAt: Date
createdAt: Date!
updatedAt: Date!
}
# ============================================
# 🔹 AI TYPES
# ============================================
type AIConversation {
_id: ID!
userId: User!
visitorIp: String
question: String!
answer: String!
provider: String!
language: String!
responseTime: Int!
timestamp: Date!
}
type AIStats {
total: Int!
last7Days: [DailyAIStats!]!
providerStats: [ProviderAIStats!]!
avgResponseTime: Int!
enabled: Boolean!
provider: String!
totalQueries: Int!
lastQueryAt: Date
}
type DailyAIStats {
date: String!
count: Int!
}
type ProviderAIStats {
provider: String!
count: Int!
}
# ============================================
# 🔹 MUTATION INPUT TYPES
# ============================================
input CreatePostInput {
content: String!
visibility: String
tags: [String!]
mentions: [MentionInput!]
}
input MentionInput {
userId: ID!
username: String
position: Int
}
input CreateStoryInput {
text: String
backgroundColor: String
textColor: String
textStyle: TextStyleInput
visibility: String
}
input TextStyleInput {
fontSize: Int
fontFamily: String
fontWeight: String
textAlign: String
position: TextPositionInput
rotation: Int
opacity: Float
textShadow: String
background: String
padding: String
borderRadius: String
maxWidth: Int
}
input TextPositionInput {
x: Int!
y: Int!
}
input CreateJobInput {
title: String!
description: String!
requirements: String!
responsibilities: String
category: String!
jobType: String!
experienceLevel: String!
location: String!
isRemote: Boolean
salaryMin: Float
salaryMax: Float
salaryCurrency: String
isSalaryNegotiable: Boolean
requiredSkills: [String!]
educationLevel: String
vacancies: Int
deadline: Date!
companyName: String
companyWebsite: String
}
input ApplyJobInput {
fullName: String!
email: String!
phone: String
coverLetter: String
portfolio: String
linkedin: String
github: String
answers: [JobAnswerInput!]
}
input JobAnswerInput {
question: String!
answer: String!
}
input CreateProductInput {
type: String!
title: String!
description: String!
price: Float!
currency: String
deliveryTime: String
tags: [String!]
images: [String!]
isActive: Boolean
}
input UpdateProductInput {
title: String
description: String
price: Float
type: String
currency: String
deliveryTime: String
tags: [String!]
images: [String!]
isActive: Boolean
}
input CreateOrderInput {
storeId: ID!
items: [OrderItemInput!]!
buyerNotes: String
paymentMethod: String!
}
input OrderItemInput {
productId: ID!
quantity: Int!
}
input StoreSettingsInput {
storeName: String
storeLogo: String
storeBanner: String
storeDescription: String
contactEmail: String
currency: String
primaryColor: String
secondaryColor: String
fontFamily: String
borderRadius: Int
shadowType: String
animationType: String
glassEffect: Boolean
backgroundType: String
backgroundValue: String
customCss: String
productViewType: String
paymentMethods: [PaymentMethodInput!]
socialLinks: SocialLinksInput
pageBuilder: PageBuilderInput
}
input PaymentMethodInput {
type: String!
label: String
details: JSON!
isActive: Boolean
}
input PageBuilderInput {
sections: [PageSectionInput!]!
}
input PageSectionInput {
id: String
type: String!
enabled: Boolean
order: Int
title: String
limit: Int
layout: String
content: JSON
settings: JSON
}
input CreatePageInput {
slug: String!
title: String!
content: String
css: String
js: String
seo: PageSEOInput
visibility: String
settings: PageSettingsInput
order: Int
}
input PageSEOInput {
title: String
description: String
keywords: String
ogImage: String
noindex: Boolean
nofollow: Boolean
}
input PageSettingsInput {
showInNav: Boolean
showInFooter: Boolean
openInNewTab: Boolean
requireAuth: Boolean
}
input UpdatePageInput {
title: String
content: String
css: String
js: String
seo: PageSEOInput
isEnabled: Boolean
visibility: String
settings: PageSettingsInput
order: Int
slug: String
}
input CreateCouponInput {
code: String!
discountType: String!
discountValue: Float!
minPurchase: Float
maxDiscount: Float
validUntil: Date
usageLimit: Int
applicableProducts: [ID!]
}
input ContactMessageInput {
name: String!
email: String!
message: String!
}
# ============================================
# 🔹 QUERY ROOT
# ============================================
type Query {
# ===== Profile =====
me: User
user(id: ID!): User
userByNickname(nickname: String!): User
profile(nickname: String!): User
myProfile: User
userStats(userId: ID!): UserStats!
profilePage(nickname: String!): ProfilePageResult!
contributionGraph(userId: ID!, year: Int): ContributionGraphResult!
userInteractions(nickname: String!, page: Int, limit: Int): [UserInteraction!]!
alsoViewed(userId: ID!): [User!]!
pageSuggestions(limit: Int): [PageSuggestion!]!
profileAnalytics: ProfileAnalytics!
userSuggestions(limit: Int): [UserSuggestion!]!
storeStatus: StoreStatus!
# ===== Search =====
searchUsers(query: String!, page: Int, limit: Int): SearchUsersResult!
searchGlobal(query: String!, limit: Int): GlobalSearchResult!
# ===== Posts =====
postsFeed(page: Int, limit: Int, type: String): PostsResult!
post(id: ID!): Post
userPosts(userId: ID!, page: Int, limit: Int): PostsResult!
savedPosts(page: Int, limit: Int): PostsResult!
suggestedPosts(limit: Int): [Post!]!
searchPosts(query: String!, page: Int, limit: Int): PostsResult!
# ===== Comments =====
comments(projectId: ID!, page: Int, limit: Int): CommentsResult!
comment(id: ID!): Comment
userComments(userId: ID!, page: Int, limit: Int): CommentsResult!
reportedComments: [Comment!]! # للمشرف فقط
getPostComments(postId: ID!, page: Int, limit: Int): CommentsResult!
# ===== Stories =====
storiesFeed(limit: Int): [StoryGroup!]!
storiesAll(page: Int, limit: Int): StoriesResult!
storiesDiscover(limit: Int): [StoryGroup!]!
storyStats: StoryStats!
userStories(userId: ID!): [Story!]!
story(id: ID!): Story
# ===== Stories =====
storyViewers(storyId: ID!, page: Int, limit: Int): StoryViewersResult!
# ===== Jobs =====
jobs(page: Int, limit: Int, search: String, category: String, jobType: String, location: String): JobsResult!
job(id: ID!): Job
myJobs(page: Int, limit: Int, status: String): JobsResult!
myJobApplications(page: Int, limit: Int, status: String): JobApplicationsResult!
jobApplications(jobId: ID!, page: Int, limit: Int, status: String): JobApplicationsResult!
jobApplication(id: ID!): JobApplication
savedJobs(page: Int, limit: Int): JobsResult!
jobCategories(lang: String): [JobCategory!]!
jobStats: JobStats!
# ===== Store =====
myStore: Store!
store(username: String!): Store!
storeProducts(username: String!, tags: [String!], limit: Int): [StoreProduct!]!
storeProduct(id: ID!): StoreProduct
myProducts: [StoreProduct!]!
storePages(username: String!): [Page!]!
storePage(username: String!, slug: String!): Page
myPages: [Page!]!
page(id: ID!): Page
storeSettings: StoreSettingsResult!
storeAnalytics(username: String!): StoreAnalytics!
# ===== Videos =====
videosFeed(page: Int, limit: Int, type: String): VideosResult!
video(id: ID!): VideoPost!
# ===== Cart =====
cart: Cart!
cartSummary: CartSummary!
# ===== Orders =====
myOrders(as: String!, page: Int, limit: Int): OrdersResult!
order(id: ID!): Order
# ===== Follow =====
followers(userId: ID!, page: Int, limit: Int): FollowersResult!
following(userId: ID!, page: Int, limit: Int): FollowingResult!
myFollowers(page: Int, limit: Int): FollowersResult!
myFollowing(page: Int, limit: Int): FollowingResult!
followRequests: [FollowRequest!]!
followStatus(userId: ID!): FollowStatus!
# ===== Notifications =====
notifications(page: Int, limit: Int): NotificationsResult!
unreadNotificationsCount: Int!
# ===== Ratings =====
userRatings(userId: ID!, page: Int, limit: Int): RatingsResult!
myRating(targetUserId: ID!): Rating
# ===== AI =====
aiConversations(page: Int, limit: Int): AIConversationsResult!
aiStats: AIStats!
aiStatus(nickname: String!): AIStatus!
# ===== Admin =====
adminUsers(page: Int, limit: Int, role: String): AdminUsersResult!
adminStores(page: Int, limit: Int): AdminStoresResult!
adminOrders(page: Int, limit: Int, status: String): AdminOrdersResult!
adminProducts(page: Int, limit: Int, type: String): AdminProductsResult!
adminReports(page: Int, limit: Int, status: String): AdminReportsResult!
adminMessageReports(page: Int, limit: Int, status: String): AdminMessageReportsResult!
adminSubscriptions(page: Int, limit: Int, status: String): AdminSubscriptionsResult!
adminSubscriptionStats: SubscriptionStats!
adminLogs(page: Int, limit: Int, type: String): AdminLogsResult!
adminPlans: [SubscriptionPlan!]!
adminPaymentMethods: [PlatformPaymentMethod!]!
# ===== Templates =====
templates(category: String, sort: String, limit: Int, offset: Int): TemplatesResult!
featuredTemplates(limit: Int): [Template!]!
popularTemplates(limit: Int): [Template!]!
template(id: ID!): Template!
templateCategories: [TemplateCategory!]!
myInstalledTemplates: [Template!]!
# ===== Site Settings =====
siteSettings: SiteSettings!
}
# ============================================
# 🔹 MUTATION ROOT
# ============================================
type Mutation {
# ===== Auth =====
register(username: String!, email: String!, password: String!): AuthResult!
login(email: String!, password: String!): AuthResult!
verifyEmail(email: String!, otp: String!): AuthResult!
resendVerification(email: String!): Boolean!
forgotPassword(email: String!): Boolean!
resetPassword(email: String!, otp: String!, newPassword: String!): Boolean!
refreshToken(refreshToken: String!): AuthResult!
logout(refreshToken: String!): Boolean!
magicLink(email: String!): Boolean!
verifyMagicLink(token: String!): AuthResult!
# ===== Profile =====
updateProfile(input: UserProfileInput!): User!
updateAppearance(theme: JSON, layout: JSON, header: JSON, footer: JSON): User!
updateSEO(seo: JSON, schema: JSON): User!
checkNickname(nickname: String!): CheckNicknameResult!
uploadAvatar(file: Upload!): String!
uploadCover(file: Upload!): String!
deleteCover: Boolean!
addEducation(input: EducationInput!): [Education!]!
updateEducation(id: ID!, input: EducationInput!): [Education!]!
deleteEducation(id: ID!): Boolean!
addExperience(input: ExperienceInput!): [Experience!]!
updateExperience(id: ID!, input: ExperienceInput!): [Experience!]!
deleteExperience(id: ID!): Boolean!
addCertificate(input: CertificateInput!): [Certificate!]!
updateCertificate(id: ID!, input: CertificateInput!): [Certificate!]!
deleteCertificate(id: ID!): Boolean!
addSkill(input: SkillInput!): [Skill!]!
updateSkill(id: ID!, input: SkillInput!): [Skill!]!
deleteSkill(id: ID!): Boolean!
addProject(input: ProjectInput!): Project!
updateProject(id: ID!, input: ProjectInput!): Project!
deleteProject(id: ID!): Boolean!
addCustomSection(input: CustomSectionInput!): CustomSection!
updateCustomSection(id: ID!, input: CustomSectionInput!): CustomSection!
deleteCustomSection(id: ID!): Boolean!
toggleCustomSectionVisibility(id: ID!, isVisible: Boolean!): CustomSection!
updateSectionNames(names: JSON!): User!
updateSectionVisibility(visibility: JSON!): User!
updateSectionOrder(order: [String!]!): User!
updateDesignSettings(input: DesignSettingsInput!): DesignSettings!
resetDesignSettings: DesignSettings!
updateAIBot(input: AIBotInput!): AIBot!
updatePrivacySettings(input: InteractionsSettingsInput!): InteractionsSettings!
deleteAccount: Boolean!
# ===== Comments =====
addComment(projectId: ID!, projectOwnerId: ID!, rating: Int!, text: String!): Comment!
addCommentReply(commentId: ID!, text: String!, rating: Int): Comment!
updateComment(id: ID!, text: String!): Comment!
deleteComment(id: ID!): Boolean!
likeComment(id: ID!): LikeResult!
reportComment(commentId: ID!, reason: String!): ReportResult!
resolveCommentReport(commentId: ID!, action: String!, adminNote: String): Comment!
updateCommentPrivacy(id: ID!, visibility: String!): Comment!
# ===== Posts =====
createPost(input: CreatePostInput!, files: [Upload!]): Post!
updatePost(id: ID!, input: CreatePostInput!): Post!
deletePost(id: ID!): Boolean!
likePost(id: ID!): LikeResult!
savePost(id: ID!): SaveResult!
pinPost(id: ID!): Post!
sharePost(id: ID!): ShareResult!
sharePostToProfile(originalPostId: ID!, content: String): Post!
addPostComment(postId: ID!, text: String!): Comment!
updatePostComment(postId: ID!, commentId: ID!, text: String!): Comment!
deletePostComment(postId: ID!, commentId: ID!): Boolean!
likePostComment(commentId: ID!): LikeResult!
reportPostComment(commentId: ID!, reason: String!): Boolean!
# ===== Stories =====
createStory(input: CreateStoryInput!, file: Upload): Story!
deleteStory(id: ID!): Boolean!
viewStory(id: ID!): Story!
reactToStory(id: ID!, type: String!): Story!
deleteExpiredStories: DeleteResult!
# ===== Jobs =====
createJob(input: CreateJobInput!): Job!
updateJob(id: ID!, input: CreateJobInput!): Job!
deleteJob(id: ID!): Boolean!
duplicateJob(id: ID!): Job!
applyToJob(jobId: ID!, input: ApplyJobInput!, resume: Upload): JobApplication!
withdrawApplication(applicationId: ID!): JobApplication!
updateApplicationStatus(applicationId: ID!, status: String!, employerNotes: String): JobApplication!
scheduleInterview(applicationId: ID!, scheduledAt: Date!, type: String!, meetingLink: String): JobApplication!
saveJob(id: ID!): SaveResult!
adminCreateJobCategory(name: String!, nameAr: String, icon: String, color: String, order: Int): JobCategory!
adminUpdateJobCategory(id: ID!, name: String, nameAr: String, icon: String, color: String, isActive: Boolean, order: Int): JobCategory!
adminDeleteJobCategory(id: ID!): Boolean!
# ===== Store =====
toggleStore(enabled: Boolean!): Boolean!
updateStoreSettings(input: StoreSettingsInput!): Store!
createProduct(input: CreateProductInput!, file: Upload): StoreProduct!
updateProduct(id: ID!, input: UpdateProductInput!): StoreProduct!
deleteProduct(id: ID!): Boolean!
toggleProduct(id: ID!, isActive: Boolean!): StoreProduct!
addProductReview(productId: ID!, rating: Int!, comment: String): ProductReview!
followStore(storeId: ID!): FollowStoreResult!
createCoupon(input: CreateCouponInput!): Coupon!
updateCoupon(id: ID!, input: CreateCouponInput!): Coupon!
deleteCoupon(id: ID!): Boolean!
validateCoupon(code: String!, cartTotal: Float!, storeId: ID!): CouponValidation!
contactStore(input: ContactMessageInput!, storeId: ID!): Boolean!
updatePagesOrder(pages: [PageOrderInput!]!): Boolean!
uploadPage(file: Upload!, slug: String, title: String): Page!
uploadPageZip(file: Upload!): [Page!]!
createPage(input: CreatePageInput!): Page!
updatePage(id: ID!, input: UpdatePageInput!): Page!
deletePage(id: ID!): Boolean!
duplicatePage(id: ID!): Page!
exportPage(id: ID!): String!
resetTemplate: Boolean!
applyTemplate(id: ID!): TemplateApplyResult!
uploadTheme(file: Upload!): StoreTheme!
updateTheme(input: ThemeInput!): StoreTheme!
resetTheme: StoreTheme!
updateLayoutTemplate(layout: String!, input: LayoutSettingsInput): Store!
resetLayoutTemplate: Store!
# ===== Cart =====
addToCart(productId: ID!, storeId: ID!, quantity: Int!): Cart!
updateCartItem(storeId: ID!, productId: ID!, quantity: Int!): Cart!
removeFromCart(storeId: ID!, productId: ID!): Cart!
clearStoreCart(storeId: ID!): Cart!
clearCart: Boolean!
# ===== Orders =====
createOrder(input: CreateOrderInput!): Order!
updateOrderStatus(id: ID!, status: String!, sellerNotes: String): Order!
cancelOrder(id: ID!, reason: String): Order!
uploadOrderFile(orderId: ID!, productId: ID!, file: Upload!): OrderItem!
addOrderFileUrl(orderId: ID!, productId: ID!, fileUrl: String!, fileName: String): OrderItem!
downloadOrderFile(orderId: ID!, productId: ID!): String!
# ===== Follow =====
followUser(userId: ID!): FollowResult!
unfollowUser(userId: ID!): FollowResult!
acceptFollowRequest(requestId: ID!): Boolean!
declineFollowRequest(requestId: ID!): Boolean!
# ===== Notifications =====
markNotificationRead(id: ID!): Notification!
markAllNotificationsRead: Boolean!
deleteNotification(id: ID!): Boolean!
# ===== Ratings =====
rateUser(targetUserId: ID!, rating: Int!, review: String): RatingResult!
# ===== AI =====
askAI(nickname: String!, question: String!, language: String): AIResponse!
clearAICache: Boolean!
# ===== Subscriptions =====
subscribe(planId: ID!, paymentMethodId: ID!, paymentDetails: JSON, autoRenew: Boolean, paymentProof: Upload): UserSubscription!
renewSubscription(planId: ID!, paymentMethodId: ID!, paymentDetails: JSON, paymentProof: Upload): UserSubscription!
cancelSubscription(reason: String): Boolean!
adminApproveSubscription(id: ID!, adminNotes: String): UserSubscription!
adminRejectSubscription(id: ID!, rejectionReason: String): Boolean!
adminCancelSubscription(id: ID!, reason: String): Boolean!
adminCreatePlan(input: CreatePlanInput!): SubscriptionPlan!
adminUpdatePlan(id: ID!, input: CreatePlanInput!): SubscriptionPlan!
adminDeletePlan(id: ID!): Boolean!
adminCreatePaymentMethod(input: CreatePaymentMethodInput!): PlatformPaymentMethod!
adminUpdatePaymentMethod(id: ID!, input: CreatePaymentMethodInput!): PlatformPaymentMethod!
adminDeletePaymentMethod(id: ID!): Boolean!
# ===== Admin =====
adminToggleStore(userId: ID!, enabled: Boolean!): Boolean!
adminDeleteStore(userId: ID!): Boolean!
adminToggleProduct(productId: ID!, isActive: Boolean!): StoreProduct!
adminDeleteProduct(productId: ID!): Boolean!
adminUpdateOrderStatus(orderId: ID!, status: String!, adminNotes: String): Order!
adminMakeUser(userId: ID!, isAdmin: Boolean!): User!
adminResolveReport(reportId: ID!, action: String!, adminNote: String): Report!
adminResolveMessageReport(reportId: ID!, action: String!, adminNote: String): Boolean!
adminCreatePlatformBank(input: PlatformBankInput!): PlatformBank!
adminUpdatePlatformBank(id: ID!, input: PlatformBankInput!): PlatformBank!
adminDeletePlatformBank(id: ID!): Boolean!
adminRegenerateSitemaps: Boolean!
adminExportUsers: String!
adminExportOrders: String!
adminCreateBackup: String!
# ===== Reports =====
reportContent(targetType: String!, targetId: ID!, reason: String!, details: String): Report!
reportMessage(messageId: ID!, reason: String!): Boolean!
}
# ============================================
# 🔹 RESULT TYPES
# ============================================
type AuthResult {
success: Boolean!
token: String
refreshToken: String
user: User
requiresVerification: Boolean
email: String
message: String
}
type CheckNicknameResult {
available: Boolean!
}
type LikeResult {
success: Boolean!
likesCount: Int!
isLiked: Boolean!
}
type SaveResult {
success: Boolean!
count: Int!
isSaved: Boolean!
}
type ShareResult {
success: Boolean!
sharesCount: Int!
}
type FollowResult {
success: Boolean!
isFollowing: Boolean!
}
type FollowStoreResult {
success: Boolean!
isFollowing: Boolean!
followersCount: Int!
}
type RatingResult {
success: Boolean!
averageRating: Float!
totalRatings: Int!
}
type DeleteResult {
deletedCount: Int!
}
type AIResponse {
answer: String!
language: String!
provider: String!
responseTime: Int!
isCommand: Boolean
}
type AIStatus {
enabled: Boolean!
}
type FollowStatus {
isFollowing: Boolean!
}
# ============================================
# 🔹 PAGINATION TYPES
# ============================================
type Pagination {
page: Int!
limit: Int!
total: Int!
pages: Int!
hasNext: Boolean!
hasPrev: Boolean!
}
type CommentsResult {
data: [Comment!]!
pagination: Pagination!
}
type ReportResult {
success: Boolean!
reportCount: Int!
hidden: Boolean!
message: String!
}
type PostsResult {
data: [Post!]!
pagination: Pagination!
}
type StoriesResult {
data: [StoryGroup!]!
pagination: Pagination!
stats: StoryStats!
}
type JobsResult {
data: [Job!]!
pagination: Pagination!
featured: [Job!]!
}
type JobApplicationsResult {
data: [JobApplication!]!
pagination: Pagination!
}
type OrdersResult {
data: [Order!]!
pagination: Pagination!
}
type FollowersResult {
data: [User!]!
pagination: Pagination!
}
type FollowingResult {
data: [User!]!
pagination: Pagination!
}
type NotificationsResult {
data: [Notification!]!
pagination: Pagination!
unreadCount: Int!
}
type RatingsResult {
data: [Rating!]!
pagination: Pagination!
averageRating: Float!
totalRatings: Int!
}
type AIConversationsResult {
data: [AIConversation!]!
pagination: Pagination!
}
type SearchUsersResult {
data: [User!]!
pagination: Pagination!
}
type GlobalSearchResult {
products: [SearchProduct!]!
stores: [SearchStore!]!
users: [SearchUser!]!
jobs: [SearchJob!]!
posts: [SearchPost!]!
total: GlobalSearchTotal!
}
type SearchProduct {
_id: ID!
title: String!
price: Float!
type: String!
image: String
storeNickname: String
url: String!
}
type SearchStore {
_id: ID!
storeName: String!
storeLogo: String
nickname: String!
productsCount: Int!
followersCount: Int!
averageRating: Float!
url: String!
}
type SearchUser {
_id: ID!
name: String!
avatar: String!
jobTitle: String!
bio: String
url: String!
}
type SearchJob {
_id: ID!
title: String!
company: String
location: String!
jobType: String!
isRemote: Boolean!
salary: String
url: String!
}
type SearchPost {
_id: ID!
content: String!
image: String
author: SearchAuthor!
likesCount: Int!
createdAt: Date!
url: String!
}
type SearchAuthor {
name: String!
avatar: String!
}
type GlobalSearchTotal {
products: Int!
stores: Int!
users: Int!
jobs: Int!
posts: Int!
}
# ============================================
# 🔹 ADMIN TYPES
# ============================================
type AdminUsersResult {
data: [AdminUser!]!
pagination: Pagination!
}
type AdminUser {
_id: ID!
username: String!
email: String!
isAdmin: Boolean!
profile: AdminUserProfile!
createdAt: Date!
stats: AdminUserStats!
}
type AdminUserProfile {
nickname: String
avatar: String
jobTitle: String
storeEnabled: Boolean
}
type AdminUserStats {
productsCount: Int!
ordersCount: Int!
salesCount: Int!
}
type AdminStoresResult {
data: [AdminStore!]!
pagination: Pagination!
}
type AdminStore {
_id: ID!
userId: User!
storeName: String
storeLogo: String
enabled: Boolean!
productsCount: Int!
ordersCount: Int!
totalSales: Float!
currencySymbol: String!
createdAt: Date!
updatedAt: Date!
}
type AdminOrdersResult {
data: [Order!]!
pagination: Pagination!
}
type AdminProductsResult {
data: [StoreProduct!]!
pagination: Pagination!
}
type AdminReportsResult {
data: [Report!]!
pagination: Pagination!
}
type AdminMessageReportsResult {
data: [MessageReport!]!
pagination: Pagination!
}
type AdminSubscriptionsResult {
data: [UserSubscription!]!
pagination: Pagination!
}
type AdminLogsResult {
data: [Notification!]!
pagination: Pagination!
}
type MessageReport {
_id: ID!
messageId: Message!
reporterId: User!
reporterUsername: String
reportedUserId: User!
reason: String!
messageContent: String
messageAttachments: JSON
conversationId: Conversation
status: String!
resolution: String
adminNote: String
resolvedBy: User
resolvedAt: Date
reportedAt: Date!
}
type Conversation {
_id: ID!
participants: [User!]!
lastMessage: ConversationLastMessage
unreadCount: Int!
updatedAt: Date!
createdAt: Date!
}
type ConversationLastMessage {
text: String!
senderId: User!
readBy: [User!]!
createdAt: Date!
}
type Message {
_id: ID!
conversationId: Conversation!
senderId: User!
text: String!
attachments: [MessageAttachment!]!
readBy: [MessageRead!]!
reactions: JSON
isPinned: Boolean!
isForwarded: Boolean!
originalMessageId: Message
replyTo: Message
hidden: Boolean!
isDeleted: Boolean!
deletedFor: [User!]!
createdAt: Date!
}
type MessageAttachment {
type: String!
url: String!
publicId: String
name: String
size: Int
}
type MessageRead {
userId: User!
readAt: Date!
}
# ============================================
# 🔹 TEMPLATE TYPES
# ============================================
type Template {
_id: ID!
name: String!
slug: String!
description: String
category: String!
previewImage: String
previewImages: [String!]!
demoUrl: String
themeData: ThemeData!
version: String!
rating: Float!
totalRatings: Int!
downloadsCount: Int!
viewsCount: Int!
installedBy: [TemplateInstall!]!
isActive: Boolean!
createdAt: Date!
installedAt: Date!
updatedAt: Date!
# حسابية
templateUrl: String
}
type ThemeData {
colors: ThemeColorsOutput # ✅ Output Type
typography: ThemeTypographyOutput # ✅ Output Type
layout: TemplateLayout
sections: [TemplateSection!]!
customCss: String
customJs: String
customHeaderFooter: CustomHeaderFooter
uploadedFiles: UploadedThemeFiles
templateUrl: String
storeInfo: TemplateStoreInfo
currency: String
paymentSettings: JSON
socialLinks: SocialLinks
seoSettings: TemplateSeoSettings
storeCoupons: [TemplateCoupon!]
shippingZones: [TemplateShippingZone!]
pagesOrder: JSON
performanceSettings: JSON
productsSettings: TemplateProductsSettings
borderRadius: Int
shadowType: String
animationType: String
glassEffect: Boolean
backgroundType: String
backgroundValue: String
pages: [TemplatePage!]
defaultPages: JSON
}
input ThemeColorsInput {
primary: String
secondary: String
accent: String
background: String
text: String
textLight: String
border: String
success: String
error: String
warning: String
}
input ThemeTypographyInput {
fontFamily: String
headingFont: String
baseFontSize: String
enableGoogleFonts: Boolean
}
type TemplateLayout {
type: String
headerLayout: String
footerLayout: String
sidebarPosition: String
productsPerRow: Int
productsPerRowMobile: Int
productsPerRowTablet: Int
productsPerRowDesktop: Int
enableStickyAddToCart: Boolean
enableCompareProducts: Boolean
enableWishlist: Boolean
enableRecentlyViewed: Boolean
containerWidth: String
containerPadding: String
showBreadcrumb: Boolean
stickyHeader: Boolean
backToTop: Boolean
showSearchBar: Boolean
showCategories: Boolean
productsPerPage: Int
enableLazyLoad: Boolean
enableAnimations: Boolean
columns: Int
shadowType: String
}
type TemplateSection {
id: String
type: String!
enabled: Boolean
order: Int
title: String
limit: Int
layout: String
content: JSON
settings: JSON
}
type CustomHeaderFooter {
header: String
footer: String
sidebar: String
productCard: String
categoryCard: String
css: String
js: String
}
type ThemeColorsOutput {
primary: String
secondary: String
accent: String
background: String
text: String
textLight: String
border: String
success: String
error: String
warning: String
}
type ThemeTypographyOutput {
fontFamily: String
headingFont: String
baseFontSize: String
enableGoogleFonts: Boolean
}
type UploadedThemeFiles {
htmlFiles: [TemplateFile!]!
cssFiles: [TemplateFile!]!
jsFiles: [TemplateFile!]!
imageFiles: [TemplateFile!]!
fontFiles: [TemplateFile!]!
}
type TemplateFile {
name: String!
url: String
size: Int
}
type TemplateStoreInfo {
storeName: String
storeLogo: String
storeBanner: String
storeDescription: String
contactEmail: String
}
type TemplateSeoSettings {
metaTitleTemplate: String
metaDescriptionTemplate: String
productTitleTemplate: String
enableBreadcrumbs: Boolean
sitemapEnabled: Boolean
robotsTxt: String
canonicalUrl: String
}
type TemplateCoupon {
code: String!
discount: Float!
discountType: String!
minPurchase: Float
maxDiscount: Float
validUntil: Date
usageLimit: Int
}
type TemplateShippingZone {
name: String!
countries: [String!]!
cities: [String!]!
cost: Float!
freeShippingAbove: Float
estimatedDays: String
}
type TemplateProductsSettings {
productViewType: String
autoApproveReviews: Boolean
enableQuickView: Boolean
enableProductReviews: Boolean
productsPerRow: Int
}
type TemplatePage {
slug: String!
title: String!
content: String
css: String
js: String
seo: PageSEO
isEnabled: Boolean
order: Int
type: String
}
type TemplateInstall {
userId: User!
installedAt: Date!
}
type TemplateCategory {
_id: String!
count: Int!
}
type TemplatesResult {
data: [Template!]!
pagination: Pagination!
}
type TemplateApplyResult {
success: Boolean!
message: String!
appliedSettings: TemplateAppliedSettings!
needsRefresh: Boolean!
redirectUrl: String!
}
type TemplateAppliedSettings {
primaryColor: String
secondaryColor: String
fontFamily: String
borderRadius: Int
shadowType: String
animationType: String
glassEffect: Boolean
backgroundType: String
sectionsCount: Int
layout: String
productsPerRow: Int
hasCustomCss: Boolean
hasCustomHeader: Boolean
hasFullTemplate: Boolean
templateUrl: String
}
# ============================================
# 🔹 INPUT TYPES FOR MUTATIONS
# ============================================
input InteractionsSettingsInput {
showToPublic: Boolean
showToLoggedIn: Boolean
showOnlyToOwner: Boolean
showToSpecificUsers: [String!]
hideProjects: [String!]
hideComments: [String!]
}
input ThemeInput {
id: String
primaryColor: String
secondaryColor: String
fontFamily: String
borderRadius: String
name: String
isActive: Boolean
version: String
layout: String
customTemplates: CustomTemplatesInput
settings: ThemeSettingsInput
colors: ThemeColorsInput
typography: ThemeTypographyInput
customAssets: CustomAssetsInput
seo: ThemeSEOInput
}
input CustomTemplatesInput {
header: String
footer: String
sidebar: String
productCard: String
categoryCard: String
}
input ThemeSettingsInput {
containerWidth: String
containerPadding: String
showBreadcrumb: Boolean
stickyHeader: Boolean
backToTop: Boolean
showSearchBar: Boolean
showCategories: Boolean
productsPerRow: Int
productsPerPage: Int
enableLazyLoad: Boolean
enableAnimations: Boolean
}
input SectionNamesInput {
about: String
experience: String
education: String
certificates: String
skills: String
projects: String
interests: String
contactInfo: String
activity: String
contributionGraph: String
alsoViewed: String
suggestions: String
pages: String
analytics: String
jobApplications: String
}
input SectionVisibilityInput {
about: Boolean
experience: Boolean
education: Boolean
certificates: Boolean
skills: Boolean
projects: Boolean
interests: Boolean
contactInfo: Boolean
socialLinks: Boolean
stats: Boolean
activity: Boolean
contributionGraph: Boolean
alsoViewed: Boolean
suggestions: Boolean
pages: Boolean
jobApplications: Boolean
analytics: Boolean
}
input SectionOrderItemInput {
id: String!
column: String
}
input SectionStyleSettingsInput {
padding: String
margin: String
background: String
textColor: String
borderRadius: String
shadow: String
}
input LayoutInput {
type: String
columns: Int
showProjectImages: Boolean
showProjectDescriptions: Boolean
showProjectRatings: Boolean
showProjectLinks: Boolean
}
input HeaderInput {
showAvatar: Boolean
showJobTitle: Boolean
showBio: Boolean
showContactInfo: Boolean
showSocialLinks: Boolean
layout: String
}
input FooterInput {
showCopyright: Boolean
customText: String
}
input SEOInput {
title: String
description: String
keywords: String
ogImage: String
ogTitle: String
ogDescription: String
twitterCard: String
twitterSite: String
canonicalUrl: String
noindex: Boolean
nofollow: Boolean
}
input SchemaInput {
type: String
name: String
description: String
image: String
sameAs: [String!]
jobTitle: String
worksFor: String
alumniOf: [String!]
knowsAbout: [String!]
}
input CustomAssetsInput {
css: String
js: String
headHtml: String
bodyHtml: String
}
input ThemeSEOInput {
metaTitle: String
metaDescription: String
metaKeywords: String
ogImage: String
twitterCard: String
canonicalUrl: String
structuredData: JSON
}
input LayoutSettingsInput {
headerLayout: String
footerLayout: String
sidebarPosition: String
productsPerRowDesktop: Int
productsPerRowTablet: Int
productsPerRowMobile: Int
enableStickyAddToCart: Boolean
enableQuickView: Boolean
enableCompareProducts: Boolean
enableWishlist: Boolean
enableRecentlyViewed: Boolean
enableProductReviews: Boolean
cardStyle: String
heroStyle: String
showStats: Boolean
showAnalytics: Boolean
showHero: Boolean
showFeatured: Boolean
showCategories: Boolean
theme: String
productViewType: String
compactMode: JSON
magazineMode: JSON
darkStoreMode: JSON
sectionsOrder: [String!]
advanced: JSON
}
input PageOrderInput {
id: ID!
order: Int!
}
input PlatformBankInput {
bankName: String!
accountName: String!
accountNumber: String!
iban: String
swiftCode: String
isActive: Boolean
order: Int
}
input CreatePlanInput {
name: String!
nameAr: String
description: String
descriptionAr: String
price: Float!
currency: String
duration: String!
features: PlanFeaturesInput!
hasFreeTrial: Boolean
freeTrialDays: Int
badge: String
badgeColor: String
icon: String
isActive: Boolean
order: Int
customPermissions: JSON
}
input PlanFeaturesInput {
storeEnabled: Boolean
maxProducts: Int
maxDigitalProducts: Int
maxProjects: Int
maxServices: Int
pageBuilderEnabled: Boolean
customDomain: Boolean
analyticsEnabled: Boolean
prioritySupport: Boolean
removeBranding: Boolean
teamMembers: Int
apiAccess: Boolean
customCss: Boolean
advancedAnalytics: Boolean
exportData: Boolean
}
input CreatePaymentMethodInput {
name: String!
nameAr: String
type: String!
icon: String
instructions: String
instructionsAr: String
bankDetails: BankDetailsInput
mobileWalletDetails: MobileWalletDetailsInput
onlineDetails: OnlineDetailsInput
isActive: Boolean
order: Int
}
input BankDetailsInput {
bankName: String
accountName: String
accountNumber: String
iban: String
swiftCode: String
branch: String
}
input MobileWalletDetailsInput {
provider: String
phoneNumber: String
}
input OnlineDetailsInput {
provider: String
apiKey: String
webhookSecret: String
isActive: Boolean
}
# ============================================
# 🔹 STORE ANALYTICS TYPES
# ============================================
type StoreAnalytics {
totalViews: Int!
uniqueViews: Int!
followersCount: Int!
orders: OrderAnalytics!
products: ProductAnalytics!
topProducts: [TopProduct!]!
last7Days: [DailyAnalytics!]!
last6Months: [MonthlyAnalytics!]!
referralSources: ReferralSources!
recentViews: [RecentView!]!
}
type OrderAnalytics {
total: Int!
completed: Int!
pending: Int!
totalRevenue: Float!
}
type ProductAnalytics {
total: Int!
digital: Int!
projects: Int!
services: Int!
totalSales: Int!
}
type TopProduct {
_id: ID!
title: String!
salesCount: Int!
price: Float!
image: String
}
type DailyAnalytics {
date: String!
views: Int!
uniqueViews: Int!
orders: Int!
revenue: Float!
}
type MonthlyAnalytics {
month: String!
views: Int!
uniqueViews: Int!
orders: Int!
revenue: Float!
}
type ReferralSources {
direct: Int!
google: Int!
facebook: Int!
twitter: Int!
linkedin: Int!
instagram: Int!
github: Int!
mgzon: Int!
search: Int!
other: Int!
}
type RecentView {
viewerName: String
deviceType: String!
browser: String!
timestamp: Date!
referer: String
}
# ============================================
# 🔹 SITE SETTINGS
# ============================================
type SiteSettings {
logo: String!
siteName: String!
primaryColor: String!
secondaryColor: String!
navbarLinks: [NavbarLink!]!
footerText: String!
updatedAt: Date!
}
type NavbarLink {
label: String!
href: String!
order: Int!
}
# ============================================
# 🔹 STORE SETTINGS RESULT
# ============================================
type StoreSettingsResult {
settings: StoreSettingsType!
theme: StoreTheme!
}
type StoreSettingsType {
userId: ID!
storeName: String
storeLogo: String
storeBanner: String
storeDescription: String
contactEmail: String
enabled: Boolean!
currency: String!
currencySymbol: String!
paymentMethods: [PaymentMethod!]!
primaryColor: String!
secondaryColor: String!
fontFamily: String!
borderRadius: Int!
shadowType: String!
animationType: String!
glassEffect: Boolean!
backgroundType: String!
backgroundValue: String!
customCss: String!
productViewType: String!
socialLinks: SocialLinks!
pageBuilder: PageBuilder!
layoutSettings: LayoutSettings!
appliedTemplate: AppliedTemplate
currentBackground: CurrentBackground
customBackgrounds: [CustomBackground!]!
backgroundHistory: [BackgroundHistory!]!
createdAt: Date!
updatedAt: Date!
}
type PaymentMethod {
type: String!
label: String
details: JSON!
isActive: Boolean!
createdAt: Date!
}
type PageBuilder {
sections: [PageSection!]!
}
type PageSection {
id: String!
type: String!
enabled: Boolean!
order: Int!
title: String
limit: Int
layout: String
content: JSON
settings: JSON
}
type LayoutSettings {
layoutTemplate: String!
headerLayout: String!
footerLayout: String!
sidebarPosition: String!
productsPerRowDesktop: Int!
productsPerRowTablet: Int!
productsPerRowMobile: Int!
enableStickyAddToCart: Boolean!
enableQuickView: Boolean!
enableCompareProducts: Boolean!
enableWishlist: Boolean!
enableRecentlyViewed: Boolean!
enableProductReviews: Boolean!
cardStyle: String!
heroStyle: String!
showStats: Boolean!
showAnalytics: Boolean!
showHero: Boolean!
showFeatured: Boolean!
showCategories: Boolean!
theme: String!
productViewType: String!
}
type AppliedTemplate {
slug: String!
name: String!
templateUrl: String
appliedAt: Date!
hasFullTemplate: Boolean!
path: String
}
type CurrentBackground {
url: String!
name: String!
type: String!
appliedAt: Date!
}
type CustomBackground {
id: ID!
name: String!
url: String!
category: String!
type: String!
uploadedAt: Date!
isActive: Boolean!
}
type BackgroundHistory {
url: String!
name: String!
appliedAt: Date!
duration: Int!
}
# ============================================
# 🔹 CART SUMMARY
# ============================================
type CartSummary {
totalItems: Int!
totalStores: Int!
stores: [CartStoreSummary!]!
}
type CartStoreSummary {
storeId: ID!
storeName: String!
itemCount: Int!
subtotal: Float!
}
# ============================================
# 🔹 RATING
# ============================================
type Rating {
_id: ID!
targetUserId: User!
raterUserId: User!
rating: Int!
review: String
createdAt: Date!
updatedAt: Date!
}
# ============================================
# 🔹 PLATFORM BANK
# ============================================
type PlatformBank {
_id: ID!
bankName: String!
accountName: String!
accountNumber: String!
iban: String
swiftCode: String
isActive: Boolean!
order: Int!
createdAt: Date!
updatedAt: Date!
}
# ============================================
# 🔹 PLATFORM PAYMENT METHOD
# ============================================
type PlatformPaymentMethod {
_id: ID!
name: String!
nameAr: String
type: String!
icon: String!
instructions: String
instructionsAr: String
bankDetails: BankDetails
mobileWalletDetails: MobileWalletDetails
onlineDetails: OnlineDetails
isActive: Boolean!
order: Int!
createdAt: Date!
updatedAt: Date!
}
type BankDetails {
bankName: String
accountName: String
accountNumber: String
iban: String
swiftCode: String
branch: String
}
type MobileWalletDetails {
provider: String
phoneNumber: String
}
type OnlineDetails {
provider: String
apiKey: String
webhookSecret: String
isActive: Boolean
}
`;
module.exports = typeDefs;