Criação dos endpoint's da tabela client

This commit is contained in:
Kenio 2025-10-17 11:23:50 -03:00
parent f5e67ef15b
commit 6a7d5a8f26

View file

@ -15,19 +15,18 @@ class SaveRepository(BaseRepository):
# Colunas para o INSERT (todos os campos da DDL): # Colunas para o INSERT (todos os campos da DDL):
insert_cols = """ insert_cols = """
client_id, cns, name, date_register, state, city, responsible, consultant, type_contract client_id, cns, name, state, city, responsible, consultant, type_contract
""" """
# Valores para o INSERT (usando os placeholders): # Valores para o INSERT (usando os placeholders):
insert_vals = """ insert_vals = """
:client_id, :cns, :name, :date_register, :state, :city, :responsible, :consultant, :type_contract :client_id, :cns, :name, :state, :city, :responsible, :consultant, :type_contract
""" """
# Ações no ON DUPLICATE KEY UPDATE (atualiza os campos, e o date_register como data de atualização) # Ações no ON DUPLICATE KEY UPDATE (atualiza os campos, e o date_register como data de atualização)
update_actions = """ update_actions = """
cns = VALUES(cns), cns = VALUES(cns),
name = VALUES(name), name = VALUES(name),
date_register = NOW(), # Atualiza o timestamp para o momento da modificação
state = VALUES(state), state = VALUES(state),
city = VALUES(city), city = VALUES(city),
responsible = VALUES(responsible), responsible = VALUES(responsible),
@ -47,7 +46,6 @@ class SaveRepository(BaseRepository):
'client_id': client_schema.client_id, 'client_id': client_schema.client_id,
'cns': client_schema.cns, 'cns': client_schema.cns,
'name': client_schema.name, 'name': client_schema.name,
'date_register': client_schema.date_register,
'state': client_schema.state, 'state': client_schema.state,
'city': client_schema.city, 'city': client_schema.city,
'responsible': client_schema.responsible, 'responsible': client_schema.responsible,