Merge branch 'routing'

This commit is contained in:
2026-03-26 02:25:22 +01:00
358 changed files with 9255 additions and 640 deletions

59
.env_example Normal file
View File

@@ -0,0 +1,59 @@
SERVER_PORT=3000
SERVER_HOST=0.0.0.0
# Database Configuration
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=Maal12345678
DB_NAME=nalu
PROJECT_NAME=nalu_b2b
DB_SERVICE_NAME=nalu_b2b
DB_SSLMODE=disable
# App COnfig
APP_NAME="B2b Management System"
APP_VERSION=2.1.0
APP_ENVIRONMENT=development
# JWT Configuration
AUTH_JWT_SECRET=5c020e6ed3d8d6e67e5804d67c83c4bd5ae474df749af6d63d8f20e7e2ba29b3
AUTH_JWT_EXPIRATION=86400
AUTH_REFRESH_EXPIRATION=604800
# Meili search
MEILISEARCH_URL=http://localhost:7700
MEILISEARCH_API_KEY=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
# OpenAI
OPENAI_KEY=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
# Google Translate Client
GOOGLE_APPLICATION_CREDENTIALS=./google-cred.json
GOOGLE_CLOUD_PROJECT_ID=translation-343517
# Google OAuth2
OAUTH_GOOGLE_CLIENT_ID=331979954218-9vrpe08oqhhcgj6bvu6d4lds0dt630m9.apps.googleusercontent.com
OAUTH_GOOGLE_CLIENT_SECRET=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
OAUTH_GOOGLE_REDIRECT_URL=http://localhost:3000/api/v1/public/auth/google/callback
# Email Configuration (SMTP)
# Set EMAIL_ENABLED=true to require email verification
EMAIL_ENABLED=true
EMAIL_SMTP_HOST=mail.ma-al.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USER=test@ma-al.com
EMAIL_SMTP_PASSWORD=maal12345678
EMAIL_FROM=test@ma-al.com
EMAIL_FROM_NAME=Gitea Manager
EMAIL_ADMIN=goc_marek@ma-al.pl
I18N_LANGS=en,pl,cs
PDF_SERVER_URL=http://localhost:8000
FILE_MAAL_PL_USER=git_operator
FILE_MAAL_PL_PASSWORD=1FnwqcEgIUjQHjt1
IMAGE_PREFIX=https://www.naluconcept.com # remove prefix to serv them from same host as presta

View File

@@ -33,8 +33,8 @@
"description": "Product listing and description endpoints (under /api/v1/restricted, requires authentication)" "description": "Product listing and description endpoints (under /api/v1/restricted, requires authentication)"
}, },
{ {
"name": "Product Description", "name": "Product Translation",
"description": "Product description management and translation endpoints (under /api/v1/restricted/product-description, requires authentication)" "description": "Product description management and translation endpoints (under /api/v1/restricted/product-translation, requires authentication)"
}, },
{ {
"name": "Menu", "name": "Menu",
@@ -48,17 +48,13 @@
"name": "Locale", "name": "Locale",
"description": "Locale selection endpoints (under /api/v1/restricted/langs-and-countries, requires authentication)" "description": "Locale selection endpoints (under /api/v1/restricted/langs-and-countries, requires authentication)"
}, },
{
"name": "Repo",
"description": "Repository time tracking data endpoints (under /api/v1/restricted/repo, requires authentication)"
},
{
"name": "Admin",
"description": "Admin-only endpoints"
},
{ {
"name": "Settings", "name": "Settings",
"description": "Application settings and configuration endpoints" "description": "Application settings and configuration endpoints"
},
{
"name": "Carts",
"description": "Shopping cart management endpoints (under /api/v1/restricted/carts, requires authentication)"
} }
], ],
"paths": { "paths": {
@@ -629,6 +625,41 @@
} }
} }
}, },
"/api/v1/public/auth/update-choice": {
"post": {
"tags": ["Auth"],
"summary": "Update JWT token choice",
"description": "Updates the user's JWT token preference or refreshes the token. Requires authentication.",
"operationId": "updateChoice",
"security": [
{
"CookieAuth": []
}
],
"responses": {
"200": {
"description": "Token choice updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/public/auth/google": { "/api/v1/public/auth/google": {
"get": { "get": {
"tags": ["Auth"], "tags": ["Auth"],
@@ -733,292 +764,6 @@
} }
} }
}, },
"/api/v1/restricted/repo/get-repos": {
"get": {
"tags": ["Repo"],
"summary": "Get accessible repositories",
"description": "Returns a list of repository IDs that the authenticated user has access to.",
"operationId": "getRepos",
"security": [
{
"CookieAuth": []
}
],
"responses": {
"200": {
"description": "List of repository IDs",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "uint"
},
"example": [1, 2, 5]
}
}
}
},
"400": {
"description": "Invalid user session",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/repo/get-years": {
"get": {
"tags": ["Repo"],
"summary": "Get available years for a repository",
"description": "Returns a list of years for which tracked time data exists in the given repository. User must have access to the repository.",
"operationId": "getYears",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "repoID",
"in": "query",
"description": "Repository ID",
"required": true,
"schema": {
"type": "integer",
"format": "uint"
}
}
],
"responses": {
"200": {
"description": "List of years with tracked time data",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "uint"
},
"example": [2023, 2024, 2025]
}
}
}
},
"400": {
"description": "Invalid repoID parameter or user does not have access to the repository",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/repo/get-quarters": {
"get": {
"tags": ["Repo"],
"summary": "Get quarterly time data for a repository",
"description": "Returns time tracked per quarter for the given repository and year. All 4 quarters are returned; quarters with no data have time=0. User must have access to the repository.",
"operationId": "getQuarters",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "repoID",
"in": "query",
"description": "Repository ID",
"required": true,
"schema": {
"type": "integer",
"format": "uint"
}
},
{
"name": "year",
"in": "query",
"description": "Year to retrieve quarterly data for",
"required": true,
"schema": {
"type": "integer",
"format": "uint",
"example": 2024
}
}
],
"responses": {
"200": {
"description": "Quarterly time data",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/QuarterData"
}
}
}
}
},
"400": {
"description": "Invalid repoID or year parameter, or user does not have access to the repository",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/repo/get-issues": {
"get": {
"tags": ["Repo"],
"summary": "Get issues with time summaries",
"description": "Returns a paginated list of issues with time tracking summaries for the given repository, year, and quarter. User must have access to the repository.",
"operationId": "getIssues",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "repoID",
"in": "query",
"description": "Repository ID",
"required": true,
"schema": {
"type": "integer",
"format": "uint"
}
},
{
"name": "year",
"in": "query",
"description": "Year to filter issues by",
"required": true,
"schema": {
"type": "integer",
"format": "uint",
"example": 2024
}
},
{
"name": "quarter",
"in": "query",
"description": "Quarter number (1-4) to filter issues by",
"required": true,
"schema": {
"type": "integer",
"format": "uint",
"minimum": 1,
"maximum": 4,
"example": 2
}
},
{
"name": "page_number",
"in": "query",
"description": "Page number for pagination (1-based)",
"required": true,
"schema": {
"type": "integer",
"format": "uint",
"example": 1
}
},
{
"name": "elements_per_page",
"in": "query",
"description": "Number of items per page",
"required": true,
"schema": {
"type": "integer",
"format": "uint",
"example": 30
}
}
],
"responses": {
"200": {
"description": "Paginated list of issues with time summaries",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaginatedIssues"
}
}
}
},
"400": {
"description": "Invalid parameters or user does not have access to the repository",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/settings": { "/api/v1/settings": {
"get": { "get": {
"tags": ["Settings"], "tags": ["Settings"],
@@ -1043,7 +788,7 @@
"get": { "get": {
"tags": ["Products"], "tags": ["Products"],
"summary": "Get product listing", "summary": "Get product listing",
"description": "Returns a paginated list of products with their basic information. Supports filtering via query parameters with operators (e.g., product_id_eq=12, name=~gold). Use sort parameter for ordering. Requires authentication.", "description": "Returns a paginated list of products with their basic information. Supports filtering via query parameters with operators (e.g., product_id_eq=12, name=~wałek). Use sort parameter for ordering. Requires authentication.",
"operationId": "getProductListing", "operationId": "getProductListing",
"security": [ "security": [
{ {
@@ -1093,11 +838,10 @@
{ {
"name": "name", "name": "name",
"in": "query", "in": "query",
"description": "Filter by product name using LIKE (case-insensitive). Use ~ prefix for partial match (e.g., '~gold')", "description": "Filter by product name using LIKE (case-insensitive). Use ~ prefix for partial match (e.g., '~wałek')",
"required": false, "required": false,
"schema": { "schema": {
"type": "string", "type": "string"
"example": "~gold"
} }
}, },
{ {
@@ -1171,9 +915,9 @@
} }
} }
}, },
"/api/v1/restricted/product-description/get-product-description": { "/api/v1/restricted/product-translation/get-product-description": {
"get": { "get": {
"tags": ["Product Description"], "tags": ["Product Translation"],
"summary": "Get product description", "summary": "Get product description",
"description": "Returns the product description for a given product ID and language. Requires authentication.", "description": "Returns the product description for a given product ID and language. Requires authentication.",
"operationId": "getProductDescription", "operationId": "getProductDescription",
@@ -1238,9 +982,9 @@
} }
} }
}, },
"/api/v1/restricted/product-description/save-product-description": { "/api/v1/restricted/product-translation/save-product-description": {
"post": { "post": {
"tags": ["Product Description"], "tags": ["Product Translation"],
"summary": "Save product description", "summary": "Save product description",
"description": "Saves the product description for a given product ID in the specified language. Requires authentication.", "description": "Saves the product description for a given product ID in the specified language. Requires authentication.",
"operationId": "saveProductDescription", "operationId": "saveProductDescription",
@@ -1315,9 +1059,9 @@
} }
} }
}, },
"/api/v1/restricted/product-description/translate-product-description": { "/api/v1/restricted/product-translation/translate-product-description": {
"get": { "get": {
"tags": ["Product Description"], "tags": ["Product Translation"],
"summary": "Translate product description", "summary": "Translate product description",
"description": "Translates the product description from one language to another using AI (OpenAI or Google). Requires authentication.", "description": "Translates the product description from one language to another using AI (OpenAI or Google). Requires authentication.",
"operationId": "translateProductDescription", "operationId": "translateProductDescription",
@@ -1527,7 +1271,7 @@
"name": "id_category", "name": "id_category",
"in": "query", "in": "query",
"description": "Filter by category ID", "description": "Filter by category ID",
"required": true, "required": false,
"schema": { "schema": {
"type": "integer", "type": "integer",
"format": "uint" "format": "uint"
@@ -1537,7 +1281,7 @@
"name": "price_lower_bound", "name": "price_lower_bound",
"in": "query", "in": "query",
"description": "Lower price bound", "description": "Lower price bound",
"required": true, "required": false,
"schema": { "schema": {
"type": "number", "type": "number",
"format": "double" "format": "double"
@@ -1547,7 +1291,7 @@
"name": "price_upper_bound", "name": "price_upper_bound",
"in": "query", "in": "query",
"description": "Upper price bound", "description": "Upper price bound",
"required": true, "required": false,
"schema": { "schema": {
"type": "number", "type": "number",
"format": "double" "format": "double"
@@ -1592,7 +1336,7 @@
"get": { "get": {
"tags": ["Search"], "tags": ["Search"],
"summary": "Create search index", "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", "operationId": "createSearchIndex",
"security": [ "security": [
{ {
@@ -1637,7 +1381,7 @@
"get": { "get": {
"tags": ["Search"], "tags": ["Search"],
"summary": "Test MeiliSearch", "summary": "Test MeiliSearch",
"description": "Tests the MeiliSearch connection. Requires superadmin access.", "description": "Tests the MeiliSearch search. Must be removed before proper release.",
"operationId": "testMeiliSearch", "operationId": "testMeiliSearch",
"security": [ "security": [
{ {
@@ -1767,6 +1511,280 @@
} }
} }
} }
},
"/api/v1/restricted/carts/add-new-cart": {
"get": {
"tags": ["Carts"],
"summary": "Create a new cart",
"description": "Creates a new shopping cart for the authenticated user. Requires authentication.",
"operationId": "addNewCart",
"security": [
{
"CookieAuth": []
}
],
"responses": {
"200": {
"description": "Cart created successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/carts/change-cart-name": {
"get": {
"tags": ["Carts"],
"summary": "Change cart name",
"description": "Updates the name of an existing cart. Requires authentication.",
"operationId": "changeCartName",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "cart_id",
"in": "query",
"description": "ID of the cart to rename",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "new_name",
"in": "query",
"description": "New name for the cart",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Cart name updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"400": {
"description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/carts/retrieve-carts-info": {
"get": {
"tags": ["Carts"],
"summary": "Retrieve all carts info",
"description": "Returns information about all carts belonging to the authenticated user. Requires authentication.",
"operationId": "retrieveCartsInfo",
"security": [
{
"CookieAuth": []
}
],
"responses": {
"200": {
"description": "Carts info retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/carts/retrieve-cart": {
"get": {
"tags": ["Carts"],
"summary": "Retrieve cart details",
"description": "Returns detailed contents of a specific cart. Requires authentication.",
"operationId": "retrieveCart",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "cart_id",
"in": "query",
"description": "ID of the cart to retrieve",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Cart retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"400": {
"description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/api/v1/restricted/carts/add-product-to-cart": {
"get": {
"tags": ["Carts"],
"summary": "Add product to cart",
"description": "Adds a product to the specified cart. Requires authentication.",
"operationId": "addProductToCart",
"security": [
{
"CookieAuth": []
}
],
"parameters": [
{
"name": "cart_id",
"in": "query",
"description": "ID of the cart to add product to",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "product_id",
"in": "query",
"description": "ID of the product to add",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "product_attribute_id",
"in": "query",
"description": "ID of the product attribute (optional, for product variants)",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "amount",
"in": "query",
"description": "Quantity to add",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Product added to cart successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiResponse"
}
}
}
},
"400": {
"description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
} }
}, },
"components": { "components": {

25
app/cmd/cmds/genModels.go Normal file
View File

@@ -0,0 +1,25 @@
package cmds
import (
"context"
"log/slog"
"time"
"git.ma-al.com/goc_daniel/b2b/app/db"
genmodels "git.ma-al.com/goc_daniel/b2b/app/utils/genModels"
"github.com/spf13/cobra"
)
var generateModelsCmd = &cobra.Command{
Use: "genmodels",
Short: "generate input database models",
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
defer cancel()
err := genmodels.New(db.Get()).GormGenModels(ctx)
if err != nil {
slog.Error("Error performing work: " + err.Error())
}
},
}

View File

@@ -0,0 +1,60 @@
package cmds
import (
"log"
"os"
"git.ma-al.com/goc_daniel/b2b/app/delivery/web"
"git.ma-al.com/goc_daniel/b2b/app/service/langsService"
"git.ma-al.com/goc_daniel/b2b/app/utils/version"
"github.com/spf13/cobra"
)
var (
rootCmd = &cobra.Command{
Use: "b2b",
Short: "This is set of tools for b2b application",
Run: func(cmd *cobra.Command, args []string) {
if versionFlag, _ := cmd.Flags().GetBool("version"); versionFlag {
log.Println(version.String())
return
}
// Create and setup the server
server := web.New()
// Configure routes
if err := server.Setup(); err != nil {
log.Fatalf("Failed to setup server: %v", err)
}
// Load translations on startup
if err := langsService.LangSrv.LoadTranslations(); err != nil {
log.Printf("Warning: Failed to load translations on startup: %v", err)
} else {
log.Println("Translations loaded successfully on startup")
}
// Start the server
if err := server.Run(); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
},
}
)
func Execute() error {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
return nil
}
func init() {
rootCmd.Flags().BoolP("version", "v", false, "show version and exit")
rootCmd.AddCommand(generateModelsCmd)
}

View File

@@ -1,41 +1,9 @@
package main package main
import ( import (
"flag" "git.ma-al.com/goc_daniel/b2b/app/cmd/cmds"
"log"
"git.ma-al.com/goc_daniel/b2b/app/delivery/web"
"git.ma-al.com/goc_daniel/b2b/app/service/langsService"
"git.ma-al.com/goc_daniel/b2b/app/utils/version"
) )
func main() { func main() {
// Check for version subcommand cmds.Execute()
versionFlag := flag.Bool("version", false, "Show version information")
flag.Parse()
if *versionFlag {
log.Println(version.String())
return
}
// Create and setup the server
server := web.New()
// Configure routes
if err := server.Setup(); err != nil {
log.Fatalf("Failed to setup server: %v", err)
}
// Load translations on startup
if err := langsService.LangSrv.LoadTranslations(); err != nil {
log.Printf("Warning: Failed to load translations on startup: %v", err)
} else {
log.Println("Translations loaded successfully on startup")
}
// Start the server
if err := server.Run(); err != nil {
log.Fatalf("Failed to start server: %v", err)
}
} }

View File

@@ -40,7 +40,6 @@ func AuthHandlerRoutes(r fiber.Router) fiber.Router {
r.Post("/reset-password", handler.ResetPassword) r.Post("/reset-password", handler.ResetPassword)
r.Post("/logout", handler.Logout) r.Post("/logout", handler.Logout)
r.Post("/refresh", handler.RefreshToken) r.Post("/refresh", handler.RefreshToken)
r.Post("/update-choice", handler.UpdateJWTToken)
// Google OAuth2 // Google OAuth2
r.Get("/google", handler.GoogleLogin) r.Get("/google", handler.GoogleLogin)
@@ -48,6 +47,7 @@ func AuthHandlerRoutes(r fiber.Router) fiber.Router {
authProtected := r.Group("", middleware.AuthMiddleware()) authProtected := r.Group("", middleware.AuthMiddleware())
authProtected.Get("/me", handler.Me) authProtected.Get("/me", handler.Me)
authProtected.Post("/update-choice", handler.UpdateJWTToken)
return r return r
} }
@@ -345,9 +345,9 @@ func (h *AuthHandler) CompleteRegistration(c fiber.Ctx) error {
return c.Status(fiber.StatusCreated).JSON(response) 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 { 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 // GoogleLogin redirects the user to Google's OAuth2 consent page

View File

@@ -0,0 +1,168 @@
package restricted
import (
"strconv"
"git.ma-al.com/goc_daniel/b2b/app/service/cartsService"
"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"
"git.ma-al.com/goc_daniel/b2b/app/utils/responseErrors"
"github.com/gofiber/fiber/v3"
)
// CartsHandler handles endpoints that modify carts.
type CartsHandler struct {
cartsService *cartsService.CartsService
}
// CartsHandler creates a new CartsHandler instance
func NewCartsHandler() *CartsHandler {
cartsService := cartsService.New()
return &CartsHandler{
cartsService: cartsService,
}
}
func CartsHandlerRoutes(r fiber.Router) fiber.Router {
handler := NewCartsHandler()
r.Get("/add-new-cart", handler.AddNewCart)
r.Get("/change-cart-name", handler.ChangeCartName)
r.Get("/retrieve-carts-info", handler.RetrieveCartsInfo)
r.Get("/retrieve-cart", handler.RetrieveCart)
r.Get("/add-product-to-cart", handler.AddProduct)
return r
}
func (h *CartsHandler) AddNewCart(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody)))
}
new_cart, err := h.cartsService.CreateNewCart(userID)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))
}
return c.JSON(response.Make(&new_cart, 0, i18n.T_(c, response.Message_OK)))
}
func (h *CartsHandler) ChangeCartName(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody)))
}
new_name := c.Query("new_name")
cart_id_attribute := c.Query("cart_id")
cart_id, err := strconv.Atoi(cart_id_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
err = h.cartsService.UpdateCartName(userID, uint(cart_id), new_name)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))
}
return c.JSON(response.Make(nullable.GetNil(""), 0, i18n.T_(c, response.Message_OK)))
}
func (h *CartsHandler) RetrieveCartsInfo(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody)))
}
carts_info, err := h.cartsService.RetrieveCartsInfo(userID)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))
}
return c.JSON(response.Make(&carts_info, 0, i18n.T_(c, response.Message_OK)))
}
func (h *CartsHandler) RetrieveCart(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody)))
}
cart_id_attribute := c.Query("cart_id")
cart_id, err := strconv.Atoi(cart_id_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
cart, err := h.cartsService.RetrieveCart(userID, uint(cart_id))
if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))
}
return c.JSON(response.Make(cart, 0, i18n.T_(c, response.Message_OK)))
}
func (h *CartsHandler) AddProduct(c fiber.Ctx) error {
userID, ok := c.Locals("userID").(uint)
if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrInvalidBody)))
}
cart_id_attribute := c.Query("cart_id")
cart_id, err := strconv.Atoi(cart_id_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
product_id_attribute := c.Query("product_id")
product_id, err := strconv.Atoi(product_id_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
product_attribute_id_attribute := c.Query("product_attribute_id")
var product_attribute_id *uint
if product_attribute_id_attribute == "" {
product_attribute_id = nil
} else {
val, err := strconv.Atoi(product_attribute_id_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
uval := uint(val)
product_attribute_id = &uval
}
amount_attribute := c.Query("amount")
amount, err := strconv.Atoi(amount_attribute)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, responseErrors.ErrBadAttribute)))
}
err = h.cartsService.AddProduct(userID, uint(cart_id), uint(product_id), product_attribute_id, uint(amount))
if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))
}
return c.JSON(response.Make(nullable.GetNil(""), 0, i18n.T_(c, response.Message_OK)))
}

