oms/backend/database/migrations/20261124010000-add-no-need-ship-to-products.js
liufumingren 2b2ea066ea 商品增加「不用发货」标记
- products 新增 no_need_ship(默认 0),商品编辑页可开关,列表展示「免发货」标签
- 命中该商品的订单明细:审核不锁库存、发货不扣库存、推送 WMS 时不进入报文
- 整单明细都是这类商品时:审核报错提示、推送按永久失败转异常
- 补单测(推送明细过滤)与迁移

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-24 01:07:24 +08:00

24 lines
686 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 商品增加「不用发货」标记。
*
* 1 表示该商品是虚拟商品(虚拟发货、服务、赠品等):订单命中后
* - 审核时不再锁定库存、发货确认也不扣减库存;
* - 推送 WMS 时该明细行不进入报文。
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('products', 'no_need_ship', {
type: Sequelize.TINYINT,
allowNull: false,
defaultValue: 0,
comment: '不用发货:1 是(不锁/不扣库存、不推 WMS) 0 否',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('products', 'no_need_ship');
},
};