{/* ── Page header ──────────────────────────────────────────────────── */}
@@ -116,10 +130,17 @@ export default function LoanOrderViewPage() {
{/* Meta */}
-
+
+
+
+
+
+
{/* Loan */}
@@ -141,6 +163,7 @@ export default function LoanOrderViewPage() {
label={t("loanOrders.fields.loanAmount", "Karz mukdary")}
value={order.loanAmount ? String(order.loanAmount) : undefined}
/>
+
{/* Location */}
@@ -160,9 +183,10 @@ export default function LoanOrderViewPage() {
{/* Personal */}
+
-
+
@@ -191,12 +215,20 @@ export default function LoanOrderViewPage() {
/>
-
+
{/* Passport info */}
-
+
+
+
+ {/* ── Row 5: Salary Card + Loan Card ──────────────────────────────── */}
+
+ {/* Salary / personal card */}
+
+
+
+
+
+
+ {/* Loan card (disbursement card) */}
+
+
+
+
+
+
+
+ {/* ── Row 6: Guarantors ───────────────────────────────────────────── */}
+
+ {/* Guarantor 1 */}
+
+
+
+
+
+
+
+
+
+
+ {/* Guarantor 2 (optional) */}
+ {hasGuarantor2 && (
+
+
+
+
+
+
+
+
+
+ )}
+
+
{/* ── Audit log ────────────────────────────────────────────────────── */}
diff --git a/src/pages/loanDepartment/loanOrders/index.tsx b/src/pages/loanDepartment/loanOrders/index.tsx
index 139152b..8731040 100644
--- a/src/pages/loanDepartment/loanOrders/index.tsx
+++ b/src/pages/loanDepartment/loanOrders/index.tsx
@@ -14,8 +14,8 @@ import { useLoanOrders, useDeleteLoanOrder } from "@/features/loanOrders/hooks/u
import type { LoanOrder, LoanOrderStatus } from "@/features/loanOrders/api/loanOrdersApi";
import { useInfiniteBranches } from "@/features/branches/hooks/useBranches";
import { DeleteDialog } from "@/components/deleteDialog";
-import { getStatusLabel, getStatusOptions, STATUS_BADGE_VARIANTS, type StatusValue } from "@/constants";
-
+import { getStatusLabel, getStatusOptions, getRegionOptions, STATUS_BADGE_VARIANTS, type StatusValue } from "@/constants";
+import { formatFromApiDate } from "@/lib/utils";
// ─── Status Badge (inline) ────────────────────────────────────────────────────
const STATUS_ICONS: Record = {
@@ -38,8 +38,6 @@ const COLUMN_IDS = ["id", "loanType", "createdAt", "region", "branch", "firstNam
// ─── Filter fields ────────────────────────────────────────────────────────────
-const REGION_CODES = ["AG", "AH", "BN", "DZ", "LB", "MR"] as const;
-
// ─── Page Component ───────────────────────────────────────────────────────────
export default function LoanOrdersPage() {
@@ -78,7 +76,6 @@ export default function LoanOrdersPage() {
{ fieldId: "region", value: "" },
{ fieldId: "status", value: "" },
{ fieldId: "branch", value: "" },
- { fieldId: "archived", value: "" },
]);
const queryParams = useMemo(() => {
@@ -88,7 +85,6 @@ export default function LoanOrdersPage() {
region: filterMap.region || undefined,
status: (filterMap.status as LoanOrderStatus) || undefined,
branch: filterMap.branch || undefined,
- archived: filterMap.archived || undefined,
page,
perPage,
};
@@ -97,7 +93,7 @@ export default function LoanOrdersPage() {
const { data, isLoading } = useLoanOrders(queryParams);
const totalPages = data ? Math.ceil(data.total / perPage) : 1;
- const regionOptions = useMemo(() => REGION_CODES.map((code) => ({ value: code, label: t(`loanOrders.regions.${code}`, code) })), [t]);
+ const regionOptions = useMemo(() => getRegionOptions(t), [t]);
const handleFilterChange = useCallback((fieldId: string, value: string) => {
setActiveFilters((prev) => prev.map((f) => (f.fieldId === fieldId ? { ...f, value } : f)));
@@ -138,7 +134,7 @@ export default function LoanOrdersPage() {
id: "createdAt",
accessorKey: "createdAt",
header: t("Created at", "DÖREDILEN WAGTY"),
- cell: ({ row }) => {row.original.createdAt},
+ cell: ({ row }) => {formatFromApiDate(row.original.createdAt)},
size: 160,
},
{
@@ -229,14 +225,6 @@ export default function LoanOrdersPage() {
searchValue: branchSearch,
onSearchChange: setBranchSearch,
},
- {
- id: "archived",
- label: t("loanOrders.filters.archived", "ARHIWLENEN"),
- options: [
- { value: "true", label: t("common.yes", "Hawa") },
- { value: "false", label: t("common.no", "Ýok") },
- ],
- },
],
[t, regionOptions, branchOptions, isBranchesLoading, isFetchingNextBranches, hasNextBranches, branchSearch],
);
diff --git a/src/pages/loanDepartment/loanRemaining/index.tsx b/src/pages/loanDepartment/loanRemaining/index.tsx
index 6f90ea0..3162948 100644
--- a/src/pages/loanDepartment/loanRemaining/index.tsx
+++ b/src/pages/loanDepartment/loanRemaining/index.tsx
@@ -74,7 +74,7 @@ export default function LoanRemainingPage() {
id: "userId",
accessorKey: "userId",
header: t("loanRemaining.columns.userId", "ULANYJY ID"),
- cell: ({ row }) => {row.original.userId},
+ cell: ({ row }) => {row.original.user?.id ?? row.original.userId ?? "—"},
size: 120,
},
{
diff --git a/src/pages/loanDepartment/loanRemainingView/index.tsx b/src/pages/loanDepartment/loanRemainingView/index.tsx
index 4d2826d..a392ccc 100644
--- a/src/pages/loanDepartment/loanRemainingView/index.tsx
+++ b/src/pages/loanDepartment/loanRemainingView/index.tsx
@@ -7,6 +7,8 @@ import { Skeleton } from "@/components/ui/skeleton";
import { InfoRow, Section } from "@/components/viewPageComponents";
import { ConfirmDialog } from "@/components/confirmDialog";
+import { formatFromApiDate } from "@/lib/utils";
+
// ─── Skeleton ─────────────────────────────────────────────────────────────────
function LoanRemainingViewSkeleton() {
@@ -78,16 +80,22 @@ export default function LoanRemainingViewPage() {
{/* ── Basic Info ─────────────────────────────────────────────────────── */}
-
+
+ {record.createdAt && (
+
+ )}
-
+
{user.email && }
@@ -253,22 +251,24 @@ export default function ProfilePage() {
-
-
-
-
-
-
-
+ {isAdmin && (
+
+
+
+
+
+
+
+ )}
>
) : (