Closed rohansen856 closed 1 week ago
@rohansen856 is attempting to deploy a commit to the Busify Team on Vercel.
A member of the Team first needs to authorize it.
@rohansen856 we will be having relationship between tickets and orders as well , it make it easier for the other issue for data fetching , please make changes according to this schema
@RISHIKESHk07 i will fix the issue and update the schema with the correct relationships, and also check if there is any need to change the data fetching method using prisma with the updated relationship.
@RISHIKESHk07 @Pratik2026 i have updated the schema.prisma
file to make relations between orders, tickets and schedule schma. also updated the data fetching method in order.service.ts
in my latest pr.
the current relationship is:
model Schedule {
id String @id
busNumber String
bus Bus @relation(fields: [busNumber], references: [number])
checkpoints String[]
from String
to String
departureTime String
days String[]
ticketPrice Int
orders Order[]
}
model Ticket {
id Int @id @default(autoincrement())
orderId String @unique
passengerEmail String[]
order Order @relation(fields: [orderId], references: [id])
}
model Order {
id String @id
userId String
scheduleId String
status String @default("pending") // how to make this enum
amount Int
attempts Int @default(0)
receipt String @unique
createdAt DateTime @default(now())
user Users @relation(fields: [userId], references: [id])
ticket Ticket?
schedule Schedule @relation(fields: [scheduleId], references: [id])
}
the relationship are:
order -> ticket
: one-to-oneschedule -> order
: many to one
thank you.
@Pratik2026 LGTM codewise , any changes as per you ?
@rohansen856 did you verify if page works when we add a ticket through the razorpay UI (dummy order) instead of seeding the data ? i tried it here (Left: Busify & Right:Ptisma Studio) , there is a ticket created but does not appear in the admin page , maybe its a date issue , you can test razorpay UPI with success@razorpay
@RISHIKESHk07 i will double check the payments issue with razorpay, and also check any issues with the data.
@RISHIKESHk07 i have solved the following issues in the latest pr:
Ticket
schema with the discussed changes.prisma/seed.mjs
.orders.service.ts
to fix the issue with the date object in razorpay payment datetime.new Date()
.frontend/src/components/AdminPanel/OrderDetailsCard/index.tsx
.
proof of work:https://github.com/bsoc-bitbyte/busify/assets/108976786/e01cbc5c-5195-46ae-b71b-cd60db4765d8
https://github.com/bsoc-bitbyte/busify/assets/108976786/57c85be1-8913-4363-9193-5273edd08616
thank you.
Overview
Essential Checklist
Proof that changes are correct
responsiveness:
![Screenshot 2024-06-16 232523](https://github.com/bsoc-bitbyte/busify/assets/108976786/cbbf4422-5506-4686-8d10-f7839a62614b)
works done in this pr:
frontend
View Details
backend
orders.service.ts
file to add the logic to get the data in required formatorders.controller.ts
file to add the route handler to get the details.PR Pointers