Skip to content

Commit

Permalink
Changed "Group" table to "Organization" table & Refactored to Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
staldcunha committed Dec 1, 2023
1 parent 88f701f commit 56d21c7
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 1,309 deletions.
10 changes: 7 additions & 3 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "node dist/index.js"
},
"prisma": {
"seed": "node prisma/seed.js"
"seed": "ts-node prisma/seed.ts"
},
"keywords": [],
"author": "",
Expand Down
67 changes: 24 additions & 43 deletions backend/prisma/data.js → backend/prisma/data.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const { Prisma } = require('@prisma/client');
import { Prisma } from '@prisma/client'

const schools = [
export const schools = [
{
name: 'University of Calgary'
}
];

const users = [
export const users = [
{
username: 'john_doe',
firstName: 'John',
Expand Down Expand Up @@ -46,7 +46,7 @@ const users = [

];

const events = [
export const events = [
{

userId: 3,
Expand Down Expand Up @@ -76,7 +76,7 @@ const events = [
},
];

const userEventResponses = [
export const userEventResponses = [
{
userId: 1,
eventId: 1,
Expand Down Expand Up @@ -140,7 +140,7 @@ const userEventResponses = [
];


const posts = [
export const posts = [
{
userId: 3,
title: 'First Post',
Expand All @@ -155,7 +155,7 @@ const posts = [
},
];

const comments = [
export const comments = [
{
userId: 1,
postId: 1,
Expand All @@ -170,7 +170,7 @@ const comments = [
},
];

const organizations = [
export const organizations = [
{
organizationName: 'Group A',
description: 'Description for Group A.',
Expand All @@ -183,31 +183,31 @@ const organizations = [
},
];

const userGroupRoles = [
export const userOrganizationRoles = [
{
userId: 1,
groupId: 1,
organizationId: 1,
roleId: 2,
},
{
userId: 2,
groupId: 2,
organizationId: 2,
roleId: 2,
},
{
userId: 3,
groupId: 1,
organizationId: 1,
roleId: 1,
},
{
userId: 4,
groupId: 2,
organizationId: 2,
roleId: 1,
},

]

const roles = [
export const roles = [
{
roleName: 'Admin',
},
Expand All @@ -217,26 +217,26 @@ const roles = [
},
];

const groupRolePermissions = [
export const organizationRolePermissions = [
{
groupId: 1,
organizationId: 1,
roleId: 1,
permissionId: 1,
},
{
groupId: 2,
organizationId: 2,
roleId: 1,
permissionId: 1,
},
];

const permissions = [
export const permissions = [
{
permissionName: 'Founder',
},
];

const enrollments = [
export const enrollments = [
{
programId: 1,
userId: 1,
Expand All @@ -263,7 +263,7 @@ const enrollments = [

];

const programs = [
export const programs = [
{
programName: 'Computer Science',
department: 'Science Department',
Expand All @@ -286,7 +286,7 @@ const programs = [

];

const topics = [
export const topics = [
{
topicName: 'computer',
},
Expand All @@ -300,7 +300,7 @@ const topics = [
topicName: 'teacher',
},
]
const eventTags = [
export const eventTags = [
{
eventId: 1,
topicId: 3,
Expand All @@ -314,7 +314,7 @@ const eventTags = [
topicId: 4,
},
]
const postTags = [
export const postTags = [
{
postId: 1,
topicId: 2 ,
Expand All @@ -324,7 +324,7 @@ const postTags = [
topicId: 1 ,
},
]
const topicSubscriptions = [
export const topicSubscriptions = [
{
userId: 1,
topicId: 1,
Expand All @@ -345,22 +345,3 @@ const topicSubscriptions = [



module.exports = {
schools,
users,
events,
userEventResponses,
posts,
comments,
organizations,
userGroupRoles,
roles,
groupRolePermissions,
permissions,
enrollments,
programs,
topics,
eventTags,
postTags,
topicSubscriptions
};
Loading

0 comments on commit 56d21c7

Please sign in to comment.