feat: enhance ata and objeto management by adding configuration options for quantity limits and usage tracking, improving data integrity and user feedback in pedidos
This commit is contained in:
@@ -18,10 +18,16 @@ export const atasTables = {
|
||||
|
||||
atasObjetos: defineTable({
|
||||
ataId: v.id('atas'),
|
||||
objetoId: v.id('objetos')
|
||||
objetoId: v.id('objetos'),
|
||||
// Configuração de limite de uso por (ataId, objetoId)
|
||||
quantidadeTotal: v.optional(v.number()),
|
||||
limitePercentual: v.optional(v.number()), // padrão lógico: 50
|
||||
// Controle transacional para evitar corrida; se ausente, pode ser inicializado via rebuild.
|
||||
quantidadeUsada: v.optional(v.number())
|
||||
})
|
||||
.index('by_ataId', ['ataId'])
|
||||
.index('by_objetoId', ['objetoId']),
|
||||
.index('by_objetoId', ['objetoId'])
|
||||
.index('by_ataId_and_objetoId', ['ataId', 'objetoId']),
|
||||
|
||||
atasDocumentos: defineTable({
|
||||
ataId: v.id('atas'),
|
||||
|
||||
@@ -46,6 +46,7 @@ export const pedidosTables = {
|
||||
})
|
||||
.index('by_pedidoId', ['pedidoId'])
|
||||
.index('by_objetoId', ['objetoId'])
|
||||
.index('by_ataId_and_objetoId', ['ataId', 'objetoId'])
|
||||
.index('by_adicionadoPor', ['adicionadoPor'])
|
||||
.index('by_acaoId', ['acaoId']),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user