docs: map existing codebase with PAUL

- stack.md - PrestaShop 1.7.x, PHP, Smarty, SCSS, modules
- architecture.md - MVC + hooks, override mechanism, CQRS in src/
- structure.md - Directory layout, key file locations
- conventions.md - PHP/Smarty/SCSS/JS conventions, PS patterns
- testing.md - No automated tests in custom modules
- integrations.md - Allegro, Empik, BaseLinker, shipping, payments
- concerns.md - Override fragility, EOL risk, missing CI/CD
- db_schema.md - Custom tables, modified core tables

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-27 12:41:05 +02:00
parent c5d0a259c7
commit b1e8bb3d12
14 changed files with 1069 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
# Database Schema
**Analysis Date:** 2026-04-27
## Connection
- Host: `dedyk75.cyber-folks.pl`
- Database: `interblue_sklep`
- Table prefix: `ps_`
- Engine: InnoDB
- Charset: UTF-8 (note: custom tables use `utf8` not `utf8mb4`)
- Cache: Memcached
## Core PrestaShop Tables (selected)
Standard PrestaShop tables present (not listed exhaustively — see PS docs):
- `ps_orders` — Orders (modified by AddOrderExtraFields, see below)
- `ps_order_history` — Order status history
- `ps_order_invoice` — Invoices
- `ps_order_payment` — Payment records (modified by AddOrderExtraFields)
- `ps_product` — Products
- `ps_product_lang` — Product translations
- `ps_cart` — Shopping carts
- `ps_customer` — Customers
## Custom Tables (Added by Modules)
### `ps_custom_feature_tab` — Feature Tab Rules
Created by: `modules/customfeaturetab/customfeaturetab.php`
| Column | Type | Notes |
|--------|------|-------|
| id_custom_feature_tab | INT UNSIGNED | PRIMARY KEY, AUTO_INCREMENT |
| id_feature | INT UNSIGNED | Feature ID from ps_feature |
| id_feature_value | INT UNSIGNED | Feature value ID |
| position | INT UNSIGNED | Display order |
| active | TINYINT(1) | Enable/disable |
| date_add | DATETIME | |
| date_upd | DATETIME | |
### `ps_custom_feature_tab_lang` — Feature Tab Content (Multilang)
Created by: `modules/customfeaturetab/customfeaturetab.php`
| Column | Type | Notes |
|--------|------|-------|
| id_custom_feature_tab | INT UNSIGNED | FK → ps_custom_feature_tab |
| id_lang | INT UNSIGNED | FK → ps_lang |
| title | VARCHAR(255) | Tab title |
| content | TEXT | Tab HTML content |
Primary key: (id_custom_feature_tab, id_lang)
## Modified Core Tables (by Modules)
### `ps_orders` — Order Source Field
Added by: `modules/AddOrderExtraFields/AddOrderExtraFields.php`
| Column | Type | Notes |
|--------|------|-------|
| order_source | ENUM('Allegro', 'Sklep int.', 'Telefonicznie') | Added via ALTER TABLE |
Logic: Set in `modules/AddOrderExtraFields/override/classes/PaymentModule.php`
- 'Allegro' — when `$order->module == 'x13allegro'`
- 'Sklep int.' — default for web store orders
- 'Telefonicznie' — manual phone orders (set manually in admin)
### `ps_order_payment` — Card Payment Field
Added by: `override/classes/order/OrderPayment.php`
- Additional field for storing card payment type (max 254 chars)
## Migration Approach
- No migration framework — DDL executed in module `install()` methods
- ALTER TABLE statements in `AddOrderExtraFields.php`
- CREATE TABLE in `customfeaturetab.php`
- No rollback scripts (uninstall drops custom tables)
- No version tracking for schema changes
## Known Issues
- Custom tables use `utf8` charset (should be `utf8mb4` for full Unicode/emoji support)
- `ps_custom_feature_tab` has no index on `id_feature` or `id_feature_value` (potential slow queries on large catalogs)
- `order_source` enum requires ALTER TABLE to add new order sources
---
*DB schema: 2026-04-27*
*Update when modules add/modify tables*