feat(edit): 定价试算开发、SKU 样式功能修改
This commit is contained in:
@@ -577,11 +577,13 @@ describe('SKU 试算与原子确认 HTTP / PostgreSQL', () => {
|
||||
);
|
||||
const input = quote();
|
||||
input.pricing.temporary_commission_rate = null;
|
||||
assert.equal(
|
||||
(await request('/pricing/quote-previews', 'POST', input)).error
|
||||
.code,
|
||||
'PRICING_COMMISSION_UNAVAILABLE',
|
||||
const withoutCommission = await request(
|
||||
'/pricing/quote-previews',
|
||||
'POST',
|
||||
input,
|
||||
);
|
||||
assert.equal(withoutCommission.error.code, 'PRICING_COMMISSION_UNAVAILABLE');
|
||||
assert.match(withoutCommission.error.message, /本次自定义参数/);
|
||||
input.pricing.temporary_commission_rate = '0.12';
|
||||
input.pricing.mode = 'fixed_sale';
|
||||
input.pricing.selling_price = '10';
|
||||
@@ -598,7 +600,7 @@ describe('SKU 试算与原子确认 HTTP / PostgreSQL', () => {
|
||||
};
|
||||
assert.equal((await save(state, payload)).status, 409);
|
||||
});
|
||||
it('开发草稿可试算并确认到商品编辑页,但不能通过首次上架校验', async () => {
|
||||
it('草稿费率可试算、确认且不阻断首次上架预检', async () => {
|
||||
await db.query(
|
||||
`UPDATE atlas.logistics_rate_cards SET status='draft',reviewed_at=NULL,reviewed_by_user_id=NULL WHERE id=$1`,
|
||||
[card],
|
||||
@@ -637,11 +639,13 @@ describe('SKU 试算与原子确认 HTTP / PostgreSQL', () => {
|
||||
{ 'X-Atlas-Platform-Id': platform },
|
||||
);
|
||||
assert.equal(validation.status, 200, JSON.stringify(validation));
|
||||
assert.ok(
|
||||
assert.equal(
|
||||
validation.data.variants[0].issues.some(
|
||||
(issue: { code: string }) =>
|
||||
issue.code === 'PRICING_RATE_REVIEW_REQUIRED',
|
||||
issue.code === 'PRICING_RATE_REVIEW_REQUIRED' ||
|
||||
issue.code === 'PRICING_REQUIRED',
|
||||
),
|
||||
false,
|
||||
);
|
||||
const rateCard = await db.query<{ status: string; reviewed_at: Date | null }>(
|
||||
'SELECT status,reviewed_at FROM atlas.logistics_rate_cards WHERE id=$1',
|
||||
|
||||
Reference in New Issue
Block a user