feat: the folder can download as the order arrives, and removes cancelled orders' files
All checks were successful
Build and deploy / Validate source (push) Successful in 14s
Build and deploy / Integration suite on a real stack (push) Successful in 5m5s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m23s
All checks were successful
Build and deploy / Validate source (push) Successful in 14s
Build and deploy / Integration suite on a real stack (push) Successful in 5m5s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m23s
Integrações gets "Baixar ao chegar" next to "Baixar na Fila". On arrival the file (the generated print file, or the final once approved) goes into a Recebidos folder inside the chosen one and moves up when the order enters the queue. Files of orders cancelled, deleted or sent back for correction, and files replaced by another final, leave the folder. The launch reset now restarts order numbers at #1 by itself: the worker's role may set the orders' number sequence, and nothing else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,9 +14,8 @@ minute. Operators, the Tiny connection and the backups are kept.
|
||||
It refuses if any payment was made with real money (Mercado Pago's
|
||||
live_mode): those are customers' orders, not tests.
|
||||
|
||||
Order numbers start again at #1 only with the database administrator's
|
||||
rights, which the worker does not have. The script prints the one command
|
||||
to run in the database container's console for that.
|
||||
Order numbers start again at #1. A database set up before the worker could
|
||||
do that prints the one command to run in the database container's console.
|
||||
"""
|
||||
import argparse
|
||||
import sys
|
||||
@@ -37,6 +36,8 @@ TABLES = [ # in an order the foreign keys allow
|
||||
ACCOUNTS = [('sessions', 'sessões de clientes'), ('accounts', 'contas de clientes')]
|
||||
CONFIRM = 'APAGAR'
|
||||
RESTART = 'ALTER TABLE dtf_local.orders ALTER COLUMN number RESTART WITH 1;'
|
||||
# What the worker's role may do itself (app/bootstrap.py grants it).
|
||||
RENUMBER = "SELECT setval(pg_get_serial_sequence('dtf_local.orders','number'), 1, false)"
|
||||
|
||||
|
||||
def counts(c, tables):
|
||||
@@ -69,7 +70,7 @@ def main(argv=None, out=print, connect=db.connect):
|
||||
out('Apagado.')
|
||||
try:
|
||||
with connect() as c:
|
||||
c.execute(RESTART)
|
||||
c.execute(RENUMBER)
|
||||
out('A numeração dos pedidos recomeça em #1.')
|
||||
except Exception as exc: # the application's role cannot alter the table
|
||||
if 'permission' not in str(exc).lower() and 'owner' not in str(exc).lower():
|
||||
|
||||
Reference in New Issue
Block a user