diff --git a/main b/main index 9548887..25c9a88 100755 Binary files a/main and b/main differ diff --git a/modules/structs/productpipeline.go b/modules/structs/productpipeline.go index 6697519..8e9b5b2 100644 --- a/modules/structs/productpipeline.go +++ b/modules/structs/productpipeline.go @@ -13,6 +13,7 @@ type NewProduct struct { Url string Variant string Characteristics string + PublishedAt string } type InWorkProduct struct { diff --git a/routers/router/api/v1/productpipeline/productpipeline.go b/routers/router/api/v1/productpipeline/productpipeline.go index 7679974..32f1474 100644 --- a/routers/router/api/v1/productpipeline/productpipeline.go +++ b/routers/router/api/v1/productpipeline/productpipeline.go @@ -5,8 +5,10 @@ import ( "errors" "fmt" "jannex/admin-dashboard-backend/modules/cache" + "jannex/admin-dashboard-backend/modules/config" "jannex/admin-dashboard-backend/modules/database" "jannex/admin-dashboard-backend/modules/logger" + "jannex/admin-dashboard-backend/modules/notification" "jannex/admin-dashboard-backend/modules/structs" "strconv" @@ -171,9 +173,22 @@ func fetchProducts(srv *sheets.Service) error { }) } else if state == 3 { var url string + var publishedAt string if len(row) > 8 && row[8] != "" { url = fmt.Sprintf("%v", row[8]) + } else { + logger.AddSystemLog(rslogger.LogTypeWarning, "Url missing for product id: %s name: %s", productId, name) + + notification.AddNotification(nil, structs.AddNotificationRequest{ + UserIds: config.Cfg.NotificationUserIds, + Type: 3, + Title: "Missing 'Shop Produkt Link' for product pipeline\n\nproduct id: " + productId + "\nname: " + name + "\n\nDie URL für das Produkt in dem Google Sheet 'Produkte' -> Worksheet: 'Pipeline' eintragen!", + }) + } + + if len(row) > 9 && row[9] != "" { + publishedAt = fmt.Sprintf("%v", row[9]) } newProducts = append(newProducts, structs.NewProduct{ @@ -182,6 +197,7 @@ func fetchProducts(srv *sheets.Service) error { Url: url, Variant: productVariant, Characteristics: productCharacteristics, + PublishedAt: publishedAt, }) } }