Metadata-Version: 2.1
Name: drf-shop-api
Version: 0.0.1
Summary: Standalone shop app, that you can add to your project
Author: Oleksandr Korol
Author-email: oleksandr.korol@coaxsoft.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: Django (>=4.2.1,<5.0.0)
Requires-Dist: django-filter (>=23.2,<24.0)
Requires-Dist: djangorestframework (>=3.14.0,<4.0.0)
Requires-Dist: drf-yasg (>=1.21.5,<2.0.0)
Requires-Dist: rest-framework-simplejwt (>=0.0.2,<0.0.3)
Description-Content-Type: text/markdown

# Features

Features:

- Products
  - products (multiple images + main image, title, description, etc.)
  - products categories (parent/child categories)
  - product dynamic stats (for filtering like on Rozetka, ek.ua)
  - product comments
  - search for products/categories
  - filter for products in the category
- Customers
  - wish lists
  - cart
  - compare lists
  - bonuses wallet
- Settings
  - taxes
  - currencies
- Orders
  - orders
  - order reports (view and generation of pdf)
  - shipping
  - statuses of order / payment / shipment

## Customers

This app will hold User related data:

`CustomerCart`
`CustomerWishList`
`CustomerBonusWallet`
`CustomerOrderHistory`

## Settings requirements

- DRF settings

```json
"DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",)
```

- DRF_SHOP settings:
  - DRF_SHOP_PAGE_SIZE on will be default 10
  - DRF_SHOP_PAYMENT_MODEL = "projects.payments.models.Payment"
  - DRF_SHOP_PAYMENT_STATUS_CHOICES = "project.payments.choices.PaymentStatus"
  - DRF_SHOP_BONUS_RATE = percentage value for each order that will go to bonus wallet (e.g. 10)

> Statuses should be aligned as regular flow then cancel followed by refund

Modify user management:
For creation of related models please use create_shop_profile decorator on you UserManager class

```python
from django.contrib.auth.base_user import BaseUserManager

from drf_shop_api.decorators import create_shop_profile


class UserManager(BaseUserManager):
    @create_shop_profile
    def create_user(self, email, password=None):
        if not email:
            raise ValueError("Enter the email")
        user = self.model(email=self.normalize_email(email))
        user.set_password(password)
        user.save(using=self._db)
        return user

```

## Dependencies

    django
    drf
    drf-yasg 1.21.5
    rest_framework_simplejwt
    mixer
    django-filter

### TODO

- Add DB indexes
- Task for currency rate update
- Review permissions
- Add custom migration to create all related model for auth user model
- Integrate payment from external project

