tt-entities 0.1.1 → 0.1.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.
- package/dist/libs/tatayab-entities-library/entities/marketing-feed.entity.d.ts +29 -0
- package/dist/libs/tatayab-entities-library/entities/marketing-feed.entity.js +122 -0
- package/dist/libs/tatayab-entities-library/entities/marketing-feed.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.d.ts +1 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.js +4 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.js.map +1 -1
- package/dist/libs/tatayab-entities-library/index.d.ts +1 -0
- package/dist/libs/tatayab-entities-library/index.js +5 -1
- package/dist/libs/tatayab-entities-library/index.js.map +1 -1
- package/libs/tatayab-entities-library/src/entities/marketing-feed.entity.ts +106 -0
- package/libs/tatayab-entities-library/src/entities/order.entity.ts +3 -0
- package/libs/tatayab-entities-library/src/index.ts +9 -0
- package/package.json +1 -1
- package/src/database/migrations/20260625000001-create-marketing-feeds.js +187 -0
- package/src/database/migrations/20260627000000-add-catalog-search-fulltext-indexes.js +89 -0
- package/src/database/migrations/20260627120000-add-gateway-payment-id-to-orders.js +38 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Store } from './store.entity';
|
|
3
|
+
export type FeedPlatform = 'meta' | 'google' | 'tiktok' | 'snapchat' | 'other';
|
|
4
|
+
export type FeedOutputFormat = 'csv' | 'tsv' | 'xml';
|
|
5
|
+
export type FeedStatus = 'active' | 'inactive';
|
|
6
|
+
export declare class MarketingFeed extends Model {
|
|
7
|
+
name: string;
|
|
8
|
+
platform: FeedPlatform;
|
|
9
|
+
status: FeedStatus;
|
|
10
|
+
storeId: number;
|
|
11
|
+
store: Store;
|
|
12
|
+
countryIds: number[] | null;
|
|
13
|
+
filterBrandIds: number[] | null;
|
|
14
|
+
filterCategoryIds: number[] | null;
|
|
15
|
+
filterMinPrice: number | null;
|
|
16
|
+
filterMaxPrice: number | null;
|
|
17
|
+
filterMinSalePrice: number | null;
|
|
18
|
+
filterMaxSalePrice: number | null;
|
|
19
|
+
filterOnSaleOnly: boolean;
|
|
20
|
+
filterInStockOnly: boolean;
|
|
21
|
+
filterTagIds: number[] | null;
|
|
22
|
+
filterSkuSearch: string | null;
|
|
23
|
+
outputFormat: FeedOutputFormat;
|
|
24
|
+
storefrontBaseUrl: string | null;
|
|
25
|
+
lastGeneratedAt: Date | null;
|
|
26
|
+
lastRowCount: number | null;
|
|
27
|
+
createdBy: number | null;
|
|
28
|
+
updatedBy: number | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MarketingFeed = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const store_entity_1 = require("./store.entity");
|
|
15
|
+
let MarketingFeed = class MarketingFeed extends sequelize_typescript_1.Model {
|
|
16
|
+
};
|
|
17
|
+
exports.MarketingFeed = MarketingFeed;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING(255), allowNull: false }),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], MarketingFeed.prototype, "name", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, sequelize_typescript_1.Column)({
|
|
24
|
+
type: sequelize_typescript_1.DataType.ENUM('meta', 'google', 'tiktok', 'snapchat', 'other'),
|
|
25
|
+
allowNull: false,
|
|
26
|
+
defaultValue: 'meta',
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], MarketingFeed.prototype, "platform", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, sequelize_typescript_1.Column)({
|
|
32
|
+
type: sequelize_typescript_1.DataType.ENUM('active', 'inactive'),
|
|
33
|
+
allowNull: false,
|
|
34
|
+
defaultValue: 'active',
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], MarketingFeed.prototype, "status", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, sequelize_typescript_1.ForeignKey)(() => store_entity_1.Store),
|
|
40
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: false }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], MarketingFeed.prototype, "storeId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.BelongsTo)(() => store_entity_1.Store),
|
|
45
|
+
__metadata("design:type", store_entity_1.Store)
|
|
46
|
+
], MarketingFeed.prototype, "store", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.JSON, allowNull: true, defaultValue: null }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], MarketingFeed.prototype, "countryIds", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.JSON, allowNull: true, defaultValue: null }),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], MarketingFeed.prototype, "filterBrandIds", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.JSON, allowNull: true, defaultValue: null }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], MarketingFeed.prototype, "filterCategoryIds", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null }),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], MarketingFeed.prototype, "filterMinPrice", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null }),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], MarketingFeed.prototype, "filterMaxPrice", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null }),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], MarketingFeed.prototype, "filterMinSalePrice", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null }),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], MarketingFeed.prototype, "filterMaxSalePrice", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.BOOLEAN, allowNull: false, defaultValue: false }),
|
|
77
|
+
__metadata("design:type", Boolean)
|
|
78
|
+
], MarketingFeed.prototype, "filterOnSaleOnly", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.BOOLEAN, allowNull: false, defaultValue: false }),
|
|
81
|
+
__metadata("design:type", Boolean)
|
|
82
|
+
], MarketingFeed.prototype, "filterInStockOnly", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.JSON, allowNull: true, defaultValue: null }),
|
|
85
|
+
__metadata("design:type", Array)
|
|
86
|
+
], MarketingFeed.prototype, "filterTagIds", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING(255), allowNull: true, defaultValue: null }),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], MarketingFeed.prototype, "filterSkuSearch", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, sequelize_typescript_1.Column)({
|
|
93
|
+
type: sequelize_typescript_1.DataType.ENUM('csv', 'tsv', 'xml'),
|
|
94
|
+
allowNull: false,
|
|
95
|
+
defaultValue: 'csv',
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], MarketingFeed.prototype, "outputFormat", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.STRING(500), allowNull: true, defaultValue: null }),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], MarketingFeed.prototype, "storefrontBaseUrl", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: true, defaultValue: null }),
|
|
105
|
+
__metadata("design:type", Date)
|
|
106
|
+
], MarketingFeed.prototype, "lastGeneratedAt", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: true, defaultValue: null }),
|
|
109
|
+
__metadata("design:type", Number)
|
|
110
|
+
], MarketingFeed.prototype, "lastRowCount", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: true }),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], MarketingFeed.prototype, "createdBy", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: true }),
|
|
117
|
+
__metadata("design:type", Number)
|
|
118
|
+
], MarketingFeed.prototype, "updatedBy", void 0);
|
|
119
|
+
exports.MarketingFeed = MarketingFeed = __decorate([
|
|
120
|
+
(0, sequelize_typescript_1.Table)({ tableName: 'MarketingFeeds', paranoid: true, timestamps: true })
|
|
121
|
+
], MarketingFeed);
|
|
122
|
+
//# sourceMappingURL=marketing-feed.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketing-feed.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/marketing-feed.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAU8B;AAC9B,iDAAuC;AAOhC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,4BAAK;CAuFvC,CAAA;AAvFY,sCAAa;AAGhB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2CACpC;AAOb;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC;QACpE,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,MAAM;KACrB,CAAC;;+CAC6B;AAOvB;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;QACzC,SAAS,EAAE,KAAK;QACh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AAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;;mDACpC;AAI5B;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gDACnB;AAGzB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gDACnB;wBArFtB,aAAa;IADzB,IAAA,4BAAK,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GAC5D,aAAa,CAuFzB"}
|
|
@@ -152,6 +152,10 @@ __decorate([
|
|
|
152
152
|
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
153
153
|
__metadata("design:type", String)
|
|
154
154
|
], Order.prototype, "paymentReference", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], Order.prototype, "gatewayPaymentId", void 0);
|
|
155
159
|
__decorate([
|
|
156
160
|
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: true }),
|
|
157
161
|
__metadata("design:type", Date)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/order.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAQ8B;AAC9B,+CAAqC;AACrC,iDAAuC;AACvC,qDAA2C;AAC3C,+DAAoD;AACpD,2DAAgD;AAChD,+EAAmE;AACnE,uEAA4D;AAC5D,iFAAoE;AACpE,iEAAsD;AACtD,2EAA+D;AAGxD,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,4BAAK;
|
|
1
|
+
{"version":3,"file":"order.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/order.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAQ8B;AAC9B,+CAAqC;AACrC,iDAAuC;AACvC,qDAA2C;AAC3C,+DAAoD;AACpD,2DAAgD;AAChD,+EAAmE;AACnE,uEAA4D;AAC5D,iFAAoE;AACpE,iEAAsD;AACtD,2EAA+D;AAGxD,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,4BAAK;CAoM/B,CAAA;AApMY,sBAAK;AAGR;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;0CACf;AAKpB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACtB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;qCACJ;AAIhB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;yCACA;AAIpB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;IACvB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sCACL;AAMhB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,iCAAW,CAAC;IAC7B,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;uCACJ;AAKjB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC;;yCACnC;AAKnB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gDACO;AAG3B;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI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|
65
65
|
export { OrderPayment, OrderPaymentStatus, OrderPaymentType, } from './entities/order-payment.entity';
|
|
66
66
|
export { OrderEditSession } from './entities/order-edit-session.entity';
|
|
67
67
|
export { OrderEditItem } from './entities/order-edit-item.entity';
|
|
68
|
+
export { MarketingFeed, FeedPlatform, FeedOutputFormat, FeedStatus, } from './entities/marketing-feed.entity';
|
|
68
69
|
export { OsName } from './utils/enums/osName';
|
|
69
70
|
export { ProductApp } from './utils/enums/productApp';
|
|
70
71
|
export { VersionType } from './utils/enums/versiontype';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Permission = exports.PurchaseOrderItemStatus = exports.PurchaseOrderItem = exports.PurchaseOrder = exports.VendorProduct = exports.Vendor = exports.ShippingRule = exports.StockMovement = exports.InventoryStock = exports.StoreInventory = exports.Inventory = exports.ProductStore = exports.Store = exports.BundleStore = exports.BundleProduct = exports.Bundle = exports.ProductTag = exports.Tag = exports.ProductVariantOption = exports.ProductVariant = exports.MediaType = exports.ProductMedia = exports.Product = exports.VariantOption = exports.VariantType = exports.Brand = exports.Category = exports.UserWalletBalance = exports.RefundStatus = exports.RefundMethod = exports.Refund = exports.RunSheetOrderStatus = exports.RunSheetOrder = exports.RunSheetStatus = exports.RunSheet = exports.AppConfig = exports.BannerStatus = exports.BannerPlacement = exports.Banner = exports.FavoriteCatalogItemType = exports.UserFavoriteCatalog = exports.UserFavorite = exports.UserAddress = exports.UserDevice = exports.User = exports.SysUser = exports.SysRole = exports.Area = exports.Country = exports.ApiKey = void 0;
|
|
4
|
-
exports.StockMovementType = exports.PurchaseOrderStatus = exports.Gender = exports.Status = exports.Language = exports.VersionType = exports.ProductApp = exports.OsName = exports.OrderEditItem = exports.OrderEditSession = exports.OrderPaymentType = exports.OrderPaymentStatus = exports.OrderPayment = exports.OrderEditScenario = exports.OrderItemChangeLog = exports.PurchaseOrderReceiptItem = exports.PurchaseOrderReceipt = exports.PurchaseOrderOrderItem = exports.TransactionCategory = exports.TransactionType = exports.UserTransaction = exports.OrderStatusHistory = exports.OrderItemBundleSelection = exports.OrderItemFulfillmentStatus = exports.OrderItemType = exports.OrderItem = exports.Order = exports.OrderStatusCode = exports.OrderStatus = exports.CouponUser = exports.CouponProduct = exports.CouponStore = exports.CouponOsTarget = exports.CouponAppliesTo = exports.CouponDiscountType = exports.Coupon = exports.CartItemBundleSelection = exports.CartItemType = exports.CartItem = exports.CartStatus = exports.Cart = exports.StorePaymentMethod = exports.PaymentMethodCountry = exports.PaymentMethodType = exports.PaymentMethod = exports.PaymentGatewayType = exports.PaymentGateway = exports.RolePermission = void 0;
|
|
4
|
+
exports.StockMovementType = exports.PurchaseOrderStatus = exports.Gender = exports.Status = exports.Language = exports.VersionType = exports.ProductApp = exports.OsName = exports.MarketingFeed = exports.OrderEditItem = exports.OrderEditSession = exports.OrderPaymentType = exports.OrderPaymentStatus = exports.OrderPayment = exports.OrderEditScenario = exports.OrderItemChangeLog = exports.PurchaseOrderReceiptItem = exports.PurchaseOrderReceipt = exports.PurchaseOrderOrderItem = exports.TransactionCategory = exports.TransactionType = exports.UserTransaction = exports.OrderStatusHistory = exports.OrderItemBundleSelection = exports.OrderItemFulfillmentStatus = exports.OrderItemType = exports.OrderItem = exports.Order = exports.OrderStatusCode = exports.OrderStatus = exports.CouponUser = exports.CouponProduct = exports.CouponStore = exports.CouponOsTarget = exports.CouponAppliesTo = exports.CouponDiscountType = exports.Coupon = exports.CartItemBundleSelection = exports.CartItemType = exports.CartItem = exports.CartStatus = exports.Cart = exports.StorePaymentMethod = exports.PaymentMethodCountry = exports.PaymentMethodType = exports.PaymentMethod = exports.PaymentGatewayType = exports.PaymentGateway = exports.RolePermission = void 0;
|
|
5
5
|
exports.getDbModels = getDbModels;
|
|
6
6
|
const country_entity_1 = require("./entities/country.entity");
|
|
7
7
|
const area_entity_1 = require("./entities/area.entity");
|
|
@@ -69,6 +69,7 @@ const order_item_change_log_entity_1 = require("./entities/order-item-change-log
|
|
|
69
69
|
const order_payment_entity_1 = require("./entities/order-payment.entity");
|
|
70
70
|
const order_edit_session_entity_1 = require("./entities/order-edit-session.entity");
|
|
71
71
|
const order_edit_item_entity_1 = require("./entities/order-edit-item.entity");
|
|
72
|
+
const marketing_feed_entity_1 = require("./entities/marketing-feed.entity");
|
|
72
73
|
var apikey_entity_2 = require("./entities/apikey.entity");
|
|
73
74
|
Object.defineProperty(exports, "ApiKey", { enumerable: true, get: function () { return apikey_entity_2.ApiKey; } });
|
|
74
75
|
var country_entity_2 = require("./entities/country.entity");
|
|
@@ -225,6 +226,8 @@ var order_edit_session_entity_2 = require("./entities/order-edit-session.entity"
|
|
|
225
226
|
Object.defineProperty(exports, "OrderEditSession", { enumerable: true, get: function () { return order_edit_session_entity_2.OrderEditSession; } });
|
|
226
227
|
var order_edit_item_entity_2 = require("./entities/order-edit-item.entity");
|
|
227
228
|
Object.defineProperty(exports, "OrderEditItem", { enumerable: true, get: function () { return order_edit_item_entity_2.OrderEditItem; } });
|
|
229
|
+
var marketing_feed_entity_2 = require("./entities/marketing-feed.entity");
|
|
230
|
+
Object.defineProperty(exports, "MarketingFeed", { enumerable: true, get: function () { return marketing_feed_entity_2.MarketingFeed; } });
|
|
228
231
|
var osName_1 = require("./utils/enums/osName");
|
|
229
232
|
Object.defineProperty(exports, "OsName", { enumerable: true, get: function () { return osName_1.OsName; } });
|
|
230
233
|
var productApp_1 = require("./utils/enums/productApp");
|
|
@@ -309,6 +312,7 @@ function getDbModels() {
|
|
|
309
312
|
order_payment_entity_1.OrderPayment,
|
|
310
313
|
order_edit_session_entity_1.OrderEditSession,
|
|
311
314
|
order_edit_item_entity_1.OrderEditItem,
|
|
315
|
+
marketing_feed_entity_1.MarketingFeed,
|
|
312
316
|
];
|
|
313
317
|
}
|
|
314
318
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/tatayab-entities-library/src/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/tatayab-entities-library/src/index.ts"],"names":[],"mappings":";;;;AAiPA,kCAgGC;AA9UD,8DAAoD;AACpD,wDAA8C;AAC9C,gEAAqD;AACrD,gEAAqD;AACrD,wDAA8C;AAC9C,oEAA0D;AAC1D,4DAAkD;AAClD,wEAA6D;AAC7D,0EAA+D;AAC/D,0FAA8E;AAC9E,4DAAkD;AAClD,oEAAyD;AAGzD,gEAAsD;AACtD,0DAAgD;AAChD,wEAA6D;AAC7D,4EAAiE;AACjE,8DAAoD;AACpD,0EAA+D;AAC/D,8EAAmE;AACnE,4FAAgF;AAChF,sDAA4C;AAC5C,sEAA2D;AAC3D,4DAAkD;AAClD,4EAAiE;AACjE,wEAA6D;AAG7D,0DAAgD;AAChD,0EAA+D;AAG/D,kEAAwD;AACxD,8EAAmE;AACnE,8EAAmE;AACnE,4EAAiE;AACjE,0EAA+D;AAG/D,4DAAkD;AAClD,4EAAiE;AACjE,4EAAiE;AACjE,sFAA0E;AAG1E,oEAA0D;AAC1D,8EAAmE;AAGnE,8EAAmE;AACnE,4EAAiE;AACjE,4FAAgF;AAChF,wFAA4E;AAG5E,wDAA8C;AAC9C,kEAAuD;AACvD,oGAAuF;AAGvF,4DAAkD;AAClD,wEAA6D;AAC7D,4EAAiE;AACjE,sEAA2D;AAG3D,wEAA6D;AAC7D,0DAAgD;AAChD,oEAAyD;AACzD,sGAAyF;AACzF,wFAA4E;AAC5E,gFAAqE;AACrE,kGAAqF;AACrF,kEAAuD;AACvD,8EAAkE;AAClE,4DAAkD;AAClD,4FAAgF;AAChF,sGAAyF;AACzF,sFAA0E;AAC1E,0FAA6E;AAC7E,0EAA+D;AAC/D,oFAAwE;AACxE,8EAAkE;AAClE,4EAAiE;AAOjE,0DAAkD;AAAzC,uGAAA,MAAM,OAAA;AACf,4DAAoD;AAA3C,yGAAA,OAAO,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,sBAAM;QACN,kBAAI;QACJ,wBAAO;QACP,yBAAO;QACP,yBAAO;QACP,kBAAI;QACJ,8BAAU;QACV,iCAAW;QACX,mCAAY;QACZ,kDAAmB;QACnB,yCAAe;QACf,8CAAiB;QAGjB,0BAAQ;QACR,oBAAK;QACL,iCAAW;QACX,qCAAa;QACb,wBAAO;QACP,mCAAY;QACZ,uCAAc;QACd,oDAAoB;QACpB,gBAAG;QACH,+BAAU;QACV,sBAAM;QACN,qCAAa;QACb,iCAAW;QAGX,oBAAK;QACL,mCAAY;QAGZ,4BAAS;QACT,uCAAc;QACd,uCAAc;QACd,qCAAa;QACb,mCAAY;QAGZ,sBAAM;QACN,qCAAa;QACb,qCAAa;QACb,8CAAiB;QAGjB,8BAAU;QACV,uCAAc;QAGd,uCAAc;QACd,qCAAa;QACb,oDAAoB;QACpB,gDAAkB;QAGlB,kBAAI;QACJ,2BAAQ;QACR,2DAAuB;QAGvB,sBAAM;QACN,iCAAW;QACX,qCAAa;QACb,+BAAU;QAGV,iCAAW;QACX,oBAAK;QACL,6BAAS;QACT,6DAAwB;QACxB,gDAAkB;QAClB,yDAAsB;QAGtB,sBAAM;QAEN,6BAAS;QAET,2BAAQ;QACR,sCAAa;QAEb,sBAAM;QACN,oDAAoB;QACpB,6DAAwB;QAExB,iDAAkB;QAClB,mCAAY;QACZ,4CAAgB;QAChB,sCAAa;QAEb,qCAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
Column,
|
|
4
|
+
Model,
|
|
5
|
+
DataType,
|
|
6
|
+
ForeignKey,
|
|
7
|
+
BelongsTo,
|
|
8
|
+
CreatedAt,
|
|
9
|
+
UpdatedAt,
|
|
10
|
+
DeletedAt,
|
|
11
|
+
} from 'sequelize-typescript';
|
|
12
|
+
import { Store } from './store.entity';
|
|
13
|
+
|
|
14
|
+
export type FeedPlatform = 'meta' | 'google' | 'tiktok' | 'snapchat' | 'other';
|
|
15
|
+
export type FeedOutputFormat = 'csv' | 'tsv' | 'xml';
|
|
16
|
+
export type FeedStatus = 'active' | 'inactive';
|
|
17
|
+
|
|
18
|
+
@Table({ tableName: 'MarketingFeeds', paranoid: true, timestamps: true })
|
|
19
|
+
export class MarketingFeed extends Model {
|
|
20
|
+
// ── Identity ───────────────────────────────────────────────────────────────
|
|
21
|
+
@Column({ type: DataType.STRING(255), allowNull: false })
|
|
22
|
+
declare name: string;
|
|
23
|
+
|
|
24
|
+
@Column({
|
|
25
|
+
type: DataType.ENUM('meta', 'google', 'tiktok', 'snapchat', 'other'),
|
|
26
|
+
allowNull: false,
|
|
27
|
+
defaultValue: 'meta',
|
|
28
|
+
})
|
|
29
|
+
declare platform: FeedPlatform;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
type: DataType.ENUM('active', 'inactive'),
|
|
33
|
+
allowNull: false,
|
|
34
|
+
defaultValue: 'active',
|
|
35
|
+
})
|
|
36
|
+
declare status: FeedStatus;
|
|
37
|
+
|
|
38
|
+
// ── Store / Country scope ──────────────────────────────────────────────────
|
|
39
|
+
@ForeignKey(() => Store)
|
|
40
|
+
@Column({ type: DataType.INTEGER, allowNull: false })
|
|
41
|
+
declare storeId: number;
|
|
42
|
+
|
|
43
|
+
@BelongsTo(() => Store)
|
|
44
|
+
declare store: Store;
|
|
45
|
+
|
|
46
|
+
/** JSON int[] — null means all countries for this store */
|
|
47
|
+
@Column({ type: DataType.JSON, allowNull: true, defaultValue: null })
|
|
48
|
+
declare countryIds: number[] | null;
|
|
49
|
+
|
|
50
|
+
// ── Filters ────────────────────────────────────────────────────────────────
|
|
51
|
+
@Column({ type: DataType.JSON, allowNull: true, defaultValue: null })
|
|
52
|
+
declare filterBrandIds: number[] | null;
|
|
53
|
+
|
|
54
|
+
@Column({ type: DataType.JSON, allowNull: true, defaultValue: null })
|
|
55
|
+
declare filterCategoryIds: number[] | null;
|
|
56
|
+
|
|
57
|
+
@Column({ type: DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null })
|
|
58
|
+
declare filterMinPrice: number | null;
|
|
59
|
+
|
|
60
|
+
@Column({ type: DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null })
|
|
61
|
+
declare filterMaxPrice: number | null;
|
|
62
|
+
|
|
63
|
+
@Column({ type: DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null })
|
|
64
|
+
declare filterMinSalePrice: number | null;
|
|
65
|
+
|
|
66
|
+
@Column({ type: DataType.DECIMAL(10, 3), allowNull: true, defaultValue: null })
|
|
67
|
+
declare filterMaxSalePrice: number | null;
|
|
68
|
+
|
|
69
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })
|
|
70
|
+
declare filterOnSaleOnly: boolean;
|
|
71
|
+
|
|
72
|
+
@Column({ type: DataType.BOOLEAN, allowNull: false, defaultValue: false })
|
|
73
|
+
declare filterInStockOnly: boolean;
|
|
74
|
+
|
|
75
|
+
@Column({ type: DataType.JSON, allowNull: true, defaultValue: null })
|
|
76
|
+
declare filterTagIds: number[] | null;
|
|
77
|
+
|
|
78
|
+
@Column({ type: DataType.STRING(255), allowNull: true, defaultValue: null })
|
|
79
|
+
declare filterSkuSearch: string | null;
|
|
80
|
+
|
|
81
|
+
// ── Output ─────────────────────────────────────────────────────────────────
|
|
82
|
+
@Column({
|
|
83
|
+
type: DataType.ENUM('csv', 'tsv', 'xml'),
|
|
84
|
+
allowNull: false,
|
|
85
|
+
defaultValue: 'csv',
|
|
86
|
+
})
|
|
87
|
+
declare outputFormat: FeedOutputFormat;
|
|
88
|
+
|
|
89
|
+
@Column({ type: DataType.STRING(500), allowNull: true, defaultValue: null })
|
|
90
|
+
declare storefrontBaseUrl: string | null;
|
|
91
|
+
|
|
92
|
+
// ── Stats ──────────────────────────────────────────────────────────────────
|
|
93
|
+
@Column({ type: DataType.DATE, allowNull: true, defaultValue: null })
|
|
94
|
+
declare lastGeneratedAt: Date | null;
|
|
95
|
+
|
|
96
|
+
@Column({ type: DataType.INTEGER, allowNull: true, defaultValue: null })
|
|
97
|
+
declare lastRowCount: number | null;
|
|
98
|
+
|
|
99
|
+
// ── Audit ──────────────────────────────────────────────────────────────────
|
|
100
|
+
@Column({ type: DataType.INTEGER, allowNull: true })
|
|
101
|
+
declare createdBy: number | null;
|
|
102
|
+
|
|
103
|
+
@Column({ type: DataType.INTEGER, allowNull: true })
|
|
104
|
+
declare updatedBy: number | null;
|
|
105
|
+
|
|
106
|
+
}
|
|
@@ -129,6 +129,9 @@ export class Order extends Model {
|
|
|
129
129
|
@Column({ allowNull: true })
|
|
130
130
|
declare paymentReference?: string; // Gateway transaction ID
|
|
131
131
|
|
|
132
|
+
@Column({ allowNull: true })
|
|
133
|
+
declare gatewayPaymentId?: string;
|
|
134
|
+
|
|
132
135
|
@Column({ type: DataType.DATE, allowNull: true })
|
|
133
136
|
declare paidAt?: Date;
|
|
134
137
|
|
|
@@ -85,6 +85,7 @@ import { OrderItemChangeLog } from './entities/order-item-change-log.entity';
|
|
|
85
85
|
import { OrderPayment } from './entities/order-payment.entity';
|
|
86
86
|
import { OrderEditSession } from './entities/order-edit-session.entity';
|
|
87
87
|
import { OrderEditItem } from './entities/order-edit-item.entity';
|
|
88
|
+
import { MarketingFeed } from './entities/marketing-feed.entity';
|
|
88
89
|
|
|
89
90
|
// =============================================================================
|
|
90
91
|
// EXPORTS
|
|
@@ -217,6 +218,12 @@ export {
|
|
|
217
218
|
} from './entities/order-payment.entity';
|
|
218
219
|
export { OrderEditSession } from './entities/order-edit-session.entity';
|
|
219
220
|
export { OrderEditItem } from './entities/order-edit-item.entity';
|
|
221
|
+
export {
|
|
222
|
+
MarketingFeed,
|
|
223
|
+
FeedPlatform,
|
|
224
|
+
FeedOutputFormat,
|
|
225
|
+
FeedStatus,
|
|
226
|
+
} from './entities/marketing-feed.entity';
|
|
220
227
|
|
|
221
228
|
// ─── Enums ────────────────────────────────────────────────────────────────────
|
|
222
229
|
export { OsName } from './utils/enums/osName';
|
|
@@ -325,5 +332,7 @@ export function getDbModels(): ModelCtor[] {
|
|
|
325
332
|
OrderPayment,
|
|
326
333
|
OrderEditSession,
|
|
327
334
|
OrderEditItem,
|
|
335
|
+
|
|
336
|
+
MarketingFeed,
|
|
328
337
|
];
|
|
329
338
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/** @type {import('sequelize-cli').Migration} */
|
|
4
|
+
module.exports = {
|
|
5
|
+
async up(queryInterface, Sequelize) {
|
|
6
|
+
await queryInterface.createTable('MarketingFeeds', {
|
|
7
|
+
id: {
|
|
8
|
+
type: Sequelize.INTEGER,
|
|
9
|
+
autoIncrement: true,
|
|
10
|
+
primaryKey: true,
|
|
11
|
+
allowNull: false,
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// ── Identity ────────────────────────────────────────────────────────────
|
|
15
|
+
name: {
|
|
16
|
+
type: Sequelize.STRING(255),
|
|
17
|
+
allowNull: false,
|
|
18
|
+
comment: 'Admin-defined label, e.g. "Kuwait — Fragrances Q3"',
|
|
19
|
+
},
|
|
20
|
+
platform: {
|
|
21
|
+
type: Sequelize.ENUM('meta', 'google', 'tiktok', 'snapchat', 'other'),
|
|
22
|
+
allowNull: false,
|
|
23
|
+
defaultValue: 'meta',
|
|
24
|
+
comment: 'Ad platform this feed is generated for',
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: Sequelize.ENUM('active', 'inactive'),
|
|
28
|
+
allowNull: false,
|
|
29
|
+
defaultValue: 'active',
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// ── Store / Country scope ────────────────────────────────────────────────
|
|
33
|
+
storeId: {
|
|
34
|
+
type: Sequelize.INTEGER,
|
|
35
|
+
allowNull: false,
|
|
36
|
+
references: { model: 'Stores', key: 'id' },
|
|
37
|
+
onUpdate: 'CASCADE',
|
|
38
|
+
onDelete: 'RESTRICT',
|
|
39
|
+
comment: 'The store this feed is scoped to',
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* For non-global stores this will equal the store's single countryId.
|
|
43
|
+
* For global stores the admin can pick one or more countries — stored
|
|
44
|
+
* as a JSON array of countryId integers, e.g. [1, 3, 5].
|
|
45
|
+
* NULL means "all countries served by this store".
|
|
46
|
+
*/
|
|
47
|
+
countryIds: {
|
|
48
|
+
type: Sequelize.JSON,
|
|
49
|
+
allowNull: true,
|
|
50
|
+
defaultValue: null,
|
|
51
|
+
comment: 'JSON int[] of countryIds; null = all countries for this store',
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
// ── Product filters ──────────────────────────────────────────────────────
|
|
55
|
+
/**
|
|
56
|
+
* Each filter field is nullable. NULL = no filter applied (include all).
|
|
57
|
+
* Arrays stored as JSON int[].
|
|
58
|
+
*/
|
|
59
|
+
filterBrandIds: {
|
|
60
|
+
type: Sequelize.JSON,
|
|
61
|
+
allowNull: true,
|
|
62
|
+
defaultValue: null,
|
|
63
|
+
comment: 'JSON int[] of Brand IDs to include; null = all brands',
|
|
64
|
+
},
|
|
65
|
+
filterCategoryIds: {
|
|
66
|
+
type: Sequelize.JSON,
|
|
67
|
+
allowNull: true,
|
|
68
|
+
defaultValue: null,
|
|
69
|
+
comment: 'JSON int[] of Category IDs (incl. descendants resolved at runtime); null = all',
|
|
70
|
+
},
|
|
71
|
+
filterMinPrice: {
|
|
72
|
+
type: Sequelize.DECIMAL(10, 3),
|
|
73
|
+
allowNull: true,
|
|
74
|
+
defaultValue: null,
|
|
75
|
+
comment: 'Min regularPrice in store currency; null = no floor',
|
|
76
|
+
},
|
|
77
|
+
filterMaxPrice: {
|
|
78
|
+
type: Sequelize.DECIMAL(10, 3),
|
|
79
|
+
allowNull: true,
|
|
80
|
+
defaultValue: null,
|
|
81
|
+
comment: 'Max regularPrice in store currency; null = no ceiling',
|
|
82
|
+
},
|
|
83
|
+
filterMinSalePrice: {
|
|
84
|
+
type: Sequelize.DECIMAL(10, 3),
|
|
85
|
+
allowNull: true,
|
|
86
|
+
defaultValue: null,
|
|
87
|
+
comment: 'Min salePrice; null = no filter',
|
|
88
|
+
},
|
|
89
|
+
filterMaxSalePrice: {
|
|
90
|
+
type: Sequelize.DECIMAL(10, 3),
|
|
91
|
+
allowNull: true,
|
|
92
|
+
defaultValue: null,
|
|
93
|
+
comment: 'Max salePrice; null = no filter',
|
|
94
|
+
},
|
|
95
|
+
filterOnSaleOnly: {
|
|
96
|
+
type: Sequelize.BOOLEAN,
|
|
97
|
+
allowNull: false,
|
|
98
|
+
defaultValue: false,
|
|
99
|
+
comment: 'If true, only include SKUs where salePrice < regularPrice',
|
|
100
|
+
},
|
|
101
|
+
filterInStockOnly: {
|
|
102
|
+
type: Sequelize.BOOLEAN,
|
|
103
|
+
allowNull: false,
|
|
104
|
+
defaultValue: false,
|
|
105
|
+
comment: 'If true, only include SKUs with physicalQty > 0 or availableFromVendor',
|
|
106
|
+
},
|
|
107
|
+
filterTagIds: {
|
|
108
|
+
type: Sequelize.JSON,
|
|
109
|
+
allowNull: true,
|
|
110
|
+
defaultValue: null,
|
|
111
|
+
comment: 'JSON int[] of Tag IDs; null = no tag filter',
|
|
112
|
+
},
|
|
113
|
+
filterSkuSearch: {
|
|
114
|
+
type: Sequelize.STRING(255),
|
|
115
|
+
allowNull: true,
|
|
116
|
+
defaultValue: null,
|
|
117
|
+
comment: 'Optional SKU prefix/substring filter',
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// ── Output options ───────────────────────────────────────────────────────
|
|
121
|
+
outputFormat: {
|
|
122
|
+
type: Sequelize.ENUM('csv', 'tsv', 'xml'),
|
|
123
|
+
allowNull: false,
|
|
124
|
+
defaultValue: 'csv',
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Storefront base URL used to build product deep-links in the feed.
|
|
128
|
+
* e.g. "https://tatayab.com/kw"
|
|
129
|
+
*/
|
|
130
|
+
storefrontBaseUrl: {
|
|
131
|
+
type: Sequelize.STRING(500),
|
|
132
|
+
allowNull: true,
|
|
133
|
+
defaultValue: null,
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
// ── Stats (updated on each generation) ──────────────────────────────────
|
|
137
|
+
lastGeneratedAt: {
|
|
138
|
+
type: Sequelize.DATE,
|
|
139
|
+
allowNull: true,
|
|
140
|
+
defaultValue: null,
|
|
141
|
+
},
|
|
142
|
+
lastRowCount: {
|
|
143
|
+
type: Sequelize.INTEGER,
|
|
144
|
+
allowNull: true,
|
|
145
|
+
defaultValue: null,
|
|
146
|
+
comment: 'Number of SKU rows in the last generated feed',
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
// ── Audit ────────────────────────────────────────────────────────────────
|
|
150
|
+
createdBy: {
|
|
151
|
+
type: Sequelize.INTEGER,
|
|
152
|
+
allowNull: true,
|
|
153
|
+
comment: 'SysUser id who created this feed config',
|
|
154
|
+
},
|
|
155
|
+
updatedBy: {
|
|
156
|
+
type: Sequelize.INTEGER,
|
|
157
|
+
allowNull: true,
|
|
158
|
+
},
|
|
159
|
+
createdAt: {
|
|
160
|
+
type: Sequelize.DATE,
|
|
161
|
+
allowNull: false,
|
|
162
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
|
|
163
|
+
},
|
|
164
|
+
updatedAt: {
|
|
165
|
+
type: Sequelize.DATE,
|
|
166
|
+
allowNull: false,
|
|
167
|
+
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
|
|
168
|
+
},
|
|
169
|
+
deletedAt: {
|
|
170
|
+
type: Sequelize.DATE,
|
|
171
|
+
allowNull: true,
|
|
172
|
+
defaultValue: null,
|
|
173
|
+
comment: 'Soft delete',
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// ── Indexes ──────────────────────────────────────────────────────────────
|
|
178
|
+
await queryInterface.addIndex('MarketingFeeds', ['storeId'], { name: 'mf_store_idx' });
|
|
179
|
+
await queryInterface.addIndex('MarketingFeeds', ['status'], { name: 'mf_status_idx' });
|
|
180
|
+
await queryInterface.addIndex('MarketingFeeds', ['platform'], { name: 'mf_platform_idx' });
|
|
181
|
+
await queryInterface.addIndex('MarketingFeeds', ['deletedAt'], { name: 'mf_deleted_idx' });
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
async down(queryInterface) {
|
|
185
|
+
await queryInterface.dropTable('MarketingFeeds');
|
|
186
|
+
},
|
|
187
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Migration: add-catalog-search-fulltext-indexes
|
|
5
|
+
*
|
|
6
|
+
* Adds FULLTEXT indexes on all columns searched by the catalog list service,
|
|
7
|
+
* plus a B-tree index on ProductVariants.sku for variant SKU lookup.
|
|
8
|
+
*
|
|
9
|
+
* Aurora MySQL (InnoDB) supports FULLTEXT natively.
|
|
10
|
+
* These are all additive — no existing column or index is modified/dropped.
|
|
11
|
+
*
|
|
12
|
+
* Filename convention: 20260627000000-add-catalog-search-fulltext-indexes.js
|
|
13
|
+
*
|
|
14
|
+
* Apply: npx sequelize-cli db:migrate
|
|
15
|
+
* Revert: npx sequelize-cli db:migrate:undo
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
up: async (queryInterface, Sequelize) => {
|
|
20
|
+
// ── 1. Products: name (EN + AR) + SKU ────────────────────────────────
|
|
21
|
+
// Covers: product name search, product SKU search
|
|
22
|
+
await queryInterface.sequelize.query(`
|
|
23
|
+
ALTER TABLE \`Products\`
|
|
24
|
+
ADD FULLTEXT INDEX \`ft_products_name_sku\` (\`nameEn\`, \`nameAr\`, \`sku\`)
|
|
25
|
+
`);
|
|
26
|
+
|
|
27
|
+
// ── 2. Brands: name (EN + AR) ────────────────────────────────────────
|
|
28
|
+
// Covers: brand name search (e.g. "Chanel", "شانيل")
|
|
29
|
+
await queryInterface.sequelize.query(`
|
|
30
|
+
ALTER TABLE \`Brands\`
|
|
31
|
+
ADD FULLTEXT INDEX \`ft_brands_name\` (\`nameEn\`, \`nameAr\`)
|
|
32
|
+
`);
|
|
33
|
+
|
|
34
|
+
// ── 3. Categories: name (EN + AR) ────────────────────────────────────
|
|
35
|
+
// Covers: category name search → BFS expansion to child categories
|
|
36
|
+
await queryInterface.sequelize.query(`
|
|
37
|
+
ALTER TABLE \`Categories\`
|
|
38
|
+
ADD FULLTEXT INDEX \`ft_categories_name\` (\`nameEn\`, \`nameAr\`)
|
|
39
|
+
`);
|
|
40
|
+
|
|
41
|
+
// ── 4. VariantOptions: name (EN + AR) ────────────────────────────────
|
|
42
|
+
// Covers: variant option name search (e.g. "100ml", "أحمر")
|
|
43
|
+
// Joined via ProductVariantOptions → ProductVariants → Products
|
|
44
|
+
await queryInterface.sequelize.query(`
|
|
45
|
+
ALTER TABLE \`VariantOptions\`
|
|
46
|
+
ADD FULLTEXT INDEX \`ft_variant_options_name\` (\`nameEn\`, \`nameAr\`)
|
|
47
|
+
`);
|
|
48
|
+
|
|
49
|
+
// ── 5. ProductVariants: SKU ───────────────────────────────────────────
|
|
50
|
+
// Covers: variant-level SKU search (e.g. "PROD-001-100ML")
|
|
51
|
+
// B-tree index is the right choice here: FULLTEXT on a single short
|
|
52
|
+
// column has no advantage over a regular index for SKU prefix/exact lookups.
|
|
53
|
+
// Skip if index already exists (e.g. added manually earlier).
|
|
54
|
+
await queryInterface.sequelize.query(`
|
|
55
|
+
ALTER TABLE \`ProductVariants\`
|
|
56
|
+
ADD INDEX \`idx_product_variants_sku\` (\`sku\`)
|
|
57
|
+
`);
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
down: async (queryInterface) => {
|
|
61
|
+
// Drop in reverse order — safe even if some were never created
|
|
62
|
+
// (Aurora ignores DROP INDEX on non-existent indexes when using IF EXISTS)
|
|
63
|
+
|
|
64
|
+
await queryInterface.sequelize.query(`
|
|
65
|
+
ALTER TABLE \`ProductVariants\`
|
|
66
|
+
DROP INDEX IF EXISTS \`idx_product_variants_sku\`
|
|
67
|
+
`);
|
|
68
|
+
|
|
69
|
+
await queryInterface.sequelize.query(`
|
|
70
|
+
ALTER TABLE \`VariantOptions\`
|
|
71
|
+
DROP INDEX IF EXISTS \`ft_variant_options_name\`
|
|
72
|
+
`);
|
|
73
|
+
|
|
74
|
+
await queryInterface.sequelize.query(`
|
|
75
|
+
ALTER TABLE \`Categories\`
|
|
76
|
+
DROP INDEX IF EXISTS \`ft_categories_name\`
|
|
77
|
+
`);
|
|
78
|
+
|
|
79
|
+
await queryInterface.sequelize.query(`
|
|
80
|
+
ALTER TABLE \`Brands\`
|
|
81
|
+
DROP INDEX IF EXISTS \`ft_brands_name\`
|
|
82
|
+
`);
|
|
83
|
+
|
|
84
|
+
await queryInterface.sequelize.query(`
|
|
85
|
+
ALTER TABLE \`Products\`
|
|
86
|
+
DROP INDEX IF EXISTS \`ft_products_name_sku\`
|
|
87
|
+
`);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Migration: add-gateway-payment-id-to-orders
|
|
5
|
+
*
|
|
6
|
+
* Adds `gatewayPaymentId` (nullable VARCHAR 255) to the Orders table.
|
|
7
|
+
*
|
|
8
|
+
* This is a generic column — each payment gateway stores its own
|
|
9
|
+
* payment/session identifier here at order placement time:
|
|
10
|
+
*
|
|
11
|
+
* tabby → payment.id UUID from /api/v2/checkout response
|
|
12
|
+
* taly → can store their order token when needed
|
|
13
|
+
* knet/cc → can store UPayments charge ID when needed
|
|
14
|
+
*
|
|
15
|
+
* Used in confirmPayment() to call gateway-specific post-payment APIs
|
|
16
|
+
* (e.g. Tabby capture) without requiring the frontend to pass it.
|
|
17
|
+
*
|
|
18
|
+
* Filename: 20260627120000-add-gateway-payment-id-to-orders.js
|
|
19
|
+
*
|
|
20
|
+
* Apply: npx sequelize-cli db:migrate
|
|
21
|
+
* Revert: npx sequelize-cli db:migrate:undo
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
up: async (queryInterface, Sequelize) => {
|
|
26
|
+
await queryInterface.addColumn('Orders', 'gatewayPaymentId', {
|
|
27
|
+
type: Sequelize.STRING(255),
|
|
28
|
+
allowNull: true,
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
comment: 'Gateway-specific payment/session ID stored at order placement. Tabby: payment UUID for capture API. Taly/UPayments: extensible for future use.',
|
|
31
|
+
after: 'paymentReference',
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
down: async (queryInterface) => {
|
|
36
|
+
await queryInterface.removeColumn('Orders', 'gatewayPaymentId');
|
|
37
|
+
},
|
|
38
|
+
};
|