"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Board1558006512362 = void 0;
const board_service_1 = require("@things-factory/board-service");
const shell_1 = require("@things-factory/shell");
const SEED_BOARD = [];
class Board1558006512362 {
    async up(queryRunner) {
        const repository = (0, shell_1.getRepository)(board_service_1.Board);
        const domainRepository = (0, shell_1.getRepository)(shell_1.Domain);
        const domain = await domainRepository.findOneBy({ subdomain: 'system' });
        const groupRepository = (0, shell_1.getRepository)(board_service_1.Group);
        const group = await groupRepository.findOneBy({ name: 'SAMPLE' });
        return await Promise.all(SEED_BOARD.map(async (board) => {
            await repository.save({
                ...board,
                domain,
                group
            });
        }));
    }
    async down(queryRunner) {
        const repository = (0, shell_1.getRepository)(board_service_1.Board);
        return await Promise.all(SEED_BOARD.reverse().map(async (board) => {
            let record = await repository.findOneBy({ name: board.name });
            await repository.remove(record);
        }));
    }
}
exports.Board1558006512362 = Board1558006512362;
//# sourceMappingURL=1558006512362-SeedBoard.js.map