From f81eb844996a20eac9749ddb14097b854cf15c04 Mon Sep 17 00:00:00 2001 From: Daniel Goc Date: Wed, 25 Mar 2026 10:42:25 +0100 Subject: [PATCH] some debugging --- app/api/openapi.json | 26 +++++++------- app/delivery/web/api/public/auth.go | 6 ++-- .../web/api/restricted/meiliSearch.go | 12 +++---- ...ctDescription.go => productTranslation.go} | 36 +++++++++---------- app/delivery/web/init.go | 6 ++-- app/model/countries.go | 4 +-- app/model/product.go | 2 +- app/repos/categoriesRepo/categoriesRepo.go | 2 +- .../localeSelectorRepo/localeSelectorRepo.go | 3 +- app/service/meiliService/meiliService.go | 4 +-- app/service/menuService/menuService.go | 5 +++ .../google_out.txt | 0 .../openai_out.txt | 0 .../productTranslationService.go} | 22 ++++++------ .../test_in.txt | 0 bo/components.d.ts | 3 -- .../20260302163122_create_tables.sql | 6 ++-- 17 files changed, 70 insertions(+), 67 deletions(-) rename app/delivery/web/api/restricted/{productDescription.go => productTranslation.go} (83%) rename app/service/{productDescriptionService => productTranslationService}/google_out.txt (100%) rename app/service/{productDescriptionService => productTranslationService}/openai_out.txt (100%) rename app/service/{productDescriptionService/productDescriptionService.go => productTranslationService/productTranslationService.go} (95%) rename app/service/{productDescriptionService => productTranslationService}/test_in.txt (100%) diff --git a/app/api/openapi.json b/app/api/openapi.json index 403e09e..307cf2b 100644 --- a/app/api/openapi.json +++ b/app/api/openapi.json @@ -33,8 +33,8 @@ "description": "Product listing and description endpoints (under /api/v1/restricted, requires authentication)" }, { - "name": "Product Description", - "description": "Product description management and translation endpoints (under /api/v1/restricted/product-description, requires authentication)" + "name": "Product Translation", + "description": "Product description management and translation endpoints (under /api/v1/restricted/product-translation, requires authentication)" }, { "name": "Menu", @@ -915,9 +915,9 @@ } } }, - "/api/v1/restricted/product-description/get-product-description": { + "/api/v1/restricted/product-translation/get-product-description": { "get": { - "tags": ["Product Description"], + "tags": ["Product Translation"], "summary": "Get product description", "description": "Returns the product description for a given product ID and language. Requires authentication.", "operationId": "getProductDescription", @@ -982,9 +982,9 @@ } } }, - "/api/v1/restricted/product-description/save-product-description": { + "/api/v1/restricted/product-translation/save-product-description": { "post": { - "tags": ["Product Description"], + "tags": ["Product Translation"], "summary": "Save product description", "description": "Saves the product description for a given product ID in the specified language. Requires authentication.", "operationId": "saveProductDescription", @@ -1059,9 +1059,9 @@ } } }, - "/api/v1/restricted/product-description/translate-product-description": { + "/api/v1/restricted/product-translation/translate-product-description": { "get": { - "tags": ["Product Description"], + "tags": ["Product Translation"], "summary": "Translate product description", "description": "Translates the product description from one language to another using AI (OpenAI or Google). Requires authentication.", "operationId": "translateProductDescription", @@ -1271,7 +1271,7 @@ "name": "id_category", "in": "query", "description": "Filter by category ID", - "required": true, + "required": false, "schema": { "type": "integer", "format": "uint" @@ -1281,7 +1281,7 @@ "name": "price_lower_bound", "in": "query", "description": "Lower price bound", - "required": true, + "required": false, "schema": { "type": "number", "format": "double" @@ -1291,7 +1291,7 @@ "name": "price_upper_bound", "in": "query", "description": "Upper price bound", - "required": true, + "required": false, "schema": { "type": "number", "format": "double" @@ -1336,7 +1336,7 @@ "get": { "tags": ["Search"], "summary": "Create search index", - "description": "Creates a MeiliSearch index for products. Requires superadmin access.", + "description": "Creates a MeiliSearch index for products. Must be removed before proper release.", "operationId": "createSearchIndex", "security": [ { @@ -1381,7 +1381,7 @@ "get": { "tags": ["Search"], "summary": "Test MeiliSearch", - "description": "Tests the MeiliSearch connection. Requires superadmin access.", + "description": "Tests the MeiliSearch search. Must be removed before proper release.", "operationId": "testMeiliSearch", "security": [ { diff --git a/app/delivery/web/api/public/auth.go b/app/delivery/web/api/public/auth.go index 747871f..9db06d5 100644 --- a/app/delivery/web/api/public/auth.go +++ b/app/delivery/web/api/public/auth.go @@ -40,7 +40,6 @@ func AuthHandlerRoutes(r fiber.Router) fiber.Router { r.Post("/reset-password", handler.ResetPassword) r.Post("/logout", handler.Logout) r.Post("/refresh", handler.RefreshToken) - r.Post("/update-choice", handler.UpdateJWTToken) // Google OAuth2 r.Get("/google", handler.GoogleLogin) @@ -48,6 +47,7 @@ func AuthHandlerRoutes(r fiber.Router) fiber.Router { authProtected := r.Group("", middleware.AuthMiddleware()) authProtected.Get("/me", handler.Me) + authProtected.Post("/update-choice", handler.UpdateJWTToken) return r } @@ -345,9 +345,9 @@ func (h *AuthHandler) CompleteRegistration(c fiber.Ctx) error { return c.Status(fiber.StatusCreated).JSON(response) } -// CompleteRegistration handles completion of registration with password +// Updates JWT Tokens func (h *AuthHandler) UpdateJWTToken(c fiber.Ctx) error { - return h.UpdateJWTToken(c) + return h.authService.UpdateJWTToken(c) } // GoogleLogin redirects the user to Google's OAuth2 consent page diff --git a/app/delivery/web/api/restricted/meiliSearch.go b/app/delivery/web/api/restricted/meiliSearch.go index c297d37..b07ba38 100644 --- a/app/delivery/web/api/restricted/meiliSearch.go +++ b/app/delivery/web/api/restricted/meiliSearch.go @@ -25,7 +25,7 @@ func NewMeiliSearchHandler() *MeiliSearchHandler { func MeiliSearchHandlerRoutes(r fiber.Router) fiber.Router { handler := NewMeiliSearchHandler() - // for superadmin only + // for testing purposes only. Must be removed before proper release. r.Get("/create-index", handler.CreateIndex) r.Get("/test", handler.Test) @@ -84,32 +84,32 @@ func (h *MeiliSearchHandler) Search(c fiber.Ctx) error { JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - id_category_attribute := c.Query("id_category") + id_category_attribute := c.Query("id_category", "0") id_category, err := strconv.Atoi(id_category_attribute) if err != nil { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - price_lower_bound_attribute := c.Query("price_lower_bound") + price_lower_bound_attribute := c.Query("price_lower_bound", "-1.0") price_lower_bound, err := strconv.ParseFloat(price_lower_bound_attribute, 64) if err != nil { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - price_upper_bound_attribute := c.Query("price_upper_bound") + price_upper_bound_attribute := c.Query("price_upper_bound", "-1.0") price_upper_bound, err := strconv.ParseFloat(price_upper_bound_attribute, 64) if err != nil { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - test, err := h.meiliService.Search(id_lang, query, uint(limit), uint(id_category), price_lower_bound, price_upper_bound) + meili_response, err := h.meiliService.Search(id_lang, query, uint(limit), uint(id_category), price_lower_bound, price_upper_bound) if err != nil { return c.Status(responseErrors.GetErrorStatus(err)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err))) } - return c.JSON(response.Make(&test, 0, i18n.T_(c, response.Message_OK))) + return c.JSON(response.Make(&meili_response, 0, i18n.T_(c, response.Message_OK))) } diff --git a/app/delivery/web/api/restricted/productDescription.go b/app/delivery/web/api/restricted/productTranslation.go similarity index 83% rename from app/delivery/web/api/restricted/productDescription.go rename to app/delivery/web/api/restricted/productTranslation.go index a107a21..760ddb3 100644 --- a/app/delivery/web/api/restricted/productDescription.go +++ b/app/delivery/web/api/restricted/productTranslation.go @@ -4,7 +4,7 @@ import ( "strconv" "git.ma-al.com/goc_daniel/b2b/app/config" - "git.ma-al.com/goc_daniel/b2b/app/service/productDescriptionService" + "git.ma-al.com/goc_daniel/b2b/app/service/productTranslationService" "git.ma-al.com/goc_daniel/b2b/app/utils/i18n" "git.ma-al.com/goc_daniel/b2b/app/utils/nullable" "git.ma-al.com/goc_daniel/b2b/app/utils/response" @@ -13,24 +13,24 @@ import ( "github.com/gofiber/fiber/v3" ) -// ProductDescriptionHandler handles endpoints that receive, save and translate product descriptions. -type ProductDescriptionHandler struct { - productDescriptionService *productDescriptionService.ProductDescriptionService +// ProductTranslationHandler handles endpoints that receive, save and translate product descriptions. +type ProductTranslationHandler struct { + productTranslationService *productTranslationService.ProductTranslationService config *config.Config } -// NewProductDescriptionHandler creates a new ProductDescriptionHandler instance -func NewProductDescriptionHandler() *ProductDescriptionHandler { - productDescriptionService := productDescriptionService.New() - return &ProductDescriptionHandler{ - productDescriptionService: productDescriptionService, +// NewProductTranslationHandler creates a new ProductTranslationHandler instance +func NewProductTranslationHandler() *ProductTranslationHandler { + productTranslationService := productTranslationService.New() + return &ProductTranslationHandler{ + productTranslationService: productTranslationService, config: config.Get(), } } -// ProductDescriptionRoutes registers all product description routes -func ProductDescriptionHandlerRoutes(r fiber.Router) fiber.Router { - handler := NewProductDescriptionHandler() +// ProductTranslationRoutes registers all product description routes +func ProductTranslationHandlerRoutes(r fiber.Router) fiber.Router { + handler := NewProductTranslationHandler() r.Get("/get-product-description", handler.GetProductDescription) r.Post("/save-product-description", handler.SaveProductDescription) @@ -40,7 +40,7 @@ func ProductDescriptionHandlerRoutes(r fiber.Router) fiber.Router { } // GetProductDescription returns the product description for a given product ID -func (h *ProductDescriptionHandler) GetProductDescription(c fiber.Ctx) error { +func (h *ProductTranslationHandler) GetProductDescription(c fiber.Ctx) error { userID, ok := c.Locals("userID").(uint) if !ok { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). @@ -61,7 +61,7 @@ func (h *ProductDescriptionHandler) GetProductDescription(c fiber.Ctx) error { JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - description, err := h.productDescriptionService.GetProductDescription(userID, uint(productID), uint(productLangID)) + description, err := h.productTranslationService.GetProductDescription(userID, uint(productID), uint(productLangID)) if err != nil { return c.Status(responseErrors.GetErrorStatus(err)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err))) @@ -71,7 +71,7 @@ func (h *ProductDescriptionHandler) GetProductDescription(c fiber.Ctx) error { } // SaveProductDescription saves the description for a given product ID, in given language -func (h *ProductDescriptionHandler) SaveProductDescription(c fiber.Ctx) error { +func (h *ProductTranslationHandler) SaveProductDescription(c fiber.Ctx) error { userID, ok := c.Locals("userID").(uint) if !ok { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). @@ -98,7 +98,7 @@ func (h *ProductDescriptionHandler) SaveProductDescription(c fiber.Ctx) error { JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody))) } - err = h.productDescriptionService.SaveProductDescription(userID, uint(productID), uint(productLangID), updates) + err = h.productTranslationService.SaveProductDescription(userID, uint(productID), uint(productLangID), updates) if err != nil { return c.Status(responseErrors.GetErrorStatus(err)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err))) @@ -108,7 +108,7 @@ func (h *ProductDescriptionHandler) SaveProductDescription(c fiber.Ctx) error { } // TranslateProductDescription returns translated product description -func (h *ProductDescriptionHandler) TranslateProductDescription(c fiber.Ctx) error { +func (h *ProductTranslationHandler) TranslateProductDescription(c fiber.Ctx) error { userID, ok := c.Locals("userID").(uint) if !ok { return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). @@ -142,7 +142,7 @@ func (h *ProductDescriptionHandler) TranslateProductDescription(c fiber.Ctx) err JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute))) } - description, err := h.productDescriptionService.TranslateProductDescription(userID, uint(productID), uint(productFromLangID), uint(productToLangID), aiModel) + description, err := h.productTranslationService.TranslateProductDescription(userID, uint(productID), uint(productFromLangID), uint(productToLangID), aiModel) if err != nil { return c.Status(responseErrors.GetErrorStatus(err)). JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err))) diff --git a/app/delivery/web/init.go b/app/delivery/web/init.go index 563f47f..94c02a6 100644 --- a/app/delivery/web/init.go +++ b/app/delivery/web/init.go @@ -89,9 +89,9 @@ func (s *Server) Setup() error { auth := s.public.Group("/auth") public.AuthHandlerRoutes(auth) - // product description routes (restricted) - productDescription := s.restricted.Group("/product-description") - restricted.ProductDescriptionHandlerRoutes(productDescription) + // product translation routes (restricted) + productTranslation := s.restricted.Group("/product-translation") + restricted.ProductTranslationHandlerRoutes(productTranslation) // listing products routes (restricted) listProducts := s.restricted.Group("/list-products") diff --git a/app/model/countries.go b/app/model/countries.go index dccbe8b..6ad933f 100644 --- a/app/model/countries.go +++ b/app/model/countries.go @@ -6,8 +6,8 @@ type Country struct { Name string `gorm:"column:name" json:"name"` Flag string `gorm:"size:16;not null;column:flag" json:"flag"` CurrencyID uint `gorm:"column:id_currency" json:"currency_id"` - CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"` - CurrencyName string `gorm:"column:name" json:"currency_name"` + CurrencyISOCode string `gorm:"column:currency_iso_code" json:"currency_iso_code"` + CurrencyName string `gorm:"column:currency_name" json:"currency_name"` } func (Country) TableName() string { diff --git a/app/model/product.go b/app/model/product.go index 7705238..6a9212b 100644 --- a/app/model/product.go +++ b/app/model/product.go @@ -85,7 +85,7 @@ type ProductFilters struct { } type ScannedCategory struct { - CategoryID uint `gorm:"column:ID;primaryKey"` + CategoryID uint `gorm:"column:category_id;primaryKey"` Name string `gorm:"column:name"` Active uint `gorm:"column:active"` Position uint `gorm:"column:position"` diff --git a/app/repos/categoriesRepo/categoriesRepo.go b/app/repos/categoriesRepo/categoriesRepo.go index bc378c1..e838ff0 100644 --- a/app/repos/categoriesRepo/categoriesRepo.go +++ b/app/repos/categoriesRepo/categoriesRepo.go @@ -22,7 +22,7 @@ func (repo *CategoriesRepo) GetAllCategories(id_lang uint) ([]model.ScannedCateg err := db.DB. Table("ps_category"). Select(` - ps_category.id_category AS id, + ps_category.id_category AS category_id, ps_category_lang.name AS name, ps_category.active AS active, ps_category_shop.position AS position, diff --git a/app/repos/localeSelectorRepo/localeSelectorRepo.go b/app/repos/localeSelectorRepo/localeSelectorRepo.go index d52ef87..9342eac 100644 --- a/app/repos/localeSelectorRepo/localeSelectorRepo.go +++ b/app/repos/localeSelectorRepo/localeSelectorRepo.go @@ -28,8 +28,9 @@ func (repo *LocaleSelectorRepo) GetCountriesAndCurrencies() ([]model.Country, er var countries []model.Country err := db.DB. + Table("b2b_countries"). Select("b2b_countries.id, b2b_countries.name, b2b_countries.flag, ps_currency.id_currency as id_currency, ps_currency.name as currency_name, ps_currency.iso_code as currency_iso_code"). - Joins("JOIN ps_currency ON ps_currency.id_currency = b2b_countries.currency"). + Joins("LEFT JOIN ps_currency ON ps_currency.id_currency = b2b_countries.currency_id"). Scan(&countries).Error return countries, err diff --git a/app/service/meiliService/meiliService.go b/app/service/meiliService/meiliService.go index c58bfa1..182d3d4 100644 --- a/app/service/meiliService/meiliService.go +++ b/app/service/meiliService/meiliService.go @@ -34,7 +34,7 @@ func New() *MeiliService { } } -// ==================================== FOR SUPERADMIN ONLY ==================================== +// ==================================== FOR TESTING ONLY ==================================== func (s *MeiliService) CreateIndex(id_lang uint) error { indexName := "meili_products_shop" + strconv.FormatInt(constdata.SHOP_ID, 10) + "_lang" + strconv.FormatInt(int64(id_lang), 10) @@ -130,7 +130,7 @@ func (s *MeiliService) CreateIndex(id_lang uint) error { return err } -// ==================================== FOR DEBUG ONLY ==================================== +// ==================================== FOR TESTING ONLY ==================================== func (s *MeiliService) Test(id_lang uint) (meilisearch.SearchResponse, error) { indexName := "meili_products_shop" + strconv.FormatInt(constdata.SHOP_ID, 10) + "_lang" + strconv.FormatInt(int64(id_lang), 10) diff --git a/app/service/menuService/menuService.go b/app/service/menuService/menuService.go index f4b9994..d0f3d09 100644 --- a/app/service/menuService/menuService.go +++ b/app/service/menuService/menuService.go @@ -1,6 +1,7 @@ package menuService import ( + "fmt" "sort" "git.ma-al.com/goc_daniel/b2b/app/model" @@ -27,6 +28,10 @@ func (s *MenuService) GetMenu(id_lang uint) (*model.Category, error) { return &model.Category{}, err } + fmt.Printf("all_categories: %v\n", all_categories) + + fmt.Printf("id_lang: %v\n", id_lang) + // find the root root_index := 0 root_found := false diff --git a/app/service/productDescriptionService/google_out.txt b/app/service/productTranslationService/google_out.txt similarity index 100% rename from app/service/productDescriptionService/google_out.txt rename to app/service/productTranslationService/google_out.txt diff --git a/app/service/productDescriptionService/openai_out.txt b/app/service/productTranslationService/openai_out.txt similarity index 100% rename from app/service/productDescriptionService/openai_out.txt rename to app/service/productTranslationService/openai_out.txt diff --git a/app/service/productDescriptionService/productDescriptionService.go b/app/service/productTranslationService/productTranslationService.go similarity index 95% rename from app/service/productDescriptionService/productDescriptionService.go rename to app/service/productTranslationService/productTranslationService.go index 940ea41..1b0a747 100644 --- a/app/service/productDescriptionService/productDescriptionService.go +++ b/app/service/productTranslationService/productTranslationService.go @@ -1,4 +1,4 @@ -package productDescriptionService +package productTranslationService import ( "context" @@ -26,7 +26,7 @@ import ( googleopt "google.golang.org/api/option" ) -type ProductDescriptionService struct { +type ProductTranslationService struct { productDescriptionRepo productDescriptionRepo.UIProductDescriptionRepo ctx context.Context googleCli translate.TranslationClient @@ -34,7 +34,7 @@ type ProductDescriptionService struct { openAIClient openai.Client } -// New creates a ProductDescriptionService and authenticates against the +// New creates a ProductTranslationService and authenticates against the // Google Cloud Translation API using a service account key file. // // Required configuration (set in .env or environment): @@ -44,14 +44,14 @@ type ProductDescriptionService struct { // // The service account must have the "Cloud Translation API User" role // (roles/cloudtranslate.user) granted in Google Cloud IAM. -func New() *ProductDescriptionService { +func New() *ProductTranslationService { ctx := context.Background() cfg := config.Get() // Read the service account key file whose path comes from config / env. data, err := os.ReadFile(cfg.GoogleTranslate.CredentialsFile) if err != nil { - log.Fatalf("productDescriptionService: cannot read credentials file %q: %v", + log.Fatalf("ProductTranslationService: cannot read credentials file %q: %v", cfg.GoogleTranslate.CredentialsFile, err) } @@ -62,18 +62,18 @@ func New() *ProductDescriptionService { CredentialsJSON: data, }) if err != nil { - log.Fatalf("productDescriptionService: cannot build Google credentials: %v", err) + log.Fatalf("ProductTranslationService: cannot build Google credentials: %v", err) } googleCli, err := translate.NewTranslationClient(ctx, googleopt.WithAuthCredentials(creds)) if err != nil { - log.Fatalf("productDescriptionService: cannot create Translation client: %v", err) + log.Fatalf("ProductTranslationService: cannot create Translation client: %v", err) } openAIClient := openai.NewClient(option.WithAPIKey(os.Getenv("OPENAI_KEY")), option.WithHTTPClient(&http.Client{Timeout: 300 * time.Second})) // five minutes timeout - return &ProductDescriptionService{ + return &ProductTranslationService{ productDescriptionRepo: productDescriptionRepo.New(), ctx: ctx, openAIClient: openAIClient, @@ -82,12 +82,12 @@ func New() *ProductDescriptionService { } } -func (s *ProductDescriptionService) GetProductDescription(userID uint, productID uint, productLangID uint) (*model.ProductDescription, error) { +func (s *ProductTranslationService) GetProductDescription(userID uint, productID uint, productLangID uint) (*model.ProductDescription, error) { return s.productDescriptionRepo.GetProductDescription(productID, productLangID) } // Updates relevant fields with the "updates" map -func (s *ProductDescriptionService) SaveProductDescription(userID uint, productID uint, productLangID uint, updates map[string]string) error { +func (s *ProductTranslationService) SaveProductDescription(userID uint, productID uint, productLangID uint, updates map[string]string) error { // only some fields can be affected allowedFields := []string{"description", "description_short", "meta_description", "meta_title", "name", "available_now", "available_later", "usage"} for key := range updates { @@ -120,7 +120,7 @@ func (s *ProductDescriptionService) SaveProductDescription(userID uint, productI // // The Google Cloud project must have the Cloud Translation API enabled and the // service account must hold the "Cloud Translation API User" role. -func (s *ProductDescriptionService) TranslateProductDescription(userID uint, productID uint, productFromLangID uint, productToLangID uint, aiModel string) (*model.ProductDescription, error) { +func (s *ProductTranslationService) TranslateProductDescription(userID uint, productID uint, productFromLangID uint, productToLangID uint, aiModel string) (*model.ProductDescription, error) { productDescription, err := s.productDescriptionRepo.GetProductDescription(productID, productFromLangID) if err != nil { diff --git a/app/service/productDescriptionService/test_in.txt b/app/service/productTranslationService/test_in.txt similarity index 100% rename from app/service/productDescriptionService/test_in.txt rename to app/service/productTranslationService/test_in.txt diff --git a/bo/components.d.ts b/bo/components.d.ts index 85bba39..3211d23 100644 --- a/bo/components.d.ts +++ b/bo/components.d.ts @@ -13,13 +13,11 @@ declare module 'vue' { export interface GlobalComponents { Cart1: typeof import('./src/components/customer/Cart1.vue')['default'] CategoryMenu: typeof import('./src/components/inner/categoryMenu.vue')['default'] - CompanyAccountView: typeof import('./src/components/customer/CompanyAccountView.vue')['default'] Cs_PrivacyPolicyView: typeof import('./src/components/terms/cs_PrivacyPolicyView.vue')['default'] Cs_TermsAndConditionsView: typeof import('./src/components/terms/cs_TermsAndConditionsView.vue')['default'] En_PrivacyPolicyView: typeof import('./src/components/terms/en_PrivacyPolicyView.vue')['default'] En_TermsAndConditionsView: typeof import('./src/components/terms/en_TermsAndConditionsView.vue')['default'] LangSwitch: typeof import('./src/components/inner/langSwitch.vue')['default'] - PageAccount: typeof import('./src/components/customer/PageAccount.vue')['default'] PageAddresses: typeof import('./src/components/customer/PageAddresses.vue')['default'] PageCart: typeof import('./src/components/customer/PageCart.vue')['default'] PageCreateAccount: typeof import('./src/components/customer/PageCreateAccount.vue')['default'] @@ -48,7 +46,6 @@ declare module 'vue' { UInput: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Input.vue')['default'] UInputNumber: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/InputNumber.vue')['default'] UModal: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Modal.vue')['default'] - UNavigationMenu: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/NavigationMenu.vue')['default'] UPagination: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Pagination.vue')['default'] USelect: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/Select.vue')['default'] USelectMenu: typeof import('./node_modules/@nuxt/ui/dist/runtime/components/SelectMenu.vue')['default'] diff --git a/i18n/migrations/20260302163122_create_tables.sql b/i18n/migrations/20260302163122_create_tables.sql index c2e104b..d9d0136 100644 --- a/i18n/migrations/20260302163122_create_tables.sql +++ b/i18n/migrations/20260302163122_create_tables.sql @@ -126,13 +126,13 @@ CREATE INDEX IF NOT EXISTS idx_refresh_tokens_customer_id ON b2b_refresh_tokens CREATE TABLE IF NOT EXISTS b2b_countries ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(128) NOT NULL, - currency INT UNSIGNED NOT NULL, + currency_id INT UNSIGNED NOT NULL, flag VARCHAR(16) NOT NULL, - CONSTRAINT fk_countries_currency FOREIGN KEY (currency) REFERENCES ps_currency(id_currency) ON DELETE RESTRICT ON UPDATE RESTRICT + CONSTRAINT fk_countries_currency FOREIGN KEY (currency_id) REFERENCES ps_currency(id_currency) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT IGNORE INTO b2b_countries - (id, name, currency, flag) + (id, name, currency_id, flag) VALUES (1, 'Polska', 1, '🇵🇱'), (2, 'England', 2, '🇬🇧'),