@infuro/cms-core 1.0.34 → 1.0.36
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 +13 -0
- package/dist/OrderTrackPage-W3J6WIG2.js +426 -0
- package/dist/OrderTrackPage-Z6FCJQYY.cjs +428 -0
- package/dist/admin.cjs +35254 -21613
- package/dist/admin.d.cts +192 -9
- package/dist/admin.d.ts +192 -9
- package/dist/admin.js +34301 -20755
- package/dist/api.cjs +137 -17531
- package/dist/api.d.cts +633 -3
- package/dist/api.d.ts +633 -3
- package/dist/api.js +15 -17528
- package/dist/auth.cjs +192 -1034
- package/dist/auth.d.cts +197 -54
- package/dist/auth.d.ts +197 -54
- package/dist/auth.js +4 -966
- package/dist/chunk-2AEVFOQP.cjs +30436 -0
- package/dist/chunk-3DZRIZOD.cjs +52 -0
- package/dist/chunk-5ELSW2UP.js +150 -0
- package/dist/chunk-7NMT3GBR.cjs +29 -0
- package/dist/chunk-COBORIJH.cjs +2373 -0
- package/dist/chunk-CRFV5WJK.js +16 -0
- package/dist/chunk-D5FBNKQM.cjs +104 -0
- package/dist/chunk-FG6I64HP.js +604 -0
- package/dist/chunk-GO7PPYNU.js +76 -0
- package/dist/chunk-HCIRL37O.js +21 -0
- package/dist/chunk-HF3L2GIT.cjs +194 -0
- package/dist/chunk-HT5DI3XW.cjs +82 -0
- package/dist/chunk-JC6DLWTE.js +21 -0
- package/dist/chunk-JS2W7XZ4.js +30312 -0
- package/dist/chunk-JXF23MPG.js +25 -0
- package/dist/chunk-KFFB6EMZ.js +123 -0
- package/dist/chunk-KPKFNLQQ.cjs +648 -0
- package/dist/chunk-LI2IXVAY.js +171 -0
- package/dist/chunk-MQBT33IV.js +48 -0
- package/dist/chunk-OOTLNH63.cjs +18 -0
- package/dist/chunk-PNOKNSG2.cjs +222 -0
- package/dist/chunk-SHUYVCID.js +4 -0
- package/dist/chunk-SPQFNIYJ.cjs +132 -0
- package/dist/chunk-SYBOCAWB.js +97 -0
- package/dist/chunk-TDV6EJHV.js +192 -0
- package/dist/chunk-UCKN4BBY.cjs +24 -0
- package/dist/chunk-UF3BYUXY.js +616 -0
- package/dist/chunk-UPLVMVRX.cjs +23 -0
- package/dist/chunk-USNT2KNT.cjs +6 -0
- package/dist/chunk-VMY2S32H.js +2342 -0
- package/dist/chunk-WEMDMVHQ.js +216 -0
- package/dist/chunk-WO2DW4AU.cjs +182 -0
- package/dist/chunk-X47PBV4I.js +79 -0
- package/dist/chunk-X6H5VBQ2.cjs +620 -0
- package/dist/chunk-XQ3QUHWR.cjs +83 -0
- package/dist/chunk-XW5ATPRW.cjs +155 -0
- package/dist/cli.cjs +107 -86
- package/dist/cli.js +66 -29
- package/dist/email-queue-CGZBVVAS.js +2 -0
- package/dist/email-queue-TPZWLTIV.cjs +23 -0
- package/dist/emit-order-notification-trigger-D2N3KFHL.cjs +16 -0
- package/dist/emit-order-notification-trigger-IVLWKKJL.js +3 -0
- package/dist/erp-config-enabled-CUMQ6N2V.cjs +11 -0
- package/dist/erp-config-enabled-T37X7T34.js +2 -0
- package/dist/erp-order-invoice-3YISSOWW.js +3 -0
- package/dist/erp-order-invoice-ZR5F2KTA.cjs +12 -0
- package/dist/event-order-defaults-EMWBIGL3.cjs +39 -0
- package/dist/event-order-defaults-SDRNAZHC.js +2 -0
- package/dist/hooks.cjs +259 -132
- package/dist/hooks.d.cts +42 -1
- package/dist/hooks.d.ts +42 -1
- package/dist/hooks.js +234 -91
- package/dist/index.cjs +3679 -22356
- package/dist/index.d.cts +2173 -643
- package/dist/index.d.ts +2173 -643
- package/dist/index.js +2587 -22119
- package/dist/interpolate-WAKPN56R.cjs +11 -0
- package/dist/interpolate-WDUWDF3I.js +2 -0
- package/dist/migrations/1779400000000-ConvertStatusToEnum.ts +142 -0
- package/dist/migrations/1779400000000-SeedDefaultCurrencies.ts +33 -0
- package/dist/migrations/1779500000000-VendorRolesAndPermissions.ts +102 -0
- package/dist/migrations/1779600000000-VendorRegistrationProfile.ts +52 -0
- package/dist/migrations/1779700000000-CollectionIsCatalog.ts +22 -0
- package/dist/migrations/1779710000000-CollectionPlatformCatalog.ts +60 -0
- package/dist/migrations/1779720000000-ProductCategoryPlatformCatalog.ts +157 -0
- package/dist/migrations/1779800000000-EventsAndEventProducts.ts +173 -0
- package/dist/migrations/1779810000000-BackfillVendorRoleEventsPermissions.ts +38 -0
- package/dist/migrations/1779820000000-FixProductsCategoryForeignKey.ts +70 -0
- package/dist/migrations/1779830000000-ProductTitleColumn.ts +32 -0
- package/dist/migrations/1779840000000-EventAboutAndVisibilityFields.ts +34 -0
- package/dist/migrations/1779850000000-EventCityCountrySplit.ts +43 -0
- package/dist/migrations/1779860000000-CreateCombos.ts +140 -0
- package/dist/migrations/1780100000000-OrderAttendeesEventId.ts +55 -0
- package/dist/migrations/1780110000000-EventContactFormId.ts +49 -0
- package/dist/migrations/1780130000000-ProductVariants.ts +54 -0
- package/dist/migrations/1780140000000-EventManagementEnhancements.ts +44 -0
- package/dist/migrations/1780160000000-EventRegistrationGstProductContactForm.ts +79 -0
- package/dist/migrations/1780170000000-ComboCurrencyPrices.ts +20 -0
- package/dist/migrations/1781110000000-VendorOwnerCombosPermission.ts +38 -0
- package/dist/migrations/1781120000000-RefundPoliciesAndRequests.ts +225 -0
- package/dist/migrations/1781130000000-CreateAttendees.ts +44 -0
- package/dist/migrations/1781140000000-EventOrderNotifications.ts +29 -0
- package/dist/migrations/1781150000000-EventNamedLists.ts +28 -0
- package/dist/migrations/1781160000000-RefundPolicyEventTiers.ts +27 -0
- package/dist/migrations/1781170000000-EventRefundPolicy.ts +42 -0
- package/dist/migrations/1781180000000-RemoveCartItemsUniqueConstraint.ts +15 -0
- package/dist/migrations/1781190000000-RenameProductTaxesToProductConfig.ts +84 -0
- package/dist/migrations/1781200000000-VendorOwnerProductConfigPermissions.ts +51 -0
- package/dist/migrations/1781210000000-VendorRoleProductConfigPermissions.ts +46 -0
- package/dist/migrations/1781220000000-AddWhatsappTriggerBindings.ts +23 -0
- package/dist/migrations/1781230000000-AddOrderNotificationTriggers.ts +46 -0
- package/dist/migrations/1781240000000-DropEventOrderNotificationColumns.ts +29 -0
- package/dist/migrations/1781250000000-RemoveOrderRefundedTrigger.ts +36 -0
- package/dist/migrations/helpers/vendor-role-seed.ts +243 -0
- package/dist/paid-order-erp-3USEG6WL.js +3 -0
- package/dist/paid-order-erp-FSQ3GSXE.cjs +12 -0
- package/dist/pg-boss-service-4XF2TQ2E.js +2 -0
- package/dist/pg-boss-service-L6MTF4EQ.cjs +15 -0
- package/dist/razorpay-KLO2KNCB.js +49 -0
- package/dist/razorpay-U23LGY72.cjs +56 -0
- package/dist/rbac-debug-db-HWP65A4O.cjs +35 -0
- package/dist/rbac-debug-db-QJH3AD34.js +33 -0
- package/dist/sms-defaults-2NL24H57.js +2 -0
- package/dist/sms-defaults-KCOPKQBA.cjs +19 -0
- package/dist/stripe-4FD27QVJ.js +51 -0
- package/dist/stripe-VU6OEG2D.cjs +57 -0
- package/dist/theme.cjs +31 -59
- package/dist/theme.d.cts +78 -3
- package/dist/theme.d.ts +78 -3
- package/dist/theme.js +23 -20
- package/dist/vendor-invite-status-77O7ZQ3U.cjs +19 -0
- package/dist/vendor-invite-status-PWJ3DE76.js +2 -0
- package/dist/whatsapp-trigger-dispatcher-ONHXI7UY.cjs +19 -0
- package/dist/whatsapp-trigger-dispatcher-PWFI4FKP.js +6 -0
- package/package.json +147 -142
- package/dist/admin.cjs.map +0 -1
- package/dist/admin.js.map +0 -1
- package/dist/api.cjs.map +0 -1
- package/dist/api.js.map +0 -1
- package/dist/auth.cjs.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/config-DJ5CmQvS.d.cts +0 -8
- package/dist/config-DJ5CmQvS.d.ts +0 -8
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/index-Bf5GO8fu.d.cts +0 -583
- package/dist/index-DOiJuMQA.d.ts +0 -583
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/theme.cjs.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/types-DCVaXlPV.d.cts +0 -78
- package/dist/types-DCVaXlPV.d.ts +0 -78
- package/dist/vendor-scope-DTYhJk_I.d.cts +0 -129
- package/dist/vendor-scope-DTYhJk_I.d.ts +0 -129
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class ProductVariants1780130000000 implements MigrationInterface {
|
|
4
|
+
name = 'ProductVariants1780130000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
const hasProducts = await queryRunner.hasTable('products');
|
|
8
|
+
if (!hasProducts) return;
|
|
9
|
+
|
|
10
|
+
const exists = await queryRunner.hasTable('product_variants');
|
|
11
|
+
if (!exists) {
|
|
12
|
+
await queryRunner.query(`
|
|
13
|
+
CREATE TABLE "product_variants" (
|
|
14
|
+
"id" SERIAL NOT NULL,
|
|
15
|
+
"productId" integer NOT NULL,
|
|
16
|
+
"sku" character varying,
|
|
17
|
+
"price" numeric(12,2),
|
|
18
|
+
"compareAtPrice" numeric(12,2),
|
|
19
|
+
"inventory" integer NOT NULL DEFAULT 0,
|
|
20
|
+
"status" character varying NOT NULL DEFAULT 'draft',
|
|
21
|
+
"attributes" jsonb,
|
|
22
|
+
"imageUrls" jsonb,
|
|
23
|
+
"createdAt" TIMESTAMP NOT NULL DEFAULT now(),
|
|
24
|
+
"updatedAt" TIMESTAMP NOT NULL DEFAULT now(),
|
|
25
|
+
CONSTRAINT "PK_product_variants" PRIMARY KEY ("id")
|
|
26
|
+
)
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
await queryRunner.query(`
|
|
31
|
+
DO $$ BEGIN
|
|
32
|
+
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'FK_product_variants_product') THEN
|
|
33
|
+
ALTER TABLE "product_variants"
|
|
34
|
+
ADD CONSTRAINT "FK_product_variants_product"
|
|
35
|
+
FOREIGN KEY ("productId") REFERENCES "products"("id")
|
|
36
|
+
ON DELETE CASCADE ON UPDATE NO ACTION;
|
|
37
|
+
END IF;
|
|
38
|
+
END $$;
|
|
39
|
+
`);
|
|
40
|
+
|
|
41
|
+
await queryRunner.query(`
|
|
42
|
+
CREATE INDEX IF NOT EXISTS "IDX_product_variants_productId" ON "product_variants" ("productId");
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
47
|
+
const exists = await queryRunner.hasTable('product_variants');
|
|
48
|
+
if (!exists) return;
|
|
49
|
+
|
|
50
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_product_variants_productId";`);
|
|
51
|
+
await queryRunner.query(`ALTER TABLE "product_variants" DROP CONSTRAINT IF EXISTS "FK_product_variants_product";`);
|
|
52
|
+
await queryRunner.query(`DROP TABLE "product_variants";`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class EventManagementEnhancements1780140000000 implements MigrationInterface {
|
|
4
|
+
name = 'EventManagementEnhancements1780140000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
if (await queryRunner.hasTable('events')) {
|
|
8
|
+
const events = await queryRunner.getTable('events');
|
|
9
|
+
if (!events?.findColumnByName('socialMediaLinks')) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "socialMediaLinks" jsonb;`);
|
|
11
|
+
}
|
|
12
|
+
if (!events?.findColumnByName('timezone')) {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "timezone" character varying;`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (await queryRunner.hasTable('products')) {
|
|
18
|
+
const products = await queryRunner.getTable('products');
|
|
19
|
+
if (!products?.findColumnByName('currencyPrices')) {
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "products" ADD COLUMN "currencyPrices" jsonb;`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (await queryRunner.hasTable('product_variants')) {
|
|
25
|
+
const variants = await queryRunner.getTable('product_variants');
|
|
26
|
+
if (!variants?.findColumnByName('currencyPrices')) {
|
|
27
|
+
await queryRunner.query(`ALTER TABLE "product_variants" ADD COLUMN "currencyPrices" jsonb;`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
33
|
+
if (await queryRunner.hasTable('events')) {
|
|
34
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "socialMediaLinks";`);
|
|
35
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "timezone";`);
|
|
36
|
+
}
|
|
37
|
+
if (await queryRunner.hasTable('products')) {
|
|
38
|
+
await queryRunner.query(`ALTER TABLE "products" DROP COLUMN IF EXISTS "currencyPrices";`);
|
|
39
|
+
}
|
|
40
|
+
if (await queryRunner.hasTable('product_variants')) {
|
|
41
|
+
await queryRunner.query(`ALTER TABLE "product_variants" DROP COLUMN IF EXISTS "currencyPrices";`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class EventRegistrationGstProductContactForm1780160000000 implements MigrationInterface {
|
|
4
|
+
name = 'EventRegistrationGstProductContactForm1780160000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
if (await queryRunner.hasTable('events')) {
|
|
8
|
+
const events = await queryRunner.getTable('events');
|
|
9
|
+
if (!events?.findColumnByName('registrationOpensAt')) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "registrationOpensAt" TIMESTAMP;`);
|
|
11
|
+
}
|
|
12
|
+
if (!events?.findColumnByName('registrationClosesAt')) {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "registrationClosesAt" TIMESTAMP;`);
|
|
14
|
+
}
|
|
15
|
+
if (!events?.findColumnByName('taxId')) {
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "taxId" integer;`);
|
|
17
|
+
}
|
|
18
|
+
if (!events?.findColumnByName('taxRate')) {
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE "events" ADD COLUMN "taxRate" numeric(5,2);`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (await queryRunner.hasTable('taxes') && (await queryRunner.hasTable('events'))) {
|
|
26
|
+
await queryRunner.query(`
|
|
27
|
+
DO $$ BEGIN
|
|
28
|
+
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'FK_events_tax') THEN
|
|
29
|
+
ALTER TABLE "events"
|
|
30
|
+
ADD CONSTRAINT "FK_events_tax"
|
|
31
|
+
FOREIGN KEY ("taxId") REFERENCES "taxes"("id")
|
|
32
|
+
ON DELETE SET NULL ON UPDATE NO ACTION;
|
|
33
|
+
END IF;
|
|
34
|
+
END $$;
|
|
35
|
+
`);
|
|
36
|
+
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_events_taxId" ON "events" ("taxId");`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (await queryRunner.hasTable('products')) {
|
|
40
|
+
const products = await queryRunner.getTable('products');
|
|
41
|
+
if (!products?.findColumnByName('contactFormId')) {
|
|
42
|
+
await queryRunner.query(`ALTER TABLE "products" ADD COLUMN "contactFormId" integer;`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (await queryRunner.hasTable('forms') && (await queryRunner.hasTable('products'))) {
|
|
47
|
+
await queryRunner.query(`
|
|
48
|
+
DO $$ BEGIN
|
|
49
|
+
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'FK_products_contactForm') THEN
|
|
50
|
+
ALTER TABLE "products"
|
|
51
|
+
ADD CONSTRAINT "FK_products_contactForm"
|
|
52
|
+
FOREIGN KEY ("contactFormId") REFERENCES "forms"("id")
|
|
53
|
+
ON DELETE SET NULL ON UPDATE NO ACTION;
|
|
54
|
+
END IF;
|
|
55
|
+
END $$;
|
|
56
|
+
`);
|
|
57
|
+
await queryRunner.query(
|
|
58
|
+
`CREATE INDEX IF NOT EXISTS "IDX_products_contactFormId" ON "products" ("contactFormId");`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
64
|
+
if (await queryRunner.hasTable('products')) {
|
|
65
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_products_contactFormId";`);
|
|
66
|
+
await queryRunner.query(`ALTER TABLE "products" DROP CONSTRAINT IF EXISTS "FK_products_contactForm";`);
|
|
67
|
+
await queryRunner.query(`ALTER TABLE "products" DROP COLUMN IF EXISTS "contactFormId";`);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (await queryRunner.hasTable('events')) {
|
|
71
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_events_taxId";`);
|
|
72
|
+
await queryRunner.query(`ALTER TABLE "events" DROP CONSTRAINT IF EXISTS "FK_events_tax";`);
|
|
73
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "taxRate";`);
|
|
74
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "taxId";`);
|
|
75
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "registrationClosesAt";`);
|
|
76
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "registrationOpensAt";`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class ComboCurrencyPrices1780170000000 implements MigrationInterface {
|
|
4
|
+
name = 'ComboCurrencyPrices1780170000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
if (await queryRunner.hasTable('combos')) {
|
|
8
|
+
const table = await queryRunner.getTable('combos');
|
|
9
|
+
if (!table?.findColumnByName('currencyPrices')) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "combos" ADD COLUMN "currencyPrices" jsonb;`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
16
|
+
if (await queryRunner.hasTable('combos')) {
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "combos" DROP COLUMN IF EXISTS "currencyPrices";`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class VendorOwnerCombosPermission1781110000000
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
name = 'VendorOwnerCombosPermission1781110000000';
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
await queryRunner.query(`
|
|
10
|
+
INSERT INTO "permissions"
|
|
11
|
+
("groupId", "entity", "canCreate", "canRead", "canUpdate", "canDelete")
|
|
12
|
+
SELECT
|
|
13
|
+
g.id,
|
|
14
|
+
'combos',
|
|
15
|
+
true,
|
|
16
|
+
true,
|
|
17
|
+
true,
|
|
18
|
+
false
|
|
19
|
+
FROM "user_groups" g
|
|
20
|
+
WHERE g.name = 'Vendor Owner'
|
|
21
|
+
AND g.deleted = false
|
|
22
|
+
ON CONFLICT ("groupId", "entity") DO UPDATE SET
|
|
23
|
+
"canCreate" = true,
|
|
24
|
+
"canRead" = true,
|
|
25
|
+
"canUpdate" = true
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
30
|
+
await queryRunner.query(`
|
|
31
|
+
DELETE FROM "permissions" p
|
|
32
|
+
USING "user_groups" g
|
|
33
|
+
WHERE p."groupId" = g.id
|
|
34
|
+
AND g.name = 'Vendor Owner'
|
|
35
|
+
AND p.entity = 'combos'
|
|
36
|
+
`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class RefundPoliciesAndRequests1781120000000
|
|
4
|
+
implements MigrationInterface
|
|
5
|
+
{
|
|
6
|
+
name = 'RefundPoliciesAndRequests1781120000000';
|
|
7
|
+
|
|
8
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
9
|
+
// =========================
|
|
10
|
+
// ENUMS
|
|
11
|
+
// =========================
|
|
12
|
+
|
|
13
|
+
await queryRunner.query(`
|
|
14
|
+
DO $$ BEGIN
|
|
15
|
+
CREATE TYPE "refund_policies_status_enum"
|
|
16
|
+
AS ENUM ('active', 'inactive');
|
|
17
|
+
EXCEPTION
|
|
18
|
+
WHEN duplicate_object THEN NULL;
|
|
19
|
+
END $$;
|
|
20
|
+
`);
|
|
21
|
+
|
|
22
|
+
await queryRunner.query(`
|
|
23
|
+
DO $$ BEGIN
|
|
24
|
+
CREATE TYPE "refund_policies_type_enum"
|
|
25
|
+
AS ENUM ('percentage');
|
|
26
|
+
EXCEPTION
|
|
27
|
+
WHEN duplicate_object THEN NULL;
|
|
28
|
+
END $$;
|
|
29
|
+
`);
|
|
30
|
+
|
|
31
|
+
await queryRunner.query(`
|
|
32
|
+
DO $$ BEGIN
|
|
33
|
+
CREATE TYPE "refund_requests_method_enum"
|
|
34
|
+
AS ENUM ('card', 'upi', 'net_banking');
|
|
35
|
+
EXCEPTION
|
|
36
|
+
WHEN duplicate_object THEN NULL;
|
|
37
|
+
END $$;
|
|
38
|
+
`);
|
|
39
|
+
|
|
40
|
+
await queryRunner.query(`
|
|
41
|
+
DO $$ BEGIN
|
|
42
|
+
CREATE TYPE "refund_requests_status_enum"
|
|
43
|
+
AS ENUM ('requested', 'approved', 'rejected', 'refunded');
|
|
44
|
+
EXCEPTION
|
|
45
|
+
WHEN duplicate_object THEN NULL;
|
|
46
|
+
END $$;
|
|
47
|
+
`);
|
|
48
|
+
|
|
49
|
+
// =========================
|
|
50
|
+
// REFUND POLICIES
|
|
51
|
+
// =========================
|
|
52
|
+
|
|
53
|
+
await queryRunner.query(`
|
|
54
|
+
CREATE TABLE IF NOT EXISTS "refund_policies" (
|
|
55
|
+
"id" SERIAL NOT NULL,
|
|
56
|
+
"name" character varying NOT NULL,
|
|
57
|
+
"desc" text,
|
|
58
|
+
"vendorId" integer NOT NULL,
|
|
59
|
+
"refundWindowDays" integer NOT NULL DEFAULT 0,
|
|
60
|
+
"status" "refund_policies_status_enum" NOT NULL DEFAULT 'active',
|
|
61
|
+
"type" "refund_policies_type_enum" NOT NULL DEFAULT 'percentage',
|
|
62
|
+
"value" decimal(10,2) NOT NULL DEFAULT 0,
|
|
63
|
+
CONSTRAINT "PK_refund_policies" PRIMARY KEY ("id")
|
|
64
|
+
)
|
|
65
|
+
`);
|
|
66
|
+
|
|
67
|
+
await queryRunner.query(`
|
|
68
|
+
DO $$ BEGIN
|
|
69
|
+
IF NOT EXISTS (
|
|
70
|
+
SELECT 1
|
|
71
|
+
FROM pg_constraint
|
|
72
|
+
WHERE conname = 'FK_refund_policies_vendor'
|
|
73
|
+
) THEN
|
|
74
|
+
ALTER TABLE "refund_policies"
|
|
75
|
+
ADD CONSTRAINT "FK_refund_policies_vendor"
|
|
76
|
+
FOREIGN KEY ("vendorId")
|
|
77
|
+
REFERENCES "vendors"("id")
|
|
78
|
+
ON DELETE CASCADE
|
|
79
|
+
ON UPDATE NO ACTION;
|
|
80
|
+
END IF;
|
|
81
|
+
END $$;
|
|
82
|
+
`);
|
|
83
|
+
|
|
84
|
+
// =========================
|
|
85
|
+
// REFUND REQUESTS
|
|
86
|
+
// =========================
|
|
87
|
+
|
|
88
|
+
await queryRunner.query(`
|
|
89
|
+
CREATE TABLE IF NOT EXISTS "refund_requests" (
|
|
90
|
+
"id" SERIAL NOT NULL,
|
|
91
|
+
"refundPolicyId" integer NOT NULL,
|
|
92
|
+
"orderId" integer NOT NULL,
|
|
93
|
+
"customerId" integer NOT NULL,
|
|
94
|
+
"reason" text,
|
|
95
|
+
"refundMethod" "refund_requests_method_enum" NOT NULL,
|
|
96
|
+
"status" "refund_requests_status_enum" NOT NULL DEFAULT 'requested',
|
|
97
|
+
"expectedRefundAmount" decimal(10,2) NOT NULL DEFAULT 0,
|
|
98
|
+
"approvedRefundAmount" decimal(10,2),
|
|
99
|
+
CONSTRAINT "PK_refund_requests" PRIMARY KEY ("id")
|
|
100
|
+
)
|
|
101
|
+
`);
|
|
102
|
+
|
|
103
|
+
await queryRunner.query(`
|
|
104
|
+
DO $$ BEGIN
|
|
105
|
+
IF NOT EXISTS (
|
|
106
|
+
SELECT 1
|
|
107
|
+
FROM pg_constraint
|
|
108
|
+
WHERE conname = 'FK_refund_requests_policy'
|
|
109
|
+
) THEN
|
|
110
|
+
ALTER TABLE "refund_requests"
|
|
111
|
+
ADD CONSTRAINT "FK_refund_requests_policy"
|
|
112
|
+
FOREIGN KEY ("refundPolicyId")
|
|
113
|
+
REFERENCES "refund_policies"("id")
|
|
114
|
+
ON DELETE CASCADE
|
|
115
|
+
ON UPDATE NO ACTION;
|
|
116
|
+
END IF;
|
|
117
|
+
END $$;
|
|
118
|
+
`);
|
|
119
|
+
|
|
120
|
+
await queryRunner.query(`
|
|
121
|
+
DO $$ BEGIN
|
|
122
|
+
IF NOT EXISTS (
|
|
123
|
+
SELECT 1
|
|
124
|
+
FROM pg_constraint
|
|
125
|
+
WHERE conname = 'FK_refund_requests_order'
|
|
126
|
+
) THEN
|
|
127
|
+
ALTER TABLE "refund_requests"
|
|
128
|
+
ADD CONSTRAINT "FK_refund_requests_order"
|
|
129
|
+
FOREIGN KEY ("orderId")
|
|
130
|
+
REFERENCES "orders"("id")
|
|
131
|
+
ON DELETE CASCADE
|
|
132
|
+
ON UPDATE NO ACTION;
|
|
133
|
+
END IF;
|
|
134
|
+
END $$;
|
|
135
|
+
`);
|
|
136
|
+
|
|
137
|
+
await queryRunner.query(`
|
|
138
|
+
DO $$ BEGIN
|
|
139
|
+
IF NOT EXISTS (
|
|
140
|
+
SELECT 1
|
|
141
|
+
FROM pg_constraint
|
|
142
|
+
WHERE conname = 'FK_refund_requests_customer'
|
|
143
|
+
) THEN
|
|
144
|
+
ALTER TABLE "refund_requests"
|
|
145
|
+
ADD CONSTRAINT "FK_refund_requests_customer"
|
|
146
|
+
FOREIGN KEY ("customerId")
|
|
147
|
+
REFERENCES "customer"("id")
|
|
148
|
+
ON DELETE CASCADE
|
|
149
|
+
ON UPDATE NO ACTION;
|
|
150
|
+
END IF;
|
|
151
|
+
END $$;
|
|
152
|
+
`);
|
|
153
|
+
|
|
154
|
+
// =========================
|
|
155
|
+
// ORDER ITEMS -> vendorId
|
|
156
|
+
// =========================
|
|
157
|
+
|
|
158
|
+
await queryRunner.query(`
|
|
159
|
+
ALTER TABLE "order_items"
|
|
160
|
+
ADD COLUMN IF NOT EXISTS "vendorId" integer
|
|
161
|
+
`);
|
|
162
|
+
|
|
163
|
+
await queryRunner.query(`
|
|
164
|
+
DO $$ BEGIN
|
|
165
|
+
IF NOT EXISTS (
|
|
166
|
+
SELECT 1
|
|
167
|
+
FROM pg_constraint
|
|
168
|
+
WHERE conname = 'FK_order_items_vendor'
|
|
169
|
+
) THEN
|
|
170
|
+
ALTER TABLE "order_items"
|
|
171
|
+
ADD CONSTRAINT "FK_order_items_vendor"
|
|
172
|
+
FOREIGN KEY ("vendorId")
|
|
173
|
+
REFERENCES "vendors"("id")
|
|
174
|
+
ON DELETE SET NULL
|
|
175
|
+
ON UPDATE NO ACTION;
|
|
176
|
+
END IF;
|
|
177
|
+
END $$;
|
|
178
|
+
`);
|
|
179
|
+
|
|
180
|
+
await queryRunner.query(`
|
|
181
|
+
CREATE INDEX IF NOT EXISTS "IDX_order_items_vendor"
|
|
182
|
+
ON "order_items" ("vendorId")
|
|
183
|
+
`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
187
|
+
await queryRunner.query(`
|
|
188
|
+
DROP INDEX IF EXISTS "IDX_order_items_vendor"
|
|
189
|
+
`);
|
|
190
|
+
|
|
191
|
+
await queryRunner.query(`
|
|
192
|
+
ALTER TABLE "order_items"
|
|
193
|
+
DROP CONSTRAINT IF EXISTS "FK_order_items_vendor"
|
|
194
|
+
`);
|
|
195
|
+
|
|
196
|
+
await queryRunner.query(`
|
|
197
|
+
ALTER TABLE "order_items"
|
|
198
|
+
DROP COLUMN IF EXISTS "vendorId"
|
|
199
|
+
`);
|
|
200
|
+
|
|
201
|
+
await queryRunner.query(`
|
|
202
|
+
DROP TABLE IF EXISTS "refund_requests"
|
|
203
|
+
`);
|
|
204
|
+
|
|
205
|
+
await queryRunner.query(`
|
|
206
|
+
DROP TABLE IF EXISTS "refund_policies"
|
|
207
|
+
`);
|
|
208
|
+
|
|
209
|
+
await queryRunner.query(`
|
|
210
|
+
DROP TYPE IF EXISTS "refund_requests_status_enum"
|
|
211
|
+
`);
|
|
212
|
+
|
|
213
|
+
await queryRunner.query(`
|
|
214
|
+
DROP TYPE IF EXISTS "refund_requests_method_enum"
|
|
215
|
+
`);
|
|
216
|
+
|
|
217
|
+
await queryRunner.query(`
|
|
218
|
+
DROP TYPE IF EXISTS "refund_policies_type_enum"
|
|
219
|
+
`);
|
|
220
|
+
|
|
221
|
+
await queryRunner.query(`
|
|
222
|
+
DROP TYPE IF EXISTS "refund_policies_status_enum"
|
|
223
|
+
`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Event / registration attendees linked optionally to CMS contacts.
|
|
5
|
+
*/
|
|
6
|
+
export class CreateAttendees1781130000000 implements MigrationInterface {
|
|
7
|
+
name = 'CreateAttendees1781130000000';
|
|
8
|
+
|
|
9
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
10
|
+
await queryRunner.query(`
|
|
11
|
+
CREATE TABLE IF NOT EXISTS "attendees" (
|
|
12
|
+
"id" SERIAL NOT NULL,
|
|
13
|
+
"displayName" character varying NOT NULL,
|
|
14
|
+
"email" character varying NOT NULL,
|
|
15
|
+
"contactId" integer,
|
|
16
|
+
CONSTRAINT "PK_attendees" PRIMARY KEY ("id")
|
|
17
|
+
)
|
|
18
|
+
`);
|
|
19
|
+
|
|
20
|
+
await queryRunner.query(`
|
|
21
|
+
DO $$ BEGIN
|
|
22
|
+
ALTER TABLE "attendees"
|
|
23
|
+
ADD CONSTRAINT "FK_attendees_contact"
|
|
24
|
+
FOREIGN KEY ("contactId") REFERENCES "contacts"("id") ON DELETE SET NULL ON UPDATE NO ACTION;
|
|
25
|
+
EXCEPTION WHEN duplicate_object THEN NULL; END $$
|
|
26
|
+
`);
|
|
27
|
+
|
|
28
|
+
await queryRunner.query(`
|
|
29
|
+
CREATE INDEX IF NOT EXISTS "IDX_attendees_contactId"
|
|
30
|
+
ON "attendees" ("contactId")
|
|
31
|
+
`);
|
|
32
|
+
|
|
33
|
+
await queryRunner.query(`
|
|
34
|
+
CREATE INDEX IF NOT EXISTS "IDX_attendees_email"
|
|
35
|
+
ON "attendees" ("email")
|
|
36
|
+
`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
40
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_attendees_email"`);
|
|
41
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_attendees_contactId"`);
|
|
42
|
+
await queryRunner.query(`DROP TABLE IF EXISTS "attendees"`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class EventOrderNotifications1781140000000 implements MigrationInterface {
|
|
4
|
+
name = 'EventOrderNotifications1781140000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
if (!(await queryRunner.hasTable('events'))) return;
|
|
8
|
+
|
|
9
|
+
const table = await queryRunner.getTable('events');
|
|
10
|
+
if (!table?.findColumnByName('orderNotificationsEnabled')) {
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`ALTER TABLE "events" ADD COLUMN "orderNotificationsEnabled" boolean NOT NULL DEFAULT false`,
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
if (!table?.findColumnByName('orderNotificationChannels')) {
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "orderNotificationChannels" jsonb;`);
|
|
17
|
+
}
|
|
18
|
+
if (!table?.findColumnByName('orderNotificationTemplates')) {
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "events" ADD COLUMN "orderNotificationTemplates" jsonb;`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
24
|
+
if (!(await queryRunner.hasTable('events'))) return;
|
|
25
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "orderNotificationTemplates"`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "orderNotificationChannels"`);
|
|
27
|
+
await queryRunner.query(`ALTER TABLE "events" DROP COLUMN IF EXISTS "orderNotificationsEnabled"`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
/** Agenda, workshops, exhibitors, partners, and speaker rows on events (name + image URL). */
|
|
4
|
+
export class EventNamedLists1781150000000 implements MigrationInterface {
|
|
5
|
+
name = 'EventNamedLists1781150000000';
|
|
6
|
+
|
|
7
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
8
|
+
await queryRunner.query(`
|
|
9
|
+
ALTER TABLE "events"
|
|
10
|
+
ADD COLUMN IF NOT EXISTS "agenda" jsonb,
|
|
11
|
+
ADD COLUMN IF NOT EXISTS "workshops" jsonb,
|
|
12
|
+
ADD COLUMN IF NOT EXISTS "exhibitors" jsonb,
|
|
13
|
+
ADD COLUMN IF NOT EXISTS "partners" jsonb,
|
|
14
|
+
ADD COLUMN IF NOT EXISTS "speakers" jsonb
|
|
15
|
+
`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
19
|
+
await queryRunner.query(`
|
|
20
|
+
ALTER TABLE "events"
|
|
21
|
+
DROP COLUMN IF EXISTS "speakers",
|
|
22
|
+
DROP COLUMN IF EXISTS "partners",
|
|
23
|
+
DROP COLUMN IF EXISTS "exhibitors",
|
|
24
|
+
DROP COLUMN IF EXISTS "workshops",
|
|
25
|
+
DROP COLUMN IF EXISTS "agenda"
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class RefundPolicyEventTiers1781160000000 implements MigrationInterface {
|
|
4
|
+
name = 'RefundPolicyEventTiers1781160000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`
|
|
8
|
+
DO $$ BEGIN
|
|
9
|
+
ALTER TYPE "refund_policies_type_enum" ADD VALUE IF NOT EXISTS 'event_tiers';
|
|
10
|
+
EXCEPTION
|
|
11
|
+
WHEN duplicate_object THEN NULL;
|
|
12
|
+
END $$;
|
|
13
|
+
`);
|
|
14
|
+
|
|
15
|
+
await queryRunner.query(`
|
|
16
|
+
ALTER TABLE "refund_policies"
|
|
17
|
+
ADD COLUMN IF NOT EXISTS "tiers" jsonb
|
|
18
|
+
`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
22
|
+
await queryRunner.query(`
|
|
23
|
+
ALTER TABLE "refund_policies"
|
|
24
|
+
DROP COLUMN IF EXISTS "tiers"
|
|
25
|
+
`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
export class EventRefundPolicy1781170000000 implements MigrationInterface {
|
|
4
|
+
name = 'EventRefundPolicy1781170000000';
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`
|
|
8
|
+
ALTER TABLE "events"
|
|
9
|
+
ADD COLUMN IF NOT EXISTS "refundPolicyId" integer
|
|
10
|
+
`);
|
|
11
|
+
|
|
12
|
+
await queryRunner.query(`
|
|
13
|
+
DO $$ BEGIN
|
|
14
|
+
IF NOT EXISTS (
|
|
15
|
+
SELECT 1 FROM pg_constraint WHERE conname = 'FK_events_refund_policy'
|
|
16
|
+
) THEN
|
|
17
|
+
ALTER TABLE "events"
|
|
18
|
+
ADD CONSTRAINT "FK_events_refund_policy"
|
|
19
|
+
FOREIGN KEY ("refundPolicyId")
|
|
20
|
+
REFERENCES "refund_policies"("id")
|
|
21
|
+
ON DELETE SET NULL
|
|
22
|
+
ON UPDATE NO ACTION;
|
|
23
|
+
END IF;
|
|
24
|
+
END $$;
|
|
25
|
+
`);
|
|
26
|
+
|
|
27
|
+
await queryRunner.query(`
|
|
28
|
+
CREATE INDEX IF NOT EXISTS "IDX_events_refundPolicyId"
|
|
29
|
+
ON "events" ("refundPolicyId")
|
|
30
|
+
`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
34
|
+
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_events_refundPolicyId"`);
|
|
35
|
+
await queryRunner.query(`
|
|
36
|
+
ALTER TABLE "events" DROP CONSTRAINT IF EXISTS "FK_events_refund_policy"
|
|
37
|
+
`);
|
|
38
|
+
await queryRunner.query(`
|
|
39
|
+
ALTER TABLE "events" DROP COLUMN IF EXISTS "refundPolicyId"
|
|
40
|
+
`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class RemoveCartItemsUniqueConstraint1781180000000 implements MigrationInterface {
|
|
4
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
5
|
+
await queryRunner.query(
|
|
6
|
+
`ALTER TABLE "cart_items" DROP CONSTRAINT IF EXISTS "UQ_cart_items_cart_product"`
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`ALTER TABLE "cart_items" ADD CONSTRAINT "UQ_cart_items_cart_product" UNIQUE ("cartId", "productId")`
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|