mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-03-21 17:34:19 -05:00
feat: Store task interval
This commit is contained in:
parent
f3f895ebd6
commit
35f23f710c
|
|
@ -15,6 +15,7 @@ const TaskSchema = new mongoose.Schema<ITask, TaskModel, ITaskMethods>({
|
|||
required: true,
|
||||
enum: ['open', 'close']
|
||||
},
|
||||
interval: Number,
|
||||
title_id: String,
|
||||
description: String,
|
||||
created: BigInt,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ export async function registerTask(request: RegisterTaskRequest, context: CallCo
|
|||
const bossAppID = request.bossAppId.trim();
|
||||
const titleID = request.titleId.toString(16).toLowerCase().padStart(16, '0');
|
||||
const status = request.status;
|
||||
const interval = request.interval;
|
||||
const description = request.description.trim();
|
||||
|
||||
if (!taskID) {
|
||||
|
|
@ -59,6 +60,7 @@ export async function registerTask(request: RegisterTaskRequest, context: CallCo
|
|||
boss_app_id: bossAppID,
|
||||
creator_pid: context.user?.pid,
|
||||
status,
|
||||
interval,
|
||||
title_id: titleID,
|
||||
description: description,
|
||||
created: Date.now(),
|
||||
|
|
@ -73,7 +75,7 @@ export async function registerTask(request: RegisterTaskRequest, context: CallCo
|
|||
bossAppId: task.boss_app_id,
|
||||
creatorPid: task.creator_pid,
|
||||
status: task.status,
|
||||
interval: 0, // TODO - Don't stub this
|
||||
interval: task.interval,
|
||||
titleId: BigInt(parseInt(task.title_id, 16)),
|
||||
description: task.description,
|
||||
createdTimestamp: task.created,
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ export async function updateTask(request: UpdateTaskRequest, context: CallContex
|
|||
task.boss_app_id = updateData.bossAppId ? updateData.bossAppId : task.boss_app_id;
|
||||
task.title_id = updateData.titleId ? updateData.titleId.toString(16).toLowerCase().padStart(16, '0') : task.title_id;
|
||||
task.status = updateData.status ? updateData.status : task.status;
|
||||
task.interval = updateData.interval ? updateData.interval : task.interval;
|
||||
task.description = updateData.description ? updateData.description : task.description;
|
||||
task.updated = BigInt(Date.now());
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ export interface ITask {
|
|||
in_game_id: string;
|
||||
boss_app_id: string;
|
||||
creator_pid: number;
|
||||
status: 'open' | 'close'; // TODO - Make this a union. What else is there?
|
||||
status: 'open' | 'close';
|
||||
interval: number;
|
||||
title_id: string;
|
||||
description: string;
|
||||
created: bigint;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user