landing desktop1

This commit is contained in:
2026-06-12 20:37:33 +03:30
parent d9b18ba0ea
commit 4e33d3f8e1
8 changed files with 1077 additions and 9 deletions
@@ -1,4 +1,95 @@
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { BusinessCategoryEntity } from './business-category.entity';
import { BusinessEntity } from './business.entity';
import { UserEntity } from './user.entity';
export enum BusinessRegistrationStatus {
PENDING = 'pending',
APPROVED = 'approved',
REJECTED = 'rejected',
}
@Entity('business_registration_requests')
export class BusinessRegistrationRequestEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'applicantId' })
applicant!: UserEntity;
@Column('uuid')
applicantId!: string;
@Column({
type: 'varchar',
length: 20,
default: BusinessRegistrationStatus.PENDING,
})
status!: BusinessRegistrationStatus;
@Column({ length: 150 })
title!: string;
@Column({ length: 120 })
slug!: string;
@ManyToOne(() => BusinessCategoryEntity, { onDelete: 'RESTRICT' })
@JoinColumn({ name: 'categoryId' })
category!: BusinessCategoryEntity;
@Column('uuid')
categoryId!: string;
@Column({ type: 'varchar', nullable: true, length: 150 })
subtitle!: string | null;
subtitle!: string | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
description!: string | null;
@Column({ type: 'varchar', nullable: true, length: 20 })
contactPhone!: string | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
address!: string | null;
@Column({ type: 'double precision', nullable: true })
latitude!: number | null;
@Column({ type: 'double precision', nullable: true })
longitude!: number | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
adminNote!: string | null;
@ManyToOne(() => UserEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'reviewedById' })
reviewedBy!: UserEntity | null;
@Column({ type: 'uuid', nullable: true })
reviewedById!: string | null;
@Column({ type: 'timestamptz', nullable: true })
reviewedAt!: Date | null;
@ManyToOne(() => BusinessEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'businessId' })
business!: BusinessEntity | null;
@Column({ type: 'uuid', nullable: true })
businessId!: string | null;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
}
+104 -1
View File
@@ -1,4 +1,107 @@
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { BookingEntity } from './booking.entity';
import { BusinessAttributeValueEntity } from './business-attribute-value.entity';
import { BusinessAvailabilitySlotEntity } from './business-availability-slot.entity';
import { BusinessCategoryEntity } from './business-category.entity';
import { BusinessImageEntity } from './business-image.entity';
import { BusinessServiceClassEntity } from './business-service-class.entity';
import { BusinessServiceEntity } from './business-service.entity';
import { UserEntity } from './user.entity';
@Entity('businesses')
export class BusinessEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ length: 150 })
title!: string;
@Column({ unique: true, length: 120 })
slug!: string;
@Column({ type: 'varchar', nullable: true, length: 150 })
subtitle!: string | null;
subtitle!: string | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
description!: string | null;
@Column({ type: 'varchar', nullable: true, length: 20 })
contactPhone!: string | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
address!: string | null;
@Column({ type: 'double precision', nullable: true })
latitude!: number | null;
@Column({ type: 'double precision', nullable: true })
longitude!: number | null;
@Column({ default: true })
isActive!: boolean;
@Column({ default: false })
serviceClassesEnabled!: boolean;
@Column({ type: 'int', default: 1 })
concurrentCapacity!: number;
@Column({ type: 'int', default: 30 })
slotStepMinutes!: number;
@ManyToOne(() => BusinessCategoryEntity, (category) => category.businesses, {
onDelete: 'RESTRICT',
})
@JoinColumn({ name: 'categoryId' })
category!: BusinessCategoryEntity;
@Column('uuid')
categoryId!: string;
@ManyToOne(() => UserEntity, (user) => user.ownedBusinesses, {
nullable: true,
onDelete: 'SET NULL',
})
@JoinColumn({ name: 'ownerId' })
owner!: UserEntity | null;
@Column({ type: 'uuid', nullable: true })
ownerId!: string | null;
@OneToMany(() => BusinessImageEntity, (image) => image.business, {
cascade: true,
})
images!: BusinessImageEntity[];
@OneToMany(() => BusinessServiceEntity, (service) => service.business)
services!: BusinessServiceEntity[];
@OneToMany(() => BusinessServiceClassEntity, (serviceClass) => serviceClass.business)
serviceClasses!: BusinessServiceClassEntity[];
@OneToMany(() => BusinessAttributeValueEntity, (attr) => attr.business)
attributes!: BusinessAttributeValueEntity[];
@OneToMany(() => BookingEntity, (booking) => booking.business)
bookings!: BookingEntity[];
@OneToMany(() => BusinessAvailabilitySlotEntity, (slot) => slot.business, {
cascade: true,
})
availabilitySlots!: BusinessAvailabilitySlotEntity[];
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
}