Commit graph

19 commits

Author SHA1 Message Date
a79791a972 style: apply CS Fixer formatting across codebase
Some checks are pending
CI / test (push) Waiting to run
Consistent brace style, spacing, and method expansion throughout
domain, infrastructure, and test files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:56:37 +00:00
6bd8e0bec8 feat: eBay business policies + per-adapter admin navigation
Some checks are pending
CI / test (push) Waiting to run
- ArticleTypePlatformConfig: fulfillmentPolicyId, paymentPolicyId,
  returnPolicyId, merchantLocationKey (all nullable)
- EbayAccountApiClient: fetches Fulfillment/Payment/Return policies
  from eBay Account API (/sell/account/v1)
- EbayInventoryApiClient: adds getLocations()
- EbayPolicyProvider: aggregates choices with 5 min cache; returns
  empty array on API failure so the form degrades to TextField
- EbayAdapter: reads real ArticleTypePlatformConfig (category ID no
  longer hardcoded), passes listingPolicies + merchantLocationKey
  into createOffer() when set
- EbayArticleTypePlatformConfigCrudController: live policy dropdowns
  from EbayPolicyProvider; fallback to TextField with help text
- DashboardController: eBay subMenu with Kategorie-Konfigurationen
- 7 new unit tests for EbayAdapter policy scenarios

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 07:13:51 +00:00
929f5a0b2d test: add category suggestions integration test
Verifies getCategorySuggestions() returns id/name/path shaped results
from the eBay sandbox Taxonomy API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 20:29:47 +00:00
7f2ec21c64 feat: expose eBay aspect usage tier (RECOMMENDED vs OPTIONAL)
EbayTaxonomyService.getCategoryAspects() now returns 'usage' alongside
'required'. eBay has three effective tiers for category 177/Notebooks:
  required=true  + usage=RECOMMENDED → hard gate (3 aspects)
  required=false + usage=RECOMMENDED → search ranking signal (17 aspects)
  required=false + usage=OPTIONAL    → truly optional (11 aspects)

Integration test covers all three tiers explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 18:21:31 +00:00
68a9f0094e feat: eBay sandbox integration — env config + taxonomy/adapter tests
Add sandbox credentials to .env.test and .env.local (sandbox URLs).
Pass EBAY_* vars through bin/test-integration.

EbayTaxonomyIntegrationTest: 6 tests against sandbox Taxonomy API using
app token (client_credentials) — verifies OAuth, aspects for notebooks
(cat 177) and RAM (cat 170083), required flags, value lists, caching.

EbayAdapterIntegrationTest: listing publish/update/deactivate tests skip
gracefully when EBAY_USER_TOKEN not set (Inventory API requires
Authorization Code user token). Noop-deactivate test always runs.

All 6 taxonomy tests pass against live sandbox.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 18:02:49 +00:00
376171303e fix: vision agent serial-bleed regex + fix broken agent unit tests
OllamaVisionAgent.extractField() now handles field labels at the start
of a value (e.g. MODEL_NUMBER: "SERIAL: 1005NK677594" -> "") not just
mid-value bleed. Both agent test files updated to mock
PromptTemplateRepositoryInterface and construct a real
PromptTemplateService, since the service is final and unmockable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 16:57:01 +00:00
c19637465b feat: Frappe ERP matching, pipeline model cache, ACL, stock field, specs by type
Frappe ERP:
- findExistingCustomer() on FrappeErpAdapter — two-step name+address lookup
- FrappeHttpClient: add put() method; switch invoice submit to PUT docstatus=1 (Frappe v16)
- buildItemDescription() uses specsText + inventory number + serial number
- Integration tests: find Simon Kühn, create real 1337€ invoice, cancel+delete in tearDown
- FRAPPE_GENERIC_ITEM_CODE=SKU002 added to .env.local and bin/test-integration

Pipeline — model cache:
- PhotoUploadHandler: after vision, check DB for existing article with same modelNumber
- On match: copy ebayTitle/ebayDescription/specsText/attributes, skip specs+JSON+eBay steps
- DraftArticleHandler: apply model_match data and mark job complete directly
- ArticleRepository: findCompletedByModelNumber() query

Pipeline — specs by article type:
- SpecsResearchAgent: accept attributeFields list, format as bullet list in {{fields}} var
- SpecsResearchHandler: derive attribute names from ArticleType, pass to agent
- SpecsResearchMessage: add attributeFields param
- Prompt migration: replace hardcoded laptop spec list with {{fields}} placeholder

Article:
- specsText field (nullable text column + migration)
- stock field visible on index and editable in CRUD form
- addAttributeValue()/removeAttributeValue() adder-remover pair for Symfony form binding
- AttributeValue::getArticle() getter
- AttributeValueFormType: detect required attributes from ArticleType assignments, set required=true
- ManualIngestType: add stock/quantity field (default 1, min 1)

Users / ACL:
- PermissionVoter: define named permission constants + allPermissions()
- User: getGrantedPermissions()/setGrantedPermissions() helpers
- UserCrudController: permissions checkbox group on edit form

UI / assets:
- public/css/admin/custom.css: red asterisk for required fields
- DashboardController: register custom CSS

