feat: add number library routing and cdr location support

This commit is contained in:
hectorzhao
2026-06-24 11:39:32 +08:00
parent 5fa1bd35e9
commit 7057fd3c42
63 changed files with 6361 additions and 566 deletions
@@ -114,6 +114,14 @@ class MemoryVendorGatewaysRepository implements VendorGatewaysRepository {
return this.update(gatewayId, { status });
}
async softDelete(gatewayId: string): Promise<VendorGatewaySummary> {
const current = await this.get(gatewayId);
const deleted = this.summary({ ...current, status: 'DISABLED' });
this.gateways.delete(gatewayId);
this.outboxEvents += 1;
return deleted;
}
private summary(input: Partial<VendorGatewaySummary> & { id: string; name: string }): VendorGatewaySummary {
const cycleRate = input.cycleRate ?? '0.000000';
const billingCycleSec = input.billingCycleSec ?? 60;
@@ -313,5 +321,7 @@ describe('S16 vendor gateways API', () => {
await request(app.getHttpServer()).post('/api/v2/vendor-gateways/vgw_created/disable').set('Authorization', `Bearer ${tokenFor('usr_ops')}`).expect(201);
await request(app.getHttpServer()).post('/api/v2/vendor-gateways/vgw_created/enable').set('Authorization', `Bearer ${tokenFor('usr_ops')}`).expect(201);
await request(app.getHttpServer()).delete('/api/v2/vendor-gateways/vgw_created').set('Authorization', `Bearer ${tokenFor('usr_ops')}`).expect(200);
expect(audit.entries.some((entry) => entry.module === 'vendor_gateways' && entry.action === 'delete' && entry.result === 'SUCCESS')).toBe(true);
});
});