# Event Join

## feat
- Join event
- kontribusi event
- histoty in progress
### No Issue
This commit is contained in:
2024-01-29 22:03:27 +08:00
parent bec87028fd
commit ca9214d9e0
109 changed files with 2932 additions and 515 deletions

View File

@@ -0,0 +1,20 @@
import { AdminEvent_Main } from "@/app_modules/admin/event";
import AdminEvent_funCountByStatusId from "@/app_modules/admin/event/fun/count/fun_count_event_by_status_id";
export default async function Page() {
const countPublish = await AdminEvent_funCountByStatusId("1");
const countReview = await AdminEvent_funCountByStatusId("2");
const countDraft = await AdminEvent_funCountByStatusId("3");
const countReject = await AdminEvent_funCountByStatusId("4");
return (
<>
<AdminEvent_Main
countPublish={countPublish as number}
countReview={countReview as number}
countDraft={countDraft as number}
countReject={countReject as number}
/>
</>
);
}

View File

@@ -0,0 +1,12 @@
import { AdminEvent_TablePublish } from "@/app_modules/admin/event";
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
export default async function Page() {
const listPublish = await AdminEvent_getListTableByStatusId("1");
return (
<>
<AdminEvent_TablePublish listPublish={listPublish as any} />
</>
);
}

View File

@@ -0,0 +1,10 @@
import { AdminEvent_TableReject } from "@/app_modules/admin/event";
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
export default async function Page() {
const listReject = await AdminEvent_getListTableByStatusId("4")
return <>
<AdminEvent_TableReject listReject={listReject as any}/>
</>
}

View File

@@ -0,0 +1,10 @@
import { AdminEvent_TableReview } from "@/app_modules/admin/event";
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
export default async function Page() {
const listReview = await AdminEvent_getListTableByStatusId("2")
return <>
<AdminEvent_TableReview listReview={listReview as any}/>
</>
}

View File

@@ -1,9 +1,11 @@
import { Event_Create } from "@/app_modules/event";
import { Event_getListUser } from "@/app_modules/event/fun/get/get_list_user";
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
import _ from "lodash";
export default async function Page() {
const listUser = await Event_getListUser();
const userId = await User_getUserId()
const listTipeAcara = await Event_getMasterTipeAcara();
return <Event_Create listUser={listUser as any} />;
return <Event_Create listTipeAcara={listTipeAcara as any} authorId={userId}/>;
}

View File

@@ -1,11 +1,16 @@
import { LayoutEvent_DetailDraft } from "@/app_modules/event";
import React from "react";
export default async function Page({
children,
params,
}: {
children: React.ReactNode;
params: { id: string };
}) {
return <LayoutEvent_DetailDraft>{children}</LayoutEvent_DetailDraft>;
let eventId = params.id
return <>
<LayoutEvent_DetailDraft eventId={eventId}>{children}</LayoutEvent_DetailDraft>;
</>
}

View File

@@ -0,0 +1,8 @@
import { Event_DetailDraft } from "@/app_modules/event";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let eventId = params.id
const dataEvent = await Event_getOneById(eventId)
return <Event_DetailDraft dataEvent={dataEvent as any} />;
}

View File

@@ -1,5 +0,0 @@
import { Event_DetailDraft } from "@/app_modules/event";
export default async function Page() {
return <Event_DetailDraft />;
}

View File

@@ -0,0 +1,20 @@
import { Event_DetailKontribusi } from "@/app_modules/event";
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const dataEvent = await Event_getOneById(eventId);
const listKontributor = await Event_getListPesertaById(eventId);
const totalPeserta = await Event_countTotalPesertaById(eventId)
return (
<>
<Event_DetailKontribusi
dataEvent={dataEvent as any}
listKontributor={listKontributor as any}
totalPeserta={totalPeserta}
/>
</>
);
}

View File

@@ -1,9 +0,0 @@
import { Event_DetailKontribusi } from "@/app_modules/event";
export default async function Page() {
return (
<>
<Event_DetailKontribusi />
</>
);
}

View File

