sozsoft-platform/ui/src/proxy/intranet/models.ts
2026-05-06 17:48:44 +03:00

164 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { UserInfoViewModel } from "../admin/models"
export interface IntranetDashboardDto {
events: EventDto[]
birthdays: UserInfoViewModel[]
documents: DocumentDto[]
announcements: AnnouncementDto[]
surveys: SurveyDto[]
socialPosts: SocialPostDto[]
}
// Etkinlik
export interface EventDto {
id: string
categoryName: string
typeName: string
date: Date
name: string
description: string
place: string
organizer: UserInfoViewModel
participants: number
photos: string[]
comments: EventCommentDto[]
likes: number
isPublished: boolean
}
export interface EventCommentDto {
id: string
user: UserInfoViewModel
content: string
creationTime: Date
likes: number
}
// Doküman (FileItemDto ile uyumlu)
export interface DocumentDto {
id: string
name: string
type: string // "file" or "folder"
size: number
extension: string
mimeType: string
createdAt: Date
modifiedAt: Date
path: string
parentId: string
isReadOnly: boolean
childCount: number
}
// Duyuru
export interface AnnouncementDto {
id: string
title: string
excerpt: string
content: string
imageUrl?: string
category: string
userId: string
user: UserInfoViewModel
publishDate: Date
expiryDate?: Date
isPinned: boolean
viewCount: number
departments?: string[]
attachments?: { name: string; url: string; size: string }[]
}
// Anket Cevap
export interface SurveyAnswerDto {
questionId: string
questionType: 'rating' | 'multiple-choice' | 'text' | 'textarea' | 'yes-no'
value: string | number | string[]
}
// Anket Cevabı
export interface SurveyResponseDto {
id: string
surveyId: string
respondentId?: string // Anonymous ise null
submissionTime: Date
answers: SurveyAnswerDto[]
}
// Anket Sorusu Seçeneği
export interface SurveyQuestionOptionDto {
id: string
text: string
order: number
}
// Anket Sorusu
export interface SurveyQuestionDto {
id: string
surveyId: string
questionText: string
type: 'rating' | 'multiple-choice' | 'text' | 'textarea' | 'yes-no'
order: number
isRequired: boolean
options?: SurveyQuestionOptionDto[]
}
// Anket
export interface SurveyDto {
id: string
title: string
description: string
creatorId: UserInfoViewModel
creationTime: Date
deadline: Date
questions: SurveyQuestionDto[]
responses: number
targetAudience: string[]
status: 'draft' | 'active' | 'closed'
isAnonymous: boolean
myResponse?: SurveyResponseDto
}
// Sosyal Duvar - Comment Interface
export interface SocialCommentDto {
id: string
user: UserInfoViewModel
content: string
creationTime: Date
}
export interface SocialPollOptionDto {
id: string
text: string
votes: number
}
// Sosyal Duvar - Social Media Interface
export interface SocialMediaDto {
id?: string
type: 'image' | 'video' | 'poll'
// Ortak alanlar
urls?: string[]
// Anket (poll) ile ilgili alanlar doğrudan burada
pollQuestion?: string
pollOptions?: SocialPollOptionDto[]
pollTotalVotes?: number
pollEndsAt?: Date
pollUserVoteId?: string
}
// Sosyal Duvar - Ana Interface
export interface SocialPostDto {
id: string
user: UserInfoViewModel
content: string
locationJson?: string
media?: SocialMediaDto
likeCount: number
isLiked: boolean
likeUsers: UserInfoViewModel[]
comments: SocialCommentDto[]
isOwnPost: boolean
creationTime: Date
}