Compare commits
21 Commits
mobile-not
...
v1.5.34
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f3f27122a | |||
| d84a1d84ff | |||
| 40ba31edec | |||
| a54f8599b4 | |||
| 09825756f3 | |||
| 3552cf4f39 | |||
| d207b6feed | |||
| f1c8432fdc | |||
| 1cd4c3713e | |||
| 4307b383e3 | |||
| 0786d23336 | |||
| cb3511f973 | |||
| b4921c4e82 | |||
| a9325054eb | |||
| 819812149f | |||
| 75ba2b29ae | |||
| 54a4d15bdd | |||
| 1321f33da9 | |||
| fad0c33b9a | |||
| 565bab4998 | |||
| 7530a38c4d |
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.5.34](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.33...v1.5.34) (2026-01-09)
|
||||||
|
|
||||||
## [1.5.33](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.32...v1.5.33) (2026-01-06)
|
## [1.5.33](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.32...v1.5.33) (2026-01-06)
|
||||||
|
|
||||||
## [1.5.32](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.31...v1.5.32) (2026-01-05)
|
## [1.5.32](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.31...v1.5.32) (2026-01-05)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.5.33",
|
"version": "1.5.34",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
|
|||||||
54
src/app/api/auth/mobile-eula/route.tsx
Normal file
54
src/app/api/auth/mobile-eula/route.tsx
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import { prisma } from "@/lib";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function POST(req: Request) {
|
||||||
|
try {
|
||||||
|
const { nomor } = await req.json();
|
||||||
|
|
||||||
|
const user = await prisma.user.findUnique({
|
||||||
|
where: {
|
||||||
|
nomor: nomor,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!user)
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "User belum terdaftar",
|
||||||
|
status: 404,
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateTerms = await prisma.user.update({
|
||||||
|
where: { nomor: nomor },
|
||||||
|
data: {
|
||||||
|
termsOfServiceAccepted: true,
|
||||||
|
acceptedTermsAt: new Date(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updateTerms) {
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Gagal setujui syarat dan ketentuan",
|
||||||
|
status: 400,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Anda telah setujui syarat dan ketentuan",
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Terjadi masalah saat setujui syarat dan ketentuan",
|
||||||
|
reason: error as Error,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@ export async function POST(req: Request) {
|
|||||||
try {
|
try {
|
||||||
const codeOtp = randomOTP();
|
const codeOtp = randomOTP();
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
console.log("[Masuk API]", body);
|
|
||||||
const { nomor } = body;
|
const { nomor } = body;
|
||||||
|
|
||||||
const user = await prisma.user.findUnique({
|
const user = await prisma.user.findUnique({
|
||||||
@@ -15,9 +14,6 @@ export async function POST(req: Request) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(["cek user", user]);
|
|
||||||
console.log(["cek nomor", nomor]);
|
|
||||||
|
|
||||||
if (!user)
|
if (!user)
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
success: false,
|
success: false,
|
||||||
@@ -66,6 +62,7 @@ export async function POST(req: Request) {
|
|||||||
success: true,
|
success: true,
|
||||||
message: "Kode verifikasi terkirim",
|
message: "Kode verifikasi terkirim",
|
||||||
kodeId: createOtpId.id,
|
kodeId: createOtpId.id,
|
||||||
|
isAcceptTerms: user.termsOfServiceAccepted,
|
||||||
},
|
},
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import prisma from "@/lib/prisma";
|
import prisma from "@/lib/prisma";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { sendNotificationMobileToOneUser } from "@/lib/mobile/notification/send-notification";
|
import {
|
||||||
|
sendNotificationMobileToManyUser,
|
||||||
|
sendNotificationMobileToOneUser,
|
||||||
|
} from "@/lib/mobile/notification/send-notification";
|
||||||
import { routeUserMobile } from "@/lib/mobile/route-page-mobile";
|
import { routeUserMobile } from "@/lib/mobile/route-page-mobile";
|
||||||
|
import { NotificationMobileBodyType } from "../../../../../../../types/type-mobile-notification";
|
||||||
|
|
||||||
export { GET, PUT };
|
export { GET, PUT };
|
||||||
|
|
||||||
@@ -63,7 +67,6 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
|||||||
const status = searchParams.get("status");
|
const status = searchParams.get("status");
|
||||||
const fixStatus = _.startCase(status as string);
|
const fixStatus = _.startCase(status as string);
|
||||||
|
|
||||||
|
|
||||||
let fixData;
|
let fixData;
|
||||||
try {
|
try {
|
||||||
const checkStatus = await prisma.masterStatus.findFirst({
|
const checkStatus = await prisma.masterStatus.findFirst({
|
||||||
@@ -148,6 +151,23 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const adminUsers = await prisma.user.findMany({
|
||||||
|
where: { masterUserRoleId: "1", NOT: { id: updt.authorId as any } },
|
||||||
|
select: { id: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
await sendNotificationMobileToManyUser({
|
||||||
|
recipientIds: adminUsers.map((user) => user.id),
|
||||||
|
senderId: data.authorId,
|
||||||
|
payload: {
|
||||||
|
title: "Ada lowongan kerja baru",
|
||||||
|
body: `${updt.title}` as NotificationMobileBodyType,
|
||||||
|
type: "announcement",
|
||||||
|
deepLink: routeUserMobile.jobDetailPublised({ id: id }),
|
||||||
|
kategoriApp: "JOB",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
fixData = updt;
|
fixData = updt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
|
|||||||
include: {
|
include: {
|
||||||
Author: {
|
Author: {
|
||||||
select: {
|
select: {
|
||||||
|
id: true,
|
||||||
username: true,
|
username: true,
|
||||||
nomor: true,
|
nomor: true,
|
||||||
Profile: {
|
Profile: {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ async function POST(request: Request) {
|
|||||||
// kirim notifikasi ke semua admin untuk mengetahui ada job baru yang harus di review
|
// kirim notifikasi ke semua admin untuk mengetahui ada job baru yang harus di review
|
||||||
|
|
||||||
const adminUsers = await prisma.user.findMany({
|
const adminUsers = await prisma.user.findMany({
|
||||||
where: { masterUserRoleId: "2" },
|
where: { masterUserRoleId: "2", NOT: { id: data.authorId } },
|
||||||
select: { id: true },
|
select: { id: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ export async function sendNotificationMobileToOneUser({
|
|||||||
sentAt: new Date().toISOString(), // ✅ Simpan metadata di data
|
sentAt: new Date().toISOString(), // ✅ Simpan metadata di data
|
||||||
id: notification.id,
|
id: notification.id,
|
||||||
deepLink: payload.deepLink,
|
deepLink: payload.deepLink,
|
||||||
|
recipientId: recipientId,
|
||||||
},
|
},
|
||||||
android: {
|
android: {
|
||||||
priority: "high" as const,
|
priority: "high" as const,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const routeAdminMobile = {
|
|||||||
const routeUserMobile = {
|
const routeUserMobile = {
|
||||||
home: `/(user)/home`,
|
home: `/(user)/home`,
|
||||||
// JOB
|
// JOB
|
||||||
|
jobDetailPublised: ({ id }: { id: string }) => `/job/${id}`,
|
||||||
jobByStatus: ({ status }: { status?: StatusApp }) =>
|
jobByStatus: ({ status }: { status?: StatusApp }) =>
|
||||||
`/job/(tabs)/status?status=${status}`,
|
`/job/(tabs)/status?status=${status}`,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ export type NotificationMobilePayload = {
|
|||||||
export type NotificationMobileTitleType =
|
export type NotificationMobileTitleType =
|
||||||
| (string & { __type: "NotificationMobileTitleType" })
|
| (string & { __type: "NotificationMobileTitleType" })
|
||||||
| "Pengajuan Review"
|
| "Pengajuan Review"
|
||||||
| "Review Selesai";
|
| "Review Selesai"
|
||||||
|
// to ALL user
|
||||||
|
| "Ada lowongan kerja baru"
|
||||||
|
|
||||||
export type NotificationMobileBodyType =
|
export type NotificationMobileBodyType =
|
||||||
// USER
|
// USER
|
||||||
|
|||||||
Reference in New Issue
Block a user