fix(sms): stop sending platform to the relay gateway

With platform "kave" (Kavenegar) the gateway answered "cURL library is not
loaded" and nothing was delivered. The body is now { phone, host, text } and
the gateway picks the line itself. SMS_RELAY_PLATFORM is removed from the
driver, docker-compose and the env examples.

Tests: sms.service.spec updated. 150 tests pass.

پیامک بدون انتخاب خط کاوه‌نگار فرستاده می‌شود و سرویس پیامک خودش خط را انتخاب می‌کند.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
s.esmaeili
2026-10-10 16:34:57 +03:30
co-authored by Cursor
parent c34bf80e6f
commit 797d030e67
7 changed files with 10 additions and 30 deletions
+1 -8
View File
@@ -75,12 +75,11 @@ describe('SMS configuration', () => {
});
describe('relay', () => {
it('works out of the box, sending through Kavenegar', () => {
it('works out of the box', () => {
process.env.SMS_RELAY_HOST = '10.0.0.5';
const c = relayConfig();
expect(c.url).toBe('http://185.231.112.101/api/createsms');
expect(c.secret).toBeTruthy();
expect(c.platform).toBe('kave');
expect(smsConfigured()).toBe(true);
});
@@ -97,11 +96,6 @@ describe('SMS configuration', () => {
expect(relayConfig().host).toBe('gold.example');
});
it('sends platform null when SMS_RELAY_PLATFORM=default', () => {
process.env.SMS_RELAY_PLATFORM = 'default';
expect(relayConfig().platform).toBeNull();
});
it('is not configured, and warns by name, when no host can be found', () => {
noExternalIp();
expect(smsConfigured()).toBe(false);
@@ -232,7 +226,6 @@ describe('SmsService.send', () => {
phone: '09120000000',
host: '10.0.0.5',
text: 'سلام',
platform: 'kave',
});
expect(create).toHaveBeenCalledWith({
data: expect.objectContaining({ recipients: '09120000000', body: 'سلام' }),