Commit graph

38 commits

Author SHA1 Message Date
5556cd008d Fixes: 1) Remove unnecessary blank line in get_or_create_attribute_safe. 2025-08-18 14:46:18 +03:00
1308aa47db Features: 1) Add get_or_create_attribute_safe method for safely creating or retrieving attributes within a transaction;
Fixes: 1) Extend imports with `transaction` to support atomic operations;

Extra: 1) Minor inline comment adjustments for clarity.
2025-08-18 14:43:54 +03:00
ab10a7a0b7 Features: 1) Add SEO meta utilities and builder functions for schemas; 2) Implement SEO-related APIs in viewsets for categories, brands, and products; 3) Add SeoMeta model and serializer to manage SEO metadata.
Fixes: 1) Resolve annotations compatibility with mypy `type: ignore` adjustments; 2) Correct `resolve_price_with_currency` method to ensure proper float returns; 3) Handle scenarios for empty or null queryset in vendor methods.

Extra: 1) Refactor utility functions for better type annotations and robustness; 2) Minor formatting corrections and removal of redundant mypy strict setting; 3) Improve method return types for consistency.
2025-08-18 14:26:09 +03:00
59870b3bc5 Features: 1) Add logging for transaction processing errors in payments/signals.py; 2) Add return type annotations for core tasks in core/tasks.py;
Fixes: 1) Avoid unused variable warning in `update_products_task` by removing exception variable `vie`; 2) Add missing imports for `logging` and `traceback` in `payments/signals.py`;

Extra: 1) Minor formatting fix in `dbbackup.py` to consolidate FTP URL string construction; 2) Remove unnecessary newline in `core/vendors/__init__.py`.
2025-08-11 14:05:48 +03:00
75709a3aa1 Features: 1) Introduce VendorInactiveError for explicitly handling inactive vendors in core/vendors; 2) Update stock update process to skip inactive vendors and log warnings.
Fixes: 1) Add missing import for `VendorInactiveError` in `core/tasks.py`.

Extra: 1) Refactor exception handling for vendor stock updates for better readability.
2025-08-07 12:31:54 +03:00
f52227973b Features: 1) Add b2b_auth_token and users fields to Vendor model with associated migration; 2) Introduce unique constraint for b2b_auth_token with migration; 3) Enhance VendorAdmin and Vendor model's save method to manage related users and token fields automatically;
Fixes: 1) Adjust `is_business` property logic for accuracy; 2) Fix import cleanup in serializers and utils files;

Extra: Refactor `core.models`, `core.utils`, and `core.vendors` for improved type annotations and other minor adjustments; Expand mypy exclusions in `pyproject.toml`.
2025-07-28 11:56:32 +03:00
09366213b6 Features: 1) Introduced AddressFilter and AddressType to enable filtering and querying addresses via GraphQL; 2) Added resolve_addresses method with permission check in GraphQL schema; 3) Updated DRF settings to improve API documentation structure.
Fixes: 1) Corrected `apply_addresses` logic to handle address validation more robustly; 2) Fixed incorrect imports and annotations for better type safety; 3) Resolved typos and clarified docstrings for various views and methods.

Extra: Adjusted formatting, added `# type: ignore` for stricter type checks, and removed unused `dist/` directory from `.dockerignore`.
2025-07-12 18:49:25 +03:00
68db25e022 Features: 1) Add initialization for filter_kwargs in delete_inactives method;
Fixes: 1) Streamline queryset filtering in `delete_inactives` by removing redundant line breaks;

Extra: 1) Minor formatting cleanup for improved code readability;
2025-07-09 16:58:31 +03:00
95cd868ebd Features: 1) Add support for batched deletion of inactive products in delete_inactives with configurable batch size; 2) Include ProductImage in imports for cleanup operations;
Fixes: 1) Ensure `delete_inactives` handles deletions safely by using query batching; 2) Correct filter logic in `delete_inactives` for inactivation methods;

Extra: Refactor `delete_inactives` logic for better maintainability and clearer error handling;
2025-07-09 03:58:05 +03:00
aa8f15d0ee Features: 1) RUFFVCKED 2025-07-03 02:53:01 +03:00
d17839abed Features: 1) Implement safeguard to trim resolving_name exceeding 255 characters; 2) Introduce character limit enforcement for key within Attribute creation;
Fixes: 1) None;

Extra: Refactor handling of oversized strings to improve robustness and avoid potential errors;
2025-07-02 17:28:05 +03:00
718f3dffa9 Features: 1) Added inactivation method parameter to delete_inactives for flexible product deletion options.
Fixes: 1) Corrected error message in `products` update case for consistent terminology.

