Repository navigation
feat: partners who sell the menu on a lent card machine, for a commission - #120
Merged
Merged
Conversation
…ommission Store role partner (ADR 0024), closed to every store route outside /stores/:storeId/partner/*. Partner orders wait for the partner's machine, carry a commission snapshot and are handed over twice (to the partner, then to the customer). Cancelling follows the partner's window, past it a manager answers the request. Managers get a paginated partners table, the partner's stats and sales, and settlements of the commission paid.
Partners sell from their own POS on the lent machine, follow their orders like the store's board and see their commission. Managers follow partners in the system's data table, with an overview chart, the sales table to settle the commission, rules and the menu they may sell; the board and the kitchen show whose order it is and any cancellation asked.
… page A table ignores sr-only's 1px box: the hidden copy of each chart (30 days in a partner's overview) made pages scroll into empty space. The table now sits in an sr-only div (overview, pace, reports, partner).
A partner's people are its manager or attendant (store_user.partner_role). Attendants sell and follow the orders; the commission is left out of what they get from the API, out of their POS and orders, and the commission screen is refused. The team page invites with that role and changes it.
- every machine lent to a partner can charge (the dialog asks which) - the order detail sheet hides the counter's actions on partner orders, holds 'Entregar' and shows the cancellation request to answer - approving a request re-reads it under the order's lock: a refusal committed meanwhile wins - requests only past the partner's window; whoever asked is told when the order is cancelled another way - periods are real days, in order, up to a year (no 500, no huge series) - an existing account added as partner is sent to the partner area - tests for other stores on the remaining partner routes
Managers ask about partners (sales, commission to pay, cancellations asked), mark a partner's commission paid and answer a cancellation, each with an approval card; the board's orders say whose they are. Partners never reach the assistant. The assistant's cancel goes through the shared cancellation. The team page's four role cards fit any width.
…nd live The notification opens the order's detail, which could show a copy from before the request: order events now refetch the order itself too. The request sits first on the detail, with Aprovar / Recusar.
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Why
A shop next door wants to sell JJ Pastéis' pastries to its own customers. The store makes the order and hands it to the partner, who hands it to the customer; the money goes to the store's Mercado Pago account on a card machine the store lends, and the partner earns a commission the store pays by hand. Until now there was no way to give someone outside the store access to sell without showing them the store's orders, customers and reports, and nothing kept the counter from making pastries nobody paid for.
What
Not done: a commission per item (a value for some items over the general rule).
Tests
pnpm lint,pnpm typecheckandpnpm test(323 tests) pass; the partner, team, reports, card machine and assistant e2e specs pass.Deploy notes
1792531273424_create_store_partners: createsstore_partners(and its categories and excluded items),partner_settlementsandorder_cancel_requests; adds rolepartnerandpartner_idtostore_user,partner_idtopoint_terminals, and channelpartnerpluspartner_id,commission_amount,partner_delivered_at/_by_idandpartner_settlement_idtoorders.1792531273425_add_partner_role_to_store_user: addsstore_user.partner_role(manager or attendant, required for partners); people already partners become its managers.parceiro@jjpasteis.dev) and an attendant (vendedor@jjpasteis.dev) in development.