dooring-core-domain
v1.0.51
Published
Dooring 프로젝트의 핵심 도메인 모델들을 정의한 npm 패키지
Readme
@dooring/core-domain
Dooring 프로젝트의 핵심 도메인 모델들을 정의한 npm 패키지입니다.
설치
npm install @dooring/core-domain
# 또는
yarn add @dooring/core-domain사용법
기본 사용법
import { User, UserRole, Project, ProjectStatus } from '@dooring/core-domain';
// User 객체 생성
const user: User = {
id: 'user-123',
email: '[email protected]',
username: 'johndoe',
firstName: 'John',
lastName: 'Doe',
isActive: true,
createdAt: new Date(),
updatedAt: new Date(),
role: UserRole.USER,
preferences: {
language: 'ko',
timezone: 'Asia/Seoul',
notifications: {
email: true,
push: true,
sms: false,
marketing: false
},
theme: 'auto'
}
};
// Project 객체 생성
const project: Project = {
id: 'project-456',
name: 'My Awesome Project',
description: 'This is a great project',
ownerId: 'user-123',
collaborators: [],
status: ProjectStatus.ACTIVE,
visibility: 'public',
tags: ['web', 'react'],
createdAt: new Date(),
updatedAt: new Date(),
settings: {
allowComments: true,
allowVersioning: true,
autoSave: true,
maxCollaborators: 10,
retentionPolicy: {
keepVersions: 5,
autoArchiveAfterDays: 365
}
}
};타입 가져오기
// User 관련 타입들
import {
User,
UserRole,
UserPreferences,
NotificationSettings,
CreateUserData,
UpdateUserData,
UserFilter
} from '@dooring/core-domain';
// Project 관련 타입들
import {
Project,
ProjectStatus,
ProjectVisibility,
CollaboratorRole,
ProjectPermission,
CreateProjectData,
UpdateProjectData,
ProjectFilter
} from '@dooring/core-domain';
// 공통 타입들
import {
BaseEntity,
PaginatedResult,
ApiResponse,
SearchOptions
} from '@dooring/core-domain';API 문서
User 모델
User 인터페이스
사용자 정보를 표현하는 핵심 엔티티입니다.
interface User {
id: string; // 사용자 고유 ID
email: string; // 이메일 주소
username: string; // 사용자명
firstName?: string; // 이름 (선택사항)
lastName?: string; // 성 (선택사항)
avatar?: string; // 프로필 이미지 URL (선택사항)
isActive: boolean; // 활성 상태
createdAt: Date; // 생성일
updatedAt: Date; // 수정일
lastLoginAt?: Date; // 마지막 로그인 시간 (선택사항)
role: UserRole; // 사용자 역할
preferences: UserPreferences; // 사용자 설정
}UserRole 열거형
enum UserRole {
ADMIN = 'admin', // 관리자
USER = 'user', // 일반 사용자
MODERATOR = 'moderator', // 중재자
GUEST = 'guest' // 게스트
}Project 모델
Project 인터페이스
프로젝트 정보를 표현하는 핵심 엔티티입니다.
interface Project {
id: string; // 프로젝트 고유 ID
name: string; // 프로젝트명
description?: string; // 설명 (선택사항)
ownerId: string; // 소유자 ID
collaborators: ProjectCollaborator[]; // 협업자 목록
status: ProjectStatus; // 프로젝트 상태
visibility: ProjectVisibility; // 가시성
tags: string[]; // 태그 목록
createdAt: Date; // 생성일
updatedAt: Date; // 수정일
settings: ProjectSettings; // 프로젝트 설정
}ProjectStatus 열거형
enum ProjectStatus {
DRAFT = 'draft', // 초안
ACTIVE = 'active', // 활성
ARCHIVED = 'archived', // 보관됨
DELETED = 'deleted' // 삭제됨
}개발
의존성 설치
npm install빌드
npm run build개발 모드 (watch)
npm run dev정리
npm run clean라이선스
MIT License
기여하기
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
지원
문제가 있거나 제안사항이 있으시면 Issues에 등록해 주세요.