Extra: 1) Refactored `delete_inactives` logic for clarity and added validation for inactivation methods.
2025-06-27 02:22:40 +03:00
61033a58d6 Features: 1) Add method parameter to prepare_for_stock_update to support multiple actions (deactivate, delete, update description);
Fixes: None;

Extra: 1) Add `QuerySet` import to support type hinting; 2) Improve error handling with descriptive `ValueError` for invalid method.
2025-06-27 02:19:54 +03:00
a91ba0c41a Features: 1) Add priority field to Category model; 2) Update priority field in Brand model to improve consistency.
Fixes: 1) Ensure correct handling of query results in category/brand auto-resolve methods; 2) Fix PO formatting issues across multiple locales.

Extra: 1) Add `priority` field to Django admin for categories; 2) Suppress specific type-checking warnings in settings and utilities.
2025-06-22 00:48:06 +03:00
fdd92dbf8b Features: 1) Introduced strict parameter for zip function in widgets.py; 2) Added EXTENSIONS_MAX_UNIQUE_QUERY_ATTEMPTS setting;
Fixes: 1) Resolved redundant lines and formatting inconsistencies across multiple files; 2) Corrected Collection typing imports and Optional replacements with union types (e.g., `str | None`);

Extra: Improved formatting and readability by consolidating single-line code sections and simplifying expressions.
2025-06-21 20:38:37 +03:00
d616d2e18b Features: 1) Improved support for nested multi-line typing hints across numerous functions; 2) Refactored variable assignments for enhanced readability within bulk_add_products and bulk_remove_products; 3) Updated token-related test methods to ensure consistent styling;
Fixes: 1) Removed unused imports including `Order` from `payments/models.py` and `health_check.contrib.redis` from settings; 2) Fixed inconsistent formatting and parameter alignment in method definitions; 3) Corrected type annotations and adjusted verbose text handling;

Extra: Cleaned up formatting in docstrings, comments, and JSON field help text across multiple files for better code style compliance and readability.
2025-06-18 16:55:49 +03:00
a33be30098 Features: 1) Added vendor, product tag, category tag models and metadata; 2) Introduced proper noinspection comments for Mypy warnings; 3) Extended Markdown linting rules.
Fixes: 1) Corrected `ForeignKey` type assertions across models; 2) Resolved typos and formatting inconsistencies in `.env` and README; 3) Fixed explicit boolean checks in user manager methods.

Extra: Updated type hints in multiple models, serializers, and views.
2025-06-18 15:58:49 +03:00
328ccaa615 Features: 1) 2.8.9 update
Fixes: 1) wtf go read diff;

Extra: ???
2025-06-18 15:05:58 +03:00
6ce7b7a6f9 Features: 1) Add optional currency parameter to resolve_price_with_currency for enhanced flexibility;
Fixes: 1) Address minor spacing inconsistencies in list comprehension and JSON detection logic;

Extra: 1) Update `.gitignore` to exclude `.astro/` directory.
2025-06-17 15:39:37 +03:00
0153157653 Features: None;
Fixes: 1) Correct indentation in multiple modules, including mutations, models, and utility methods to maintain consistency; 2) Fix typos in function parameters and update alignment for readability;

Extra: Refactored for improved code readability and adherence to PEP 8 style guidelines.
2025-06-17 11:34:02 +03:00
ddad857015 Features: 1) Implement marketological rounding method to handle psychological pricing; 2) Enhance rounding logic to consider price magnitude using logarithmic calculation;
Fixes: None;

Extra: 1) Update import to include `log10` from `math`; 2) Add detailed docstring explaining marketological rounding method logic.
2025-06-17 09:54:03 +03:00
d86a6ed3c8 RUFF 2025-05-26 16:12:59 +03:00
ea0d14bfc8 Features: 1) Add "Stock.DoesNotExist" and "ProductImage.DoesNotExist" to ignored exceptions in base settings;
Fixes: 1) Ensure auto_resolver_helper returns only the created or fetched instance by accessing tuple index [0];

Extra: None;
2025-05-13 03:15:15 +03:00
37c0867ab7 Features: 1) Add support for defaults in get_or_create for auto_resolver_helper; 2) Modularize Sentry ignore_errors configuration with a dedicated variable;
Fixes: None;

