general destination and verify

This commit is contained in:
2026-05-08 18:23:51 +07:00
parent 2de8ac4086
commit 63349a144d
21 changed files with 2535 additions and 56 deletions
+6
View File
@@ -22,6 +22,12 @@ export * from './enums';
*
*/
export type User = Prisma.UserModel
/**
* Model UserProfile
* Profil sosial publik. Berisi info yang user pilih untuk dibagikan ke peserta lain
* (bio, kota, minat). Tidak menyimpan data sensitif — KYC tetap di OrganizerVerification.
*/
export type UserProfile = Prisma.UserProfileModel
/**
* Model Account
* Tabel link akun OAuth pihak ketiga (Google, dst). Diisi oleh PrismaAdapter NextAuth.
+6
View File
@@ -46,6 +46,12 @@ export { Prisma }
*
*/
export type User = Prisma.UserModel
/**
* Model UserProfile
* Profil sosial publik. Berisi info yang user pilih untuk dibagikan ke peserta lain
* (bio, kota, minat). Tidak menyimpan data sensitif — KYC tetap di OrganizerVerification.
*/
export type UserProfile = Prisma.UserProfileModel
/**
* Model Account
* Tabel link akun OAuth pihak ketiga (Google, dst). Diisi oleh PrismaAdapter NextAuth.
File diff suppressed because one or more lines are too long
@@ -385,6 +385,7 @@ type FieldRefInputType<Model, FieldType> = Model extends never ? never : FieldRe
export const ModelName = {
User: 'User',
UserProfile: 'UserProfile',
Account: 'Account',
OrganizerVerification: 'OrganizerVerification',
Trip: 'Trip',
@@ -406,7 +407,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions
}
meta: {
modelProps: "user" | "account" | "organizerVerification" | "trip" | "tripReview" | "tripImage" | "tripParticipant"
modelProps: "user" | "userProfile" | "account" | "organizerVerification" | "trip" | "tripReview" | "tripImage" | "tripParticipant"
txIsolationLevel: TransactionIsolationLevel
}
model: {
@@ -484,6 +485,80 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
}
}
}
UserProfile: {
payload: Prisma.$UserProfilePayload<ExtArgs>
fields: Prisma.UserProfileFieldRefs
operations: {
findUnique: {
args: Prisma.UserProfileFindUniqueArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload> | null
}
findUniqueOrThrow: {
args: Prisma.UserProfileFindUniqueOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
findFirst: {
args: Prisma.UserProfileFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload> | null
}
findFirstOrThrow: {
args: Prisma.UserProfileFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
findMany: {
args: Prisma.UserProfileFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>[]
}
create: {
args: Prisma.UserProfileCreateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
createMany: {
args: Prisma.UserProfileCreateManyArgs<ExtArgs>
result: BatchPayload
}
createManyAndReturn: {
args: Prisma.UserProfileCreateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>[]
}
delete: {
args: Prisma.UserProfileDeleteArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
update: {
args: Prisma.UserProfileUpdateArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
deleteMany: {
args: Prisma.UserProfileDeleteManyArgs<ExtArgs>
result: BatchPayload
}
updateMany: {
args: Prisma.UserProfileUpdateManyArgs<ExtArgs>
result: BatchPayload
}
updateManyAndReturn: {
args: Prisma.UserProfileUpdateManyAndReturnArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>[]
}
upsert: {
args: Prisma.UserProfileUpsertArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$UserProfilePayload>
}
aggregate: {
args: Prisma.UserProfileAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateUserProfile>
}
groupBy: {
args: Prisma.UserProfileGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.UserProfileGroupByOutputType>[]
}
count: {
args: Prisma.UserProfileCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.UserProfileCountAggregateOutputType> | number
}
}
}
Account: {
payload: Prisma.$AccountPayload<ExtArgs>
fields: Prisma.AccountFieldRefs
@@ -983,6 +1058,20 @@ export const UserScalarFieldEnum = {
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
export const UserProfileScalarFieldEnum = {
id: 'id',
userId: 'userId',
bio: 'bio',
city: 'city',
interests: 'interests',
instagram: 'instagram',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type UserProfileScalarFieldEnum = (typeof UserProfileScalarFieldEnum)[keyof typeof UserProfileScalarFieldEnum]
export const AccountScalarFieldEnum = {
id: 'id',
userId: 'userId',
@@ -1346,6 +1435,7 @@ export type PrismaClientOptions = ({
}
export type GlobalOmitConfig = {
user?: Prisma.UserOmit
userProfile?: Prisma.UserProfileOmit
account?: Prisma.AccountOmit
organizerVerification?: Prisma.OrganizerVerificationOmit
trip?: Prisma.TripOmit
@@ -52,6 +52,7 @@ export const AnyNull = runtime.AnyNull
export const ModelName = {
User: 'User',
UserProfile: 'UserProfile',
Account: 'Account',
OrganizerVerification: 'OrganizerVerification',
Trip: 'Trip',
@@ -92,6 +93,20 @@ export const UserScalarFieldEnum = {
export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum]
export const UserProfileScalarFieldEnum = {
id: 'id',
userId: 'userId',
bio: 'bio',
city: 'city',
interests: 'interests',
instagram: 'instagram',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
} as const
export type UserProfileScalarFieldEnum = (typeof UserProfileScalarFieldEnum)[keyof typeof UserProfileScalarFieldEnum]
export const AccountScalarFieldEnum = {
id: 'id',
userId: 'userId',
+1
View File
@@ -9,6 +9,7 @@
* 🟢 You can import this file directly.
*/
export type * from './models/User'
export type * from './models/UserProfile'
export type * from './models/Account'
export type * from './models/OrganizerVerification'
export type * from './models/Trip'
+160
View File
@@ -228,6 +228,7 @@ export type UserWhereInput = {
tripReviews?: Prisma.TripReviewListRelationFilter
organizerVerification?: Prisma.XOR<Prisma.OrganizerVerificationNullableScalarRelationFilter, Prisma.OrganizerVerificationWhereInput> | null
reviewedVerifications?: Prisma.OrganizerVerificationListRelationFilter
profile?: Prisma.XOR<Prisma.UserProfileNullableScalarRelationFilter, Prisma.UserProfileWhereInput> | null
}
export type UserOrderByWithRelationInput = {
@@ -247,6 +248,7 @@ export type UserOrderByWithRelationInput = {
tripReviews?: Prisma.TripReviewOrderByRelationAggregateInput
organizerVerification?: Prisma.OrganizerVerificationOrderByWithRelationInput
reviewedVerifications?: Prisma.OrganizerVerificationOrderByRelationAggregateInput
profile?: Prisma.UserProfileOrderByWithRelationInput
}
export type UserWhereUniqueInput = Prisma.AtLeast<{
@@ -269,6 +271,7 @@ export type UserWhereUniqueInput = Prisma.AtLeast<{
tripReviews?: Prisma.TripReviewListRelationFilter
organizerVerification?: Prisma.XOR<Prisma.OrganizerVerificationNullableScalarRelationFilter, Prisma.OrganizerVerificationWhereInput> | null
reviewedVerifications?: Prisma.OrganizerVerificationListRelationFilter
profile?: Prisma.XOR<Prisma.UserProfileNullableScalarRelationFilter, Prisma.UserProfileWhereInput> | null
}, "id" | "email">
export type UserOrderByWithAggregationInput = {
@@ -320,6 +323,7 @@ export type UserCreateInput = {
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateInput = {
@@ -339,6 +343,7 @@ export type UserUncheckedCreateInput = {
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserUpdateInput = {
@@ -358,6 +363,7 @@ export type UserUpdateInput = {
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateInput = {
@@ -377,6 +383,7 @@ export type UserUncheckedUpdateInput = {
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserCreateManyInput = {
@@ -487,6 +494,20 @@ export type DateTimeFieldUpdateOperationsInput = {
set?: Date | string
}
export type UserCreateNestedOneWithoutProfileInput = {
create?: Prisma.XOR<Prisma.UserCreateWithoutProfileInput, Prisma.UserUncheckedCreateWithoutProfileInput>
connectOrCreate?: Prisma.UserCreateOrConnectWithoutProfileInput
connect?: Prisma.UserWhereUniqueInput
}
export type UserUpdateOneRequiredWithoutProfileNestedInput = {
create?: Prisma.XOR<Prisma.UserCreateWithoutProfileInput, Prisma.UserUncheckedCreateWithoutProfileInput>
connectOrCreate?: Prisma.UserCreateOrConnectWithoutProfileInput
upsert?: Prisma.UserUpsertWithoutProfileInput
connect?: Prisma.UserWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutProfileInput, Prisma.UserUpdateWithoutProfileInput>, Prisma.UserUncheckedUpdateWithoutProfileInput>
}
export type UserCreateNestedOneWithoutAccountsInput = {
create?: Prisma.XOR<Prisma.UserCreateWithoutAccountsInput, Prisma.UserUncheckedCreateWithoutAccountsInput>
connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput
@@ -573,6 +594,98 @@ export type UserUpdateOneRequiredWithoutParticipationsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.UserUpdateToOneWithWhereWithoutParticipationsInput, Prisma.UserUpdateWithoutParticipationsInput>, Prisma.UserUncheckedUpdateWithoutParticipationsInput>
}
export type UserCreateWithoutProfileInput = {
id?: string
name: string
email: string
password?: string | null
image?: string | null
emailVerified?: Date | string | null
acceptedTermsAndPrivacy?: boolean
acceptedAt?: Date | string | null
createdAt?: Date | string
updatedAt?: Date | string
accounts?: Prisma.AccountCreateNestedManyWithoutUserInput
trips?: Prisma.TripCreateNestedManyWithoutOrganizerInput
participations?: Prisma.TripParticipantCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
}
export type UserUncheckedCreateWithoutProfileInput = {
id?: string
name: string
email: string
password?: string | null
image?: string | null
emailVerified?: Date | string | null
acceptedTermsAndPrivacy?: boolean
acceptedAt?: Date | string | null
createdAt?: Date | string
updatedAt?: Date | string
accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput
trips?: Prisma.TripUncheckedCreateNestedManyWithoutOrganizerInput
participations?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
}
export type UserCreateOrConnectWithoutProfileInput = {
where: Prisma.UserWhereUniqueInput
create: Prisma.XOR<Prisma.UserCreateWithoutProfileInput, Prisma.UserUncheckedCreateWithoutProfileInput>
}
export type UserUpsertWithoutProfileInput = {
update: Prisma.XOR<Prisma.UserUpdateWithoutProfileInput, Prisma.UserUncheckedUpdateWithoutProfileInput>
create: Prisma.XOR<Prisma.UserCreateWithoutProfileInput, Prisma.UserUncheckedCreateWithoutProfileInput>
where?: Prisma.UserWhereInput
}
export type UserUpdateToOneWithWhereWithoutProfileInput = {
where?: Prisma.UserWhereInput
data: Prisma.XOR<Prisma.UserUpdateWithoutProfileInput, Prisma.UserUncheckedUpdateWithoutProfileInput>
}
export type UserUpdateWithoutProfileInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.StringFieldUpdateOperationsInput | string
password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
emailVerified?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
acceptedTermsAndPrivacy?: Prisma.BoolFieldUpdateOperationsInput | boolean
acceptedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput
trips?: Prisma.TripUpdateManyWithoutOrganizerNestedInput
participations?: Prisma.TripParticipantUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
}
export type UserUncheckedUpdateWithoutProfileInput = {
id?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.StringFieldUpdateOperationsInput | string
password?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
image?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
emailVerified?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
acceptedTermsAndPrivacy?: Prisma.BoolFieldUpdateOperationsInput | boolean
acceptedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput
trips?: Prisma.TripUncheckedUpdateManyWithoutOrganizerNestedInput
participations?: Prisma.TripParticipantUncheckedUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
}
export type UserCreateWithoutAccountsInput = {
id?: string
name: string
@@ -589,6 +702,7 @@ export type UserCreateWithoutAccountsInput = {
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutAccountsInput = {
@@ -607,6 +721,7 @@ export type UserUncheckedCreateWithoutAccountsInput = {
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutAccountsInput = {
@@ -641,6 +756,7 @@ export type UserUpdateWithoutAccountsInput = {
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutAccountsInput = {
@@ -659,6 +775,7 @@ export type UserUncheckedUpdateWithoutAccountsInput = {
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserCreateWithoutOrganizerVerificationInput = {
@@ -677,6 +794,7 @@ export type UserCreateWithoutOrganizerVerificationInput = {
participations?: Prisma.TripParticipantCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutOrganizerVerificationInput = {
@@ -695,6 +813,7 @@ export type UserUncheckedCreateWithoutOrganizerVerificationInput = {
participations?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutOrganizerVerificationInput = {
@@ -718,6 +837,7 @@ export type UserCreateWithoutReviewedVerificationsInput = {
participations?: Prisma.TripParticipantCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutReviewedVerificationsInput = {
@@ -736,6 +856,7 @@ export type UserUncheckedCreateWithoutReviewedVerificationsInput = {
participations?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutUserInput
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutReviewedVerificationsInput = {
@@ -770,6 +891,7 @@ export type UserUpdateWithoutOrganizerVerificationInput = {
participations?: Prisma.TripParticipantUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutOrganizerVerificationInput = {
@@ -788,6 +910,7 @@ export type UserUncheckedUpdateWithoutOrganizerVerificationInput = {
participations?: Prisma.TripParticipantUncheckedUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserUpsertWithoutReviewedVerificationsInput = {
@@ -817,6 +940,7 @@ export type UserUpdateWithoutReviewedVerificationsInput = {
participations?: Prisma.TripParticipantUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutReviewedVerificationsInput = {
@@ -835,6 +959,7 @@ export type UserUncheckedUpdateWithoutReviewedVerificationsInput = {
participations?: Prisma.TripParticipantUncheckedUpdateManyWithoutUserNestedInput
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserCreateWithoutTripsInput = {
@@ -853,6 +978,7 @@ export type UserCreateWithoutTripsInput = {
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutTripsInput = {
@@ -871,6 +997,7 @@ export type UserUncheckedCreateWithoutTripsInput = {
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutTripsInput = {
@@ -905,6 +1032,7 @@ export type UserUpdateWithoutTripsInput = {
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutTripsInput = {
@@ -923,6 +1051,7 @@ export type UserUncheckedUpdateWithoutTripsInput = {
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserCreateWithoutTripReviewsInput = {
@@ -941,6 +1070,7 @@ export type UserCreateWithoutTripReviewsInput = {
participations?: Prisma.TripParticipantCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutTripReviewsInput = {
@@ -959,6 +1089,7 @@ export type UserUncheckedCreateWithoutTripReviewsInput = {
participations?: Prisma.TripParticipantUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutTripReviewsInput = {
@@ -993,6 +1124,7 @@ export type UserUpdateWithoutTripReviewsInput = {
participations?: Prisma.TripParticipantUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutTripReviewsInput = {
@@ -1011,6 +1143,7 @@ export type UserUncheckedUpdateWithoutTripReviewsInput = {
participations?: Prisma.TripParticipantUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
export type UserCreateWithoutParticipationsInput = {
@@ -1029,6 +1162,7 @@ export type UserCreateWithoutParticipationsInput = {
tripReviews?: Prisma.TripReviewCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileCreateNestedOneWithoutUserInput
}
export type UserUncheckedCreateWithoutParticipationsInput = {
@@ -1047,6 +1181,7 @@ export type UserUncheckedCreateWithoutParticipationsInput = {
tripReviews?: Prisma.TripReviewUncheckedCreateNestedManyWithoutUserInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedCreateNestedOneWithoutUserInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedCreateNestedManyWithoutReviewedByInput
profile?: Prisma.UserProfileUncheckedCreateNestedOneWithoutUserInput
}
export type UserCreateOrConnectWithoutParticipationsInput = {
@@ -1081,6 +1216,7 @@ export type UserUpdateWithoutParticipationsInput = {
tripReviews?: Prisma.TripReviewUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUpdateOneWithoutUserNestedInput
}
export type UserUncheckedUpdateWithoutParticipationsInput = {
@@ -1099,6 +1235,7 @@ export type UserUncheckedUpdateWithoutParticipationsInput = {
tripReviews?: Prisma.TripReviewUncheckedUpdateManyWithoutUserNestedInput
organizerVerification?: Prisma.OrganizerVerificationUncheckedUpdateOneWithoutUserNestedInput
reviewedVerifications?: Prisma.OrganizerVerificationUncheckedUpdateManyWithoutReviewedByNestedInput
profile?: Prisma.UserProfileUncheckedUpdateOneWithoutUserNestedInput
}
@@ -1185,6 +1322,7 @@ export type UserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = r
tripReviews?: boolean | Prisma.User$tripReviewsArgs<ExtArgs>
organizerVerification?: boolean | Prisma.User$organizerVerificationArgs<ExtArgs>
reviewedVerifications?: boolean | Prisma.User$reviewedVerificationsArgs<ExtArgs>
profile?: boolean | Prisma.User$profileArgs<ExtArgs>
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["user"]>
@@ -1235,6 +1373,7 @@ export type UserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs =
tripReviews?: boolean | Prisma.User$tripReviewsArgs<ExtArgs>
organizerVerification?: boolean | Prisma.User$organizerVerificationArgs<ExtArgs>
reviewedVerifications?: boolean | Prisma.User$reviewedVerificationsArgs<ExtArgs>
profile?: boolean | Prisma.User$profileArgs<ExtArgs>
_count?: boolean | Prisma.UserCountOutputTypeDefaultArgs<ExtArgs>
}
export type UserIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {}
@@ -1249,6 +1388,7 @@ export type $UserPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs =
tripReviews: Prisma.$TripReviewPayload<ExtArgs>[]
organizerVerification: Prisma.$OrganizerVerificationPayload<ExtArgs> | null
reviewedVerifications: Prisma.$OrganizerVerificationPayload<ExtArgs>[]
profile: Prisma.$UserProfilePayload<ExtArgs> | null
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: string
@@ -1673,6 +1813,7 @@ export interface Prisma__UserClient<T, Null = never, ExtArgs extends runtime.Typ
tripReviews<T extends Prisma.User$tripReviewsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$tripReviewsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$TripReviewPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
organizerVerification<T extends Prisma.User$organizerVerificationArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$organizerVerificationArgs<ExtArgs>>): Prisma.Prisma__OrganizerVerificationClient<runtime.Types.Result.GetResult<Prisma.$OrganizerVerificationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
reviewedVerifications<T extends Prisma.User$reviewedVerificationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$reviewedVerificationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrganizerVerificationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
profile<T extends Prisma.User$profileArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.User$profileArgs<ExtArgs>>): Prisma.Prisma__UserProfileClient<runtime.Types.Result.GetResult<Prisma.$UserProfilePayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
@@ -2243,6 +2384,25 @@ export type User$reviewedVerificationsArgs<ExtArgs extends runtime.Types.Extensi
distinct?: Prisma.OrganizerVerificationScalarFieldEnum | Prisma.OrganizerVerificationScalarFieldEnum[]
}
/**
* User.profile
*/
export type User$profileArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the UserProfile
*/
select?: Prisma.UserProfileSelect<ExtArgs> | null
/**
* Omit specific fields from the UserProfile
*/
omit?: Prisma.UserProfileOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.UserProfileInclude<ExtArgs> | null
where?: Prisma.UserProfileWhereInput
}
/**
* User without action
*/
File diff suppressed because it is too large Load Diff
+22 -1
View File
@@ -7,6 +7,7 @@ import { authOptions } from "@/lib/auth";
import { profileService } from "@/server/services/profile.service";
import { TripCard } from "@/features/trip/components/trip-card";
import { ProfileTripRow } from "@/features/profile/components/profile-trip-row";
import { ProfileEditor } from "@/features/profile/components/profile-editor";
export const metadata: Metadata = {
title: "Profil Saya",
@@ -19,7 +20,10 @@ export default async function ProfilePage() {
redirect("/login?callbackUrl=/profile");
}
const data = await profileService.getProfileDashboard(session.user.id);
const [data, ownProfile] = await Promise.all([
profileService.getProfileDashboard(session.user.id),
profileService.getOwnProfile(session.user.id),
]);
const {
user,
isVerifiedOrganizer,
@@ -80,6 +84,23 @@ export default async function ProfilePage() {
</Link>
</div>
{/* Profil sosial publik */}
<div className="mb-6">
<ProfileEditor
userId={user.id}
initial={
ownProfile
? {
bio: ownProfile.bio,
city: ownProfile.city,
interests: ownProfile.interests,
instagram: ownProfile.instagram,
}
: null
}
/>
</div>
{/* Trip selesai — akses ulasan (trip ini tidak muncul di Open Trip) */}
{reviewable.length > 0 && (
<section className="mb-8 rounded-2xl border border-amber-200 bg-amber-50/60 p-4 sm:p-5">
+9 -5
View File
@@ -301,9 +301,12 @@ export default async function TripDetailPage({
</span>
<div className="min-w-0">
<p className="text-[10px] font-medium text-neutral-400 sm:text-xs">Organizer</p>
<p className="truncate text-xs font-semibold text-neutral-800 sm:text-sm">
<Link
href={`/u/${trip.organizer.id}`}
className="truncate text-xs font-semibold text-neutral-800 hover:text-primary-700 sm:text-sm"
>
{trip.organizer.name}
</p>
</Link>
</div>
</div>
</div>
@@ -458,9 +461,10 @@ export default async function TripDetailPage({
) : (
<div className="flex flex-wrap gap-1.5 sm:gap-2">
{confirmedParticipants.map((p) => (
<div
<Link
key={p.id}
className="flex items-center gap-1.5 rounded-full bg-neutral-100 px-2.5 py-1 sm:gap-2 sm:px-3 sm:py-1.5"
href={`/u/${p.user.id}`}
className="flex items-center gap-1.5 rounded-full bg-neutral-100 px-2.5 py-1 transition-colors hover:bg-primary-100 sm:gap-2 sm:px-3 sm:py-1.5"
>
<div className="flex h-5 w-5 items-center justify-center rounded-full bg-primary-600 text-[9px] font-bold text-white sm:h-6 sm:w-6 sm:text-[10px]">
{p.user.name.charAt(0).toUpperCase()}
@@ -468,7 +472,7 @@ export default async function TripDetailPage({
<span className="text-xs font-medium text-neutral-700 sm:text-sm">
{p.user.name}
</span>
</div>
</Link>
))}
</div>
)}
+225
View File
@@ -0,0 +1,225 @@
import type { Metadata } from "next";
import Link from "next/link";
import Image from "next/image";
import { notFound } from "next/navigation";
import { profileService } from "@/server/services/profile.service";
import { TripCard } from "@/features/trip/components/trip-card";
import { ProfileTripRow } from "@/features/profile/components/profile-trip-row";
import { siteConfig } from "@/lib/site";
interface PageProps {
params: Promise<{ id: string }>;
}
export async function generateMetadata({
params,
}: PageProps): Promise<Metadata> {
const { id } = await params;
const data = await profileService.getPublicProfile(id);
if (!data) {
return { title: "Profil tidak ditemukan", robots: { index: false } };
}
const { user } = data;
const title = `${user.name} — Profil`;
const desc =
user.profile?.bio?.slice(0, 160) ||
`Lihat profil ${user.name} di ${siteConfig.name}: trip yang dibuat, trip yang diikuti, dan minat aktivitas.`;
return {
title,
description: desc,
alternates: { canonical: `/u/${id}` },
openGraph: { title, description: desc, url: `/u/${id}` },
};
}
export default async function PublicProfilePage({ params }: PageProps) {
const { id } = await params;
const data = await profileService.getPublicProfile(id);
if (!data) notFound();
const { user, isVerifiedOrganizer, organizedTrips, joinedTrips } = data;
const profile = user.profile;
const memberSince = new Date(user.createdAt).toLocaleDateString("id-ID", {
month: "long",
year: "numeric",
});
return (
<div className="mx-auto max-w-4xl px-4 py-6 sm:py-8">
{/* Header */}
<section className="rounded-2xl border border-neutral-200 bg-white p-5 shadow-sm sm:p-6">
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:gap-5">
<div className="relative h-20 w-20 shrink-0 overflow-hidden rounded-full bg-neutral-200 sm:h-24 sm:w-24">
{user.image ? (
<Image
src={user.image}
alt={user.name}
fill
sizes="96px"
className="object-cover"
/>
) : (
<div className="flex h-full items-center justify-center text-2xl font-bold text-neutral-500">
{user.name.charAt(0).toUpperCase()}
</div>
)}
</div>
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2">
<h1 className="text-xl font-bold text-neutral-800 sm:text-2xl">
{user.name}
</h1>
{isVerifiedOrganizer && (
<span
className="inline-flex items-center gap-0.5 rounded-full bg-primary-100 px-2 py-0.5 text-[11px] font-bold uppercase tracking-wide text-primary-800"
title="Identitas organizer telah diverifikasi (KTP & rekening)"
>
Verified Organizer
</span>
)}
</div>
<div className="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-neutral-500">
{profile?.city && (
<span className="inline-flex items-center gap-1">
📍 {profile.city}
</span>
)}
<span className="text-xs">Bergabung sejak {memberSince}</span>
</div>
{profile?.bio && (
<p className="mt-3 whitespace-pre-line text-sm text-neutral-700">
{profile.bio}
</p>
)}
{profile?.interests && profile.interests.length > 0 && (
<div className="mt-3 flex flex-wrap gap-1.5">
{profile.interests.map((tag) => (
<span
key={tag}
className="rounded-full bg-secondary-50 px-2.5 py-0.5 text-xs font-medium text-secondary-700"
>
#{tag}
</span>
))}
</div>
)}
{profile?.instagram && (
<a
href={`https://instagram.com/${profile.instagram}`}
target="_blank"
rel="noopener noreferrer nofollow"
className="mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary-600 hover:text-primary-700"
>
<span>📸</span>
<span>@{profile.instagram}</span>
</a>
)}
</div>
</div>
<div className="mt-5 grid grid-cols-2 gap-3 border-t border-neutral-100 pt-4 text-center sm:grid-cols-3">
<div>
<p className="text-lg font-bold text-primary-600">
{organizedTrips.length}
</p>
<p className="text-[11px] text-neutral-500">Trip dibuat</p>
</div>
<div>
<p className="text-lg font-bold text-secondary-600">
{joinedTrips.length}
</p>
<p className="text-[11px] text-neutral-500">Trip diikuti</p>
</div>
<div className="col-span-2 sm:col-span-1">
<p className="text-lg font-bold text-neutral-700">
{organizedTrips.length + joinedTrips.length}
</p>
<p className="text-[11px] text-neutral-500">Total perjalanan</p>
</div>
</div>
</section>
{/* Empty profile hint */}
{!profile && (
<p className="mt-5 rounded-xl border border-dashed border-neutral-200 bg-neutral-50 px-4 py-3 text-center text-xs text-neutral-500">
{user.name} belum melengkapi profil sosial bio, kota, & minat akan
muncul di sini setelah diisi.
</p>
)}
{/* Trip dibuat */}
{organizedTrips.length > 0 && (
<section className="mt-8">
<h2 className="mb-3 text-base font-bold text-neutral-800 sm:text-lg">
Trip yang dibuat ({organizedTrips.length})
</h2>
<div className="grid gap-4 sm:grid-cols-2">
{organizedTrips.map((trip) => (
<TripCard
key={trip.id}
id={trip.id}
title={trip.title}
category={trip.category}
destination={trip.destination}
location={trip.location}
date={trip.date}
endDate={trip.endDate}
price={trip.price}
maxParticipants={trip.maxParticipants}
participantCount={trip._count.participants}
organizerName={user.name}
status={trip.status}
coverImage={trip.images[0]?.url}
isVerifiedOrganizer={isVerifiedOrganizer}
/>
))}
</div>
</section>
)}
{/* Trip diikuti */}
{joinedTrips.length > 0 && (
<section className="mt-8">
<h2 className="mb-3 text-base font-bold text-neutral-800 sm:text-lg">
Trip yang diikuti ({joinedTrips.length})
</h2>
<ul className="space-y-2">
{joinedTrips.map((trip) => (
<li key={trip.id}>
<ProfileTripRow
href={`/trips/${trip.id}`}
title={trip.title}
destination={trip.destination}
date={trip.date}
endDate={trip.endDate}
rightSlot={
<span className="text-neutral-500">
bareng{" "}
<Link
href={`/u/${trip.organizer.id}`}
className="font-medium text-neutral-700 hover:text-primary-600"
>
{trip.organizer.name}
</Link>
</span>
}
/>
</li>
))}
</ul>
</section>
)}
{/* Empty state */}
{organizedTrips.length === 0 && joinedTrips.length === 0 && (
<p className="mt-8 rounded-xl border border-dashed border-neutral-200 bg-white px-4 py-10 text-center text-sm text-neutral-500">
Belum ada trip yang dibuat atau diikuti.
</p>
)}
</div>
);
}