Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portal new design #435

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 12 additions & 0 deletions backend/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { Sequelize } = require('sequelize')
const sequelize = new Sequelize('BrainPortal', 'sa', 'B1Admin', {
host: 'localhost',
dialect: 'mssql',
dialectOptions: {
options: {
encrypt: true,
trustServerCertificate: true,
},
},
})
module.exports = sequelize
19 changes: 19 additions & 0 deletions backend/models/Client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Client = sequelize.define('Client', {
name: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull: false,
},
phone: {
type: DataTypes.STRING,
allowNull: false,
},
});

module.exports = Client;
45 changes: 45 additions & 0 deletions backend/models/Connection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Connection = sequelize.define('Connection', {
type: {
type: DataTypes.STRING,
allowNull: false,
},
address: {
type: DataTypes.STRING,
allowNull: false,
},
username: {
type: DataTypes.STRING,
allowNull: false,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
notes: {
type: DataTypes.TEXT,
allowNull: true,
},
clientId: {
type: DataTypes.INTEGER,
references: {
model: 'Clients',
key: 'id',
},
},
type2: {
type: DataTypes.TEXT,
allowNull: true,
},
clientId2: {
type: DataTypes.INTEGER,
references: {
model: 'Clients',
key: 'id',
},
},
});

module.exports = Connection;
26 changes: 26 additions & 0 deletions backend/models/Contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Contact = sequelize.define('Contact', {
name: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull: false,
},
phone: {
type: DataTypes.STRING,
allowNull: false,
},
clientId: {
type: DataTypes.INTEGER,
references: {
model: 'Clients',
key: 'id',
},
}
});

module.exports = Contact;
46 changes: 46 additions & 0 deletions backend/models/Project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Project = sequelize.define('Project', {
projectNumber: {
type: DataTypes.STRING,
allowNull: false,
},
clientName: {
type: DataTypes.STRING,
allowNull: false,
},
projectName: {
type: DataTypes.STRING,
allowNull: false,
},
projectType: {
type: DataTypes.STRING,
allowNull: false,
},
isFrozen: {
type: DataTypes.BOOLEAN,
allowNull: false,
},
budget: {
type: DataTypes.FLOAT,
allowNull: false,
},
remainingBudget: {
type: DataTypes.FLOAT,
allowNull: true,
},
notes: {
type: DataTypes.TEXT,
allowNull: true,
},
clientId: {
type: DataTypes.INTEGER,
references: {
model: 'Clients',
key: 'id',
},
}
}); // <-- Correct closing parenthesis here

module.exports = Project;
50 changes: 50 additions & 0 deletions backend/models/Task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const { DataTypes } = require('sequelize');
const sequelize = require('../db');

const Task = sequelize.define('Task', {
taskNumber: {
type: DataTypes.STRING,
allowNull: false,
},
clientName: {
type: DataTypes.STRING,
allowNull: false,
},
contactName: {
type: DataTypes.STRING,
allowNull: false,
},
projectName: {
type: DataTypes.STRING,
allowNull: false,
},
taskSubject: {
type: DataTypes.STRING,
allowNull: false,
},
approvedHours: {
type: DataTypes.FLOAT,
allowNull: false,
},
priority: {
type: DataTypes.STRING,
allowNull: false,
},
taskDescription: {
type: DataTypes.TEXT,
allowNull: true,
},
attachedFiles: {
type: DataTypes.STRING,
allowNull: true,
},
clientId: {
type: DataTypes.INTEGER,
references: {
model: 'Clients',
key: 'id',
},
}
});

module.exports = Task;
26 changes: 26 additions & 0 deletions backend/models/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// server.js

const { Sequelize, DataTypes } = require('sequelize');
const sequelize = require('../db');

const User = sequelize.define('User', {
name: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull: false,
},
role: {
type: DataTypes.STRING,
allowNull: false,
},
country: {
type: DataTypes.STRING,
allowNull: false,
},
})


module.exports = User;
16 changes: 16 additions & 0 deletions backend/node_modules/.bin/is-docker

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

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/is-docker.cmd

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

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/is-docker.ps1

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

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/mime

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

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mime.cmd

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

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/mime.ps1

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

16 changes: 16 additions & 0 deletions backend/node_modules/.bin/mssql

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

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mssql.cmd

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

Loading