@atomsolution/sdk-merchant 1.4.2 → 1.5.3

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.
Files changed (44) hide show
  1. package/dist/assets/locales/en/download-sample.json.d.ts +9 -2
  2. package/dist/assets/locales/en/file.json.d.ts +5 -2
  3. package/dist/assets/locales/en/merchant-batch-create-form.json.d.ts +3 -1
  4. package/dist/assets/locales/vi/download-sample.json.d.ts +9 -2
  5. package/dist/assets/locales/vi/file.json.d.ts +5 -2
  6. package/dist/assets/locales/vi/merchant-batch-create-form.json.d.ts +3 -1
  7. package/dist/batch-product-creation/components/merchant-batch-create-form/field-mapping-popup.d.ts +2 -1
  8. package/dist/batch-product-creation/components/merchant-batch-create-form/file-upload-tab.d.ts +6 -1
  9. package/dist/batch-product-creation/components/merchant-batch-create-form/index.d.ts +6 -1
  10. package/dist/batch-product-creation/components/merchant-batch-create-form/merge-and-check-data.d.ts +5 -1
  11. package/dist/batch-product-creation/components/merchant-batch-create-form/modals/create-product-confirm-modal.d.ts +3 -1
  12. package/dist/batch-product-creation/components/merchant-batch-create-form/modals/update-product-modal/index.d.ts +2 -1
  13. package/dist/batch-product-creation/components/merchant-batch-create-form/product-info-preview/index.d.ts +5 -1
  14. package/dist/batch-product-creation/components/merchant-batch-create-form/product-info-preview/product-preview-table/index.d.ts +2 -2
  15. package/dist/batch-product-creation/store/use-upload-store.d.ts +3 -1
  16. package/dist/batch-product-creation/types/product-info-preview.d.ts +32 -3
  17. package/dist/batch-product-creation.cjs +729 -547
  18. package/dist/batch-product-creation.cjs.map +1 -1
  19. package/dist/batch-product-creation.esm.js +730 -548
  20. package/dist/batch-product-creation.esm.js.map +1 -1
  21. package/dist/batch-product-creation.js +730 -548
  22. package/dist/batch-product-creation.js.map +1 -1
  23. package/dist/components/MerchantBatchCreateForm/index.d.ts +6 -0
  24. package/dist/digistore.cjs +1 -1
  25. package/dist/digistore.esm.js +1 -1
  26. package/dist/digistore.js +1 -1
  27. package/dist/{dropdownMenuAbsolute-BKV3mzgE.cjs → dropdownMenuAbsolute-77lk7HqZ.cjs} +2 -2
  28. package/dist/{dropdownMenuAbsolute-BKV3mzgE.cjs.map → dropdownMenuAbsolute-77lk7HqZ.cjs.map} +1 -1
  29. package/dist/{dropdownMenuAbsolute-BreOsoPt.js → dropdownMenuAbsolute-x0WsXrLZ.js} +2 -2
  30. package/dist/{dropdownMenuAbsolute-BreOsoPt.js.map → dropdownMenuAbsolute-x0WsXrLZ.js.map} +1 -1
  31. package/dist/{index.esm-DPmk5fdS.js → index.esm-CW4gWR7r.js} +3 -3
  32. package/dist/{index.esm-DPmk5fdS.js.map → index.esm-CW4gWR7r.js.map} +1 -1
  33. package/dist/merchant-profile.cjs +2 -2
  34. package/dist/merchant-profile.esm.js +2 -2
  35. package/dist/merchant-profile.js +2 -2
  36. package/dist/permission.esm.js +1 -1
  37. package/dist/permission.js +1 -1
  38. package/dist/style.css +8 -0
  39. package/dist/{use-translation-Df6YK55O.js → use-translation-CEr2fmqT.js} +41 -11
  40. package/dist/{use-translation-Df6YK55O.js.map → use-translation-CEr2fmqT.js.map} +1 -1
  41. package/dist/{use-translation-OSujcs4v.cjs → use-translation-CN8MTMJN.cjs} +41 -11
  42. package/dist/{use-translation-OSujcs4v.cjs.map → use-translation-CN8MTMJN.cjs.map} +1 -1
  43. package/dist/utils/translations.d.ts +22 -2
  44. package/package.json +1 -1
