Files
backend/libs/common/src/modules/product/entities/product.entity.ts
ZaydSkaff 8503ee728d Refactor/space management (#404)
* refactor: reducing used queries on get communities (#385)

* refactor: fix create space logic (#394)

* Remove unique constraint on subspace and product in SubspaceProductAllocationEntity; update product relation to nullable in NewTagEntity

* refactor: fix create space logic

* device model updated to include the fixes and final columns

* updated space models to include suggested fixes, update final logic and column names

* task: removing old references of the old tag-product relation

* task: remove old use of tags

* task: remove old tag & tag model usage

* refactor: delete space

* task: remove unused functions

* fix lint rule
2025-06-11 13:15:21 +03:00

38 lines
829 B
TypeScript

import { Column, Entity, OneToMany } from 'typeorm';
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
import { DeviceEntity } from '../../device/entities';
import { ProductDto } from '../dtos';
@Entity({ name: 'product' })
export class ProductEntity extends AbstractEntity<ProductDto> {
@Column({
nullable: false,
})
catName: string;
@Column({
nullable: false,
unique: true,
})
public prodId: string;
@Column({
nullable: true,
})
public name: string;
@Column({
nullable: false,
})
public prodType: string;
@OneToMany(
() => DeviceEntity,
(devicesProductEntity) => devicesProductEntity.productDevice,
)
devicesProductEntity: DeviceEntity[];
constructor(partial: Partial<ProductEntity>) {
super();
Object.assign(this, partial);
}
}