Updated via schema editor on 2025-06-20 14:45
This commit is contained in:
parent
805c769b1a
commit
1d6237de08
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
*/node_modules/
|
*/node_modules/
|
||||||
*/build/
|
*/build/
|
||||||
|
|
||||||
|
**/node_modules/
|
||||||
|
**/build/
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
File diff suppressed because one or more lines are too long
36
backend/src/db/migrations/1750430495894.js
Normal file
36
backend/src/db/migrations/1750430495894.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
module.exports = {
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async up(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async down(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -19,11 +19,11 @@ const CustomersData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
PhoneNumber: 'Albert Einstein',
|
PhoneNumber: 'Francis Galton',
|
||||||
|
|
||||||
InvoicingEmail: 'Comte de Buffon',
|
InvoicingEmail: 'Hans Bethe',
|
||||||
|
|
||||||
Address: 'Antoine Laurent Lavoisier',
|
Address: 'John Dalton',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -33,11 +33,11 @@ const CustomersData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
PhoneNumber: 'Arthur Eddington',
|
PhoneNumber: 'Carl Linnaeus',
|
||||||
|
|
||||||
InvoicingEmail: 'Emil Kraepelin',
|
InvoicingEmail: 'Euclid',
|
||||||
|
|
||||||
Address: 'Sigmund Freud',
|
Address: 'Hermann von Helmholtz',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -47,11 +47,39 @@ const CustomersData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
PhoneNumber: 'George Gaylord Simpson',
|
PhoneNumber: 'Jonas Salk',
|
||||||
|
|
||||||
InvoicingEmail: 'Charles Lyell',
|
InvoicingEmail: 'Gertrude Belle Elion',
|
||||||
|
|
||||||
Address: 'Hermann von Helmholtz',
|
Address: 'Franz Boas',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Umbrella Corp',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
PhoneNumber: 'Erwin Schrodinger',
|
||||||
|
|
||||||
|
InvoicingEmail: 'Max Delbruck',
|
||||||
|
|
||||||
|
Address: 'Karl Landsteiner',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Hooli',
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
PhoneNumber: 'Ludwig Boltzmann',
|
||||||
|
|
||||||
|
InvoicingEmail: 'Anton van Leeuwenhoek',
|
||||||
|
|
||||||
|
Address: 'Edward Teller',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -69,17 +97,17 @@ const ProjectsData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
DevelopmentCost: 68.78,
|
DevelopmentCost: 28.78,
|
||||||
|
|
||||||
MaintenanceCost: 70.05,
|
MaintenanceCost: 84.45,
|
||||||
|
|
||||||
ExpenseCost: 'B. F. Skinner',
|
ExpenseCost: 'Comte de Buffon',
|
||||||
|
|
||||||
Profits: 82.01,
|
Profits: 28.31,
|
||||||
|
|
||||||
StartDate: new Date(Date.now()),
|
StartDate: new Date(Date.now()),
|
||||||
|
|
||||||
EndDate: 'Max Planck',
|
EndDate: 'Lynn Margulis',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -95,17 +123,17 @@ const ProjectsData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
DevelopmentCost: 68.69,
|
DevelopmentCost: 30.77,
|
||||||
|
|
||||||
MaintenanceCost: 90.16,
|
MaintenanceCost: 86.18,
|
||||||
|
|
||||||
ExpenseCost: 'Albrecht von Haller',
|
ExpenseCost: 'Marie Curie',
|
||||||
|
|
||||||
Profits: 63.75,
|
Profits: 62.16,
|
||||||
|
|
||||||
StartDate: new Date(Date.now()),
|
StartDate: new Date(Date.now()),
|
||||||
|
|
||||||
EndDate: 'Lynn Margulis',
|
EndDate: 'Pierre Simon de Laplace',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -121,25 +149,77 @@ const ProjectsData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
DevelopmentCost: 78.44,
|
DevelopmentCost: 64.96,
|
||||||
|
|
||||||
MaintenanceCost: 25.18,
|
MaintenanceCost: 79.67,
|
||||||
|
|
||||||
ExpenseCost: 'Jean Baptiste Lamarck',
|
ExpenseCost: 'Max Planck',
|
||||||
|
|
||||||
Profits: 51.98,
|
Profits: 56.37,
|
||||||
|
|
||||||
|
StartDate: new Date(Date.now()),
|
||||||
|
|
||||||
|
EndDate: 'Lucretius',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Project Delta',
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
budget: 150000,
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
DevelopmentCost: 90.49,
|
||||||
|
|
||||||
|
MaintenanceCost: 32.89,
|
||||||
|
|
||||||
|
ExpenseCost: 'James Watson',
|
||||||
|
|
||||||
|
Profits: 20.72,
|
||||||
|
|
||||||
StartDate: new Date(Date.now()),
|
StartDate: new Date(Date.now()),
|
||||||
|
|
||||||
EndDate: 'Edwin Hubble',
|
EndDate: 'Edwin Hubble',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Project Epsilon',
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_many" field
|
||||||
|
|
||||||
|
budget: 200000,
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
DevelopmentCost: 78.95,
|
||||||
|
|
||||||
|
MaintenanceCost: 88.86,
|
||||||
|
|
||||||
|
ExpenseCost: 'Ernst Haeckel',
|
||||||
|
|
||||||
|
Profits: 66.52,
|
||||||
|
|
||||||
|
StartDate: new Date(Date.now()),
|
||||||
|
|
||||||
|
EndDate: 'Charles Darwin',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const TasksData = [
|
const TasksData = [
|
||||||
{
|
{
|
||||||
title: 'Design Phase',
|
title: 'Design Phase',
|
||||||
|
|
||||||
status: 'InProgress',
|
status: 'Completed',
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
@ -151,25 +231,25 @@ const TasksData = [
|
|||||||
|
|
||||||
TaskType: 'User Story',
|
TaskType: 'User Story',
|
||||||
|
|
||||||
EpicEstimatedCost: 78.27,
|
EpicEstimatedCost: 69.74,
|
||||||
|
|
||||||
EpicActualCost: 82.44,
|
EpicActualCost: 15.68,
|
||||||
|
|
||||||
EpicEstimatedTime: 3,
|
EpicEstimatedTime: 2,
|
||||||
|
|
||||||
EpicCostVariance: 80.45,
|
EpicCostVariance: 48.99,
|
||||||
|
|
||||||
EpicActualTime: 7,
|
EpicActualTime: 7,
|
||||||
|
|
||||||
EpicVarianceTime: 2,
|
EpicVarianceTime: 7,
|
||||||
|
|
||||||
EpicCompletionRate: 'William Harvey',
|
EpicCompletionRate: 'Joseph J. Thomson',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: 'Development Phase',
|
title: 'Development Phase',
|
||||||
|
|
||||||
status: 'InProgress',
|
status: 'Completed',
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
@ -179,27 +259,27 @@ const TasksData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
TaskType: 'Feature',
|
TaskType: 'User Story',
|
||||||
|
|
||||||
EpicEstimatedCost: 26.45,
|
EpicEstimatedCost: 72.24,
|
||||||
|
|
||||||
EpicActualCost: 82.28,
|
EpicActualCost: 31.96,
|
||||||
|
|
||||||
EpicEstimatedTime: 8,
|
EpicEstimatedTime: 5,
|
||||||
|
|
||||||
EpicCostVariance: 95.76,
|
EpicCostVariance: 31.11,
|
||||||
|
|
||||||
EpicActualTime: 4,
|
EpicActualTime: 9,
|
||||||
|
|
||||||
EpicVarianceTime: 1,
|
EpicVarianceTime: 7,
|
||||||
|
|
||||||
EpicCompletionRate: 'Sigmund Freud',
|
EpicCompletionRate: 'Wilhelm Wundt',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: 'Testing Phase',
|
title: 'Testing Phase',
|
||||||
|
|
||||||
status: 'NotStarted',
|
status: 'Completed',
|
||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
@ -209,21 +289,81 @@ const TasksData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
TaskType: 'Feature',
|
TaskType: 'User Story',
|
||||||
|
|
||||||
EpicEstimatedCost: 24.21,
|
EpicEstimatedCost: 52.63,
|
||||||
|
|
||||||
EpicActualCost: 92.46,
|
EpicActualCost: 70.55,
|
||||||
|
|
||||||
EpicEstimatedTime: 7,
|
EpicEstimatedTime: 7,
|
||||||
|
|
||||||
EpicCostVariance: 55.98,
|
EpicCostVariance: 11.14,
|
||||||
|
|
||||||
EpicActualTime: 9,
|
EpicActualTime: 7,
|
||||||
|
|
||||||
EpicVarianceTime: 3,
|
EpicVarianceTime: 5,
|
||||||
|
|
||||||
EpicCompletionRate: 'Alfred Wegener',
|
EpicCompletionRate: 'Johannes Kepler',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: 'Deployment Phase',
|
||||||
|
|
||||||
|
status: 'Completed',
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
start_date: new Date('2024-01-01T09:00:00Z'),
|
||||||
|
|
||||||
|
end_date: new Date('2024-01-15T17:00:00Z'),
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
TaskType: 'Epic',
|
||||||
|
|
||||||
|
EpicEstimatedCost: 76.17,
|
||||||
|
|
||||||
|
EpicActualCost: 17.91,
|
||||||
|
|
||||||
|
EpicEstimatedTime: 5,
|
||||||
|
|
||||||
|
EpicCostVariance: 78.78,
|
||||||
|
|
||||||
|
EpicActualTime: 6,
|
||||||
|
|
||||||
|
EpicVarianceTime: 9,
|
||||||
|
|
||||||
|
EpicCompletionRate: 'John Bardeen',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: 'Requirement Gathering',
|
||||||
|
|
||||||
|
status: 'Completed',
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
start_date: new Date('2023-10-01T09:00:00Z'),
|
||||||
|
|
||||||
|
end_date: new Date('2023-10-15T17:00:00Z'),
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
TaskType: 'Epic',
|
||||||
|
|
||||||
|
EpicEstimatedCost: 62.61,
|
||||||
|
|
||||||
|
EpicActualCost: 79.85,
|
||||||
|
|
||||||
|
EpicEstimatedTime: 3,
|
||||||
|
|
||||||
|
EpicCostVariance: 33.23,
|
||||||
|
|
||||||
|
EpicActualTime: 1,
|
||||||
|
|
||||||
|
EpicVarianceTime: 8,
|
||||||
|
|
||||||
|
EpicCompletionRate: 'Alfred Kinsey',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -263,6 +403,30 @@ const TimesheetsData = [
|
|||||||
|
|
||||||
// type code here for "relation_one" field
|
// type code here for "relation_one" field
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
hours: 5,
|
||||||
|
|
||||||
|
date: new Date('2023-11-04T09:00:00Z'),
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
|
||||||
|
hours: 9,
|
||||||
|
|
||||||
|
date: new Date('2023-11-05T09:00:00Z'),
|
||||||
|
|
||||||
|
// type code here for "relation_one" field
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const OrganizationsData = [
|
const OrganizationsData = [
|
||||||
@ -277,6 +441,14 @@ const OrganizationsData = [
|
|||||||
{
|
{
|
||||||
name: 'Blue Sky Enterprises',
|
name: 'Blue Sky Enterprises',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Future Tech',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'Creative Minds',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// Similar logic for "relation_many"
|
// Similar logic for "relation_many"
|
||||||
@ -314,6 +486,28 @@ async function associateUserWithOrganization() {
|
|||||||
if (User2?.setOrganization) {
|
if (User2?.setOrganization) {
|
||||||
await User2.setOrganization(relatedOrganization2);
|
await User2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const User3 = await Users.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (User3?.setOrganization) {
|
||||||
|
await User3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const User4 = await Users.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (User4?.setOrganization) {
|
||||||
|
await User4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar logic for "relation_many"
|
// Similar logic for "relation_many"
|
||||||
@ -351,6 +545,28 @@ async function associateCustomerWithOrganization() {
|
|||||||
if (Customer2?.setOrganization) {
|
if (Customer2?.setOrganization) {
|
||||||
await Customer2.setOrganization(relatedOrganization2);
|
await Customer2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Customer3 = await Customers.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Customer3?.setOrganization) {
|
||||||
|
await Customer3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Customer4 = await Customers.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Customer4?.setOrganization) {
|
||||||
|
await Customer4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateProjectWithCustomer() {
|
async function associateProjectWithCustomer() {
|
||||||
@ -386,6 +602,28 @@ async function associateProjectWithCustomer() {
|
|||||||
if (Project2?.setCustomer) {
|
if (Project2?.setCustomer) {
|
||||||
await Project2.setCustomer(relatedCustomer2);
|
await Project2.setCustomer(relatedCustomer2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedCustomer3 = await Customers.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
||||||
|
});
|
||||||
|
const Project3 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Project3?.setCustomer) {
|
||||||
|
await Project3.setCustomer(relatedCustomer3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedCustomer4 = await Customers.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
||||||
|
});
|
||||||
|
const Project4 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Project4?.setCustomer) {
|
||||||
|
await Project4.setCustomer(relatedCustomer4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar logic for "relation_many"
|
// Similar logic for "relation_many"
|
||||||
@ -423,6 +661,28 @@ async function associateProjectWithOrganization() {
|
|||||||
if (Project2?.setOrganization) {
|
if (Project2?.setOrganization) {
|
||||||
await Project2.setOrganization(relatedOrganization2);
|
await Project2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Project3 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Project3?.setOrganization) {
|
||||||
|
await Project3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Project4 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Project4?.setOrganization) {
|
||||||
|
await Project4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateProjectWithOrganization() {
|
async function associateProjectWithOrganization() {
|
||||||
@ -458,6 +718,28 @@ async function associateProjectWithOrganization() {
|
|||||||
if (Project2?.setOrganization) {
|
if (Project2?.setOrganization) {
|
||||||
await Project2.setOrganization(relatedOrganization2);
|
await Project2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Project3 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Project3?.setOrganization) {
|
||||||
|
await Project3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Project4 = await Projects.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Project4?.setOrganization) {
|
||||||
|
await Project4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateTaskWithProject() {
|
async function associateTaskWithProject() {
|
||||||
@ -493,6 +775,28 @@ async function associateTaskWithProject() {
|
|||||||
if (Task2?.setProject) {
|
if (Task2?.setProject) {
|
||||||
await Task2.setProject(relatedProject2);
|
await Task2.setProject(relatedProject2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedProject3 = await Projects.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Projects.count())),
|
||||||
|
});
|
||||||
|
const Task3 = await Tasks.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Task3?.setProject) {
|
||||||
|
await Task3.setProject(relatedProject3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedProject4 = await Projects.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Projects.count())),
|
||||||
|
});
|
||||||
|
const Task4 = await Tasks.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Task4?.setProject) {
|
||||||
|
await Task4.setProject(relatedProject4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateTaskWithOrganization() {
|
async function associateTaskWithOrganization() {
|
||||||
@ -528,6 +832,28 @@ async function associateTaskWithOrganization() {
|
|||||||
if (Task2?.setOrganization) {
|
if (Task2?.setOrganization) {
|
||||||
await Task2.setOrganization(relatedOrganization2);
|
await Task2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Task3 = await Tasks.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Task3?.setOrganization) {
|
||||||
|
await Task3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Task4 = await Tasks.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Task4?.setOrganization) {
|
||||||
|
await Task4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateTimesheetWithUser() {
|
async function associateTimesheetWithUser() {
|
||||||
@ -563,6 +889,28 @@ async function associateTimesheetWithUser() {
|
|||||||
if (Timesheet2?.setUser) {
|
if (Timesheet2?.setUser) {
|
||||||
await Timesheet2.setUser(relatedUser2);
|
await Timesheet2.setUser(relatedUser2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedUser3 = await Users.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Users.count())),
|
||||||
|
});
|
||||||
|
const Timesheet3 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Timesheet3?.setUser) {
|
||||||
|
await Timesheet3.setUser(relatedUser3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedUser4 = await Users.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Users.count())),
|
||||||
|
});
|
||||||
|
const Timesheet4 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Timesheet4?.setUser) {
|
||||||
|
await Timesheet4.setUser(relatedUser4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateTimesheetWithTask() {
|
async function associateTimesheetWithTask() {
|
||||||
@ -598,6 +946,28 @@ async function associateTimesheetWithTask() {
|
|||||||
if (Timesheet2?.setTask) {
|
if (Timesheet2?.setTask) {
|
||||||
await Timesheet2.setTask(relatedTask2);
|
await Timesheet2.setTask(relatedTask2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedTask3 = await Tasks.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Tasks.count())),
|
||||||
|
});
|
||||||
|
const Timesheet3 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Timesheet3?.setTask) {
|
||||||
|
await Timesheet3.setTask(relatedTask3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedTask4 = await Tasks.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Tasks.count())),
|
||||||
|
});
|
||||||
|
const Timesheet4 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Timesheet4?.setTask) {
|
||||||
|
await Timesheet4.setTask(relatedTask4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function associateTimesheetWithOrganization() {
|
async function associateTimesheetWithOrganization() {
|
||||||
@ -633,6 +1003,28 @@ async function associateTimesheetWithOrganization() {
|
|||||||
if (Timesheet2?.setOrganization) {
|
if (Timesheet2?.setOrganization) {
|
||||||
await Timesheet2.setOrganization(relatedOrganization2);
|
await Timesheet2.setOrganization(relatedOrganization2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relatedOrganization3 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Timesheet3 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 3,
|
||||||
|
});
|
||||||
|
if (Timesheet3?.setOrganization) {
|
||||||
|
await Timesheet3.setOrganization(relatedOrganization3);
|
||||||
|
}
|
||||||
|
|
||||||
|
const relatedOrganization4 = await Organizations.findOne({
|
||||||
|
offset: Math.floor(Math.random() * (await Organizations.count())),
|
||||||
|
});
|
||||||
|
const Timesheet4 = await Timesheets.findOne({
|
||||||
|
order: [['id', 'ASC']],
|
||||||
|
offset: 4,
|
||||||
|
});
|
||||||
|
if (Timesheet4?.setOrganization) {
|
||||||
|
await Timesheet4.setOrganization(relatedOrganization4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@ -31,9 +31,6 @@ router.use(checkCrudPermissions('customers'));
|
|||||||
* InvoicingEmail:
|
* InvoicingEmail:
|
||||||
* type: string
|
* type: string
|
||||||
* default: InvoicingEmail
|
* default: InvoicingEmail
|
||||||
* Address:
|
|
||||||
* type: string
|
|
||||||
* default: Address
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -319,7 +316,7 @@ router.get(
|
|||||||
currentUser,
|
currentUser,
|
||||||
});
|
});
|
||||||
if (filetype && filetype === 'csv') {
|
if (filetype && filetype === 'csv') {
|
||||||
const fields = ['id', 'name', 'PhoneNumber', 'InvoicingEmail', 'Address'];
|
const fields = ['id', 'name', 'PhoneNumber', 'InvoicingEmail'];
|
||||||
const opts = { fields };
|
const opts = { fields };
|
||||||
try {
|
try {
|
||||||
const csv = parse(payload.rows, opts);
|
const csv = parse(payload.rows, opts);
|
||||||
|
|||||||
@ -43,7 +43,7 @@ module.exports = class SearchService {
|
|||||||
const tableColumns = {
|
const tableColumns = {
|
||||||
users: ['firstName', 'lastName', 'phoneNumber', 'email'],
|
users: ['firstName', 'lastName', 'phoneNumber', 'email'],
|
||||||
|
|
||||||
customers: ['name', 'PhoneNumber', 'InvoicingEmail', 'Address'],
|
customers: ['name', 'PhoneNumber', 'InvoicingEmail'],
|
||||||
|
|
||||||
projects: ['name', 'ExpenseCost', 'EndDate'],
|
projects: ['name', 'ExpenseCost', 'EndDate'],
|
||||||
|
|
||||||
|
|||||||
1
frontend/json/runtimeError.json
Normal file
1
frontend/json/runtimeError.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@ -83,19 +83,6 @@ const CardCustomers = ({
|
|||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex justify-between gap-x-4 py-3'>
|
|
||||||
<dt className=' text-gray-500 dark:text-dark-600'>
|
|
||||||
Projects
|
|
||||||
</dt>
|
|
||||||
<dd className='flex items-start gap-x-2'>
|
|
||||||
<div className='font-medium line-clamp-4'>
|
|
||||||
{dataFormatter
|
|
||||||
.projectsManyListFormatter(item.projects)
|
|
||||||
.join(', ')}
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className='flex justify-between gap-x-4 py-3'>
|
<div className='flex justify-between gap-x-4 py-3'>
|
||||||
<dt className=' text-gray-500 dark:text-dark-600'>
|
<dt className=' text-gray-500 dark:text-dark-600'>
|
||||||
Phone Number
|
Phone Number
|
||||||
@ -117,17 +104,6 @@ const CardCustomers = ({
|
|||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex justify-between gap-x-4 py-3'>
|
|
||||||
<dt className=' text-gray-500 dark:text-dark-600'>
|
|
||||||
Address
|
|
||||||
</dt>
|
|
||||||
<dd className='flex items-start gap-x-2'>
|
|
||||||
<div className='font-medium line-clamp-4'>
|
|
||||||
{item.Address}
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -56,15 +56,6 @@ const ListCustomers = ({
|
|||||||
<p className={'line-clamp-2'}>{item.name}</p>
|
<p className={'line-clamp-2'}>{item.name}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'flex-1 px-3'}>
|
|
||||||
<p className={'text-xs text-gray-500 '}>Projects</p>
|
|
||||||
<p className={'line-clamp-2'}>
|
|
||||||
{dataFormatter
|
|
||||||
.projectsManyListFormatter(item.projects)
|
|
||||||
.join(', ')}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={'flex-1 px-3'}>
|
<div className={'flex-1 px-3'}>
|
||||||
<p className={'text-xs text-gray-500 '}>Phone Number</p>
|
<p className={'text-xs text-gray-500 '}>Phone Number</p>
|
||||||
<p className={'line-clamp-2'}>{item.PhoneNumber}</p>
|
<p className={'line-clamp-2'}>{item.PhoneNumber}</p>
|
||||||
@ -76,11 +67,6 @@ const ListCustomers = ({
|
|||||||
</p>
|
</p>
|
||||||
<p className={'line-clamp-2'}>{item.InvoicingEmail}</p>
|
<p className={'line-clamp-2'}>{item.InvoicingEmail}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={'flex-1 px-3'}>
|
|
||||||
<p className={'text-xs text-gray-500 '}>Address</p>
|
|
||||||
<p className={'line-clamp-2'}>{item.Address}</p>
|
|
||||||
</div>
|
|
||||||
</Link>
|
</Link>
|
||||||
<ListActionsPopover
|
<ListActionsPopover
|
||||||
onDelete={onDelete}
|
onDelete={onDelete}
|
||||||
|
|||||||
@ -50,25 +50,6 @@ export const loadColumns = async (
|
|||||||
editable: hasUpdatePermission,
|
editable: hasUpdatePermission,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
field: 'projects',
|
|
||||||
headerName: 'Projects',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
|
|
||||||
editable: false,
|
|
||||||
sortable: false,
|
|
||||||
type: 'singleSelect',
|
|
||||||
valueFormatter: ({ value }) =>
|
|
||||||
dataFormatter.projectsManyListFormatter(value).join(', '),
|
|
||||||
renderEditCell: (params) => (
|
|
||||||
<DataGridMultiSelect {...params} entityName={'projects'} />
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'PhoneNumber',
|
field: 'PhoneNumber',
|
||||||
headerName: 'Phone Number',
|
headerName: 'Phone Number',
|
||||||
@ -93,18 +74,6 @@ export const loadColumns = async (
|
|||||||
editable: hasUpdatePermission,
|
editable: hasUpdatePermission,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
field: 'Address',
|
|
||||||
headerName: 'Address',
|
|
||||||
flex: 1,
|
|
||||||
minWidth: 120,
|
|
||||||
filterable: false,
|
|
||||||
headerClassName: 'datagrid--header',
|
|
||||||
cellClassName: 'datagrid--cell',
|
|
||||||
|
|
||||||
editable: hasUpdatePermission,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'actions',
|
field: 'actions',
|
||||||
type: 'actions',
|
type: 'actions',
|
||||||
|
|||||||
@ -32,9 +32,6 @@ const CustomersTablesPage = () => {
|
|||||||
{ label: 'Name', title: 'name' },
|
{ label: 'Name', title: 'name' },
|
||||||
{ label: 'Phone Number', title: 'PhoneNumber' },
|
{ label: 'Phone Number', title: 'PhoneNumber' },
|
||||||
{ label: 'Invoicing Email', title: 'InvoicingEmail' },
|
{ label: 'Invoicing Email', title: 'InvoicingEmail' },
|
||||||
{ label: 'Address', title: 'Address' },
|
|
||||||
|
|
||||||
{ label: 'Projects', title: 'projects' },
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const hasCreatePermission =
|
const hasCreatePermission =
|
||||||
|
|||||||
@ -32,9 +32,6 @@ const CustomersTablesPage = () => {
|
|||||||
{ label: 'Name', title: 'name' },
|
{ label: 'Name', title: 'name' },
|
||||||
{ label: 'Phone Number', title: 'PhoneNumber' },
|
{ label: 'Phone Number', title: 'PhoneNumber' },
|
||||||
{ label: 'Invoicing Email', title: 'InvoicingEmail' },
|
{ label: 'Invoicing Email', title: 'InvoicingEmail' },
|
||||||
{ label: 'Address', title: 'Address' },
|
|
||||||
|
|
||||||
{ label: 'Projects', title: 'projects' },
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const hasCreatePermission =
|
const hasCreatePermission =
|
||||||
|
|||||||
@ -131,8 +131,6 @@ const OrganizationsView = () => {
|
|||||||
<th>Phone Number</th>
|
<th>Phone Number</th>
|
||||||
|
|
||||||
<th>Invoicing Email</th>
|
<th>Invoicing Email</th>
|
||||||
|
|
||||||
<th>Address</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -154,8 +152,6 @@ const OrganizationsView = () => {
|
|||||||
<td data-label='InvoicingEmail'>
|
<td data-label='InvoicingEmail'>
|
||||||
{item.InvoicingEmail}
|
{item.InvoicingEmail}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td data-label='Address'>{item.Address}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user