mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 23:35:43 +00:00
feat(BE-58,59,60,61): implement stock transfer API, validation, audit log, and schema update
- Build stock transfer API with nested details, deliveries, and items - Extend DB schema for stock transfers - Implement validation for transfer request and stock - Prepare/implement transfer audit log structure - Preload all relations for complete response - Update DTOs for nested response - Remove redundant root fields, use relation objects
This commit is contained in:
+8
-1
@@ -1,6 +1,10 @@
|
||||
// Find all details by StockTransferId
|
||||
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitlab.com/mbugroup/lti-api.git/internal/common/repository"
|
||||
entity "gitlab.com/mbugroup/lti-api.git/internal/entities"
|
||||
"gorm.io/gorm"
|
||||
@@ -8,7 +12,7 @@ import (
|
||||
|
||||
type StockTransferDetailRepository interface {
|
||||
repository.BaseRepository[entity.StockTransferDetail]
|
||||
// Tambahkan custom method jika perlu
|
||||
FindByTransferId(ctx context.Context, transferId uint64, out *[]entity.StockTransferDetail) error
|
||||
}
|
||||
|
||||
type StockTransferDetailRepositoryImpl struct {
|
||||
@@ -20,3 +24,6 @@ func NewStockTransferDetailRepository(db *gorm.DB) StockTransferDetailRepository
|
||||
BaseRepositoryImpl: repository.NewBaseRepository[entity.StockTransferDetail](db),
|
||||
}
|
||||
}
|
||||
func (r *StockTransferDetailRepositoryImpl) FindByTransferId(ctx context.Context, transferId uint64, out *[]entity.StockTransferDetail) error {
|
||||
return r.DB().WithContext(ctx).Where("stock_transfer_id = ?", transferId).Find(out).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user