-
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.
## RecNet auto-release action This is an auto-generated PR by recnet-release-action 🤖 Please make sure to test your changes in staging before merging. ## Related Issues - #341 - #335 - #301 - #260 - #261 - #342 ## Related PRs - #346 - #344 - #343 ## Staging links recnet-web: [https://vercel.live/link/recnet-git-dev-recnet-542617e7.vercel.app](https://vercel.live/link/recnet-git-dev-recnet-542617e7.vercel.app) recnet-api: [https://dev-api.recnet.io/api](https://dev-api.recnet.io/api)
- Loading branch information
Showing
49 changed files
with
1,090 additions
and
1,030 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "recnet-api", | ||
"version": "1.7.2" | ||
"version": "1.8.0" | ||
} |
15 changes: 15 additions & 0 deletions
15
apps/recnet-api/prisma/migrations/20241027001827_add_subscription_table/down.sql
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,15 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Subscription" DROP CONSTRAINT "Subscription_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" DROP COLUMN "slackEmail"; | ||
|
||
-- DropTable | ||
DROP TABLE "Subscription"; | ||
|
||
-- DropEnum | ||
DROP TYPE "Channel"; | ||
|
||
-- DropEnum | ||
DROP TYPE "SubscriptionType"; | ||
|
25 changes: 25 additions & 0 deletions
25
apps/recnet-api/prisma/migrations/20241027001827_add_subscription_table/migration.sql
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 @@ | ||
-- CreateEnum | ||
CREATE TYPE "Channel" AS ENUM ('EMAIL', 'SLACK'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "SubscriptionType" AS ENUM ('WEEKLY_DIGEST'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ADD COLUMN "slackEmail" VARCHAR(128); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Subscription" ( | ||
"id" SERIAL NOT NULL, | ||
"userId" VARCHAR(64) NOT NULL, | ||
"type" "SubscriptionType" NOT NULL, | ||
"channel" "Channel" NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "Subscription_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Subscription_userId_type_channel_key" ON "Subscription"("userId", "type", "channel"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Subscription" ADD CONSTRAINT "Subscription_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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
21 changes: 21 additions & 0 deletions
21
apps/recnet-api/src/modules/announcement/announcement.transform.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,21 @@ | ||
import { Announcement as DbAnnouncement } from "@recnet-api/database/repository/announcement.repository.type"; | ||
import { transformUserPreview } from "@recnet-api/modules/user/user.transformer"; | ||
|
||
import { Announcement } from "./entities/announcement.entity"; | ||
|
||
export const transformAnnouncement = ( | ||
dbAnnouncement: DbAnnouncement | ||
): Announcement => { | ||
const { createdBy } = dbAnnouncement; | ||
const createdByUserPreview = transformUserPreview(createdBy); | ||
return { | ||
id: dbAnnouncement.id, | ||
title: dbAnnouncement.title, | ||
content: dbAnnouncement.content, | ||
startAt: dbAnnouncement.startAt, | ||
endAt: dbAnnouncement.endAt, | ||
isActivated: dbAnnouncement.isActivated, | ||
allowClose: dbAnnouncement.allowClose, | ||
createdBy: createdByUserPreview, | ||
}; | ||
}; |
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.