diff --git a/src/Components/Cards/AddressCard.tsx b/src/Components/Cards/AddressCard.tsx new file mode 100644 index 0000000..37adc58 --- /dev/null +++ b/src/Components/Cards/AddressCard.tsx @@ -0,0 +1,28 @@ +import { Divider } from 'antd' +import { useTranslation } from 'react-i18next' +import { RxHome } from "react-icons/rx"; + +const AddressCard = ({ data }: { data: any }) => { + const { t } = useTranslation(); + return ( +
+
{t("practical.address")}
+ +
+ {data?.map((address:any)=>( +
+ + +
{t(`practical.${address?.key}`)}
+

{address?.value}

+
+
+ ))} +
+
+ ) +} + +export default AddressCard + + diff --git a/src/Components/Cards/AttachmentsCard.tsx b/src/Components/Cards/AttachmentsCard.tsx new file mode 100644 index 0000000..ae35427 --- /dev/null +++ b/src/Components/Cards/AttachmentsCard.tsx @@ -0,0 +1,24 @@ +import { Divider } from 'antd'; +import { useTranslation } from 'react-i18next' +import ImageBoxField from '../CustomFields/ImageBoxField/ImageBoxField'; + +const AttachmentsCard = ({data}:{data?:any}) => { + const {t} = useTranslation(); + + return ( +
+
{t("practical.address")}
+ +
+
{t("practical.id_photo")}
+ {/* {data?.map((address:any)=>( */} + + + + {/* ))} */} +
+
+ ) +} + +export default AttachmentsCard \ No newline at end of file diff --git a/src/Components/Cards/InfoCard.tsx b/src/Components/Cards/InfoCard.tsx new file mode 100644 index 0000000..5267683 --- /dev/null +++ b/src/Components/Cards/InfoCard.tsx @@ -0,0 +1,39 @@ +import { Button, Divider } from 'antd' +import { useTranslation } from 'react-i18next' +import { canAddReSeller } from '../../utils/hasAbilityFn'; + +const InfoCard = ({ data, name, status,withButton = false,handleClick}:{ data:any, name:any, status:any,withButton?:boolean,handleClick?:() => void}) => { + const {t} = useTranslation(); + + return ( +
+
+ +
+ {status} +

{name}

+
+
+ +
+ {data?.map((student: any) => ( + +

{student?.key}

+

{student?.value}

+
+ ))} + {withButton ? + canAddReSeller && + + : ""} +
+ +
+ ) +} + +export default InfoCard + + diff --git a/src/Components/Cards/ParamInfo.ts b/src/Components/Cards/ParamInfo.ts new file mode 100644 index 0000000..542abbc --- /dev/null +++ b/src/Components/Cards/ParamInfo.ts @@ -0,0 +1,27 @@ +export const StudentParamInfo = [ + {key:"الحنس" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"} +] + +export const ReSellerParamInfo = [ + {key:"رقم الهوية" , value:"12i9128921019"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, +] + +export const StudentAddressInfo = [ + {key:"address" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, +] + +export const ReSellerAddressInfo = [ + {key:"governorate" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, + {key:"address" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, +] \ No newline at end of file diff --git a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx index 230058e..27b6787 100644 --- a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx +++ b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx @@ -10,7 +10,7 @@ import { generateImagePreview } from "./generateImagePreview"; const ImageBoxField = ({ name }: any) => { const formik = useFormikContext(); - const value = getNestedValue(formik.values, name); + const value = getNestedValue(formik?.values, name); const [imagePreview, setImagePreview] = useState(null); const fileInputRef = useRef(null); diff --git a/src/Components/student/AddressCard.tsx b/src/Components/student/AddressCard.tsx deleted file mode 100644 index 558a9aa..0000000 --- a/src/Components/student/AddressCard.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Divider } from 'antd' -import { useTranslation } from 'react-i18next' -import { RxHome } from "react-icons/rx"; - -const StudentAddressCard = ({address}:{address:string}) => { - const {t} = useTranslation(); - return ( -
-
{t("practical.address")}
- -
- - -
{t("practical.address")}
-

{address}

-
-
-
- ) -} - -export default StudentAddressCard - - diff --git a/src/Components/student/StudentInfoCard.tsx b/src/Components/student/StudentInfoCard.tsx deleted file mode 100644 index 238d48c..0000000 --- a/src/Components/student/StudentInfoCard.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react' -import { studentParamInfo } from './StudentParam' -import { Divider } from 'antd' - -const StudentInfoCard = ({data,name,status}:any) => { - return ( -
-
- -
- {status} -

