Skip to content

Commit

Permalink
Merge pull request #822 from odisha-muktasoft/PRIVACY-MERGE
Browse files Browse the repository at this point in the history
Privacy merge
  • Loading branch information
Tulika-eGov authored Dec 10, 2024
2 parents 80058a2 + 337d3ca commit ea63cac
Show file tree
Hide file tree
Showing 25 changed files with 164 additions and 126 deletions.
9 changes: 6 additions & 3 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
"scripts": {
"start": "react-scripts start"
},
"resolutions": {
"**/@babel/traverse":"7.25.9"
},
"devDependencies": {
"@egovernments/digit-ui-react-components": "1.5.12",
"@egovernments/digit-ui-components": "0.0.2-beta.47",
"@egovernments/digit-ui-libraries": "1.5.0",
"@egovernments/digit-ui-module-core": "1.8.2-beta.25",
"@egovernments/digit-ui-module-hrms": "1.5.26",
"@egovernments/digit-ui-module-dss": "1.5.52",
"@egovernments/digit-ui-module-attendencemgmt": "0.4.15",
"@egovernments/digit-ui-module-attendencemgmt": "0.4.16",
"@egovernments/digit-ui-module-contracts": "0.4.15",
"@egovernments/digit-ui-module-measurement":"0.2.22",
"@egovernments/digit-ui-module-estimate": "0.4.22",
"@egovernments/digit-ui-module-masters": "0.4.23",
"@egovernments/digit-ui-module-masters": "0.4.26",
"@egovernments/digit-ui-module-project": "0.4.17",
"@egovernments/digit-ui-module-expenditure": "0.4.29",
"@egovernments/digit-ui-module-expenditure": "0.4.30",
"@egovernments/digit-ui-customisation-mukta": "0.2.14",
"@egovernments/digit-ui-module-rate-analysis": "0.4.16",
"http-proxy-middleware": "^1.0.5",
Expand Down
3 changes: 3 additions & 0 deletions frontend/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"lint-staged": {
"*.{js,css,md}": "prettier --write"
},
"resolutions": {
"**/@babel/traverse":"7.25.9"
},
"dependencies": {
"react-google-recaptcha": "^3.1.0",
"lodash": "^4.17.21",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ export const UICustomizations = {
case "MASTERS_ADDRESS":
return value ? (
<span style={{ whiteSpace: "break-spaces" }}>
{String(`${t(Digit.Utils.locale.getCityLocale(row?.tenantId))} ${t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId))}`)}
{String(`${t(Digit.Utils.locale.getCityLocale(row?.tenantId))}, ${t(Digit.Utils.locale.getMohallaLocale(value, row?.tenantId))}`)}
</span>
) : (
t("ES_COMMON_NA")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-works-css",
"version": "0.2.57",
"version": "0.2.58",
"license": "MIT",
"author": "Jagankumar <[email protected]>",
"main": "dist/index.css",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@
}
}

.loginFormStyleEmployee .loginCardClassName div:nth-child(7) {
margin-top: 0 !important;
}

.topbar .left .employee-select-wrap .options-card {
right: -3rem !important
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
.search-field-wrapper.search.custom-both-clear-search{
.search-button-wrapper.search {
grid-column: initial;

}
.search-button-wrapper.search.customIndSearchButton {
grid-column: 4;

}
.search-button-wrapper{
.link-label{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const Urls = {

wageseeker: {
create: "/individual/v1/_create",
search: "/individual/v1/_search",
search: "/mukta-services/individual/v1/_search",
wmssearch: "/wms/individual/_search",
update: "/individual/v1/_update",
delete: "/individual/v1/_delete",
Expand All @@ -257,14 +257,15 @@ const Urls = {
},

organisation: {
search: "/org-services/organisation/v1/_search",
search: "/mukta-services/org-services/organisation/v1/_search",
create: "/org-services/organisation/v1/_create",
update: "/org-services/organisation/v1/_update",
},

bankaccount: {
create: "/bankaccount-service/bankaccount/v1/_create",
search: "/bankaccount-service/bankaccount/v1/_search",
//changed here for privacy
search: "/mukta-services/bankaccount/v1/_search",
update: "/bankaccount-service/bankaccount/v1/_update",
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import AttendanceService from "../../elements/Attendance";
import { WageSeekerService } from "../../elements/WageSeeker";
import { WorksService } from "../../elements/Works";

const attendanceTypes = {
Expand Down Expand Up @@ -41,27 +42,29 @@ const getWeekAttendance = (data) => {
return weekAttendance
}

const getAttendanceTableData = async(data, skills, t, expenseCalculations) => {
const getAttendanceTableData = async(data, skills, t, expenseCalculations, indResponse) => {
let individuals = indResponse?.Individual;
let tableData = {}
if(data?.individualEntries?.length > 0) {
data?.individualEntries.filter((ob) => ob?.attendanceEntries !== null)?.forEach((item, index) => {
let tableRow = {}
let individualdata = individuals?.filter((ob) => ob?.individualId === item?.additionalDetails?.userId)?.[0]
tableRow.id = item.id
tableRow.sno = index + 1
tableRow.registerId = item?.additionalDetails?.userId || t("NA")
tableRow.registerId = {isLink:true, label:individualdata?.individualId, to:`/works-ui/employee/masters/view-wageseeker?tenantId=${individualdata?.tenantId}&individualId=${individualdata?.individualId}`} || t("NA")
tableRow.actualWorkingDays = item?.actualTotalAttendance || 0
tableRow.nameOfIndividual = item?.additionalDetails?.userName || t("NA")
tableRow.guardianName = item?.additionalDetails?.fatherName || t("NA")
tableRow.nameOfIndividual = individualdata?.name?.givenName || t("NA")
tableRow.guardianName = individualdata?.fatherName || t("NA")
const skill = skills[item?.additionalDetails?.skillCode]
tableRow.skill = skill ? `${t(skill.sorSubType)} - ${skill.description}` : t("NA");
tableRow.amount = skills[item?.additionalDetails?.skillCode]?.amount * item?.actualTotalAttendance || 0
tableRow.modifiedAmount = expenseCalculations?.filter(data=>data?.payee?.identifier === item?.individualId)?.[0]?.lineItems?.[0]?.amount || 0;
tableRow.modifiedWorkingDays = item?.modifiedTotalAttendance ? item?.modifiedTotalAttendance : item?.actualTotalAttendance
tableRow.bankAccountDetails = {
accountNo : item?.additionalDetails?.bankDetails || t("NA"),
ifscCode : null
}
tableRow.aadharNumber = item?.additionalDetails?.aadharNumber || t("NA")
// tableRow.bankAccountDetails = {
// accountNo : item?.additionalDetails?.bankDetails || t("NA"),
// ifscCode : null
// }
// tableRow.aadharNumber = item?.additionalDetails?.aadharNumber || t("NA")
tableRow.attendence = getWeekAttendance(item?.attendanceEntries)
tableRow.perDayWage = skills[item?.additionalDetails?.skillCode]?.rates?.rate || 0
tableData[item.id] = tableRow
Expand All @@ -88,7 +91,7 @@ const getAttendanceTableData = async(data, skills, t, expenseCalculations) => {
return tableData
}

const transformViewDataToApplicationDetails = async (t, data, skills) => {
const transformViewDataToApplicationDetails = async (t, data, skills, indResponse) => {

const expenseCalculatorPayload = {
criteria : {
Expand All @@ -103,7 +106,7 @@ const transformViewDataToApplicationDetails = async (t, data, skills) => {
if(data?.musterRolls?.length === 0) throw new Error('No data found');

const musterRoll = data.musterRolls[0]
const attendanceTableData = await getAttendanceTableData(musterRoll, skills, t, expenseCalculations)
const attendanceTableData = await getAttendanceTableData(musterRoll, skills, t, expenseCalculations, indResponse)

const totalAmount = expenseCalculationsResponse?.calculation?.totalAmount;
const weekDates = getWeekDates(musterRoll)
Expand Down Expand Up @@ -206,9 +209,19 @@ export const fetchAttendanceDetails = async (t, tenantId, searchParams) => {
try {
const response = await AttendanceService.search(tenantId, searchParams);
// const workflowDetails = await workflowDataDetails(tenantId, searchParams.musterRollNumber);
let IndsToSearch = response?.musterRolls?.[0].individualEntries.map((ob) => ob?.individualId)

let indPayload =IndsToSearch?.length!==0 ? {
Individual:{
id:IndsToSearch
}
} : null

const indResponse = await WageSeekerService.search(tenantId, indPayload, {tenantId,offset:0,limit:100});

const skills = await getWageSeekerSkills(response)

return transformViewDataToApplicationDetails(t, response, skills)
return transformViewDataToApplicationDetails(t, response, skills, indResponse)
} catch (error) {
throw new Error(error?.response?.data?.Errors[0].message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import BillingService from "../../../elements/Bill";
import { ContractService } from "../../../elements/Contracts";
import AttendanceService from "../../../elements/Attendance";
import { WageSeekerService } from "../../../elements/WageSeeker";

const getBeneficiaryData = async (wageBillDetails, tenantId, musterRoll, t) => {
const getBeneficiaryData = async (wageBillDetails, tenantId, musterRoll, t, indResponse) => {
let tableData = {}
const individuals = musterRoll?.individualEntries
const individuals = indResponse?.Individual
if(wageBillDetails?.length > 0) {
wageBillDetails?.forEach((item, index) => {
let tableRow = {}
const individual = individuals?.find(ind => ind?.individualId === item?.payee?.identifier)
const individual = individuals?.find(ind => ind?.id === item?.payee?.identifier)
tableRow.id = item?.id
tableRow.sno = index + 1
tableRow.registerId = individual?.additionalDetails?.userId || t("NA")
tableRow.nameOfIndividual = individual?.additionalDetails?.userName || t("NA")
tableRow.guardianName = individual?.additionalDetails?.fatherName || t("NA")
//tableRow.registerId = individual?.individualId || t("NA")
tableRow.registerId = {to:`/works-ui/employee/masters/view-wageseeker?tenantId=${tenantId}&individualId=${individual?.individualId}`, label:individual?.individualId, isLink:true}
tableRow.nameOfIndividual = individual?.name?.givenName || t("NA")
tableRow.guardianName = individual?.fatherName || t("NA")
// tableRow.amount = item?.payableLineItems?.[0]?.amount || 0 //check if correct(add all payable here)
tableRow.amount = item?.payableLineItems?.reduce((acc,item)=>{
if(item?.type==="PAYABLE") return acc + item.amount
return acc
},0) || 0 //check if correct(add all payable here)
tableRow.bankAccountDetails = {
accountNo : individual?.additionalDetails?.bankDetails || t("NA"),
ifscCode : null
}
// tableRow.bankAccountDetails = {
// accountNo : individual?.additionalDetails?.bankDetails || t("NA"),
// ifscCode : null
// }
//update this id
tableData[item.id] = tableRow
});
Expand All @@ -35,7 +37,7 @@ const getBeneficiaryData = async (wageBillDetails, tenantId, musterRoll, t) => {
totalRow.nameOfIndividual = "DNR"
totalRow.guardianName = "DNR"
totalRow.amount = 0
totalRow.bankAccountDetails = ""
//totalRow.bankAccountDetails = ""

tableData['total'] = totalRow
}
Expand Down Expand Up @@ -70,8 +72,18 @@ const transformViewDataToApplicationDetails = async (t, data, tenantId) => {
//get muster details
const musterRes = await AttendanceService.search(tenantId, { musterRollNumber: musterRollNum });
const musterRoll = musterRes?.musterRolls?.[0]

let IndsToSearch = musterRes?.musterRolls?.[0].individualEntries.map((ob) => ob?.individualId)

let indPayload =IndsToSearch?.length!==0 ? {
Individual:{
id:IndsToSearch
}
} : null

const indResponse = await WageSeekerService.search(tenantId, indPayload, {tenantId,offset:0,limit:100});

const beneficiaryData = await getBeneficiaryData(wageBill?.billDetails, tenantId, musterRoll, t)
const beneficiaryData = await getBeneficiaryData(wageBill?.billDetails, tenantId, musterRoll, t, indResponse)

const billDetails = {
title: " ",
Expand All @@ -90,7 +102,7 @@ const transformViewDataToApplicationDetails = async (t, data, tenantId) => {
title: "EXP_BENEFICIARY_DETAILS",
asSectionHeader: true,
values: [
{ title: "ES_COMMON_MUSTER_ROLL_ID", value: musterRollNum || t("ES_COMMON_NA")},
{ title: "ES_COMMON_MUSTER_ROLL_ID", value: musterRollNum || t("ES_COMMON_NA"), isLink : true, to : `/works-ui/employee/attendencemgmt/view-attendance?tenantId=${tenantId}&musterRollNumber=${musterRollNum}`},
{ title: "ES_COMMON_MUSTER_ROLL_PERIOD", value: `${Digit.DateUtils.ConvertTimestampToDate(musterRoll?.startDate, 'dd/MM/yyyy')} - ${Digit.DateUtils.ConvertTimestampToDate(musterRoll?.endDate, 'dd/MM/yyyy')}` || t("ES_COMMON_NA") }
],
additionalDetails : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ const transformViewDataToApplicationDetails = async (t, data, tenantId) => {
const PAN = organisation?.identifiers?.find(item => item?.isActive && item?.type === 'PAN' )
const GSTIN = organisation?.identifiers?.find(item => item?.isActive && item?.type === 'GSTIN')

const getAddressMasked = (value) => {
return value.replace(/(?<=.{1})./g, '*');
}
const orgDetails = [
{
title: '',
Expand Down Expand Up @@ -43,8 +46,8 @@ const transformViewDataToApplicationDetails = async (t, data, tenantId) => {
asSectionHeader: true,
values: [
{ title: "CORE_COMMON_PROFILE_CITY", value: organisation?.orgAddress?.[0]?.tenantId ? Digit.Utils.locale.getCityLocale(organisation?.orgAddress?.[0]?.tenantId) : t("NA")},
{ title: "COMMON_WARD", value: organisation?.orgAddress?.[0]?.boundaryCode ? Digit.Utils.locale.getMohallaLocale(organisation?.orgAddress?.[0]?.boundaryCode, tenantId) : t("NA")},
{ title: "COMMON_LOCALITY", value: organisation?.additionalDetails?.locality ? Digit.Utils.locale.getMohallaLocale(organisation?.additionalDetails?.locality, tenantId) : t("NA")},
{ title: "COMMON_WARD", value: organisation?.orgAddress?.[0]?.boundaryCode ? ( organisation?.orgAddress?.[0]?.geoLocation?.additionalDetails?.isWardMasked ? getAddressMasked(t(Digit.Utils.locale.getMohallaLocale(organisation?.orgAddress?.[0]?.boundaryCode, tenantId))) : Digit.Utils.locale.getMohallaLocale(organisation?.orgAddress?.[0]?.boundaryCode, tenantId)) : t("NA")},
{ title: "COMMON_LOCALITY", value: organisation?.additionalDetails?.locality ? ( organisation?.additionalDetails?.isLocalityMasked ? getAddressMasked(t(Digit.Utils.locale.getMohallaLocale(organisation?.additionalDetails?.locality, tenantId))) : Digit.Utils.locale.getMohallaLocale(organisation?.additionalDetails?.locality, tenantId)) : t("NA")},
{ title: "ES_COMMON_STREET", value: organisation?.orgAddress?.[0]?.street || t("NA")},
{ title: "ES_COMMON_DOOR_NO", value: organisation?.orgAddress?.[0]?.doorNo || t("NA")},
]
Expand Down
Loading

0 comments on commit ea63cac

Please sign in to comment.