@buunguyen3589/collections-module 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/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +17 -0
- package/dist/app/usecases/command/create-collection.usecase.d.ts +16 -0
- package/dist/app/usecases/command/create-collection.usecase.js +66 -0
- package/dist/app/usecases/command/delete-collection.usecase.d.ts +13 -0
- package/dist/app/usecases/command/delete-collection.usecase.js +57 -0
- package/dist/app/usecases/command/index.d.ts +5 -0
- package/dist/app/usecases/command/index.js +21 -0
- package/dist/app/usecases/command/post-collection/index.d.ts +1 -0
- package/dist/app/usecases/command/post-collection/index.js +17 -0
- package/dist/app/usecases/command/post-collection/upsert-post-collection.usecase.d.ts +14 -0
- package/dist/app/usecases/command/post-collection/upsert-post-collection.usecase.js +63 -0
- package/dist/app/usecases/command/product-collection/add-all-products-collection.usecase.d.ts +24 -0
- package/dist/app/usecases/command/product-collection/add-all-products-collection.usecase.js +93 -0
- package/dist/app/usecases/command/product-collection/create-product-collection.usecase.d.ts +24 -0
- package/dist/app/usecases/command/product-collection/create-product-collection.usecase.js +94 -0
- package/dist/app/usecases/command/product-collection/delete-product-collection.usecase.d.ts +14 -0
- package/dist/app/usecases/command/product-collection/delete-product-collection.usecase.js +56 -0
- package/dist/app/usecases/command/product-collection/index.d.ts +3 -0
- package/dist/app/usecases/command/product-collection/index.js +19 -0
- package/dist/app/usecases/command/update-collection.usecase.d.ts +15 -0
- package/dist/app/usecases/command/update-collection.usecase.js +73 -0
- package/dist/app/usecases/index.d.ts +2 -0
- package/dist/app/usecases/index.js +18 -0
- package/dist/app/usecases/query/get-detail-collection.usecase.d.ts +36 -0
- package/dist/app/usecases/query/get-detail-collection.usecase.js +216 -0
- package/dist/app/usecases/query/get-list-collection.usecase.d.ts +23 -0
- package/dist/app/usecases/query/get-list-collection.usecase.js +96 -0
- package/dist/app/usecases/query/get-products-by-collections-internal.usecase.d.ts +19 -0
- package/dist/app/usecases/query/get-products-by-collections-internal.usecase.js +65 -0
- package/dist/app/usecases/query/get-products-by-collections.usecase.d.ts +44 -0
- package/dist/app/usecases/query/get-products-by-collections.usecase.js +130 -0
- package/dist/app/usecases/query/index.d.ts +4 -0
- package/dist/app/usecases/query/index.js +20 -0
- package/dist/collection.module.d.ts +2 -0
- package/dist/collection.module.js +62 -0
- package/dist/domain/aggregates/enums/collection.enum.d.ts +5 -0
- package/dist/domain/aggregates/enums/collection.enum.js +9 -0
- package/dist/domain/aggregates/enums/index.d.ts +1 -0
- package/dist/domain/aggregates/enums/index.js +17 -0
- package/dist/domain/aggregates/index.d.ts +2 -0
- package/dist/domain/aggregates/index.js +18 -0
- package/dist/domain/aggregates/types/collection.type.d.ts +14 -0
- package/dist/domain/aggregates/types/collection.type.js +2 -0
- package/dist/domain/aggregates/types/index.d.ts +3 -0
- package/dist/domain/aggregates/types/index.js +19 -0
- package/dist/domain/aggregates/types/post-collection.type.d.ts +12 -0
- package/dist/domain/aggregates/types/post-collection.type.js +2 -0
- package/dist/domain/aggregates/types/product-collection.type.d.ts +11 -0
- package/dist/domain/aggregates/types/product-collection.type.js +2 -0
- package/dist/domain/builders/collection.builder.d.ts +8 -0
- package/dist/domain/builders/collection.builder.js +38 -0
- package/dist/domain/builders/index.d.ts +3 -0
- package/dist/domain/builders/index.js +19 -0
- package/dist/domain/builders/post-collection.builder.d.ts +8 -0
- package/dist/domain/builders/post-collection.builder.js +38 -0
- package/dist/domain/builders/product-collection.builder.d.ts +8 -0
- package/dist/domain/builders/product-collection.builder.js +38 -0
- package/dist/domain/consts/event-collection.name.const.d.ts +5 -0
- package/dist/domain/consts/event-collection.name.const.js +8 -0
- package/dist/domain/consts/event-post-collection.name.const.d.ts +6 -0
- package/dist/domain/consts/event-post-collection.name.const.js +9 -0
- package/dist/domain/consts/event-product-collection.name.const.d.ts +5 -0
- package/dist/domain/consts/event-product-collection.name.const.js +8 -0
- package/dist/domain/consts/index.d.ts +3 -0
- package/dist/domain/consts/index.js +19 -0
- package/dist/domain/dtos/collection.dto.d.ts +4 -0
- package/dist/domain/dtos/collection.dto.js +2 -0
- package/dist/domain/dtos/index.d.ts +3 -0
- package/dist/domain/dtos/index.js +19 -0
- package/dist/domain/dtos/post-collection.dto.d.ts +4 -0
- package/dist/domain/dtos/post-collection.dto.js +2 -0
- package/dist/domain/dtos/product-collection.dto.d.ts +4 -0
- package/dist/domain/dtos/product-collection.dto.js +2 -0
- package/dist/domain/entities/collection.entity.d.ts +40 -0
- package/dist/domain/entities/collection.entity.js +87 -0
- package/dist/domain/entities/index.d.ts +3 -0
- package/dist/domain/entities/index.js +19 -0
- package/dist/domain/entities/post-collection.entity.d.ts +33 -0
- package/dist/domain/entities/post-collection.entity.js +70 -0
- package/dist/domain/entities/product-collection.entity.d.ts +30 -0
- package/dist/domain/entities/product-collection.entity.js +55 -0
- package/dist/domain/index.d.ts +6 -0
- package/dist/domain/index.js +22 -0
- package/dist/domain/mappers/collection.mapper.d.ts +11 -0
- package/dist/domain/mappers/collection.mapper.js +56 -0
- package/dist/domain/mappers/index.d.ts +3 -0
- package/dist/domain/mappers/index.js +19 -0
- package/dist/domain/mappers/post-collection.mapper.d.ts +11 -0
- package/dist/domain/mappers/post-collection.mapper.js +50 -0
- package/dist/domain/mappers/product-collection.mapper.d.ts +11 -0
- package/dist/domain/mappers/product-collection.mapper.js +48 -0
- package/dist/domain/repositories/collection.repository.d.ts +21 -0
- package/dist/domain/repositories/collection.repository.js +93 -0
- package/dist/domain/repositories/index.d.ts +3 -0
- package/dist/domain/repositories/index.js +19 -0
- package/dist/domain/repositories/post-collection.repository.d.ts +21 -0
- package/dist/domain/repositories/post-collection.repository.js +107 -0
- package/dist/domain/repositories/product-collection.repository.d.ts +21 -0
- package/dist/domain/repositories/product-collection.repository.js +98 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -0
- package/dist/infra/daos/collection.dao.d.ts +7 -0
- package/dist/infra/daos/collection.dao.js +36 -0
- package/dist/infra/daos/index.d.ts +3 -0
- package/dist/infra/daos/index.js +19 -0
- package/dist/infra/daos/post-collection.dao.d.ts +10 -0
- package/dist/infra/daos/post-collection.dao.js +70 -0
- package/dist/infra/daos/product-collection.dao.d.ts +9 -0
- package/dist/infra/daos/product-collection.dao.js +69 -0
- package/dist/infra/event-handlers/collection.event-emitter.d.ts +6 -0
- package/dist/infra/event-handlers/collection.event-emitter.js +27 -0
- package/dist/infra/event-handlers/index.d.ts +3 -0
- package/dist/infra/event-handlers/index.js +19 -0
- package/dist/infra/event-handlers/post-collection.event-emitter.d.ts +6 -0
- package/dist/infra/event-handlers/post-collection.event-emitter.js +27 -0
- package/dist/infra/event-handlers/product-collection.event-emitter.d.ts +6 -0
- package/dist/infra/event-handlers/product-collection.event-emitter.js +27 -0
- package/dist/infra/filters/collection.filter.d.ts +25 -0
- package/dist/infra/filters/collection.filter.js +84 -0
- package/dist/infra/filters/index.d.ts +3 -0
- package/dist/infra/filters/index.js +19 -0
- package/dist/infra/filters/post-collection.filter.d.ts +16 -0
- package/dist/infra/filters/post-collection.filter.js +54 -0
- package/dist/infra/filters/product-collection.filter.d.ts +13 -0
- package/dist/infra/filters/product-collection.filter.js +44 -0
- package/dist/infra/index.d.ts +6 -0
- package/dist/infra/index.js +22 -0
- package/dist/infra/mappers/collection.mapper.d.ts +8 -0
- package/dist/infra/mappers/collection.mapper.js +31 -0
- package/dist/infra/mappers/index.d.ts +3 -0
- package/dist/infra/mappers/index.js +19 -0
- package/dist/infra/mappers/post-collection.mapper.d.ts +8 -0
- package/dist/infra/mappers/post-collection.mapper.js +25 -0
- package/dist/infra/mappers/product-collection.mapper.d.ts +8 -0
- package/dist/infra/mappers/product-collection.mapper.js +24 -0
- package/dist/infra/query-configs/collection.query-config.d.ts +3 -0
- package/dist/infra/query-configs/collection.query-config.js +46 -0
- package/dist/infra/query-configs/index.d.ts +3 -0
- package/dist/infra/query-configs/index.js +19 -0
- package/dist/infra/query-configs/post-collection.query-config.d.ts +3 -0
- package/dist/infra/query-configs/post-collection.query-config.js +31 -0
- package/dist/infra/query-configs/product-collection.query-config.d.ts +3 -0
- package/dist/infra/query-configs/product-collection.query-config.js +26 -0
- package/dist/infra/records/collection.record.d.ts +11 -0
- package/dist/infra/records/collection.record.js +2 -0
- package/dist/infra/records/index.d.ts +3 -0
- package/dist/infra/records/index.js +19 -0
- package/dist/infra/records/post-collection.record.d.ts +7 -0
- package/dist/infra/records/post-collection.record.js +2 -0
- package/dist/infra/records/product-collection.record.d.ts +7 -0
- package/dist/infra/records/product-collection.record.js +2 -0
- package/dist/presentation/controllers/index.d.ts +2 -0
- package/dist/presentation/controllers/index.js +18 -0
- package/dist/presentation/controllers/internals/index.d.ts +1 -0
- package/dist/presentation/controllers/internals/index.js +17 -0
- package/dist/presentation/controllers/internals/product-collection.internal.rest.d.ts +8 -0
- package/dist/presentation/controllers/internals/product-collection.internal.rest.js +45 -0
- package/dist/presentation/controllers/storefront/collection.storefront.rest.d.ts +26 -0
- package/dist/presentation/controllers/storefront/collection.storefront.rest.js +155 -0
- package/dist/presentation/controllers/storefront/index.d.ts +3 -0
- package/dist/presentation/controllers/storefront/index.js +19 -0
- package/dist/presentation/controllers/storefront/post-collection.storefront.d.ts +7 -0
- package/dist/presentation/controllers/storefront/post-collection.storefront.js +37 -0
- package/dist/presentation/controllers/storefront/product-collection.storefront.rest.d.ts +5 -0
- package/dist/presentation/controllers/storefront/product-collection.storefront.rest.js +50 -0
- package/dist/presentation/index.d.ts +1 -0
- package/dist/presentation/index.js +17 -0
- package/dist/shared/configs/index.d.ts +1 -0
- package/dist/shared/configs/index.js +17 -0
- package/dist/shared/configs/pagination.config.d.ts +4 -0
- package/dist/shared/configs/pagination.config.js +7 -0
- package/dist/shared/constants/collection-inject-tokens.const.d.ts +56 -0
- package/dist/shared/constants/collection-inject-tokens.const.js +61 -0
- package/dist/shared/constants/collection-table-names.const.d.ts +12 -0
- package/dist/shared/constants/collection-table-names.const.js +16 -0
- package/dist/shared/constants/component-inject-tokens.const.d.ts +7 -0
- package/dist/shared/constants/component-inject-tokens.const.js +11 -0
- package/dist/shared/constants/error-codes.const.d.ts +6 -0
- package/dist/shared/constants/error-codes.const.js +10 -0
- package/dist/shared/constants/index.d.ts +4 -0
- package/dist/shared/constants/index.js +21 -0
- package/dist/shared/core/filter.d.ts +80 -0
- package/dist/shared/core/filter.js +554 -0
- package/dist/shared/core/index.d.ts +1 -0
- package/dist/shared/core/index.js +17 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +21 -0
- package/dist/shared/interfaces/ambassador-dao.interface.d.ts +5 -0
- package/dist/shared/interfaces/ambassador-dao.interface.js +2 -0
- package/dist/shared/interfaces/ambassador-usecase.interface.d.ts +16 -0
- package/dist/shared/interfaces/ambassador-usecase.interface.js +2 -0
- package/dist/shared/interfaces/campaign-service.interface.d.ts +3 -0
- package/dist/shared/interfaces/campaign-service.interface.js +4 -0
- package/dist/shared/interfaces/index.d.ts +6 -0
- package/dist/shared/interfaces/index.js +22 -0
- package/dist/shared/interfaces/post-product-dao.interface.d.ts +8 -0
- package/dist/shared/interfaces/post-product-dao.interface.js +2 -0
- package/dist/shared/interfaces/product-service.interface.d.ts +6 -0
- package/dist/shared/interfaces/product-service.interface.js +2 -0
- package/dist/shared/interfaces/ugc-management-service.interface.d.ts +11 -0
- package/dist/shared/interfaces/ugc-management-service.interface.js +2 -0
- package/dist/shared/types/common.type.d.ts +4 -0
- package/dist/shared/types/common.type.js +2 -0
- package/dist/shared/types/discount.enum.d.ts +4 -0
- package/dist/shared/types/discount.enum.js +8 -0
- package/dist/shared/types/index.d.ts +4 -0
- package/dist/shared/types/index.js +20 -0
- package/dist/shared/types/shopify.type.d.ts +28 -0
- package/dist/shared/types/shopify.type.js +2 -0
- package/dist/shared/types/ugc.type.d.ts +41 -0
- package/dist/shared/types/ugc.type.js +2 -0
- package/package.json +56 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PaginationInput } from '@cbidigital/aqua-ddd';
|
|
2
|
+
import { ListResponse, ShopifyProduct } from '../types';
|
|
3
|
+
export interface IProductService {
|
|
4
|
+
getProducts(input: PaginationInput<ShopifyProduct>, productIds?: string[]): Promise<ListResponse<ShopifyProduct>>;
|
|
5
|
+
getProductsByShopifyCollectionIds(collectionIds?: string[]): Promise<ListResponse<ShopifyProduct>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PaginationInput } from '@cbidigital/aqua-ddd';
|
|
2
|
+
import { ListResponse, UGCPost } from '../types';
|
|
3
|
+
export type GetPostsParams = {
|
|
4
|
+
absUsernames?: string[];
|
|
5
|
+
ids?: string[];
|
|
6
|
+
paginationInput?: PaginationInput;
|
|
7
|
+
};
|
|
8
|
+
export interface IUgcManagementService {
|
|
9
|
+
getApprovedPosts(input: GetPostsParams): Promise<ListResponse<UGCPost>>;
|
|
10
|
+
getPostById(id: string): Promise<UGCPost>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscountValueType = void 0;
|
|
4
|
+
var DiscountValueType;
|
|
5
|
+
(function (DiscountValueType) {
|
|
6
|
+
DiscountValueType["PERCENTAGE"] = "percentage";
|
|
7
|
+
DiscountValueType["FIXED"] = "fixed";
|
|
8
|
+
})(DiscountValueType = exports.DiscountValueType || (exports.DiscountValueType = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./shopify.type"), exports);
|
|
18
|
+
__exportStar(require("./ugc.type"), exports);
|
|
19
|
+
__exportStar(require("./common.type"), exports);
|
|
20
|
+
__exportStar(require("./discount.enum"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ShopifyProduct = {
|
|
2
|
+
id: string;
|
|
3
|
+
productId?: string;
|
|
4
|
+
productName: string;
|
|
5
|
+
productShopifyId: string;
|
|
6
|
+
productMinPrice: string | number;
|
|
7
|
+
productMaxPrice: string | number;
|
|
8
|
+
productUrl: string;
|
|
9
|
+
productDescription: string;
|
|
10
|
+
productImage: string;
|
|
11
|
+
productMedia: {
|
|
12
|
+
node: {
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
}[];
|
|
16
|
+
productStatus: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
collectionId?: string;
|
|
20
|
+
};
|
|
21
|
+
export type ShopifyCollection = {
|
|
22
|
+
id: string;
|
|
23
|
+
collectionName: string;
|
|
24
|
+
collectionShopifyId: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
collectionProducts: ShopifyProduct[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type UGCPost = {
|
|
2
|
+
id: string;
|
|
3
|
+
postId: string;
|
|
4
|
+
postTitle: string;
|
|
5
|
+
postAuthorId: string;
|
|
6
|
+
postContent: string;
|
|
7
|
+
postContentExtra: {
|
|
8
|
+
end: number;
|
|
9
|
+
type: number;
|
|
10
|
+
start: number;
|
|
11
|
+
secUid: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
awemeId: string;
|
|
14
|
+
subType: number;
|
|
15
|
+
hashtagId: string;
|
|
16
|
+
isCommerce: false;
|
|
17
|
+
hashtagName: string;
|
|
18
|
+
userUniqueId: string;
|
|
19
|
+
}[];
|
|
20
|
+
postContentHtml: string;
|
|
21
|
+
postImpression: number;
|
|
22
|
+
postEngRate: number;
|
|
23
|
+
postEMV: number;
|
|
24
|
+
postStatus: string;
|
|
25
|
+
postType: string;
|
|
26
|
+
postUrl: string;
|
|
27
|
+
postSocialType: string;
|
|
28
|
+
postSocialCreatedAt: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
postMediaDetails: {
|
|
32
|
+
id: string;
|
|
33
|
+
postId: string;
|
|
34
|
+
mediaUrl: string;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
postAuthorId: string;
|
|
37
|
+
mediaType: string;
|
|
38
|
+
mediaPosition: number;
|
|
39
|
+
}[];
|
|
40
|
+
hidden?: boolean;
|
|
41
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@buunguyen3589/collections-module",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Collections management module built with HeronJS framework following Clean Architecture principles",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/**/*.js",
|
|
9
|
+
"dist/**/*.d.ts",
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"prepublishOnly": "npm run build",
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"heronjs",
|
|
20
|
+
"collections",
|
|
21
|
+
"module",
|
|
22
|
+
"clean-architecture",
|
|
23
|
+
"ddd",
|
|
24
|
+
"typescript"
|
|
25
|
+
],
|
|
26
|
+
"author": "buunguyen3589",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/buunguyen3589/test-ai.git",
|
|
31
|
+
"directory": "src/features/collections"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=20"
|
|
35
|
+
},
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@cbidigital/aqua-ddd": "^1.0.0-rc.6",
|
|
44
|
+
"@cbidigital/aqua": "^3.0.10",
|
|
45
|
+
"@heronjs/common": "^3.3.40",
|
|
46
|
+
"zod": "^3.24.1",
|
|
47
|
+
"http-status-codes": "*",
|
|
48
|
+
"knex": "*",
|
|
49
|
+
"axios": "*"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^20.12.13",
|
|
53
|
+
"typescript": "^4.9.5"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|