-
Notifications
You must be signed in to change notification settings - Fork 17
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
1 parent
5d0f6d5
commit 862e798
Showing
19 changed files
with
186 additions
and
14 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
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
40 changes: 40 additions & 0 deletions
40
apps/server/src/modules/board/controller/dto/element/appointment-finder-element.response.ts
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,40 @@ | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { DecodeHtmlEntities } from '@shared/controller'; | ||
import { ContentElementType } from '../../../domain'; | ||
import { TimestampsResponse } from '../timestamps.response'; | ||
|
||
export class AppointmentFinderElementContent { | ||
constructor({ appointmentFinderId, adminId }: AppointmentFinderElementContent) { | ||
this.appointmentFinderId = appointmentFinderId; | ||
this.adminId = adminId; | ||
} | ||
|
||
@ApiPropertyOptional() | ||
@DecodeHtmlEntities() | ||
appointmentFinderId?: string; | ||
|
||
@ApiPropertyOptional() | ||
@DecodeHtmlEntities() | ||
adminId?: string; | ||
} | ||
|
||
export class AppointmentFinderElementResponse { | ||
constructor(props: AppointmentFinderElementResponse) { | ||
this.id = props.id; | ||
this.type = props.type; | ||
this.timestamps = props.timestamps; | ||
this.content = props.content; | ||
} | ||
|
||
@ApiProperty({ pattern: '[a-f0-9]{24}' }) | ||
id: string; | ||
|
||
@ApiProperty({ enum: ContentElementType, enumName: 'ContentElementType' }) | ||
type: ContentElementType.APPOINTMENT_FINDER; | ||
|
||
@ApiProperty() | ||
timestamps: TimestampsResponse; | ||
|
||
@ApiProperty() | ||
content: AppointmentFinderElementContent; | ||
} |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
export * from './any-content-element.response'; | ||
export * from './appointment-finder-element.response'; | ||
export * from './collaborative-text-editor-element.response'; | ||
export * from './create-content-element.body.params'; | ||
export * from './deleted-element.response'; | ||
export * from './drawing-element.response'; | ||
export * from './external-tool-element.response'; | ||
export * from './file-element.response'; | ||
export * from './link-element.response'; | ||
export * from './rich-text-element.response'; | ||
export * from './submission-container-element.response'; | ||
export * from './update-element-content.body.params'; | ||
export * from './deleted-element.response'; |
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
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
33 changes: 33 additions & 0 deletions
33
.../server/src/modules/board/controller/mapper/appointment-finder-element-response.mapper.ts
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,33 @@ | ||
import { AppointmentFinderElement, ContentElementType } from '../../domain'; | ||
import { AppointmentFinderElementResponse, TimestampsResponse } from '../dto'; | ||
import { BaseResponseMapper } from './base-mapper.interface'; | ||
|
||
export class AppointmentFinderElementResponseMapper implements BaseResponseMapper { | ||
private static instance: AppointmentFinderElementResponseMapper; | ||
|
||
public static getInstance(): AppointmentFinderElementResponseMapper { | ||
if (!AppointmentFinderElementResponseMapper.instance) { | ||
AppointmentFinderElementResponseMapper.instance = new AppointmentFinderElementResponseMapper(); | ||
} | ||
|
||
return AppointmentFinderElementResponseMapper.instance; | ||
} | ||
|
||
mapToResponse(element: AppointmentFinderElement): AppointmentFinderElementResponse { | ||
const result = new AppointmentFinderElementResponse({ | ||
id: element.id, | ||
timestamps: new TimestampsResponse({ lastUpdatedAt: element.updatedAt, createdAt: element.createdAt }), | ||
type: ContentElementType.APPOINTMENT_FINDER, | ||
content: { | ||
appointmentFinderId: element.appointmentFinderId, | ||
adminId: element.adminId, | ||
}, | ||
}); | ||
|
||
return result; | ||
} | ||
|
||
canMap(element: AppointmentFinderElement): boolean { | ||
return element instanceof AppointmentFinderElement; | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
apps/server/src/modules/board/domain/appointment-finder.do.ts
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,27 @@ | ||
import { BoardNode } from './board-node.do'; | ||
import type { AppointmentFinderElementProps } from './types'; | ||
|
||
export class AppointmentFinderElement extends BoardNode<AppointmentFinderElementProps> { | ||
get appointmentFinderId(): string | undefined { | ||
return this.props.externalId; | ||
} | ||
|
||
set appointmentFinderId(value: string) { | ||
this.props.externalId = value; | ||
} | ||
|
||
get adminId(): string | undefined { | ||
return this.props.externalAdminId; | ||
} | ||
|
||
set adminId(value: string) { | ||
this.props.externalAdminId = value; | ||
} | ||
|
||
canHaveChild(): boolean { | ||
return false; | ||
} | ||
} | ||
|
||
export const isAppointmentFinderElement = (reference: unknown): reference is AppointmentFinderElement => | ||
reference instanceof AppointmentFinderElement; |
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
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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
export * from './board-node.do'; | ||
export * from './appointment-finder.do'; | ||
export * from './board-node-authorizable.do'; | ||
export * from './board-node.do'; | ||
export * from './board-node.factory'; | ||
export * from './collaborative-text-editor.do'; | ||
export * from './card.do'; | ||
export * from './column.do'; | ||
export * from './collaborative-text-editor.do'; | ||
export * from './colum-board.do'; | ||
export * from './column.do'; | ||
export * from './deleted-element.do'; | ||
export * from './drawing-element.do'; | ||
export * from './external-tool-element.do'; | ||
export * from './file-element.do'; | ||
export * from './link-element.do'; | ||
export * from './media-board'; | ||
export * from './path-utils'; | ||
export * from './rich-text-element.do'; | ||
export * from './submission-container-element.do'; | ||
export * from './submission-item.do'; | ||
export * from './path-utils'; | ||
export * from './types'; | ||
export * from './type-mapping'; | ||
export * from './deleted-element.do'; | ||
export * from './types'; |
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
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
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
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
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
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
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
Oops, something went wrong.