mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
Настройки работают
Иерархия групп работает Полностью завязано на пользователя и серверы
This commit is contained in:
@@ -36,6 +36,10 @@ type RMSServer struct {
|
||||
Login string `gorm:"type:varchar(100);not null" json:"login"`
|
||||
EncryptedPassword string `gorm:"type:text;not null" json:"-"` // Пароль храним зашифрованным
|
||||
|
||||
DefaultStoreID *uuid.UUID `gorm:"type:uuid" json:"default_store_id"` // Склад для подстановки
|
||||
RootGroupGUID *uuid.UUID `gorm:"type:uuid" json:"root_group_guid"` // ID корневой папки для поиска товаров
|
||||
AutoProcess bool `gorm:"default:false" json:"auto_process"` // Пытаться сразу проводить накладную
|
||||
|
||||
// Billing / Stats
|
||||
InvoiceCount int `gorm:"default:0" json:"invoice_count"` // Счетчик успешно отправленных накладных
|
||||
|
||||
|
||||
@@ -58,8 +58,10 @@ type Repository interface {
|
||||
SaveProducts(products []Product) error
|
||||
SaveContainer(container ProductContainer) error
|
||||
|
||||
Search(serverID uuid.UUID, query string) ([]Product, error)
|
||||
GetActiveGoods(serverID uuid.UUID) ([]Product, error)
|
||||
Search(serverID uuid.UUID, query string, rootGroupID *uuid.UUID) ([]Product, error)
|
||||
GetActiveGoods(serverID uuid.UUID, rootGroupID *uuid.UUID) ([]Product, error)
|
||||
|
||||
GetGroups(serverID uuid.UUID) ([]Product, error)
|
||||
|
||||
SaveStores(stores []Store) error
|
||||
GetActiveStores(serverID uuid.UUID) ([]Store, error)
|
||||
|
||||
@@ -70,6 +70,8 @@ type Repository interface {
|
||||
Update(draft *DraftInvoice) error
|
||||
CreateItems(items []DraftInvoiceItem) error
|
||||
UpdateItem(itemID uuid.UUID, productID *uuid.UUID, containerID *uuid.UUID, qty, price decimal.Decimal) error
|
||||
CreateItem(item *DraftInvoiceItem) error
|
||||
DeleteItem(itemID uuid.UUID) error
|
||||
Delete(id uuid.UUID) error
|
||||
GetActive(userID uuid.UUID) ([]DraftInvoice, error)
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ type Invoice struct {
|
||||
SupplierID uuid.UUID `gorm:"type:uuid;index"`
|
||||
DefaultStoreID uuid.UUID `gorm:"type:uuid;index"`
|
||||
Status string `gorm:"type:varchar(50)"`
|
||||
Comment string `gorm:"type:text"`
|
||||
|
||||
Items []InvoiceItem `gorm:"foreignKey:InvoiceID;constraint:OnDelete:CASCADE"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user