路由表化:迁移锁价、购料、库存与回收路由

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
黄健铭andClaude Opus 5.5 committed 2026-12-04 12:31:26 -08:00
1 parent babb914c59
commit d5c015f826
6 files changed
+302 -170

No files matched your search

@@ -0,0 +1,51 @@
'use strict';
// 锁价单及锁价修改审批。
const { reviewRoutes } = require('./review');
const LOCK = '/api/price-locks/:id(hexid)';
module.exports = [
{ method: 'GET', path: '/api/price-locks', handler: ({ ledger, query }) => ledger.priceLocks(query) },
{
method: 'POST',
path: '/api/price-locks',
write: true,
handler: ({ ledger, body, actor }) => ledger.createPriceLock(body, actor),
},
{ method: 'GET', path: LOCK, handler: ({ ledger, params: { id } }) => ledger.priceLockDetail(id) },
{
method: 'GET',
path: LOCK + '/edit-context',
handler: ({ ledger, params: { id }, actor }) => ledger.priceLockEdit(id, actor),
},
{
method: 'POST',
path: LOCK + '/deliver',
write: true,
handler: ({ ledger, params: { id }, body, actor }) => ledger.deliverPriceLock(id, body, actor),
},
{
method: 'POST',
path: LOCK + '/edit',
write: true,
handler: ({ ledger, params: { id }, body, actor }) => ledger.editPriceLock(id, body, actor),
},
{
method: 'POST',
path: LOCK + '/cancel',
write: true,
handler: ({ ledger, params: { id }, body, actor }) => ledger.cancelPriceLock(id, body, actor),
},
{
method: 'POST',
path: LOCK + '/change-requests',
write: true,
handler: ({ ledger, params: { id }, body, actor }) => ledger.requestPriceLockChange(id, body, actor),
},
...reviewRoutes('/api/price-lock-changes', {
list: 'priceLockChanges',
one: 'priceLockChange',
approve: 'approvePriceLockChange',
reject: 'rejectPriceLockChange',
}),
];