View File

@@ -25,7 +25,7 @@ func NewMeiliSearchHandler() *MeiliSearchHandler {
func MeiliSearchHandlerRoutes(r fiber.Router) fiber.Router { func MeiliSearchHandlerRoutes(r fiber.Router) fiber.Router {
handler := NewMeiliSearchHandler() handler := NewMeiliSearchHandler()
// for superadmin only // for testing purposes only. Must be removed before proper release.
r.Get("/create-index", handler.CreateIndex) r.Get("/create-index", handler.CreateIndex)
r.Get("/test", handler.Test) 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))) 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) id_category, err := strconv.Atoi(id_category_attribute)
if err != nil { if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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) price_lower_bound, err := strconv.ParseFloat(price_lower_bound_attribute, 64)
if err != nil { if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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) price_upper_bound, err := strconv.ParseFloat(price_upper_bound_attribute, 64)
if err != nil { if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)). return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadAttribute)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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 { if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)). return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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)))
} }

View File

@@ -4,7 +4,7 @@ import (
"strconv" "strconv"
"git.ma-al.com/goc_daniel/b2b/app/config" "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/i18n"
"git.ma-al.com/goc_daniel/b2b/app/utils/nullable" "git.ma-al.com/goc_daniel/b2b/app/utils/nullable"
"git.ma-al.com/goc_daniel/b2b/app/utils/response" "git.ma-al.com/goc_daniel/b2b/app/utils/response"
@@ -13,24 +13,24 @@ import (
"github.com/gofiber/fiber/v3" "github.com/gofiber/fiber/v3"
) )
// ProductDescriptionHandler handles endpoints that receive, save and translate product descriptions. // ProductTranslationHandler handles endpoints that receive, save and translate product descriptions.
type ProductDescriptionHandler struct { type ProductTranslationHandler struct {
productDescriptionService *productDescriptionService.ProductDescriptionService productTranslationService *productTranslationService.ProductTranslationService
config *config.Config config *config.Config
} }
// NewProductDescriptionHandler creates a new ProductDescriptionHandler instance // NewProductTranslationHandler creates a new ProductTranslationHandler instance
func NewProductDescriptionHandler() *ProductDescriptionHandler { func NewProductTranslationHandler() *ProductTranslationHandler {
productDescriptionService := productDescriptionService.New() productTranslationService := productTranslationService.New()
return &ProductDescriptionHandler{ return &ProductTranslationHandler{
productDescriptionService: productDescriptionService, productTranslationService: productTranslationService,
config: config.Get(), config: config.Get(),
} }
} }
// ProductDescriptionRoutes registers all product description routes // ProductTranslationRoutes registers all product description routes
func ProductDescriptionHandlerRoutes(r fiber.Router) fiber.Router { func ProductTranslationHandlerRoutes(r fiber.Router) fiber.Router {
handler := NewProductDescriptionHandler() handler := NewProductTranslationHandler()
r.Get("/get-product-description", handler.GetProductDescription) r.Get("/get-product-description", handler.GetProductDescription)
r.Post("/save-product-description", handler.SaveProductDescription) 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 // 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) userID, ok := c.Locals("userID").(uint)
if !ok { if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). 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))) 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 { if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)). return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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 // 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) userID, ok := c.Locals("userID").(uint)
if !ok { if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). 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))) 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 { if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)). return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, 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 // 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) userID, ok := c.Locals("userID").(uint)
if !ok { if !ok {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrInvalidBody)). 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))) 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 { if err != nil {
return c.Status(responseErrors.GetErrorStatus(err)). return c.Status(responseErrors.GetErrorStatus(err)).
JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err))) JSON(response.Make(nullable.GetNil(""), 0, responseErrors.GetErrorCode(c, err)))

