"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.GrantRoleCommandFixture = exports.ApplyRolesCommandFixture = exports.ApplyRolesRequestFixture = exports.GetRoleMembersRequestFixture = exports.GetRoleMemberCountRequestFixture = exports.GetRolesForRequestFixture = exports.GetRoleCountForRequestFixture = exports.RoleRequestFixture = exports.HasRoleQueryFixture = exports.GetRolesForQueryFixture = exports.GetRoleMembersQueryFixture = exports.GetRoleMemberCountQueryFixture = exports.GetRoleCountForQueryFixture = void 0;
const config_1 = require("../config");
const DataFixture_1 = require("../shared/DataFixture");
const SecurityRole_1 = require("../../../src/domain/context/security/SecurityRole");
exports.GetRoleCountForQueryFixture = (0, config_1.createFixture)((query) => {
    query.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
});
exports.GetRoleMemberCountQueryFixture = (0, config_1.createFixture)((query) => {
    query.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.role.faker((faker) => faker.lorem.words());
});
exports.GetRoleMembersQueryFixture = (0, config_1.createFixture)((query) => {
    query.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.role.faker((faker) => faker.lorem.words());
    query.start.faker((faker) => faker.number.int({ min: 1, max: 999 }));
    query.end.faker((faker) => faker.number.int({ min: 1, max: 999 }));
});
exports.GetRolesForQueryFixture = (0, config_1.createFixture)((query) => {
    query.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.start.faker((faker) => faker.number.int({ min: 1, max: 999 }));
    query.end.faker((faker) => faker.number.int({ min: 1, max: 999 }));
});
exports.HasRoleQueryFixture = (0, config_1.createFixture)((query) => {
    query.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    query.role.faker((faker) => faker.lorem.words());
});
exports.RoleRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole_1.SecurityRole)));
});
exports.GetRoleCountForRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
});
exports.GetRolesForRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.start.faker((faker) => faker.number.int({ min: 1, max: 10 }));
    request.end.faker((faker) => faker.number.int({ min: 1, max: 10 }));
});
exports.GetRoleMemberCountRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole_1.SecurityRole)));
});
exports.GetRoleMembersRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole_1.SecurityRole)));
    request.start.faker((faker) => faker.number.int({ min: 1, max: 10 }));
    request.end.faker((faker) => faker.number.int({ min: 1, max: 10 }));
});
exports.ApplyRolesRequestFixture = (0, config_1.createFixture)((request) => {
    request.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    request.roles.faker((faker) => [faker.helpers.arrayElement(Object.values(SecurityRole_1.SecurityRole))]);
    request.actives.faker((faker) => [faker.datatype.boolean()]);
});
exports.ApplyRolesCommandFixture = (0, config_1.createFixture)((command) => {
    command.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    command.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    command.roles.faker((faker) => Array.from({ length: 3 }, () => faker.string.hexadecimal({ length: 64, prefix: "0x", casing: "lower" })));
    command.actives.faker((faker) => Array.from({ length: 3 }, () => faker.datatype.boolean()));
});
exports.GrantRoleCommandFixture = (0, config_1.createFixture)((command) => {
    command.securityId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    command.targetId.as(() => DataFixture_1.HederaIdPropsFixture.create().value);
    command.role.faker((faker) => faker.string.hexadecimal({ length: 64, prefix: "0x", casing: "lower" }));
});
