2701-есть адекватный порядок для строк черновика и фикс пустого поиска

This commit is contained in:
2026-01-27 08:51:59 +03:00
parent 38a5143902
commit de4bd9c8d7
8 changed files with 148 additions and 5 deletions

View File

@@ -59,6 +59,9 @@ type DraftInvoiceItem struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
DraftID uuid.UUID `gorm:"type:uuid;not null;index" json:"draft_id"`
// Порядок отображения позиции в черновике
Order int `gorm:"not null;default:0" json:"order"`
RawName string `gorm:"type:varchar(255);not null" json:"raw_name"`
RawAmount decimal.Decimal `gorm:"type:numeric(19,4)" json:"raw_amount"`
RawPrice decimal.Decimal `gorm:"type:numeric(19,4)" json:"raw_price"`
@@ -87,6 +90,7 @@ type Repository interface {
CreateItems(items []DraftInvoiceItem) error
Update(draft *DraftInvoice) error
UpdateItem(itemID uuid.UUID, updates map[string]interface{}) error
UpdateItemOrder(itemID uuid.UUID, newOrder int) error
CreateItem(item *DraftInvoiceItem) error
DeleteItem(itemID uuid.UUID) error
Delete(id uuid.UUID) error