-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rooms): add room report endpoints (#14)
- Loading branch information
Showing
20 changed files
with
598 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TYPE "public"."room_report_reason" AS ENUM('WRONG_DESCRIPTION', 'WRONG_LOCATION', 'NOT_EXISTING', 'MISSING', 'OTHER');--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "room_reports" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"room" text NOT NULL, | ||
"reason" "room_report_reason" NOT NULL, | ||
"description" text NOT NULL, | ||
"created_at" timestamp with time zone NOT NULL, | ||
"resolved_at" timestamp with time zone | ||
); |
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,320 @@ | ||
{ | ||
"id": "b85d110e-f795-46a3-8090-99928653875b", | ||
"prevId": "6ba274fb-ed5a-49b7-9f98-ac5a167cbf68", | ||
"version": "7", | ||
"dialect": "postgresql", | ||
"tables": { | ||
"public.app_announcements": { | ||
"name": "app_announcements", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"title_de": { | ||
"name": "title_de", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"title_en": { | ||
"name": "title_en", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description_de": { | ||
"name": "description_de", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description_en": { | ||
"name": "description_en", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"start_date_time": { | ||
"name": "start_date_time", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"end_date_time": { | ||
"name": "end_date_time", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"priority": { | ||
"name": "priority", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"url": { | ||
"name": "url", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
}, | ||
"public.room_reports": { | ||
"name": "room_reports", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"room": { | ||
"name": "room", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"reason": { | ||
"name": "reason", | ||
"type": "room_report_reason", | ||
"typeSchema": "public", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description": { | ||
"name": "description", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"resolved_at": { | ||
"name": "resolved_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
}, | ||
"public.university_sports": { | ||
"name": "university_sports", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"title_de": { | ||
"name": "title_de", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description_de": { | ||
"name": "description_de", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"title_en": { | ||
"name": "title_en", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description_en": { | ||
"name": "description_en", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"campus": { | ||
"name": "campus", | ||
"type": "campus", | ||
"typeSchema": "public", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"location": { | ||
"name": "location", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"weekday": { | ||
"name": "weekday", | ||
"type": "weekday", | ||
"typeSchema": "public", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"start_time": { | ||
"name": "start_time", | ||
"type": "time", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"end_time": { | ||
"name": "end_time", | ||
"type": "time", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"requires_registration": { | ||
"name": "requires_registration", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"invitation_link": { | ||
"name": "invitation_link", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"e_mail": { | ||
"name": "e_mail", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"sports_category": { | ||
"name": "sports_category", | ||
"type": "sports_category", | ||
"typeSchema": "public", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {}, | ||
"checkConstraints": {} | ||
} | ||
}, | ||
"enums": { | ||
"public.room_report_reason": { | ||
"name": "room_report_reason", | ||
"schema": "public", | ||
"values": [ | ||
"WRONG_DESCRIPTION", | ||
"WRONG_LOCATION", | ||
"NOT_EXISTING", | ||
"MISSING", | ||
"OTHER" | ||
] | ||
}, | ||
"public.campus": { | ||
"name": "campus", | ||
"schema": "public", | ||
"values": ["Ingolstadt", "Neuburg"] | ||
}, | ||
"public.sports_category": { | ||
"name": "sports_category", | ||
"schema": "public", | ||
"values": [ | ||
"Basketball", | ||
"Soccer", | ||
"Calisthenics", | ||
"Dancing", | ||
"StrengthTraining", | ||
"Running", | ||
"Jogging", | ||
"Handball", | ||
"Frisbee", | ||
"Volleyball", | ||
"Spikeball", | ||
"FullBodyWorkout", | ||
"Defense", | ||
"Yoga", | ||
"Meditation", | ||
"Tennis", | ||
"Badminton", | ||
"Swimming", | ||
"Waterpolo", | ||
"Cycling", | ||
"Climbing", | ||
"Boxing", | ||
"Kickboxing", | ||
"MartialArts", | ||
"TableTennis", | ||
"Rowing", | ||
"Baseball", | ||
"Skateboarding", | ||
"Parkour", | ||
"Hockey", | ||
"Hiking", | ||
"Other" | ||
] | ||
}, | ||
"public.weekday": { | ||
"name": "weekday", | ||
"schema": "public", | ||
"values": [ | ||
"Monday", | ||
"Tuesday", | ||
"Wednesday", | ||
"Thursday", | ||
"Friday", | ||
"Saturday", | ||
"Sunday" | ||
] | ||
} | ||
}, | ||
"schemas": {}, | ||
"sequences": {}, | ||
"views": {}, | ||
"_meta": { | ||
"columns": {}, | ||
"schemas": {}, | ||
"tables": {} | ||
} | ||
} |
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,9 @@ | ||
import * as appAnnouncements from '@/db/schema/appAnnouncements' | ||
import * as roomReports from '@/db/schema/roomReports' | ||
import * as universitySports from '@/db/schema/universitySports' | ||
|
||
export default { ...appAnnouncements, ...universitySports } | ||
export default { | ||
...appAnnouncements, | ||
...universitySports, | ||
...roomReports, | ||
} |
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,18 @@ | ||
import { pgEnum, pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core' | ||
|
||
export const roomReportReason = pgEnum('room_report_reason', [ | ||
'WRONG_DESCRIPTION', | ||
'WRONG_LOCATION', | ||
'NOT_EXISTING', | ||
'MISSING', | ||
'OTHER', | ||
]) | ||
|
||
export const roomReports = pgTable('room_reports', { | ||
id: serial('id').primaryKey(), | ||
room: text('room').notNull(), | ||
reason: roomReportReason('reason').notNull(), | ||
description: text('description').notNull(), | ||
created_at: timestamp('created_at', { withTimezone: true }).notNull(), | ||
resolved_at: timestamp('resolved_at', { withTimezone: true }), | ||
}) |
Oops, something went wrong.