=== ConsigBrechó for WooCommerce ===
Contributors: prsgouvea
Tags: woocommerce, consignado, brecho, gestao
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Consignment management for thrift stores integrated with WooCommerce: consignors, items, sales, and payouts — everything on your site.

== Description ==

ConsigBrechó solves the biggest nightmare of those who work with consignment: knowing exactly who owns each item and how much you owe each consignor.

WooCommerce takes care of the storefront and sales. ConsigBrechó takes care of the consignment — which WooCommerce doesn't do.

**How it works:**

Register your consignors and their items. Publish each item to WooCommerce with a single click. When a sale occurs, the plugin automatically registers the due payout. At the end of the month, view each consignor's statement and mark the settlement — all in a few clicks.

**Privacy:**

The engine runs 100% inside your WordPress. Your consignors, your items, your sales, and payouts — everything stays in your own site's database and never leaves it.

The only exception, exclusive to the Pro plan, is the AI assistant: when you click "Generate with AI", the **item title** is sent to an external artificial intelligence service to generate description, category, and tag suggestions. No other data (consignor, price, sales, payouts) is shared. The plugin requests your confirmation the first time the assistant is used.

**What's included in the free plan:**

* Unlimited consignors
* Registration and publication of items in WooCommerce
* Automatic sales registration (via WooCommerce hook)
* Payout calculation with agreement hierarchy (item → consignor → store default)
* Sales, payouts, and statement screen per consignor
* Complete monthly settlement

**Pro Plan (sold separately, more info at consignapro.com.br):**

* Importer for existing WooCommerce products
* AI-assisted item descriptions
* Advanced reports (coming soon)
* Priority support

== Installation ==

1. Install and activate WooCommerce (required).
2. Upload the ConsigBrechó plugin via the WordPress dashboard (Plugins → Add New → Upload Plugin) or install directly from the WordPress.org repository.
3. Activate the plugin.
4. In the admin sidebar menu, access **ConsigBrechó** to get started.

No additional configuration is required. The system comes with defaults ready — register the first consignor and start using it.

== Frequently Asked Questions ==

= Do my data stay on my server? =

Yes. The entire ConsigBrechó engine runs inside your WordPress. Your items, your consignors, your sales, and your payouts stay in your own site's database.

There are two external communications, both exclusive to the Pro plan: (1) a periodic license subscription check, which does not send any business data; (2) when you use the AI assistant, the item title is sent to an external artificial intelligence service. No other data is shared. The plugin asks for your confirmation the first time.

= Does the plugin work with any WordPress theme? =

Yes. ConsigBrechó works in the WordPress admin dashboard and does not interfere with your store's theme. The storefront continues to be managed by WooCommerce with the theme you already use.

= If I cancel Pro, do I lose my data? =

No. All your data remains intact in your database regardless of plan. Canceling Pro only removes access to Pro-only features (importer, AI assistant, advanced reports); your consignors, items, sales, and payout history are never deleted.

= Do I need technical knowledge to install? =

No. Installation is the same as any WordPress plugin — a few clicks. After activating, the plugin creates the necessary tables automatically. You don't need to configure a database, edit files, or run commands.

= Does it work with existing orders in WooCommerce? =

The plugin registers sales automatically when an order is marked as "processing" or "completed". Orders prior to the plugin installation are not processed retroactively — only new ones from the activation onwards.

= Can I set different commissions for each consignor? =

Yes. The system uses a three-level hierarchy: the store default (valid for all), the consignor agreement (overwrites the default for that consignor), and the item agreement (overwrites everything for that specific item). Whoever doesn't have their own configuration inherits the default.

== Screenshots ==

1. Consignors dashboard — list and registration
2. Items dashboard — list, registration, and publish to WooCommerce button
3. Sales dashboard — automatic sales registration
4. Payouts dashboard — ledger of debts by consignor and period
5. Statement and monthly settlement — statement per consignor with close month button

== Changelog ==

= 1.0.0 =
* Initial release.
* Registration of consignors and items.
* Publication of items in WooCommerce.
* Automatic sales registration via WooCommerce hook.
* Payout calculation with agreement hierarchy (COALESCE in 3 levels).
* Sales, payouts, and statement screens per consignor.
* Complete monthly settlement.