Compare commits

...

6 Commits

Author SHA1 Message Date
firmanr ffcbf65d9d Merge pull request 'feat/report' (#52) from feat/report into development
continuous-integration/drone/tag Build is passing Details
Reviewed-on: #52
2024-08-06 05:35:06 +00:00
Firman Ramdhani 2f19db8dd7 feat(SPG-777): add validation delete for tenant item bundling 2024-08-06 11:40:18 +07:00
Firman Ramdhani e7664be8a8 feat(SPG-777): add validation delete for tenant item bundling 2024-08-06 11:39:40 +07:00
Firman Ramdhani a2c1af2a65 merge 2024-08-06 11:38:17 +07:00
Firman Ramdhani 26db7d2745 Merge branch 'development' of ssh://git.eigen.co.id:2222/eigen/pos-be into feat/report 2024-08-06 11:37:59 +07:00
Firman Ramdhani e922db827d feat(SPG-777): add validation delete for tenant item bundling 2024-08-06 11:33:51 +07:00
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 {