mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 21:28:23 +00:00
Enhance payment processing and device management features
- Introduced wallet payment option in verifyPayment function to allow users to pay using their wallet balance. - Added new BlockDeviceDialog component for managing device blocking and unblocking actions. - Updated DeviceCard component to display device status and integrate blocking functionality. - Refactored DevicesTable to utilize DeviceCard for better UI representation of devices. - Implemented Wallet component to manage wallet balance and top-up functionality. - Enhanced API routes and Prisma schema to support wallet transactions and device blocking reasons. - Improved overall user experience with responsive design adjustments and new UI elements. These changes improve user control over payments and device management, enhancing the overall functionality of the application.
This commit is contained in:
2
prisma/migrations/20241224110841_add/migration.sql
Normal file
2
prisma/migrations/20241224110841_add/migration.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "user" ADD COLUMN "walletBalance" DOUBLE PRECISION NOT NULL DEFAULT 0;
|
2
prisma/migrations/20241224111353_add/migration.sql
Normal file
2
prisma/migrations/20241224111353_add/migration.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Device" ADD COLUMN "reasonForBlocking" TEXT;
|
11
prisma/migrations/20241224145258_add/migration.sql
Normal file
11
prisma/migrations/20241224145258_add/migration.sql
Normal file
@ -0,0 +1,11 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Topup" (
|
||||
"id" TEXT NOT NULL,
|
||||
"amount" DOUBLE PRECISION NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"paid" BOOLEAN NOT NULL DEFAULT false,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "Topup_pkey" PRIMARY KEY ("id")
|
||||
);
|
@ -35,6 +35,7 @@ model User {
|
||||
phoneNumberVerified Boolean @default(false)
|
||||
termsAccepted Boolean @default(false)
|
||||
policyAccepted Boolean @default(false)
|
||||
walletBalance Float @default(0)
|
||||
|
||||
devices Device[]
|
||||
|
||||
@ -110,19 +111,20 @@ model Island {
|
||||
}
|
||||
|
||||
model Device {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
mac String
|
||||
isActive Boolean @default(false)
|
||||
registered Boolean @default(false)
|
||||
blocked Boolean @default(false)
|
||||
expiryDate DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
payment Payment? @relation(fields: [paymentId], references: [id])
|
||||
paymentId String?
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
mac String
|
||||
reasonForBlocking String?
|
||||
isActive Boolean @default(false)
|
||||
registered Boolean @default(false)
|
||||
blocked Boolean @default(false)
|
||||
expiryDate DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
User User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
payment Payment? @relation(fields: [paymentId], references: [id])
|
||||
paymentId String?
|
||||
}
|
||||
|
||||
model Payment {
|
||||
@ -147,3 +149,12 @@ model BillFormula {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Topup {
|
||||
id String @id @default(cuid())
|
||||
amount Float
|
||||
userId String
|
||||
paid Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
Reference in New Issue
Block a user