редактирование и удаление сопоставлений

список накладных с позициями
This commit is contained in:
2025-12-29 10:46:05 +03:00
parent c2d382cb6a
commit 310a64e3ba
30 changed files with 1250 additions and 8173 deletions

View File

@@ -51,6 +51,15 @@ func (r *pgRepository) GetRankedByUsage(serverID uuid.UUID, daysLookBack int) ([
return result, err
}
func (r *pgRepository) GetByID(id uuid.UUID) (*suppliers.Supplier, error) {
var supplier suppliers.Supplier
err := r.db.Where("id = ? AND is_deleted = ?", id, false).First(&supplier).Error
if err != nil {
return nil, err
}
return &supplier, nil
}
func (r *pgRepository) Count(serverID uuid.UUID) (int64, error) {
var count int64
err := r.db.Model(&suppliers.Supplier{}).