fix(admin): city-scoped district pick and clearer overlap errors
CI / verify (pull_request) Has been cancelled
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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user