Infra:
- PipelineJobFailureListener: mark job failed (with real error) when Messenger exhausts retries
- doctrine.yaml: exclude app.inventory_seq from schema diff
- ErpAdapterInterface: add findExistingCustomer()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 16:42:15 +00:00
cba8ebcf5e feat: Frappe customer integration tests + FrappeHttpClient get/delete
Adds GET and DELETE methods to FrappeHttpClient. Integration tests cover
create, find, not-found (wrong name), and delete against the live staging
ERPNext instance. Run with: bin/test-integration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 14:47:20 +00:00
f55e96b094 chore: add tooling config, test bootstrap, env templates and docs
PHPUnit config (phpunit.dist.xml, bin/phpunit, bootstrap.php), PHP CS
Fixer config, .editorconfig. Separate .env.dev/.env.test templates.
Ollama tunnel setup script. Architecture and plan docs. Updated
application-layer unit tests to match current service signatures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:44:16 +00:00
487c7f8da1 feat: add security layer, domain repositories and infrastructure services
ApiKeyAuthenticator, PermissionVoter and UserProvider implement
Symfony Security for the API (Bearer token) and admin (session) flows.
Domain repository interfaces added for ApiKey, User, AIPipelineJob and
Invoice; Doctrine implementations provided.

Also adds DatabaseLogHandler for structured DB logging, SerpApiWebSearch,
and the LogEntry domain entity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:43:58 +00:00
46cff4553f feat: add eBay and Frappe channel adapters with order infrastructure
eBay adapter covers OAuth, inventory API, fulfillment API, taxonomy
service and webhook signature verification. Frappe ERP adapter wraps
the Frappe HTTP client for order/invoice sync.

Includes CustomerResolver, InvoiceMailer, and the EbayWebhookController
for inbound eBay marketplace notifications.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:43:52 +00:00
fddfd920f5 feat: add Symfony Messenger pipeline with AI agents and handlers
Messages and handlers for the full AI pipeline:
DraftArticle → Validation → SpecsResearch → PhotoUpload → EbayText →
JsonCoding → PublishToChannel / DeactivateListingMessage / TrackingPush /
UpdateStockOnChannels / OrderReceived.

OllamaClient and OllamaClientInterface provide the base LLM backend.
AI agents (EbayTextAgent, JsonCodingAgent, OllamaVisionAgent,
SpecsResearchAgent) wrap the client with task-specific prompts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:43:47 +00:00
838b96eb14 feat: required/optional attribute sections in ArticleType form
Promote article_type_attributes join table to ArticleTypeAttribute entity
with a required boolean flag. ArticleType gains virtual form properties
(requiredAttributeDefs / optionalAttributeDefs) reconciled via
applyAttributeAssignments() on persist/update.

Admin form shows two Tom Select multi-selects; a small JS module
(article-type-attr-sync.js) listens for ea.autocomplete.connect events
and keeps the two lists mutually exclusive in real time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:43:42 +00:00
f915bba966 feat: admin panel, Mistral client, attribute management, API key command
- Fix EasyAdmin 5 routing: #[AdminDashboard] attribute + easyadmin.routes loader
- Fix login: _username/_password field names, CSRF stateless token config,
  sessions directory, Opcache reload after cache:clear
- Add MistralClient behind OllamaClientInterface — switchable via services.yaml alias
- Add Attribute CRUD with EnumType form + ChoiceField display (enum-safe rendering)
- Add Article Type CRUD with AssociationField for attribute assignments
- Add app:api-keys:create console command (bcrypt-hashed, never stored as plaintext)
- Add redis ext to Docker image + symfony/redis-messenger, start workers
- Translate all UI strings to English
- Add tests: MistralClient, ApiKey, CreateApiKeyCommand, StringArrayType,
  ArticleTypeCrudController, AttributeDefinitionCrudController (82 tests total)
- Update design doc: tech stack, AI backend switching guide, ops section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 20:15:13 +00:00
6bf001b0c0 feat: implement Plan 2 — Article Management API
- 6 new domain repository interfaces (StoragePath, ArticlePhoto, AttributeValue, ChannelField, ArticleTypePlatformConfig, AttributeMapping)
- 6 Doctrine repository implementations
- StorageManager with multi-path quota-aware file storage (LocalStorageManager)
- Application services: ArticleTypeService, ArticleService, ArticleValidator, PhotoService, PlatformService, MappingService
- REST controllers: ArticleType, Article, Photo, Platform, Mapping (all under /api prefix)
- inventory_number sequence migration
- 22 unit tests passing, PHPStan level 9 clean, CS Fixer clean
- Fixed phpdoc_to_comment CS Fixer rule (disabled) to preserve @var type annotations
- Fixed PHPStan: User::getUserIdentifier non-empty-string, AIPipelineJob nullable missingFields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 05:19:20 +00:00
e8fb01f707 feat: add Order, Pipeline, Auth domain entities (Customer with matching-key, Order, Invoice, AIPipelineJob, User, ApiKey) 2026-05-14 04:30:12 +00:00
3cc8f57f11 feat: add Article domain cluster (ArticleType, AttributeDefinition, Article, AttributeValue, ArticlePhoto, StoragePath) 2026-05-14 04:28:06 +00:00
6e8a2e070f feat: add domain enums (ArticleStatus with transitions, ArticleCondition, AttributeType, OrderStatus, AIPipelineJob enums) 2026-05-14 04:26:50 +00:00
f204233509 feat: add PHPStan level 9, PHP CS Fixer, Pest; fix docker user=1000 to avoid root-owned files 2026-05-14 04:25:30 +00:00