import {
  PrivilegeAdminConstant,
  PrivilegePOSConstant,
} from 'src/core/strings/constants/privilege.constants';

export class UserPrivilegeConfigurationHelper {
  static createConfigurations() {
    const privilege = [
      ...PrivilegeAdminConstant.map((item) => {
        return {
          ...item,
          module: 'ADMIN_PAGE',
          module_label: 'Admin Page',
        };
      }),
      ...PrivilegePOSConstant.map((item) => {
        return {
          ...item,
          module: 'POS',
          module_label: 'Point of Sales',
        };
      }),
    ];

    privilege?.forEach((item) => {
      item.actions?.forEach((element) => {
        item[element] = false;
      });
    });

    return privilege;
  }
}
