feat: add number library routing and cdr location support
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user