mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
0202-финиш перед десктопом
пересчет поправил редактирование с перепроведением галка автопроведения работает рекомендации починил
This commit is contained in:
@@ -160,20 +160,23 @@ func (r *pgRepository) GetActive(serverID uuid.UUID) ([]drafts.DraftInvoice, err
|
||||
return list, err
|
||||
}
|
||||
|
||||
func (r *pgRepository) GetRMSInvoiceIDToPhotoURLMap(serverID uuid.UUID) (map[uuid.UUID]string, error) {
|
||||
func (r *pgRepository) GetLinkedDraftsMap(serverID uuid.UUID) (map[uuid.UUID]drafts.LinkedDraftInfo, error) {
|
||||
var draftsList []drafts.DraftInvoice
|
||||
err := r.db.
|
||||
Select("rms_invoice_id", "sender_photo_url").
|
||||
Select("id", "rms_invoice_id", "sender_photo_url").
|
||||
Where("rms_server_id = ? AND rms_invoice_id IS NOT NULL", serverID).
|
||||
Find(&draftsList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := make(map[uuid.UUID]string)
|
||||
result := make(map[uuid.UUID]drafts.LinkedDraftInfo)
|
||||
for _, d := range draftsList {
|
||||
if d.RMSInvoiceID != nil {
|
||||
result[*d.RMSInvoiceID] = d.SenderPhotoURL
|
||||
result[*d.RMSInvoiceID] = drafts.LinkedDraftInfo{
|
||||
DraftID: d.ID,
|
||||
PhotoURL: d.SenderPhotoURL,
|
||||
}
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user