Criação dos endpoint's da tabela client
This commit is contained in:
parent
f5e67ef15b
commit
6a7d5a8f26
1 changed files with 2 additions and 4 deletions
|
|
@ -15,19 +15,18 @@ class SaveRepository(BaseRepository):
|
|||
|
||||
# Colunas para o INSERT (todos os campos da DDL):
|
||||
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):
|
||||
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)
|
||||
update_actions = """
|
||||
cns = VALUES(cns),
|
||||
name = VALUES(name),
|
||||
date_register = NOW(), # Atualiza o timestamp para o momento da modificação
|
||||
state = VALUES(state),
|
||||
city = VALUES(city),
|
||||
responsible = VALUES(responsible),
|
||||
|
|
@ -47,7 +46,6 @@ class SaveRepository(BaseRepository):
|
|||
'client_id': client_schema.client_id,
|
||||
'cns': client_schema.cns,
|
||||
'name': client_schema.name,
|
||||
'date_register': client_schema.date_register,
|
||||
'state': client_schema.state,
|
||||
'city': client_schema.city,
|
||||
'responsible': client_schema.responsible,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue