This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
@startuml Garden Manager Module | ||
|
||
skinparam classAttributeIconSize 0 | ||
|
||
skinparam class { | ||
BackgroundColor White | ||
ArrowColor Black | ||
BorderColor Black | ||
} | ||
|
||
' Controllers | ||
class ManagementGardenManagerController { | ||
-gardenManagerService: IGardenManagerService | ||
-userTokenService: IUserTokenService | ||
-gardenService: IGardenService | ||
+list() | ||
+getDetail() | ||
+create() | ||
+update() | ||
+deactivate() | ||
+activate() | ||
} | ||
|
||
' Interfaces | ||
interface IGardenManagerService { | ||
+create(createGardenManagerDto: CreateGardenManagerDto): Promise<GardenManagerDocument> | ||
+findById(gardenManagerId: string, projection?, populates?): Promise<GardenManagerDocument> | ||
+findByEmail(email: string, projection?): Promise<GardenManagerDocument> | ||
+update(conditions: FilterQuery, payload: UpdateQuery, options?): Promise<GardenManagerDocument> | ||
+list(pagination: PaginationParams, queryGardenManagerDto: QueryGardenManagerDto) | ||
} | ||
|
||
interface IGardenManagerRepository { | ||
} | ||
|
||
class GardenManagerService { | ||
-gardenManagerRepository: IGardenManagerRepository | ||
-helperService: HelperService | ||
-notificationService: INotificationService | ||
+create() | ||
+findById() | ||
+findByEmail() | ||
+update() | ||
+list() | ||
} | ||
|
||
class GardenManagerRepository { | ||
+model: PaginateModel<GardenManagerDocument> | ||
} | ||
|
||
abstract class AbstractRepository { | ||
+model: PaginateModel<T> | ||
+constructor(model: PaginateModel<T>) | ||
+findOne(params: {conditions, projection?, populates?, options?}): Promise<T | undefined> | ||
+findMany(params: {conditions, projection?, populates?, sort?, options?}): Promise<Array<T>> | ||
+create(payload: Record<string, any>, options?: SaveOptions): Promise<T> | ||
+findOneAndUpdate(conditions: FilterQuery<T>, payload: UpdateQuery<T>, options?: QueryOptions): Promise<T> | ||
} | ||
|
||
' DTOs | ||
class BaseGardenManagerDto { | ||
+_id: string | ||
+name: string | ||
+password: string | ||
+email: string | ||
+idCardPhoto: string | ||
+avatar: string | ||
+status: GardenManagerStatus | ||
+createdAt: Date | ||
+updatedAt: Date | ||
} | ||
|
||
' Schemas | ||
entity GardenManager { | ||
+_id: string | ||
+name: string | ||
+email: string | ||
+password: string | ||
+idCardPhoto: string | ||
+status: GardenManagerStatus | ||
} | ||
|
||
' Relationships | ||
ManagementGardenManagerController ..> IGardenManagerService | ||
|
||
IGardenManagerService <|.. GardenManagerService | ||
|
||
GardenManagerService ..> IGardenManagerRepository | ||
|
||
IGardenManagerRepository <|.. GardenManagerRepository | ||
IGardenManagerRepository --|> AbstractRepository | ||
GardenManagerRepository --|> AbstractRepository | ||
|
||
GardenManagerRepository ..> GardenManager | ||
BaseGardenManagerDto -- GardenManager | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
@startuml Learner Module | ||
|
||
skinparam classAttributeIconSize 0 | ||
|
||
skinparam class { | ||
BackgroundColor White | ||
ArrowColor Black | ||
BorderColor Black | ||
} | ||
|
||
' Controllers | ||
class ManagementLearnerController { | ||
-learnerService: ILearnerService | ||
-userTokenService: IUserTokenService | ||
-reportService: IReportService | ||
+list() | ||
+getDetail() | ||
+deactivate() | ||
+activate() | ||
} | ||
|
||
class InstructorLearnerController { | ||
-learnerService: ILearnerService | ||
+getDetail() | ||
} | ||
|
||
class LearnerController { | ||
-learnerService: ILearnerService | ||
+viewProfile() | ||
+updateProfile() | ||
} | ||
|
||
' Interfaces | ||
interface ILearnerService { | ||
+create(learner: any): Promise<LearnerDocument> | ||
+findById(learnerId: string): Promise<LearnerDocument> | ||
+findByEmail(email: string): Promise<LearnerDocument> | ||
+update(conditions: FilterQuery, payload: UpdateQuery): Promise<LearnerDocument> | ||
+list(pagination: PaginationParams, queryLearnerDto: QueryLearnerDto) | ||
+findMany(conditions: FilterQuery): Promise<LearnerDocument[]> | ||
} | ||
|
||
interface ILearnerRepository { | ||
} | ||
|
||
class LearnerService { | ||
-learnerRepository: ILearnerRepository | ||
+create() | ||
+findById() | ||
+findByEmail() | ||
+update() | ||
+list() | ||
+findMany() | ||
} | ||
|
||
class LearnerRepository { | ||
+model: PaginateModel<LearnerDocument> | ||
} | ||
|
||
abstract class AbstractRepository { | ||
+model: PaginateModel<T> | ||
+constructor(model: PaginateModel<T>) | ||
+findOne(params: {conditions, projection?, populates?, options?}): Promise<T> | ||
+findMany(params: {conditions, projection?, populates?, sort?, options?}): Promise<Array<T>> | ||
+create(payload: Record<string, any>, options?: SaveOptions): Promise<T> | ||
+findOneAndUpdate(conditions: FilterQuery<T>, payload: UpdateQuery<T>, options?: QueryOptions): Promise<T> | ||
} | ||
|
||
' DTOs | ||
class BaseLearnerDto { | ||
+_id: string | ||
+name: string | ||
+email: string | ||
+password: string | ||
+avatar: string | ||
+dateOfBirth: Date | ||
+phone: string | ||
+status: LearnerStatus | ||
+createdAt: Date | ||
+updatedAt: Date | ||
} | ||
|
||
' Schemas | ||
entity Learner { | ||
+_id: string | ||
+name: string | ||
+email: string | ||
+password: string | ||
+avatar: string | ||
+dateOfBirth: Date | ||
+phone: string | ||
+status: LearnerStatus | ||
} | ||
|
||
' Relationships | ||
ManagementLearnerController ..> ILearnerService | ||
InstructorLearnerController ..> ILearnerService | ||
LearnerController ..> ILearnerService | ||
|
||
ILearnerService <|.. LearnerService | ||
LearnerService ..> ILearnerRepository | ||
|
||
ILearnerRepository <|.. LearnerRepository | ||
ILearnerRepository --|> AbstractRepository | ||
LearnerRepository --|> AbstractRepository | ||
|
||
LearnerRepository ..> Learner | ||
BaseLearnerDto -- Learner | ||
|
||
@enduml |