85 lines
3.1 KiB
TypeScript
85 lines
3.1 KiB
TypeScript
import type { IntlPaymentDocs } from "@/features/visaMasterPayments/api/visaMasterPaymentsApi";
|
|
|
|
export type DocKey = keyof IntlPaymentDocs;
|
|
export type TFn = (key: string, fallback?: string) => string;
|
|
|
|
interface DocDef {
|
|
key: DocKey;
|
|
i18nKey: string;
|
|
fallback: string;
|
|
}
|
|
|
|
// Backend keys behind each field are in DOC_FILE_TO_KEY (visaMasterPaymentsApi.ts).
|
|
export const ACCEPTED_DOC_DEFS: DocDef[] = [
|
|
{
|
|
key: "doc_sberbank_account",
|
|
i18nKey: "sberPayments.documents.sberbankCard",
|
|
fallback: "Talýba degişli SBERBANK kartynyň rekwizitleri",
|
|
},
|
|
{
|
|
key: "doc_school_enrollment",
|
|
i18nKey: "sberPayments.documents.enrollment",
|
|
fallback: "Daşary ýurt ÝOM-da okaýandygy baradaky güwänamasy",
|
|
},
|
|
{ key: "doc_summons", i18nKey: "sberPayments.documents.summons", fallback: "Çagyrylma hatynyn göçürmesi" },
|
|
{ key: "doc_passport_tm", i18nKey: "sberPayments.documents.passportTm", fallback: "TM içki pasportynyň asyl görnüşi we göçürmesi" },
|
|
{ key: "doc_foreign_passport", i18nKey: "sberPayments.documents.zagranPassport", fallback: "Daşary ýurt (zagran) pasportynyň göçürmesi" },
|
|
{
|
|
key: "doc_foreign_passport_copy",
|
|
i18nKey: "sberPayments.documents.visaPage",
|
|
fallback: "Daşary ýurda rugsat (wizasy) bellenen sahypasynyň göçürmesi",
|
|
},
|
|
{
|
|
key: "doc_exit_permission",
|
|
i18nKey: "sberPayments.documents.entryStamp",
|
|
fallback: "Daşary ýurt döwletine girenligi baradaky ştamply sahypasynyň göçürmesi",
|
|
},
|
|
{
|
|
key: "doc_school_foreign_info",
|
|
i18nKey: "sberPayments.documents.schoolLetter",
|
|
fallback: "ÝOM-dan hat (daşary ýurt dilinde maglumatly)",
|
|
},
|
|
];
|
|
|
|
export const SENT_DOC_DEFS: DocDef[] = [
|
|
{
|
|
key: "doc_school_departure_info",
|
|
i18nKey: "sberPayments.documents.sentPassportTm",
|
|
fallback: "Ugradyjynyň TM içki pasportynyň asyl görnüşi we göçürmesi",
|
|
},
|
|
{
|
|
key: "upd_doc_passport_tm",
|
|
i18nKey: "sberPayments.documents.sentZagranPassport",
|
|
fallback: "Ugradyjynyň daşary ýurt pasportynyň asyl görnüşi we göçürmesi",
|
|
},
|
|
{
|
|
key: "upd_doc_foreign_passport",
|
|
i18nKey: "sberPayments.documents.sentEntryStamp",
|
|
fallback: "Ugradyjynyň daşary döwletine girenligi ştamply sahypasynyň göçürmesi",
|
|
},
|
|
{
|
|
key: "upd_doc_visa",
|
|
i18nKey: "sberPayments.documents.sentRelationDoc",
|
|
fallback: "Ugradyjy we kabul edijiniň garyndaşlyk tassyklaýjy resminamasynyn göçürmesi",
|
|
},
|
|
{
|
|
key: "upd_doc_acceptance_letter",
|
|
i18nKey: "sberPayments.documents.sentNewPassportSeries",
|
|
fallback: "Ugradyjy/kabul ediji täze (2015+) pasport seriýasy maglumaty",
|
|
},
|
|
{
|
|
key: "upd_doc_passport_biometric",
|
|
i18nKey: "sberPayments.documents.sentPolicePassportSeries",
|
|
fallback: "Ugradyjy/kabul ediji pasport seriýasy (polisiýa) maglumaty",
|
|
},
|
|
{
|
|
key: "upd_doc_passport_old",
|
|
i18nKey: "sberPayments.documents.sentOldPassportSeries",
|
|
fallback: "Ugradyjy/kabul ediji köne pasport seriýasy baradaky güwänamasy",
|
|
},
|
|
];
|
|
|
|
export const ALL_DOC_KEYS: DocKey[] = [...ACCEPTED_DOC_DEFS, ...SENT_DOC_DEFS].map((d) => d.key);
|
|
|
|
export const docLabel = (d: DocDef, t: TFn) => t(d.i18nKey, d.fallback);
|