Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/src/roadmapFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default [
{ html: 'הוספת אפשרות למנהלת להתקשר ולשמוע אילו מורות דיווחו נוכחות היום', status: 'בוצע', statusColor: 'success' },
{ html: 'הוספת דוח המציג אילו מורות דיווחו נוכחות בתאריך נבחר', status: 'בוצע', statusColor: 'success' },
{ html: 'הוספת דף "צור קשר" לשליחת פנייה עם קבצים מצורפים', status: 'בוצע', statusColor: 'success' },
{ html: 'תשתית משימות רקע: ייצוא נתונים אסינכרוני, תזמונים קבועים וניטור משימות', status: 'בוצע', statusColor: 'success' },

// { html: 'הגדרת תקופת זמן לפי תאריכים', status: 'בקרוב', statusColor: 'warning' },
// { html: 'הגדרת תקופת זמן לפי יום בשבוע', status: 'בוצע', statusColor: 'success' },
Expand Down
2 changes: 2 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@nestjs/mapped-types": "*",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/schedule": "^3.0.4",
"@nestjs/swagger": "^6.3.0",
"@nestjs/throttler": "^4.0.0",
"@nestjs/typeorm": "^9.0.1",
Expand All @@ -52,6 +53,7 @@
"axios": "^1.3.4",
"bcrypt": "^5.1.0",
"change-case": "^4.1.2",
"cron-parser": "^4.9.0",
"class-transformer": "^0.5.1",
"class-validator": "0.13",
"cookie-parser": "^1.4.6",
Expand Down
61 changes: 61 additions & 0 deletions server/src/migrations/1787100000000-addJobsAndSchedulesTables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class addJobsAndSchedulesTables1787100000000 implements MigrationInterface {
name = 'addJobsAndSchedulesTables1787100000000'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE IF NOT EXISTS \`jobs\` (
\`id\` int NOT NULL AUTO_INCREMENT,
\`user_id\` int NOT NULL,
\`type\` varchar(100) NOT NULL,
\`status\` varchar(20) NOT NULL DEFAULT 'pending',
\`payload\` longtext NULL,
\`result\` longtext NULL,
\`progress\` int NOT NULL DEFAULT '0',
\`attempts\` int NOT NULL DEFAULT '0',
\`max_attempts\` int NOT NULL DEFAULT '3',
\`available_at\` datetime NULL,
\`locked_at\` datetime NULL,
\`locked_by\` varchar(100) NULL,
\`dedupe_key\` varchar(191) NULL,
\`error\` text NULL,
\`created_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
\`updated_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
\`completed_at\` datetime NULL,
PRIMARY KEY (\`id\`),
INDEX \`job_user_id_idx\` (\`user_id\`),
INDEX \`job_type_idx\` (\`type\`),
INDEX \`job_status_idx\` (\`status\`),
INDEX \`job_available_at_idx\` (\`available_at\`),
INDEX \`job_dedupe_key_idx\` (\`dedupe_key\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);

await queryRunner.query(`
CREATE TABLE IF NOT EXISTS \`schedules\` (
\`id\` int NOT NULL AUTO_INCREMENT,
\`user_id\` int NOT NULL,
\`name\` varchar(255) NOT NULL,
\`job_type\` varchar(100) NOT NULL,
\`payload\` text NULL,
\`cron_expression\` varchar(120) NOT NULL,
\`time_zone\` varchar(60) NOT NULL DEFAULT 'Asia/Jerusalem',
\`active\` tinyint(1) NOT NULL DEFAULT '1',
\`next_run_at\` datetime NULL,
\`last_run_at\` datetime NULL,
\`created_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
\`updated_at\` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
PRIMARY KEY (\`id\`),
INDEX \`schedule_user_id_idx\` (\`user_id\`),
INDEX \`schedule_next_run_at_idx\` (\`next_run_at\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE IF EXISTS \`schedules\``);
await queryRunner.query(`DROP TABLE IF EXISTS \`jobs\``);
}

}
43 changes: 43 additions & 0 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,14 @@
multer "1.4.4-lts.1"
tslib "2.4.1"

"@nestjs/schedule@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@nestjs/schedule/-/schedule-3.0.4.tgz#c2a3d96bb2cb7d562349f030823080b8513b34c3"
integrity sha512-uFJpuZsXfpvgx2y7/KrIZW9e1L68TLiwRodZ6+Gc8xqQiHSUzAVn+9F4YMxWFlHITZvvkjWziUFgRNCitDcTZQ==
dependencies:
cron "2.4.3"
uuid "9.0.1"

"@nestjs/schematics@^9.0.0":
version "9.0.3"
resolved "https://registry.npmjs.org/@nestjs/schematics/-/schematics-9.0.3.tgz"
Expand Down Expand Up @@ -1737,6 +1745,11 @@
dependencies:
"@types/node" "*"

"@types/luxon@~3.3.0":
version "3.3.8"
resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.3.8.tgz#84dbf2d020a9209a272058725e168f21d331a67e"
integrity sha512-jYvz8UMLDgy3a5SkGJne8H7VA7zPV2Lwohjx0V8V31+SqAjNmurWMkk9cQhfvlcnXWudBpK9xPM1n4rljOcHYQ==

"@types/mime@*":
version "3.0.1"
resolved "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz"
Expand Down Expand Up @@ -3331,6 +3344,21 @@ create-require@^1.1.0:
resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cron-parser@^4.9.0:
version "4.9.0"
resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-4.9.0.tgz#0340694af3e46a0894978c6f52a6dbb5c0f11ad5"
integrity sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==
dependencies:
luxon "^3.2.1"

cron@2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/cron/-/cron-2.4.3.tgz#4e43d8d9a6373b8f28d876c4e9a47c14422d8652"
integrity sha512-YBvExkQYF7w0PxyeFLRyr817YVDhGxaCi5/uRRMqa4aWD3IFKRd+uNbpW1VWMdqQy8PZ7CElc+accXJcauPKzQ==
dependencies:
"@types/luxon" "~3.3.0"
luxon "~3.3.0"

cross-fetch@3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
Expand Down Expand Up @@ -6206,6 +6234,16 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

luxon@^3.2.1:
version "3.7.2"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba"
integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==

luxon@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.3.0.tgz#d73ab5b5d2b49a461c47cedbc7e73309b4805b48"
integrity sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==

macos-release@^2.5.0:
version "2.5.0"
resolved "https://registry.npmjs.org/macos-release/-/macos-release-2.5.0.tgz"
Expand Down Expand Up @@ -9273,6 +9311,11 @@ uuid@9.0.0:
resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz"
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==

uuid@9.0.1:
version "9.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

v8-compile-cache-lib@^3.0.1:
version "3.0.1"
resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz"
Expand Down
Loading