Metadata-Version: 2.4
Name: flexcommerce-core
Version: 1.0.0
Summary: Foundation for FlexCommerce: settings, events, hooks, signed webhooks, jobs, audit log and address book
Author-email: NzeStan <nnamaniifeanyi10@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/NzeStan/flex_commerce
Project-URL: Documentation, https://github.com/NzeStan/flex_commerce#readme
Project-URL: Repository, https://github.com/NzeStan/flex_commerce
Project-URL: Issues, https://github.com/NzeStan/flex_commerce/issues
Project-URL: Changelog, https://github.com/NzeStan/flex_commerce/blob/main/CHANGELOG.md
Keywords: django,ecommerce,flexcommerce,nigeria,africa,drf,webhooks,audit,signals
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: djangorestframework>=3.14
Provides-Extra: celery
Requires-Dist: celery>=5.3; extra == "celery"
Dynamic: license-file

# flexcommerce-core

Foundation of FlexCommerce: settings, post-commit events, in-transaction hooks, background execution, maintenance jobs, signed outgoing webhooks, audit log, address book and the shared API conventions.

Part of **[FlexCommerce](https://github.com/NzeStan/flex_commerce/blob/main/README.md)** — a complete, modular e-commerce and marketplace backend for
Django + DRF, built for Nigeria and Africa. Every app is optional.

## Features

- One `FLEXCOMMERCE = {...}` settings dict; every package registers its defaults
- `events.emit()` — signals that fire only after the transaction commits, isolated from each other
- `hooks` — plugins that take part in the business operation (and can veto it)
- `tasks.enqueue()` — `sync`, `threading`, Celery or your own executor
- `flexcommerce_run_jobs` — one command for every package's maintenance jobs
- Outgoing webhooks: HMAC-SHA256 signatures, retries with backoff, SSRF protection
- Address book API (Nigeria-aware: LGA, landmark, phone validation)
- Consistent error format, pagination and throttling for every FlexCommerce API
- System checks that catch misconfiguration at `manage.py check`
- `pytest_plugins = ["flexcommerce_core.testing"]` helpers for your own tests

## Install

```bash
pip install flexcommerce-core
```

```python
INSTALLED_APPS = [..., "rest_framework", "flexcommerce_core"]
urlpatterns = [path("api/", include("flexcommerce_core.urls"))]
```

```bash
python manage.py migrate
```

Example: `GET/POST /api/addresses/`

## Documentation

- [Integration guide](https://github.com/NzeStan/flex_commerce/blob/main/INTEGRATION.md)
- [Settings](https://github.com/NzeStan/flex_commerce/blob/main/docs/settings.md) · [API](https://github.com/NzeStan/flex_commerce/blob/main/docs/api.md) · [Events & notifications](https://github.com/NzeStan/flex_commerce/blob/main/docs/events.md)
- [Extending](https://github.com/NzeStan/flex_commerce/blob/main/docs/extending.md) · [Operations](https://github.com/NzeStan/flex_commerce/blob/main/docs/operations.md) · [Changelog](https://github.com/NzeStan/flex_commerce/blob/main/CHANGELOG.md)

Requires Python 3.10+, Django 4.2+, Django REST framework 3.14+. MIT licensed.
