@longvansoftware/service-js-client 1.16.1 → 1.16.2
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 -93
- package/dist/src/graphql/accounting_service/mutations.js +96 -96
- package/dist/src/graphql/accounting_service/queries.js +57 -57
- package/dist/src/graphql/auth/mutations.js +235 -235
- package/dist/src/graphql/auth/queries.js +68 -68
- package/dist/src/graphql/cloud/mutations.js +282 -282
- package/dist/src/graphql/cloud/queries.js +341 -341
- package/dist/src/graphql/computing/mutations.js +303 -303
- package/dist/src/graphql/computing/queries.js +548 -548
- package/dist/src/graphql/crm/mutations.js +390 -390
- package/dist/src/graphql/crm/queries.js +357 -357
- package/dist/src/graphql/crm_camping/mutations.js +32 -32
- package/dist/src/graphql/crm_camping/queries.js +228 -199
- package/dist/src/graphql/orderGraphQL/mutations.js +351 -351
- package/dist/src/graphql/orderGraphQL/queries.js +387 -387
- package/dist/src/graphql/payment/mutations.js +45 -45
- package/dist/src/graphql/payment/queries.js +60 -60
- package/dist/src/graphql/paymentLV/mutations.js +19 -19
- package/dist/src/graphql/paymentLV/queries.js +75 -75
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +910 -892
- package/dist/src/graphql/quicklab_service/mutations.js +154 -154
- package/dist/src/graphql/quicklab_service/queries.js +108 -108
- package/dist/src/graphql/resource_permission/mutations.js +57 -57
- package/dist/src/graphql/resource_permission/queries.js +13 -13
- package/dist/src/graphql/service/mutations.js +228 -228
- package/dist/src/graphql/service/queries.js +128 -128
- package/dist/src/graphql/user/mutations.js +214 -214
- package/dist/src/graphql/user/queries.js +312 -312
- package/dist/src/lib/crm_camping/index.d.ts +1 -1
- package/dist/src/lib/crm_camping/index.js +10 -6
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +18 -0
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/lib/serviceSDK.js +12 -12
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +43 -44
- package/dist/src/graphql/campaign/mutations.d.ts +0 -1
- package/dist/src/graphql/campaign/mutations.js +0 -34
- package/dist/src/graphql/campaign/queries.d.ts +0 -9
- package/dist/src/graphql/campaign/queries.js +0 -412
- package/dist/src/graphql/cashbook/queries.d.ts +0 -2
- package/dist/src/graphql/cashbook/queries.js +0 -99
- package/dist/src/graphql/paymentV2/mutations.d.ts +0 -3
- package/dist/src/graphql/paymentV2/mutations.js +0 -54
- package/dist/src/graphql/paymentV2/queries.d.ts +0 -6
- package/dist/src/graphql/paymentV2/queries.js +0 -186
- package/dist/src/graphql/store/mutations.d.ts +0 -1
- package/dist/src/graphql/store/mutations.js +0 -29
- package/dist/src/graphql/store/queries.d.ts +0 -1
- package/dist/src/graphql/store/queries.js +0 -29
- package/dist/src/lib/accounting/index.d.ts +0 -5
- package/dist/src/lib/accounting/index.js +0 -32
- package/dist/src/lib/campaign/index.d.ts +0 -20
- package/dist/src/lib/campaign/index.js +0 -213
- package/dist/src/lib/cashbook/index.d.ts +0 -6
- package/dist/src/lib/cashbook/index.js +0 -56
- package/dist/src/lib/comhub/index.d.ts +0 -6
- package/dist/src/lib/comhub/index.js +0 -50
- package/dist/src/lib/deepLinkVietQr/index.d.ts +0 -6
- package/dist/src/lib/deepLinkVietQr/index.js +0 -45
- package/dist/src/lib/getImage/index.d.ts +0 -4
- package/dist/src/lib/getImage/index.js +0 -10
- package/dist/src/lib/image/index.d.ts +0 -7
- package/dist/src/lib/image/index.js +0 -49
- package/dist/src/lib/omnigateway/index.d.ts +0 -7
- package/dist/src/lib/omnigateway/index.js +0 -58
- package/dist/src/lib/paymentV2/index.d.ts +0 -13
- package/dist/src/lib/paymentV2/index.js +0 -163
- package/dist/src/lib/portal/index.d.ts +0 -21
- package/dist/src/lib/portal/index.js +0 -225
- package/dist/src/lib/store/index.d.ts +0 -30
- package/dist/src/lib/store/index.js +0 -74
- package/dist/src/lib/token/index.d.ts +0 -5
- package/dist/src/lib/token/index.js +0 -32
- package/dist/src/lib/upload/index.d.ts +0 -5
- package/dist/src/lib/upload/index.js +0 -35
- package/dist/src/lib/warehouseV2/index.d.ts +0 -13
- package/dist/src/lib/warehouseV2/index.js +0 -54
- package/dist/src/lib/zca/index.d.ts +0 -12
- package/dist/src/lib/zca/index.js +0 -41
- package/dist/src/types/campaign.d.ts +0 -14
- package/dist/src/types/campaign.js +0 -2
- package/dist/src/types/invoice.d.ts +0 -13
- package/dist/src/types/invoice.js +0 -2
- package/dist/src/types/store.d.ts +0 -158
- package/dist/src/types/store.js +0 -3
- package/dist/src/utils/validatePhoneNumber.d.ts +0 -1
- package/dist/src/utils/validatePhoneNumber.js +0 -20
@@ -1,74 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.StoreService = void 0;
|
13
|
-
// src/lib/store/index.ts
|
14
|
-
const serviceSDK_1 = require("../serviceSDK");
|
15
|
-
/**
|
16
|
-
* Service class for managing store-related operations.
|
17
|
-
*/
|
18
|
-
class StoreService extends serviceSDK_1.Service {
|
19
|
-
/**
|
20
|
-
* Constructs a new StoreService instance.
|
21
|
-
* @param endpoint - The endpoint URL for the service.
|
22
|
-
* @param orgId - The organization ID.
|
23
|
-
* @param storeId - The store ID.
|
24
|
-
*/
|
25
|
-
constructor(endpoint, orgId, storeId) {
|
26
|
-
super(endpoint, orgId, storeId);
|
27
|
-
}
|
28
|
-
setToken(token) {
|
29
|
-
this.token = token;
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* Creates a store channel.
|
33
|
-
*
|
34
|
-
* @param storeChannelData - The data for creating the store channel.
|
35
|
-
* @returns A promise that resolves to the created store channel response.
|
36
|
-
* @throws If an error occurs while creating the store channel.
|
37
|
-
*/
|
38
|
-
createStoreChannel(storeChannelData) {
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
40
|
-
const endpoint = `/store-channels/${this.orgId}`;
|
41
|
-
const method = "POST";
|
42
|
-
try {
|
43
|
-
const response = yield this.restApiCallWithToken(endpoint, method, Object.assign(Object.assign({}, storeChannelData), { partyId: this.orgId }));
|
44
|
-
return response;
|
45
|
-
}
|
46
|
-
catch (error) {
|
47
|
-
console.log(`Error in createStoreChannel: ${error}`);
|
48
|
-
throw error;
|
49
|
-
}
|
50
|
-
});
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Gets available store channels for an employee.
|
54
|
-
*
|
55
|
-
* @param empId - The employee ID.
|
56
|
-
* @returns A promise that resolves to the available store channels.
|
57
|
-
* @throws If an error occurs while fetching the store channels.
|
58
|
-
*/
|
59
|
-
getAvailableStoreChannels(empId) {
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
61
|
-
const endpoint = `/store-channels/LONGVAN/available/${empId}`;
|
62
|
-
const method = "GET";
|
63
|
-
try {
|
64
|
-
const response = yield this.restApiCallWithToken(endpoint, method);
|
65
|
-
return response;
|
66
|
-
}
|
67
|
-
catch (error) {
|
68
|
-
console.log(`Error in getAvailableStoreChannels: ${error}`);
|
69
|
-
throw error;
|
70
|
-
}
|
71
|
-
});
|
72
|
-
}
|
73
|
-
}
|
74
|
-
exports.StoreService = StoreService;
|
@@ -1,32 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.AuthorizationService = void 0;
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
14
|
-
class AuthorizationService extends serviceSDK_1.Service {
|
15
|
-
constructor(endpoint, orgId, storeId) {
|
16
|
-
super(endpoint, orgId, storeId);
|
17
|
-
}
|
18
|
-
checkToken(orgId, token) {
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
20
|
-
const endpoint = `/${orgId}/oauth2/api/v1/token/${token}`;
|
21
|
-
const method = "GET";
|
22
|
-
try {
|
23
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
24
|
-
return response;
|
25
|
-
}
|
26
|
-
catch (error) {
|
27
|
-
throw error;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
}
|
31
|
-
}
|
32
|
-
exports.AuthorizationService = AuthorizationService;
|
@@ -1,35 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.UploadService = void 0;
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
14
|
-
class UploadService extends serviceSDK_1.Service {
|
15
|
-
constructor(endpoint, orgId, storeId) {
|
16
|
-
super(endpoint, orgId, storeId);
|
17
|
-
}
|
18
|
-
uploadImage(imageCode) {
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
20
|
-
const endpoint = "";
|
21
|
-
const method = "POST";
|
22
|
-
try {
|
23
|
-
const formData = new FormData();
|
24
|
-
formData.append("uploadFile", imageCode);
|
25
|
-
formData.append("path", "public");
|
26
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method, formData);
|
27
|
-
return response;
|
28
|
-
}
|
29
|
-
catch (error) {
|
30
|
-
throw error;
|
31
|
-
}
|
32
|
-
});
|
33
|
-
}
|
34
|
-
}
|
35
|
-
exports.UploadService = UploadService;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { Service } from "../serviceSDK";
|
2
|
-
export declare class WarehouseServiceV2 extends Service {
|
3
|
-
/**
|
4
|
-
* Constructs a new OrderService instance.
|
5
|
-
* @param endpoint - The endpoint URL for the service.
|
6
|
-
* @param orgId - The organization ID.
|
7
|
-
* @param storeId - The store ID.
|
8
|
-
*/
|
9
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
10
|
-
setToken(token: string): void;
|
11
|
-
getInventory(warehouseId: string, data: any[]): Promise<any>;
|
12
|
-
getInfoWarehouse(warehouseId: string): Promise<any>;
|
13
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.WarehouseServiceV2 = void 0;
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
14
|
-
class WarehouseServiceV2 extends serviceSDK_1.Service {
|
15
|
-
/**
|
16
|
-
* Constructs a new OrderService instance.
|
17
|
-
* @param endpoint - The endpoint URL for the service.
|
18
|
-
* @param orgId - The organization ID.
|
19
|
-
* @param storeId - The store ID.
|
20
|
-
*/
|
21
|
-
constructor(endpoint, orgId, storeId) {
|
22
|
-
super(endpoint, orgId, storeId);
|
23
|
-
}
|
24
|
-
setToken(token) {
|
25
|
-
this.token = token;
|
26
|
-
}
|
27
|
-
getInventory(warehouseId, data) {
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
29
|
-
const endpoint = `/public-facility/1.0.0/product-inventory-v3/${warehouseId}`;
|
30
|
-
const method = "POST";
|
31
|
-
try {
|
32
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
33
|
-
return response;
|
34
|
-
}
|
35
|
-
catch (error) {
|
36
|
-
throw error;
|
37
|
-
}
|
38
|
-
});
|
39
|
-
}
|
40
|
-
getInfoWarehouse(warehouseId) {
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
42
|
-
try {
|
43
|
-
const endpoint = `/facility/1.0.0/facility/${warehouseId}`;
|
44
|
-
const method = "GET";
|
45
|
-
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
46
|
-
return response;
|
47
|
-
}
|
48
|
-
catch (error) {
|
49
|
-
throw error;
|
50
|
-
}
|
51
|
-
});
|
52
|
-
}
|
53
|
-
}
|
54
|
-
exports.WarehouseServiceV2 = WarehouseServiceV2;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { Service } from "../serviceSDK";
|
2
|
-
export declare class ZcaService extends Service {
|
3
|
-
/**
|
4
|
-
* Constructs a new OrderService instance.
|
5
|
-
* @param endpoint - The endpoint URL for the service.
|
6
|
-
* @param orgId - The organization ID.
|
7
|
-
* @param storeId - The store ID.
|
8
|
-
*/
|
9
|
-
constructor(endpoint: string, orgId: string, storeId: string);
|
10
|
-
setToken(token: string): void;
|
11
|
-
loginQR(sessionId: string, appId: string): Promise<any>;
|
12
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.ZcaService = void 0;
|
13
|
-
const serviceSDK_1 = require("../serviceSDK");
|
14
|
-
class ZcaService extends serviceSDK_1.Service {
|
15
|
-
/**
|
16
|
-
* Constructs a new OrderService instance.
|
17
|
-
* @param endpoint - The endpoint URL for the service.
|
18
|
-
* @param orgId - The organization ID.
|
19
|
-
* @param storeId - The store ID.
|
20
|
-
*/
|
21
|
-
constructor(endpoint, orgId, storeId) {
|
22
|
-
super(endpoint, orgId, storeId);
|
23
|
-
}
|
24
|
-
setToken(token) {
|
25
|
-
this.token = token;
|
26
|
-
}
|
27
|
-
loginQR(sessionId, appId) {
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
29
|
-
const endpoint = `/login?sessionId=${sessionId}&orgId=${this.orgId}&storeId=${this.storeId}&appId=${appId}`;
|
30
|
-
const method = "GET";
|
31
|
-
try {
|
32
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
33
|
-
return response;
|
34
|
-
}
|
35
|
-
catch (error) {
|
36
|
-
throw error;
|
37
|
-
}
|
38
|
-
});
|
39
|
-
}
|
40
|
-
}
|
41
|
-
exports.ZcaService = ZcaService;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export interface SearchVoucherRequest {
|
2
|
-
partyId: String;
|
3
|
-
voucherCodes: [String];
|
4
|
-
voucherCode: String;
|
5
|
-
voucherType: String;
|
6
|
-
campaignId: String;
|
7
|
-
campaignActionId: String;
|
8
|
-
customerId: String;
|
9
|
-
campaignActionType: String;
|
10
|
-
isBirthday: Boolean;
|
11
|
-
isPageAble: Boolean;
|
12
|
-
pageNumber: number;
|
13
|
-
pageSize: number;
|
14
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export interface VatInvoiceRequestDTO {
|
2
|
-
sourceId: String;
|
3
|
-
sourceType: String;
|
4
|
-
signType: String;
|
5
|
-
includeBuyerTaxCode: Boolean;
|
6
|
-
buyerName: String;
|
7
|
-
buyerTaxCode: String;
|
8
|
-
buyerCompany: String;
|
9
|
-
buyerAddress: String;
|
10
|
-
sendMail: Boolean;
|
11
|
-
receiverName: String;
|
12
|
-
receiverEmail: String;
|
13
|
-
}
|
@@ -1,158 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Store Data Transfer Object
|
3
|
-
* Represents a store/channel in the system
|
4
|
-
*/
|
5
|
-
export interface StoreDTO {
|
6
|
-
/** Unique identifier for the store */
|
7
|
-
id: string;
|
8
|
-
/** Timestamp when the store was created */
|
9
|
-
createdStamp: string | null;
|
10
|
-
/** Display name of the store */
|
11
|
-
name: string;
|
12
|
-
/** Type of store (pos, ecommerce, etc.) */
|
13
|
-
type: 'pos' | 'ecommerce' | 'marketplace' | 'wholesale' | string;
|
14
|
-
/** Whether the store is enabled/active */
|
15
|
-
enable: boolean;
|
16
|
-
/** Party/Organization ID that owns this store */
|
17
|
-
partyId: string;
|
18
|
-
/** Array of warehouse IDs associated with this store */
|
19
|
-
warehouses: string[];
|
20
|
-
/** Default warehouse ID for this store */
|
21
|
-
warehouseIdDefault: string;
|
22
|
-
/** Whether future orders are allowed */
|
23
|
-
enableOrderAbleFuture: boolean;
|
24
|
-
/** Whether negative quantity orders are allowed */
|
25
|
-
enableOrderNegativeQuantity: boolean;
|
26
|
-
/** E-commerce specific store name */
|
27
|
-
storeEcommerceName: string | null;
|
28
|
-
/** Array of shipping company IDs */
|
29
|
-
shippingCompanies: string[];
|
30
|
-
/** Primary shipping company ID */
|
31
|
-
shippingCompanyIdPrimary: string;
|
32
|
-
/** Primary customer ID */
|
33
|
-
customerIdPrimary: string;
|
34
|
-
/** Primary payment method ID */
|
35
|
-
paymentMethodIdPrimary: string;
|
36
|
-
/** Whether custom product pricing is enabled */
|
37
|
-
enableCustomProductPrice: boolean;
|
38
|
-
/** Whether partial payments are enabled */
|
39
|
-
enablePaymentPartial: boolean;
|
40
|
-
/** Array of allowed partial payment percentages */
|
41
|
-
paymentPartialPercent: number[];
|
42
|
-
/** Link to the product store (for e-commerce) */
|
43
|
-
productStoreLink: string | null;
|
44
|
-
/** GraphQL typename */
|
45
|
-
__typename?: string;
|
46
|
-
}
|
47
|
-
/**
|
48
|
-
* Request interface for creating a new store
|
49
|
-
*/
|
50
|
-
export interface CreateStoreRequest {
|
51
|
-
/** Partner/Organization ID */
|
52
|
-
partnerId: string;
|
53
|
-
/** Name for the new store */
|
54
|
-
storeName: string;
|
55
|
-
/** Optional store type */
|
56
|
-
type?: 'pos' | 'ecommerce' | 'marketplace' | 'wholesale';
|
57
|
-
/** Optional configuration */
|
58
|
-
config?: Partial<StoreConfiguration>;
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Store configuration options
|
62
|
-
*/
|
63
|
-
export interface StoreConfiguration {
|
64
|
-
/** Whether the store should be enabled by default */
|
65
|
-
enable: boolean;
|
66
|
-
/** Warehouse IDs to associate with the store */
|
67
|
-
warehouses: string[];
|
68
|
-
/** Default warehouse ID */
|
69
|
-
warehouseIdDefault: string;
|
70
|
-
/** Whether to enable future orders */
|
71
|
-
enableOrderAbleFuture: boolean;
|
72
|
-
/** Whether to enable negative quantity orders */
|
73
|
-
enableOrderNegativeQuantity: boolean;
|
74
|
-
/** E-commerce store name */
|
75
|
-
storeEcommerceName: string;
|
76
|
-
/** Shipping company IDs */
|
77
|
-
shippingCompanies: string[];
|
78
|
-
/** Primary shipping company ID */
|
79
|
-
shippingCompanyIdPrimary: string;
|
80
|
-
/** Primary customer ID */
|
81
|
-
customerIdPrimary: string;
|
82
|
-
/** Primary payment method ID */
|
83
|
-
paymentMethodIdPrimary: string;
|
84
|
-
/** Enable custom product pricing */
|
85
|
-
enableCustomProductPrice: boolean;
|
86
|
-
/** Enable partial payments */
|
87
|
-
enablePaymentPartial: boolean;
|
88
|
-
/** Partial payment percentages */
|
89
|
-
paymentPartialPercent: number[];
|
90
|
-
/** Product store link */
|
91
|
-
productStoreLink: string;
|
92
|
-
}
|
93
|
-
/**
|
94
|
-
* Request interface for getting store channels by employee ID
|
95
|
-
*/
|
96
|
-
export interface GetStoreChannelRequest {
|
97
|
-
/** Employee/Sale ID */
|
98
|
-
saleId: string;
|
99
|
-
/** Optional filter by store type */
|
100
|
-
type?: 'pos' | 'ecommerce' | 'marketplace' | 'wholesale';
|
101
|
-
/** Optional filter by enabled status */
|
102
|
-
enabledOnly?: boolean;
|
103
|
-
}
|
104
|
-
/**
|
105
|
-
* Response interface for store channel queries
|
106
|
-
*/
|
107
|
-
export interface StoreChannelResponse {
|
108
|
-
/** Array of accessible stores */
|
109
|
-
stores: StoreDTO[];
|
110
|
-
/** Total count of stores */
|
111
|
-
totalCount: number;
|
112
|
-
/** Whether user has admin permissions (can see all stores) */
|
113
|
-
hasAdminAccess: boolean;
|
114
|
-
}
|
115
|
-
/**
|
116
|
-
* Store filter options for querying stores
|
117
|
-
*/
|
118
|
-
export interface StoreFilterOptions {
|
119
|
-
/** Filter by store type */
|
120
|
-
type?: 'pos' | 'ecommerce' | 'marketplace' | 'wholesale' | string;
|
121
|
-
/** Filter by enabled status */
|
122
|
-
enabled?: boolean;
|
123
|
-
/** Filter by party/organization ID */
|
124
|
-
partyId?: string;
|
125
|
-
/** Search by store name */
|
126
|
-
searchName?: string;
|
127
|
-
/** Pagination - current page */
|
128
|
-
currentPage?: number;
|
129
|
-
/** Pagination - max results per page */
|
130
|
-
maxResult?: number;
|
131
|
-
}
|
132
|
-
/**
|
133
|
-
* Store statistics interface
|
134
|
-
*/
|
135
|
-
export interface StoreStats {
|
136
|
-
/** Total number of stores */
|
137
|
-
totalStores: number;
|
138
|
-
/** Number of active stores */
|
139
|
-
activeStores: number;
|
140
|
-
/** Number of inactive stores */
|
141
|
-
inactiveStores: number;
|
142
|
-
/** Breakdown by store type */
|
143
|
-
byType: {
|
144
|
-
pos: number;
|
145
|
-
ecommerce: number;
|
146
|
-
marketplace: number;
|
147
|
-
wholesale: number;
|
148
|
-
other: number;
|
149
|
-
};
|
150
|
-
}
|
151
|
-
/**
|
152
|
-
* Store service method return types
|
153
|
-
*/
|
154
|
-
export interface StoreServiceMethods {
|
155
|
-
createStore: (partnerId: string, storeName: string) => Promise<StoreDTO>;
|
156
|
-
getStoreChannelByEmpId: (saleId: string) => Promise<StoreDTO[]>;
|
157
|
-
}
|
158
|
-
export type { StoreDTO as Store, };
|
package/dist/src/types/store.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare function validatePhoneNumber(phoneNumber: string): boolean;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validatePhoneNumber = void 0;
|
4
|
-
function validatePhoneNumber(phoneNumber) {
|
5
|
-
var _a;
|
6
|
-
const urlParams = new URLSearchParams(window.location.search);
|
7
|
-
const country = ((_a = urlParams.get("country")) === null || _a === void 0 ? void 0 : _a.trim()) || "default";
|
8
|
-
const pattern = (() => {
|
9
|
-
switch (country) {
|
10
|
-
case "vietnam":
|
11
|
-
return /^(0?)(3[2-9]|5[6|8|9]|7[0|6-9]|8[0-6|8|9]|9[0-4|6-9])[0-9]{7}$/;
|
12
|
-
case "quocte":
|
13
|
-
return /^(\+|00)[1-9][0-9]{1,3}[0-9]{4,14}$/;
|
14
|
-
default:
|
15
|
-
return /^(0?)(3[2-9]|5[6|8|9]|7[0|6-9]|8[0-6|8|9]|9[0-4|6-9])[0-9]{7}$|^(\+|00)[1-9][0-9]{1,3}[0-9]{4,14}$/;
|
16
|
-
}
|
17
|
-
})();
|
18
|
-
return pattern.test(phoneNumber);
|
19
|
-
}
|
20
|
-
exports.validatePhoneNumber = validatePhoneNumber;
|