@@ -0,0 +1,27 @@
import { Event_DetailMain } from "@/app_modules/event";
import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id";
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const dataEvent = await Event_getOneById(eventId);
const listPeserta = await Event_getListPesertaById(eventId);
const userLoginId = await User_getUserId();
const isJoin = await Event_CekUserJoinById(eventId, userLoginId);
const totalPeserta = await Event_countTotalPesertaById(eventId)
return (
<>
<Event_DetailMain
dataEvent={dataEvent as any}
listPeserta={listPeserta as any}
userLoginId={userLoginId}
isJoin={isJoin}
totalPeserta={totalPeserta as any}
/>
</>
);
}

View File

@@ -1,7 +0,0 @@
import { Event_DetailMain } from "@/app_modules/event";
export default async function Page() {
return <>
<Event_DetailMain/>
</>
}

View File

@@ -0,0 +1,9 @@
import { Event_DetailPublish } from "@/app_modules/event";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const dataEvent = await Event_getOneById(eventId);
return <Event_DetailPublish dataEvent={dataEvent as any} />;
}

View File

@@ -1,5 +0,0 @@
import { Event_DetailPublish } from "@/app_modules/event";
export default async function Page() {
return <Event_DetailPublish />;
}

View File

@@ -0,0 +1,9 @@
import { Event_DetailReject } from "@/app_modules/event";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let eventId = params.id
const dataEvent = await Event_getOneById(eventId)
return <Event_DetailReject dataEvent={dataEvent as any}/>;
}

View File

@@ -1,5 +0,0 @@
import { Event_DetailReject } from "@/app_modules/event";
export default async function Page() {
return <Event_DetailReject />;
}

View File

@@ -0,0 +1,10 @@
import { Event_DetailReview } from "@/app_modules/event";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let eventId = params.id
const dataEvent = await Event_getOneById(eventId)
return <Event_DetailReview dataEvent={dataEvent as any}/>;
}

View File

@@ -1,6 +0,0 @@
import { Event_DetailReview } from "@/app_modules/event";
export default async function Page() {
return <Event_DetailReview />;
}

View File

@@ -0,0 +1,27 @@
import { Event_Edit } from "@/app_modules/event";
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
import _ from "lodash";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
const data = await Event_getOneById(eventId);
const dataEvent = _.omit(data, [
"Author",
"EventMaster_Status",
"Event_Peserta",
"createdAt",
"updatedAt",
"active",
]);
// console.log(dataEvent)
const listTipeAcara = await Event_getMasterTipeAcara()
return (
<>
<Event_Edit dataEvent={dataEvent as any} listTipeAcara={listTipeAcara as any}/>
</>
);
}

View File

@@ -1,7 +0,0 @@
import { Event_Edit } from "@/app_modules/event";
export default async function Page() {
return<>
<Event_Edit/>
</>
}

View File

@@ -1,11 +1,12 @@
"use client";
import { Event_Beranda } from "@/app_modules/event";
import { Event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish";
export default async function Page() {
const dataEvent = await Event_getListAllPublish()
export default function Page() {
return (
<>
<Event_Beranda />
<Event_Beranda dataEvent={dataEvent as any}/>
</>
);
}

View File

@@ -0,0 +1,7 @@
import { Event_History } from "@/app_modules/event";
export default async function Page({ params }: { params: { id: string } }) {
let eventId = params.id;
console.log(eventId);
return <Event_History />;
}

View File

@@ -1,8 +1,14 @@
import { Event_Kontribusi } from "@/app_modules/event";
import { Event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
export default async function Page() {
return<>
<Event_Kontribusi/>
const userLoginId = await User_getUserId();
const listKontribusi = await Event_getListKontibusiByUserId(userLoginId)
return (
<>
<Event_Kontribusi listKontribusi={listKontribusi as any}/>
</>
}
);
}

View File

@@ -1,5 +1,20 @@
import { Event_StatusPage } from "@/app_modules/event";
import { Event_getByStatusId } from "@/app_modules/event/fun/get/get_event_by_status_id";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
export default async function Page() {
return <Event_StatusPage/>
}
const authorId = await User_getUserId();
const listPublish = await Event_getByStatusId("1", authorId);
const listReview = await Event_getByStatusId("2", authorId);
const listDraft = await Event_getByStatusId("3", authorId);
const listReject = await Event_getByStatusId("4", authorId);
return (
<Event_StatusPage
listPublish={listPublish}
listReview={listReview}
listDraft={listDraft}
listReject={listReject}
/>
);
}