mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat(BE-229,234,235,230,231,232,233): purchase request and purchase order and fix master data dto
This commit is contained in:
@@ -13,6 +13,7 @@ type ApprovalRepository interface {
|
||||
FindByTarget(ctx context.Context, workflow string, approvableID uint, modifier func(*gorm.DB) *gorm.DB) ([]entity.Approval, error)
|
||||
LatestByTarget(ctx context.Context, workflow string, approvableID uint, modifier func(*gorm.DB) *gorm.DB) (*entity.Approval, error)
|
||||
LatestByTargets(ctx context.Context, workflow string, approvableIDs []uint, modifier func(*gorm.DB) *gorm.DB) (map[uint]entity.Approval, error)
|
||||
DeleteByTarget(ctx context.Context, workflow string, approvableID uint) error
|
||||
}
|
||||
|
||||
type approvalRepositoryImpl struct {
|
||||
@@ -104,3 +105,13 @@ func (r *approvalRepositoryImpl) LatestByTargets(
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (r *approvalRepositoryImpl) DeleteByTarget(
|
||||
ctx context.Context,
|
||||
workflow string,
|
||||
approvableID uint,
|
||||
) error {
|
||||
return r.DB().WithContext(ctx).
|
||||
Where("approvable_type = ? AND approvable_id = ?", workflow, approvableID).
|
||||
Delete(&entity.Approval{}).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user