-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from chaynHQ/develop
Merge Develop onto Main
- Loading branch information
Showing
18 changed files
with
600 additions
and
227 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { IsBoolean } from 'class-validator'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class UpdatePartnerDto { | ||
@IsBoolean() | ||
@ApiProperty({ type: Boolean }) | ||
active: boolean; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEnum, IsNotEmpty, IsString } from 'class-validator'; | ||
import { FEEDBACK_TAGS_ENUM } from 'src/utils/constants'; | ||
|
||
export class SessionFeedbackDto { | ||
@IsNotEmpty() | ||
@IsString() | ||
@ApiProperty({ type: String }) | ||
sessionId: string; | ||
|
||
@IsNotEmpty() | ||
@IsEnum(FEEDBACK_TAGS_ENUM) | ||
@ApiProperty({ | ||
enum: FEEDBACK_TAGS_ENUM, | ||
type: String, | ||
example: Object.values(FEEDBACK_TAGS_ENUM), | ||
}) | ||
feedbackTags: FEEDBACK_TAGS_ENUM; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
@ApiProperty({ type: String }) | ||
feedbackDescription: string; | ||
} |
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,25 @@ | ||
import { Body, Controller, Post, UseGuards } from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger'; | ||
import { ControllerDecorator } from 'src/utils/controller.decorator'; | ||
import { FirebaseAuthGuard } from '../firebase/firebase-auth.guard'; | ||
import { SessionFeedbackDto } from './dtos/session-feedback.dto'; | ||
import { SessionFeedbackService } from './session-feedback.service'; | ||
|
||
@ApiTags('Session Feedback') | ||
@ControllerDecorator() | ||
@Controller('/v1/session-feedback') | ||
export class SessionFeedbackController { | ||
constructor(private readonly sessionFeedbackService: SessionFeedbackService) {} | ||
|
||
@Post() | ||
@ApiBearerAuth('access-token') | ||
@ApiOperation({ | ||
description: 'Stores feedback from a user', | ||
}) | ||
@UseGuards(FirebaseAuthGuard) | ||
async storeUserFeedback( | ||
@Body() sessionFeedbackDto: SessionFeedbackDto, | ||
): Promise<SessionFeedbackDto> { | ||
return await this.sessionFeedbackService.createSessionFeedback(sessionFeedbackDto); | ||
} | ||
} |
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,48 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { SlackMessageClient } from 'src/api/slack/slack-api'; | ||
import { ZapierWebhookClient } from 'src/api/zapier/zapier-webhook-client'; | ||
import { PartnerAccessEntity } from 'src/entities/partner-access.entity'; | ||
import { PartnerEntity } from 'src/entities/partner.entity'; | ||
import { SessionFeedbackEntity } from 'src/entities/session-feedback.entity'; | ||
import { SessionEntity } from 'src/entities/session.entity'; | ||
import { SubscriptionUserEntity } from 'src/entities/subscription-user.entity'; | ||
import { SubscriptionEntity } from 'src/entities/subscription.entity'; | ||
import { TherapySessionEntity } from 'src/entities/therapy-session.entity'; | ||
import { UserEntity } from 'src/entities/user.entity'; | ||
import { PartnerAccessService } from 'src/partner-access/partner-access.service'; | ||
import { SessionService } from 'src/session/session.service'; | ||
import { SubscriptionUserService } from 'src/subscription-user/subscription-user.service'; | ||
import { SubscriptionService } from 'src/subscription/subscription.service'; | ||
import { TherapySessionService } from 'src/therapy-session/therapy-session.service'; | ||
import { UserService } from 'src/user/user.service'; | ||
import { SessionFeedbackController } from './session-feedback.controller'; | ||
import { SessionFeedbackService } from './session-feedback.service'; | ||
|
||
@Module({ | ||
imports: [ | ||
TypeOrmModule.forFeature([ | ||
SessionFeedbackEntity, | ||
SessionEntity, | ||
UserEntity, | ||
PartnerAccessEntity, | ||
PartnerEntity, | ||
SubscriptionUserEntity, | ||
SubscriptionEntity, | ||
TherapySessionEntity, | ||
]), | ||
], | ||
controllers: [SessionFeedbackController], | ||
providers: [ | ||
SessionFeedbackService, | ||
SessionService, | ||
UserService, | ||
SubscriptionUserService, | ||
SubscriptionService, | ||
PartnerAccessService, | ||
TherapySessionService, | ||
ZapierWebhookClient, | ||
SlackMessageClient, | ||
], | ||
}) | ||
export class SessionFeedbackModule {} |
Oops, something went wrong.