@@ -24,8 +24,15 @@ declare const _default: {
24
24
  "requirementClass": "text-red-500",
25
25
  "example": "BEEF BELLY IN SAUCE (KOREA)"
26
26
  },
27
- "price": {
28
- "title": "Price",
27
+ "taxVAT": {
28
+ "title": "Tax VAT",
29
+ "format": "- It is one of four values: 0, 5, 8, 10",
30
+ "requirement": "Required",
31
+ "requirementClass": "text-red-500",
32
+ "example": "Valid: 0, 5, 8, 10 <br/>Invalid: Letters, decimal numbers, special characters,..."
33
+ },
34
+ "priceAfterTax": {
35
+ "title": "Price After Tax",
29
36
  "format": "- Integer <b>&gt;= 1,000 VND</b>. No negative values, no decimals.",
30
37
  "requirement": "Required",
31
38
  "requirementClass": "text-red-500",
@@ -18,7 +18,9 @@ declare const _default: {
18
18
  "systemFields": [
19
19
  "Product Code",
20
20
  "Product Name",
21
- "Price",
21
+ "Price before tax",
22
+ "Tax (VAT)",
23
+ "Price after tax",
22
24
  "Unit",
23
25
  "Product Category"
24
26
  ],
@@ -41,7 +43,8 @@ declare const _default: {
41
43
  "close": "Close",
42
44
  "stopUpload": "Stop upload",
43
45
  "mergeDataTitle": "Merge Fields & Validate Data",
44
- "mergeDescription": "Each upload is limited to 1 file and up to 100 rows of information (products).\n If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).\n\nPreview data from the .xlsx file. Map each column in the file to a system field to continue creating products."
46
+ "mergeDescription": "Each upload is limited to 1 file and up to 100 rows of information (products).\n If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).\n\nPreview data from the .xlsx file. Map each column in the file to a system field to continue creating products.",
47
+ "directTaxNote": "The system has automatically applied the tax method to all products using the <span class='font-bold'>Direct tax setting method.</span>"
45
48
  }
46
49
  ;
47
50
 
@@ -10,7 +10,9 @@ declare const _default: {
10
10
  "no_image": "No Image",
11
11
  "name": "Product Name",
12
12
  "code": "Product Code",
13
- "price_vat": "Price",
13
+ "price_vat": "Price after tax",
14
+ "tax": "Tax VAT",
15
+ "price_without_vat": "Price before tax",
14
16
  "category": "Category",
15
17
  "unit": "Unit",
16
18
  "not_available": "Not available",
@@ -24,8 +24,15 @@ declare const _default: {
24
24
  "requirementClass": "text-red-500",
25
25
  "example": "BA CHỈ BÒ NƯỚC SỐT THỊT (HÀN QUỐC)"
26
26
  },
27
- "price": {
28
- "title": "Giá",
27
+ "taxVAT": {
28
+ "title": "Thuế VAT",
29
+ "format": "- Là một trong 04 giá trị: 0, 5, 8, 10",
30
+ "requirement": "Bắt buộc",
31
+ "requirementClass": "text-red-500",
32
+ "example": "Hợp lệ: 0, 5, 8, 10 <br/>Không hợp lệ: Chữ cái, số thập phân, ký tự đặc biệt,..."
33
+ },
34
+ "priceAfterTax": {
35
+ "title": "Giá bán sau thuế",
29
36
  "format": "- Số nguyên <b>&gt;= 1.000 VND</b>. Không âm, không thập phân.",
30
37
  "requirement": "Bắt buộc",
31
38
  "requirementClass": "text-red-500",
@@ -18,7 +18,9 @@ declare const _default: {
18
18
  "systemFields": [
19
19
  "Mã sản phẩm",
20
20
  "Tên sản phẩm",
21
- "Giá",
21
+ "Giá bán trước thuế",
22
+ "Thuế VAT",
23
+ "Giá bán sau thuế",
22
24
  "Đơn vị tính",
23
25
  "Danh mục sản phẩm"
24
26
  ],
@@ -41,7 +43,8 @@ declare const _default: {
41
43
  "close": "Đóng",
42
44
  "stopUpload": "Ngưng tải lên",
43
45
  "mergeDataTitle": "Ghép trường & Kiểm tra dữ liệu",
44
- "mergeDescription": "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). \n Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).\n \nXem trước dữ liệu từ file .xlsx. Ghép từng cột trong file với trường của hệ thống để tiếp tục tạo sản phẩm."
46
+ "mergeDescription": "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). \n Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).\n \nXem trước dữ liệu từ file .xlsx. Ghép từng cột trong file với trường của hệ thống để tiếp tục tạo sản phẩm.",
47
+ "directTaxNote": "Hệ thống đã tự động áp dụng cho toàn bộ sản phẩm theo phương pháp thiết lập thuế <span class='font-bold'>Trực tiếp.</span>"
45
48
  }
46
49
  ;
47
50
 
@@ -10,7 +10,9 @@ declare const _default: {
10
10
  "no_image": "Không có ảnh",
11
11
  "name": "Tên sản phẩm",
12
12
  "code": "Mã sản phẩm",
13
- "price_vat": "Giá",
13
+ "price_vat": "Giá bán sau thuế",
14
+ "tax": "Thuế VAT",
15
+ "price_without_vat": "Giá bán trước thuế",
14
16
  "category": "Danh mục sản phẩm",
15
17
  "unit": "Đơn vị tính",
16
18
  "not_available": "Chưa có",
@@ -3,6 +3,7 @@ interface FieldMappingPopoverProps {
3
3
  mappings: Record<string, string>;
4
4
  defaultMappings: Record<string, string>;
5
5
  onChange?: (mappings: Record<string, string>) => void;
6
+ taxDeductionMethod: "direct" | "credit";
6
7
  }
7
- export default function FieldMappingPopup({ sheetHeaders, mappings, defaultMappings, onChange, }: FieldMappingPopoverProps): import("react/jsx-runtime").JSX.Element;
8
+ export default function FieldMappingPopup({ sheetHeaders, mappings, defaultMappings, onChange, taxDeductionMethod, }: FieldMappingPopoverProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1 +1,6 @@
1
- export default function FileUploadTab(): import("react/jsx-runtime").JSX.Element;
1
+ type FileUploadTabProps = {
2
+ taxDeductionMethod: "direct" | "credit";
3
+ directTax?: number;
4
+ };
5
+ export default function FileUploadTab({ taxDeductionMethod, directTax, }: FileUploadTabProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1 +1,6 @@
1
- export declare const MerchantBatchCreateForm: ({}: {}) => import("react/jsx-runtime").JSX.Element;
1
+ type MerchantBatchCreateFormProps = {
2
+ taxDeductionMethod?: "direct" | "credit";
3
+ directTax?: number;
4
+ };
5
+ export declare const MerchantBatchCreateForm: ({ taxDeductionMethod, directTax, }: MerchantBatchCreateFormProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1 +1,5 @@
1
- export default function MergeAndCheckData(): import("react/jsx-runtime").JSX.Element;
1
+ type Props = {
2
+ taxDeductionMethod: "direct" | "credit";
3
+ };
4
+ export default function MergeAndCheckData({ taxDeductionMethod }: Props): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -5,6 +5,8 @@ type Props = {
5
5
  open: boolean;
6
6
  onClose: () => void;
7
7
  onSuccess: (data: CreatedProductResponse) => void;
8
+ taxDeductionMethod: "direct" | "credit";
9
+ directTax?: number;
8
10
  };
9
- declare const CreateProductConfirmModal: ({ checkedProducts, numCheckedProducts, open, onClose, onSuccess, }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ declare const CreateProductConfirmModal: ({ checkedProducts, numCheckedProducts, open, onClose, onSuccess, taxDeductionMethod, directTax, }: Props) => import("react/jsx-runtime").JSX.Element;
10
12
  export default CreateProductConfirmModal;
@@ -11,6 +11,7 @@ type Props = {
11
11
  }) | null;
12
12
  productsTableData: ProductPreview[];
13
13
  setProductsTableData: React.Dispatch<React.SetStateAction<ProductPreview[]>>;
14
+ taxDeductionMethod: "direct" | "credit";
14
15
  };
15
- declare const UpdateProductModal: ({ product, disable, open, onClose, productsTableData, setProductsTableData, }: Props) => import("react/jsx-runtime").JSX.Element;
16
+ declare const UpdateProductModal: ({ product, disable, open, onClose, productsTableData, setProductsTableData, taxDeductionMethod, }: Props) => import("react/jsx-runtime").JSX.Element;
16
17
  export default UpdateProductModal;
@@ -1,2 +1,6 @@
1
- declare const ProductInfoPreview: () => import("react/jsx-runtime").JSX.Element;
1
+ type Props = {
2
+ taxDeductionMethod: "direct" | "credit";
3
+ directTax?: number;
4
+ };
5
+ declare const ProductInfoPreview: ({ taxDeductionMethod, directTax }: Props) => import("react/jsx-runtime").JSX.Element;
2
6
  export default ProductInfoPreview;
@@ -1,8 +1,8 @@
1
1
  import { ProductPreview } from '../../../../types/product-info-preview';
2
- import { default as React } from 'react';
3
2
  type Props = {
4
3
  checkedProducts: ProductPreview[];
5
4
  setCheckedProducts: React.Dispatch<React.SetStateAction<ProductPreview[]>>;
5
+ taxDeductionMethod: "direct" | "credit";
6
6
  };
7
- declare const ProductPreviewTable: ({ checkedProducts, setCheckedProducts, }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ declare const ProductPreviewTable: ({ checkedProducts, setCheckedProducts, taxDeductionMethod, }: Props) => import("react/jsx-runtime").JSX.Element;
8
8
  export default ProductPreviewTable;
@@ -1,7 +1,9 @@
1
1
  export interface ProductPreview {
2
2
  name: string;
3
3
  code: string;
4
- price: number | null;
4
+ priceBeforeTax: number;
5
+ tax: number;
6
+ priceAfterTax: number | null;
5
7
  category: string;
6
8
  unit: string;
7
9
  note: string;
@@ -1,21 +1,48 @@
1
- import * as z from 'zod';
1
+ import * as z from "zod";
2
2
  export declare const ProductPreviewSchema: z.ZodObject<{
3
3
  img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
4
4
  name: z.ZodString;
5
5
  unit: z.ZodString;
6
6
  code: z.ZodString;
7
- price: z.ZodNumber;
7
+ priceBeforeTax: z.ZodOptional<z.ZodNumber>;
8
+ tax: z.ZodNumber;
9
+ priceAfterTax: z.ZodNumber;
8
10
  category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
9
11
  unitOfMesure: z.ZodOptional<z.ZodString>;
10
12
  note: z.ZodOptional<z.ZodString>;
11
13
  }, z.core.$strip>;
14
+ export declare const createProductPreviewSchema: (method: "direct" | "credit") => z.ZodObject<{
15
+ img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
16
+ name: z.ZodString;
17
+ unit: z.ZodString;
18
+ code: z.ZodString;
19
+ priceBeforeTax: z.ZodOptional<z.ZodNumber>;
20
+ tax: z.ZodNumber;
21
+ priceAfterTax: z.ZodNumber;
22
+ category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
23
+ unitOfMesure: z.ZodOptional<z.ZodString>;
24
+ note: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip> | z.ZodObject<{
26
+ img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
27
+ name: z.ZodString;
28
+ unit: z.ZodString;
29
+ code: z.ZodString;
30
+ priceBeforeTax: z.ZodOptional<z.ZodNumber>;
31
+ priceAfterTax: z.ZodNumber;
32
+ category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
33
+ unitOfMesure: z.ZodOptional<z.ZodString>;
34
+ note: z.ZodOptional<z.ZodString>;
35
+ tax: z.ZodAny;
36
+ }, z.core.$strip>;
12
37
  export declare const ProductSchema: z.ZodObject<{
13
38
  id: z.ZodString;
14
39
  img: z.ZodUnion<[z.ZodURL, z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"">, z.ZodNull]>>]>;
15
40
  name: z.ZodString;
16
41
  unit: z.ZodString;
17
42
  code: z.ZodString;
18
- price: z.ZodNumber;
43
+ priceBeforeTax: z.ZodOptional<z.ZodNumber>;
44
+ tax: z.ZodNumber;
45
+ priceAfterTax: z.ZodNumber;
19
46
  category: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
20
47
  unitOfMesure: z.ZodOptional<z.ZodString>;
21
48
  note: z.ZodOptional<z.ZodString>;
@@ -29,6 +56,8 @@ export type ProductPayload = {
29
56
  code: string;
30
57
  name: string;
31
58
  price: number;
59
+ priceBeforeTax?: number;
60
+ priceAfterTax?: number;
32
61
  img: string;
33
62
  cost: number;
34
63
  tax: number;