Complete backend-python to be a full mirror of backend-node - #7
Merged
Conversation
Agent-Logs-Url: https://github.com/fiorionrails/feira-da-troca/sessions/b97a0379-f588-40fc-9fc5-6f991759c1ea Co-authored-by: fiorionrails <110871387+fiorionrails@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
fiorionrails
April 5, 2026 03:46
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
backend-pythonhad data-loss bugs, missing endpoints, and no input validation — diverging significantly from the Node.js reference implementation.Critical bugs fixed
process_debitnever persisted — missingconn.commit()silently discarded every debitrecalculate_pending_boxesnever persisted — same missing commitNameErrorcrash onPOST /distribution—datetimeused but not imported.env—admin_token/secret_keyhad no defaultsSchema auto-initialization
get_db_connection()now creates all tables/views on first call, matching Node.jsgetDb()behavior.manage.pystill works but is no longer required.Missing features
utils.py—parse_positive_int/parse_non_negative_int: safe parsers that reject booleans, floats, negatives, and non-numeric strings (mirrorsutils.js)comanda_service.pymax_comandasenforced (MaxComandasReachedError)DuplicateCodeErroron concurrent code collision viasqlite3.IntegrityErrorinitial_balanceno longer inserts a phantom credit eventbox_service.py—claim_boxreplaced SELECT→UPDATE pattern with a single atomicUPDATE … WHERE responsible_name IS NULL AND status = 'pending'to eliminate the race conditionws_admin.py+ws_store.pySTRESS_NO_RATELIMIT=trueto bypass)MAX_ADMIN_CONNECTIONS/MAX_STORE_CONNECTIONSenv varsparse_positive_int/parse_non_negative_intws_store: tracksstore_idper connection;disconnect_store_by_id()closes sockets on token revocationws_admin:maybeFlagRecalccalled after cart-item changesrest.pyPUT /distribution/:id/activatenow archives the previously active distributionDELETE /distribution/:idadded (was missing entirely)POST /stores/:id/revoke_tokendisconnects active WebSocket sessionsPOST /storesandPOST /categoriesreturn201