mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
removed allowed quantity and renamed tags
This commit is contained in:
@ -23,13 +23,10 @@ export class SpaceModelProductAllocationDto {
|
|||||||
@Type(() => ProductDto)
|
@Type(() => ProductDto)
|
||||||
product: ProductDto;
|
product: ProductDto;
|
||||||
|
|
||||||
@IsInt()
|
|
||||||
allowedQuantity: number;
|
|
||||||
|
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
@Type(() => NewTagDto)
|
@Type(() => NewTagDto)
|
||||||
allowedTags: NewTagDto[];
|
tags: NewTagDto[];
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsArray()
|
@IsArray()
|
||||||
|
@ -16,11 +16,8 @@ export class SubspaceModelProductAllocationDto {
|
|||||||
@Type(() => ProductDto)
|
@Type(() => ProductDto)
|
||||||
product: ProductDto;
|
product: ProductDto;
|
||||||
|
|
||||||
@IsInt()
|
|
||||||
allowedQuantity: number;
|
|
||||||
|
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
@Type(() => NewTagDto)
|
@Type(() => NewTagDto)
|
||||||
allowedTags: NewTagDto[];
|
tags: NewTagDto[];
|
||||||
}
|
}
|
||||||
|
@ -31,12 +31,9 @@ export class SpaceModelProductAllocationEntity extends AbstractEntity<SpaceModel
|
|||||||
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
||||||
public product: ProductEntity;
|
public product: ProductEntity;
|
||||||
|
|
||||||
@Column({ type: 'int', default: 1 })
|
|
||||||
public allowedQuantity: number;
|
|
||||||
|
|
||||||
@ManyToMany(() => NewTagEntity)
|
@ManyToMany(() => NewTagEntity)
|
||||||
@JoinTable({ name: 'space_model_product_tags' })
|
@JoinTable({ name: 'space_model_product_tags' })
|
||||||
public allowedTags: NewTagEntity[];
|
public tags: NewTagEntity[];
|
||||||
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
() => SpaceProductAllocationEntity,
|
() => SpaceProductAllocationEntity,
|
||||||
|
@ -27,12 +27,9 @@ export class SubspaceModelProductAllocationEntity extends AbstractEntity<Subspac
|
|||||||
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
||||||
public product: ProductEntity;
|
public product: ProductEntity;
|
||||||
|
|
||||||
@Column({ type: 'int', default: 1 })
|
|
||||||
public allowedQuantity: number;
|
|
||||||
|
|
||||||
@ManyToMany(() => NewTagEntity, (tag) => tag.subspaceModelAllocations)
|
@ManyToMany(() => NewTagEntity, (tag) => tag.subspaceModelAllocations)
|
||||||
@JoinTable({ name: 'subspace_model_product_tags' })
|
@JoinTable({ name: 'subspace_model_product_tags' })
|
||||||
public allowedTags: NewTagEntity[];
|
public tags: NewTagEntity[];
|
||||||
|
|
||||||
constructor(partial: Partial<SubspaceModelProductAllocationEntity>) {
|
constructor(partial: Partial<SubspaceModelProductAllocationEntity>) {
|
||||||
super();
|
super();
|
||||||
|
@ -33,7 +33,7 @@ export class SubspaceModelEntity extends AbstractEntity<SubSpaceModelDto> {
|
|||||||
@OneToMany(() => SubspaceEntity, (subspace) => subspace.subSpaceModel, {
|
@OneToMany(() => SubspaceEntity, (subspace) => subspace.subSpaceModel, {
|
||||||
cascade: true,
|
cascade: true,
|
||||||
})
|
})
|
||||||
public subspaceModel: SubspaceEntity[];
|
public subspace: SubspaceEntity[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
|
@ -20,5 +20,5 @@ export class SpaceProductAllocationDto {
|
|||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
@Type(() => NewTagDto)
|
@Type(() => NewTagDto)
|
||||||
allowedTags: NewTagDto[];
|
tags: NewTagDto[];
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,5 @@ export class SubspaceProductAllocationDto {
|
|||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
@Type(() => NewTagDto)
|
@Type(() => NewTagDto)
|
||||||
allowedTags: NewTagDto[];
|
tags: NewTagDto[];
|
||||||
}
|
}
|
||||||
|
@ -30,12 +30,9 @@ export class SpaceProductAllocationEntity extends AbstractEntity<SpaceProductAll
|
|||||||
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
||||||
public product: ProductEntity;
|
public product: ProductEntity;
|
||||||
|
|
||||||
@Column({ type: 'int', default: 1 })
|
|
||||||
public allowedQuantity: number;
|
|
||||||
|
|
||||||
@ManyToMany(() => NewTagEntity)
|
@ManyToMany(() => NewTagEntity)
|
||||||
@JoinTable({ name: 'space_product_tags' })
|
@JoinTable({ name: 'space_product_tags' })
|
||||||
public allowedTags: NewTagEntity[];
|
public tags: NewTagEntity[];
|
||||||
|
|
||||||
constructor(partial: Partial<SpaceProductAllocationEntity>) {
|
constructor(partial: Partial<SpaceProductAllocationEntity>) {
|
||||||
super();
|
super();
|
||||||
|
@ -38,12 +38,9 @@ export class SubspaceProductAllocationEntity extends AbstractEntity<SubspaceProd
|
|||||||
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
@ManyToOne(() => ProductEntity, { nullable: false, onDelete: 'CASCADE' })
|
||||||
public product: ProductEntity;
|
public product: ProductEntity;
|
||||||
|
|
||||||
@Column({ type: 'int', default: 1 })
|
|
||||||
public allowedQuantity: number;
|
|
||||||
|
|
||||||
@ManyToMany(() => NewTagEntity)
|
@ManyToMany(() => NewTagEntity)
|
||||||
@JoinTable({ name: 'subspace_product_tags' })
|
@JoinTable({ name: 'subspace_product_tags' })
|
||||||
public allowedTags: NewTagEntity[];
|
public tags: NewTagEntity[];
|
||||||
|
|
||||||
constructor(partial: Partial<SubspaceProductAllocationEntity>) {
|
constructor(partial: Partial<SubspaceProductAllocationEntity>) {
|
||||||
super();
|
super();
|
||||||
|
@ -45,13 +45,13 @@ export class NewTagEntity extends AbstractEntity<NewTagDto> {
|
|||||||
|
|
||||||
@ManyToMany(
|
@ManyToMany(
|
||||||
() => SpaceModelProductAllocationEntity,
|
() => SpaceModelProductAllocationEntity,
|
||||||
(allocation) => allocation.allowedTags,
|
(allocation) => allocation.tags,
|
||||||
)
|
)
|
||||||
public spaceModelAllocations: SpaceModelProductAllocationEntity[];
|
public spaceModelAllocations: SpaceModelProductAllocationEntity[];
|
||||||
|
|
||||||
@ManyToMany(
|
@ManyToMany(
|
||||||
() => SubspaceModelProductAllocationEntity,
|
() => SubspaceModelProductAllocationEntity,
|
||||||
(allocation) => allocation.allowedTags,
|
(allocation) => allocation.tags,
|
||||||
)
|
)
|
||||||
public subspaceModelAllocations: SubspaceModelProductAllocationEntity[];
|
public subspaceModelAllocations: SubspaceModelProductAllocationEntity[];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user