tipsEnabled
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { BookingEntity } from './booking.entity';
|
||||
import { BusinessEntity } from './business.entity';
|
||||
import { UserEntity } from './user.entity';
|
||||
|
||||
@Entity('booking_reviews')
|
||||
export class BookingReviewEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id!: string;
|
||||
|
||||
@ManyToOne(() => BookingEntity, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'bookingId' })
|
||||
booking!: BookingEntity;
|
||||
|
||||
@Column({ type: 'uuid', unique: true })
|
||||
bookingId!: string;
|
||||
|
||||
@ManyToOne(() => UserEntity, { onDelete: 'RESTRICT' })
|
||||
@JoinColumn({ name: 'customerId' })
|
||||
customer!: UserEntity;
|
||||
|
||||
@Column('uuid')
|
||||
customerId!: string;
|
||||
|
||||
@ManyToOne(() => BusinessEntity, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'businessId' })
|
||||
business!: BusinessEntity;
|
||||
|
||||
@Column('uuid')
|
||||
businessId!: string;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
rating!: number;
|
||||
|
||||
@Column({ type: 'decimal', precision: 12, scale: 0, nullable: true })
|
||||
tipAmount!: string | null;
|
||||
|
||||
@Column({ default: false })
|
||||
tipPaid!: boolean;
|
||||
|
||||
@Column({ type: 'varchar', nullable: true, length: 64 })
|
||||
tipAuthority!: string | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
||||
@@ -80,6 +80,12 @@ export class BookingEntity {
|
||||
@Column({ type: 'varchar', nullable: true, length: 64 })
|
||||
paymentAuthority!: string | null;
|
||||
|
||||
@Column({ type: 'timestamptz', nullable: true })
|
||||
completedAt!: Date | null;
|
||||
|
||||
@Column({ type: 'timestamptz', nullable: true })
|
||||
reviewPromptedAt!: Date | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
|
||||
|
||||
@@ -62,6 +62,10 @@ export class BusinessEntity {
|
||||
@Column({ default: false })
|
||||
autoApproveBookings!: boolean;
|
||||
|
||||
/** When true, customers can leave an optional gratuity after rating a completed booking. */
|
||||
@Column({ default: false })
|
||||
tipsEnabled!: boolean;
|
||||
|
||||
@ManyToOne(() => BusinessCategoryEntity, (category) => category.businesses, {
|
||||
onDelete: 'RESTRICT',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user