feat: schedule config interface

This commit is contained in:
karishmas6
2024-10-22 18:32:27 +05:30
parent c413b8eced
commit 44ecb8018c

View File

@@ -27,6 +27,19 @@ interface RobotAttributes {
google_refresh_token?: string | null;
}
interface ScheduleConfig {
enabled: boolean;
runEvery: number;
runEveryUnit: 'MINUTES' | 'HOURS' | 'DAYS' | 'WEEKS' | 'MONTHS';
startFrom: 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
atTimeStart?: string;
atTimeEnd?: string;
timezone: string;
lastRunAt?: Date;
nextRunAt?: Date;
cronExpression?: string;
}
interface RobotCreationAttributes extends Optional<RobotAttributes, 'id'> { }
class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements RobotAttributes {