"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CategorySeedService = void 0;
const common_1 = require("@nestjs/common");
const category_entity_1 = require("../../../category/entities/category.entity");
const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm");
let CategorySeedService = class CategorySeedService {
    constructor(categoryRepository) {
        this.categoryRepository = categoryRepository;
    }
    async run() {
        await this.categoryRepository.delete({});
        let i = 0;
        let categories = [
            {
                id: ++i,
                name: "Power supply",
                icon: { path: "https://cdn-icons-png.flaticon.com/128/6637/6637988.png" },
                subCategories: [
                    {
                        name: "Industrial computer",
                    },
                    {
                        name: "Industrial monitor",
                    },
                    {
                        name: "Industrial panel PC",
                    },
                    {
                        name: "Industrial tablet",
                    },
                ]
            },
            {
                id: ++i,
                name: "Robot",
                icon: { path: "https://cdn-icons-png.flaticon.com/128/1404/1404716.png" },
                subCategories: [
                    {
                        name: "Industrial robot",
                    },
                    {
                        name: "Robot controller",
                    },
                    {
                        name: "Robot gripper",
                    },
                    {
                        name: "Robot tool",
                    },
                ]
            },
            {
                name: "Sensor",
                icon: { path: "https://cdn-icons-png.flaticon.com/128/2540/2540142.png" },
                subCategories: [
                    {
                        name: "Flow sensor",
                    },
                    {
                        name: "Force sensor",
                    },
                    {
                        name: "Level sensor",
                    },
                    {
                        name: "Light sensor",
                    },
                    {
                        name: "Motion sensor",
                    },
                    {
                        name: "Position sensor",
                    },
                    {
                        name: "Pressure sensor",
                    },
                    {
                        name: "Proximity sensor",
                    },
                    {
                        name: "Temperature sensor",
                    },
                    {
                        name: "Vibration sensor",
                    },
                    {
                        name: "Vision sensor",
                    },
                ]
            },
            {
                name: "PLC",
                icon: { path: "https://cdn-icons-png.flaticon.com/128/7082/7082602.png" },
                subCategories: [
                    {
                        name: "PLC controller",
                    },
                    {
                        name: "PLC expansion module",
                    },
                    {
                        name: "PLC power supply",
                    },
                    {
                        name: "PLC programming cable",
                    },
                    {
                        name: "PLC rack",
                    },
                    {
                        name: "PLC software",
                    },
                ]
            },
            {
                name: "HMI",
                icon: { path: "https://static.thenounproject.com/png/5664890-200.png" },
                subCategories: [
                    {
                        name: "HMI cable",
                    },
                    {
                        name: "HMI panel",
                    },
                    {
                        name: "HMI programming cable",
                    },
                    {
                        name: "HMI software",
                    },
                ]
            },
            {
                name: "Servo motor",
                icon: { path: "https://cdn-icons-png.flaticon.com/128/2061/2061899.png" },
                subCategories: [
                    {
                        name: "Servo drive",
                    },
                    {
                        name: "Servo motor cable",
                    },
                    {
                        name: "Servo motor encoder",
                    },
                    {
                        name: "Servo motor power cable",
                    },
                    {
                        name: "Servo motor software",
                    },
                ]
            },
        ];
        categories = await this.categoryRepository.save(categories);
        console.log("categories seed completed.");
        return categories;
    }
};
exports.CategorySeedService = CategorySeedService;
exports.CategorySeedService = CategorySeedService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(category_entity_1.Category)),
    __metadata("design:paramtypes", [typeorm_2.Repository])
], CategorySeedService);
//# sourceMappingURL=category-seed.service.js.map