View File

@@ -89,9 +89,9 @@ func (s *Server) Setup() error {
auth := s.public.Group("/auth") auth := s.public.Group("/auth")
public.AuthHandlerRoutes(auth) public.AuthHandlerRoutes(auth)
// product description routes (restricted) // product translation routes (restricted)
productDescription := s.restricted.Group("/product-description") productTranslation := s.restricted.Group("/product-translation")
restricted.ProductDescriptionHandlerRoutes(productDescription) restricted.ProductTranslationHandlerRoutes(productTranslation)
// listing products routes (restricted) // listing products routes (restricted)
listProducts := s.restricted.Group("/list-products") listProducts := s.restricted.Group("/list-products")
@@ -110,6 +110,10 @@ func (s *Server) Setup() error {
meiliSearch := s.restricted.Group("/meili-search") meiliSearch := s.restricted.Group("/meili-search")
restricted.MeiliSearchHandlerRoutes(meiliSearch) restricted.MeiliSearchHandlerRoutes(meiliSearch)
// carts (restricted)
carts := s.restricted.Group("/carts")
restricted.CartsHandlerRoutes(carts)
s.api.All("*", func(c fiber.Ctx) error { s.api.All("*", func(c fiber.Ctx) error {
return c.SendStatus(fiber.StatusNotFound) return c.SendStatus(fiber.StatusNotFound)
}) })

24
app/model/cart.go Normal file
View File

@@ -0,0 +1,24 @@
package model
type CustomerCart struct {
CartID uint `gorm:"column:cart_id;primaryKey;autoIncrement" json:"cart_id"`
UserID uint `gorm:"column:user_id;not null;index" json:"-"`
Name *string `gorm:"column:name;size:255" json:"name,omitempty"`
Products []CartProduct `gorm:"foreignKey:CartID;references:CartID" json:"products,omitempty"`
}
func (CustomerCart) TableName() string {
return "b2b_customer_carts"
}
type CartProduct struct {
ID uint `gorm:"column:id;primaryKey;autoIncrement" json:"-"`
CartID uint `gorm:"column:cart_id;not null;index" json:"-"`
ProductID uint `gorm:"column:product_id;not null" json:"product_id"`
ProductAttributeID *uint `gorm:"column:product_attribute_id" json:"product_attribute_id,omitempty"`
Amount uint `gorm:"column:amount;not null" json:"amount"`
}
func (CartProduct) TableName() string {
return "b2b_carts_products"
}

View File

@@ -8,4 +8,24 @@ type Country struct {
CurrencyID uint `gorm:"column:id_currency" json:"currency_id"` CurrencyID uint `gorm:"column:id_currency" json:"currency_id"`
CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"` CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"`
CurrencyName string `gorm:"column:name" json:"currency_name"` CurrencyName string `gorm:"column:name" json:"currency_name"`
// PSCountryID int `gorm:"column:id_country" json:"ps_country_id"`
// PSCountry *PSCountry `gorm:"foreignKey:PSCountryID;references:ID" json:"ps_country"`
PSCurrencyID uint `gorm:"column:currency" json:"currency"`
PSCurrency *PSCurrency `gorm:"foreignKey:PSCurrencyID;references:currency_id" json:"ps_currency"`
}
func (Country) TableName() string {
return "b2b_countries"
}
type PSCountry struct {
CurrencyID uint `gorm:"column:id_currency" json:"currency_id"`
}
func (PSCountry) TableName() string {
return "ps_country"
}
type PSCurrency struct {
Currency int `gorm:"column:currency" json:"currency"`
} }

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAccess = "ps_access"
// PsAccess mapped from table <ps_access>
type PsAccess struct {
IDProfile int32 `gorm:"column:id_profile;primaryKey" json:"id_profile"`
IDAuthorizationRole int32 `gorm:"column:id_authorization_role;primaryKey" json:"id_authorization_role"`
}
// TableName PsAccess's table name
func (*PsAccess) TableName() string {
return TableNamePsAccess
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAccessory = "ps_accessory"
// PsAccessory mapped from table <ps_accessory>
type PsAccessory struct {
IDProduct1 int32 `gorm:"column:id_product_1;not null;index:accessory_product,priority:1" json:"id_product_1"`
IDProduct2 int32 `gorm:"column:id_product_2;not null;index:accessory_product,priority:2" json:"id_product_2"`
}
// TableName PsAccessory's table name
func (*PsAccessory) TableName() string {
return TableNamePsAccessory
}

View File

@@ -0,0 +1,45 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsAddress = "ps_address"
// PsAddress mapped from table <ps_address>
type PsAddress struct {
IDAddress int32 `gorm:"column:id_address;primaryKey;autoIncrement:true" json:"id_address"`
IDCountry int32 `gorm:"column:id_country;not null;index:id_country,priority:1" json:"id_country"`
IDState *int32 `gorm:"column:id_state;index:id_state,priority:1" json:"id_state"`
IDCustomer int32 `gorm:"column:id_customer;not null;index:address_customer,priority:1" json:"id_customer"`
IDManufacturer int32 `gorm:"column:id_manufacturer;not null;index:id_manufacturer,priority:1" json:"id_manufacturer"`
IDSupplier int32 `gorm:"column:id_supplier;not null;index:id_supplier,priority:1" json:"id_supplier"`
IDWarehouse int32 `gorm:"column:id_warehouse;not null;index:id_warehouse,priority:1" json:"id_warehouse"`
Alias string `gorm:"column:alias;not null" json:"alias"`
Company *string `gorm:"column:company" json:"company"`
Lastname string `gorm:"column:lastname;not null" json:"lastname"`
Firstname string `gorm:"column:firstname;not null" json:"firstname"`
Address1 string `gorm:"column:address1;not null" json:"address1"`
Address2 *string `gorm:"column:address2" json:"address2"`
Postcode *string `gorm:"column:postcode" json:"postcode"`
City string `gorm:"column:city;not null" json:"city"`
Other *string `gorm:"column:other" json:"other"`
Phone *string `gorm:"column:phone" json:"phone"`
PhoneMobile *string `gorm:"column:phone_mobile" json:"phone_mobile"`
VatNumber *string `gorm:"column:vat_number" json:"vat_number"`
Dni *string `gorm:"column:dni" json:"dni"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
Active bool `gorm:"column:active;not null;default:1" json:"active"`
Deleted bool `gorm:"column:deleted;not null" json:"deleted"`
IsNovat int32 `gorm:"column:is_novat;not null" json:"is_novat"`
}
// TableName PsAddress's table name
func (*PsAddress) TableName() string {
return TableNamePsAddress
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAddressFormat = "ps_address_format"
// PsAddressFormat mapped from table <ps_address_format>
type PsAddressFormat struct {
IDCountry int32 `gorm:"column:id_country;primaryKey" json:"id_country"`
Format string `gorm:"column:format;not null" json:"format"`
}
// TableName PsAddressFormat's table name
func (*PsAddressFormat) TableName() string {
return TableNamePsAddressFormat
}

View File

@@ -0,0 +1,23 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAdminFilter = "ps_admin_filter"
// PsAdminFilter mapped from table <ps_admin_filter>
type PsAdminFilter struct {
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
Employee int32 `gorm:"column:employee;not null;uniqueIndex:admin_filter_search_id_idx,priority:1" json:"employee"`
Shop int32 `gorm:"column:shop;not null;uniqueIndex:admin_filter_search_id_idx,priority:2" json:"shop"`
Controller string `gorm:"column:controller;not null;uniqueIndex:admin_filter_search_id_idx,priority:3" json:"controller"`
Action string `gorm:"column:action;not null;uniqueIndex:admin_filter_search_id_idx,priority:4" json:"action"`
Filter string `gorm:"column:filter;not null" json:"filter"`
FilterID string `gorm:"column:filter_id;not null;uniqueIndex:admin_filter_search_id_idx,priority:5" json:"filter_id"`
}
// TableName PsAdminFilter's table name
func (*PsAdminFilter) TableName() string {
return TableNamePsAdminFilter
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAdvice = "ps_advice"
// PsAdvice mapped from table <ps_advice>
type PsAdvice struct {
IDAdvice int32 `gorm:"column:id_advice;primaryKey;autoIncrement:true" json:"id_advice"`
IDPsAdvice int32 `gorm:"column:id_ps_advice;not null" json:"id_ps_advice"`
IDTab int32 `gorm:"column:id_tab;not null" json:"id_tab"`
IdsTab *string `gorm:"column:ids_tab" json:"ids_tab"`
Validated bool `gorm:"column:validated;not null" json:"validated"`
Hide bool `gorm:"column:hide;not null" json:"hide"`
Location string `gorm:"column:location;not null" json:"location"`
Selector *string `gorm:"column:selector" json:"selector"`
StartDay int32 `gorm:"column:start_day;not null" json:"start_day"`
StopDay int32 `gorm:"column:stop_day;not null" json:"stop_day"`
Weight *int32 `gorm:"column:weight;default:1" json:"weight"`
}
// TableName PsAdvice's table name
func (*PsAdvice) TableName() string {
return TableNamePsAdvice
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAdviceLang = "ps_advice_lang"
// PsAdviceLang mapped from table <ps_advice_lang>
type PsAdviceLang struct {
IDAdvice int32 `gorm:"column:id_advice;primaryKey" json:"id_advice"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
HTML *string `gorm:"column:html" json:"html"`
}
// TableName PsAdviceLang's table name
func (*PsAdviceLang) TableName() string {
return TableNamePsAdviceLang
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAlias = "ps_alias"
// PsAlias mapped from table <ps_alias>
type PsAlias struct {
IDAlias int32 `gorm:"column:id_alias;primaryKey;autoIncrement:true" json:"id_alias"`
Alias string `gorm:"column:alias;not null;uniqueIndex:alias,priority:1" json:"alias"`
Search string `gorm:"column:search;not null" json:"search"`
Active bool `gorm:"column:active;not null;default:1" json:"active"`
}
// TableName PsAlias's table name
func (*PsAlias) TableName() string {
return TableNamePsAlias
}

View File

@@ -0,0 +1,21 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttachment = "ps_attachment"
// PsAttachment mapped from table <ps_attachment>
type PsAttachment struct {
IDAttachment int32 `gorm:"column:id_attachment;primaryKey;autoIncrement:true" json:"id_attachment"`
File string `gorm:"column:file;not null" json:"file"`
FileName string `gorm:"column:file_name;not null" json:"file_name"`
FileSize int64 `gorm:"column:file_size;not null" json:"file_size"`
Mime string `gorm:"column:mime;not null" json:"mime"`
}
// TableName PsAttachment's table name
func (*PsAttachment) TableName() string {
return TableNamePsAttachment
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttachmentLang = "ps_attachment_lang"
// PsAttachmentLang mapped from table <ps_attachment_lang>
type PsAttachmentLang struct {
IDAttachment int32 `gorm:"column:id_attachment;primaryKey;autoIncrement:true" json:"id_attachment"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name *string `gorm:"column:name" json:"name"`
Description *string `gorm:"column:description" json:"description"`
}
// TableName PsAttachmentLang's table name
func (*PsAttachmentLang) TableName() string {
return TableNamePsAttachmentLang
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttribute = "ps_attribute"
// PsAttribute mapped from table <ps_attribute>
type PsAttribute struct {
IDAttribute int32 `gorm:"column:id_attribute;primaryKey;autoIncrement:true" json:"id_attribute"`
IDAttributeGroup int32 `gorm:"column:id_attribute_group;not null;index:attribute_group,priority:1" json:"id_attribute_group"`
Color string `gorm:"column:color;not null" json:"color"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsAttribute's table name
func (*PsAttribute) TableName() string {
return TableNamePsAttribute
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeGroup = "ps_attribute_group"
// PsAttributeGroup mapped from table <ps_attribute_group>
type PsAttributeGroup struct {
IDAttributeGroup int32 `gorm:"column:id_attribute_group;primaryKey;autoIncrement:true" json:"id_attribute_group"`
IsColorGroup bool `gorm:"column:is_color_group;not null" json:"is_color_group"`
GroupType string `gorm:"column:group_type;not null" json:"group_type"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsAttributeGroup's table name
func (*PsAttributeGroup) TableName() string {
return TableNamePsAttributeGroup
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeGroupLang = "ps_attribute_group_lang"
// PsAttributeGroupLang mapped from table <ps_attribute_group_lang>
type PsAttributeGroupLang struct {
IDAttributeGroup int32 `gorm:"column:id_attribute_group;primaryKey;index:IDX_4653726C67A664FB,priority:1" json:"id_attribute_group"`
IDLang int32 `gorm:"column:id_lang;primaryKey;index:IDX_4653726CBA299860,priority:1" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
PublicName string `gorm:"column:public_name;not null" json:"public_name"`
}
// TableName PsAttributeGroupLang's table name
func (*PsAttributeGroupLang) TableName() string {
return TableNamePsAttributeGroupLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeGroupShop = "ps_attribute_group_shop"
// PsAttributeGroupShop mapped from table <ps_attribute_group_shop>
type PsAttributeGroupShop struct {
IDAttributeGroup int32 `gorm:"column:id_attribute_group;primaryKey;index:IDX_DB30BAAC67A664FB,priority:1" json:"id_attribute_group"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:IDX_DB30BAAC274A50A0,priority:1" json:"id_shop"`
}
// TableName PsAttributeGroupShop's table name
func (*PsAttributeGroupShop) TableName() string {
return TableNamePsAttributeGroupShop
}

View File

@@ -0,0 +1,21 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeImpact = "ps_attribute_impact"
// PsAttributeImpact mapped from table <ps_attribute_impact>
type PsAttributeImpact struct {
IDAttributeImpact int32 `gorm:"column:id_attribute_impact;primaryKey;autoIncrement:true" json:"id_attribute_impact"`
IDProduct int32 `gorm:"column:id_product;not null;uniqueIndex:id_product,priority:1" json:"id_product"`
IDAttribute int32 `gorm:"column:id_attribute;not null;uniqueIndex:id_product,priority:2" json:"id_attribute"`
Weight float64 `gorm:"column:weight;not null" json:"weight"`
Price float64 `gorm:"column:price;not null" json:"price"`
}
// TableName PsAttributeImpact's table name
func (*PsAttributeImpact) TableName() string {
return TableNamePsAttributeImpact
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeLang = "ps_attribute_lang"
// PsAttributeLang mapped from table <ps_attribute_lang>
type PsAttributeLang struct {
IDAttribute int32 `gorm:"column:id_attribute;primaryKey;index:IDX_3ABE46A77A4F53DC,priority:1" json:"id_attribute"`
IDLang int32 `gorm:"column:id_lang;primaryKey;index:IDX_3ABE46A7BA299860,priority:1" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
}
// TableName PsAttributeLang's table name
func (*PsAttributeLang) TableName() string {
return TableNamePsAttributeLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAttributeShop = "ps_attribute_shop"
// PsAttributeShop mapped from table <ps_attribute_shop>
type PsAttributeShop struct {
IDAttribute int32 `gorm:"column:id_attribute;primaryKey;index:IDX_A7DD8E677A4F53DC,priority:1" json:"id_attribute"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:IDX_A7DD8E67274A50A0,priority:1" json:"id_shop"`
}
// TableName PsAttributeShop's table name
func (*PsAttributeShop) TableName() string {
return TableNamePsAttributeShop
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsAuthorizationRole = "ps_authorization_role"
// PsAuthorizationRole mapped from table <ps_authorization_role>
type PsAuthorizationRole struct {
IDAuthorizationRole int32 `gorm:"column:id_authorization_role;primaryKey;autoIncrement:true" json:"id_authorization_role"`
Slug string `gorm:"column:slug;not null;uniqueIndex:slug,priority:1" json:"slug"`
}
// TableName PsAuthorizationRole's table name
func (*PsAuthorizationRole) TableName() string {
return TableNamePsAuthorizationRole
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsBadge = "ps_badge"
// PsBadge mapped from table <ps_badge>
type PsBadge struct {
IDBadge int32 `gorm:"column:id_badge;primaryKey;autoIncrement:true" json:"id_badge"`
IDPsBadge int32 `gorm:"column:id_ps_badge;not null" json:"id_ps_badge"`
Type string `gorm:"column:type;not null" json:"type"`
IDGroup int32 `gorm:"column:id_group;not null" json:"id_group"`
GroupPosition int32 `gorm:"column:group_position;not null" json:"group_position"`
Scoring int32 `gorm:"column:scoring;not null" json:"scoring"`
Awb *int32 `gorm:"column:awb" json:"awb"`
Validated bool `gorm:"column:validated;not null" json:"validated"`
}
// TableName PsBadge's table name
func (*PsBadge) TableName() string {
return TableNamePsBadge
}

View File

@@ -0,0 +1,21 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsBadgeLang = "ps_badge_lang"
// PsBadgeLang mapped from table <ps_badge_lang>
type PsBadgeLang struct {
IDBadge int32 `gorm:"column:id_badge;primaryKey" json:"id_badge"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name *string `gorm:"column:name" json:"name"`
Description *string `gorm:"column:description" json:"description"`
GroupName *string `gorm:"column:group_name" json:"group_name"`
}
// TableName PsBadgeLang's table name
func (*PsBadgeLang) TableName() string {
return TableNamePsBadgeLang
}

View File

@@ -0,0 +1,37 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrier = "ps_carrier"
// PsCarrier mapped from table <ps_carrier>
type PsCarrier struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey;autoIncrement:true" json:"id_carrier"`
IDReference int32 `gorm:"column:id_reference;not null;index:reference,priority:1" json:"id_reference"`
IDTaxRulesGroup *int32 `gorm:"column:id_tax_rules_group;index:id_tax_rules_group,priority:1" json:"id_tax_rules_group"`
Name string `gorm:"column:name;not null" json:"name"`
URL *string `gorm:"column:url" json:"url"`
Active bool `gorm:"column:active;not null;index:deleted,priority:2;index:reference,priority:3" json:"active"`
Deleted bool `gorm:"column:deleted;not null;index:deleted,priority:1;index:reference,priority:2" json:"deleted"`
ShippingHandling bool `gorm:"column:shipping_handling;not null;default:1" json:"shipping_handling"`
RangeBehavior bool `gorm:"column:range_behavior;not null" json:"range_behavior"`
IsModule bool `gorm:"column:is_module;not null" json:"is_module"`
IsFree bool `gorm:"column:is_free;not null" json:"is_free"`
ShippingExternal bool `gorm:"column:shipping_external;not null" json:"shipping_external"`
NeedRange bool `gorm:"column:need_range;not null" json:"need_range"`
ExternalModuleName *string `gorm:"column:external_module_name" json:"external_module_name"`
ShippingMethod int32 `gorm:"column:shipping_method;not null" json:"shipping_method"`
Position int32 `gorm:"column:position;not null" json:"position"`
MaxWidth *int32 `gorm:"column:max_width" json:"max_width"`
MaxHeight *int32 `gorm:"column:max_height" json:"max_height"`
MaxDepth *int32 `gorm:"column:max_depth" json:"max_depth"`
MaxWeight *float64 `gorm:"column:max_weight;default:0.000000" json:"max_weight"`
Grade *int32 `gorm:"column:grade" json:"grade"`
}
// TableName PsCarrier's table name
func (*PsCarrier) TableName() string {
return TableNamePsCarrier
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrierGroup = "ps_carrier_group"
// PsCarrierGroup mapped from table <ps_carrier_group>
type PsCarrierGroup struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
IDGroup int32 `gorm:"column:id_group;primaryKey" json:"id_group"`
}
// TableName PsCarrierGroup's table name
func (*PsCarrierGroup) TableName() string {
return TableNamePsCarrierGroup
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrierLang = "ps_carrier_lang"
// PsCarrierLang mapped from table <ps_carrier_lang>
type PsCarrierLang struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
IDShop int32 `gorm:"column:id_shop;primaryKey;default:1" json:"id_shop"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Delay *string `gorm:"column:delay" json:"delay"`
}
// TableName PsCarrierLang's table name
func (*PsCarrierLang) TableName() string {
return TableNamePsCarrierLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrierShop = "ps_carrier_shop"
// PsCarrierShop mapped from table <ps_carrier_shop>
type PsCarrierShop struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
}
// TableName PsCarrierShop's table name
func (*PsCarrierShop) TableName() string {
return TableNamePsCarrierShop
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrierTaxRulesGroupShop = "ps_carrier_tax_rules_group_shop"
// PsCarrierTaxRulesGroupShop mapped from table <ps_carrier_tax_rules_group_shop>
type PsCarrierTaxRulesGroupShop struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
IDTaxRulesGroup int32 `gorm:"column:id_tax_rules_group;primaryKey" json:"id_tax_rules_group"`
IDShop int32 `gorm:"column:id_shop;primaryKey" json:"id_shop"`
}
// TableName PsCarrierTaxRulesGroupShop's table name
func (*PsCarrierTaxRulesGroupShop) TableName() string {
return TableNamePsCarrierTaxRulesGroupShop
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCarrierZone = "ps_carrier_zone"
// PsCarrierZone mapped from table <ps_carrier_zone>
type PsCarrierZone struct {
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
IDZone int32 `gorm:"column:id_zone;primaryKey" json:"id_zone"`
}
// TableName PsCarrierZone's table name
func (*PsCarrierZone) TableName() string {
return TableNamePsCarrierZone
}

View File

@@ -0,0 +1,43 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCart = "ps_cart"
// PsCart mapped from table <ps_cart>
type PsCart struct {
IDCart int32 `gorm:"column:id_cart;primaryKey;autoIncrement:true" json:"id_cart"`
IDShopGroup int32 `gorm:"column:id_shop_group;not null;index:id_shop_group,priority:1;default:1" json:"id_shop_group"`
IDShop int32 `gorm:"column:id_shop;not null;index:id_shop,priority:1;index:id_shop_2,priority:1;default:1" json:"id_shop"`
IDCarrier int32 `gorm:"column:id_carrier;not null;index:id_carrier,priority:1" json:"id_carrier"`
DeliveryOption string `gorm:"column:delivery_option;not null" json:"delivery_option"`
IDLang int32 `gorm:"column:id_lang;not null;index:id_lang,priority:1" json:"id_lang"`
IDAddressDelivery int32 `gorm:"column:id_address_delivery;not null;index:id_address_delivery,priority:1" json:"id_address_delivery"`
IDAddressInvoice int32 `gorm:"column:id_address_invoice;not null;index:id_address_invoice,priority:1" json:"id_address_invoice"`
IDCurrency int32 `gorm:"column:id_currency;not null;index:id_currency,priority:1" json:"id_currency"`
IDCustomer int32 `gorm:"column:id_customer;not null;index:cart_customer,priority:1" json:"id_customer"`
IDGuest int32 `gorm:"column:id_guest;not null;index:id_guest,priority:1" json:"id_guest"`
SecureKey string `gorm:"column:secure_key;not null;default:-1" json:"secure_key"`
Recyclable bool `gorm:"column:recyclable;not null;default:1" json:"recyclable"`
Gift bool `gorm:"column:gift;not null" json:"gift"`
GiftMessage *string `gorm:"column:gift_message" json:"gift_message"`
MobileTheme bool `gorm:"column:mobile_theme;not null" json:"mobile_theme"`
AllowSeperatedPackage bool `gorm:"column:allow_seperated_package;not null" json:"allow_seperated_package"`
DateAdd time.Time `gorm:"column:date_add;not null;index:id_shop,priority:2" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null;index:id_shop_2,priority:2" json:"date_upd"`
CheckoutSessionData *string `gorm:"column:checkout_session_data" json:"checkout_session_data"`
CustomeShippingPriceNetto *float64 `gorm:"column:custome_shipping_price_netto" json:"custome_shipping_price_netto"`
CustomeShippingPrice *float64 `gorm:"column:custome_shipping_price" json:"custome_shipping_price"`
CustomeShippingTaxRate *float64 `gorm:"column:custome_shipping_tax_rate" json:"custome_shipping_tax_rate"`
}
// TableName PsCart's table name
func (*PsCart) TableName() string {
return TableNamePsCart
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartCartRule = "ps_cart_cart_rule"
// PsCartCartRule mapped from table <ps_cart_cart_rule>
type PsCartCartRule struct {
IDCart int32 `gorm:"column:id_cart;primaryKey" json:"id_cart"`
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey;index:id_cart_rule,priority:1" json:"id_cart_rule"`
}
// TableName PsCartCartRule's table name
func (*PsCartCartRule) TableName() string {
return TableNamePsCartCartRule
}

View File

@@ -0,0 +1,28 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCartProduct = "ps_cart_product"
// PsCartProduct mapped from table <ps_cart_product>
type PsCartProduct struct {
IDCart int32 `gorm:"column:id_cart;primaryKey;index:id_cart_order,priority:1" json:"id_cart"`
IDProduct int32 `gorm:"column:id_product;primaryKey;index:id_cart_order,priority:3" json:"id_product"`
IDAddressDelivery int32 `gorm:"column:id_address_delivery;primaryKey" json:"id_address_delivery"`
IDShop int32 `gorm:"column:id_shop;not null;default:1" json:"id_shop"`
IDProductAttribute int32 `gorm:"column:id_product_attribute;primaryKey;index:id_cart_order,priority:4;index:id_product_attribute,priority:1" json:"id_product_attribute"`
IDCustomization int32 `gorm:"column:id_customization;primaryKey" json:"id_customization"`
Quantity int32 `gorm:"column:quantity;not null" json:"quantity"`
DateAdd time.Time `gorm:"column:date_add;not null;index:id_cart_order,priority:2" json:"date_add"`
}
// TableName PsCartProduct's table name
func (*PsCartProduct) TableName() string {
return TableNamePsCartProduct
}

View File

@@ -0,0 +1,53 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCartRule = "ps_cart_rule"
// PsCartRule mapped from table <ps_cart_rule>
type PsCartRule struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey;autoIncrement:true" json:"id_cart_rule"`
IDCustomer int32 `gorm:"column:id_customer;not null;index:id_customer,priority:1;index:id_customer_2,priority:1" json:"id_customer"`
DateFrom time.Time `gorm:"column:date_from;not null;index:date_from,priority:1" json:"date_from"`
DateTo time.Time `gorm:"column:date_to;not null;index:date_to,priority:1;index:group_restriction,priority:3;index:group_restriction_2,priority:4;index:id_customer,priority:3;index:id_customer_2,priority:4" json:"date_to"`
Description *string `gorm:"column:description" json:"description"`
Quantity int32 `gorm:"column:quantity;not null" json:"quantity"`
QuantityPerUser int32 `gorm:"column:quantity_per_user;not null" json:"quantity_per_user"`
Priority int32 `gorm:"column:priority;not null;default:1" json:"priority"`
PartialUse bool `gorm:"column:partial_use;not null" json:"partial_use"`
Code string `gorm:"column:code;not null" json:"code"`
MinimumAmount float64 `gorm:"column:minimum_amount;not null;default:0.00" json:"minimum_amount"`
MinimumAmountTax bool `gorm:"column:minimum_amount_tax;not null" json:"minimum_amount_tax"`
MinimumAmountCurrency int32 `gorm:"column:minimum_amount_currency;not null" json:"minimum_amount_currency"`
MinimumAmountShipping bool `gorm:"column:minimum_amount_shipping;not null" json:"minimum_amount_shipping"`
CountryRestriction bool `gorm:"column:country_restriction;not null" json:"country_restriction"`
CarrierRestriction bool `gorm:"column:carrier_restriction;not null" json:"carrier_restriction"`
GroupRestriction bool `gorm:"column:group_restriction;not null;index:group_restriction,priority:1;index:group_restriction_2,priority:1" json:"group_restriction"`
CartRuleRestriction bool `gorm:"column:cart_rule_restriction;not null" json:"cart_rule_restriction"`
ProductRestriction bool `gorm:"column:product_restriction;not null" json:"product_restriction"`
ShopRestriction bool `gorm:"column:shop_restriction;not null" json:"shop_restriction"`
FreeShipping bool `gorm:"column:free_shipping;not null" json:"free_shipping"`
ReductionPercent float64 `gorm:"column:reduction_percent;not null;default:0.00" json:"reduction_percent"`
ReductionAmount float64 `gorm:"column:reduction_amount;not null;default:0.00" json:"reduction_amount"`
ReductionTax bool `gorm:"column:reduction_tax;not null" json:"reduction_tax"`
ReductionCurrency int32 `gorm:"column:reduction_currency;not null" json:"reduction_currency"`
ReductionProduct int32 `gorm:"column:reduction_product;not null" json:"reduction_product"`
ReductionExcludeSpecial bool `gorm:"column:reduction_exclude_special;not null" json:"reduction_exclude_special"`
GiftProduct int32 `gorm:"column:gift_product;not null" json:"gift_product"`
GiftProductAttribute int32 `gorm:"column:gift_product_attribute;not null" json:"gift_product_attribute"`
Highlight bool `gorm:"column:highlight;not null;index:group_restriction_2,priority:3;index:id_customer_2,priority:3" json:"highlight"`
Active bool `gorm:"column:active;not null;index:group_restriction,priority:2;index:group_restriction_2,priority:2;index:id_customer,priority:2;index:id_customer_2,priority:2" json:"active"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsCartRule's table name
func (*PsCartRule) TableName() string {
return TableNamePsCartRule
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleCarrier = "ps_cart_rule_carrier"
// PsCartRuleCarrier mapped from table <ps_cart_rule_carrier>
type PsCartRuleCarrier struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey" json:"id_cart_rule"`
IDCarrier int32 `gorm:"column:id_carrier;primaryKey" json:"id_carrier"`
}
// TableName PsCartRuleCarrier's table name
func (*PsCartRuleCarrier) TableName() string {
return TableNamePsCartRuleCarrier
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleCombination = "ps_cart_rule_combination"
// PsCartRuleCombination mapped from table <ps_cart_rule_combination>
type PsCartRuleCombination struct {
IDCartRule1 int32 `gorm:"column:id_cart_rule_1;primaryKey;index:id_cart_rule_1,priority:1" json:"id_cart_rule_1"`
IDCartRule2 int32 `gorm:"column:id_cart_rule_2;primaryKey;index:id_cart_rule_2,priority:1" json:"id_cart_rule_2"`
}
// TableName PsCartRuleCombination's table name
func (*PsCartRuleCombination) TableName() string {
return TableNamePsCartRuleCombination
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleCountry = "ps_cart_rule_country"
// PsCartRuleCountry mapped from table <ps_cart_rule_country>
type PsCartRuleCountry struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey" json:"id_cart_rule"`
IDCountry int32 `gorm:"column:id_country;primaryKey" json:"id_country"`
}
// TableName PsCartRuleCountry's table name
func (*PsCartRuleCountry) TableName() string {
return TableNamePsCartRuleCountry
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleGroup = "ps_cart_rule_group"
// PsCartRuleGroup mapped from table <ps_cart_rule_group>
type PsCartRuleGroup struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey" json:"id_cart_rule"`
IDGroup int32 `gorm:"column:id_group;primaryKey" json:"id_group"`
}
// TableName PsCartRuleGroup's table name
func (*PsCartRuleGroup) TableName() string {
return TableNamePsCartRuleGroup
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleLang = "ps_cart_rule_lang"
// PsCartRuleLang mapped from table <ps_cart_rule_lang>
type PsCartRuleLang struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey" json:"id_cart_rule"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
}
// TableName PsCartRuleLang's table name
func (*PsCartRuleLang) TableName() string {
return TableNamePsCartRuleLang
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleProductRule = "ps_cart_rule_product_rule"
// PsCartRuleProductRule mapped from table <ps_cart_rule_product_rule>
type PsCartRuleProductRule struct {
IDProductRule int32 `gorm:"column:id_product_rule;primaryKey;autoIncrement:true" json:"id_product_rule"`
IDProductRuleGroup int32 `gorm:"column:id_product_rule_group;not null" json:"id_product_rule_group"`
Type string `gorm:"column:type;not null" json:"type"`
}
// TableName PsCartRuleProductRule's table name
func (*PsCartRuleProductRule) TableName() string {
return TableNamePsCartRuleProductRule
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleProductRuleGroup = "ps_cart_rule_product_rule_group"
// PsCartRuleProductRuleGroup mapped from table <ps_cart_rule_product_rule_group>
type PsCartRuleProductRuleGroup struct {
IDProductRuleGroup int32 `gorm:"column:id_product_rule_group;primaryKey;autoIncrement:true" json:"id_product_rule_group"`
IDCartRule int32 `gorm:"column:id_cart_rule;not null" json:"id_cart_rule"`
Quantity int32 `gorm:"column:quantity;not null;default:1" json:"quantity"`
}
// TableName PsCartRuleProductRuleGroup's table name
func (*PsCartRuleProductRuleGroup) TableName() string {
return TableNamePsCartRuleProductRuleGroup
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleProductRuleValue = "ps_cart_rule_product_rule_value"
// PsCartRuleProductRuleValue mapped from table <ps_cart_rule_product_rule_value>
type PsCartRuleProductRuleValue struct {
IDProductRule int32 `gorm:"column:id_product_rule;primaryKey" json:"id_product_rule"`
IDItem int32 `gorm:"column:id_item;primaryKey" json:"id_item"`
}
// TableName PsCartRuleProductRuleValue's table name
func (*PsCartRuleProductRuleValue) TableName() string {
return TableNamePsCartRuleProductRuleValue
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCartRuleShop = "ps_cart_rule_shop"
// PsCartRuleShop mapped from table <ps_cart_rule_shop>
type PsCartRuleShop struct {
IDCartRule int32 `gorm:"column:id_cart_rule;primaryKey" json:"id_cart_rule"`
IDShop int32 `gorm:"column:id_shop;primaryKey" json:"id_shop"`
}
// TableName PsCartRuleShop's table name
func (*PsCartRuleShop) TableName() string {
return TableNamePsCartRuleShop
}

View File

@@ -0,0 +1,31 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCategory = "ps_category"
// PsCategory mapped from table <ps_category>
type PsCategory struct {
IDCategory int32 `gorm:"column:id_category;primaryKey;autoIncrement:true;index:idx_category,priority:1" json:"id_category"`
IDParent int32 `gorm:"column:id_parent;not null;index:category_parent,priority:1" json:"id_parent"`
IDShopDefault int32 `gorm:"column:id_shop_default;not null;default:1" json:"id_shop_default"`
LevelDepth int32 `gorm:"column:level_depth;not null;index:level_depth,priority:1" json:"level_depth"`
Nleft int32 `gorm:"column:nleft;not null;index:activenleft,priority:2;index:idx_category,priority:3;index:nleftrightactive,priority:1" json:"nleft"`
Nright int32 `gorm:"column:nright;not null;index:activenright,priority:2;index:idx_category,priority:4;index:nleftrightactive,priority:2;index:nright,priority:1" json:"nright"`
Active bool `gorm:"column:active;not null;index:activenleft,priority:1;index:activenright,priority:1;index:idx_category,priority:2;index:idx_ps_category_active,priority:1;index:nleftrightactive,priority:3" json:"active"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
Position int32 `gorm:"column:position;not null" json:"position"`
IsRootCategory bool `gorm:"column:is_root_category;not null" json:"is_root_category"`
}
// TableName PsCategory's table name
func (*PsCategory) TableName() string {
return TableNamePsCategory
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCategoryGroup = "ps_category_group"
// PsCategoryGroup mapped from table <ps_category_group>
type PsCategoryGroup struct {
IDCategory int32 `gorm:"column:id_category;primaryKey;index:id_category,priority:1" json:"id_category"`
IDGroup int32 `gorm:"column:id_group;primaryKey;index:id_group,priority:1" json:"id_group"`
}
// TableName PsCategoryGroup's table name
func (*PsCategoryGroup) TableName() string {
return TableNamePsCategoryGroup
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCategoryLang = "ps_category_lang"
// PsCategoryLang mapped from table <ps_category_lang>
type PsCategoryLang struct {
IDCategory int32 `gorm:"column:id_category;primaryKey" json:"id_category"`
IDShop int32 `gorm:"column:id_shop;primaryKey;default:1" json:"id_shop"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name string `gorm:"column:name;not null;index:category_name,priority:1" json:"name"`
Description *string `gorm:"column:description" json:"description"`
LinkRewrite string `gorm:"column:link_rewrite;not null" json:"link_rewrite"`
MetaTitle *string `gorm:"column:meta_title" json:"meta_title"`
MetaKeywords *string `gorm:"column:meta_keywords" json:"meta_keywords"`
MetaDescription *string `gorm:"column:meta_description" json:"meta_description"`
}
// TableName PsCategoryLang's table name
func (*PsCategoryLang) TableName() string {
return TableNamePsCategoryLang
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCategoryProduct = "ps_category_product"
// PsCategoryProduct mapped from table <ps_category_product>
type PsCategoryProduct struct {
IDCategory int32 `gorm:"column:id_category;primaryKey;index:idx_category_product,priority:2;index:id_category,priority:1" json:"id_category"`
IDProduct int32 `gorm:"column:id_product;primaryKey;index:idx_category_product,priority:1;index:id_product,priority:1" json:"id_product"`
Position int32 `gorm:"column:position;not null;index:id_category,priority:2" json:"position"`
}
// TableName PsCategoryProduct's table name
func (*PsCategoryProduct) TableName() string {
return TableNamePsCategoryProduct
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCategoryShop = "ps_category_shop"
// PsCategoryShop mapped from table <ps_category_shop>
type PsCategoryShop struct {
IDCategory int32 `gorm:"column:id_category;primaryKey" json:"id_category"`
IDShop int32 `gorm:"column:id_shop;primaryKey" json:"id_shop"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsCategoryShop's table name
func (*PsCategoryShop) TableName() string {
return TableNamePsCategoryShop
}

View File

@@ -0,0 +1,21 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCm = "ps_cms"
// PsCm mapped from table <ps_cms>
type PsCm struct {
IDCms int32 `gorm:"column:id_cms;primaryKey;autoIncrement:true" json:"id_cms"`
IDCmsCategory int32 `gorm:"column:id_cms_category;not null" json:"id_cms_category"`
Position int32 `gorm:"column:position;not null" json:"position"`
Active bool `gorm:"column:active;not null" json:"active"`
Indexation bool `gorm:"column:indexation;not null;default:1" json:"indexation"`
}
// TableName PsCm's table name
func (*PsCm) TableName() string {
return TableNamePsCm
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCmsCategory = "ps_cms_category"
// PsCmsCategory mapped from table <ps_cms_category>
type PsCmsCategory struct {
IDCmsCategory int32 `gorm:"column:id_cms_category;primaryKey;autoIncrement:true" json:"id_cms_category"`
IDParent int32 `gorm:"column:id_parent;not null;index:category_parent,priority:1" json:"id_parent"`
LevelDepth int32 `gorm:"column:level_depth;not null" json:"level_depth"`
Active bool `gorm:"column:active;not null" json:"active"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsCmsCategory's table name
func (*PsCmsCategory) TableName() string {
return TableNamePsCmsCategory
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsCategoryLang = "ps_cms_category_lang"
// PsCmsCategoryLang mapped from table <ps_cms_category_lang>
type PsCmsCategoryLang struct {
IDCmsCategory int32 `gorm:"column:id_cms_category;primaryKey" json:"id_cms_category"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
IDShop int32 `gorm:"column:id_shop;primaryKey;default:1" json:"id_shop"`
Name string `gorm:"column:name;not null;index:category_name,priority:1" json:"name"`
Description *string `gorm:"column:description" json:"description"`
LinkRewrite string `gorm:"column:link_rewrite;not null" json:"link_rewrite"`
MetaTitle *string `gorm:"column:meta_title" json:"meta_title"`
MetaKeywords *string `gorm:"column:meta_keywords" json:"meta_keywords"`
MetaDescription *string `gorm:"column:meta_description" json:"meta_description"`
}
// TableName PsCmsCategoryLang's table name
func (*PsCmsCategoryLang) TableName() string {
return TableNamePsCmsCategoryLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsCategoryShop = "ps_cms_category_shop"
// PsCmsCategoryShop mapped from table <ps_cms_category_shop>
type PsCmsCategoryShop struct {
IDCmsCategory int32 `gorm:"column:id_cms_category;primaryKey;autoIncrement:true" json:"id_cms_category"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
}
// TableName PsCmsCategoryShop's table name
func (*PsCmsCategoryShop) TableName() string {
return TableNamePsCmsCategoryShop
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsLang = "ps_cms_lang"
// PsCmsLang mapped from table <ps_cms_lang>
type PsCmsLang struct {
IDCms int32 `gorm:"column:id_cms;primaryKey" json:"id_cms"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
IDShop int32 `gorm:"column:id_shop;primaryKey;default:1" json:"id_shop"`
MetaTitle string `gorm:"column:meta_title;not null" json:"meta_title"`
HeadSeoTitle *string `gorm:"column:head_seo_title" json:"head_seo_title"`
MetaDescription *string `gorm:"column:meta_description" json:"meta_description"`
MetaKeywords *string `gorm:"column:meta_keywords" json:"meta_keywords"`
Content *string `gorm:"column:content" json:"content"`
LinkRewrite string `gorm:"column:link_rewrite;not null" json:"link_rewrite"`
}
// TableName PsCmsLang's table name
func (*PsCmsLang) TableName() string {
return TableNamePsCmsLang
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsRole = "ps_cms_role"
// PsCmsRole mapped from table <ps_cms_role>
type PsCmsRole struct {
IDCmsRole int32 `gorm:"column:id_cms_role;primaryKey;autoIncrement:true" json:"id_cms_role"`
Name string `gorm:"column:name;not null;uniqueIndex:name,priority:1" json:"name"`
IDCms int32 `gorm:"column:id_cms;primaryKey" json:"id_cms"`
}
// TableName PsCmsRole's table name
func (*PsCmsRole) TableName() string {
return TableNamePsCmsRole
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsRoleLang = "ps_cms_role_lang"
// PsCmsRoleLang mapped from table <ps_cms_role_lang>
type PsCmsRoleLang struct {
IDCmsRole int32 `gorm:"column:id_cms_role;primaryKey" json:"id_cms_role"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
IDShop int32 `gorm:"column:id_shop;primaryKey" json:"id_shop"`
Name *string `gorm:"column:name" json:"name"`
}
// TableName PsCmsRoleLang's table name
func (*PsCmsRoleLang) TableName() string {
return TableNamePsCmsRoleLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCmsShop = "ps_cms_shop"
// PsCmsShop mapped from table <ps_cms_shop>
type PsCmsShop struct {
IDCms int32 `gorm:"column:id_cms;primaryKey" json:"id_cms"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
}
// TableName PsCmsShop's table name
func (*PsCmsShop) TableName() string {
return TableNamePsCmsShop
}

View File

@@ -0,0 +1,32 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCondition = "ps_condition"
// PsCondition mapped from table <ps_condition>
type PsCondition struct {
IDCondition int32 `gorm:"column:id_condition;primaryKey;autoIncrement:true" json:"id_condition"`
IDPsCondition int32 `gorm:"column:id_ps_condition;primaryKey" json:"id_ps_condition"`
Type string `gorm:"column:type;not null" json:"type"`
Request *string `gorm:"column:request" json:"request"`
Operator *string `gorm:"column:operator" json:"operator"`
Value *string `gorm:"column:value" json:"value"`
Result *string `gorm:"column:result" json:"result"`
CalculationType *string `gorm:"column:calculation_type" json:"calculation_type"`
CalculationDetail *string `gorm:"column:calculation_detail" json:"calculation_detail"`
Validated bool `gorm:"column:validated;not null" json:"validated"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsCondition's table name
func (*PsCondition) TableName() string {
return TableNamePsCondition
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsConditionAdvice = "ps_condition_advice"
// PsConditionAdvice mapped from table <ps_condition_advice>
type PsConditionAdvice struct {
IDCondition int32 `gorm:"column:id_condition;primaryKey" json:"id_condition"`
IDAdvice int32 `gorm:"column:id_advice;primaryKey" json:"id_advice"`
Display bool `gorm:"column:display;not null" json:"display"`
}
// TableName PsConditionAdvice's table name
func (*PsConditionAdvice) TableName() string {
return TableNamePsConditionAdvice
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsConditionBadge = "ps_condition_badge"
// PsConditionBadge mapped from table <ps_condition_badge>
type PsConditionBadge struct {
IDCondition int32 `gorm:"column:id_condition;primaryKey" json:"id_condition"`
IDBadge int32 `gorm:"column:id_badge;primaryKey" json:"id_badge"`
}
// TableName PsConditionBadge's table name
func (*PsConditionBadge) TableName() string {
return TableNamePsConditionBadge
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConfiguration = "ps_configuration"
// PsConfiguration mapped from table <ps_configuration>
type PsConfiguration struct {
IDConfiguration int32 `gorm:"column:id_configuration;primaryKey;autoIncrement:true" json:"id_configuration"`
IDShopGroup *int32 `gorm:"column:id_shop_group;index:id_shop_group,priority:1" json:"id_shop_group"`
IDShop *int32 `gorm:"column:id_shop;index:id_shop,priority:1" json:"id_shop"`
Name string `gorm:"column:name;not null;index:name,priority:1" json:"name"`
Value *string `gorm:"column:value" json:"value"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsConfiguration's table name
func (*PsConfiguration) TableName() string {
return TableNamePsConfiguration
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConfigurationKpi = "ps_configuration_kpi"
// PsConfigurationKpi mapped from table <ps_configuration_kpi>
type PsConfigurationKpi struct {
IDConfigurationKpi int32 `gorm:"column:id_configuration_kpi;primaryKey;autoIncrement:true" json:"id_configuration_kpi"`
IDShopGroup *int32 `gorm:"column:id_shop_group;index:id_shop_group,priority:1" json:"id_shop_group"`
IDShop *int32 `gorm:"column:id_shop;index:id_shop,priority:1" json:"id_shop"`
Name string `gorm:"column:name;not null;index:name,priority:1" json:"name"`
Value *string `gorm:"column:value" json:"value"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsConfigurationKpi's table name
func (*PsConfigurationKpi) TableName() string {
return TableNamePsConfigurationKpi
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConfigurationKpiLang = "ps_configuration_kpi_lang"
// PsConfigurationKpiLang mapped from table <ps_configuration_kpi_lang>
type PsConfigurationKpiLang struct {
IDConfigurationKpi int32 `gorm:"column:id_configuration_kpi;primaryKey" json:"id_configuration_kpi"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Value *string `gorm:"column:value" json:"value"`
DateUpd *time.Time `gorm:"column:date_upd" json:"date_upd"`
}
// TableName PsConfigurationKpiLang's table name
func (*PsConfigurationKpiLang) TableName() string {
return TableNamePsConfigurationKpiLang
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConfigurationLang = "ps_configuration_lang"
// PsConfigurationLang mapped from table <ps_configuration_lang>
type PsConfigurationLang struct {
IDConfiguration int32 `gorm:"column:id_configuration;primaryKey" json:"id_configuration"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Value *string `gorm:"column:value" json:"value"`
DateUpd *time.Time `gorm:"column:date_upd" json:"date_upd"`
}
// TableName PsConfigurationLang's table name
func (*PsConfigurationLang) TableName() string {
return TableNamePsConfigurationLang
}

View File

@@ -0,0 +1,28 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConnection = "ps_connections"
// PsConnection mapped from table <ps_connections>
type PsConnection struct {
IDConnections int32 `gorm:"column:id_connections;primaryKey;autoIncrement:true" json:"id_connections"`
IDShopGroup int32 `gorm:"column:id_shop_group;not null;default:1" json:"id_shop_group"`
IDShop int32 `gorm:"column:id_shop;not null;default:1" json:"id_shop"`
IDGuest int32 `gorm:"column:id_guest;not null;index:id_guest,priority:1" json:"id_guest"`
IDPage int32 `gorm:"column:id_page;not null;index:id_page,priority:1" json:"id_page"`
IPAddress *int64 `gorm:"column:ip_address" json:"ip_address"`
DateAdd time.Time `gorm:"column:date_add;not null;index:date_add,priority:1" json:"date_add"`
HTTPReferer *string `gorm:"column:http_referer" json:"http_referer"`
}
// TableName PsConnection's table name
func (*PsConnection) TableName() string {
return TableNamePsConnection
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConnectionsPage = "ps_connections_page"
// PsConnectionsPage mapped from table <ps_connections_page>
type PsConnectionsPage struct {
IDConnections int32 `gorm:"column:id_connections;primaryKey" json:"id_connections"`
IDPage int32 `gorm:"column:id_page;primaryKey" json:"id_page"`
TimeStart time.Time `gorm:"column:time_start;primaryKey" json:"time_start"`
TimeEnd *time.Time `gorm:"column:time_end" json:"time_end"`
}
// TableName PsConnectionsPage's table name
func (*PsConnectionsPage) TableName() string {
return TableNamePsConnectionsPage
}

View File

@@ -0,0 +1,26 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsConnectionsSource = "ps_connections_source"
// PsConnectionsSource mapped from table <ps_connections_source>
type PsConnectionsSource struct {
IDConnectionsSource int32 `gorm:"column:id_connections_source;primaryKey;autoIncrement:true" json:"id_connections_source"`
IDConnections int32 `gorm:"column:id_connections;not null;index:connections,priority:1" json:"id_connections"`
HTTPReferer *string `gorm:"column:http_referer;index:http_referer,priority:1" json:"http_referer"`
RequestURI *string `gorm:"column:request_uri;index:request_uri,priority:1" json:"request_uri"`
Keywords *string `gorm:"column:keywords" json:"keywords"`
DateAdd time.Time `gorm:"column:date_add;not null;index:orderby,priority:1" json:"date_add"`
}
// TableName PsConnectionsSource's table name
func (*PsConnectionsSource) TableName() string {
return TableNamePsConnectionsSource
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsContact = "ps_contact"
// PsContact mapped from table <ps_contact>
type PsContact struct {
IDContact int32 `gorm:"column:id_contact;primaryKey;autoIncrement:true" json:"id_contact"`
Email string `gorm:"column:email;not null" json:"email"`
CustomerService bool `gorm:"column:customer_service;not null" json:"customer_service"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsContact's table name
func (*PsContact) TableName() string {
return TableNamePsContact
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsContactLang = "ps_contact_lang"
// PsContactLang mapped from table <ps_contact_lang>
type PsContactLang struct {
IDContact int32 `gorm:"column:id_contact;primaryKey" json:"id_contact"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
Description *string `gorm:"column:description" json:"description"`
}
// TableName PsContactLang's table name
func (*PsContactLang) TableName() string {
return TableNamePsContactLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsContactShop = "ps_contact_shop"
// PsContactShop mapped from table <ps_contact_shop>
type PsContactShop struct {
IDContact int32 `gorm:"column:id_contact;primaryKey" json:"id_contact"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
}
// TableName PsContactShop's table name
func (*PsContactShop) TableName() string {
return TableNamePsContactShop
}

View File

@@ -0,0 +1,27 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCountry = "ps_country"
// PsCountry mapped from table <ps_country>
type PsCountry struct {
IDCountry int32 `gorm:"column:id_country;primaryKey;autoIncrement:true" json:"id_country"`
IDZone int32 `gorm:"column:id_zone;not null;index:country_,priority:1" json:"id_zone"`
IDCurrency int32 `gorm:"column:id_currency;not null" json:"id_currency"`
IsoCode string `gorm:"column:iso_code;not null;index:country_iso_code,priority:1" json:"iso_code"`
CallPrefix int32 `gorm:"column:call_prefix;not null" json:"call_prefix"`
Active bool `gorm:"column:active;not null" json:"active"`
ContainsStates bool `gorm:"column:contains_states;not null" json:"contains_states"`
NeedIdentificationNumber bool `gorm:"column:need_identification_number;not null" json:"need_identification_number"`
NeedZipCode bool `gorm:"column:need_zip_code;not null;default:1" json:"need_zip_code"`
ZipCodeFormat string `gorm:"column:zip_code_format;not null" json:"zip_code_format"`
DisplayTaxLabel bool `gorm:"column:display_tax_label;not null" json:"display_tax_label"`
}
// TableName PsCountry's table name
func (*PsCountry) TableName() string {
return TableNamePsCountry
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCountryLang = "ps_country_lang"
// PsCountryLang mapped from table <ps_country_lang>
type PsCountryLang struct {
IDCountry int32 `gorm:"column:id_country;primaryKey" json:"id_country"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
}
// TableName PsCountryLang's table name
func (*PsCountryLang) TableName() string {
return TableNamePsCountryLang
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCountryShop = "ps_country_shop"
// PsCountryShop mapped from table <ps_country_shop>
type PsCountryShop struct {
IDCountry int32 `gorm:"column:id_country;primaryKey" json:"id_country"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
}
// TableName PsCountryShop's table name
func (*PsCountryShop) TableName() string {
return TableNamePsCountryShop
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCurrency = "ps_currency"
// PsCurrency mapped from table <ps_currency>
type PsCurrency struct {
IDCurrency int32 `gorm:"column:id_currency;primaryKey;autoIncrement:true" json:"id_currency"`
Name string `gorm:"column:name;not null" json:"name"`
IsoCode string `gorm:"column:iso_code;not null;index:currency_iso_code,priority:1;default:0" json:"iso_code"`
NumericIsoCode *string `gorm:"column:numeric_iso_code" json:"numeric_iso_code"`
Precision int32 `gorm:"column:precision;not null;default:6" json:"precision"`
ConversionRate float64 `gorm:"column:conversion_rate;not null" json:"conversion_rate"`
Deleted bool `gorm:"column:deleted;not null" json:"deleted"`
Active bool `gorm:"column:active;not null;default:1" json:"active"`
}
// TableName PsCurrency's table name
func (*PsCurrency) TableName() string {
return TableNamePsCurrency
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCurrencyLang = "ps_currency_lang"
// PsCurrencyLang mapped from table <ps_currency_lang>
type PsCurrencyLang struct {
IDCurrency int32 `gorm:"column:id_currency;primaryKey" json:"id_currency"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
Name string `gorm:"column:name;not null" json:"name"`
Symbol string `gorm:"column:symbol;not null" json:"symbol"`
}
// TableName PsCurrencyLang's table name
func (*PsCurrencyLang) TableName() string {
return TableNamePsCurrencyLang
}

View File

@@ -0,0 +1,19 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCurrencyShop = "ps_currency_shop"
// PsCurrencyShop mapped from table <ps_currency_shop>
type PsCurrencyShop struct {
IDCurrency int32 `gorm:"column:id_currency;primaryKey" json:"id_currency"`
IDShop int32 `gorm:"column:id_shop;primaryKey;index:id_shop,priority:1" json:"id_shop"`
ConversionRate float64 `gorm:"column:conversion_rate;not null" json:"conversion_rate"`
}
// TableName PsCurrencyShop's table name
func (*PsCurrencyShop) TableName() string {
return TableNamePsCurrencyShop
}

View File

@@ -0,0 +1,53 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCustomer = "ps_customer"
// PsCustomer mapped from table <ps_customer>
type PsCustomer struct {
IDCustomer int32 `gorm:"column:id_customer;primaryKey;autoIncrement:true;index:id_customer_passwd,priority:1" json:"id_customer"`
IDShopGroup int32 `gorm:"column:id_shop_group;not null;index:id_shop_group,priority:1;default:1" json:"id_shop_group"`
IDShop int32 `gorm:"column:id_shop;not null;index:id_shop,priority:1;default:1" json:"id_shop"`
IDGender int32 `gorm:"column:id_gender;not null;index:id_gender,priority:1" json:"id_gender"`
IDDefaultGroup int32 `gorm:"column:id_default_group;not null;default:1" json:"id_default_group"`
IDLang *int32 `gorm:"column:id_lang" json:"id_lang"`
IDRisk int32 `gorm:"column:id_risk;not null;default:1" json:"id_risk"`
Company *string `gorm:"column:company" json:"company"`
Siret *string `gorm:"column:siret" json:"siret"`
Ape *string `gorm:"column:ape" json:"ape"`
Firstname string `gorm:"column:firstname;not null" json:"firstname"`
Lastname string `gorm:"column:lastname;not null" json:"lastname"`
Email string `gorm:"column:email;not null;index:customer_email,priority:1;index:customer_login,priority:1" json:"email"`
Passwd string `gorm:"column:passwd;not null;index:customer_login,priority:2;index:id_customer_passwd,priority:2" json:"passwd"`
LastPasswdGen time.Time `gorm:"column:last_passwd_gen;not null;default:current_timestamp()" json:"last_passwd_gen"`
Birthday *time.Time `gorm:"column:birthday" json:"birthday"`
Newsletter bool `gorm:"column:newsletter;not null" json:"newsletter"`
IPRegistrationNewsletter *string `gorm:"column:ip_registration_newsletter" json:"ip_registration_newsletter"`
NewsletterDateAdd *time.Time `gorm:"column:newsletter_date_add" json:"newsletter_date_add"`
Optin bool `gorm:"column:optin;not null" json:"optin"`
Website *string `gorm:"column:website" json:"website"`
OutstandingAllowAmount float64 `gorm:"column:outstanding_allow_amount;not null;default:0.000000" json:"outstanding_allow_amount"`
ShowPublicPrices bool `gorm:"column:show_public_prices;not null" json:"show_public_prices"`
MaxPaymentDays int32 `gorm:"column:max_payment_days;not null;default:60" json:"max_payment_days"`
SecureKey string `gorm:"column:secure_key;not null;default:-1" json:"secure_key"`
Note *string `gorm:"column:note" json:"note"`
Active bool `gorm:"column:active;not null" json:"active"`
IsGuest bool `gorm:"column:is_guest;not null" json:"is_guest"`
Deleted bool `gorm:"column:deleted;not null" json:"deleted"`
DateAdd time.Time `gorm:"column:date_add;not null;index:id_shop,priority:2" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
ResetPasswordToken *string `gorm:"column:reset_password_token" json:"reset_password_token"`
ResetPasswordValidity *time.Time `gorm:"column:reset_password_validity" json:"reset_password_validity"`
}
// TableName PsCustomer's table name
func (*PsCustomer) TableName() string {
return TableNamePsCustomer
}

View File

@@ -0,0 +1,18 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomerGroup = "ps_customer_group"
// PsCustomerGroup mapped from table <ps_customer_group>
type PsCustomerGroup struct {
IDCustomer int32 `gorm:"column:id_customer;primaryKey;index:id_customer,priority:1" json:"id_customer"`
IDGroup int32 `gorm:"column:id_group;primaryKey;index:customer_login,priority:1" json:"id_group"`
}
// TableName PsCustomerGroup's table name
func (*PsCustomerGroup) TableName() string {
return TableNamePsCustomerGroup
}

View File

@@ -0,0 +1,32 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCustomerMessage = "ps_customer_message"
// PsCustomerMessage mapped from table <ps_customer_message>
type PsCustomerMessage struct {
IDCustomerMessage int32 `gorm:"column:id_customer_message;primaryKey;autoIncrement:true" json:"id_customer_message"`
IDCustomerThread *int32 `gorm:"column:id_customer_thread;index:id_customer_thread,priority:1" json:"id_customer_thread"`
IDEmployee *int32 `gorm:"column:id_employee;index:id_employee,priority:1" json:"id_employee"`
Message string `gorm:"column:message;not null" json:"message"`
FileName *string `gorm:"column:file_name" json:"file_name"`
IPAddress *string `gorm:"column:ip_address" json:"ip_address"`
UserAgent *string `gorm:"column:user_agent" json:"user_agent"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
Private int32 `gorm:"column:private;not null" json:"private"`
Read bool `gorm:"column:read;not null" json:"read"`
Product *string `gorm:"column:product" json:"product"`
}
// TableName PsCustomerMessage's table name
func (*PsCustomerMessage) TableName() string {
return TableNamePsCustomerMessage
}

View File

@@ -0,0 +1,17 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomerMessageSyncImap = "ps_customer_message_sync_imap"
// PsCustomerMessageSyncImap mapped from table <ps_customer_message_sync_imap>
type PsCustomerMessageSyncImap struct {
Md5Header []byte `gorm:"column:md5_header;not null;index:md5_header_index,priority:1" json:"md5_header"`
}
// TableName PsCustomerMessageSyncImap's table name
func (*PsCustomerMessageSyncImap) TableName() string {
return TableNamePsCustomerMessageSyncImap
}

View File

@@ -0,0 +1,32 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsCustomerThread = "ps_customer_thread"
// PsCustomerThread mapped from table <ps_customer_thread>
type PsCustomerThread struct {
IDCustomerThread int32 `gorm:"column:id_customer_thread;primaryKey;autoIncrement:true" json:"id_customer_thread"`
IDShop int32 `gorm:"column:id_shop;not null;index:id_shop,priority:1;default:1" json:"id_shop"`
IDLang int32 `gorm:"column:id_lang;not null;index:id_lang,priority:1" json:"id_lang"`
IDContact int32 `gorm:"column:id_contact;not null;index:id_contact,priority:1" json:"id_contact"`
IDCustomer *int32 `gorm:"column:id_customer;index:id_customer,priority:1" json:"id_customer"`
IDOrder *int32 `gorm:"column:id_order;index:id_order,priority:1" json:"id_order"`
IDProduct *int32 `gorm:"column:id_product;index:id_product,priority:1" json:"id_product"`
Status string `gorm:"column:status;not null;default:open" json:"status"`
Email string `gorm:"column:email;not null" json:"email"`
Token *string `gorm:"column:token" json:"token"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsCustomerThread's table name
func (*PsCustomerThread) TableName() string {
return TableNamePsCustomerThread
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomization = "ps_customization"
// PsCustomization mapped from table <ps_customization>
type PsCustomization struct {
IDCustomization int32 `gorm:"column:id_customization;primaryKey;autoIncrement:true" json:"id_customization"`
IDProductAttribute int32 `gorm:"column:id_product_attribute;not null;index:id_cart_product,priority:3;index:id_product_attribute,priority:1" json:"id_product_attribute"`
IDAddressDelivery int32 `gorm:"column:id_address_delivery;primaryKey" json:"id_address_delivery"`
IDCart int32 `gorm:"column:id_cart;primaryKey;index:id_cart_product,priority:1" json:"id_cart"`
IDProduct int32 `gorm:"column:id_product;primaryKey;index:id_cart_product,priority:2" json:"id_product"`
Quantity int32 `gorm:"column:quantity;not null" json:"quantity"`
QuantityRefunded int32 `gorm:"column:quantity_refunded;not null" json:"quantity_refunded"`
QuantityReturned int32 `gorm:"column:quantity_returned;not null" json:"quantity_returned"`
InCart bool `gorm:"column:in_cart;not null" json:"in_cart"`
}
// TableName PsCustomization's table name
func (*PsCustomization) TableName() string {
return TableNamePsCustomization
}

View File

@@ -0,0 +1,22 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomizationField = "ps_customization_field"
// PsCustomizationField mapped from table <ps_customization_field>
type PsCustomizationField struct {
IDCustomizationField int32 `gorm:"column:id_customization_field;primaryKey;autoIncrement:true" json:"id_customization_field"`
IDProduct int32 `gorm:"column:id_product;not null;index:id_product,priority:1" json:"id_product"`
Type bool `gorm:"column:type;not null" json:"type"`
Required bool `gorm:"column:required;not null" json:"required"`
IsModule bool `gorm:"column:is_module;not null" json:"is_module"`
IsDeleted bool `gorm:"column:is_deleted;not null" json:"is_deleted"`
}
// TableName PsCustomizationField's table name
func (*PsCustomizationField) TableName() string {
return TableNamePsCustomizationField
}

View File

@@ -0,0 +1,20 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomizationFieldLang = "ps_customization_field_lang"
// PsCustomizationFieldLang mapped from table <ps_customization_field_lang>
type PsCustomizationFieldLang struct {
IDCustomizationField int32 `gorm:"column:id_customization_field;primaryKey" json:"id_customization_field"`
IDLang int32 `gorm:"column:id_lang;primaryKey" json:"id_lang"`
IDShop int32 `gorm:"column:id_shop;primaryKey;default:1" json:"id_shop"`
Name string `gorm:"column:name;not null" json:"name"`
}
// TableName PsCustomizationFieldLang's table name
func (*PsCustomizationFieldLang) TableName() string {
return TableNamePsCustomizationFieldLang
}

View File

@@ -0,0 +1,23 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsCustomizedDatum = "ps_customized_data"
// PsCustomizedDatum mapped from table <ps_customized_data>
type PsCustomizedDatum struct {
IDCustomization int32 `gorm:"column:id_customization;primaryKey" json:"id_customization"`
Type bool `gorm:"column:type;primaryKey" json:"type"`
Index int32 `gorm:"column:index;primaryKey" json:"index"`
Value string `gorm:"column:value;not null" json:"value"`
IDModule int32 `gorm:"column:id_module;not null" json:"id_module"`
Price float64 `gorm:"column:price;not null;default:0.000000" json:"price"`
Weight float64 `gorm:"column:weight;not null;default:0.000000" json:"weight"`
}
// TableName PsCustomizedDatum's table name
func (*PsCustomizedDatum) TableName() string {
return TableNamePsCustomizedDatum
}

View File

@@ -0,0 +1,23 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDateRange = "ps_date_range"
// PsDateRange mapped from table <ps_date_range>
type PsDateRange struct {
IDDateRange int32 `gorm:"column:id_date_range;primaryKey;autoIncrement:true" json:"id_date_range"`
TimeStart time.Time `gorm:"column:time_start;not null" json:"time_start"`
TimeEnd time.Time `gorm:"column:time_end;not null" json:"time_end"`
}
// TableName PsDateRange's table name
func (*PsDateRange) TableName() string {
return TableNamePsDateRange
}

View File

@@ -0,0 +1,24 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
const TableNamePsDelivery = "ps_delivery"
// PsDelivery mapped from table <ps_delivery>
type PsDelivery struct {
IDDelivery int32 `gorm:"column:id_delivery;primaryKey;autoIncrement:true" json:"id_delivery"`
IDShop *int32 `gorm:"column:id_shop" json:"id_shop"`
IDShopGroup *int32 `gorm:"column:id_shop_group" json:"id_shop_group"`
IDCarrier int32 `gorm:"column:id_carrier;not null;index:id_carrier,priority:1" json:"id_carrier"`
IDRangePrice *int32 `gorm:"column:id_range_price;index:id_range_price,priority:1" json:"id_range_price"`
IDRangeWeight *int32 `gorm:"column:id_range_weight;index:id_range_weight,priority:1" json:"id_range_weight"`
IDZone int32 `gorm:"column:id_zone;not null;index:id_carrier,priority:2;index:id_zone,priority:1" json:"id_zone"`
Price float64 `gorm:"column:price;not null" json:"price"`
}
// TableName PsDelivery's table name
func (*PsDelivery) TableName() string {
return TableNamePsDelivery
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandCarrier = "ps_dpdpoland_carrier"
// PsDpdpolandCarrier mapped from table <ps_dpdpoland_carrier>
type PsDpdpolandCarrier struct {
IDDpdpolandCarrier int32 `gorm:"column:id_dpdpoland_carrier;primaryKey;autoIncrement:true" json:"id_dpdpoland_carrier"`
IDCarrier int32 `gorm:"column:id_carrier;not null" json:"id_carrier"`
IDReference int32 `gorm:"column:id_reference;not null" json:"id_reference"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandCarrier's table name
func (*PsDpdpolandCarrier) TableName() string {
return TableNamePsDpdpolandCarrier
}

View File

@@ -0,0 +1,26 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandCountry = "ps_dpdpoland_country"
// PsDpdpolandCountry mapped from table <ps_dpdpoland_country>
type PsDpdpolandCountry struct {
IDDpdpolandCountry int32 `gorm:"column:id_dpdpoland_country;primaryKey;autoIncrement:true" json:"id_dpdpoland_country"`
IDShop int32 `gorm:"column:id_shop;primaryKey" json:"id_shop"`
IDCountry int32 `gorm:"column:id_country;not null" json:"id_country"`
Enabled bool `gorm:"column:enabled;not null" json:"enabled"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandCountry's table name
func (*PsDpdpolandCountry) TableName() string {
return TableNamePsDpdpolandCountry
}

View File

@@ -0,0 +1,25 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandManifest = "ps_dpdpoland_manifest"
// PsDpdpolandManifest mapped from table <ps_dpdpoland_manifest>
type PsDpdpolandManifest struct {
IDManifest int32 `gorm:"column:id_manifest;primaryKey;autoIncrement:true" json:"id_manifest"`
IDManifestWs int32 `gorm:"column:id_manifest_ws;not null;uniqueIndex:id_manifest_ws,priority:1" json:"id_manifest_ws"`
IDPackageWs int32 `gorm:"column:id_package_ws;not null;uniqueIndex:id_manifest_ws,priority:2" json:"id_package_ws"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandManifest's table name
func (*PsDpdpolandManifest) TableName() string {
return TableNamePsDpdpolandManifest
}

View File

@@ -0,0 +1,41 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandPackage = "ps_dpdpoland_package"
// PsDpdpolandPackage mapped from table <ps_dpdpoland_package>
type PsDpdpolandPackage struct {
IDPackage int32 `gorm:"column:id_package;primaryKey;autoIncrement:true" json:"id_package"`
IDPackageWs int32 `gorm:"column:id_package_ws;not null;uniqueIndex:id_package_ws,priority:1" json:"id_package_ws"`
IDOrder int32 `gorm:"column:id_order;not null" json:"id_order"`
SessionID int32 `gorm:"column:sessionId;not null" json:"sessionId"`
SessionType string `gorm:"column:sessionType;not null" json:"sessionType"`
PayerNumber string `gorm:"column:payerNumber;not null" json:"payerNumber"`
IDAddressSender int32 `gorm:"column:id_address_sender;not null" json:"id_address_sender"`
IDAddressDelivery int32 `gorm:"column:id_address_delivery;not null" json:"id_address_delivery"`
CodAmount *float64 `gorm:"column:cod_amount" json:"cod_amount"`
DeclaredValueAmount *float64 `gorm:"column:declaredValue_amount" json:"declaredValue_amount"`
Ref1 *string `gorm:"column:ref1" json:"ref1"`
Ref2 *string `gorm:"column:ref2" json:"ref2"`
AdditionalInfo *string `gorm:"column:additional_info" json:"additional_info"`
LabelsPrinted bool `gorm:"column:labels_printed;not null" json:"labels_printed"`
IDSenderAddress int32 `gorm:"column:id_sender_address;not null" json:"id_sender_address"`
Cud bool `gorm:"column:cud;not null" json:"cud"`
Rod bool `gorm:"column:rod;not null" json:"rod"`
Dpde bool `gorm:"column:dpde;not null" json:"dpde"`
Dpdnd bool `gorm:"column:dpdnd;not null" json:"dpdnd"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandPackage's table name
func (*PsDpdpolandPackage) TableName() string {
return TableNamePsDpdpolandPackage
}

View File

@@ -0,0 +1,31 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandParcel = "ps_dpdpoland_parcel"
// PsDpdpolandParcel mapped from table <ps_dpdpoland_parcel>
type PsDpdpolandParcel struct {
IDParcel int32 `gorm:"column:id_parcel;primaryKey" json:"id_parcel"`
IDPackageWs int32 `gorm:"column:id_package_ws;not null" json:"id_package_ws"`
Waybill string `gorm:"column:waybill;not null" json:"waybill"`
Content string `gorm:"column:content;not null" json:"content"`
Weight float64 `gorm:"column:weight;not null" json:"weight"`
Height float64 `gorm:"column:height;not null" json:"height"`
Length float64 `gorm:"column:length;not null" json:"length"`
Width float64 `gorm:"column:width;not null" json:"width"`
Number int32 `gorm:"column:number;not null" json:"number"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandParcel's table name
func (*PsDpdpolandParcel) TableName() string {
return TableNamePsDpdpolandParcel
}

View File

@@ -0,0 +1,28 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package prestadb
import (
"time"
)
const TableNamePsDpdpolandParcelProduct = "ps_dpdpoland_parcel_product"
// PsDpdpolandParcelProduct mapped from table <ps_dpdpoland_parcel_product>
type PsDpdpolandParcelProduct struct {
IDParcelProduct int32 `gorm:"column:id_parcel_product;primaryKey;autoIncrement:true" json:"id_parcel_product"`
IDParcel int32 `gorm:"column:id_parcel;not null" json:"id_parcel"`
IDProduct int32 `gorm:"column:id_product;not null" json:"id_product"`
IDProductAttribute int32 `gorm:"column:id_product_attribute;not null" json:"id_product_attribute"`
Name string `gorm:"column:name;not null" json:"name"`
Weight float64 `gorm:"column:weight;not null" json:"weight"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsDpdpolandParcelProduct's table name
func (*PsDpdpolandParcelProduct) TableName() string {
return TableNamePsDpdpolandParcelProduct
}

Some files were not shown because too many files have changed in this diff Show More