Compare commits

...

9 Commits

Author SHA1 Message Date
victorAnumudu 7a42cd5c65 account view subscription table added 2025-09-28 06:54:04 +01:00
CHIEFSOFT\ameye b26df44c19 Details pages 2025-09-27 16:47:13 -04:00
CHIEFSOFT\ameye 2a92649eec Adding Customer page details 2025-09-27 14:02:30 -04:00
ameye 52193f0baa Merge branch 'custom-template-fix' of MERMS/MermsFirstOffice into master 2025-09-23 16:19:26 +00:00
victorAnumudu a118adac65 fixed custom endpoint data 2025-09-23 17:16:31 +01:00
CHIEFSOFT\ameye de114904d2 remove spaces 2025-09-23 11:28:13 -04:00
ameye 82123bf254 Merge branch 'product-template-fix' of MERMS/MermsFirstOffice into master 2025-09-23 14:12:02 +00:00
victorAnumudu f70d39ab38 product template endpoint fixed 2025-09-22 17:17:54 +01:00
ameye 2b1c499cca Merge branch 'account-view-endpoint' of MERMS/MermsFirstOffice into master 2025-09-22 15:54:32 +00:00
13 changed files with 416 additions and 15 deletions
+1
View File
@@ -4,6 +4,7 @@ const RouteLinks = {
customerPage: '/customer',
accountDetails: '/account-view/*',
subscriptions: '/subscriptions',
subscriptionDetails: '/subscription-view/*',
billings: '/billings',
recentSignup: '/recent-signup',
loansPage: '/loans',
+2
View File
@@ -20,6 +20,7 @@ import TransactionDetailsPage from './pages/TransactionDetailsPage'
import AccountDetailsPage from "./pages/AccountDetailsPage";
import ProductTemplatePage from "./pages/ProductTemplatePage";
import CustomTemplatePage from "./pages/CustomTemplatePage"; // TRANSACTION DETAILS PAGE
import SubscriptionDetailViewPage from './pages/SubscriptionDetailViewPage' // SUBSCRIPTION DETAIL VIEW PAGE
// const Home = lazy(() => import('./pages/Home'));
@@ -41,6 +42,7 @@ export default function SiteRoutes() {
<Route path={RouteLinks.productTemplates} element={<ProductTemplatePage/>}/> {`*/PRODUCTS TEMPLATE PAGE*/`}
<Route path={RouteLinks.customTemplates} element={<CustomTemplatePage/>}/> {`*/CUSTOM TEMPLATES PAGE*/`}
<Route path={RouteLinks.subscriptionDetails} element={<SubscriptionDetailViewPage/>}/> {`*/SUBSCRIPTION DETAIL VIEW PAGE*/`}
<Route path={RouteLinks.loansPage} element={<LoansPage/>}/> {`*/LOANS PAGE*/`}
<Route path={RouteLinks.transaction_details_page}
@@ -0,0 +1,52 @@
export default function AccountProfileView() {
return <>
<div className="row" style={{paddingBottom:'20px'}}>
<div className="col-12 col-lg-12">
<div className="card card-statistics">
<div className="card-header">
<div className="card-heading">
<h4 className="card-title"><b>Account Profile</b></h4>
</div>
</div>
<div className="card-body">
<div className="table-responsive">
<table className="table table-hover mb-0" style={{width:'100%', backgroundColor: 'aliceblue', borderRadius: '10px'}}>
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</>
}
+17 -4
View File
@@ -7,6 +7,10 @@ import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
import RouteLinks from '../../RouteLinks'
import { getAccountView } from '../../services/siteServices'
import queryKeys from '../../services/queryKeys'
import CustomerAccountView from "./CustomerAccountView";
import AccountProfileView from "./AccountProfileView";
import CustomerSubscriptionsView from "./CustomerSubscriptionsView";
import CustomerPaymentsView from "./CustomerPaymentsView";
export default function AccountViewCom() {
@@ -32,9 +36,12 @@ export default function AccountViewCom() {
},
staleTime: 0 //0 mins
})
const accountsViewData = data?.data?.products // ACCOUNT VIEW DATA
const pagination = data?.data?.pagination
console.log('DATA', data?.data)
const accountsViewData = data?.data // ACCOUNT VIEW DATA
const account_info = accountsViewData?.account
const account_profile = accountsViewData?.account_profile
const subscriptions = accountsViewData?.subscriptions
const payments = accountsViewData?.payments
// console.log('DATA', payments, subscriptions)
return (
<div className='w-full flex flex-col gap-8'>
@@ -48,7 +55,13 @@ export default function AccountViewCom() {
: isError ?
<p className='text-red-500'>{error.message}</p>
:
<p className='text-slate-800'>coming soon</p>
<>
<CustomerAccountView accountInfo={account_info} />
<AccountProfileView />
<CustomerSubscriptionsView subscriptions={subscriptions} memberUID={memberUID} />
<CustomerPaymentsView payments={payments} />
</>
}
</div>
@@ -0,0 +1,93 @@
import {Link} from 'react-router-dom'
import Icons from "../Icons";
export default function CustomerAccountView({accountInfo}) {
return <>
<div className="pb-5">
<div className="flex flex-col gap-1">
<div className="w-full">
<h4 className="font-semibold text-lg">Account Info</h4>
</div>
<div className="w-full overflow-x-auto">
<>
<table className="py-2 w-full text-sm" style={{backgroundColor: 'aliceblue', borderRadius: '10px'}}>
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
#
</th>
<th scope="col" className="px-2">
Firstname
</th>
<th scope="col" className="px-2">
Lastname
</th>
<th scope="col" className="px-2">
Username
</th>
<th scope="col" className="px-2">
Email
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
{(accountInfo && Object.keys(accountInfo).length > 0) ?
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className="text-left">
<div className="text-base font-semibold">{1}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{accountInfo?.firstname}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{accountInfo?.lastname}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{accountInfo?.username}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{accountInfo?.email}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Link
// to={`/subscription-view/63554d40-9ba1-4afe-80c2-ca147236f7ee`}
>
<Icons name='eye'/>
</Link>
</div>
</div>
</td>
</tr>
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={6}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
</div>
</div>
</div>
</>
}
@@ -0,0 +1,69 @@
export default function CustomerPaymentsView({payments}) {
return <>
<div className="pb-5">
<div className="flex flex-col gap-1">
<div className="w-full">
<h4 className="font-semibold text-lg">Payments</h4>
</div>
<div className="w-full overflow-x-auto">
<>
<table className="py-2 w-full text-sm" style={{backgroundColor: 'aliceblue', borderRadius: '10px'}}>
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
#
</th>
<th scope="col" className="px-2">
First
</th>
<th scope="col" className="px-2">
Last
</th>
<th scope="col" className="px-2">
Handle
</th>
</tr>
</thead>
<tbody>
{(payments && payments.length > 0) ? payments?.map((item, index) => (
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className="text-left">
<div className="text-base font-semibold">{index+1}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.first}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.last}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.handle}</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={4}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
</div>
</div>
</div>
</>
}
@@ -0,0 +1,94 @@
import getDateTimeFromDateString from "../../helpers/getDateTimeFromDateString";
import RouteLinks from "../../RouteLinks";
import Icons from "../Icons";
import {Link} from 'react-router-dom'
export default function CustomerSubscriptionsView({subscriptions, memberUID}) {
return <>
<div className="pb-5">
<div className="flex flex-col gap-1">
<div className="w-full">
<h4 className="font-semibold text-lg">Subscriptions</h4>
</div>
<div className="w-full overflow-x-auto">
<>
<table className="py-2 w-full text-sm" style={{backgroundColor: 'aliceblue', borderRadius: '10px'}}>
<thead className="py-2 text-sm text-slate-500 text-left">
<tr>
<th scope="col" className="px-2 py-2">
#
</th>
<th scope="col" className="px-2">
Added
</th>
<th scope="col" className="px-2">
Product
</th>
<th scope="col" className="px-2">
URL
</th>
<th scope="col" className="px-2">
Status
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
{(subscriptions && subscriptions.length > 0) ? subscriptions?.map((item, index) => (
<tr key={index} className="py-2 border-t border-dashed border-slate-300">
<td className="px-2 py-2">
<div className="text-left">
<div className="text-base font-semibold">{index+1}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.product_id}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.internal_url}</div>
</div>
</td>
<td className="px-2">
<div className="text-right">
<div className="text-base font-semibold">{item?.status}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Link to={`/subscription-view/${memberUID}`} state={{customerID: item?.id, memberUID}}>
<Icons name='eye'/>
</Link>
</div>
</div>
</td>
</tr>
))
:
<tr className="py-2 border-t border-dashed border-slate-300">
<td className="px-3 py-2" colSpan={6}>
<div className="flex justify-center items-center">
No Record Found
</div>
</td>
</tr>
}
</tbody>
</table>
</>
</div>
</div>
</div>
</>
}
+3 -3
View File
@@ -43,7 +43,7 @@ export default function CustomTemplates() {
},
staleTime: 0 //0 mins
})
const customTemData = data?.data?.products // CUSTOM TEMPLATE LIST
const customTemData = data?.data?.templates // CUSTOM TEMPLATE LIST
const pagination = data?.data?.pagination
// console.log('DATA', data?.data)
@@ -104,12 +104,12 @@ export default function CustomTemplates() {
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.name}</div>
<div className="text-base font-semibold">{item?.custom_id}</div>
</div>
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.product_id}</div>
<div className="text-base font-semibold">{item?.provision_name}</div>
</div>
</td>
<td className="px-2">
+4 -4
View File
@@ -6,7 +6,7 @@ import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
import TablePaginatedWrapper from '../tableWrapper/TablePaginatedWrapper'
import Icons from '../Icons'
import { getProductsTemplate } from '../../services/siteServices'
import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
// import getDateTimeFromDateString from '../../helpers/getDateTimeFromDateString'
export default function ProductTemplates() {
@@ -43,7 +43,7 @@ export default function ProductTemplates() {
},
staleTime: 0 //0 mins
})
const productsTemData = data?.data?.products // PRODUCTS TEMPLATE LIST
const productsTemData = data?.data?.templates // PRODUCTS TEMPLATE LIST
const pagination = data?.data?.pagination
// console.log('DATA', data?.data)
@@ -98,7 +98,7 @@ export default function ProductTemplates() {
<td className="px-2 py-2">
<div className='w-full min-w-48 flex items-center gap-2 whitespace-nowrap'>
<div className="text-left">
<div className="text-base font-semibold">{getDateTimeFromDateString(item?.added)}</div>
<div className="text-base font-semibold">{item?.product_id}</div>
</div>
</div>
</td>
@@ -109,7 +109,7 @@ export default function ProductTemplates() {
</td>
<td className="px-2">
<div className="text-left">
<div className="text-base font-semibold">{item?.product_id}</div>
<div className="text-base font-semibold">{item?.provision_name}</div>
</div>
</td>
<td className="px-2">
@@ -0,0 +1,56 @@
import {useEffect, useState} from 'react'
import { useQuery } from '@tanstack/react-query'
import {useLocation, useNavigate, Link} from 'react-router-dom'
import BreadcrumbCom from '../breadcrumb/BreadcrumbCom'
import RouteLinks from '../../RouteLinks'
import { getAccountView } from '../../services/siteServices'
import queryKeys from '../../services/queryKeys'
export default function SubscriptionDetailViewCom() {
const {state:{memberUID}} = useLocation()
const navigate = useNavigate()
useEffect(()=>{
if(!memberUID){
navigate(`/account-view/${memberUID}`, {replace: true, state:{memberUID}})
}
},[])
const {data, isFetching, isError, error} = useQuery({
queryKey: queryKeys.account_view,
queryFn: () => {
// const filterData = filter?.type ? {[filter?.type]: filter.id} : {}
const reqData = {
member_uid: memberUID
// page,
// ...filterData
}
// return getAccountView(reqData)
},
staleTime: 0 //0 mins
})
const subscriptionViewData = data?.data // SUBSCRIPTION VIEW DATA
// console.log('DATA', payments, subscriptions)
return (
<div className='w-full flex flex-col gap-8'>
<BreadcrumbCom title={`Subscription View [${memberUID}]`} paths={['Dashboard', 'Subscription View']}/>
<div className='box bg-white dark:bg-black-box text-black-body dark:text-white-body'>
{isFetching ?
<>
<p className='text-slate-800'>Loading...</p>
</>
: isError ?
<p className='text-red-500'>{error.message}</p>
:
<p className='text-slate-800'>Coming soon</p>
}
</div>
</div>
)
}
@@ -1,4 +1,6 @@
import { useState } from 'react'
import {Link} from 'react-router-dom'
// import {Link} from 'react-router-dom'
import { useQuery } from '@tanstack/react-query'
import queryKeys from '../../services/queryKeys'
@@ -93,6 +95,9 @@ export default function SubscriptionsCom() {
<th scope="col" className="px-2 text-right">
Status
</th>
<th scope="col" className="px-2 text-right">
Action
</th>
</tr>
</thead>
<tbody>
@@ -122,6 +127,17 @@ export default function SubscriptionsCom() {
<div className="text-base font-semibold">{item?.status}</div>
</div>
</td>
<td className="px-2 text-right">
<div className='flex items-center justify-end gap-3 md:gap-4'>
<div
className='p-2 flex justify-center items-center text-slate-500 bg-white-body dark:text-white-body dark:bg-black-body rounded-md'>
<Link to={`/subscription-view/${item?.subscription_uid}`}
state={{customerID: item?.id, memberUID: item?.member_uid}}>
<Icons name='eye'/>
</Link>
</div>
</div>
</td>
</tr>
))
:
+7
View File
@@ -0,0 +1,7 @@
import React from 'react'
import SubscriptionDetailViewCom from "../components/subscription_view/SubscriptionDetailViewCom";
export default function SubscriptionDetailViewPage() {
return (
<SubscriptionDetailViewCom />
)
}
+2 -4
View File
@@ -101,13 +101,13 @@ export const getUsers = (reqData) => {
// FUNCTION TO GET PRODUCTS TEMPLATE DATA
export const getProductsTemplate = (reqData) => {
const postData = { ...reqData }
return getAuxEnd(`/products-template`, postData)
return getAuxEnd(`/products-templates`, postData)
}
// FUNCTION TO GET CUSTOM TEMPLATE DATA
export const getCustomTemplate = (reqData) => {
const postData = { ...reqData }
return getAuxEnd(`/custom-template`, postData)
return getAuxEnd(`/custom-templates`, postData)
}
// FUNCTION TO VIEW SELECTED ACCOUNT DATA
@@ -117,8 +117,6 @@ export const getAccountView = (reqData) => {
}
// FUNCTION TO GET LOANS TABLE
export const getLoans = (reqData) => {
const postData = { ...reqData }