Extra: 1) Minor code refactor to streamline `ignore_errors` handling in Sentry setup;
2025-05-13 02:48:56 +03:00
87c355474c Features: 1) Enable Elasticsearch DSL autosync and switch to CelerySignalProcessor; 2) Extract common logic into auto_resolver_helper for resolving brands and categories; 3) Add conditional CACHEOPS_ENABLED based on sys arguments;
Fixes: 1) Add missing sys import in caches.py; 2) Ensure CACHEOPS_REDIS is only declared when CACHEOPS_ENABLED is True;

Extra: 1) Formatting and cleanup for readability in settings and auto-resolve methods; 2) Rearrange cacheops import in base settings;
2025-05-13 02:09:10 +03:00
ae17cc1371 Features: 1) Add populate_index function for Elasticsearch indexing and integrate it into update_products; 2) Enhance CategoryViewSet queryset with prefetching of "parent" and "children";
Fixes: 1) Refine logic in vendor category and brand handling to correctly handle multiple active/inactive entries;

Extra: 1) Add missing import for `registry` in Elasticsearch module; 2) Minor cleanup and spacing adjustments in Elasticsearch and vendor modules.
2025-05-12 20:22:01 +03:00
11cca3b9f0 Features: 1) Add process_attribute method for handling product attributes in vendors module; 2) Introduce blocked_attributes list to manage excluded attributes; 3) Add dependency zeep to pyproject.toml.
Fixes: 1) Correctly handle `IntegrityError` and `MultipleObjectsReturned` exceptions in `process_attribute` to prevent crashes; 2) Add missing imports for `django.db.IntegrityError`, `Attribute`, and `AttributeGroup`.

Extra: Cleanup formatting in `poetry.lock` for consistent style.
2025-05-12 01:51:56 +03:00
3185eb8188 Features: None;
Fixes: 1) Correct typo in 'exclude' method call for categories; 2) Correct typo in 'exclude' method call for brands;

Extra: None;
2025-05-09 06:57:41 +03:00
695058128e Features: 1) Add exception handling for Category.MultipleObjectsReturned and Brand.MultipleObjectsReturned; 2) Add aiosmtpd dependency to pyproject.toml.
Fixes: None;

Extra: 1) Update poetry.lock for the new aiosmtpd package; 2) Perform formatting changes to json and hash entries in poetry.lock for consistency.
2025-05-09 06:53:53 +03:00
ed16a4fd3d Revert "Features:"
This reverts commit a31ce44dfc.
2025-05-09 04:31:48 +03:00
a31ce44dfc Features:
1) Add Celery shared_task decorator to `update_stock` method for asynchronous execution.

Fixes:
1) Replace direct `update_stock()` calls with `update_stock.delay()` to enable task queuing.

Extra:
1) Add missing import for `shared_task` in `core/vendors/__init__.py`.
2025-05-09 04:29:07 +03:00
808e2aae25 Refactor category and brand resolution logic.
Improve handling of duplicate and inactive objects during category and brand resolution. Ensures only the most relevant entry is retained while unused duplicates are deleted. Fixes potential issues with object retrieval and creation logic.
2025-05-07 19:55:36 +03:00
e1f54304b6 Refactor error handling in auto_resolve methods.
Replaced context manager suppress(KeyError) with try-except blocks to handle both KeyError and IndexError in auto_resolve_category and auto_resolve_brand methods. This improves clarity and ensures proper handling of potential IndexError cases.
2025-05-07 10:40:40 +03:00
87e124f614 Handle errors in vendor stock updates and inactive vendors
Add error handling during the stock update process to log and skip problematic vendors without halting execution. Additionally, ensure `get_vendor_instance` only returns active vendors, raising an error if the vendor is inactive. This improves system resilience and data integrity.
2025-05-07 03:15:23 +03:00
5aca04cf55 Reorder imports in core/vendors/__init__.py
Adjusted the import order in compliance with PEP 8 guidelines. This helps improve code readability and maintain consistency across the codebase.
2025-05-07 02:41:41 +03:00
5d007c07a2 Add auto_resolve_brand method to handle brand resolution
Introduced a new static method, auto_resolve_brand, to simplify and automate the resolution or creation of Brand objects based on a given brand name. Updated imports in core/vendors/__init__.py to include the Brand model. This enhances the system's ability to process brands effectively.
2025-05-07 02:40:23 +03:00
70cf2c23a1 Add auto_resolve_category method to vendor logic
Introduced the auto_resolve_category method to streamline category resolution using Elasticsearch. This enhances category lookup efficiency and ensures seamless creation or retrieval of categories when necessary.
2025-05-07 02:38:28 +03:00
68febcdb08 Initial Commit 2025-04-29 22:40:30 +03:00