Merge pull request 'feat/report' (#52) from feat/report into development
continuous-integration/drone/tag Build is passing Details

Reviewed-on: #52
pull/53/head devel_20.1.6
firmanr 2024-08-06 05:35:06 +00:00
commit ffcbf65d9d
3 changed files with 27 additions and 2 deletions

View File

@ -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[];
}

View File

@ -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 {

View File

@ -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 {