Initial commit — Southwest Roleplay FiveM
This commit is contained in:
31
src/server/entities/business-stock-level.entity.ts
Normal file
31
src/server/entities/business-stock-level.entity.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryGeneratedColumn, Unique } from 'typeorm';
|
||||
import { PropertyEntity } from './property.entity';
|
||||
import { ItemTypeEntity } from './item-type.entity';
|
||||
|
||||
@Entity('business_stock_levels')
|
||||
@Unique(['property_id', 'item_type_id'])
|
||||
export class BusinessStockLevelEntity {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Index()
|
||||
@Column()
|
||||
property_id: number;
|
||||
|
||||
@Column()
|
||||
item_type_id: number;
|
||||
|
||||
@Column({ type: 'int', default: 0 })
|
||||
quantity: number;
|
||||
|
||||
@Column({ type: 'int', default: 0 })
|
||||
min_threshold: number;
|
||||
|
||||
@ManyToOne(() => PropertyEntity, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'property_id' })
|
||||
property: PropertyEntity;
|
||||
|
||||
@ManyToOne(() => ItemTypeEntity)
|
||||
@JoinColumn({ name: 'item_type_id' })
|
||||
itemType: ItemTypeEntity;
|
||||
}
|
||||
Reference in New Issue
Block a user