feat: complete phase2 baseline cdr quality rbac
This commit is contained in:
@@ -59,9 +59,38 @@ function prismaFixture(): PrismaClient {
|
||||
{ id: 'cus_1', status: 'ENABLED', balance: new Prisma.Decimal('10'), creditLimit: new Prisma.Decimal('0'), minBalance: new Prisma.Decimal('0') }
|
||||
]
|
||||
},
|
||||
businessPrefix: {
|
||||
findMany: async () => [
|
||||
{ id: 'bp_1', prefix: '671', name: '业务671', priority: 10, status: 'ENABLED' }
|
||||
]
|
||||
},
|
||||
customerGateway: {
|
||||
findMany: async () => [
|
||||
{ id: 'cgw_1', customerId: 'cus_1', authMode: 'IP', sourceIp: '100.93.185.30', sipUsername: null, sipDomain: null, sipHa1: null, status: 'ENABLED' }
|
||||
{
|
||||
id: 'cgw_1',
|
||||
customerId: 'cus_1',
|
||||
authMode: 'IP',
|
||||
sourceIp: '100.93.185.30',
|
||||
ips: [
|
||||
{ sourceIp: '100.93.185.30' },
|
||||
{ sourceIp: '100.93.185.31' }
|
||||
],
|
||||
sipUsername: null,
|
||||
sipDomain: null,
|
||||
sipHa1: null,
|
||||
lineGroupId: 'lg_1',
|
||||
billingCycleSec: 6,
|
||||
cycleRate: new Prisma.Decimal('0.008'),
|
||||
callerMatchMode: 'PREFIXES',
|
||||
callerPrefixes: [{ prefix: '021' }],
|
||||
calleeMatchMode: 'BUSINESS_PREFIXES',
|
||||
businessPrefixes: [
|
||||
{
|
||||
businessPrefix: { id: 'bp_1', prefix: '671', name: '业务671', priority: 10, status: 'ENABLED' }
|
||||
}
|
||||
],
|
||||
status: 'ENABLED'
|
||||
}
|
||||
]
|
||||
},
|
||||
customerGatewayPolicy: {
|
||||
@@ -95,10 +124,15 @@ function prismaFixture(): PrismaClient {
|
||||
concurrencyLimit: 30,
|
||||
billingCycleSec: 6,
|
||||
cycleRate: new Prisma.Decimal('0.012'),
|
||||
landingCalleePrefix: '86',
|
||||
status: 'ENABLED',
|
||||
forbiddenPeriods: [],
|
||||
codecs: [],
|
||||
prefixRules: [],
|
||||
callerRewritePool: [
|
||||
{ caller: '02160010001', weight: 70, status: 'ENABLED' },
|
||||
{ caller: '02160010002', weight: 30, status: 'ENABLED' }
|
||||
],
|
||||
blockedRegions: [{ regionScope: 'CITY', provinceCode: '340000', provinceName: '安徽省', cityCode: '340100', cityName: '合肥市' }]
|
||||
}
|
||||
]
|
||||
@@ -141,6 +175,12 @@ describe('S42 config publisher number library snapshot', () => {
|
||||
|
||||
expect(result.published).toBe(true);
|
||||
expect(result.manifest).toMatchObject({
|
||||
schemaVersion: 2,
|
||||
businessPrefixCount: 1,
|
||||
customerGatewayIpCount: 2,
|
||||
customerGatewayBusinessPrefixCount: 1,
|
||||
customerGatewayCallerPrefixCount: 1,
|
||||
callerRewriteCount: 2,
|
||||
cityCount: 1,
|
||||
phoneSegmentCount: 1,
|
||||
areaCodeCount: 1,
|
||||
@@ -149,6 +189,14 @@ describe('S42 config publisher number library snapshot', () => {
|
||||
});
|
||||
expect(redis.writes).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:business_prefix:bp_1` }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:business_prefix_value:671`, value: 'bp_1' }),
|
||||
expect.objectContaining({ command: 'rpush', key: `cfg:v:${version}:business_prefixes` }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:auth:ip:100.93.185.30`, value: 'cgw_1' }),
|
||||
expect.objectContaining({ command: 'rpush', key: `cfg:v:${version}:auth:ip:100.93.185.31:gateways`, value: 'cgw_1' }),
|
||||
expect.objectContaining({ command: 'rpush', key: `cfg:v:${version}:customer_gateway:cgw_1:caller_prefixes`, value: '021' }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:customer_gateway:cgw_1:line_group`, value: 'lg_1' }),
|
||||
expect.objectContaining({ command: 'rpush', key: `cfg:v:${version}:vendor_gateway:vgw_1:caller_rewrite_pool` }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:phone_segment:1380013` }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:area_code:0551` }),
|
||||
expect.objectContaining({ command: 'set', key: `cfg:v:${version}:carrier_prefix:138` }),
|
||||
|
||||
Reference in New Issue
Block a user