"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LimitOrder = void 0;
const db_1 = require("../Sheluder/db");
const uuid_1 = require("uuid");
class LimitOrder {
    async createLimitOrder(input) {
        const now = new Date().toISOString();
        const newSchedule = Object.assign(Object.assign({}, input), { id: (0, uuid_1.v4)(), createdAt: now, updatedAt: now, status: "pending" });
        (0, db_1.insertSchedule)(newSchedule);
        return newSchedule;
    }
    async getLimitOrders() {
        const schedules = (0, db_1.getAllSchedules)();
        if ((await schedules).length > 0) {
            return schedules;
        }
        return [];
    }
}
exports.LimitOrder = LimitOrder;
