register update

This commit is contained in:
Samandar Turgunboyev
2026-03-18 17:56:26 +05:00
parent a34cf75c57
commit 22c1688781
31 changed files with 631 additions and 1080 deletions

View File

@@ -1,6 +1,6 @@
import httpClient from '@/api/httpClient';
import { API_URLS } from '@/api/URLs';
import { AxiosResponse } from 'axios';
import axios, { AxiosResponse } from 'axios';
interface ConfirmBody {
status: boolean;
@@ -13,307 +13,70 @@ interface ConfirmBody {
};
}
export interface CompanyInfo {
id: number;
inn: string;
registration_authority: string;
registration_date: string;
registration_number: string;
name: string;
short_name: string;
opf_code: string;
opf_name: string;
oked_code: string;
vat_number: string;
oked_name: string;
area: string;
region: string;
soogu_code: string;
soogu_name: string;
small_businesses: string;
activity_state: number;
statutory_fund: string;
activity_state_detail: ActivityStateDetail;
business_type_detail: BusinessTypeDetail;
director: string;
email: string;
village_code: string;
email_status: number;
phones: string[];
soato_code: string;
soato_name: string;
address: string;
relevance_date: string;
court_relevance_date: string | null;
deal_relevance_date: string | null;
tax_mode: number;
trust: string;
score: number;
itpark: number;
leasing_count_all: number | null;
leasing_count_not_finish: number | null;
leasing_sum: number | null;
leasing_is_delay: number | null;
leasing_debt: number | null;
leasing_is_partner: number | null;
leasing_relevance_date: string | null;
is_bankrupt: number;
is_abuse_vat: number;
is_large_taxpayer: number;
vendor_rating: number | null;
developer_rating: number | null;
dishonest_executor: DishonestExecutor;
village_detail: VillageDetail;
company_billing_address: BillingAddress;
actual_date: string;
kfs: Kfs;
uuid: string;
connections: Connections;
courts: Courts;
director_uuid: string;
founders: Founder[];
deals: Deals;
licenses: Licenses;
leasing_guarantor_pinfl: string | null;
leasing_guarantor_inn: string | null;
buildings: Buildings;
cadastres: Cadastres;
liquidation_date: string | null;
liquidation_reason: string | null;
is_suppliers: number;
}
export interface ActivityStateDetail {
id: number;
group: string;
name: string;
name_en: string;
name_uz: string;
name_uz_kir: string;
export interface GetInfo {
VATRegCode: null | string
VATRegStatus: null | string
account: string
accountant: null | string
address: string
bankAccount: string
bankCode: string
director: string | null
directorPinfl: string | null
directorTin: null | string
fullName: string
fullname: string
isBudget: number
isItd: boolean
mfo: string
na1Code: null | string
na1Name: null | string
name: string
ns10Code: number
ns11Code: number
oked: null | string
peasantFarm: boolean
personalNum: string
privateNotary: boolean
regDate: null | string
selfEmployment: boolean
shortName: string
shortname: string
statusCode: null | string
statusName: null | string
tin: string
}
export interface BusinessTypeDetail {
id: number;
external_id: number;
name: string;
name_uz: string;
name_en: string;
export interface GetDistrict {
districtId: string,
regionId: number,
districtCode: number,
name: string
}
export interface DishonestExecutor {
is_dishonest_executor: number;
delete_date: string | null;
export interface GetRegion {
regionId: number,
name: string
}
export interface VillageDetail {
code: number;
name: string;
}
export interface BillingAddress {
country_code: number;
region_code: number;
region_name: string;
region_name_en: string;
region_name_uz: string;
district_code: number;
district_name: string;
district_name_en: string;
district_name_uz: string;
sector_code: number;
street_name: string;
house: string | null;
flat: string | null;
postcode: string;
}
export interface Kfs {
code: number;
name: string;
name_ru: string;
name_uz_cyr: string;
name_uz_lat: string;
}
export interface Connections {
director: number;
founders: number;
entrepreneur: number;
all: number;
}
export interface Courts {
total: number;
current: number;
completed: number;
}
export interface Founder {
name: string;
percentage: number;
is_individual: number;
person_type: string;
id: number | null;
founder_uuid: string;
}
export interface Deals {
customer: DealSide;
provider: DealSide;
actual_date: string;
}
export interface DealSide {
rows: any[];
total: number;
summ: number | null;
}
export interface Licenses {
total: number;
relevance_date: string;
actual_date: string;
}
export interface Buildings {
total: number;
}
export interface Cadastres {
total: number;
relevance_date: string | null;
}
export interface GetInfoResponse {
status: boolean;
data: CompanyInfo | IndividualInfo;
}
export interface IndividualInfo {
uuid: string,
id: number,
lastname: string,
firstname: string,
middlename: string,
registered_at: string,
unregistered_at: null | string,
activities: {
code: number,
name_en: string,
name_uz: string,
name_ru: string
}[]
}
export interface GetDirectorInfoResponse {
export interface GetTokens {
status: boolean,
data: {
entity: {
name: {
rows: {
id: number,
inn: string,
name: string,
director: string,
email: string,
phones: string[],
founders: {
name: string,
percentage: number,
is_individual: number,
person_type: string,
id: number | null,
founder_uuid: string
}[],
activity_state: number,
registration_date: string,
oked_code: string,
oked_name: string,
statutory_fund: string,
address: string,
variant: null
}[],
total: number
},
inn: {
rows: [],
total: 0
},
director: {
rows: [],
total: 0
},
founder: {
rows: {
id: number,
inn: string,
name: string,
director: string,
email: string,
phones: string[],
founders:
{
name: string,
percentage: number,
is_individual: number,
person_type: string,
id: number | null,
founder_uuid: string
}[],
activity_state: number,
registration_date: string,
oked_code: string,
oked_name: string,
statutory_fund: string,
address: string,
variant: null
}[],
total: number
},
email: {
rows: [],
total: number
},
phone: {
rows: [],
total: number
}
links: {
previous: null | string,
next: null | string
},
entrepreneur: {
rows:
{
id: number,
pinfl: string,
entrepreneur: string,
email: string,
phone: string,
registration_date: string
}[],
total: number
},
trademark: {
rows: [],
total: number
}
total_items: number,
total_pages: number,
page_size: number,
current_page: number,
results:
{
id: number,
key: string,
value: string,
is_active: boolean
}[]
}
}
@@ -332,25 +95,60 @@ export const auth_api = {
return res;
},
async get_info(body: { value: string, type: string, passport_series?: string, passport_number?: string }): Promise<AxiosResponse<GetInfoResponse>> {
const res = await httpClient.post(API_URLS.Info, body);
return res;
async get_info(body: { value: string, token: string, tokenName: string }): Promise<AxiosResponse<GetInfo>> {
try {
const res = await axios.get(`https://testapi3.didox.uz/v1/utils/info/${body.value}`, {
headers: {
"Accept-Language": "uz",
[body.tokenName]: body.token
}
});
return res;
} catch (error) {
throw error;
}
},
async get_director_info(body: { value: string }): Promise<AxiosResponse<GetDirectorInfoResponse>> {
const res = await httpClient.post(API_URLS.Get_Director_Info, body);
return res;
async get_district(): Promise<AxiosResponse<GetDistrict[]>> {
try {
const res = await axios.get(`https://testapi3.didox.uz/v1/districts/all/`, {
headers: {
"Accept-Language": "uz",
"Partner-Authorization": `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzYsInN0YXR1cyI6IkFDVElWRSIsIm5hbWUiOiJcIkZFTElYIC0gSVRTXCIgTUNISiIsInJvbGUiOiJQQVJUTkVSIiwidGluIjoiMzA3NTA0MzQ4IiwiaWF0IjoxNzczMzkyMjcwfQ.Q-cIBl4Z784Fq5jdRUEVYF2iaUd7_5RD2sFsJeh-Xno `
}
});
return res;
} catch (error) {
throw error;
}
},
async get_region(): Promise<AxiosResponse<GetRegion[]>> {
try {
const res = await axios.get(`https://testapi3.didox.uz/v1/regions/all/`, {
headers: {
"Accept-Language": "uz",
"Partner-Authorization": `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzYsInN0YXR1cyI6IkFDVElWRSIsIm5hbWUiOiJcIkZFTElYIC0gSVRTXCIgTUNISiIsInJvbGUiOiJQQVJUTkVSIiwidGluIjoiMzA3NTA0MzQ4IiwiaWF0IjoxNzczMzkyMjcwfQ.Q-cIBl4Z784Fq5jdRUEVYF2iaUd7_5RD2sFsJeh-Xno `
}
});
return res;
} catch (error) {
throw error;
}
},
async register(body: {
phone: string;
stir: string;
person_type: string;
referal: string;
referral: string;
activate_types: number[];
director_full_name: string;
first_name: string;
last_name: string;
district: number;
address: number;
company_name: string;
}) {
const res = await httpClient.post(API_URLS.Register, body);
return res;
@@ -365,4 +163,10 @@ export const auth_api = {
const res = await httpClient.post(API_URLS.Register_Resend, body);
return res;
},
async get_tokens(): Promise<AxiosResponse<GetTokens>> {
const res = httpClient.get(API_URLS.GetTokens)
return res
},
};