@atomsolution/sdk-merchant 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/dist/App.d.ts +3 -0
- package/dist/assets/locales/en/common.json.d.ts +18 -0
- package/dist/assets/locales/en/digistore-id.json.d.ts +32 -0
- package/dist/assets/locales/en/download-sample.json.d.ts +59 -0
- package/dist/assets/locales/en/file.json.d.ts +48 -0
- package/dist/assets/locales/en/form.json.d.ts +85 -0
- package/dist/assets/locales/en/merchant-batch-create-form.json.d.ts +92 -0
- package/dist/assets/locales/en/table.json.d.ts +36 -0
- package/dist/assets/locales/vi/common.json.d.ts +18 -0
- package/dist/assets/locales/vi/digistore-id.json.d.ts +32 -0
- package/dist/assets/locales/vi/download-sample.json.d.ts +59 -0
- package/dist/assets/locales/vi/file.json.d.ts +48 -0
- package/dist/assets/locales/vi/form.json.d.ts +85 -0
- package/dist/assets/locales/vi/merchant-batch-create-form.json.d.ts +92 -0
- package/dist/assets/locales/vi/table.json.d.ts +35 -0
- package/dist/bvbLogo.png +0 -0
- package/dist/components/MerchantBatchCreateForm/DownloadSampleFile.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/FileUpload/fileUploadButton.d.ts +6 -0
- package/dist/components/MerchantBatchCreateForm/FileUpload/sheetDropDown.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/Layout/Layout.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/CategoryCell.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/UploadImageCell.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/ProductPreviewTable/index.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/ProductInfoPreview/index.d.ts +2 -0
- package/dist/components/MerchantBatchCreateForm/fieldMappingPopup.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/fileUploadTab.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/hook/useFileValidator.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/index.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/mergeAndCheckData.d.ts +1 -0
- package/dist/components/MerchantBatchCreateForm/modals/CreateProductConfirmModal.d.ts +10 -0
- package/dist/components/MerchantBatchCreateForm/modals/CreateProductSuccessModal.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/modals/DeleteImageConfirmModal.d.ts +8 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/CategoriesInput/index.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/ActionButtons.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/AddOptionComponent.d.ts +13 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/OptionItem/EditOptionComponent.d.ts +14 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/OptionItem/index.d.ts +18 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/SelectButton.d.ts +11 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/DropdownContent/index.d.ts +22 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/index.d.ts +4 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/utils/LocalStorage.d.ts +6 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/UnitSelectUI/utils/validation.d.ts +7 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UnitSelect/index.d.ts +10 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/UploadImage.d.ts +12 -0
- package/dist/components/MerchantBatchCreateForm/modals/UpdateProductModal/index.d.ts +16 -0
- package/dist/components/MerchantBatchCreateForm/store/useMappingStore.d.ts +9 -0
- package/dist/components/MerchantBatchCreateForm/store/useUploadStore.d.ts +27 -0
- package/dist/components/MerchantBatchCreateForm/utils/download.d.ts +4 -0
- package/dist/components/MerchantBatchCreateForm/utils/upload.d.ts +5 -0
- package/dist/components/MerchantEdit/AddressFields.d.ts +16 -0
- package/dist/components/MerchantEdit/FileUpload.d.ts +13 -0
- package/dist/components/MerchantEdit/Header.d.ts +9 -0
- package/dist/components/MerchantEdit/UserTypeForm.d.ts +22 -0
- package/dist/components/MerchantEdit/index.d.ts +10 -0
- package/dist/components/MerchantRegistrationForm/AddressFields.d.ts +16 -0
- package/dist/components/MerchantRegistrationForm/FileUpload.d.ts +12 -0
- package/dist/components/MerchantRegistrationForm/Header.d.ts +9 -0
- package/dist/components/MerchantRegistrationForm/IndustrySelect.d.ts +8 -0
- package/dist/components/MerchantRegistrationForm/MerchantRegistrationForm.d.ts +37 -0
- package/dist/components/MerchantRegistrationForm/UserTypeForm.d.ts +21 -0
- package/dist/components/MerchantTable/index.d.ts +11 -0
- package/dist/components/MerchantTable/merchantTableAction.d.ts +8 -0
- package/dist/components/MerchantTable/merchantTableFilter.d.ts +16 -0
- package/dist/components/MerchantTable/merchantTableHeader.d.ts +6 -0
- package/dist/components/MerchantView/AddressFields.d.ts +16 -0
- package/dist/components/MerchantView/FileUpload.d.ts +13 -0
- package/dist/components/MerchantView/Header.d.ts +9 -0
- package/dist/components/MerchantView/UserTypeForm.d.ts +22 -0
- package/dist/components/MerchantView/index.d.ts +10 -0
- package/dist/components/NewAccountCreate/FormHeader.d.ts +8 -0
- package/dist/components/NewAccountCreate/Icon.d.ts +6 -0
- package/dist/components/NewAccountCreate/InputField.d.ts +21 -0
- package/dist/components/NewAccountCreate/PasswordRequirements.d.ts +6 -0
- package/dist/components/NewAccountCreate/RequirementItem.d.ts +6 -0
- package/dist/components/NewAccountCreate/SubmitButton.d.ts +11 -0
- package/dist/components/NewAccountCreate/index.d.ts +8 -0
- package/dist/components/NewAccountCreate/types.d.ts +7 -0
- package/dist/components/common/button.d.ts +11 -0
- package/dist/components/common/custom-toast/index.d.ts +6 -0
- package/dist/components/common/dataTable/dataTable.d.ts +25 -0
- package/dist/components/common/dataTable/pagination.d.ts +14 -0
- package/dist/components/common/dataTable/statusBadge.d.ts +9 -0
- package/dist/components/common/dataTable/tableBody.d.ts +8 -0
- package/dist/components/common/dataTable/tableHeader.d.ts +6 -0
- package/dist/components/common/dataTable/tableSkeleton.d.ts +7 -0
- package/dist/components/common/datePicker.d.ts +10 -0
- package/dist/components/common/dropdownMenu.d.ts +27 -0
- package/dist/components/common/dropdownMenuAbsolute.d.ts +4 -0
- package/dist/components/common/form/error-message.d.ts +14 -0
- package/dist/components/common/input.d.ts +3 -0
- package/dist/components/common/label.d.ts +6 -0
- package/dist/components/common/modals/ConfirmModal.d.ts +13 -0
- package/dist/components/common/modals/ExitConfirmGuard.d.ts +11 -0
- package/dist/components/common/modals/WrapModal.d.ts +9 -0
- package/dist/components/common/number-input.d.ts +5 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/confirmModal.d.ts +10 -0
- package/dist/components/ui/error-modal.d.ts +8 -0
- package/dist/components/ui/input.d.ts +18 -0
- package/dist/components/ui/success-modal.d.ts +8 -0
- package/dist/configs/portalAxiosClient.d.ts +2 -0
- package/dist/configs/wesapAxiosClient.d.ts +2 -0
- package/dist/constants/merchant-batch-create-form.constant.d.ts +4 -0
- package/dist/fonts/inter/Inter_18pt-Bold.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-Medium.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-Regular.ttf +0 -0
- package/dist/fonts/inter/Inter_18pt-SemiBold.ttf +0 -0
- package/dist/hooks/use-address.d.ts +9 -0
- package/dist/hooks/use-create-merchant.d.ts +20 -0
- package/dist/hooks/use-edit-merchant.d.ts +20 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-merchant-table.d.ts +13 -0
- package/dist/hooks/use-translation.d.ts +10 -0
- package/dist/hooks/useClickOutside.d.ts +3 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useMCCList.d.ts +6 -0
- package/dist/hooks/useMerchantDetail.d.ts +8 -0
- package/dist/hooks/usePasswordValidation.d.ts +9 -0
- package/dist/index.cjs +73887 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.esm.js +73871 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/main.d.ts +0 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/toast-provider.d.ts +2 -0
- package/dist/services/MCCList.d.ts +2 -0
- package/dist/services/addressService.d.ts +10 -0
- package/dist/services/create-products.service.d.ts +6 -0
- package/dist/services/createDigistoreAccountService.d.ts +7 -0
- package/dist/services/editFormService.d.ts +5 -0
- package/dist/services/merchantFormService.d.ts +5 -0
- package/dist/services/merchantService.d.ts +3 -0
- package/dist/store/use-external-config.store.d.ts +10 -0
- package/dist/store/use-portal-api-config.store.d.ts +8 -0
- package/dist/store/use-unsaved-changes.store.d.ts +11 -0
- package/dist/store/use-wesap-api-config.store.d.ts +10 -0
- package/dist/style.css +2971 -0
- package/dist/types/MCCList.d.ts +5 -0
- package/dist/types/addressType.d.ts +17 -0
- package/dist/types/formData.d.ts +58 -0
- package/dist/types/global.d.ts +3 -0
- package/dist/types/merchant-batch-create-form/product-info-preview.d.ts +45 -0
- package/dist/types/merchant-batch-create-form/sheet-product-validation.d.ts +10 -0
- package/dist/types/merchant-batch-create-form/table.d.ts +1 -0
- package/dist/types/merchant-batch-create-form/unit-select.d.ts +14 -0
- package/dist/types/merchantDetail.d.ts +30 -0
- package/dist/types/merchantTableData.d.ts +16 -0
- package/dist/types/user.d.ts +23 -0
- package/dist/utils/commonFunctions.d.ts +2 -0
- package/dist/utils/datetime.d.ts +8 -0
- package/dist/utils/form.d.ts +1 -0
- package/dist/utils/mapLicenseData.d.ts +25 -0
- package/dist/utils/merchantTableData.d.ts +3 -0
- package/dist/utils/tokenManager.d.ts +2 -0
- package/dist/utils/translations.d.ts +685 -0
- package/dist/vite.svg +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Country {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface City {
|
|
7
|
+
id?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export interface District {
|
|
11
|
+
id?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Ward {
|
|
15
|
+
id?: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface FormData {
|
|
2
|
+
userType: 'individual' | 'business' | 'enterprise';
|
|
3
|
+
phoneNumberSecond: string;
|
|
4
|
+
businessName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
branchName: string;
|
|
7
|
+
businessLicense: string | null;
|
|
8
|
+
taxLicense: string | null;
|
|
9
|
+
taxCode: string;
|
|
10
|
+
industry: string;
|
|
11
|
+
representative: string;
|
|
12
|
+
country: string;
|
|
13
|
+
city: string;
|
|
14
|
+
district: string;
|
|
15
|
+
ward: string;
|
|
16
|
+
address: string;
|
|
17
|
+
referralCode: string;
|
|
18
|
+
business_registration_number: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateMerchantPayload {
|
|
21
|
+
entity_type: "PERSON" | "BUSINESS_HOUSEHOLD" | "ENTERPRISE";
|
|
22
|
+
tax_code: string;
|
|
23
|
+
full_name: string;
|
|
24
|
+
brand_name?: string;
|
|
25
|
+
phone_number: string;
|
|
26
|
+
business_registration_number?: string;
|
|
27
|
+
email: string;
|
|
28
|
+
referral_code?: string;
|
|
29
|
+
industry: string;
|
|
30
|
+
business_license: File | null;
|
|
31
|
+
tax_license: File | null;
|
|
32
|
+
representative_name: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
city: string;
|
|
35
|
+
district: string;
|
|
36
|
+
ward: string;
|
|
37
|
+
street_address: string;
|
|
38
|
+
}
|
|
39
|
+
export interface EditMerchantPayload {
|
|
40
|
+
entity_type: "PERSON" | "BUSINESS_HOUSEHOLD" | "ENTERPRISE";
|
|
41
|
+
tax_code: string;
|
|
42
|
+
full_name: string;
|
|
43
|
+
brand_name?: string;
|
|
44
|
+
phone_number: string;
|
|
45
|
+
business_registration_number?: string;
|
|
46
|
+
email: string;
|
|
47
|
+
referral_code?: string;
|
|
48
|
+
industry: string;
|
|
49
|
+
business_license: File | null;
|
|
50
|
+
tax_license: File | null;
|
|
51
|
+
representative_name: string;
|
|
52
|
+
country?: string;
|
|
53
|
+
city: string;
|
|
54
|
+
district: string;
|
|
55
|
+
ward: string;
|
|
56
|
+
street_address: string;
|
|
57
|
+
partner_id: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const ProductPreviewSchema: z.ZodObject<{
|
|
3
|
+
img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
unit: z.ZodString;
|
|
6
|
+
code: z.ZodString;
|
|
7
|
+
price: z.ZodNumber;
|
|
8
|
+
category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
9
|
+
unitOfMesure: z.ZodOptional<z.ZodString>;
|
|
10
|
+
note: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const ProductSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
unit: z.ZodString;
|
|
17
|
+
code: z.ZodString;
|
|
18
|
+
price: z.ZodNumber;
|
|
19
|
+
category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
20
|
+
unitOfMesure: z.ZodOptional<z.ZodString>;
|
|
21
|
+
note: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const UnitSchema: z.ZodObject<{
|
|
24
|
+
unit: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type ProductPreview = z.infer<typeof ProductPreviewSchema>;
|
|
27
|
+
export type Product = z.infer<typeof ProductSchema>;
|
|
28
|
+
export type ProductPayload = {
|
|
29
|
+
code: string;
|
|
30
|
+
name: string;
|
|
31
|
+
price: number;
|
|
32
|
+
img: string;
|
|
33
|
+
cost: number;
|
|
34
|
+
tax: number;
|
|
35
|
+
unit: string;
|
|
36
|
+
status: number;
|
|
37
|
+
category_names: string[];
|
|
38
|
+
};
|
|
39
|
+
export type CreatedProductResponse = {
|
|
40
|
+
msg: string;
|
|
41
|
+
total_success: number;
|
|
42
|
+
total_failed: number;
|
|
43
|
+
products_err: string[];
|
|
44
|
+
err_details: string[];
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CategoryColor = 'yellow' | 'purple' | 'green' | 'red';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Option {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EditableSelectProps {
|
|
7
|
+
options: Option[];
|
|
8
|
+
value?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
onOptionsChange?: (options: Option[]) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
tempValueUI?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ApiResponse<T> {
|
|
2
|
+
data: T;
|
|
3
|
+
msg: string;
|
|
4
|
+
errors: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface MerchantDetail {
|
|
7
|
+
account_type: "PERSONAL" | "BUSINESS" | "HOUSEHOLD";
|
|
8
|
+
name: string;
|
|
9
|
+
branch_name: string;
|
|
10
|
+
industry: string;
|
|
11
|
+
email: string;
|
|
12
|
+
status: string;
|
|
13
|
+
vat: string;
|
|
14
|
+
company_registry: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
presentative: boolean;
|
|
17
|
+
country: string;
|
|
18
|
+
city: string;
|
|
19
|
+
district: string;
|
|
20
|
+
ward: string;
|
|
21
|
+
street: string;
|
|
22
|
+
referal_code: string;
|
|
23
|
+
tax_license: string;
|
|
24
|
+
business_license: string;
|
|
25
|
+
"industry_code": string;
|
|
26
|
+
"country_code": string;
|
|
27
|
+
"city_code": string;
|
|
28
|
+
"district_code": string;
|
|
29
|
+
"ward_code": string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ApplicantType = "ENTERPRISE" | "PERSONAL" | "HOUSEHOLD";
|
|
2
|
+
export type StatusType = "Chấp nhận" | "Đang xét duyệt" | "Từ chối" | "Bản nháp";
|
|
3
|
+
export interface Applicant {
|
|
4
|
+
index?: number;
|
|
5
|
+
submittedAt: string;
|
|
6
|
+
applicantType: ApplicantType;
|
|
7
|
+
name: string;
|
|
8
|
+
industry: string;
|
|
9
|
+
brandName: string;
|
|
10
|
+
businessId: string;
|
|
11
|
+
status: StatusType;
|
|
12
|
+
rejectNote?: string;
|
|
13
|
+
merchant_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MerchantInShort {
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type UserInfo = {
|
|
2
|
+
merchant_id: number;
|
|
3
|
+
account_type: string;
|
|
4
|
+
name: string;
|
|
5
|
+
business: string;
|
|
6
|
+
trademark: string;
|
|
7
|
+
tax_no: string;
|
|
8
|
+
representative_name: boolean;
|
|
9
|
+
position: boolean;
|
|
10
|
+
indentification_no: boolean;
|
|
11
|
+
merchant_code: string;
|
|
12
|
+
address: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
mobile: string;
|
|
15
|
+
email: string;
|
|
16
|
+
website: boolean;
|
|
17
|
+
acquirer_bank: object;
|
|
18
|
+
x_use_qrpay: boolean;
|
|
19
|
+
industry_code: string;
|
|
20
|
+
city: string;
|
|
21
|
+
is_fnb: boolean;
|
|
22
|
+
contact_type: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toFormData(obj: Record<string, any>): FormData;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ILicenseData } from 'ocr-upload-reader';
|
|
2
|
+
export declare const mapLicenseData: (data: ILicenseData) => {
|
|
3
|
+
organization: {
|
|
4
|
+
name: string;
|
|
5
|
+
address: string;
|
|
6
|
+
taxCode: string;
|
|
7
|
+
taxAuthority: string;
|
|
8
|
+
};
|
|
9
|
+
contactPerson: {
|
|
10
|
+
name: string;
|
|
11
|
+
address: string;
|
|
12
|
+
email: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
};
|
|
15
|
+
legalRepresentative: {
|
|
16
|
+
name: string;
|
|
17
|
+
dob: string;
|
|
18
|
+
gender: string;
|
|
19
|
+
phone: string;
|
|
20
|
+
idCard: string;
|
|
21
|
+
passportNumber: string;
|
|
22
|
+
nationality: string;
|
|
23
|
+
permanentAddress: string;
|
|
24
|
+
};
|
|
25
|
+
};
|