Skip to content

Commit

Permalink
Merge pull request #244 from Team3132/mel-suggestions
Browse files Browse the repository at this point in the history
Mel-suggestions
  • Loading branch information
sebasptsch authored Aug 5, 2023
2 parents 71be2e2 + abaca94 commit 7328406
Show file tree
Hide file tree
Showing 61 changed files with 1,040 additions and 401 deletions.
3 changes: 3 additions & 0 deletions packages/backend/drizzle/0004_next_penance.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "RSVP" ADD COLUMN "checkinTime" timestamp(3) with time zone;--> statement-breakpoint
ALTER TABLE "RSVP" ADD COLUMN "checkoutTime" timestamp(3) with time zone;--> statement-breakpoint
ALTER TABLE "RSVP" DROP COLUMN IF EXISTS "attended";
315 changes: 315 additions & 0 deletions packages/backend/drizzle/meta/0004_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
{
"version": "5",
"dialect": "pg",
"id": "ad2518d2-81ec-47a3-9fc5-9e49552c9fa2",
"prevId": "9a26111b-8ebe-43ff-afd4-e16a76dd56f4",
"tables": {
"Event": {
"name": "Event",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startDate": {
"name": "startDate",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true
},
"endDate": {
"name": "endDate",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true
},
"allDay": {
"name": "allDay",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"type": {
"name": "type",
"type": "EventTypes",
"primaryKey": false,
"notNull": true,
"default": "'Regular'"
},
"secret": {
"name": "secret",
"type": "text",
"primaryKey": false,
"notNull": true
},
"roles": {
"name": "roles",
"type": "text[]",
"primaryKey": false,
"notNull": false
},
"isSyncedEvent": {
"name": "isSyncedEvent",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {
"Event_secret_key": {
"name": "Event_secret_key",
"columns": [
"secret"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"RSVP": {
"name": "RSVP",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"eventId": {
"name": "eventId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"delay": {
"name": "delay",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"createdAt": {
"name": "createdAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"status": {
"name": "status",
"type": "RSVPStatus",
"primaryKey": false,
"notNull": false
},
"checkinTime": {
"name": "checkinTime",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": false
},
"checkoutTime": {
"name": "checkoutTime",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"RSVP_eventId_userId_key": {
"name": "RSVP_eventId_userId_key",
"columns": [
"eventId",
"userId"
],
"isUnique": true
}
},
"foreignKeys": {
"RSVP_eventId_Event_id_fk": {
"name": "RSVP_eventId_Event_id_fk",
"tableFrom": "RSVP",
"tableTo": "Event",
"columnsFrom": [
"eventId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"RSVP_userId_User_id_fk": {
"name": "RSVP_userId_User_id_fk",
"tableFrom": "RSVP",
"tableTo": "User",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"Scancode": {
"name": "Scancode",
"schema": "",
"columns": {
"code": {
"name": "code",
"type": "text",
"primaryKey": true,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"Scancode_userId_User_id_fk": {
"name": "Scancode_userId_User_id_fk",
"tableFrom": "Scancode",
"tableTo": "User",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "restrict",
"onUpdate": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"User": {
"name": "User",
"schema": "",
"columns": {
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"createdAt": {
"name": "createdAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updatedAt": {
"name": "updatedAt",
"type": "timestamp(3) with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"roles": {
"name": "roles",
"type": "text[]",
"primaryKey": false,
"notNull": false
},
"defaultStatus": {
"name": "defaultStatus",
"type": "RSVPStatus",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {
"EventTypes": {
"name": "EventTypes",
"values": {
"Social": "Social",
"Regular": "Regular",
"Outreach": "Outreach"
}
},
"RSVPStatus": {
"name": "RSVPStatus",
"values": {
"LATE": "LATE",
"MAYBE": "MAYBE",
"NO": "NO",
"YES": "YES"
}
}
},
"schemas": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
7 changes: 7 additions & 0 deletions packages/backend/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"when": 1691102994519,
"tag": "0003_spicy_amphibian",
"breakpoints": true
},
{
"idx": 4,
"version": "5",
"when": 1691158084466,
"tag": "0004_next_penance",
"breakpoints": true
}
]
}
5 changes: 4 additions & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "node --enable-source-maps dist/src/main.js --inspect",
"dev": "tsup --watch",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"migrate": "drizzle-kit generate:pg"
},
"main": "./dist/main.js",
"dependencies": {
"@discordjs/rest": "^2.0.0",
"@google-cloud/local-auth": "2.1.1",
"@nestjs/bull": "^10.0.1",
"@nestjs/cache-manager": "^2.0.1",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.0.0",
Expand All @@ -30,6 +32,7 @@
"@nestjs/swagger": "^7.0.0",
"@nestjs/websockets": "^10.0.0",
"axios": "^1.4.0",
"bull": "^4.10.4",
"cache-manager": "^5.1.4",
"cache-manager-ioredis-yet": "^1.1.0",
"cache-manager-redis-store": "^3.0.1",
Expand Down
11 changes: 11 additions & 0 deletions packages/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { OutreachModule } from './outreach/outreach.module';
import { DrizzleModule } from './drizzle/drizzle.module';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
import { BullModule } from '@nestjs/bull';

@Module({
imports: [
Expand Down Expand Up @@ -58,6 +59,16 @@ import { join } from 'path';
},
inject: [ConfigService],
}),
BullModule.forRootAsync({
useFactory: async (config: ConfigService) => ({
redis: {
host: config.getOrThrow('REDIS_HOST'),
port: config.getOrThrow('REDIS_PORT'),
db: 2,
},
}),
inject: [ConfigService],
}),
UserModule,
EventModule,
RsvpModule,
Expand Down
Loading

0 comments on commit 7328406

Please sign in to comment.