feat(project): menambahkan background_color untuk icon project

This commit is contained in:
Muhammad Zhafran Ilham
2026-06-25 21:03:34 +07:00
parent 66ba749a2e
commit d05505d596
5 changed files with 40 additions and 5 deletions
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `project` ADD COLUMN `background_color` VARCHAR(20) NOT NULL DEFAULT '#BA1A1A';
+1
View File
@@ -207,6 +207,7 @@ model Project {
id_admin Int //mentor project
slug String @unique @db.VarChar(255)
project_icon ProjectIcon @default(code)
background_color String @default("#BA1A1A") @db.VarChar(20)
project_name String @db.VarChar(255)
description String @db.Text
start_date DateTime @db.Date
+6 -5
View File
@@ -1,6 +1,7 @@
const bcrypt = require('bcrypt');
const { PrismaClient } = require('../src/generated/prisma');
const prisma = new PrismaClient();
const { getProjectBackgroundColor } = require('../src/helpers/utils/projectTheme');
// Diperlukan ketika isi databasenya masih kosong dan ingin menambahkan dummy data sebagai testing development [Rafi 08/06/2026 16:34]
async function main() {
@@ -175,19 +176,19 @@ async function main() {
// 10. Project
const proj1 = await prisma.project.create({
data: { id_admin: admin1.id, project_icon: 'code', project_name: 'Internify Platform Dev', slug: slugify('Internify Platform Dev', 'Project 1 slug'), description: 'Upgrading the core Internify platform backend and web client.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
data: { id_admin: admin1.id, project_icon: 'code', background_color: getProjectBackgroundColor('code'), project_name: 'Internify Platform Dev', slug: slugify('Internify Platform Dev', 'Project 1 slug'), description: 'Upgrading the core Internify platform backend and web client.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
});
const proj2 = await prisma.project.create({
data: { id_admin: admin2.id, project_icon: 'shield', project_name: 'Auth Gateway Module', slug: slugify('Auth Gateway Module', 'Project 2 slug'), description: 'Securing API gateway with unified OAuth2 authentication.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
data: { id_admin: admin2.id, project_icon: 'shield', background_color: getProjectBackgroundColor('shield'), project_name: 'Auth Gateway Module', slug: slugify('Auth Gateway Module', 'Project 2 slug'), description: 'Securing API gateway with unified OAuth2 authentication.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
});
const proj3 = await prisma.project.create({
data: { id_admin: admin1.id, project_icon: 'chart', project_name: 'Recruitment Analytics Dashboard', slug: slugify('Recruitment Analytics Dashboard', 'Project 3 slug'), description: 'Developing analytical charts for recruitment metrics.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
data: { id_admin: admin1.id, project_icon: 'chart', background_color: getProjectBackgroundColor('chart'), project_name: 'Recruitment Analytics Dashboard', slug: slugify('Recruitment Analytics Dashboard', 'Project 3 slug'), description: 'Developing analytical charts for recruitment metrics.', start_date: new Date('2026-07-15'), end_date: new Date('2026-10-15'), status: 'active' }
});
const proj4 = await prisma.project.create({
data: { id_admin: mentor1.id, project_icon: 'gear', project_name: 'Mentor Backend Task Management Project', slug: slugify('Mentor Backend Project', 'Project 4 slug'), description: 'Project owned by mentor for backend project and task management.', start_date: new Date('2026-07-20'), end_date: new Date('2026-10-15'), status: 'active' }
data: { id_admin: mentor1.id, project_icon: 'gear', background_color: getProjectBackgroundColor('gear'), project_name: 'Mentor Backend Task Management Project', slug: slugify('Mentor Backend Project', 'Project 4 slug'), description: 'Project owned by mentor for backend project and task management.', start_date: new Date('2026-07-20'), end_date: new Date('2026-10-15'), status: 'active' }
});
const proj5 = await prisma.project.create({
data: { id_admin: mentor2.id, project_icon: 'clipboard', project_name: 'Mentor UI UX Evaluation Project', slug: slugify('Mentor UI UX Evaluation Project', 'Project 5 slug'), description: 'Project owned by mentor for testing UI/UX mentoring workflow.', start_date: new Date('2026-07-18'), end_date: new Date('2026-10-15'), status: 'active' }
data: { id_admin: mentor2.id, project_icon: 'clipboard', background_color: getProjectBackgroundColor('clipboard'), project_name: 'Mentor UI UX Evaluation Project', slug: slugify('Mentor UI UX Evaluation Project', 'Project 5 slug'), description: 'Project owned by mentor for testing UI/UX mentoring workflow.', start_date: new Date('2026-07-18'), end_date: new Date('2026-10-15'), status: 'active' }
});
// 11. LamaranMagang