import { Flags } from "@oclif/core";
import { MBSCommand } from "@mb-it-org/shared";
export default class OrgLittleLeaders extends MBSCommand {
    static description = "List little leaders / supervisors (主管下拉)";
    static flags = {
        company: Flags.string({ description: "Company ID (1=胤元, 33=启元)" }),
        platform: Flags.string({ description: "Platform ID" }),
        leaders: Flags.string({ description: "Leader IDs, comma-separated" }),
        managers: Flags.string({ description: "Manager IDs, comma-separated" }),
        type: Flags.string({ description: "Employee type: 1=sales, 2=dev" }),
        keyword: Flags.string({ description: "Search keyword" }),
    };
    async run() {
        const { flags } = await this.parse(OrgLittleLeaders);
        const buildArray = (val) => val?.split(",").map((v) => v.trim()) ?? [];
        const data = await this.client.post("/teamDropDown/littleManagerDropDown", {
            companyIds: flags.company ? [Number(flags.company)] : [],
            platformIds: buildArray(flags.platform),
            leaders: buildArray(flags.leaders),
            managers: buildArray(flags.managers),
            employeeType: flags.type,
            keyWord: flags.keyword ?? "",
        }, { pathPrefix: "/erpOrder/erpOrder" });
        this.output(data);
    }
}
//# sourceMappingURL=little-leaders.js.map