fix(admin): city-scoped district pick and clearer overlap errors
CI / verify (pull_request) Has been cancelled

Region partners only select districts under the chosen city; overlap errors name the occupying partner.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-22 18:14:54 +08:00
parent 85f2c156b0
commit 8c4419e04e
9 changed files with 338 additions and 140 deletions
+12 -1
View File
@@ -63,10 +63,21 @@ describe('validatePartnerCityBinding', () => {
it('rejects overlapping district codes', () => {
const result = validatePartnerCityBinding(
[{ id: '1', partnerAccountId: '10', scopeType: 'DISTRICT', districtCodes: ['410105'] }],
[
{
id: '1',
partnerAccountId: '10',
scopeType: 'DISTRICT',
districtCodes: ['410105'],
companyName: '甲公司',
},
],
{ partnerAccountId: '11', scopeType: 'DISTRICT', districtCodes: ['410105'] },
);
expect(result.ok).toBe(false);
expect(result.message).toContain('区域重合');
expect(result.message).toContain('甲公司');
expect(result.occupiedCodes).toEqual(['410105']);
});
it('allows valid district binding', () => {