Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #832 from egovernments/pay-gov-merge
Browse files Browse the repository at this point in the history
Pay gov merge
  • Loading branch information
pradeepkumarcm-egov authored Jul 1, 2024
2 parents 80149e1 + 093e8c4 commit a07d179
Show file tree
Hide file tree
Showing 29 changed files with 2,039 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ class _ExpenseDetailsState extends State<ExpenseDetails> {
fontSize: 19,
color: expensesDetailsProvider
.expenditureDetails
.allowEdit ==
.allowEdit ==
true && expensesDetailsProvider.expenditureDetails.isBillPaid == false
? Colors.black
: Colors.grey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@egovernments/digit-ui-libraries":"^1.4.0",
"@egovernments/digit-ui-module-common":"^1.4.0",
"@egovernments/digit-ui-module-engagement":"^1.4.0",
"@egovernments/digit-ui-module-payment":"0.0.2",
"@egovernments/digit-ui-module-fsm":"^1.4.0",
"@egovernments/digit-ui-module-mcollect":"^1.4.0",
"@egovernments/digit-ui-module-noc":"^1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@egovernments/digit-ui-module-core": "1.5.46",
"@egovernments/digit-ui-module-hrms": "1.5.27",
"@egovernments/digit-ui-module-pgr": "1.7.0",
"@egovernments/digit-ui-module-payment":"0.0.8",
"@egovernments/digit-ui-module-engagement": "1.5.20",
"@egovernments/digit-ui-react-components": "1.5.26",
"http-proxy-middleware": "^1.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>mGramSeva</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />

<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,152 @@ export const UICustomizations = {
}
}
},
OpenPaymentSearch:{
preProcess: (data, additionalDetails) => {

//we need to get three things -> consumerCode,businessService,tenantId
// businessService and tenantId can be either in queryParams or in form
let {consumerCode,businessService,tenantId} = data?.state?.searchForm || {};
businessService = businessService?.code
tenantId = tenantId?.[0]?.code
if(!businessService){
businessService = additionalDetails?.queryParams?.businessService
}
if(!tenantId){
tenantId = additionalDetails?.queryParams?.tenantId
}
const finalParams = {
// consumerCode,
tenantId,
businessService,
textSearch:consumerCode
}
data.params = finalParams
// data.params.textSearch = finalParams.consumerCode
// const tenantId = Digit.ULBService.getCurrentTenantId();
// data.body = { RequestInfo: data.body.RequestInfo };
// const { limit, offset } = data?.state?.tableForm || {};
// const { campaignName, campaignType } = data?.state?.searchForm || {};
// data.body.CampaignDetails = {
// tenantId: tenantId,
// status: ["failed"],
// createdBy: Digit.UserService.getUser().info.uuid,
// pagination: {
// sortBy: "createdTime",
// sortOrder: "desc",
// limit: limit,
// offset: offset,
// },
// };
// if (campaignName) {
// data.body.CampaignDetails.campaignName = campaignName;
// }
// if (campaignType) {
// data.body.CampaignDetails.projectType = campaignType?.[0]?.code;
// }
delete data.body.custom;
delete data.body.pagination;
data.options = {
userService:false,
auth:false
}
// delete data.body.inbox;
// delete data.params;
return data;
},
additionalCustomizations: (row, key, column, value, t, searchResult) => {

switch (key) {
case "OP_CONS_CODE":
return <span className="link">
<Link
to={`/${window.contextPath}/citizen/payment/open-view?tenantId=${row.tenantId}&businessService=WS&consumerCode=${row.connectionNo}`}
>
{String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))}
</Link>
</span>

case "OP_APPLICATION_TYPE":
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_APPLICATION_TYPE_${value}`)) : t("ES_COMMON_NA")}
</div>

case "OP_APPLICATION_STATUS":
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_APPLICATION_STATUS_${value}`)) : t("ES_COMMON_NA")}
</div>
case "OP_CONNECTION_TYPE":
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_CONNECTION_TYPE_${value}`)) : t("ES_COMMON_NA")}
</div>
case "OP_METER_INSTALLATION_DATE":
return <div>
{value ? Digit.DateUtils.ConvertEpochToDate(value) : t("ES_COMMON_NA")}
</div>
case "OP_METER_READING_DATE":
return <div>
{value ? Digit.DateUtils.ConvertEpochToDate(value) : t("ES_COMMON_NA")}
</div>
case "OP_PROPERTY_TYPE":
return <div>
{ value ? t(Digit.Utils.locale.getTransformedLocale(`OP_PROPERTY_TYPE_${value}`)) : t("ES_COMMON_NA")}
</div>


default:
return <span>{t("ES_COMMON_DEFAULT_NA")}</span>
}
if (key === "OP_BILL_DATE") {
return Digit.DateUtils.ConvertEpochToDate(value);
}

if(key === "OP_BILL_TOTAL_AMT"){
return <span>{`₹ ${value}`}</span>
}

if(key === "OP_CONS_CODE") {
return <span className="link">
<Link
to={`/${window.contextPath}/citizen/payment/open-view?tenantId=${row.tenantId}&businessService=${row.businessService}&consumerCode=${row.consumerCode}`}
>
{String(value ? (column.translate ? t(column.prefix ? `${column.prefix}${value}` : value) : value) : t("ES_COMMON_NA"))}
</Link>
</span>
}
},
populateReqCriteria: () => {
const tenantId = Digit.ULBService.getCurrentTenantId();
return {
url: "/mdms-v2/v1/_search",
params: { tenantId },
body: {
MdmsCriteria: {
tenantId,
moduleDetails: [
{
moduleName: "tenant",
masterDetails: [
{
name: "tenants",
},
],
},
],
},
},
config: {
enabled: true,
select: (data) => {
const result = data?.MdmsRes?.tenant?.tenants?.filter(row => row?.divisionCode && row?.divisionName)?.map(row => {
return {
...row,
updatedCode:`${row.divisionName} - ${row?.name}`
}
});
return result;
},
},
};
},
}
};
3 changes: 3 additions & 0 deletions frontend/micro-ui/web/micro-ui-internals/example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { initDSSComponents } from "@egovernments/digit-ui-module-dss";
import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement";
import { initHRMSComponents } from "@egovernments/digit-ui-module-hrms";
import { initPGRComponents, PGRReducers } from "@egovernments/digit-ui-module-pgr";
import {initPaymentComponents} from "@egovernments/digit-ui-module-payment";
import "@egovernments/digit-ui-css/example/index.css";

import { pgrCustomizations } from "./pgr";
Expand All @@ -18,6 +19,7 @@ const enabledModules = [
"DSS",
"HRMS",
"PGR",
"Payment"
// "Engagement", "NDSS","QuickPayLinks", "Payment",
// "Utilities",
//added to check fsm
Expand Down Expand Up @@ -63,6 +65,7 @@ const initDigitUI = () => {
initHRMSComponents();
initEngagementComponents();
initPGRComponents();
initPaymentComponents();

const moduleReducers = (initData) => ({
pgr: PGRReducers(initData),
Expand Down
2 changes: 2 additions & 0 deletions frontend/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dev:components": "cd packages/react-components && yarn start",
"dev:pgr": "cd packages/modules/pgr && yarn start",
"dev:hrms": "cd packages/modules/hrms && yarn start",
"dev:payment": "cd packages/modules/payment && yarn start",
"dev:core": "cd packages/modules/core && yarn start",
"dev:example": "cd example && yarn start",
"build": "run-p build:**",
Expand All @@ -35,6 +36,7 @@
"build:pgr": "cd packages/modules/pgr && yarn build",
"build:hrms": "cd packages/modules/hrms && yarn build",
"build:core": "cd packages/modules/core && yarn build",
"build:payment": "cd packages/modules/payment && yarn build",
"build:sample": "cd packages/modules/sample && yarn build",
"deploy:jenkins": "./scripts/jenkins.sh",
"clean": "rm -rf node_modules"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ export const useFetchPayment = ({ tenantId, consumerCode, businessService }, con
};
};

export const usePaymentUpdate = ({ egId }, businessService, config) => {
export const usePaymentUpdate = ({ egId }, businessService, config,auth=true,userService=true) => {
const getPaymentData = async (egId) => {
const transaction = await Digit.PaymentService.updateCitizenReciept(egId);
const transaction = await Digit.PaymentService.updateCitizenReciept(egId,auth,userService);
const payments = await Digit.PaymentService.getReciept(transaction.Transaction[0].tenantId, businessService, {
consumerCodes: transaction.Transaction[0].consumerCode,
});
},auth,userService);
return { payments, applicationNo: transaction.Transaction[0].consumerCode, txnStatus: transaction.Transaction[0].txnStatus };
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import { CustomService } from "../services/elements/CustomService";
*/


const useCustomAPIHook = ({ url, params, body, config = {}, plainAccessRequest,changeQueryName="Random" }) => {
const useCustomAPIHook = ({ url, params, body, config = {}, plainAccessRequest,changeQueryName="Random",options={} }) => {
const client = useQueryClient();

const { isLoading, data, isFetching } = useQuery(
[url,changeQueryName].filter((e) => e),
() => CustomService.getResponse({ url, params, body, plainAccessRequest }),
() => CustomService.getResponse({ url, params, body, plainAccessRequest,...options }),
{
cacheTime:0,
...config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Request = async ({
headers = {},
useCache = false,
params = {},
auth,
auth=true,
urlParams = {},
userService,
locale = true,
Expand All @@ -74,7 +74,7 @@ export const Request = async ({
data.RequestInfo = {
apiId: "Rainmaker",
};
if (auth || !!Digit.UserService.getUser()?.access_token) {
if (auth) {
data.RequestInfo = { ...data.RequestInfo, ...requestInfo() };
}
if (userService) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Request } from "../atoms/Utils/Request";

export const CustomService = {
getResponse: ({ url, params, body, plainAccessRequest,useCache=true,userService=true,setTimeParam=true ,userDownload=false}) =>
getResponse: ({ url, params, body, plainAccessRequest,useCache=true,userService=true,setTimeParam=true,userDownload=false,auth=true}) =>
Request({
url: url,
data: body,
useCache,
userService,
method: "POST",
auth: true,
auth: auth,
params: params,
plainAccessRequest: plainAccessRequest,
userDownload:userDownload,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ export const PaymentService = {
data: { ...details },
}),

getReciept: (tenantId, businessservice, filters = {}) =>
getReciept: (tenantId, businessservice, filters = {},auth=true,userService=true) =>
Request({
url:
businessservice && businessservice !== "BPAREG"
? `${Urls.payment.print_reciept}/${businessservice}/_search`
: `${Urls.payment.print_reciept}/_search`,
useCache: false,
method: "POST",
auth: true,
userService: true,
auth,
userService,
params: { tenantId, ...filters },
}),

Expand Down Expand Up @@ -95,13 +95,13 @@ export const PaymentService = {
data: { ...details },
}),

updateCitizenReciept: (transactionId) =>
updateCitizenReciept: (transactionId,auth=true,userService=true) =>
Request({
url: Urls.payment.update_citizen_reciept,
useCache: false,
method: "POST",
auth: true,
userService: true,
auth,
userService,
params: { transactionId },
}),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const sidebarHiddenFor = [
`/${window?.contextPath}/citizen/select-location`,
`/${window?.contextPath}/citizen/login`,
`/${window?.contextPath}/citizen/register/otp`,
`/citizen/payment/`,
];

const getTenants = (codes, tenants) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const EmployeeApp = ({ path, url, userType }) => {
</Link>{" "}
/ <span>{location.pathname === `/${window?.contextPath}/employee/hrms/inbox` ? t("HR_COMMON_HEADER") : t("HR_COMMON_HEADER")}</span>
</p>
<div class="back-btn2 " onClick={() => history.goBack()}><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="19px"><path d="M24 0v24H0V0h24z" fill="none" opacity=".87"></path><path d="M14 7l-5 5 5 5V7z"></path></svg><p>Back</p></div>
<div class="back-btn2 " onClick={() => history.goBack()}><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="19px"><path d="M24 0v24H0V0h24z" fill="none" opacity=".87"></path><path d="M14 7l-5 5 5 5V7z"></path></svg><p>Back</p></div>
<PrivateRoute
path={`${path}/inbox`}
component={() => (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@egovernments/digit-ui-module-payment",
"version": "0.0.8",
"description": "Open Payments",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/Module.js",
"files": [
"dist"
],
"scripts": {
"start": "microbundle-crl watch --no-compress --format modern,cjs",
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
"prepublish": "yarn build"
},
"peerDependencies": {
"react": "17.0.2",
"react-router-dom": "5.3.0"
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.2-beta.4",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.3.0",
"jquery": "3.6.0"
},
"author": "JaganKumar <[email protected]>",
"license": "MIT",
"keywords": [

]
}
Loading

0 comments on commit a07d179

Please sign in to comment.