Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-05-06 11:07:55 +03:00
parent 05a2a03a6a
commit 77fe2b04b6
38 changed files with 12676 additions and 8 deletions

View File

@@ -8,8 +8,10 @@ import (
"bssapp-backend/permissions"
"bssapp-backend/repository"
"bssapp-backend/routes"
"bssapp-backend/utils"
"database/sql"
"log"
"log/slog"
"net/http"
"os"
"path"
@@ -738,6 +740,101 @@ func InitRoutes(pgDB *sql.DB, mssql *sql.DB, ml *mailer.GraphMailer) *mux.Router
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductPricingListHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/no-cost-products", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionNoCostProductsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-products", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostProductsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-history", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostHistoryHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-groups", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailGroupsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-header", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailHeaderHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/production-types", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionTypesHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/detail-editor-options", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailEditorOptionsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-exchange-rates", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailExchangeRatesHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-line-history", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailLineHistoryHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-similar-history", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionHasCostDetailSimilarHistoryHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/has-cost-detail-bulk-prices", "POST",
"order", "view",
wrapV3(http.HandlerFunc(routes.PostProductionHasCostDetailBulkPricesHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/options/urun-ana-grup", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionProductCostingUrunAnaGrupOptionsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/options/urun-alt-grup", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionProductCostingUrunAltGrupOptionsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/options/urun-ana-alt-combos", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionProductCostingUrunAnaAltCombosHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/options/mtbolum", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionProductCostingMTBolumOptionsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/maliyet-parca-eslestirme", "GET",
"order", "view",
wrapV3(http.HandlerFunc(routes.GetProductionProductCostingParcaMappingsHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/maliyet-parca-eslestirme", "DELETE",
"order", "view",
wrapV3(http.HandlerFunc(routes.DeleteProductionProductCostingParcaMappingHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/maliyet-parca-eslestirme/upsert", "POST",
"order", "view",
wrapV3(http.HandlerFunc(routes.PostProductionProductCostingParcaMappingUpsertHandler)),
)
bindV3(r, pgDB,
"/api/pricing/production-product-costing/maliyet-parca-eslestirme/set-active", "POST",
"order", "view",
wrapV3(http.HandlerFunc(routes.PostProductionProductCostingParcaMappingSetActiveHandler)),
)
// ============================================================
// ROLE MANAGEMENT
@@ -797,6 +894,8 @@ func InitRoutes(pgDB *sql.DB, mssql *sql.DB, ml *mailer.GraphMailer) *mux.Router
}
func main() {
utils.InitSlog()
slog.Info("backend start", "scope", "main")
log.Println("🔥🔥🔥 BSSAPP BACKEND STARTED — LOGIN ROUTE SHOULD EXIST 🔥🔥🔥")
// -------------------------------------------------------
@@ -825,6 +924,13 @@ func main() {
log.Fatal(err3)
}
}
if err := db.ConnectMSSQLUretim(); err != nil {
if strings.Contains(err.Error(), "URETIM_MSSQL_CONN tanimli degil") {
log.Println("⚠️ URETIM DB baglantisi atlandi: URETIM_MSSQL_CONN tanimli degil")
} else {
log.Fatal(err)
}
}
pgDB, err := db.ConnectPostgres()
if err != nil {