Implement Bitrix24Partners support (issue #70)#109
Open
KarlsonComplete wants to merge 71 commits into
Conversation
- Replace `docker-compose` with `docker compose` commands in `Makefile` - Remove deprecated `setBitrix24PartnerId` method from `Bitrix24Partner` class
…tory` instance and simplify `setPhone` logic in `Bitrix24Partner`.
…improved context.
…andler создания партнера.
There was a problem hiding this comment.
Code Review
This pull request refactors the Bitrix24Partners module by renaming bitrix24PartnerId to bitrix24PartnerNumber and transitioning the repository to a composition-based approach. It also introduces email validation, updates PHP and PHPUnit version requirements, adds a maintainer skill definition, and improves testing infrastructure with a new partner builder. Feedback identifies inconsistent Docker command usage in the Makefile, suggests a more standard PHP version constraint, notes PSR-12 style regressions, recommends better HTML error handling, and identifies a typo in a directory name.
camaxtly
requested changes
Apr 19, 2026
…cked, MarkAsActive и Update.
…logic: - Add `Bitrix24PartnerNotFoundException` handling to UseCase Handlers (`Create`, `Update`, `Delete`, `MarkAsBlocked`, `MarkAsActive`) for better error management and logging. - Enhance field validation in `Update.Command` to ensure stricter checks. - Introduce `logoUrl` field in `Bitrix24Partner` entity and adjust related UseCases and tests. - Refactor tests to include new scenarios and improve data consistency.
- Replace `docker-compose` with `docker compose` in `Makefile`. - Introduce `bitrix24:partners:scrape:v2` command with updated logic. - Register `ScrapePartnersCommand_V2` in the console application.
- Integrate Monolog for detailed logging throughout the scraping process. - Refactor `ScrapePartnersCommand_V2` to enhance parsing logic and improve error handling. - Introduce support for fetching partner logos and storing results in a CSV file. - Streamline HTTP requests and implement configurable delays.
…`Makefile` and `console` setup.
…а, изменил сигнатуры методов сущности и добавил поддержку логотипа партнера.
camaxtly
reviewed
Apr 26, 2026
camaxtly
reviewed
Apr 26, 2026
camaxtly
requested changes
Apr 26, 2026
- Add `Uuid::v7()` support in `Bitrix24Partner` constructors and builders. - Improve validation for partner creation with `bitrix24PartnerNumber`. - Update Doctrine mapping for `bitrix24PartnerNumber` to use `unique` attribute.
…erBuilder: - Remove redundant `withBitrix24PartnerNumber` calls from tests. - Adjust `Bitrix24PartnerBuilder` to expand possible number range. - Reorder `clear()` in `Update.HandlerTest` for better test consistency.
…dize database truncation across functional tests.
- Implement stricter non-empty string checks for `site`, `email`, `openLineId`, `externalId`, and `logoUrl` in `Update.Command` and `Bitrix24Partner` entity. - Update associated tests to cover new validation scenarios.
…s, and refactor `Makefile` and `console` setup.
…aper` services and integrated them into `ScrapePartnersCommandV2` for improved modularity and reusability.
…ndling with new helper methods.
…ScrapePartnersCommandV2: добавлена обработка блокировок, настройки задержек, детектирование пустых страниц и обновлён механизм работы с доменом.
…rtnersCsvCommand, улучшил обработку пустых страниц и блокировок в ScrapePartnersCommandV2, добавил загрузку .env.local.
…ацию всех пунктов, включая BanDetector, processPartner, Bitrix24Zone enum, и обновление документации.
camaxtly
requested changes
May 24, 2026
…r update logic into `ScrapeWorkflow` and `ScrapePartnersCommand` for improved modularity and maintainability. Update ScrapeConfig to support specific partner updates. Streamline progress tracking and error handling.
…r file organization: - Replace `outputFile` with `outputDir` across configurations, workflows, and commands. - Introduce timestamped filenames for output files. - Update state management to support directory-based operations. - Adjust tests, Makefile commands, and verbosity outputs accordingly.
…scrape configuration to introduce `requestDelay`. Simplify `ScrapeWorkflow` start context resolution and improve state management consistency.
- Remove `.opencode/plans/2026-05-26-fix-output-dir-resume-logic.md` to declutter repository. - Refactor `ScrapeConfig` to use nullable `outputFile` and remove auto-generation. - Update `ScrapeStateManager` to store full `output_file` paths and add output-dir validation on resume. - Split `resolveStartContext` into `resolveResumeContext` and `getPageRange` in `ScrapeWorkflow`. - Refactor `ScrapePartnersCommand` for single-pass output-file resolution and verbosity improvements. - Introduce `ScrapeOptions` for streamlined scraping configurations.
…ortStats`, update method signatures, and streamline CSV file handling and import command default directory.
…leted partners, add option to include deleted in queries, and improve logging for skipped operations.
…enarios in `partner-scenarios.md` - Introduce `partner-common.md` with guidelines for CSV format, ban detection, and partner handling. - Simplify and consolidate `partner-scenarios.md` to focus on key scraping use cases. - Replace per-scenario options with centralized documentation for `partners:scrape` command. - Update examples and workflows to reflect streamlined scraping architecture and functionality.
…emove obsolete `Upsert` tests, commands, and handlers; add `Import` equivalents.
…ated use cases; streamline `Command` test cases by removing redundant assertions.
… maintainability: - Replace redundant `(new Bitrix24PartnerBuilder())` with `new Bitrix24PartnerBuilder()` across test files for cleaner syntax. - Remove unused properties and refine logic in `ScrapeProgress`. - Introduce `phpstan-baseline.neon` for static analysis error management. - Update `ScrapeConfig` and commands to align with stricter type declarations and nullable handling. - Bump `phpstan` and `rector` versions in `composer.json` for enhanced static analysis. - Restructure and streamline test scenarios for `MarkAsActive`, `Update`, `Delete`, and `Import`.
…ameter in constructor calls.
…age, commands, options, workflows, and error handling.
camaxtly
requested changes
May 31, 2026
| use League\Csv\Writer; | ||
| use Psr\Log\LoggerInterface; | ||
|
|
||
| class ScrapeWorkflow |
…h normalization, update related methods, and adjust test assertions. Fix partner ID validation in `ScrapePartnersCommand`.
…ed partner mapping, update `ImportWorkflow` to use `PartnerSyncView`, adjust repository to return raw partner data, and clean up redundant interface usage.
…and related documentation for clarity on relative path usage.
camaxtly
reviewed
Jun 21, 2026
…ate default directory references in documentation and examples, and remove unused `DEFAULT_OUTPUT_DIR` constant.
…SV-based data import to evaluate performance of `findAllActiveAsArray` and `findAllActive` methods.
…target, introduce `PartnerSyncViewTest`, refactor `ImportWorkflow` to use `Bitrix24PartnerReadModel`, and migrate repository logic for `findAllActiveAsArray` to `Bitrix24PartnerReadModel`.
…xcessive validation errors, add detailed error reporting, and improve import summary output.
…ior, add error handling details for import, and explain idempotent import logic.
…ImportResult`, and `ImportPartnersCsvCommand` for readability and consistency.
…kills` dependencies from the project.
camaxtly
requested changes
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements comprehensive support for Bitrix24Partners following the established DDD/CQRS patterns in the codebase.
Features Implemented:
Core Domain
Use Cases (CQRS)
CLI Tools
Testing
Technical Details:
Resolves: #70