@zohoim/client-sdk 1.0.0-replyAreaPoc9 → 1.0.0-whatsAppPricing.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/es/application/services/index.js +3 -1
- package/es/application/services/subscription/SubscriptionService.js +36 -0
- package/es/application/services/subscription/index.js +2 -0
- package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +21 -0
- package/es/application/services/whatsAppPricing/index.js +2 -0
- package/es/core/constants/ModuleNames.js +3 -1
- package/es/core/constants/ModuleTypes.js +5 -0
- package/es/core/constants/index.js +2 -1
- package/es/domain/dto/index.js +3 -1
- package/es/domain/dto/subscription/buyAddOnPackageRequest.js +18 -0
- package/es/domain/dto/subscription/getAddOnPackagesRequest.js +15 -0
- package/es/domain/dto/subscription/getLicenseDetailsRequest.js +7 -0
- package/es/domain/dto/subscription/index.js +5 -0
- package/es/domain/dto/subscription/modifyAddOnPackageRequest.js +18 -0
- package/es/domain/dto/whatsAppPricing/calculatePricingRequest.js +14 -0
- package/es/domain/dto/whatsAppPricing/index.js +2 -0
- package/es/domain/entities/AddOnPackage/AddOnPackage.js +34 -0
- package/es/domain/entities/AddOnPackage/index.js +2 -0
- package/es/domain/entities/LicenseDetails/LicenseDetails.js +23 -0
- package/es/domain/entities/LicenseDetails/index.js +2 -0
- package/es/domain/entities/WhatsAppPricingResult/WhatsAppPricingResult.js +24 -0
- package/es/domain/entities/WhatsAppPricingResult/index.js +2 -0
- package/es/domain/entities/index.js +4 -1
- package/es/domain/enum/index.js +2 -1
- package/es/domain/enum/session/SessionReplyStatus.js +4 -1
- package/es/domain/enum/subscription/AddOnSubscriptionStatus.js +7 -0
- package/es/domain/enum/subscription/index.js +2 -0
- package/es/domain/interfaces/repositories/index.js +3 -1
- package/es/domain/interfaces/repositories/subscription/ISubscriptionRepository.js +35 -0
- package/es/domain/interfaces/repositories/subscription/index.js +2 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +17 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
- package/es/domain/schema/index.js +3 -1
- package/es/domain/schema/subscription/AddOnPackageSchema.js +33 -0
- package/es/domain/schema/subscription/AddOnSubscriptionSchema.js +29 -0
- package/es/domain/schema/subscription/LicenseDetailsSchema.js +11 -0
- package/es/domain/schema/subscription/index.js +4 -0
- package/es/domain/schema/whatsAppPricing/PricingCategorySchema.js +11 -0
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingResultSchema.js +21 -0
- package/es/domain/schema/whatsAppPricing/index.js +3 -0
- package/es/frameworks/managers/ModuleFactory.js +62 -24
- package/es/frameworks/managers/ModuleManager.js +20 -4
- package/es/frameworks/sdk/IMSDK.js +19 -9
- package/es/frameworks/sdk/subscription/SubscriptionSDK.js +29 -0
- package/es/frameworks/sdk/subscription/index.js +2 -0
- package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +27 -0
- package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/adapters/index.js +3 -1
- package/es/infrastructure/adapters/subscription/AddOnPackageAdapter.js +25 -0
- package/es/infrastructure/adapters/subscription/LicenseDetailsAdapter.js +20 -0
- package/es/infrastructure/adapters/subscription/index.js +3 -0
- package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingResultAdapter.js +22 -0
- package/es/infrastructure/adapters/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/BaseAPI.js +2 -2
- package/es/infrastructure/api/index.js +3 -1
- package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +5 -1
- package/es/infrastructure/api/registry/subscription/constructSubscriptionEndPoint.js +10 -0
- package/es/infrastructure/api/registry/subscription/index.js +3 -0
- package/es/infrastructure/api/registry/subscription/subscriptionAPIRegistry.js +28 -0
- package/es/infrastructure/api/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +5 -0
- package/es/infrastructure/api/registry/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +13 -0
- package/es/infrastructure/api/subscription/SubscriptionAPI.js +44 -0
- package/es/infrastructure/api/subscription/index.js +2 -0
- package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +14 -0
- package/es/infrastructure/api/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/repositories/index.js +3 -1
- package/es/infrastructure/repositories/subscription/SubscriptionRepository.js +82 -0
- package/es/infrastructure/repositories/subscription/index.js +2 -0
- package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +50 -0
- package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ISubscriptionRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class SubscriptionService extends ISubscriptionRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
subscriptionRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.subscriptionRepository = subscriptionRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getAddOnPackages(request) {
|
|
12
|
+
return this.subscriptionRepository.getAddOnPackages(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async getLicenseDetails(request) {
|
|
16
|
+
return this.subscriptionRepository.getLicenseDetails(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async buyAddOnPackage(request) {
|
|
20
|
+
return this.subscriptionRepository.buyAddOnPackage(request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async modifyAddOnPackage(request) {
|
|
24
|
+
return this.subscriptionRepository.modifyAddOnPackage(request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toJSON() {
|
|
28
|
+
return {
|
|
29
|
+
getAddOnPackages: this.getAddOnPackages.bind(this),
|
|
30
|
+
getLicenseDetails: this.getLicenseDetails.bind(this),
|
|
31
|
+
buyAddOnPackage: this.buyAddOnPackage.bind(this),
|
|
32
|
+
modifyAddOnPackage: this.modifyAddOnPackage.bind(this)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import IWhatsAppPricingRepository from '../../../domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository';
|
|
2
|
+
export default class WhatsAppPricingService extends IWhatsAppPricingRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
whatsAppPricingRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.whatsAppPricingRepository = whatsAppPricingRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async calculatePricing(request) {
|
|
12
|
+
return this.whatsAppPricingRepository.calculatePricing(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
calculatePricing: this.calculatePricing.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -7,6 +7,8 @@ const ModuleNames = {
|
|
|
7
7
|
AGENTS: 'agents',
|
|
8
8
|
CANNED_MESSAGES: 'cannedMessages',
|
|
9
9
|
TEMPLATE_MESSAGES: 'templateMessages',
|
|
10
|
-
CUSTOM_REPLY_EXTENSIONS: 'articles'
|
|
10
|
+
CUSTOM_REPLY_EXTENSIONS: 'articles',
|
|
11
|
+
SUBSCRIPTION: 'subscription',
|
|
12
|
+
WHATSAPP_PRICING: 'whatsAppPricing'
|
|
11
13
|
};
|
|
12
14
|
export default ModuleNames;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
2
|
import ModuleNames from './ModuleNames';
|
|
3
|
+
import ModuleTypes from './ModuleTypes';
|
|
3
4
|
import ResponseTypes from './ResponseTypes';
|
|
4
5
|
const IM_API_PREFIX = '/api/v1';
|
|
5
6
|
const HTTP_METHODS = HttpMethods;
|
|
6
|
-
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
|
7
|
+
export { ModuleNames, ModuleTypes, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
package/es/domain/dto/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function buyAddOnPackageRequest() {
|
|
4
|
+
let {
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withBody({
|
|
8
|
+
name: null,
|
|
9
|
+
count: null,
|
|
10
|
+
source: null,
|
|
11
|
+
autoRenewal: null,
|
|
12
|
+
renewalCount: null,
|
|
13
|
+
renewalThreshold: null,
|
|
14
|
+
...body
|
|
15
|
+
}).build();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default buyAddOnPackageRequest;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function getAddOnPackagesRequest() {
|
|
4
|
+
let {
|
|
5
|
+
query = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withQuery({
|
|
8
|
+
integrationServiceId: null,
|
|
9
|
+
subscription: null,
|
|
10
|
+
currencyCode: null,
|
|
11
|
+
...query
|
|
12
|
+
}).build();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default getAddOnPackagesRequest;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import getAddOnPackagesRequest from './getAddOnPackagesRequest';
|
|
2
|
+
import getLicenseDetailsRequest from './getLicenseDetailsRequest';
|
|
3
|
+
import buyAddOnPackageRequest from './buyAddOnPackageRequest';
|
|
4
|
+
import modifyAddOnPackageRequest from './modifyAddOnPackageRequest';
|
|
5
|
+
export { getAddOnPackagesRequest, getLicenseDetailsRequest, buyAddOnPackageRequest, modifyAddOnPackageRequest };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function modifyAddOnPackageRequest() {
|
|
4
|
+
let {
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withBody({
|
|
8
|
+
name: null,
|
|
9
|
+
count: null,
|
|
10
|
+
source: null,
|
|
11
|
+
autoRenewal: null,
|
|
12
|
+
renewalCount: null,
|
|
13
|
+
renewalThreshold: null,
|
|
14
|
+
...body
|
|
15
|
+
}).build();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default modifyAddOnPackageRequest;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function calculatePricingRequest() {
|
|
4
|
+
let {
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withBody({
|
|
8
|
+
currency: null,
|
|
9
|
+
data: null,
|
|
10
|
+
...body
|
|
11
|
+
}).build();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default calculatePricingRequest;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { AddOnPackageSchema } from '../../schema';
|
|
3
|
+
export default class AddOnPackage {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: AddOnPackageSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'AddOnPackage'
|
|
10
|
+
}); // Set required properties from schema
|
|
11
|
+
|
|
12
|
+
this.name = validatedData.name; // Set optional properties from schema
|
|
13
|
+
|
|
14
|
+
this.type = validatedData.type || null;
|
|
15
|
+
this.module = validatedData.module || null;
|
|
16
|
+
this.cost = validatedData.cost || null;
|
|
17
|
+
this.integrationService = validatedData.integrationService || null;
|
|
18
|
+
this.subscriptionInfo = validatedData.subscriptionInfo || null;
|
|
19
|
+
this.metaInfo = validatedData.metaInfo || null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toJSON() {
|
|
23
|
+
return {
|
|
24
|
+
name: this.name,
|
|
25
|
+
type: this.type,
|
|
26
|
+
module: this.module,
|
|
27
|
+
cost: this.cost,
|
|
28
|
+
integrationService: this.integrationService,
|
|
29
|
+
subscriptionInfo: this.subscriptionInfo,
|
|
30
|
+
metaInfo: this.metaInfo
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { LicenseDetailsSchema } from '../../schema';
|
|
3
|
+
export default class LicenseDetails {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: LicenseDetailsSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'LicenseDetails'
|
|
10
|
+
}); // Set optional properties from schema
|
|
11
|
+
|
|
12
|
+
this.paymentSource = validatedData.paymentSource || false;
|
|
13
|
+
this.data = validatedData.data || null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toJSON() {
|
|
17
|
+
return {
|
|
18
|
+
paymentSource: this.paymentSource,
|
|
19
|
+
data: this.data
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { WhatsAppPricingResultSchema } from '../../schema/whatsAppPricing';
|
|
3
|
+
export default class WhatsAppPricingResult {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: WhatsAppPricingResultSchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'WhatsAppPricingResult'
|
|
10
|
+
});
|
|
11
|
+
this.data = {
|
|
12
|
+
total: validatedData.total,
|
|
13
|
+
creditsCount: validatedData.creditsCount,
|
|
14
|
+
category: validatedData.category,
|
|
15
|
+
actualCreditsAmount: validatedData.actualCreditsAmount
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toJSON() {
|
|
20
|
+
return { ...this.data
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -9,4 +9,7 @@ export * from './Contact';
|
|
|
9
9
|
export * from './IntegrationService';
|
|
10
10
|
export * from './CannedMessage';
|
|
11
11
|
export * from './TemplateMessage';
|
|
12
|
-
export * from './CustomReplyExtension';
|
|
12
|
+
export * from './CustomReplyExtension';
|
|
13
|
+
export * from './AddOnPackage';
|
|
14
|
+
export * from './LicenseDetails';
|
|
15
|
+
export * from './WhatsAppPricingResult';
|
package/es/domain/enum/index.js
CHANGED
|
@@ -16,6 +16,9 @@ const SessionReplyStatus = {
|
|
|
16
16
|
CHANNEL_DELETED: 'CHANNEL_DELETED',
|
|
17
17
|
ENDUSER_OFFLINE: 'ENDUSER_OFFLINE',
|
|
18
18
|
CONFIG_SKIPPED_CHANNEL: 'CONFIG_SKIPPED_CHANNEL',
|
|
19
|
-
ASSIGNED_TO_OTHER_SERVICE: 'ASSIGNED_TO_OTHER_SERVICE'
|
|
19
|
+
ASSIGNED_TO_OTHER_SERVICE: 'ASSIGNED_TO_OTHER_SERVICE',
|
|
20
|
+
WECOM_TRAIL_EXPIRED: 'WECOM_TRAIL_EXPIRED',
|
|
21
|
+
WECOM_LICENSE_EXPIRED: 'WECOM_LICENSE_EXPIRED',
|
|
22
|
+
OUTGOING_LIMIT_REACHED: 'OUTGOING_LIMIT_REACHED'
|
|
20
23
|
};
|
|
21
24
|
export default SessionReplyStatus;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ModuleNames } from '../../../../core/constants';
|
|
2
|
+
import BaseAPI from '../../../../infrastructure/api/BaseAPI';
|
|
3
|
+
import { getAddOnPackagesRequest, getLicenseDetailsRequest, buyAddOnPackageRequest, modifyAddOnPackageRequest } from '../../../dto';
|
|
4
|
+
export default class ISubscriptionRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.SUBSCRIPTION
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
getAddOnPackages() {
|
|
13
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAddOnPackagesRequest();
|
|
14
|
+
throw new Error('Method not implemented.');
|
|
15
|
+
} // eslint-disable-next-line no-unused-vars
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
getLicenseDetails() {
|
|
19
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getLicenseDetailsRequest();
|
|
20
|
+
throw new Error('Method not implemented.');
|
|
21
|
+
} // eslint-disable-next-line no-unused-vars
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
buyAddOnPackage() {
|
|
25
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : buyAddOnPackageRequest();
|
|
26
|
+
throw new Error('Method not implemented.');
|
|
27
|
+
} // eslint-disable-next-line no-unused-vars
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
modifyAddOnPackage() {
|
|
31
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : modifyAddOnPackageRequest();
|
|
32
|
+
throw new Error('Method not implemented.');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModuleNames } from '../../../../core/constants';
|
|
2
|
+
import BaseAPI from '../../../../infrastructure/api/BaseAPI';
|
|
3
|
+
import { calculatePricingRequest } from '../../../dto';
|
|
4
|
+
export default class IWhatsAppPricingRepository extends BaseAPI {
|
|
5
|
+
constructor() {
|
|
6
|
+
super({
|
|
7
|
+
module: ModuleNames.WHATSAPP_PRICING
|
|
8
|
+
});
|
|
9
|
+
} // eslint-disable-next-line no-unused-vars
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
calculatePricing() {
|
|
13
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : calculatePricingRequest();
|
|
14
|
+
throw new Error('Method not implemented.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -8,4 +8,6 @@ export * from './integrationService';
|
|
|
8
8
|
export * from './contact';
|
|
9
9
|
export * from './cannedMessage';
|
|
10
10
|
export * from './templateMessage';
|
|
11
|
-
export * from './customReplyExtension';
|
|
11
|
+
export * from './customReplyExtension';
|
|
12
|
+
export * from './subscription';
|
|
13
|
+
export * from './whatsAppPricing';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import AddOnSubscriptionSchema from './AddOnSubscriptionSchema';
|
|
2
|
+
const AddOnPackageSchema = {
|
|
3
|
+
name: {
|
|
4
|
+
type: 'string',
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
type: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: false
|
|
10
|
+
},
|
|
11
|
+
module: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
cost: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
integrationService: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
subscriptionInfo: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
required: false,
|
|
26
|
+
schema: AddOnSubscriptionSchema
|
|
27
|
+
},
|
|
28
|
+
metaInfo: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
required: false
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export default AddOnPackageSchema;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AddOnSubscriptionStatus } from '../../enum/subscription';
|
|
2
|
+
const AddOnSubscriptionSchema = {
|
|
3
|
+
count: {
|
|
4
|
+
type: 'number',
|
|
5
|
+
required: false
|
|
6
|
+
},
|
|
7
|
+
available: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: false
|
|
10
|
+
},
|
|
11
|
+
renewalCount: {
|
|
12
|
+
type: 'number',
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
renewalThreshold: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
required: false,
|
|
22
|
+
enum: Object.values(AddOnSubscriptionStatus)
|
|
23
|
+
},
|
|
24
|
+
reserved: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
required: false
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export default AddOnSubscriptionSchema;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PricingCategorySchema from './PricingCategorySchema';
|
|
2
|
+
const WhatsAppPricingResultSchema = {
|
|
3
|
+
total: {
|
|
4
|
+
type: 'number',
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
creditsCount: {
|
|
8
|
+
type: 'number',
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
category: {
|
|
12
|
+
type: 'array',
|
|
13
|
+
required: true,
|
|
14
|
+
schema: PricingCategorySchema
|
|
15
|
+
},
|
|
16
|
+
actualCreditsAmount: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
required: false
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default WhatsAppPricingResultSchema;
|