Merge pull request 'feat/report' (#52) from feat/report into development
continuous-integration/drone/tag Build is passing
Details
continuous-integration/drone/tag Build is passing
Details
Reviewed-on: #52pull/53/head devel_20.1.6
commit
ffcbf65d9d
|
@ -116,4 +116,19 @@ export class ItemModel
|
|||
onUpdate: 'CASCADE',
|
||||
})
|
||||
gates: GateModel[];
|
||||
|
||||
// relasi untuk mendapatkan parent bundling
|
||||
@ManyToMany(() => ItemModel, (model) => model.bundling_parents)
|
||||
@JoinTable({
|
||||
name: 'item_bundlings',
|
||||
joinColumn: {
|
||||
name: 'item_id',
|
||||
referencedColumnName: 'id',
|
||||
},
|
||||
inverseJoinColumn: {
|
||||
name: 'item_bundling_id',
|
||||
referencedColumnName: 'id',
|
||||
},
|
||||
})
|
||||
bundling_parents: ItemModel[];
|
||||
}
|
||||
|
|
|
@ -26,7 +26,12 @@ export class BatchDeleteItemManager extends BaseBatchDeleteManager<ItemEntity> {
|
|||
}
|
||||
|
||||
get validateRelations(): validateRelations[] {
|
||||
return [];
|
||||
return [
|
||||
{
|
||||
relation: 'bundling_parents',
|
||||
message: `Gagal! Item sudah berelasi dengen bundling`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
get entityTarget(): any {
|
||||
|
|
|
@ -29,7 +29,12 @@ export class DeleteItemManager extends BaseDeleteManager<ItemEntity> {
|
|||
}
|
||||
|
||||
get validateRelations(): validateRelations[] {
|
||||
return [];
|
||||
return [
|
||||
{
|
||||
relation: 'bundling_parents',
|
||||
message: `Gagal! Item sudah berelasi dengen bundling`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
get entityTarget(): any {
|
||||
|
|
Loading…
Reference in New Issue