fixed some missed data, added role based function(user)

This commit is contained in:
Jelaletdin12 committed 2026-08-31 19:18:42 +05:00
1 parent 5884ec831c
commit 9ad86634dd
31 files changed
+1276 -977

No files matched your search

@@ -13,6 +13,7 @@ import { useCardTypes } from "@/features/cardTypes/hooks/useCardTypes";
import type { LocalizedTitle } from "@/features/cardTypes/api/cardTypesApi";
import { cardTransactionFormSchema, DEFAULT_FORM_VALUES, buildPayload } from "../schemas/cardTransaction.schema";
import type { CardTransactionFormData } from "../schemas/cardTransaction.schema";
import { MONTH_OPTIONS, CARD_YEAR_OPTIONS } from "@/constants";
// ─── Types ────────────────────────────────────────────────────────────────────
@@ -21,18 +22,6 @@ interface CardTransactionFormProps {
initialData?: Card;
}
// ─── Constants ────────────────────────────────────────────────────────────────
const MONTH_OPTIONS = Array.from({ length: 12 }, (_, i) => {
const val = String(i + 1).padStart(2, "0");
return { value: val, label: val };
});
const YEAR_OPTIONS = Array.from({ length: 20 }, (_, i) => {
const year = String(new Date().getFullYear() + i);
return { value: year, label: year };
});
// ─── Form errors helper ───────────────────────────────────────────────────────
type FlatErrors = Partial<Record<keyof CardTransactionFormData, string>>;
@@ -224,7 +213,7 @@ export function CardTransactionForm({ mode, initialData }: CardTransactionFormPr
label={t("Card expiry year", "Kart möhleti (ýyl)")}
value={form.year}
onChange={setField("year")}
options={YEAR_OPTIONS}
options={CARD_YEAR_OPTIONS}
placeholder={t("Select to choose", "Saýlamak üçin basyň")}
error={errMsg(errors.year)}
required