fixed some ui
This commit is contained in:
@@ -145,27 +145,158 @@ export interface PaginatedResponse<T> {
|
||||
|
||||
// ─── Mock Data ─────────────────────────────────────────────────────────────────
|
||||
|
||||
const USE_MOCK = true // gerçek API hazır olunca false yap
|
||||
|
||||
const MOCK_DATA: LoanOrderMobile[] = [
|
||||
{ id: 'LOM-0001', loanType: 'Sarp etmek karzy', createdAt: '2025-01-15 09:42', region: 'Aşgabat', branch: 'Merkezi', firstName: 'Oraz', lastName: 'Annaýew', phone: '+99361123456', status: 'GARAŞYLÝAR' },
|
||||
{ id: 'LOM-0002', loanType: 'Awtoulag karzy', createdAt: '2025-01-18 11:05', region: 'Ahal', branch: 'Änew', firstName: 'Merjen', lastName: 'Hudaýewa', phone: '+99362234567', status: 'KANAGATLANDYRYLAN' },
|
||||
{ id: 'LOM-0003', loanType: 'Ipoteka karzy', createdAt: '2025-01-20 14:30', region: 'Balkan', branch: 'Türkmenbaşy', firstName: 'Serdar', lastName: 'Durdyýew', phone: '+99363345678', status: 'IŞLENÝÄR' },
|
||||
{ id: 'LOM-0004', loanType: 'Telekeçilik karzy', createdAt: '2025-01-22 08:15', region: 'Lebap', branch: 'Türkmenabat', firstName: 'Aýna', lastName: 'Meredowa', phone: '+99365456789', status: 'RED_EDILDI' },
|
||||
{ id: 'LOM-0005', loanType: 'Sarp etmek karzy', createdAt: '2025-01-25 16:00', region: 'Mary', branch: 'Mary', firstName: 'Begmyrat',lastName: 'Oraz', phone: '+99366567890', status: 'GARAŞYLÝAR' },
|
||||
{ id: 'LOM-0006', loanType: 'Bilim karzy', createdAt: '2025-01-28 10:20', region: 'Daşoguz', branch: 'Daşoguz', firstName: 'Gülälek', lastName: 'Saparowa', phone: '+99361678901', status: 'KANAGATLANDYRYLAN' },
|
||||
{ id: 'LOM-0007', loanType: 'Awtoulag karzy', createdAt: '2025-02-01 13:45', region: 'Aşgabat', branch: 'Çoganly', firstName: 'Myrat', lastName: 'Ataýew', phone: '+99362789012', status: 'IŞLENÝÄR' },
|
||||
{ id: 'LOM-0008', loanType: 'Ipoteka karzy', createdAt: '2025-02-03 09:00', region: 'Ahal', branch: 'Tejen', firstName: 'Ogulnur', lastName: 'Berdiýewa', phone: '+99363890123', status: 'GARAŞYLÝAR' },
|
||||
{ id: 'LOM-0009', loanType: 'Telekeçilik karzy', createdAt: '2025-02-05 15:30', region: 'Balkan', branch: 'Balkanabat', firstName: 'Döwlet', lastName: 'Çaryýew', phone: '+99364901234', status: 'RED_EDILDI' },
|
||||
{ id: 'LOM-0010', loanType: 'Sarp etmek karzy', createdAt: '2025-02-08 11:15', region: 'Lebap', branch: 'Farap', firstName: 'Maral', lastName: 'Ýollyýewa', phone: '+99365012345', status: 'KANAGATLANDYRYLAN' },
|
||||
{ id: 'LOM-0011', loanType: 'Bilim karzy', createdAt: '2025-02-10 08:45', region: 'Mary', branch: 'Baýramaly', firstName: 'Nurmuhammet', lastName: 'Garaýew', phone: '+99366123456', status: 'GARAŞYLÝAR' },
|
||||
{ id: 'LOM-0012', loanType: 'Awtoulag karzy', createdAt: '2025-02-12 14:00', region: 'Daşoguz', branch: 'Köneürgenç', firstName: 'Şemşat', lastName: 'Jumaýewa', phone: '+99361234567', status: 'IŞLENÝÄR' },
|
||||
{
|
||||
id: 'LOM-0001', loanType: 'Sarp ediş karzy', createdAt: '2025-01-15 09:42',
|
||||
region: 'Aşgabat', branch: 'Merkezi şahamça',
|
||||
firstName: 'Oraz', lastName: 'Annaýew', phone: '+99361123456', status: 'GARAŞYLÝAR',
|
||||
note: 'Müşderi dokumentleri tassyklamady',
|
||||
loanAmount: 15000, loanHistory: 'positive',
|
||||
patronicName: 'Myradowiç', education: 'high', marriageStatus: 'MARRIED',
|
||||
dateOfBirth: '1992-04-18',
|
||||
residence: 'Aşgabat, Bitarap Türkmenistan şaýoly, 15',
|
||||
currentResidence: 'Aşgabat, Garaşsyzlyk köçesi, 5',
|
||||
passportSerie: 'I', passportNumber: '123456',
|
||||
passportDateOfIssue: '2015-03-10',
|
||||
passportGivenBy: 'Aşgabat şäheriniň Içeri işler müdirligi',
|
||||
bornPlace: 'Aşgabat şäheri',
|
||||
email: 'oraz.annayew@email.com',
|
||||
phoneAdditional: '+99365443322',
|
||||
workCompany: 'Türkmennebit', workHrPhone: '+99312456789',
|
||||
workRegion: 'Aşgabat', workProvince: 'Büzmeýin etraby',
|
||||
position: 'Inžener', salary: 2500, workStartedAt: '2018-06-01',
|
||||
cardNumber: '4111111111111111', cardName: 'ORAZ ANNAÝEW',
|
||||
cardExpMonth: '12', cardExpYear: '2027',
|
||||
guarantor1Name: 'Berdi', guarantor1Surname: 'Berdiýew',
|
||||
guarantor1Patronic: 'Annagulyýewiç',
|
||||
guarantor1PassportSerie: 'II', guarantor1PassportNumber: '654321',
|
||||
guarantor1CardNumber: '4222222222222222', guarantor1CardName: 'BERDI BERDIÝEW',
|
||||
guarantor1CardExpMonth: '06', guarantor1CardExpYear: '2026', guarantor1Salary: 3000,
|
||||
},
|
||||
{
|
||||
id: 'LOM-0002', loanType: 'Awtoulag karzy', createdAt: '2025-01-18 11:05',
|
||||
region: 'Ahal', branch: 'Änew şahamçasy',
|
||||
firstName: 'Merjen', lastName: 'Hudaýewa', phone: '+99362234567', status: 'KANAGATLANDYRYLAN',
|
||||
loanAmount: 30000, loanHistory: 'new',
|
||||
patronicName: 'Myratowna', education: 'masters', marriageStatus: 'SINGLE',
|
||||
dateOfBirth: '1995-11-20',
|
||||
residence: 'Änew şäher, Garaşsyzlyk köçesi, 10',
|
||||
passportSerie: 'I', passportNumber: '789012',
|
||||
passportDateOfIssue: '2018-07-22',
|
||||
passportGivenBy: 'Ahal welaýatynyň Içeri işler müdirligi',
|
||||
bornPlace: 'Änew şäheri',
|
||||
email: 'merjen.hudayewa@email.com',
|
||||
workCompany: 'Änew etrap hasap bölümi', position: 'Hasapçy',
|
||||
salary: 1800, workStartedAt: '2019-03-15',
|
||||
cardNumber: '4333333333333333', cardName: 'MERJEN HUDAÝEWA',
|
||||
cardExpMonth: '09', cardExpYear: '2028',
|
||||
guarantor1Name: 'Merdan', guarantor1Surname: 'Merdanow',
|
||||
guarantor1PassportSerie: 'I', guarantor1PassportNumber: '345678',
|
||||
guarantor1CardNumber: '4444444444444444', guarantor1CardName: 'MERDAN MERDANOW',
|
||||
guarantor1CardExpMonth: '03', guarantor1CardExpYear: '2025', guarantor1Salary: 2200,
|
||||
},
|
||||
{
|
||||
id: 'LOM-0003', loanType: 'Ipoteka karzy', createdAt: '2025-01-20 14:30',
|
||||
region: 'Balkan', branch: 'Balkanabat şahamçasy',
|
||||
firstName: 'Serdar', lastName: 'Durdyýew', phone: '+99363345678', status: 'IŞLENÝÄR',
|
||||
loanAmount: 50000, loanHistory: 'positive',
|
||||
patronicName: 'Annagylyjowiç', education: 'high', marriageStatus: 'MARRIED',
|
||||
dateOfBirth: '1988-07-12',
|
||||
residence: 'Balkanabat, Magtymguly köçesi, 25',
|
||||
passportSerie: 'II', passportNumber: '456123',
|
||||
passportDateOfIssue: '2016-05-18',
|
||||
passportGivenBy: 'Balkan welaýatynyň Içeri işler müdirligi',
|
||||
email: 'serdar.durdyyew@email.com',
|
||||
workCompany: 'Balkan nebit', position: 'Operator',
|
||||
salary: 3200, workStartedAt: '2015-09-01',
|
||||
cardNumber: '4555555555555555', cardName: 'SERDAR DURDYÝEW',
|
||||
cardExpMonth: '04', cardExpYear: '2029',
|
||||
guarantor1Name: 'Döwran', guarantor1Surname: 'Döwranow',
|
||||
guarantor1PassportSerie: 'I', guarantor1PassportNumber: '789456',
|
||||
guarantor1CardNumber: '4666666666666666', guarantor1CardName: 'DÖWRAN DÖWRANOW',
|
||||
guarantor1CardExpMonth: '11', guarantor1CardExpYear: '2027', guarantor1Salary: 3500,
|
||||
},
|
||||
{
|
||||
id: 'LOM-0004', loanType: 'Telekeçilik karzy', createdAt: '2025-01-22 08:15',
|
||||
region: 'Lebap', branch: 'Türkmenabat şahamçasy',
|
||||
firstName: 'Aýna', lastName: 'Meredowa', phone: '+99365456789', status: 'RED_EDILDI',
|
||||
loanAmount: 25000,
|
||||
patronicName: 'Begenjowna', education: 'high', marriageStatus: 'DIVORCED',
|
||||
dateOfBirth: '1991-02-28',
|
||||
residence: 'Türkmenabat, Lebap köçesi, 8',
|
||||
passportSerie: 'I', passportNumber: '321654',
|
||||
passportDateOfIssue: '2017-11-05',
|
||||
passportGivenBy: 'Lebap welaýatynyň Içeri işler müdirligi',
|
||||
workCompany: 'Hususy telekeçi', position: 'Telekeçi',
|
||||
salary: 4000, workStartedAt: '2020-01-10',
|
||||
cardNumber: '4777777777777777', cardName: 'AÝNA MEREDOWA',
|
||||
cardExpMonth: '07', cardExpYear: '2026',
|
||||
},
|
||||
{
|
||||
id: 'LOM-0005', loanType: 'Sarp ediş karzy', createdAt: '2025-01-25 16:00',
|
||||
region: 'Mary', branch: 'Mary-1 şahamçasy',
|
||||
firstName: 'Begmyrat', lastName: 'Oraz', phone: '+99366567890', status: 'GARAŞYLÝAR',
|
||||
loanAmount: 8000, loanHistory: 'new',
|
||||
patronicName: 'Annageldiwiç', education: 'middle', marriageStatus: 'SINGLE',
|
||||
dateOfBirth: '2000-08-15',
|
||||
residence: 'Mary şäher, Saýat köçesi, 3',
|
||||
passportSerie: 'I', passportNumber: '567890',
|
||||
passportDateOfIssue: '2020-01-20',
|
||||
passportGivenBy: 'Mary welaýatynyň Içeri işler müdirligi',
|
||||
workCompany: 'Mary gurluşyk', position: 'Işçi',
|
||||
salary: 1200, workStartedAt: '2022-06-01',
|
||||
},
|
||||
{
|
||||
id: 'LOM-0006', loanType: 'Bilim karzy', createdAt: '2025-01-28 10:20',
|
||||
region: 'Daşoguz', branch: 'Daşoguz şahamçasy',
|
||||
firstName: 'Gülälek', lastName: 'Saparowa', phone: '+99361678901', status: 'KANAGATLANDYRYLAN',
|
||||
loanAmount: 12000,
|
||||
patronicName: 'Mämmedowna', education: 'phd', marriageStatus: 'MARRIED',
|
||||
dateOfBirth: '1985-12-03',
|
||||
residence: 'Daşoguz, Gurbansoltan eje köçesi, 12',
|
||||
passportSerie: 'II', passportNumber: '901234',
|
||||
passportDateOfIssue: '2014-08-30',
|
||||
passportGivenBy: 'Daşoguz welaýatynyň Içeri işler müdirligi',
|
||||
email: 'gulalek.saparowa@email.com',
|
||||
workCompany: 'Daşoguz uniwersiteti', position: 'Mugallym',
|
||||
salary: 2000, workStartedAt: '2016-09-01',
|
||||
cardNumber: '4888888888888888', cardName: 'GÜLÄLEK SAPAROWA',
|
||||
cardExpMonth: '02', cardExpYear: '2028',
|
||||
guarantor1Name: 'Maksat', guarantor1Surname: 'Saparow',
|
||||
guarantor1PassportSerie: 'I', guarantor1PassportNumber: '112233',
|
||||
guarantor1CardNumber: '4999999999999999', guarantor1CardName: 'MAKSAT SAPAROW',
|
||||
guarantor1CardExpMonth: '10', guarantor1CardExpYear: '2027', guarantor1Salary: 2500,
|
||||
},
|
||||
{
|
||||
id: 'LOM-0007', loanType: 'Awtoulag karzy', createdAt: '2025-02-01 13:45',
|
||||
region: 'Aşgabat', branch: 'Garaşsyzlyk şahamçasy',
|
||||
firstName: 'Myrat', lastName: 'Ataýew', phone: '+99362789012', status: 'IŞLENÝÄR',
|
||||
loanAmount: 35000,
|
||||
patronicName: 'Batyrowiç', education: 'high', marriageStatus: 'MARRIED',
|
||||
dateOfBirth: '1989-09-22',
|
||||
residence: 'Aşgabat, Çandybil köçesi, 45',
|
||||
passportSerie: 'I', passportNumber: '334455',
|
||||
passportDateOfIssue: '2015-12-12',
|
||||
passportGivenBy: 'Aşgabat şäheriniň Içeri işler müdirligi',
|
||||
workCompany: 'Türkmenhowaýollar', position: 'Sürüji',
|
||||
salary: 2800, workStartedAt: '2017-04-01',
|
||||
cardNumber: '4111111111112222', cardName: 'MYRAT ATAÝEW',
|
||||
cardExpMonth: '08', cardExpYear: '2027',
|
||||
},
|
||||
]
|
||||
|
||||
let mockStore = [...MOCK_DATA]
|
||||
let nextId = 8
|
||||
|
||||
const delay = (ms = 300) => new Promise((r) => setTimeout(r, ms))
|
||||
|
||||
function applyMockFilters(
|
||||
params: LoanOrderMobileListParams,
|
||||
): PaginatedResponse<LoanOrderMobile> {
|
||||
let result = [...MOCK_DATA]
|
||||
const page = params.page ?? 1
|
||||
const perPage = params.perPage ?? 25
|
||||
|
||||
let result = [...mockStore]
|
||||
|
||||
if (params.search) {
|
||||
const q = params.search.toLowerCase()
|
||||
@@ -182,8 +313,6 @@ function applyMockFilters(
|
||||
if (params.branch) result = result.filter((r) => r.branch === params.branch)
|
||||
|
||||
const total = result.length
|
||||
const page = params.page ?? 1
|
||||
const perPage = params.perPage ?? 25
|
||||
const start = (page - 1) * perPage
|
||||
|
||||
return { data: result.slice(start, start + perPage), total }
|
||||
@@ -194,8 +323,10 @@ function applyMockFilters(
|
||||
export async function fetchLoanOrderMobiles(
|
||||
params: LoanOrderMobileListParams,
|
||||
): Promise<PaginatedResponse<LoanOrderMobile>> {
|
||||
if (USE_MOCK) return applyMockFilters(params)
|
||||
|
||||
if (true) {
|
||||
await delay(500)
|
||||
return applyMockFilters(params)
|
||||
}
|
||||
const { data } = await apiClient.get<PaginatedResponse<LoanOrderMobile>>(
|
||||
'/loan-order-mobiles',
|
||||
{ params },
|
||||
@@ -204,51 +335,78 @@ export async function fetchLoanOrderMobiles(
|
||||
}
|
||||
|
||||
export async function deleteLoanOrderMobile(id: string): Promise<void> {
|
||||
if (USE_MOCK) {
|
||||
const idx = MOCK_DATA.findIndex((r) => r.id === id)
|
||||
if (idx !== -1) MOCK_DATA.splice(idx, 1)
|
||||
return
|
||||
}
|
||||
await apiClient.delete(`/loan-order-mobiles/${id}`)
|
||||
await delay(300)
|
||||
mockStore = mockStore.filter((r) => r.id !== id)
|
||||
}
|
||||
|
||||
export async function getLoanOrderMobileById(id: string): Promise<LoanOrderMobile> {
|
||||
if (USE_MOCK) {
|
||||
const order = MOCK_DATA.find((r) => r.id === id)
|
||||
if (!order) throw new Error('Not found')
|
||||
return order
|
||||
}
|
||||
const { data } = await apiClient.get<LoanOrderMobile>(`/loan-order-mobiles/${id}`)
|
||||
return data
|
||||
await delay(300)
|
||||
const order = mockStore.find((r) => r.id === id)
|
||||
if (!order) throw new Error('Not found')
|
||||
return { ...order }
|
||||
}
|
||||
|
||||
export async function createLoanOrderMobile(
|
||||
payload: LoanOrderMobilePayload
|
||||
): Promise<LoanOrderMobile> {
|
||||
if (USE_MOCK) {
|
||||
const newOrder: LoanOrderMobile = {
|
||||
...payload,
|
||||
id: `LOM-${String(MOCK_DATA.length + 1).padStart(4, '0')}`,
|
||||
createdAt: new Date().toISOString().slice(0, 16).replace('T', ' '),
|
||||
status: payload.status as LoanOrderMobileStatus,
|
||||
}
|
||||
MOCK_DATA.unshift(newOrder)
|
||||
return newOrder
|
||||
await delay(500)
|
||||
const newOrder: LoanOrderMobile = {
|
||||
...payload,
|
||||
id: `LOM-${String(nextId++).padStart(4, '0')}`,
|
||||
createdAt: new Date().toISOString().slice(0, 16).replace('T', ' '),
|
||||
status: payload.status as LoanOrderMobileStatus,
|
||||
}
|
||||
const { data } = await apiClient.post<LoanOrderMobile>('/loan-order-mobiles', payload)
|
||||
return data
|
||||
mockStore = [newOrder, ...mockStore]
|
||||
return newOrder
|
||||
}
|
||||
|
||||
export async function updateLoanOrderMobile(
|
||||
id: string,
|
||||
payload: Partial<LoanOrderMobilePayload>
|
||||
): Promise<LoanOrderMobile> {
|
||||
if (USE_MOCK) {
|
||||
const idx = MOCK_DATA.findIndex((r) => r.id === id)
|
||||
if (idx === -1) throw new Error('Not found')
|
||||
MOCK_DATA[idx] = { ...MOCK_DATA[idx], ...payload } as LoanOrderMobile
|
||||
return MOCK_DATA[idx]
|
||||
}
|
||||
const { data } = await apiClient.put<LoanOrderMobile>(`/loan-order-mobiles/${id}`, payload)
|
||||
return data
|
||||
}
|
||||
await delay(500)
|
||||
const idx = mockStore.findIndex((r) => r.id === id)
|
||||
if (idx === -1) throw new Error('Not found')
|
||||
const updated = { ...mockStore[idx], ...payload } as LoanOrderMobile
|
||||
mockStore = mockStore.map((r) => (r.id === id ? updated : r))
|
||||
return updated
|
||||
}
|
||||
|
||||
// ─── Branch options by region ─────────────────────────────────────────────────
|
||||
|
||||
export const BRANCHES_BY_REGION_MOBILE: Record<string, { value: string; label: string }[]> = {
|
||||
'Aşgabat': [
|
||||
{ value: 'Merkezi şahamça', label: 'Merkezi şahamça' },
|
||||
{ value: 'Garaşsyzlyk şahamçasy', label: 'Garaşsyzlyk şahamçasy' },
|
||||
{ value: 'Bitarap şahamça', label: 'Bitarap şahamça' },
|
||||
{ value: 'Aşgabat-1 şahamçasy', label: 'Aşgabat-1 şahamçasy' },
|
||||
],
|
||||
'Ahal': [
|
||||
{ value: 'Änew şahamçasy', label: 'Änew şahamçasy' },
|
||||
{ value: 'Gökdepe şahamçasy', label: 'Gökdepe şahamçasy' },
|
||||
{ value: 'Tejen şahamçasy', label: 'Tejen şahamçasy' },
|
||||
],
|
||||
'Balkan': [
|
||||
{ value: 'Balkanabat şahamçasy', label: 'Balkanabat şahamçasy' },
|
||||
{ value: 'Türkmenbaşy şahamçasy', label: 'Türkmenbaşy şahamçasy' },
|
||||
{ value: 'Bereket şahamçasy', label: 'Bereket şahamçasy' },
|
||||
],
|
||||
'Daşoguz': [
|
||||
{ value: 'Daşoguz şahamçasy', label: 'Daşoguz şahamçasy' },
|
||||
{ value: 'Akdepe şahamçasy', label: 'Akdepe şahamçasy' },
|
||||
{ value: 'Boldumsaz şahamçasy', label: 'Boldumsaz şahamçasy' },
|
||||
],
|
||||
'Lebap': [
|
||||
{ value: 'Türkmenabat şahamçasy', label: 'Türkmenabat şahamçasy' },
|
||||
{ value: 'Seýdi şahamçasy', label: 'Seýdi şahamçasy' },
|
||||
{ value: 'Kerki şahamçasy', label: 'Kerki şahamçasy' },
|
||||
],
|
||||
'Mary': [
|
||||
{ value: 'Mary-1 şahamçasy', label: 'Mary-1 şahamçasy' },
|
||||
{ value: 'Mary-2 şahamçasy', label: 'Mary-2 şahamçasy' },
|
||||
{ value: 'Baýramaly şahamçasy', label: 'Baýramaly şahamçasy' },
|
||||
],
|
||||
'Arkadag': [
|
||||
{ value: 'Arkadag şahamçasy', label: 'Arkadag şahamçasy' },
|
||||
],
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,3 @@
|
||||
import { apiClient } from '@/lib/api/client'
|
||||
|
||||
// ─── Types ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export type LoanOrderStatus =
|
||||
@@ -9,7 +7,6 @@ export type LoanOrderStatus =
|
||||
| 'IŞLENÝÄR'
|
||||
|
||||
export interface LoanOrder {
|
||||
// ── List fields ──────────────────────────────────────────────────────────
|
||||
id: string
|
||||
loanType: string
|
||||
createdAt: string
|
||||
@@ -21,7 +18,6 @@ export interface LoanOrder {
|
||||
status: LoanOrderStatus
|
||||
note?: string | null
|
||||
|
||||
// ── Detail fields ─────────────────────────────────────────────────────────
|
||||
loanAmount?: number | null
|
||||
loanHistory?: string | null
|
||||
patronicName?: string | null
|
||||
@@ -31,7 +27,6 @@ export interface LoanOrder {
|
||||
residence?: string | null
|
||||
currentResidence?: string | null
|
||||
|
||||
// Passport
|
||||
passportSerie?: string | null
|
||||
passportNumber?: string | null
|
||||
passportDateOfIssue?: string | null
|
||||
@@ -42,12 +37,10 @@ export interface LoanOrder {
|
||||
passportPage89Url?: string | null
|
||||
passportPage32Url?: string | null
|
||||
|
||||
// Contact
|
||||
email?: string | null
|
||||
phoneAdditional?: string | null
|
||||
homePhone?: string | null
|
||||
|
||||
// Employment
|
||||
workCompany?: string | null
|
||||
workHrPhone?: string | null
|
||||
workRegion?: string | null
|
||||
@@ -56,13 +49,11 @@ export interface LoanOrder {
|
||||
salary?: number | null
|
||||
workStartedAt?: string | null
|
||||
|
||||
// Card (Zähmet haky)
|
||||
cardNumber?: string | null
|
||||
cardName?: string | null
|
||||
cardExpMonth?: string | null
|
||||
cardExpYear?: string | null
|
||||
|
||||
// Guarantor (Zamun)
|
||||
guarantor1Name?: string | null
|
||||
guarantor1Surname?: string | null
|
||||
guarantor1Patronic?: string | null
|
||||
@@ -74,7 +65,6 @@ export interface LoanOrder {
|
||||
guarantor1CardExpYear?: string | null
|
||||
guarantor1Salary?: number | null
|
||||
|
||||
// ── Restored fields from previous version ───────────────────────────────
|
||||
amount?: number | null
|
||||
createdBy?: string | null
|
||||
fullName?: string | null
|
||||
@@ -172,6 +162,44 @@ const MOCK_DATA: LoanOrder[] = [
|
||||
lastName: 'Amanow',
|
||||
phone: '+993 65 112233',
|
||||
status: 'GARAŞYLÝAR',
|
||||
note: 'Müşderi dokumentleri tassyklamady',
|
||||
loanAmount: 50000,
|
||||
loanHistory: 'positive',
|
||||
patronicName: 'Myradowiç',
|
||||
education: 'high',
|
||||
marriageStatus: 'MARRIED',
|
||||
dateOfBirth: '1990-05-15',
|
||||
residence: 'Aşgabat, Bitarap Türkmenistan şaýoly, 15',
|
||||
currentResidence: 'Aşgabat, Garaşsyzlyk köçesi, 5',
|
||||
passportSerie: 'I',
|
||||
passportNumber: '123456',
|
||||
passportDateOfIssue: '2015-03-10',
|
||||
passportGivenBy: 'Aşgabat şäheriniň Içeri işler müdirligi',
|
||||
bornPlace: 'Aşgabat şäheri',
|
||||
email: 'aman.amanow@email.com',
|
||||
phoneAdditional: '+993 65 334455',
|
||||
homePhone: '+993 12 456789',
|
||||
workCompany: 'Türkmennebit',
|
||||
workHrPhone: '+993 12 987654',
|
||||
workRegion: 'Aşgabat',
|
||||
workProvince: 'Büzmeýin etraby',
|
||||
position: 'Inžener',
|
||||
salary: 2500,
|
||||
workStartedAt: '2018-06-01',
|
||||
cardNumber: '4111111111111111',
|
||||
cardName: 'AMAN AMANOW',
|
||||
cardExpMonth: '12',
|
||||
cardExpYear: '2027',
|
||||
guarantor1Name: 'Berdi',
|
||||
guarantor1Surname: 'Berdiýew',
|
||||
guarantor1Patronic: 'Annagulyýewiç',
|
||||
guarantor1PassportSerie: 'II',
|
||||
guarantor1PassportNumber: '654321',
|
||||
guarantor1CardNumber: '4222222222222222',
|
||||
guarantor1CardName: 'BERDI BERDIÝEW',
|
||||
guarantor1CardExpMonth: '06',
|
||||
guarantor1CardExpYear: '2026',
|
||||
guarantor1Salary: 3000,
|
||||
},
|
||||
{
|
||||
id: 'L-1002',
|
||||
@@ -183,56 +211,159 @@ const MOCK_DATA: LoanOrder[] = [
|
||||
lastName: 'Berdiýewa',
|
||||
phone: '+993 61 445566',
|
||||
status: 'IŞLENÝÄR',
|
||||
note: null,
|
||||
loanAmount: 10000,
|
||||
loanHistory: 'new',
|
||||
patronicName: 'Myratowna',
|
||||
education: 'masters',
|
||||
marriageStatus: 'SINGLE',
|
||||
dateOfBirth: '1995-11-20',
|
||||
residence: 'Mary şäher, Gurbansoltan eje köçesi, 10',
|
||||
currentResidence: 'Mary şäher, Gurbansoltan eje köçesi, 10',
|
||||
passportSerie: 'I',
|
||||
passportNumber: '789012',
|
||||
passportDateOfIssue: '2018-07-22',
|
||||
passportGivenBy: 'Mary şäheriniň Içeri işler müdirligi',
|
||||
bornPlace: 'Mary şäheri',
|
||||
email: 'oguljan.berdiýewa@email.com',
|
||||
phoneAdditional: null,
|
||||
homePhone: null,
|
||||
workCompany: 'Mary ýangyn söndüriş bölümi',
|
||||
workHrPhone: '+993 55 112233',
|
||||
workRegion: 'Mary',
|
||||
workProvince: 'Mary şäher',
|
||||
position: 'Hasapçy',
|
||||
salary: 1800,
|
||||
workStartedAt: '2019-03-15',
|
||||
cardNumber: '4333333333333333',
|
||||
cardName: 'OGULJAN BERDIÝEWA',
|
||||
cardExpMonth: '09',
|
||||
cardExpYear: '2028',
|
||||
guarantor1Name: 'Merdan',
|
||||
guarantor1Surname: 'Merdanow',
|
||||
guarantor1Patronic: 'Amanowiç',
|
||||
guarantor1PassportSerie: 'I',
|
||||
guarantor1PassportNumber: '345678',
|
||||
guarantor1CardNumber: '4444444444444444',
|
||||
guarantor1CardName: 'MERDAN MERDANOW',
|
||||
guarantor1CardExpMonth: '03',
|
||||
guarantor1CardExpYear: '2025',
|
||||
guarantor1Salary: 2200,
|
||||
},
|
||||
]
|
||||
|
||||
let mockStore = [...MOCK_DATA]
|
||||
let nextId = 1003
|
||||
|
||||
const delay = (ms = 300) => new Promise((r) => setTimeout(r, ms))
|
||||
|
||||
// ─── API Functions ────────────────────────────────────────────────────────────
|
||||
|
||||
export async function fetchLoanOrders(
|
||||
params: LoanOrdersParams
|
||||
): Promise<LoanOrdersResponse> {
|
||||
// Mock — real API hazır bolanda aşakdaky commentden çykar
|
||||
await new Promise((resolve) => setTimeout(resolve, 800))
|
||||
await delay(600)
|
||||
const page = params.page || 1
|
||||
const perPage = params.perPage || 25
|
||||
const filtered = MOCK_DATA.filter(
|
||||
(item) =>
|
||||
!params.search ||
|
||||
item.firstName.toLowerCase().includes(params.search.toLowerCase()) ||
|
||||
item.id.toLowerCase().includes(params.search.toLowerCase())
|
||||
)
|
||||
const start = (page - 1) * perPage
|
||||
return {
|
||||
data: filtered.slice(start, start + perPage),
|
||||
total: filtered.length,
|
||||
page,
|
||||
perPage,
|
||||
}
|
||||
|
||||
// const { data } = await apiClient.get<LoanOrdersResponse>('/loan-orders', { params })
|
||||
// return data
|
||||
let filtered = mockStore.filter((item) => {
|
||||
const matchSearch =
|
||||
!params.search ||
|
||||
`${item.firstName} ${item.lastName}`.toLowerCase().includes(params.search.toLowerCase()) ||
|
||||
item.id.toLowerCase().includes(params.search.toLowerCase()) ||
|
||||
item.phone.includes(params.search)
|
||||
const matchStatus =
|
||||
!params.status
|
||||
? true
|
||||
: item.status === params.status
|
||||
const matchRegion =
|
||||
!params.region ? true : item.region === params.region
|
||||
const matchBranch =
|
||||
!params.branch ? true : item.branch === params.branch
|
||||
return matchSearch && matchStatus && matchRegion && matchBranch
|
||||
})
|
||||
|
||||
filtered = [...filtered].sort((a, b) => b.createdAt.localeCompare(a.createdAt))
|
||||
const total = filtered.length
|
||||
const start = (page - 1) * perPage
|
||||
const data = filtered.slice(start, start + perPage)
|
||||
|
||||
return { data, total, page, perPage }
|
||||
}
|
||||
|
||||
export async function getLoanOrderById(id: string): Promise<LoanOrder> {
|
||||
const { data } = await apiClient.get<LoanOrder>(`/loan-orders/${id}`)
|
||||
return data
|
||||
await delay(300)
|
||||
const item = mockStore.find((o) => o.id === id)
|
||||
if (!item) throw new Error('Not found')
|
||||
return { ...item }
|
||||
}
|
||||
|
||||
export async function createLoanOrder(
|
||||
payload: LoanOrderPayload
|
||||
): Promise<LoanOrder> {
|
||||
const { data } = await apiClient.post<LoanOrder>('/loan-orders', payload)
|
||||
return data
|
||||
await delay(500)
|
||||
const newItem = {
|
||||
id: `L-${nextId++}`,
|
||||
createdAt: new Date().toISOString().slice(0, 16).replace('T', ' '),
|
||||
...payload,
|
||||
} as LoanOrder
|
||||
mockStore = [newItem, ...mockStore]
|
||||
return newItem
|
||||
}
|
||||
|
||||
export async function updateLoanOrder(
|
||||
id: string,
|
||||
payload: Partial<LoanOrderPayload>
|
||||
): Promise<LoanOrder> {
|
||||
const { data } = await apiClient.put<LoanOrder>(`/loan-orders/${id}`, payload)
|
||||
return data
|
||||
await delay(500)
|
||||
const idx = mockStore.findIndex((o) => o.id === id)
|
||||
if (idx === -1) throw new Error('Not found')
|
||||
const updated = { ...mockStore[idx], ...payload } as LoanOrder
|
||||
mockStore = mockStore.map((o) => (o.id === id ? updated : o))
|
||||
return updated
|
||||
}
|
||||
|
||||
export async function deleteLoanOrder(id: string): Promise<void> {
|
||||
await apiClient.delete(`/loan-orders/${id}`)
|
||||
}
|
||||
await delay(300)
|
||||
mockStore = mockStore.filter((o) => o.id !== id)
|
||||
}
|
||||
|
||||
// ─── Branch options by region ─────────────────────────────────────────────────
|
||||
|
||||
export const BRANCHES_BY_REGION: Record<string, { value: string; label: string }[]> = {
|
||||
'Aşgabat': [
|
||||
{ value: 'Merkezi şahamça', label: 'Merkezi şahamça' },
|
||||
{ value: 'Garaşsyzlyk şahamçasy', label: 'Garaşsyzlyk şahamçasy' },
|
||||
{ value: 'Bitarap şahamça', label: 'Bitarap şahamça' },
|
||||
{ value: 'Aşgabat-1 şahamçasy', label: 'Aşgabat-1 şahamçasy' },
|
||||
{ value: 'Aşgabat-2 şahamçasy', label: 'Aşgabat-2 şahamçasy' },
|
||||
],
|
||||
'Ahal': [
|
||||
{ value: 'Änew şahamçasy', label: 'Änew şahamçasy' },
|
||||
{ value: 'Gökdepe şahamçasy', label: 'Gökdepe şahamçasy' },
|
||||
{ value: 'Tejen şahamçasy', label: 'Tejen şahamçasy' },
|
||||
],
|
||||
'Balkan': [
|
||||
{ value: 'Balkanabat şahamçasy', label: 'Balkanabat şahamçasy' },
|
||||
{ value: 'Türkmenbaşy şahamçasy', label: 'Türkmenbaşy şahamçasy' },
|
||||
{ value: 'Bereket şahamçasy', label: 'Bereket şahamçasy' },
|
||||
],
|
||||
'Daşoguz': [
|
||||
{ value: 'Daşoguz şahamçasy', label: 'Daşoguz şahamçasy' },
|
||||
{ value: 'Akdepe şahamçasy', label: 'Akdepe şahamçasy' },
|
||||
{ value: 'Boldumsaz şahamçasy', label: 'Boldumsaz şahamçasy' },
|
||||
],
|
||||
'Lebap': [
|
||||
{ value: 'Türkmenabat şahamçasy', label: 'Türkmenabat şahamçasy' },
|
||||
{ value: 'Seýdi şahamçasy', label: 'Seýdi şahamçasy' },
|
||||
{ value: 'Kerki şahamçasy', label: 'Kerki şahamçasy' },
|
||||
],
|
||||
'Mary': [
|
||||
{ value: 'Mary-1 şahamçasy', label: 'Mary-1 şahamçasy' },
|
||||
{ value: 'Mary-2 şahamçasy', label: 'Mary-2 şahamçasy' },
|
||||
{ value: 'Baýramaly şahamçasy', label: 'Baýramaly şahamçasy' },
|
||||
],
|
||||
'Arkadag': [
|
||||
{ value: 'Arkadag şahamçasy', label: 'Arkadag şahamçasy' },
|
||||
],
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { FormActions } from '@/components/formActions'
|
||||
import { StepBarCards, type StepCardItem } from '@/components/stepBarV2'
|
||||
import { useCreateLoanOrder, useUpdateLoanOrder } from '@/features/loanOrders/hooks/useLoanOrders'
|
||||
import type { LoanOrder, LoanOrderPayload } from '@/features/loanOrders/api/loanOrdersApi'
|
||||
import { BRANCHES_BY_REGION } from '@/features/loanOrders/api/loanOrdersApi'
|
||||
|
||||
// ─── Static options ───────────────────────────────────────────────────────────
|
||||
|
||||
@@ -387,7 +388,7 @@ interface StepContentProps {
|
||||
function StepStatus({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Ýagdaý">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="select"
|
||||
label="Status"
|
||||
@@ -400,7 +401,7 @@ function StepStatus({ form, errors, set }: StepContentProps) {
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Bellik">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="textarea"
|
||||
label="Bellik"
|
||||
@@ -417,7 +418,7 @@ function StepStatus({ form, errors, set }: StepContentProps) {
|
||||
function StepLoan({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Karz görnüşi">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="searchable-select"
|
||||
label="Karz görnüşi"
|
||||
@@ -430,7 +431,7 @@ function StepLoan({ form, errors, set }: StepContentProps) {
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Möçber">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="number"
|
||||
label="Karz möçberi"
|
||||
@@ -446,9 +447,11 @@ function StepLoan({ form, errors, set }: StepContentProps) {
|
||||
}
|
||||
|
||||
function StepLocation({ form, errors, set }: StepContentProps) {
|
||||
const branchOptions = BRANCHES_BY_REGION[form.region] ?? []
|
||||
|
||||
return (
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Welaýat">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="searchable-select"
|
||||
label="Welaýat"
|
||||
@@ -459,19 +462,16 @@ function StepLocation({ form, errors, set }: StepContentProps) {
|
||||
placeholder="Saýlamak üçin basyň"
|
||||
error={errors.region}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Welaýaty saýlasaňyz şahamçalar güncellenar.
|
||||
</p>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Şahamça">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="searchable-select"
|
||||
label="Şahamça"
|
||||
required
|
||||
value={form.branch}
|
||||
onChange={(v) => set('branch', v)}
|
||||
options={[]}
|
||||
options={branchOptions}
|
||||
placeholder="Saýlamak üçin basyň"
|
||||
disabled={!form.region}
|
||||
error={errors.branch}
|
||||
@@ -485,37 +485,37 @@ function StepPersonal({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title="Ady">
|
||||
<BentoCard>
|
||||
<FormInput type="text" label="Ady" required value={form.firstName} onChange={(v) => set('firstName', v)} placeholder="Ady" error={errors.firstName} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Familiýasy">
|
||||
<BentoCard>
|
||||
<FormInput type="text" label="Familiýasy" required value={form.lastName} onChange={(v) => set('lastName', v)} placeholder="Familiýasy" error={errors.lastName} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Atasynyň ady">
|
||||
<BentoCard>
|
||||
<FormInput type="text" label="Atasynyň ady" value={form.patronicName} onChange={(v) => set('patronicName', v)} placeholder="Atasynyň ady" />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title="Bilimi">
|
||||
<BentoCard >
|
||||
<FormInput type="select" label="Bilimi" required value={form.education} onChange={(v) => set('education', v)} options={EDUCATION_OPTIONS} placeholder="Saýlaň" error={errors.education} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Maşgala ýagdaýy">
|
||||
<BentoCard >
|
||||
<FormInput type="select" label="Maşgala ýagdaýy" required value={form.marriageStatus} onChange={(v) => set('marriageStatus', v)} options={MARRIAGE_OPTIONS} placeholder="Saýlaň" error={errors.marriageStatus} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Doglan güni">
|
||||
<BentoCard >
|
||||
<FormInput type="date" label="Doglan güni" required value={form.dateOfBirth} onChange={(v) => set('dateOfBirth', v)} error={errors.dateOfBirth} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Ýazgy edilen salgy">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Ýazgy edilen salgyňyz" required value={form.residence} onChange={(v) => set('residence', v)} placeholder="Ýazgy edilen salgy" error={errors.residence} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Häzirki ýaşaýyş ýeri">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Häzirki ýaşaýyş ýeri" value={form.currentResidence} onChange={(v) => set('currentResidence', v)} placeholder="Häzirki ýaşaýyş ýeri" />
|
||||
</BentoCard>
|
||||
<BentoCard title="Karz taryhy" span="full">
|
||||
<BentoCard span="full">
|
||||
<FormInput type="searchable-select" label="Karz taryhy" value={form.loanHistory} onChange={(v) => set('loanHistory', v)} options={[]} placeholder="Saýlamak üçin basyň" />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
@@ -543,22 +543,22 @@ function StepPassport({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title="Seriýasy">
|
||||
<BentoCard >
|
||||
<FormInput type="searchable-select" label="Pasport seriýasy" required value={form.passportSerie} onChange={(v) => set('passportSerie', v)} options={PASSPORT_SERIES_OPTIONS} placeholder="Saýlamak üçin basyň" error={errors.passportSerie} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Belgisi">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Pasport belgisi" required value={form.passportNumber} onChange={(v) => set('passportNumber', v)} placeholder="Pasport belgisi" error={errors.passportNumber} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Berlen senesi">
|
||||
<BentoCard >
|
||||
<FormInput type="date" label="Pasport berlen senesi" required value={form.passportDateOfIssue} onChange={(v) => set('passportDateOfIssue', v)} error={errors.passportDateOfIssue} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Kim tarapyndan berildi">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Kim tarapyndan berildi" required value={form.passportGivenBy} onChange={(v) => set('passportGivenBy', v)} placeholder="Kim tarapyndan berildi" error={errors.passportGivenBy} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Doglan ýeri">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Doglan ýeri (pasport)" value={form.bornPlace} onChange={(v) => set('bornPlace', v)} placeholder="Doglan ýeri (pasport)" />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
@@ -586,25 +586,25 @@ function StepJob({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Kärhana">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Işleýän edaranyň/kärhananyň ady" required value={form.workCompany} onChange={(v) => set('workCompany', v)} placeholder="Kärhananyň ady" error={errors.workCompany} />
|
||||
<FormInput type="phone" label="Işgärler bölüminiň iş belgisi" value={form.workHrPhone} onChange={(v) => set('workHrPhone', v)} placeholder="61 097 651" />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Iş ýeri">
|
||||
<BentoCard >
|
||||
<FormInput type="searchable-select" label="Işleýän welaýatyňyz" value={form.workRegion} onChange={(v) => set('workRegion', v)} options={REGION_OPTIONS} placeholder="Saýlamak üçin basyň" />
|
||||
<FormInput type="searchable-select" label="Işleýän etrabyňyz" value={form.workProvince} onChange={(v) => set('workProvince', v)} options={[]} placeholder="Saýlamak üçin basyň" />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title="Wezipe">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Wezipe" required value={form.position} onChange={(v) => set('position', v)} placeholder="Wezipe" error={errors.position} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Zähmet haky">
|
||||
<BentoCard>
|
||||
<FormInput type="number" label="Zähmet haky" required value={form.salary} onChange={(v) => set('salary', v)} placeholder="Zähmet haky" error={errors.salary} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Işe başlan wagty">
|
||||
<BentoCard>
|
||||
<FormInput type="date" label="Işe başlan wagtyňyz" required value={form.workStartedAt} onChange={(v) => set('workStartedAt', v)} error={errors.workStartedAt} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
@@ -644,7 +644,7 @@ function StepFiles({
|
||||
)}
|
||||
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Pasport (sahypa 1)">
|
||||
<BentoCard >
|
||||
<FormInput
|
||||
type="file"
|
||||
label={mode === 'edit' ? 'Pasport (sahypa 1) (çalyşmak)' : 'Pasport (sahypa 1)'}
|
||||
@@ -656,7 +656,7 @@ function StepFiles({
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Pasport (2-3-nji sahypa)">
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="file"
|
||||
label={mode === 'edit' ? 'Pasport (2-3-nji sahypa) (çalyşmak)' : 'Pasport (2-3-nji sahypa)'}
|
||||
@@ -668,7 +668,7 @@ function StepFiles({
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Pasport (8-9 sahypa)">
|
||||
<BentoCard >
|
||||
<FormInput
|
||||
type="file"
|
||||
label="Pasport (8-9 sahypa)"
|
||||
@@ -678,7 +678,7 @@ function StepFiles({
|
||||
/>
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Pasport (32-nji sahypa)">
|
||||
<BentoCard >
|
||||
<FormInput
|
||||
type="file"
|
||||
label="Pasport (32-nji sahypa)"
|
||||
@@ -696,33 +696,33 @@ function StepGuarantor({ form, errors, set }: StepContentProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<BentoGrid cols={3}>
|
||||
<BentoCard title="Ady">
|
||||
<BentoCard>
|
||||
<FormInput type="text" label="Zamunyň ady" required value={form.guarantor1Name} onChange={(v) => set('guarantor1Name', v)} placeholder="Zamunyň ady" error={errors.guarantor1Name} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Familiýasy">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Zamunyň familiýasy" required value={form.guarantor1Surname} onChange={(v) => set('guarantor1Surname', v)} placeholder="Zamunyň familiýasy" error={errors.guarantor1Surname} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Atasynyň ady">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Zamunyň atasynyň ady" value={form.guarantor1Patronic} onChange={(v) => set('guarantor1Patronic', v)} placeholder="Zamunyň atasynyň ady" />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Pasport seriýasy">
|
||||
<BentoCard >
|
||||
<FormInput type="searchable-select" label="Pasport seriýasy" required value={form.guarantor1PassportSerie} onChange={(v) => set('guarantor1PassportSerie', v)} options={PASSPORT_SERIES_OPTIONS} placeholder="Saýlamak üçin basyň" error={errors.guarantor1PassportSerie} />
|
||||
</BentoCard>
|
||||
<BentoCard title="Pasport belgisi">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Pasport belgisi" required value={form.guarantor1PassportNumber} onChange={(v) => set('guarantor1PassportNumber', v)} placeholder="Pasport belgisi" error={errors.guarantor1PassportNumber} />
|
||||
</BentoCard>
|
||||
</BentoGrid>
|
||||
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title="Kart maglumatlary">
|
||||
<BentoCard >
|
||||
<FormInput type="text" label="Kart belgisi" required value={form.guarantor1CardNumber} onChange={(v) => set('guarantor1CardNumber', v)} placeholder="Kart belgisi" error={errors.guarantor1CardNumber} />
|
||||
<FormInput type="text" label="Kartdaky ady" required value={form.guarantor1CardName} onChange={(v) => set('guarantor1CardName', v)} placeholder="Kartdaky ady" error={errors.guarantor1CardName} />
|
||||
</BentoCard>
|
||||
|
||||
<BentoCard title="Kart möhleti we zähmet haky">
|
||||
<BentoCard>
|
||||
<FormInput type="searchable-select" label="Möhleti (aý)" required value={form.guarantor1CardExpMonth} onChange={(v) => set('guarantor1CardExpMonth', v)} options={MONTH_OPTIONS} placeholder="Saýlamak üçin basyň" error={errors.guarantor1CardExpMonth} />
|
||||
<FormInput type="searchable-select" label="Möhleti (ýyl)" required value={form.guarantor1CardExpYear} onChange={(v) => set('guarantor1CardExpYear', v)} options={YEAR_OPTIONS} placeholder="Saýlamak üçin basyň" error={errors.guarantor1CardExpYear} />
|
||||
<FormInput type="number" label="Ortaca zähmet haky" required value={form.guarantor1Salary} onChange={(v) => set('guarantor1Salary', v)} placeholder="Ortaca zähmet haky" error={errors.guarantor1Salary} />
|
||||
@@ -923,16 +923,6 @@ export function LoanOrderForm({ mode, initialData, loanOrderId }: LoanOrderFormP
|
||||
<StepBarCards steps={stepBarItems} onGoTo={handleGoTo} />
|
||||
</div>
|
||||
|
||||
{/* Step label */}
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="inline-flex items-center px-2 py-0.5 rounded-full bg-primary/10 text-primary text-[11px] font-semibold tabular-nums">
|
||||
{currentStep + 1} / {STEPS.length}
|
||||
</span>
|
||||
<h2 className="text-sm font-semibold text-foreground">
|
||||
{t(STEPS[currentStep].titleKey) || STEPS[currentStep].titleFallback}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
{/* Step content */}
|
||||
{currentStep === 0 && <StepStatus {...stepProps} />}
|
||||
{currentStep === 1 && <StepLoan {...stepProps} />}
|
||||
|
||||
Reference in New Issue
Block a user