Compare commits
30 Commits
mobile-api
...
mobile-qrc
| Author | SHA1 | Date | |
|---|---|---|---|
| 40df3a5e5b | |||
| 134f1dceff | |||
| 9a3726cbcc | |||
| 10fb0449b4 | |||
| ac6c6217b5 | |||
| cf8d62531f | |||
| 04dd7e6c11 | |||
| 9a967f0965 | |||
| 5e07dfb749 | |||
| dbb71633d4 | |||
| 27259cd86c | |||
| b1a5e50b7b | |||
| a278470dbb | |||
| b209a12315 | |||
| 9aee4e52ed | |||
| 2e2a5c2566 | |||
| ccfb361564 | |||
| 0f11fa37a5 | |||
| 5553f451e8 | |||
| 027ec4f6c5 | |||
| 8485209a75 | |||
| 29677066ef | |||
| d9e2fdaf30 | |||
| 579444c002 | |||
| 7fe5826f5c | |||
| c47decf246 | |||
| 4ef93e0509 | |||
| 3052dabbce | |||
|
|
4fc0ebf7ee | ||
|
|
577ee38220 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
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.12](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.10...v1.5.12) (2025-11-13)
|
||||||
|
|
||||||
|
## [1.5.11](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.4.45...v1.5.11) (2025-11-07)
|
||||||
|
|
||||||
|
## [1.5.10](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.9...v1.5.10) (2025-11-03)
|
||||||
|
|
||||||
|
## [1.5.9](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.8...v1.5.9) (2025-10-30)
|
||||||
|
|
||||||
|
## [1.5.8](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.7...v1.5.8) (2025-10-29)
|
||||||
|
|
||||||
|
## [1.5.7](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.6...v1.5.7) (2025-10-28)
|
||||||
|
|
||||||
## [1.5.6](https://wibugit.wibudev.com/bip/hipmi/compare/v1.5.5...v1.5.6) (2025-10-21)
|
## [1.5.6](https://wibugit.wibudev.com/bip/hipmi/compare/v1.5.5...v1.5.6) (2025-10-21)
|
||||||
|
|
||||||
## [1.5.5](https://wibugit.wibudev.com/bip/hipmi/compare/v1.5.4...v1.5.5) (2025-10-20)
|
## [1.5.5](https://wibugit.wibudev.com/bip/hipmi/compare/v1.5.4...v1.5.5) (2025-10-20)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.5.6",
|
"version": "1.5.12",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Donasi_Invoice" ADD COLUMN "masterBankId" TEXT;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "Donasi_Invoice" ADD CONSTRAINT "Donasi_Invoice_masterBankId_fkey" FOREIGN KEY ("masterBankId") REFERENCES "MasterBank"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
@@ -202,6 +202,7 @@ model MasterBank {
|
|||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
Investasi_Invoice Investasi_Invoice[]
|
Investasi_Invoice Investasi_Invoice[]
|
||||||
EventTransaksi EventTransaksi[]
|
EventTransaksi EventTransaksi[]
|
||||||
|
Donasi_Invoice Donasi_Invoice[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterStatus {
|
model MasterStatus {
|
||||||
@@ -576,7 +577,9 @@ model Donasi_Invoice {
|
|||||||
Images Images? @relation(fields: [imagesId], references: [id])
|
Images Images? @relation(fields: [imagesId], references: [id])
|
||||||
imagesId String?
|
imagesId String?
|
||||||
|
|
||||||
imageId String?
|
imageId String?
|
||||||
|
MasterBank MasterBank? @relation(fields: [masterBankId], references: [id])
|
||||||
|
masterBankId String? @default("null")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Donasi_Kabar {
|
model Donasi_Kabar {
|
||||||
|
|||||||
11
public/.well-known/apple-app-site-association
Normal file
11
public/.well-known/apple-app-site-association
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"applinks": {
|
||||||
|
"apps": [],
|
||||||
|
"details": [
|
||||||
|
{
|
||||||
|
"appID": "BMY6GT6W3D.com.anonymous.hipmi-mobile",
|
||||||
|
"paths": ["*"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
8
public/.well-known/assetlinks.json
Normal file
8
public/.well-known/assetlinks.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[{
|
||||||
|
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||||
|
"target": {
|
||||||
|
"namespace": "android_app",
|
||||||
|
"package_name": "com.bip.hipmimobileapp",
|
||||||
|
"sha256_cert_fingerprints": ["CFF8431520BFAE665025B68138774A4E64AA6338D2DF6C7D900A71F0551FFD2D"]
|
||||||
|
}
|
||||||
|
}]
|
||||||
301
public/privacy-policy.html
Normal file
301
public/privacy-policy.html
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Privacy Policy</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #333;
|
||||||
|
max-width: 900px;
|
||||||
|
margin: 40px auto;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
.last-updated {
|
||||||
|
color: #777;
|
||||||
|
font-style: italic;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
margin: 15px 0;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #0066cc;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.summary-box {
|
||||||
|
background-color: #faf8e8;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 25px 0;
|
||||||
|
}
|
||||||
|
.summary-box h3 {
|
||||||
|
margin-top: 0;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
.section-title {
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
address {
|
||||||
|
margin-top: 15px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Privacy Policy</h1>
|
||||||
|
<div class="last-updated">Last updated November 06, 2025</div>
|
||||||
|
|
||||||
|
<p>This Privacy Notice for Bali Interaktif Perkasa ("<strong>we</strong>", "<strong>us</strong>", or "<strong>our</strong>"), describes how and why we might access, collect, store, use, and/or share ("<strong>process</strong>") your personal information when you use our services ("<strong>Services</strong>"), including when you:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Download and use our mobile application (HIPMI Badung Connect), or any other application of ours that links to this Privacy Notice</li>
|
||||||
|
|
||||||
|
<li>Use HIPMI Badung Connect. HIPMI Badung Connect is an official digital platform developed to support the network of members of HIPMI (Himpunan Pengusaha Muda Indonesia – Indonesian Young Entrepreneurs Association) in Badung Regency. The app aims to strengthen collaboration, partnerships, and the business ecosystem among young entrepreneurs through a range of interactive and informative features. Key features of the app include:
|
||||||
|
<ul style="list-style-type: none; padding-left: 0;">
|
||||||
|
<li><strong>Profile:</strong> Displays users’ personal and professional background as HIPMI Badung members.</li>
|
||||||
|
<li><strong>Business Portfolio:</strong> Allows users to showcase their business name, business information, and associated social media links.</li>
|
||||||
|
<li><strong>User Search:</strong> Enables members to discover and connect with other users based on specific criteria.</li>
|
||||||
|
<li><strong>Events:</strong> Provides information and registration for business events, seminars, workshops, and HIPMI Badung community activities.</li>
|
||||||
|
<li><strong>Voting:</strong> Supports internal organizational decision-making through a digital voting system.</li>
|
||||||
|
<li><strong>Collaboration Projects:</strong> Serves as a hub for initiating, managing, and participating in joint business initiatives.</li>
|
||||||
|
<li><strong>Job Search:</strong> Offers job postings and career opportunities within the members’ business ecosystem.</li>
|
||||||
|
<li><strong>Forum:</strong> An interactive space for members to exchange ideas, ask questions, and share solutions related to entrepreneurship.</li>
|
||||||
|
<li><strong>Business Map (Maps):</strong> Displays the physical locations of members’ businesses to facilitate networking and in-person visits.</li>
|
||||||
|
<li><strong>Crowdfunding:</strong> Includes two funding mechanisms—Investment (for business opportunities offering returns) and Donation (for social support with no expectation of return).</li>
|
||||||
|
</ul>
|
||||||
|
This app is designed to uphold user data integrity while promoting transparency, collaboration, and sustainable economic growth among young entrepreneurs in Badung. All personal and business information collected through the app is used solely to enable core functionalities and is managed in accordance with applicable privacy policies.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>Engage with us in other related ways, including any sales, marketing, or events</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p><strong>Questions or concerns?</strong> Reading this Privacy Notice will help you understand your privacy rights and choices. We are responsible for making decisions about how your personal information is processed. If you do not agree with our policies and practices, please do not use our Services. If you still have any questions or concerns, please contact us at <a href="mailto:bip.baliinteraktifperkasa@gmail.com">bip.baliinteraktifperkasa@gmail.com</a>.</p>
|
||||||
|
|
||||||
|
<!-- SUMMARY OF KEY POINTS -->
|
||||||
|
<div class="summary-box">
|
||||||
|
<h3>Summary of Key Points</h3>
|
||||||
|
<p>This summary provides key points from our Privacy Notice, but you can find out more details about any of these topics by using the table of contents below.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><strong>What personal information do we process?</strong> We may process personal information depending on how you interact with us and the Services, the choices you make, and the products and features you use.</li>
|
||||||
|
<li><strong>Do we process any sensitive personal information?</strong> We do not process sensitive personal information.</li>
|
||||||
|
<li><strong>Do we collect any information from third parties?</strong> We do not collect any information from third parties.</li>
|
||||||
|
<li><strong>How do we process your information?</strong> To provide, improve, and administer our Services; communicate with you; for security and fraud prevention; and to comply with law.</li>
|
||||||
|
<li><strong>In what situations and with which parties do we share personal information?</strong> We may share information in specific situations and with specific third parties.</li>
|
||||||
|
<li><strong>How do we keep your information safe?</strong> We have adequate organizational and technical processes in place to protect your personal information.</li>
|
||||||
|
<li><strong>What are your rights?</strong> Depending on where you are located geographically, you may have certain rights regarding your personal information.</li>
|
||||||
|
<li><strong>How do you exercise your rights?</strong> By submitting a data subject access request, or by contacting us.</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TABLE OF CONTENTS -->
|
||||||
|
<h3>Table of Contents</h3>
|
||||||
|
<ol>
|
||||||
|
<li><a href="#section1">WHAT INFORMATION DO WE COLLECT?</a></li>
|
||||||
|
<li><a href="#section2">HOW DO WE PROCESS YOUR INFORMATION?</a></li>
|
||||||
|
<li><a href="#section3">WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?</a></li>
|
||||||
|
<li><a href="#section4">DO WE USE COOKIES AND OTHER TRACKING TECHNOLOGIES?</a></li>
|
||||||
|
<li><a href="#section5">HOW LONG DO WE KEEP YOUR INFORMATION?</a></li>
|
||||||
|
<li><a href="#section6">HOW DO WE KEEP YOUR INFORMATION SAFE?</a></li>
|
||||||
|
<li><a href="#section7">DO WE COLLECT INFORMATION FROM MINORS?</a></li>
|
||||||
|
<li><a href="#section8">WHAT ARE YOUR PRIVACY RIGHTS?</a></li>
|
||||||
|
<li><a href="#section9">CONTROLS FOR DO-NOT-TRACK FEATURES</a></li>
|
||||||
|
<li><a href="#section10">DO WE MAKE UPDATES TO THIS NOTICE?</a></li>
|
||||||
|
<li><a href="#section11">HOW CAN YOU CONTACT US ABOUT THIS NOTICE?</a></li>
|
||||||
|
<li><a href="#section12">HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?</a></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<!-- SECTION 1 -->
|
||||||
|
<div id="section1" class="section-title">1. WHAT INFORMATION DO WE COLLECT?</div>
|
||||||
|
<h4>Personal information you disclose to us</h4>
|
||||||
|
<p><em>In Short:</em> We collect personal information that you provide to us.</p>
|
||||||
|
<p>We collect personal information that you voluntarily provide to us when you register on the Services, express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us.</p>
|
||||||
|
<h4>Personal Information Provided by You.</h4>
|
||||||
|
<p>The personal information that we collect depends on the context of your interactions with us and the Services, the choices you make, and the products and features you use. The personal information we collect may include the following:</p>
|
||||||
|
<ul>
|
||||||
|
<li>names</li>
|
||||||
|
<li>phone numbers</li>
|
||||||
|
<li>email addresses</li>
|
||||||
|
<li>usernames</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Sensitive Information.</h4>
|
||||||
|
<p>We do not process sensitive information.</p>
|
||||||
|
<h4>Application Data.</h4>
|
||||||
|
<p>If you use our application(s), we also may collect the following information if you choose to provide us with access or permission:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Geolocation Information.</strong> We may request access or permission to track location-based information from your mobile device, either continuously or while you are using our mobile application(s), to provide certain location-based services. If you wish to change our access or permissions, you may do so in your device's settings.</li>
|
||||||
|
<li><strong>Mobile Device Data.</strong> We automatically collect device information (such as your mobile device ID, model, and manufacturer), operating system, version information and system configuration information, device and application identification numbers, browser type and version, hardware model Internet service provider and/or mobile carrier, and Internet Protocol (IP) address (or proxy server). If you are using our application(s), we may also collect information about the phone network associated with your mobile device, your mobile device’s operating system or platform, the type of mobile device you use, your mobile device’s unique device ID, and information about the features of our application(s) you accessed.</li>
|
||||||
|
<li><strong>Push Notifications.</strong> We may request to send you push notifications regarding your account or certain features of the application(s). If you wish to opt out from receiving these types of communications, you may turn them off in your device's settings.</li>
|
||||||
|
</ul>
|
||||||
|
<p>This information is primarily needed to maintain the security and operation of our application(s), for troubleshooting, and for our internal analytics and reporting purposes.</p>
|
||||||
|
<p>All personal information that you provide to us must be true, complete, and accurate, and you must notify us of any changes to such personal information.</p>
|
||||||
|
<h4>Information automatically collected</h4>
|
||||||
|
<p><em>In Short:</em> Some information — such as your Internet Protocol (IP) address and/or browser and device characteristics — is collected automatically when you visit our Services.</p>
|
||||||
|
<p>We automatically collect certain information when you visit, use, or navigate the Services. This information does not reveal your specific identity (like your name or contact information) but may include device and usage information, such as your IP address, browser and device characteristics, operating system, language preferences, referring URLs, device name, country, location, information about how and when you use our Services, and other technical information. This information is primarily needed to maintain the security and operation of our Services, and for our internal analytics and reporting purposes.</p>
|
||||||
|
<p>Like many businesses, we also collect information through cookies and similar technologies.</p>
|
||||||
|
<h4>The information we collect includes:</h4>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Log and Usage Data.</strong> Log and usage data is service-related, diagnostic, usage, and performance information our servers automatically collect when you access or use our Services and which we record in log files. Depending on how you interact with us, this log data may include your IP address, device information, browser type, and settings and information about your activity in the Services (such as the date/time stamps associated with your usage, pages and files viewed, searches, and other actions you take such as which features you use), device event information (such as system activity, error reports (sometimes called "crash dumps"), and hardware settings).</li>
|
||||||
|
<li><strong>Device Data.</strong> We collect device data such as information about your computer, phone, tablet, or other device you use to access the Services. Depending on the device used, this device data may include information such as your IP address (or proxy server), device and application identification numbers, location, browser type, hardware model, Internet service provider and/or mobile carrier, operating system, and system configuration information.</li>
|
||||||
|
<li><strong>Location Data.</strong> We collect location data such as information about your device's location, which can be either precise or imprecise. How much information we collect depends on the type and settings of the device you use to access the Services. For example, we may use GPS and other technologies to collect geolocation data that tells us your current location (based on your IP address). You can opt out of allowing us to collect this information either by refusing access to the information or by disabling your Location setting on your device. However, if you choose to opt out, you may not be able to use certain aspects of the Services.</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Google API</h4>
|
||||||
|
<p>Our use of information received from Google APIs will adhere to <a href="https://developers.google.com/terms/api-services-user-data-policy" target="_blank">Google API Services User Data Policy</a>, including the <a href="https://developers.google.com/terms/api-services-user-data-policy#limited-use" target="_blank">Limited Use requirements</a>.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 2 -->
|
||||||
|
<div id="section2" class="section-title">2. HOW DO WE PROCESS YOUR INFORMATION?</div>
|
||||||
|
<p><em>In Short:</em> We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent.</p>
|
||||||
|
<p>We process your personal information for a variety of reasons, depending on how you interact with our Services, including:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>To facilitate account creation and authentication and otherwise manage user accounts.</strong> We may process your information so you can create and log in to your account, as well as keep your account in working order.</li>
|
||||||
|
<li><strong>To deliver and facilitate delivery of services to the user.</strong> We may process your information to provide you with the requested service.</li>
|
||||||
|
<li><strong>To respond to user inquiries/offer support to users.</strong> We may process your information to respond to your inquiries and solve any potential issues you might have with the requested service.</li>
|
||||||
|
<li><strong>To send administrative information to you.</strong> We may process your information to send you details about our products and services, changes to our terms and policies, and other similar information.</li>
|
||||||
|
<li><strong>To enable user-to-user communications.</strong> We may process your information if you choose to use any of our offerings that allow for communication with another user.</li>
|
||||||
|
<li><strong>To request feedback.</strong> We may process your information when necessary to request feedback and to contact you about your use of our Services.</li>
|
||||||
|
<li><strong>To send you marketing and promotional communications.</strong> We may process the personal information you send to us for our marketing purposes, if this is in accordance with your marketing preferences. You can opt out of our marketing emails at any time. For more information, see "<a href="#section8">WHAT ARE YOUR PRIVACY RIGHTS?</a>" below.</li>
|
||||||
|
<li><strong>To protect our Services.</strong> We may process your information as part of our efforts to keep our Services safe and secure, including fraud monitoring and prevention.</li>
|
||||||
|
<li><strong>To evaluate and improve our Services, products, marketing, and your experience.</strong> We may process your information when we believe it is necessary to identify usage trends, determine the effectiveness of our promotional campaigns, and to evaluate and improve our Services, products, marketing, and your experience.</li>
|
||||||
|
<li><strong>To identify usage trends.</strong> We may process information about how you use our Services to better understand how they are being used so we can improve them.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- SECTION 3 -->
|
||||||
|
<div id="section3" class="section-title">3. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?</div>
|
||||||
|
<p><em>In Short:</em> We may share information in specific situations described in this section and/or with the following third parties.</p>
|
||||||
|
<h4>Vendors, Consultants, and Other Third-Party Service Providers.</h4>
|
||||||
|
<p>We may share your data with third-party vendors, service providers, contractors, or agents (“<strong>third parties</strong>”) who perform services for us or on our behalf and require access to such information to do that work. We have contracts in place with our third parties, which are designed to help safeguard your personal information. This means that they cannot do anything with your personal information unless we have instructed them to do it. They will also not share your personal information with any organization apart from us. They also commit to protect the data they hold on our behalf and to retain it for the period we instruct.</p>
|
||||||
|
<p>The third parties we may share personal information with are as follows:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Cloud Computing Services</strong>
|
||||||
|
<ul style="list-style-type: none; padding-left: 15px;">
|
||||||
|
<li>Google Cloud Platform</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Functionality and Infrastructure Optimization</strong>
|
||||||
|
<ul style="list-style-type: none; padding-left: 15px;">
|
||||||
|
<li>Firebase Realtime Database</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Web and Mobile Analytics</strong>
|
||||||
|
<ul style="list-style-type: none; padding-left: 15px;">
|
||||||
|
<li>Google Analytics for Firebase</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Website Performance Monitoring</strong>
|
||||||
|
<ul style="list-style-type: none; padding-left: 15px;">
|
||||||
|
<li>Firebase Crash Reporting</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><strong>Website Testing</strong>
|
||||||
|
<ul style="list-style-type: none; padding-left: 15px;">
|
||||||
|
<li>Google Play Console and TestFlight</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>We also may need to share your personal information in the following situations:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Business Transfers.</strong> We may share or transfer your information in connection with, or during negotiations of, any merger, sale of company assets, financing, or acquisition of all or a portion of our business to another company.</li>
|
||||||
|
<li><strong>When we use Google Maps Platform APIs.</strong> We may share your information with certain Google Maps Platform APIs (e.g., Google Maps API, Places API). Google Maps uses GPS, Wi-Fi, and cell towers to estimate your location. GPS is accurate to about 20 meters, while Wi-Fi and cell towers help improve accuracy when GPS signals are weak, like indoors. This data helps Google Maps provide directions, but it is not always perfectly precise. We obtain and store on your device (“cache”) your location. You may revoke your consent anytime by contacting us at the contact details provided at the end of this document.</li>
|
||||||
|
<li><strong>Business Partners.</strong> We may share your information with our business partners to offer you certain products, services, or promotions.</li>
|
||||||
|
<li><strong>Other Users.</strong> When you share personal information (for example, by posting comments, contributions, or other content to the Services) or otherwise interact with public areas of the Services, such personal information may be viewed by all users and may be publicly made available outside the Services in perpetuity. Similarly, other users will be able to view descriptions of your activity, communicate with you within our Services, and view your profile.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- SECTION 4 -->
|
||||||
|
<div id="section4" class="section-title">4. DO WE USE COOKIES AND OTHER TRACKING TECHNOLOGIES?</div>
|
||||||
|
<p><em>In Short:</em> We may use cookies and other tracking technologies to collect and store your information.</p>
|
||||||
|
<p>We may use cookies and similar tracking technologies (like web beacons and pixels) to gather information when you interact with our Services. Some online tracking technologies help us maintain the security of our Services and your account, prevent crashes, fix bugs, save your preferences, and assist with basic site functions.</p>
|
||||||
|
<p>We also permit third parties and service providers to use online tracking technologies on our Services for analytics and advertising, including to help manage and display advertisements, to tailor advertisements to your interests, or to send abandoned shopping cart reminders (depending on your communication preferences). The third parties and service providers use their technology to provide advertising about products and services tailored to your interests which may appear either on our Services or on other websites.</p>
|
||||||
|
<p>Specific information about how we use such technologies and how you can refuse certain cookies is set out in our Cookie Notice.</p>
|
||||||
|
<h4>Google Analytics</h4>
|
||||||
|
<p>We may share your information with Google Analytics to track and analyze the use of the Services. To opt out of being tracked by Google Analytics across the Services, visit <a href="https://tools.google.com/dlpage/gaoptout" target="_blank">https://tools.google.com/dlpage/gaoptout</a>. For more information on the privacy practices of Google, please visit the <a href="https://policies.google.com/privacy" target="_blank">Google Privacy & Terms page</a>.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 5 -->
|
||||||
|
<div id="section5" class="section-title">5. HOW LONG DO WE KEEP YOUR INFORMATION?</div>
|
||||||
|
<p><em>In Short:</em> We keep your information for as long as necessary to fulfill the purposes outlined in this Privacy Notice unless otherwise required by law.</p>
|
||||||
|
<p>We will only keep your personal information for as long as it is necessary for the purposes set out in this Privacy Notice, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements). No purpose in this notice will require us keeping your personal information for longer than the period of time in which users have an account with us.</p>
|
||||||
|
<p>When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 6 -->
|
||||||
|
<div id="section6" class="section-title">6. HOW DO WE KEEP YOUR INFORMATION SAFE?</div>
|
||||||
|
<p><em>In Short:</em> We aim to protect your personal information through a system of organizational and technical security measures.</p>
|
||||||
|
<p>We have implemented appropriate and reasonable technical and organizational security measures designed to protect the security of any personal information we process. However, despite our safeguards and efforts to secure your information, no electronic transmission over the Internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Although we will do our best to protect your personal information, transmission of personal information to and from our Services is at your own risk. You should only access the Services within a secure environment.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 7 -->
|
||||||
|
<div id="section7" class="section-title">7. DO WE COLLECT INFORMATION FROM MINORS?</div>
|
||||||
|
<p><em>In Short:</em> We do not knowingly collect data from or market to minors.</p>
|
||||||
|
<p>HIPMI Badung Connect is not intended for use by individuals under the age of 18. We do not knowingly collect personal information from children under 18. If we become aware that we have inadvertently collected such information, we will take steps to delete it as soon as possible.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 8 -->
|
||||||
|
<div id="section8" class="section-title">8. WHAT ARE YOUR PRIVACY RIGHTS?</div>
|
||||||
|
<p><em>In Short:</em> You may review, change, or terminate your account at any time, depending on your country, province, or state of residence.</p>
|
||||||
|
<h4>Withdrawing your consent:</h4>
|
||||||
|
<p>If we are relying on your consent to process your personal information, which may be express and/or implied consent depending on the applicable law, you have the right to withdraw your consent at any time. You can withdraw your consent at any time by contacting us by using the contact details provided in the section "<a href="#section11">HOW CAN YOU CONTACT US ABOUT THIS NOTICE?</a>" below.</p>
|
||||||
|
<p>However, please note that this will not affect the lawfulness of the processing before its withdrawal nor, when applicable law allows, will it affect the processing of your personal information conducted in reliance on lawful processing grounds other than consent.</p>
|
||||||
|
<h4>Opting out of marketing and promotional communications:</h4>
|
||||||
|
<p>You can unsubscribe from our marketing and promotional communications at any time by clicking on the unsubscribe link in the emails that we send, or by contacting us using the details provided in the section "<a href="#section11">HOW CAN YOU CONTACT US ABOUT THIS NOTICE?</a>" below. You will then be removed from the marketing lists. However, we may still communicate with you — for example, to send you service-related messages that are necessary for the administration and use of your account, to respond to service requests, or for other non-marketing purposes.</p>
|
||||||
|
<h4>Account Information</h4>
|
||||||
|
<p>If you would at any time like to review or change the information in your account or terminate your account, you can:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Log in to your account settings and update your user account.</li>
|
||||||
|
<li>Contact us using the contact information provided.</li>
|
||||||
|
<li><a href="mailto:bip.baliinteraktifperkasa@gmail.com">bip.baliinteraktifperkasa@gmail.com</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>Upon your request to terminate your account, we will deactivate or delete your account and information from our active databases. However, we may retain some information in our files to prevent fraud, troubleshoot problems, assist with any investigations, enforce our legal terms and/or comply with applicable legal requirements.</p>
|
||||||
|
<h4>Cookies and similar technologies:</h4>
|
||||||
|
<p>Most Web browsers are set to accept cookies by default. If you prefer, you can usually choose to set your browser to remove cookies and to reject cookies. If you choose to remove cookies or reject cookies, this could affect certain features or services of our Services.</p>
|
||||||
|
<p>If you have questions or comments about your privacy rights, you may email us at <a href="mailto:bip.baliinteraktifperkasa@gmail.com">bip.baliinteraktifperkasa@gmail.com</a>.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 9 -->
|
||||||
|
<div id="section9" class="section-title">9. CONTROLS FOR DO-NOT-TRACK FEATURES</div>
|
||||||
|
<p>Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track ("DNT") feature or setting you can activate to signal your privacy preference not to have data about your online browsing activities monitored and collected. At this stage, no uniform technology standard for recognizing and implementing DNT signals has been finalized. As such, we do not currently respond to DNT browser signals or any other mechanism that automatically communicates your choice not to be tracked online. If a standard for online tracking is adopted that we must follow in the future, we will inform you about that practice in a revised version of this Privacy Notice.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 10 -->
|
||||||
|
<div id="section10" class="section-title">10. DO WE MAKE UPDATES TO THIS NOTICE?</div>
|
||||||
|
<p><em>In Short:</em> Yes, we will update this notice as necessary to stay compliant with relevant laws.</p>
|
||||||
|
<p>We may update this Privacy Notice from time to time. The updated version will be indicated by an updated "Revised" date at the top of this Privacy Notice. If we make material changes to this Privacy Notice, we may notify you either by prominently posting a notice of such changes or by directly sending you a notification. We encourage you to review this Privacy Notice frequently to be informed of how we are protecting your information.</p>
|
||||||
|
|
||||||
|
<!-- SECTION 11 -->
|
||||||
|
<div id="section11" class="section-title">11. HOW CAN YOU CONTACT US ABOUT THIS NOTICE?</div>
|
||||||
|
<p>If you have questions or comments about this notice, you may email us at <a href="mailto:bip.baliinteraktifperkasa@gmail.com">bip.baliinteraktifperkasa@gmail.com</a> or contact us by post at:</p>
|
||||||
|
<address>
|
||||||
|
Bali Interaktif Perkasa<br>
|
||||||
|
Park23 Creative Hub, Bali Interaktif Perkasa - Private Office<br>
|
||||||
|
Jl. Kediri 3rd Floor, Number 01 - 02, Tuban<br>
|
||||||
|
Badung, Bali, Indonesia 80361<br>
|
||||||
|
Indonesia
|
||||||
|
</address>
|
||||||
|
|
||||||
|
<!-- SECTION 12 -->
|
||||||
|
<div id="section12" class="section-title">12. HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?</div>
|
||||||
|
<p>You have the right to request access to the personal information we collect from you, details about how we have processed it, correct inaccuracies, or delete your personal information. You may also have the right to withdraw your consent to our processing of your personal information. These rights may be limited in some circumstances by applicable law.</p>
|
||||||
|
<p>To make a request, please contact us at <a href="mailto:bip.baliinteraktifperkasa@gmail.com">bip.baliinteraktifperkasa@gmail.com</a>.</p>
|
||||||
|
<hr style="margin: 30px 0; border: 0; border-top: 1px solid #eee;">
|
||||||
|
<p>© 2025 Bali Interaktif Perkasa. All rights reserved.</p>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -3,109 +3,107 @@ import backendLogger from "@/util/backendLogger";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function GET(req: Request,
|
export async function GET(
|
||||||
{ params }: { params: { id: string } }) {
|
req: Request,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
let fixData;
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(req.url);
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
|
||||||
try {
|
if (!page) {
|
||||||
let fixData;
|
fixData = await prisma.donasi_Invoice.findMany({
|
||||||
const { id } = params;
|
orderBy: {
|
||||||
const { searchParams } = new URL(req.url);
|
createdAt: "desc",
|
||||||
const page = searchParams.get("page");
|
|
||||||
const status = searchParams.get("status");
|
|
||||||
const takeData = 10
|
|
||||||
const skipData = Number(page) * takeData - takeData;
|
|
||||||
|
|
||||||
if (!page) {
|
|
||||||
fixData = await prisma.donasi_Invoice.findMany({
|
|
||||||
orderBy: {
|
|
||||||
createdAt: "desc",
|
|
||||||
},
|
|
||||||
where: {
|
|
||||||
donasiId: id,
|
|
||||||
active: true,
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
nominal: true,
|
|
||||||
createdAt: true,
|
|
||||||
Author: true,
|
|
||||||
DonasiMaster_Bank: true,
|
|
||||||
DonasiMaster_StatusInvoice: true,
|
|
||||||
donasiMaster_StatusInvoiceId: true,
|
|
||||||
imagesId: true,
|
|
||||||
imageId: true,
|
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const fixStatus = _.startCase(status ? status : "");
|
|
||||||
const data = await prisma.donasi_Invoice.findMany({
|
|
||||||
take: takeData,
|
|
||||||
skip: skipData,
|
|
||||||
orderBy: {
|
|
||||||
createdAt: "desc",
|
|
||||||
},
|
|
||||||
where: {
|
|
||||||
|
|
||||||
donasiId: id,
|
|
||||||
active: true,
|
|
||||||
DonasiMaster_StatusInvoice: {
|
|
||||||
name: {
|
|
||||||
contains: fixStatus,
|
|
||||||
mode: "insensitive",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
nominal: true,
|
|
||||||
createdAt: true,
|
|
||||||
Author: true,
|
|
||||||
DonasiMaster_Bank: true,
|
|
||||||
DonasiMaster_StatusInvoice: true,
|
|
||||||
donasiMaster_StatusInvoiceId: true,
|
|
||||||
imagesId: true,
|
|
||||||
imageId: true,
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const nCount = await prisma.donasi_Invoice.count({
|
|
||||||
where: {
|
|
||||||
donasiId: id,
|
|
||||||
active: true,
|
|
||||||
DonasiMaster_StatusInvoice: {
|
|
||||||
name: {
|
|
||||||
contains: fixStatus,
|
|
||||||
mode: "insensitive",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
fixData = {
|
|
||||||
data: data,
|
|
||||||
nPage: _.ceil(nCount / takeData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
success: true,
|
|
||||||
message: "Success",
|
|
||||||
data: fixData,
|
|
||||||
},
|
},
|
||||||
{ status: 200 }
|
where: {
|
||||||
)
|
donasiId: id,
|
||||||
} catch (error) {
|
active: true,
|
||||||
backendLogger.error("Error get data donatur >>", error);
|
|
||||||
return NextResponse.json({
|
|
||||||
success: false,
|
|
||||||
message: "Error get data donatur",
|
|
||||||
reason: (error as Error).message
|
|
||||||
},
|
},
|
||||||
{ status: 500 }
|
select: {
|
||||||
)
|
id: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
DonasiMaster_Bank: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
imagesId: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const fixStatus = _.startCase(status ? status : "");
|
||||||
|
const data = await prisma.donasi_Invoice.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
active: true,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
name: {
|
||||||
|
contains: fixStatus,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
DonasiMaster_Bank: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
imagesId: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.donasi_Invoice.count({
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
active: true,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
name: {
|
||||||
|
contains: fixStatus,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = {
|
||||||
|
data: data,
|
||||||
|
nPage: _.ceil(nCount / takeData),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
backendLogger.error("Error get data donatur >>", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get data donatur",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
166
src/app/api/mobile/admin/donation/[id]/disbursement/route.ts
Normal file
166
src/app/api/mobile/admin/donation/[id]/disbursement/route.ts
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export { POST, GET };
|
||||||
|
|
||||||
|
async function POST(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await request.json();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const dataDonasi = await prisma.donasi.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
akumulasiPencairan: true,
|
||||||
|
totalPencairan: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!dataDonasi)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Pencarian Donasi Gagal",
|
||||||
|
reason: "Pencarian Donasi Gagal",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
|
||||||
|
const createPencairan = await prisma.donasi_PencairanDana.create({
|
||||||
|
data: {
|
||||||
|
donasiId: id,
|
||||||
|
nominalCair: +data.nominalCair,
|
||||||
|
deskripsi: data.deskripsi,
|
||||||
|
title: data.title,
|
||||||
|
imageId: data.imageId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!createPencairan)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Pencairan Dana Gagal",
|
||||||
|
reason: "Pencairan Dana Gagal",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
|
||||||
|
const hasilTotalPencairan =
|
||||||
|
Number(dataDonasi.totalPencairan) + Number(data.nominalCair);
|
||||||
|
// const hasilAkumulasiPencairan = Number(dataDonasi.akumulasiPencairan) + 1;
|
||||||
|
|
||||||
|
const countPencairan = await prisma.donasi_PencairanDana.count({
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const updateDonasi = await prisma.donasi.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
akumulasiPencairan: countPencairan,
|
||||||
|
totalPencairan: hasilTotalPencairan,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updateDonasi)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Update Donasi Gagal",
|
||||||
|
reason: "Update Donasi Gagal",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Pencairan Dana Berhasil",
|
||||||
|
// data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Pencairan Dana Gagal",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
|
||||||
|
console.log("[CATEGORY]", category);
|
||||||
|
let fixData;
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (category === "get-all") {
|
||||||
|
fixData = await prisma.donasi_PencairanDana.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
createdAt: true,
|
||||||
|
nominalCair: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else if (category === "get-one") {
|
||||||
|
fixData = await prisma.donasi_PencairanDana.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Category tidak ditemukan",
|
||||||
|
reason: "Category tidak ditemukan",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success get data disbursement",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal mendapatkan data disbursement",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
115
src/app/api/mobile/admin/donation/[id]/donatur/route.ts
Normal file
115
src/app/api/mobile/admin/donation/[id]/donatur/route.ts
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(req: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(req.url);
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
const fixStatus = _.startCase(status || "");
|
||||||
|
|
||||||
|
console.log("[FIX STATUS]", fixStatus);
|
||||||
|
|
||||||
|
let fixData;
|
||||||
|
try {
|
||||||
|
if (status === null) {
|
||||||
|
fixData = await prisma.donasi_Invoice.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
DonasiMaster_Bank: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
imagesId: true,
|
||||||
|
imageId: true,
|
||||||
|
MasterBank: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const checkStatusTransaksi =
|
||||||
|
await prisma.donasiMaster_StatusInvoice.findFirst({
|
||||||
|
where: {
|
||||||
|
name: fixStatus,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[CHECK STATUS TRANSAKSI]", checkStatusTransaksi);
|
||||||
|
|
||||||
|
if (!checkStatusTransaksi)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: "Status not found",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
|
||||||
|
const data = await prisma.donasi_Invoice.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
active: true,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
name: {
|
||||||
|
contains: checkStatusTransaksi.name,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
DonasiMaster_Bank: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
imagesId: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil mendapatkan data",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
176
src/app/api/mobile/admin/donation/[id]/invoice/route.ts
Normal file
176
src/app/api/mobile/admin/donation/[id]/invoice/route.ts
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
export { GET, PUT };
|
||||||
|
|
||||||
|
async function GET(req: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
console.log("[ID]", id);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.donasi_Invoice.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
donasiId: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
imageId: true,
|
||||||
|
MasterBank: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil mendapatkan data",
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TYPE DATA
|
||||||
|
interface DataType {
|
||||||
|
donationId: string;
|
||||||
|
nominal: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function PUT(req: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await req.json();
|
||||||
|
const { searchParams } = new URL(req.url);
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
const fixStatus = _.startCase(status as string);
|
||||||
|
|
||||||
|
console.log("[ID]", id);
|
||||||
|
console.log("[DATA]", data);
|
||||||
|
console.log("[FIX STATUS]", fixStatus);
|
||||||
|
|
||||||
|
const cloneData = data as DataType;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const checkStatusTransaksi =
|
||||||
|
await prisma.donasiMaster_StatusInvoice.findFirst({
|
||||||
|
where: {
|
||||||
|
name: fixStatus,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!checkStatusTransaksi)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed update status invoice",
|
||||||
|
reason: "Status not found",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
|
||||||
|
const donasi = await prisma.donasi.findUnique({
|
||||||
|
where: {
|
||||||
|
id: data?.donationId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
target: true,
|
||||||
|
terkumpul: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!donasi) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed update status invoice",
|
||||||
|
reason: "Donasi not found",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateInvoice = await prisma.donasi_Invoice.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
donasiMaster_StatusInvoiceId: checkStatusTransaksi.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updateInvoice) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed update status invoice",
|
||||||
|
reason: "Update invoice failed",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let totalNominal =
|
||||||
|
Number(cloneData.nominal) + (Number(donasi.terkumpul) || 0);
|
||||||
|
const progres =
|
||||||
|
Math.floor((totalNominal / Number(donasi.target)) * 1000) / 10;
|
||||||
|
|
||||||
|
console.log("[STATUS]", checkStatusTransaksi);
|
||||||
|
console.log("[TOTAL NOMINAL]", totalNominal);
|
||||||
|
console.log("[PROGRES]", progres);
|
||||||
|
|
||||||
|
const updateDonasi = await prisma.donasi.update({
|
||||||
|
where: {
|
||||||
|
id: data?.donationId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
terkumpul: "" + totalNominal,
|
||||||
|
progres: "" + progres,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updateDonasi) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed update status invoice",
|
||||||
|
reason: "Update donasi failed",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil update status invoice",
|
||||||
|
data: updateDonasi,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error update status invoice",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
152
src/app/api/mobile/admin/donation/[id]/route.ts
Normal file
152
src/app/api/mobile/admin/donation/[id]/route.ts
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export { GET, PUT };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
try {
|
||||||
|
const { id } = params;
|
||||||
|
const donasiId = id;
|
||||||
|
const data = await prisma.donasi.findUnique({
|
||||||
|
where: {
|
||||||
|
id: donasiId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
target: true,
|
||||||
|
active: true,
|
||||||
|
createdAt: true,
|
||||||
|
updatedAt: true,
|
||||||
|
publishTime: true,
|
||||||
|
catatan: true,
|
||||||
|
progres: true,
|
||||||
|
terkumpul: true,
|
||||||
|
authorId: true,
|
||||||
|
namaBank: true,
|
||||||
|
rekening: true,
|
||||||
|
totalPencairan: true,
|
||||||
|
akumulasiPencairan: true,
|
||||||
|
imagesId: true,
|
||||||
|
donasiMaster_KategoriId: true,
|
||||||
|
donasiMaster_DurasiId: true,
|
||||||
|
donasiMaster_StatusDonasiId: true,
|
||||||
|
Author: true,
|
||||||
|
imageDonasi: true,
|
||||||
|
CeritaDonasi: true,
|
||||||
|
DonasiMaster_Ketegori: true,
|
||||||
|
DonasiMaster_Durasi: true,
|
||||||
|
DonasiMaster_Status: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const successInvoice = await prisma.donasi_Invoice.count({
|
||||||
|
where: {
|
||||||
|
donasiId: donasiId,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
name: "Berhasil",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Data Donasi Berhasil Diambil",
|
||||||
|
data: {
|
||||||
|
donasi: data,
|
||||||
|
donatur: successInvoice,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function PUT(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await request.json();
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
const fixStatus = _.startCase(status as string);
|
||||||
|
|
||||||
|
console.log("[PUT ID]", id);
|
||||||
|
console.log("[PUT DATA DONASI]", data);
|
||||||
|
console.log("[PUT DATA DONASI]", fixStatus);
|
||||||
|
|
||||||
|
let fixData;
|
||||||
|
try {
|
||||||
|
const checkStatus = await prisma.donasiMaster_StatusDonasi.findFirst({
|
||||||
|
where: {
|
||||||
|
name: fixStatus,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[PUT CHECK STATUS]", checkStatus);
|
||||||
|
|
||||||
|
if (!checkStatus)
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error update data event",
|
||||||
|
reason: "Status not found",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (fixStatus === "Reject") {
|
||||||
|
const updateData = await prisma.donasi.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
catatan: data,
|
||||||
|
donasiMaster_StatusDonasiId: checkStatus.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = updateData;
|
||||||
|
} else if (fixStatus === "Publish") {
|
||||||
|
const updateData = await prisma.donasi.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
donasiMaster_StatusDonasiId: checkStatus.id,
|
||||||
|
publishTime: new Date(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = updateData;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Data Donasi Berhasil Diambil",
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
134
src/app/api/mobile/admin/donation/route.ts
Normal file
134
src/app/api/mobile/admin/donation/route.ts
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request) {
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const search = searchParams.get("search");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
console.log("[CATEGORY]", category);
|
||||||
|
let fixData;
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (category === "dashboard") {
|
||||||
|
const publish = await prisma.donasi.count({
|
||||||
|
where: {
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
name: "Publish",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const review = await prisma.donasi.count({
|
||||||
|
where: {
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
name: "Review",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const reject = await prisma.donasi.count({
|
||||||
|
where: {
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
name: "Reject",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const countCategoryDonation = await prisma.donasiMaster_Kategori.findMany(
|
||||||
|
{
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "asc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const categoryDonation = countCategoryDonation.length;
|
||||||
|
|
||||||
|
fixData = {
|
||||||
|
publish,
|
||||||
|
review,
|
||||||
|
reject,
|
||||||
|
categoryDonation,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
const fixCategory = _.startCase(category || "");
|
||||||
|
|
||||||
|
const checkStatus = await prisma.donasiMaster_StatusDonasi.findFirst({
|
||||||
|
where: {
|
||||||
|
name: fixCategory,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[STATUS]", checkStatus);
|
||||||
|
|
||||||
|
if (!checkStatus) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed to get data donation",
|
||||||
|
reason: "Status not found",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixData = await prisma.donasi.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
name: checkStatus.name,
|
||||||
|
},
|
||||||
|
active: true,
|
||||||
|
title: {
|
||||||
|
contains: search || "",
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[LIST]", fixData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: `Success get data donation ${category}`,
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get data donation:", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Failed to get data donation",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
53
src/app/api/mobile/admin/event/[id]/participants/route.ts
Normal file
53
src/app/api/mobile/admin/event/[id]/participants/route.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
try {
|
||||||
|
const { id } = params;
|
||||||
|
|
||||||
|
const data = await prisma.event_Peserta.findMany({
|
||||||
|
where: {
|
||||||
|
eventId: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
eventId: true,
|
||||||
|
userId: true,
|
||||||
|
isPresent: true,
|
||||||
|
User: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
nomor: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success get participants",
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get participants",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
70
src/app/api/mobile/admin/investment/[id]/investor/route.ts
Normal file
70
src/app/api/mobile/admin/investment/[id]/investor/route.ts
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
request: Request,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
let fixData;
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
|
||||||
|
const fixStatus = _.startCase(status ? status : "");
|
||||||
|
|
||||||
|
const checkStatus = await prisma.investasiMaster_StatusInvoice.findFirst({
|
||||||
|
where: {
|
||||||
|
name: fixStatus,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = await prisma.investasi_Invoice.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
investasiId: id,
|
||||||
|
isActive: true,
|
||||||
|
StatusInvoice: {
|
||||||
|
name: {
|
||||||
|
contains: checkStatus?.name,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
Author: true,
|
||||||
|
StatusInvoice: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = data;
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success get status transaksi",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Eror get status transaksi", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get status transaksi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
178
src/app/api/mobile/admin/investment/[id]/invoice/route.ts
Normal file
178
src/app/api/mobile/admin/investment/[id]/invoice/route.ts
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
|
||||||
|
export { GET, PUT };
|
||||||
|
|
||||||
|
async function GET(req: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.investasi_Invoice.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
investasiId: true,
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
Author: true,
|
||||||
|
StatusInvoice: true,
|
||||||
|
imageId: true,
|
||||||
|
MasterBank: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil mendapatkan data",
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function PUT(req: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await req.json();
|
||||||
|
const { searchParams } = new URL(req.url);
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
|
||||||
|
console.log("[ID]", id);
|
||||||
|
console.log("[DATA]", data);
|
||||||
|
console.log("[CATEGORY]", category);
|
||||||
|
|
||||||
|
let fixData;
|
||||||
|
try {
|
||||||
|
if (category === "deny") {
|
||||||
|
const updt = await prisma.investasi_Invoice.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
statusInvoiceId: "4",
|
||||||
|
},
|
||||||
|
// select: {
|
||||||
|
// StatusInvoice: true,
|
||||||
|
// authorId: true,
|
||||||
|
// },
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = updt;
|
||||||
|
} else if (category === "accept") {
|
||||||
|
const dataInvestasi: any = await prisma.investasi.findFirst({
|
||||||
|
where: {
|
||||||
|
id: data.investasiId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
totalLembar: true,
|
||||||
|
sisaLembar: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Hitung TOTAL SISA LEMBAR
|
||||||
|
const investasi_sisaLembar = Number(dataInvestasi?.sisaLembar);
|
||||||
|
const invoice_lembarTerbeli = Number(data.lembarTerbeli);
|
||||||
|
const resultSisaLembar = investasi_sisaLembar - invoice_lembarTerbeli;
|
||||||
|
|
||||||
|
// TAMBAH LEMBAR TERBELI
|
||||||
|
const investasi_lembarTerbeli = Number(dataInvestasi?.lembarTerbeli);
|
||||||
|
const resultLembarTerbeli =
|
||||||
|
investasi_lembarTerbeli + invoice_lembarTerbeli;
|
||||||
|
|
||||||
|
// Progress
|
||||||
|
const investasi_totalLembar = Number(dataInvestasi?.totalLembar);
|
||||||
|
const progress = (resultLembarTerbeli / investasi_totalLembar) * 100;
|
||||||
|
const resultProgres = Number(progress).toFixed(2);
|
||||||
|
|
||||||
|
const updt = await prisma.investasi_Invoice.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
statusInvoiceId: "1",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updt) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal Update Status",
|
||||||
|
reason: "Update status failed",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateInvestasi = await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: data.investasiId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
sisaLembar: resultSisaLembar.toString(),
|
||||||
|
lembarTerbeli: resultLembarTerbeli.toString(),
|
||||||
|
progress: resultProgres,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
MasterStatusInvestasi: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updateInvestasi) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Gagal Update Data Investasi",
|
||||||
|
reason: "Update data investasi failed",
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixData = updt;
|
||||||
|
} else {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Invalid category",
|
||||||
|
reason: "Invalid category",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil update data",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error update detail Investasi",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
137
src/app/api/mobile/admin/investment/[id]/route.ts
Normal file
137
src/app/api/mobile/admin/investment/[id]/route.ts
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
|
||||||
|
export { GET, PUT };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.investasi.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
imageId: true,
|
||||||
|
prospektusFileId: true,
|
||||||
|
id: true,
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
nomor: true,
|
||||||
|
Profile: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
hargaLembar: true,
|
||||||
|
targetDana: true,
|
||||||
|
totalLembar: true,
|
||||||
|
sisaLembar: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
progress: true,
|
||||||
|
roi: true,
|
||||||
|
active: true,
|
||||||
|
createdAt: true,
|
||||||
|
updatedAt: true,
|
||||||
|
catatan: true,
|
||||||
|
imagesId: true,
|
||||||
|
MasterStatusInvestasi: true,
|
||||||
|
BeritaInvestasi: true,
|
||||||
|
DokumenInvestasi: true,
|
||||||
|
ProspektusInvestasi: true,
|
||||||
|
MasterPembagianDeviden: true,
|
||||||
|
MasterPencarianInvestor: true,
|
||||||
|
MasterPeriodeDeviden: true,
|
||||||
|
MasterProgresInvestasi: true,
|
||||||
|
masterStatusInvestasiId: true,
|
||||||
|
countDown: true,
|
||||||
|
Investasi_Invoice: {
|
||||||
|
where: {
|
||||||
|
statusInvoiceId: "2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success get data investment",
|
||||||
|
data: data,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get data investment",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function PUT(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await request.json();
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const status = searchParams.get("status");
|
||||||
|
|
||||||
|
console.log("[=======Start Investment console=======]");
|
||||||
|
console.log("[ID]", id);
|
||||||
|
console.log("[DATA]", data);
|
||||||
|
console.log("[STATUS]", status);
|
||||||
|
console.log("[=======End Investment console=======]");
|
||||||
|
|
||||||
|
const publishTime = new Date();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (status === "reject") {
|
||||||
|
const updatedData = await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
catatan: data,
|
||||||
|
masterStatusInvestasiId: "4",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[UPDATE REJECT]", updatedData);
|
||||||
|
} else if (status === "publish") {
|
||||||
|
const updatedData = await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
masterStatusInvestasiId: "1",
|
||||||
|
masterProgresInvestasiId: "1",
|
||||||
|
countDown: publishTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[UPDATE PUBLISH]", updatedData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success update data investment",
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error update data investment",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
104
src/app/api/mobile/admin/investment/route.ts
Normal file
104
src/app/api/mobile/admin/investment/route.ts
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request) {
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
const search = searchParams.get("search");
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = Number(page) * takeData - takeData;
|
||||||
|
|
||||||
|
console.log("[CATEGORY]", category);
|
||||||
|
console.log("[PAGE]", page);
|
||||||
|
|
||||||
|
let fixData;
|
||||||
|
try {
|
||||||
|
if (category === "dashboard") {
|
||||||
|
const publish = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
name: "Publish",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const review = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
name: "Review",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const reject = await prisma.investasi.count({
|
||||||
|
where: {
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
name: "Reject",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = {
|
||||||
|
publish,
|
||||||
|
review,
|
||||||
|
reject,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
const fixCategoryToStatus = _.startCase(category || "");
|
||||||
|
console.log("[STATUS]", fixCategoryToStatus);
|
||||||
|
|
||||||
|
const data = await prisma.investasi.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
active: true,
|
||||||
|
MasterStatusInvestasi: {
|
||||||
|
name: fixCategoryToStatus,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
contains: search || "",
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success get data investment",
|
||||||
|
data: fixData,
|
||||||
|
},
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[ERROR GET DATA INVESTMENT]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error get data investment",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/app/api/mobile/admin/master/type-of-event/[id]/route.ts
Normal file
59
src/app/api/mobile/admin/master/type-of-event/[id]/route.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET, PUT };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.eventMaster_TipeAcara.findUnique({
|
||||||
|
where: {
|
||||||
|
id: Number(id),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Success get type of event",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get type of event", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Error get type of event",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function PUT(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { data } = await request.json();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const updated = await prisma.eventMaster_TipeAcara.update({
|
||||||
|
where: {
|
||||||
|
id: Number(id),
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
name: data.name,
|
||||||
|
active: data.active,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Success update type of event",
|
||||||
|
data: updated,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error update type of event", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Error update type of event",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
70
src/app/api/mobile/admin/master/type-of-event/route.ts
Normal file
70
src/app/api/mobile/admin/master/type-of-event/route.ts
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET, POST };
|
||||||
|
|
||||||
|
async function GET(request: Request) {
|
||||||
|
try {
|
||||||
|
const data = await prisma.eventMaster_TipeAcara.findMany({
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Success get type of event",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error get type of event", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Error get type of event",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function POST(request: Request) {
|
||||||
|
const { data } = await request.json();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const checkList = await prisma.eventMaster_TipeAcara.count({});
|
||||||
|
|
||||||
|
if (!checkList) {
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Type of event already exists",
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const created = await prisma.eventMaster_TipeAcara.create({
|
||||||
|
data: {
|
||||||
|
id: checkList + 1,
|
||||||
|
name: data,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: true,
|
||||||
|
message: "Success create type of event",
|
||||||
|
},
|
||||||
|
{ status: 201 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error create type of event", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error create type of event",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
37
src/app/api/mobile/donation/[id]/disbursement/route.ts
Normal file
37
src/app/api/mobile/donation/[id]/disbursement/route.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { prisma } from "@/lib";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const page = Number(searchParams.get("page"));
|
||||||
|
const takeData = 5;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.donasi_PencairanDana.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "asc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Success get disbursement data",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Error get disbursement data",
|
||||||
|
reason: error as Error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
74
src/app/api/mobile/donation/[id]/donatur/route.ts
Normal file
74
src/app/api/mobile/donation/[id]/donatur/route.ts
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
request: Request,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
let fixData;
|
||||||
|
const { id } = params;
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const page = Number(searchParams.get("page"));
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
fixData = await prisma.donasi_Invoice.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
donasiId: id,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
name: "Berhasil",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
nominal: true,
|
||||||
|
createdAt: true,
|
||||||
|
// updatedAt: true,
|
||||||
|
// DonasiMaster_StatusInvoice: true,
|
||||||
|
// donasiMaster_StatusInvoiceId: true,
|
||||||
|
// Donasi: {
|
||||||
|
// select: {
|
||||||
|
// id: true,
|
||||||
|
// title: true,
|
||||||
|
// target: true,
|
||||||
|
// progres: true,
|
||||||
|
// authorId: true,
|
||||||
|
// imagesId: true,
|
||||||
|
// publishTime: true,
|
||||||
|
// donasiMaster_KategoriId: true,
|
||||||
|
// donasiMaster_DurasiId: true,
|
||||||
|
// donasiMaster_StatusDonasiId: true,
|
||||||
|
// imageDonasi: true,
|
||||||
|
// DonasiMaster_Ketegori: true,
|
||||||
|
// DonasiMaster_Durasi: true,
|
||||||
|
// DonasiMaster_Status: true,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Data berhasil diambil",
|
||||||
|
data: fixData,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Terjadi kesalahan saat mengambil data",
|
||||||
|
reason: error as Error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
|
|||||||
data: {
|
data: {
|
||||||
donasiId: id,
|
donasiId: id,
|
||||||
nominal: data.nominal,
|
nominal: data.nominal,
|
||||||
donasiMaster_BankId: data.bankId,
|
masterBankId: data.bankId,
|
||||||
authorId: data.authorId,
|
authorId: data.authorId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
@@ -48,7 +48,7 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
|
|||||||
reason: (error as Error).message,
|
reason: (error as Error).message,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function GET(request: Request, { params }: { params: { id: string } }) {
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
try {
|
try {
|
||||||
@@ -65,6 +65,7 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
|
|||||||
createdAt: true,
|
createdAt: true,
|
||||||
donasiMaster_BankId: true,
|
donasiMaster_BankId: true,
|
||||||
donasiMaster_StatusInvoiceId: true,
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
MasterBank: true,
|
||||||
Donasi: {
|
Donasi: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -137,13 +138,14 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
|||||||
message: "Status tidak ditemukan",
|
message: "Status tidak ditemukan",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const update = await prisma.donasi_Invoice.update({
|
const update = await prisma.donasi_Invoice.update({
|
||||||
where: {
|
where: {
|
||||||
id: id,
|
id: id,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
donasiMaster_StatusInvoiceId: checkStatus.id,
|
donasiMaster_StatusInvoiceId: checkStatus.id,
|
||||||
imageId: data.fileId,
|
imageId: data || null,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -162,6 +164,8 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[UPDATE INVOICE]", update);
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
status: 200,
|
status: 200,
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ export async function GET(
|
|||||||
const { searchParams } = new URL(request.url);
|
const { searchParams } = new URL(request.url);
|
||||||
const userId = searchParams.get("userId");
|
const userId = searchParams.get("userId");
|
||||||
|
|
||||||
console.log("userId", userId);
|
|
||||||
|
|
||||||
const checkDataEvent = await prisma.event.findUnique({
|
const checkDataEvent = await prisma.event.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: id,
|
id: id,
|
||||||
@@ -53,8 +51,6 @@ export async function GET(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("checkPeserta", checkPeserta);
|
|
||||||
|
|
||||||
if (checkPeserta) {
|
if (checkPeserta) {
|
||||||
peserta = true;
|
peserta = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -116,33 +112,6 @@ export async function POST(
|
|||||||
console.log("id", id);
|
console.log("id", id);
|
||||||
console.log("data", data);
|
console.log("data", data);
|
||||||
|
|
||||||
// const checkEvent = await prisma.event.findUnique({
|
|
||||||
// where: {
|
|
||||||
// id: id,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// if (!checkEvent) {
|
|
||||||
// return NextResponse.json(
|
|
||||||
// { message: "Event Not Found", response: null },
|
|
||||||
// { status: 400 }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const checkPeserta = await prisma.event_Peserta.findFirst({
|
|
||||||
// where: {
|
|
||||||
// userId: userId,
|
|
||||||
// eventId: id,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// if (!checkPeserta) {
|
|
||||||
// return NextResponse.json(
|
|
||||||
// { message: "Peserta Not Found", response: null },
|
|
||||||
// { status: 400 }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (category === "join_and_confirm") {
|
if (category === "join_and_confirm") {
|
||||||
const join = await prisma.event_Peserta.create({
|
const join = await prisma.event_Peserta.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -152,14 +121,13 @@ export async function POST(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("join", join);
|
|
||||||
fixData = join;
|
fixData = join;
|
||||||
} else if (category === "confirmation") {
|
} else if (category === "confirmation") {
|
||||||
const checkPeserta = await prisma.event_Peserta.findFirst({
|
const checkPeserta = await prisma.event_Peserta.findFirst({
|
||||||
where: {
|
where: {
|
||||||
userId: data.userId,
|
userId: data.userId,
|
||||||
eventId: id,
|
eventId: id,
|
||||||
isPresent: true,
|
isPresent: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -179,7 +147,6 @@ export async function POST(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("confirm", confirm);
|
|
||||||
fixData = confirm;
|
fixData = confirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
48
src/app/api/mobile/investment/[id]/investor/route.ts
Normal file
48
src/app/api/mobile/investment/[id]/investor/route.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.investasi_Invoice.findMany({
|
||||||
|
where: {
|
||||||
|
investasiId: id,
|
||||||
|
statusInvoiceId: "1",
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
nominal: true,
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil Mendapatkan Data",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "Error Mendapatkan Data",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,6 +48,9 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
|
|||||||
const category = searchParams.get("category");
|
const category = searchParams.get("category");
|
||||||
const authorId = searchParams.get("authorId");
|
const authorId = searchParams.get("authorId");
|
||||||
|
|
||||||
|
console.log("[ID INVOICE]", id);
|
||||||
|
|
||||||
|
|
||||||
let fixData;
|
let fixData;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -80,6 +83,8 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[DATA INVOICE]", data ? true : false);
|
||||||
|
|
||||||
const { ...allData } = data;
|
const { ...allData } = data;
|
||||||
const Investor = data?.Investasi?.Investasi_Invoice;
|
const Investor = data?.Investasi?.Investasi_Invoice;
|
||||||
fixData = { ...allData, Investor };
|
fixData = { ...allData, Investor };
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
|
|||||||
Profile: true,
|
Profile: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Investasi_Invoice: true,
|
Investasi_Invoice: {
|
||||||
|
where: {
|
||||||
|
statusInvoiceId: "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
MasterStatusInvestasi: true,
|
MasterStatusInvestasi: true,
|
||||||
BeritaInvestasi: true,
|
BeritaInvestasi: true,
|
||||||
DokumenInvestasi: true,
|
DokumenInvestasi: true,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import prisma from "@/lib/prisma";
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
export { POST, GET };
|
export { POST, GET };
|
||||||
|
|
||||||
async function POST(request: Request) {
|
async function POST(request: Request) {
|
||||||
const { data } = await request.json();
|
const { data } = await request.json();
|
||||||
console.log(["DATA INVESTASI"], data);
|
console.log(["DATA INVESTASI"], data);
|
||||||
@@ -46,82 +47,112 @@ async function POST(request: Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function GET(request: Request) {
|
async function GET(request: Request) {
|
||||||
let fixData;
|
|
||||||
const { searchParams } = new URL(request.url);
|
const { searchParams } = new URL(request.url);
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
const authorId = searchParams.get("authorId");
|
||||||
|
|
||||||
|
console.log("[CATEGORY]", category);
|
||||||
|
console.log("[AUTHOR ID]", authorId);
|
||||||
|
let fixData;
|
||||||
try {
|
try {
|
||||||
const data = await prisma.investasi.findMany({
|
if (category === "bursa") {
|
||||||
where: {
|
const data = await prisma.investasi.findMany({
|
||||||
masterStatusInvestasiId: "1",
|
where: {
|
||||||
masterProgresInvestasiId: "1",
|
masterStatusInvestasiId: "1",
|
||||||
},
|
masterProgresInvestasiId: "1",
|
||||||
select: {
|
},
|
||||||
id: true,
|
select: {
|
||||||
MasterPencarianInvestor: true,
|
id: true,
|
||||||
countDown: true,
|
MasterPencarianInvestor: true,
|
||||||
progress: true,
|
countDown: true,
|
||||||
},
|
progress: true,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
|
||||||
for (let a of data) {
|
for (let a of data) {
|
||||||
if (
|
if (
|
||||||
(a.MasterPencarianInvestor?.name as any) -
|
(a.MasterPencarianInvestor?.name as any) -
|
||||||
moment(new Date()).diff(new Date(a.countDown as any), "days") <=
|
moment(new Date()).diff(new Date(a.countDown as any), "days") <=
|
||||||
0
|
0
|
||||||
) {
|
) {
|
||||||
await prisma.investasi.update({
|
await prisma.investasi.update({
|
||||||
where: {
|
where: {
|
||||||
id: a.id,
|
id: a.id,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
masterProgresInvestasiId: "3",
|
masterProgresInvestasiId: "3",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a.progress === "100") {
|
||||||
|
await prisma.investasi.update({
|
||||||
|
where: {
|
||||||
|
id: a.id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
masterProgresInvestasiId: "2",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a.progress === "100") {
|
const dataAwal = await prisma.investasi.findMany({
|
||||||
await prisma.investasi.update({
|
orderBy: [
|
||||||
where: {
|
{
|
||||||
id: a.id,
|
masterProgresInvestasiId: "asc",
|
||||||
},
|
},
|
||||||
data: {
|
{
|
||||||
masterProgresInvestasiId: "2",
|
countDown: "desc",
|
||||||
},
|
},
|
||||||
});
|
],
|
||||||
}
|
where: {
|
||||||
}
|
masterStatusInvestasiId: "1",
|
||||||
|
|
||||||
const dataAwal = await prisma.investasi.findMany({
|
|
||||||
orderBy: [
|
|
||||||
{
|
|
||||||
masterProgresInvestasiId: "asc",
|
|
||||||
},
|
},
|
||||||
{
|
select: {
|
||||||
countDown: "desc",
|
id: true,
|
||||||
},
|
imageId: true,
|
||||||
],
|
title: true,
|
||||||
where: {
|
progress: true,
|
||||||
masterStatusInvestasiId: "1",
|
countDown: true,
|
||||||
},
|
MasterPencarianInvestor: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
name: true,
|
||||||
imageId: true,
|
},
|
||||||
title: true,
|
|
||||||
progress: true,
|
|
||||||
countDown: true,
|
|
||||||
MasterPencarianInvestor: {
|
|
||||||
select: {
|
|
||||||
name: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
|
||||||
fixData = dataAwal.map((v: any) => ({
|
fixData = dataAwal.map((v: any) => ({
|
||||||
..._.omit(v, ["MasterPencarianInvestor"]),
|
..._.omit(v, ["MasterPencarianInvestor"]),
|
||||||
pencarianInvestor: v.MasterPencarianInvestor.name,
|
pencarianInvestor: v.MasterPencarianInvestor.name,
|
||||||
}));
|
}));
|
||||||
|
} else if (category === "my-holding") {
|
||||||
|
const data = await prisma.investasi_Invoice.findMany({
|
||||||
|
where: {
|
||||||
|
authorId: authorId,
|
||||||
|
statusInvoiceId: "1",
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
investasiId: true,
|
||||||
|
nominal: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
Investasi: {
|
||||||
|
select: {
|
||||||
|
title: true,
|
||||||
|
progress: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = data.map((v: any) => ({
|
||||||
|
..._.omit(v, ["Investasi"]),
|
||||||
|
title: v.Investasi.title,
|
||||||
|
progress: v.Investasi.progress,
|
||||||
|
}));
|
||||||
|
}
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
status: 200,
|
status: 200,
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
30
src/app/api/mobile/master/transaction-status/route.ts
Normal file
30
src/app/api/mobile/master/transaction-status/route.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { prisma } from "@/lib";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function GET(request: Request) {
|
||||||
|
try {
|
||||||
|
const res = await prisma.masterStatusTransaksi.findMany({
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "asc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: true, message: "Berhasil mendapatkan data", data: res },
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "API Error Get Data",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,10 +13,10 @@ export async function adminInvestasi_funAcceptTransaksiById({
|
|||||||
invoiceId: string;
|
invoiceId: string;
|
||||||
investasiId: string;
|
investasiId: string;
|
||||||
lembarTerbeli: string;
|
lembarTerbeli: string;
|
||||||
}) {
|
}) {
|
||||||
console.log("Ini invoiceid", invoiceId)
|
console.log("Ini invoiceid", invoiceId);
|
||||||
console.log("Ini investasid", investasiId)
|
console.log("Ini investasid", investasiId);
|
||||||
console.log("Ini lembar terbeli", lembarTerbeli)
|
console.log("Ini lembar terbeli", lembarTerbeli);
|
||||||
|
|
||||||
const dataInvestasi: any = await prisma.investasi.findFirst({
|
const dataInvestasi: any = await prisma.investasi.findFirst({
|
||||||
where: {
|
where: {
|
||||||
@@ -50,7 +50,6 @@ export async function adminInvestasi_funAcceptTransaksiById({
|
|||||||
statusInvoiceId: "1",
|
statusInvoiceId: "1",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (!updt) {
|
if (!updt) {
|
||||||
return { status: 400, message: "Gagal Update Status" };
|
return { status: 400, message: "Gagal Update Status" };
|
||||||
@@ -87,6 +86,3 @@ export async function adminInvestasi_funAcceptTransaksiById({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ const CONFIG: MiddlewareConfig = {
|
|||||||
userPath: "/dev/home",
|
userPath: "/dev/home",
|
||||||
publicRoutes: [
|
publicRoutes: [
|
||||||
"/",
|
"/",
|
||||||
|
"/.well-known/*",
|
||||||
|
"/privacy-policy.html",
|
||||||
"/api/not-user/*",
|
"/api/not-user/*",
|
||||||
"/api/voting/*",
|
"/api/voting/*",
|
||||||
"/api/collaboration/*",
|
"/api/collaboration/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user