mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
редактирование и удаление сопоставлений
список накладных с позициями
This commit is contained in:
@@ -28,9 +28,11 @@ type DraftInvoice struct {
|
||||
SenderPhotoURL string `gorm:"type:text" json:"photo_url"`
|
||||
Status string `gorm:"type:varchar(50);default:'PROCESSING'" json:"status"`
|
||||
|
||||
DocumentNumber string `gorm:"type:varchar(100)" json:"document_number"`
|
||||
DateIncoming *time.Time `json:"date_incoming"`
|
||||
SupplierID *uuid.UUID `gorm:"type:uuid" json:"supplier_id"`
|
||||
DocumentNumber string `gorm:"type:varchar(100)" json:"document_number"`
|
||||
// Входящий номер документа
|
||||
IncomingDocumentNumber string `gorm:"type:varchar(100)" json:"incoming_document_number"`
|
||||
DateIncoming *time.Time `json:"date_incoming"`
|
||||
SupplierID *uuid.UUID `gorm:"type:uuid" json:"supplier_id"`
|
||||
|
||||
StoreID *uuid.UUID `gorm:"type:uuid" json:"store_id"`
|
||||
Store *catalog.Store `gorm:"foreignKey:StoreID" json:"store,omitempty"`
|
||||
@@ -67,6 +69,7 @@ type DraftInvoiceItem struct {
|
||||
type Repository interface {
|
||||
Create(draft *DraftInvoice) error
|
||||
GetByID(id uuid.UUID) (*DraftInvoice, error)
|
||||
GetByRMSInvoiceID(rmsInvoiceID uuid.UUID) (*DraftInvoice, error)
|
||||
Update(draft *DraftInvoice) error
|
||||
CreateItems(items []DraftInvoiceItem) error
|
||||
UpdateItem(itemID uuid.UUID, productID *uuid.UUID, containerID *uuid.UUID, qty, price decimal.Decimal) error
|
||||
@@ -76,4 +79,7 @@ type Repository interface {
|
||||
|
||||
// GetActive возвращает активные черновики для СЕРВЕРА (а не юзера)
|
||||
GetActive(serverID uuid.UUID) ([]DraftInvoice, error)
|
||||
|
||||
// GetRMSInvoiceIDToPhotoURLMap возвращает мапу rms_invoice_id -> sender_photo_url для сервера, где rms_invoice_id не NULL
|
||||
GetRMSInvoiceIDToPhotoURLMap(serverID uuid.UUID) (map[uuid.UUID]string, error)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ type InvoiceItem struct {
|
||||
}
|
||||
|
||||
type Repository interface {
|
||||
GetByID(id uuid.UUID) (*Invoice, error)
|
||||
GetLastInvoiceDate(serverID uuid.UUID) (*time.Time, error)
|
||||
GetByPeriod(serverID uuid.UUID, from, to time.Time) ([]Invoice, error)
|
||||
SaveInvoices(invoices []Invoice) error
|
||||
|
||||
@@ -23,6 +23,7 @@ type Supplier struct {
|
||||
|
||||
type Repository interface {
|
||||
SaveBatch(suppliers []Supplier) error
|
||||
GetByID(id uuid.UUID) (*Supplier, error)
|
||||
// GetRankedByUsage возвращает поставщиков, отсортированных по частоте использования в накладных за N дней
|
||||
GetRankedByUsage(serverID uuid.UUID, daysLookBack int) ([]Supplier, error)
|
||||
Count(serverID uuid.UUID) (int64, error)
|
||||
|
||||
Reference in New Issue
Block a user