{name}

-
-
- -
- {data?.map((student:any)=>( - -

{student?.key}

-

{student?.value}

-
- ))} -
-
- ) -} - -export default StudentInfoCard - - diff --git a/src/Components/student/StudentParam.ts b/src/Components/student/StudentParam.ts deleted file mode 100644 index 556fff7..0000000 --- a/src/Components/student/StudentParam.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const studentParamInfo = [ - {key:"الحنس" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"} -] \ No newline at end of file diff --git a/src/Pages/Admin/Reseller/Page.tsx b/src/Pages/Admin/Reseller/Page.tsx index fab96da..ee7d105 100644 --- a/src/Pages/Admin/Reseller/Page.tsx +++ b/src/Pages/Admin/Reseller/Page.tsx @@ -1,13 +1,9 @@ -import { FaPlus } from "react-icons/fa"; -import useModalHandler from "../../../utils/useModalHandler"; import { ModalEnum } from "../../../enums/Model"; import { useTranslation } from "react-i18next"; import { lazy, Suspense } from "react"; import { Spin } from "antd"; import { - canAddReport, canAddReSeller, - canAddTags, } from "../../../utils/hasAbilityFn"; import useSetPageTitle from "../../../Hooks/useSetPageTitle"; import { useDeleteTag } from "../../../api/tags"; diff --git a/src/Pages/Admin/Reseller/show/Model/AddModel.tsx b/src/Pages/Admin/Reseller/show/Model/AddModel.tsx new file mode 100644 index 0000000..18de414 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/AddModel.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { getInitialValues, getValidationSchema } from "./formUtil"; +import { ModalEnum } from "../../../../../enums/Model"; +import LayoutModel from "../../../../../Layout/Dashboard/LayoutModel"; +import { QueryStatusEnum } from "../../../../../enums/QueryStatus"; +import ModelForm from "./ModelForm"; +import { useAddReseller } from "../../../../../api/reseller"; + +const AddModel: React.FC = () => { + const { mutate, status } = useAddReseller(); + + const handleSubmit = (values: any) => { + mutate({ + ...values, + }); + }; + return ( + <> + + + + + ); +}; + +export default AddModel; diff --git a/src/Pages/Admin/Reseller/show/Model/EditModel.tsx b/src/Pages/Admin/Reseller/show/Model/EditModel.tsx new file mode 100644 index 0000000..f366fef --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/EditModel.tsx @@ -0,0 +1,36 @@ +import React from "react"; +import { getInitialValues, getValidationSchema } from "./formUtil"; +import { ModalEnum } from "../../../../../enums/Model"; +import LayoutModel from "../../../../../Layout/Dashboard/LayoutModel"; +import ModelForm from "./ModelForm"; +import { QueryStatusEnum } from "../../../../../enums/QueryStatus"; +import { useObjectToEdit } from "../../../../../zustand/ObjectToEditState"; +import { useUpdateReseller } from "../../../../../api/reseller"; + +const EditModel: React.FC = () => { + const { mutate, status } = useUpdateReseller(); + const { objectToEdit } = useObjectToEdit((state) => state); + + const handleSubmit = (values: any) => { + mutate({ + ...values, + }); + }; + return ( + <> + + + + + ); +}; + +export default EditModel; diff --git a/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx b/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx index e1925e4..ec00bd6 100644 --- a/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx +++ b/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx @@ -1,18 +1,13 @@ -import React from "react"; import ValidationField from "../../../../../Components/ValidationField/ValidationField"; import { Col, Row } from "reactstrap"; -import { userTypeOptions } from "../../../../../config/userTypeOptions"; const FilterForm = () => { return (
- - - - - + +
diff --git a/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx b/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx new file mode 100644 index 0000000..9440a8d --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx @@ -0,0 +1,17 @@ +import { Col, Row } from "reactstrap"; +import ValidationField from "../../../../../Components/ValidationField/ValidationField"; + +const Form = () => { + return ( + + + + + + + + + ); +}; + +export default Form; diff --git a/src/Pages/Admin/Reseller/show/Model/formUtil.ts b/src/Pages/Admin/Reseller/show/Model/formUtil.ts new file mode 100644 index 0000000..0f7ba00 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/formUtil.ts @@ -0,0 +1,19 @@ +import * as Yup from "yup"; +export const getInitialValues = (objectToEdit: any): any => { + return { + id: objectToEdit?.id ?? null, + amount_value: objectToEdit?.amount_value ?? null, + description: objectToEdit?.description ?? null, + date_of_receipt: objectToEdit?.date_of_receipt ?? null, + + }; +}; + +export const getValidationSchema = () => { + return Yup.object().shape({ + amount_value: Yup.string().required("validation.required"), + description: Yup.string().required("validation.required"), + date_of_receipt: Yup.string().required("validation.required"), + + }); +}; diff --git a/src/Pages/Admin/Reseller/show/Page.tsx b/src/Pages/Admin/Reseller/show/Page.tsx index d5ad396..d433cfa 100644 --- a/src/Pages/Admin/Reseller/show/Page.tsx +++ b/src/Pages/Admin/Reseller/show/Page.tsx @@ -1,38 +1,66 @@ import { useTranslation } from "react-i18next"; -import { Suspense } from "react"; +import { lazy, Suspense } from "react"; import { Spin } from "antd"; import useSetPageTitle from "../../../../Hooks/useSetPageTitle"; import PageHeader from "../../../../Layout/Dashboard/PageHeader"; -import FilterLayout from "../../../../Layout/Dashboard/FilterLayout"; -import FilterForm from "./Model/FilterForm"; -import StudentInfoCard from "../../../../Components/student/StudentInfoCard"; -import StudentAddressCard from "../../../../Components/student/AddressCard"; -import { studentParamInfo } from "../../../../Components/student/StudentParam"; -import StudentTabs from "./StudentTabs"; +import InfoCard from "../../../../Components/Cards/InfoCard"; +import AddressCard from "../../../../Components/Cards/AddressCard"; +import { ReSellerAddressInfo, ReSellerParamInfo } from "../../../../Components/Cards/ParamInfo"; +import StudentTabs from "./ReSellerTabs"; +import { useParams } from "react-router-dom"; +import { ParamsEnum } from "../../../../enums/params"; +import AttachmentsCard from "../../../../Components/Cards/AttachmentsCard"; +import { ModalEnum } from "../../../../enums/Model"; +import { useDeleteReseller } from "../../../../api/reseller"; +import { useObjectToEdit } from "../../../../zustand/ObjectToEditState"; +import useModalHandler from "../../../../utils/useModalHandler"; +const DeleteModalForm = lazy( + () => import("../../../../Layout/Dashboard/DeleteModels"),); + const EditModalForm = lazy(() => import("./Model/EditModel")); + const AddModalForm = lazy(() => import("./Model/AddModel")); const TableHeader = () => { const [t] = useTranslation(); - useSetPageTitle( - t(`page_header.users`) + - "/ " + - t(`PageTitle.students`) - + - " / " + - t(`PageTitle.students_details`), - ); + const { re_seller_id } = useParams() + + useSetPageTitle([ + { name: `${t(`page_header.home`)}`, path: "/" }, + { name: `${t(`page_header.reseller`)}`, path: "reseller" }, + { name: `${t(`page_header.reseller_details`)}`, path: `reseller/${re_seller_id}` }, + ]); + const { handel_open_model } = useModalHandler(); + + const handleOpenModel = () =>{ + handel_open_model(ModalEnum?.RE_SELLER_COLLECTION_ADD); + + } + const deleteMutation = useDeleteReseller(); + return (
}>
- - + + +
- + + + +
diff --git a/src/Pages/Admin/Reseller/show/StudentTabs.tsx b/src/Pages/Admin/Reseller/show/ReSellerTabs.tsx similarity index 78% rename from src/Pages/Admin/Reseller/show/StudentTabs.tsx rename to src/Pages/Admin/Reseller/show/ReSellerTabs.tsx index b889809..49dd241 100644 --- a/src/Pages/Admin/Reseller/show/StudentTabs.tsx +++ b/src/Pages/Admin/Reseller/show/ReSellerTabs.tsx @@ -9,15 +9,16 @@ import { IoStatsChartOutline } from "react-icons/io5"; import { useGetAllUser } from '../../../../api/user'; import useSearchQuery from '../../../../api/utils/useSearchQuery'; import { useFilterState } from '../../../../Components/Utils/Filter/FilterState'; +import { useGetAllReseller } from '../../../../api/reseller'; const Table = lazy(() => import("./Table")); -const StudentTabs = () => { +const ReSellerTabs = () => { const {t} = useTranslation(); const [searchQuery] = useSearchQuery("name"); const { filterState } = useFilterState(); - const response = useGetAllUser({ + const response = useGetAllReseller({ name: searchQuery, pagination: true, ...filterState, @@ -26,26 +27,26 @@ const StudentTabs = () => { const items: TabsProps['items'] = [ { key: '1', - label: t("practical.quiz"), + label: t("practical.sales"), icon:, children: <> } - filterTitle="sidebar.quiz" + filterTitle="practical.sales" /> - +
, }, { key: '2', - label: t("practical.hightes_quiz"), + label: t("practical.collections"), icon:, children: <> } - filterTitle="practical.hightes_quiz" + filterTitle="practical.collections" />
, @@ -58,4 +59,4 @@ const StudentTabs = () => { ) } -export default StudentTabs \ No newline at end of file +export default ReSellerTabs \ No newline at end of file diff --git a/src/Pages/Admin/Reseller/show/Table.tsx b/src/Pages/Admin/Reseller/show/Table.tsx index f416400..ffebfbf 100644 --- a/src/Pages/Admin/Reseller/show/Table.tsx +++ b/src/Pages/Admin/Reseller/show/Table.tsx @@ -1,8 +1,14 @@ import DataTable from "../../../../Layout/Dashboard/Table/DataTable"; import { useColumns } from "./useTableColumns"; -const App = ({response}:{response:any}) => { - - return ; +import { useColumnsCollection } from "./useTableColumnsCollections"; + +const App = ({salesTable = false ,response}:{salesTable?:boolean,response:any}) => { + if (salesTable) { + return ; + } else { + return ; + } + }; export default App; diff --git a/src/Pages/Admin/Reseller/show/useTableColumns.tsx b/src/Pages/Admin/Reseller/show/useTableColumns.tsx index 3c6b583..c10eef2 100644 --- a/src/Pages/Admin/Reseller/show/useTableColumns.tsx +++ b/src/Pages/Admin/Reseller/show/useTableColumns.tsx @@ -1,45 +1,40 @@ import { TableColumnsType } from "antd"; import { user } from "../../../../types/Item"; import { useTranslation } from "react-i18next"; +import { ReSeller } from "../../../../types/ReSeller"; export const useColumns = () => { const [t] = useTranslation(); - const columns: TableColumnsType = [ + const columns: TableColumnsType = [ { - title: t("columns.quiz_date"), - dataIndex: "id", - key: "id", + title: t("columns.student_full_name"), + dataIndex: "student_full_name", + key: "student_full_name", align: "center", }, { - title: t("columns.subject"), - dataIndex: "username", - key: "username", + title: t("columns.grade"), + dataIndex: "grade", + key: "grade", align: "center", }, { - title: t("columns.quiz_address"), - dataIndex: "phone_number", - key: "phone_number", + title: t("columns.package"), + dataIndex: "package", + key: "package", align: "center", }, { - title: t("columns.created_by"), - dataIndex: "type", - key: "type", + title: t("columns.amount_paid"), + dataIndex: "amount_paid", + key: "amount_paid", align: "center", }, { - title: t("columns.creator_name"), - dataIndex: "type", - key: "type", - align: "center", - }, - { - title: t("columns.quiz_status"), - dataIndex: "type", - key: "type", + title: t("columns.sale_date"), + dataIndex: "sale_date", + key: "sale_date", align: "center", }, ]; diff --git a/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx b/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx new file mode 100644 index 0000000..106e694 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx @@ -0,0 +1,82 @@ +import { TableColumnsType } from "antd"; +import { useTranslation } from "react-i18next"; +import ActionButtons from "../../../../Components/Table/ActionButtons"; +import { canDeleteReSeller, canEditReSeller, canShowReSeller } from "../../../../utils/hasAbilityFn"; +import { ReSeller } from "../../../../types/ReSeller"; +import useModalHandler from "../../../../utils/useModalHandler"; +import { useObjectToEdit } from "../../../../zustand/ObjectToEditState"; +import { ModalEnum } from "../../../../enums/Model"; + +export const useColumnsCollection = () => { + const { handel_open_model } = useModalHandler(); + + const { setObjectToEdit } = useObjectToEdit((state) => state); + + const [t] = useTranslation(); + const handelDelete = (data: ReSeller) => { + setObjectToEdit(data); + handel_open_model(ModalEnum?.RE_SELLER_DELETE); + }; + + const handleEdit = (record: ReSeller) => { + setObjectToEdit(record); + handel_open_model(ModalEnum?.RE_SELLER_EDIT); + }; + const columns: TableColumnsType = [ + { + title: t("columns.ID"), + dataIndex: "ID", + key: "ID", + align: "center", + }, + { + title: t("columns.amount"), + dataIndex: "amount", + key: "amount", + align: "center", + }, + { + title: t("columns.date_of_receipt"), + dataIndex: "date_of_receipt", + key: "date_of_receipt", + align: "center", + }, + { + title: t("columns.description"), + dataIndex: "description", + key: "description", + align: "center", + }, + { + title: t("columns.residual"), + dataIndex: "residual", + key: "residual", + align: "center", + }, + { + title: t("columns.procedure"), + dataIndex: "procedure", + key: "procedure", + align: "center", + }, + { + title: t("columns.procedure"), + + key: "actions", + align: "center", + render: (_text, record, index) => { + return ( + handelDelete(record)} + onEdit={() => handleEdit(record)} + /> + ); + }, + }, + ]; + + return columns; +}; diff --git a/src/Pages/Admin/Reseller/useTableColumns.tsx b/src/Pages/Admin/Reseller/useTableColumns.tsx index 43a4cd2..9de525b 100644 --- a/src/Pages/Admin/Reseller/useTableColumns.tsx +++ b/src/Pages/Admin/Reseller/useTableColumns.tsx @@ -1,21 +1,16 @@ import { TableColumnsType } from "antd"; import { ReSeller } from "../../../types/ReSeller"; -import { FaPlus } from "react-icons/fa"; import useModalHandler from "../../../utils/useModalHandler"; import { ModalEnum } from "../../../enums/Model"; import { useObjectToEdit } from "../../../zustand/ObjectToEditState"; import { useTranslation } from "react-i18next"; -import { ABILITIES_ENUM } from "../../../enums/abilities"; import { useNavigate } from "react-router-dom"; import { - canAddReSeller, canDeleteReSeller, canEditReSeller, canShowReSeller, - canShowStudent, } from "../../../utils/hasAbilityFn"; import ActionButtons from "../../../Components/Table/ActionButtons"; -import ColumnsImage from "../../../Components/Columns/ColumnsImage"; export const useColumns = () => { const { handel_open_model } = useModalHandler(); @@ -68,8 +63,7 @@ export const useColumns = () => { render: (_text, record) => record?.user?.username, }, { - title: "", - + title: t("columns.procedure"), key: "actions", align: "center", render: (_text, record, index) => { diff --git a/src/Pages/Admin/Student/show/Page.tsx b/src/Pages/Admin/Student/show/Page.tsx index d5ad396..f597de2 100644 --- a/src/Pages/Admin/Student/show/Page.tsx +++ b/src/Pages/Admin/Student/show/Page.tsx @@ -5,21 +5,23 @@ import useSetPageTitle from "../../../../Hooks/useSetPageTitle"; import PageHeader from "../../../../Layout/Dashboard/PageHeader"; import FilterLayout from "../../../../Layout/Dashboard/FilterLayout"; import FilterForm from "./Model/FilterForm"; -import StudentInfoCard from "../../../../Components/student/StudentInfoCard"; -import StudentAddressCard from "../../../../Components/student/AddressCard"; -import { studentParamInfo } from "../../../../Components/student/StudentParam"; +import InfoCard from "../../../../Components/Cards/InfoCard"; +import AddressCard from "../../../../Components/Cards/AddressCard"; +import { StudentAddressInfo, StudentParamInfo } from "../../../../Components/Cards/ParamInfo"; import StudentTabs from "./StudentTabs"; +import { useParams } from "react-router-dom"; +import { ParamsEnum } from "../../../../enums/params"; const TableHeader = () => { const [t] = useTranslation(); - useSetPageTitle( - t(`page_header.users`) + - "/ " + - t(`PageTitle.students`) - + - " / " + - t(`PageTitle.students_details`), - ); + const {student_id} = useParams(); + + useSetPageTitle([ + { name: `${t(`page_header.users`)}`, path: "/" }, + { name: `${t(`PageTitle.students`)}`, path: "students" }, + { name: `${t(`PageTitle.students_details`)}`, path: `reseller/${student_id}` }, + ]); + return (
}> @@ -28,11 +30,11 @@ const TableHeader = () => { />
- - + +
- +
diff --git a/src/Pages/Admin/Student/useTableColumns.tsx b/src/Pages/Admin/Student/useTableColumns.tsx index 2a69c2c..5582906 100644 --- a/src/Pages/Admin/Student/useTableColumns.tsx +++ b/src/Pages/Admin/Student/useTableColumns.tsx @@ -1,13 +1,11 @@ import { TableColumnsType } from "antd"; import { Student } from "../../../types/Student"; -import { FaPlus } from "react-icons/fa"; import useModalHandler from "../../../utils/useModalHandler"; import { ModalEnum } from "../../../enums/Model"; import { useObjectToEdit } from "../../../zustand/ObjectToEditState"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { - canAddStudent, canDeleteStudent, canEditStudent, canShowStudent, diff --git a/src/Routes.tsx b/src/Routes.tsx index ccb0641..262931e 100644 --- a/src/Routes.tsx +++ b/src/Routes.tsx @@ -222,7 +222,7 @@ export const CrudRoute: TCrudRoute[] = [ { header: "page_header.edit_reseller", element: , - path: `/${ABILITIES_ENUM?.RE_SELLER}/:id`, + path: `/${ABILITIES_ENUM?.RE_SELLER}/:${ParamsEnum?.RE_SELLER_ID}/edit`, abilities: ABILITIES_ENUM?.RE_SELLER, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, @@ -230,7 +230,7 @@ export const CrudRoute: TCrudRoute[] = [ { header: "page_header.reSeller", element: , - path: `/${ABILITIES_ENUM?.RE_SELLER}/:id`, + path: `/${ABILITIES_ENUM?.RE_SELLER}/:${ParamsEnum?.RE_SELLER_ID}`, abilities: ABILITIES_ENUM?.RE_SELLER, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, @@ -238,7 +238,7 @@ export const CrudRoute: TCrudRoute[] = [ { header: "page_header.student", element: , - path: `/${ABILITIES_ENUM?.STUDENT}/:id`, + path: `/${ABILITIES_ENUM?.STUDENT}/:${ParamsEnum?.STUDENT_ID}`, abilities: ABILITIES_ENUM?.STUDENT, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, diff --git a/src/Styles/Pages/InfoCard.scss b/src/Styles/Pages/InfoCard.scss new file mode 100644 index 0000000..1c994ff --- /dev/null +++ b/src/Styles/Pages/InfoCard.scss @@ -0,0 +1,134 @@ +.single_student { + display: flex; + + .single_student_body { + display: flex; + width: 100%; + + .student_info { + width: 32%; + } + + .student_table { + width: 68%; + } + } +} + + + + + +.info_card, +.address_card, +.attachments_card { + width: 24vw; + box-shadow: 2px 2px 8px 3px rgba(0, 0, 0, 0.1); + border-radius: 10px; + padding: 20px 15px; + + p { + color: #6A7287; + } + + .info_card_header { + display: flex; + gap: 10px; + + img { + width: 24%; + } + + .student_name_and_sub { + display: flex; + flex-direction: column; + justify-content: center; + + span { + color: greenyellow; + } + + h2 { + font-size: 22px; + } + } + } + + .info_card_body { + display: flex; + flex-direction: column; + gap: 30px; + + span { + display: flex; + justify-content: space-between; + + h4 { + color: #202C4B; + font-size: 20px; + } + } + .info_card_button{ + background: var(--primary); + color: var(--white); + padding: 25px 0px; + border-radius: 9px; + } + } +} + + +.address_card { + margin-block: 30px; + .address_card_body { + display: flex; + flex-direction: column; + align-items: center; + div{ + margin-block: 20px; + gap: 15px; + display: flex !important; + } + svg { + @include Flex; + border-radius: 5px; + background: #F2F4F8; + width: 40px; + height: 40px; + padding: 7px; + } + } +} + + +@media screen and (max-width:1250px) { + .single_student { + display: flex; + + .single_student_body { + display: flex; + flex-direction: column !important; + width: 100%; + + .student_info { + display: flex; + width: 100%; + gap: 20px; + + .address_card { + width: 50%; + margin-block: 0 !important; + max-height: 17vw; + } + + .info_card { + width: 50%; + } + } + + .student_table { + width: 100%; + } + } + } +} \ No newline at end of file diff --git a/src/Styles/Pages/StudentInfoCard.scss b/src/Styles/Pages/StudentInfoCard.scss deleted file mode 100644 index 0faed1c..0000000 --- a/src/Styles/Pages/StudentInfoCard.scss +++ /dev/null @@ -1,100 +0,0 @@ -.single_student{ - display: flex; - .single_student_body{ - display: flex; - width: 100%; - .student_info{ - width: 32%; - } - .student_table{ - width: 68%; - } - } -} - - - - - -.student_info_card, -.student_address_card{ - width: 24vw; - box-shadow: 2px 2px 8px 3px rgba(0, 0, 0, 0.1); - border-radius: 10px; - padding: 20px 15px ; - p{ - color: #6A7287; - } - .student_info_card_header{ - display: flex; - gap: 10px; - img{ - width: 24%; - } - .student_name_and_sub{ - display: flex; flex-direction: column;justify-content: center; - span{ - color: greenyellow; - } - h2{ - font-size: 22px; - } - } - } - .student_info_card_body{ - display: flex; flex-direction: column; - gap: 30px; - span{ - display: flex;justify-content: space-between; - h4{ - color: #202C4B; - font-size: 20px; - } - } - } -} - - -.student_address_card{ - margin-top: 30px; - .student_address_card_body{ - display: flex;align-items: center; - gap: 15px; - svg{ - @include Flex; - border-radius: 5px; - background: #F2F4F8; - width: 40px;height: 40px; - padding: 7px; - } - } -} - - - - -@media screen and (max-width:1250px) { - .single_student{ - display: flex; - .single_student_body{ - display: flex;flex-direction: column !important; - width: 100%; - .student_info{ - display: flex; - width: 100%; - gap: 20px; - .student_address_card{ - width: 50%; - margin-top: 0 !important; - max-height: 17vw ; - } - .student_info_card{ - width: 50%; - } - } - .student_table{ - width: 100%; - } - } - } -} diff --git a/src/Styles/Pages/index.scss b/src/Styles/Pages/index.scss index fb57c55..1f410e0 100644 --- a/src/Styles/Pages/index.scss +++ b/src/Styles/Pages/index.scss @@ -10,4 +10,4 @@ @import "./Marks.scss"; @import "./exercise.scss"; @import './reSeller.scss'; -@import './StudentInfoCard.scss'; +@import './InfoCard.scss'; \ No newline at end of file diff --git a/src/enums/Model.ts b/src/enums/Model.ts index de37336..75f16b5 100644 --- a/src/enums/Model.ts +++ b/src/enums/Model.ts @@ -176,6 +176,11 @@ export enum ModalEnum { RE_SELLER_ADD = "ReSeller.add", RE_SELLER_DELETE = "ReSeller.delete", + /// ReSeller + RE_SELLER_COLLECTION_EDIT = "ReSeller.edit", + RE_SELLER_COLLECTION_ADD = "ReSeller.add", + RE_SELLER_COLLECTION_DELETE = "ReSeller.delete", + /// Param Param_EDIT = "Param.edit", Param_ADD = "Param.add", diff --git a/src/enums/params.ts b/src/enums/params.ts index 0214cda..c16b172 100644 --- a/src/enums/params.ts +++ b/src/enums/params.ts @@ -11,4 +11,5 @@ export enum ParamsEnum { LESSON_ID = "lesson_id", QUESTION_ID = "question_id", CHILDREN_QUESTION_ID = "children_question_id", + RE_SELLER_ID = "re_seller_id", } diff --git a/src/translate/ar.json b/src/translate/ar.json index 81c2b58..38a097c 100644 --- a/src/translate/ar.json +++ b/src/translate/ar.json @@ -192,7 +192,16 @@ "base_question": " تمرين متعدد ", "normal_question": " تمرين عادي", "hint":"شرح ", - "tags":"كلمات مفتاحية" + "tags":"كلمات مفتاحية", + "student_full_name":"اسم الطالب الثلاثي", + "amount_paid":"المبلغ المدفوع", + "sale_date":"تاريخ البيع", + "grade":"الصف", + "package":"حزمة", + "ID":"ID", + "residual":"المتبقي", + "date_of_receipt":"تاريخ الاستلام", + "amount":"مبلغ" }, "practical": { "to_confirm_deletion_please_re_enter": "لتأكيد الحذف، يرجى إعادة الإدخال", @@ -242,7 +251,12 @@ "Abbreviations": "الاختصارات", "address":"العنوان", "quiz":"الاختبارات", - "hightes_quiz":"اعلى اختبار" + "hightes_quiz":"اعلى اختبار", + "sales":"المبيعات", + "collections":"التحصيلات", + "collecting_an_amount":"تحصيل مبلغ", + "governorate":"المحافظة", + "id_photo":"صورة الهوية" }, "Table": { "header": "", @@ -313,8 +327,9 @@ "user_details": "تفاصيل المستخدم", "reseller_details": "تفاصيل اعادة البيع", "reseller": "البائعين", - "student_package": "حزمة الطالب" - }, + "student_package": "حزمة الطالب", + "collection":"تحصيل" + }, "education_class_actions": { "Student_Records": "سجلات الطلاب", "Attendance": "الحضور", @@ -428,7 +443,9 @@ "Seller Percentage": "نسبة البائع", "city": "المحافظة", "personal_image": "صورة شخصية", - "id_image": "صورة الهوية" + "id_image": "صورة الهوية", + "date_of_receipt":"تاريخ الاستلام", + "amount_value":"قيمة المبلغ" }, "select": { "enums": { @@ -795,7 +812,8 @@ "report": "تقرير", "tags": "كلمات مفتاحية", "reseller":"البائعين", - "QuestionBank":"بنك الأسئلة" + "QuestionBank":"بنك الأسئلة", + "reseller_details":"تفاصيل البائع" }, "page_header": { "home": "لوحة القيادة", @@ -833,7 +851,8 @@ "add_reseller": " البائعين / إضافة بائع ", "param": "معامل", "student_package": "حزمة الطالب", - "QuestionBank":"بنك الأسئلة" + "QuestionBank":"بنك الأسئلة", + "reseller_details":"تفاصيل البائع" }, "table": { "student": "قائمة الطلاب",