// SPDX-License-Identifier: Apache-2.0
import { createFixture } from "../config";
import { HederaIdPropsFixture } from "../shared/DataFixture";
import { SecurityRole } from "../../../src/domain/context/security/SecurityRole";
export const GetRoleCountForQueryFixture = createFixture((query) => {
    query.securityId.as(() => HederaIdPropsFixture.create().value);
    query.targetId.as(() => HederaIdPropsFixture.create().value);
});
export const GetRoleMemberCountQueryFixture = createFixture((query) => {
    query.securityId.as(() => HederaIdPropsFixture.create().value);
    query.role.faker((faker) => faker.lorem.words());
});
export const GetRoleMembersQueryFixture = createFixture((query) => {
    query.securityId.as(() => 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 }));
});
export const GetRolesForQueryFixture = createFixture((query) => {
    query.securityId.as(() => HederaIdPropsFixture.create().value);
    query.targetId.as(() => 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 }));
});
export const HasRoleQueryFixture = createFixture((query) => {
    query.securityId.as(() => HederaIdPropsFixture.create().value);
    query.targetId.as(() => HederaIdPropsFixture.create().value);
    query.role.faker((faker) => faker.lorem.words());
});
export const RoleRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.targetId.as(() => HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole)));
});
export const GetRoleCountForRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.targetId.as(() => HederaIdPropsFixture.create().value);
});
export const GetRolesForRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.targetId.as(() => 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 }));
});
export const GetRoleMemberCountRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole)));
});
export const GetRoleMembersRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.role.faker((faker) => faker.helpers.arrayElement(Object.values(SecurityRole)));
    request.start.faker((faker) => faker.number.int({ min: 1, max: 10 }));
    request.end.faker((faker) => faker.number.int({ min: 1, max: 10 }));
});
export const ApplyRolesRequestFixture = createFixture((request) => {
    request.securityId.as(() => HederaIdPropsFixture.create().value);
    request.targetId.as(() => HederaIdPropsFixture.create().value);
    request.roles.faker((faker) => [faker.helpers.arrayElement(Object.values(SecurityRole))]);
    request.actives.faker((faker) => [faker.datatype.boolean()]);
});
export const ApplyRolesCommandFixture = createFixture((command) => {
    command.securityId.as(() => HederaIdPropsFixture.create().value);
    command.targetId.as(() => 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()));
});
export const GrantRoleCommandFixture = createFixture((command) => {
    command.securityId.as(() => HederaIdPropsFixture.create().value);
    command.targetId.as(() => HederaIdPropsFixture.create().value);
    command.role.faker((faker) => faker.string.hexadecimal({ length: 64, prefix: "0x", casing: "lower" }));
});
