Files
mws.frontend.vue/src/types/index.ts
T

201 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-08-24 08:07:23 +07:00
export interface PagedResult<T> {
items: T[]
totalCount: number
page: number
pageSize: number
}
2026-08-11 23:17:04 +07:00
export interface User {
id: string
username: string
displayName: string
roleId: string
roleName: string
}
2026-08-24 08:07:23 +07:00
export interface UserListItem {
2026-08-11 23:17:04 +07:00
id: string
username: string
displayName: string
roleId: string
roleName: string
isActive: boolean
createdAt: string
}
export interface LoginResponse {
token: string
user: User
}
export interface MenuItem {
key: string
label: string
path: string
canView: boolean
canCreate: boolean
canEdit: boolean
canDelete: boolean
}
export interface PermissionEntry {
screen: string
canView: boolean
canCreate: boolean
canEdit: boolean
canDelete: boolean
}
export interface Role {
id: string
name: string
isSystem: boolean
permissions: PermissionEntry[]
}
export interface SaveRoleRequest {
name: string
permissions: PermissionEntry[]
}
2026-08-24 08:07:23 +07:00
export interface MasterDataItem {
id: string
group: string
label: string
value: string
sortOrder: number
isActive: boolean
}
export interface SaveMasterDataRequest {
group: string
label: string
value: string
sortOrder: number
isActive: boolean
}
2026-08-11 23:17:04 +07:00
export type ProjectStatus = 'Active' | 'Archived'
export type MemberRole = 'Owner' | 'Member'
export type DocumentType = 'Folder' | 'Document'
export type TaskStatus = 'Todo' | 'InProgress' | 'Done' | 'Cancelled'
export type TaskPriority = 'Low' | 'Medium' | 'High'
export interface Project {
id: string
name: string
description: string | null
status: ProjectStatus
2026-08-24 08:07:23 +07:00
createdBy: string
createdByName: string
2026-08-11 23:17:04 +07:00
createdAt: string
2026-08-24 08:07:23 +07:00
updatedBy: string | null
updatedByName: string | null
2026-08-11 23:17:04 +07:00
updatedAt: string
}
export interface ProjectMember {
userId: string
username: string
displayName: string
role: MemberRole
2026-08-24 08:07:23 +07:00
canViewDocuments: boolean
canCreateDocuments: boolean
canEditDocuments: boolean
canDeleteDocuments: boolean
2026-08-11 23:17:04 +07:00
}
export interface DocumentNode {
id: string
parentId: string | null
title: string
type: DocumentType
2026-08-24 08:07:23 +07:00
createdAt: string
createdBy: string
2026-08-11 23:17:04 +07:00
updatedAt: string
2026-08-24 08:07:23 +07:00
updatedBy: string | null
2026-08-11 23:17:04 +07:00
children: DocumentNode[]
}
export interface DocumentItem {
id: string
projectId: string
parentId: string | null
title: string
content: string | null
type: DocumentType
createdBy: string
createdAt: string
updatedBy: string | null
updatedAt: string
}
export interface Task {
id: string
projectId: string
title: string
description: string | null
status: TaskStatus
priority: TaskPriority
assigneeId: string | null
assigneeName: string | null
dueDate: string | null
createdAt: string
updatedAt: string
}
2026-08-24 08:07:23 +07:00
export interface UserRoleDetail {
userId: string
username: string
displayName: string
assignedRoles: Role[]
unassignedRoles: Role[]
}
2026-08-11 23:17:04 +07:00
export interface TaskCounts {
[status: string]: number
2026-08-24 08:07:23 +07:00
}
2026-09-20 16:17:33 +07:00
export interface ActionLog {
id: string
actorUserId: string
actorUsername: string
action: string
entityType: string
entityId: string | null
entityName: string | null
ipAddress: string | null
userAgent: string | null
createdAt: string
}
export interface LoginLog {
id: string
username: string
userId: string | null
success: boolean
failureReason: string | null
ipAddress: string | null
userAgent: string | null
createdAt: string
}
export interface ActionLogFilters {
from?: string
to?: string
actor?: string
action?: string
entityType?: string
page?: number
pageSize?: number
}
export interface LoginLogFilters {
from?: string
to?: string
username?: string
success?: boolean
page?: number
pageSize?: number
}