|
|
|
|
@ -5,11 +5,12 @@ import { TaskService } from '../../../src/tasks/service';
|
|
|
|
|
import { RemindersService } from '../../../src/services/reminders';
|
|
|
|
|
import { AllowedGroups } from '../../../src/services/allowed-groups';
|
|
|
|
|
import { ResponseQueue } from '../../../src/services/response-queue';
|
|
|
|
|
import { toIsoSql } from '../../helpers/dates';
|
|
|
|
|
|
|
|
|
|
function seedGroup(db: Database, groupId: string) {
|
|
|
|
|
const cols = db.query(`PRAGMA table_info(groups)`).all() as any[];
|
|
|
|
|
const values: Record<string, any> = {};
|
|
|
|
|
const nowIso = new Date().toISOString().replace('T', ' ').replace('Z', '');
|
|
|
|
|
const nowIso = toIsoSql(new Date());
|
|
|
|
|
|
|
|
|
|
for (const c of cols) {
|
|
|
|
|
const name = String(c.name);
|
|
|
|
|
@ -58,7 +59,7 @@ describe('RemindersService - gating por grupos en modo enforce', () => {
|
|
|
|
|
sent = [];
|
|
|
|
|
|
|
|
|
|
// Asegurar usuario receptor para satisfacer la FK de user_preferences
|
|
|
|
|
const iso = new Date().toISOString().replace('T', ' ').replace('Z', '');
|
|
|
|
|
const iso = toIsoSql(new Date());
|
|
|
|
|
memdb.exec(`
|
|
|
|
|
INSERT INTO users (id, first_seen, last_seen)
|
|
|
|
|
VALUES ('34600123456', '${iso}', '${iso}')
|
|
|
|
|
|