tt-entities 0.1.8 → 0.1.10
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/.claude/settings.local.json +17 -1
- package/dist/libs/tatayab-entities-library/entities/area.entity.d.ts +2 -0
- package/dist/libs/tatayab-entities-library/entities/area.entity.js +10 -1
- package/dist/libs/tatayab-entities-library/entities/area.entity.js.map +1 -1
- package/dist/libs/tatayab-entities-library/entities/shipping-rule.entity.d.ts +1 -0
- package/dist/libs/tatayab-entities-library/entities/shipping-rule.entity.js +4 -0
- package/dist/libs/tatayab-entities-library/entities/shipping-rule.entity.js.map +1 -1
- package/libs/tatayab-entities-library/src/entities/area.entity.ts +9 -1
- package/libs/tatayab-entities-library/src/entities/shipping-rule.entity.ts +4 -0
- package/package.json +1 -1
- package/src/database/migrations/20260709100000-add-vat-percentage-to-shipping-rules.js +16 -0
- package/src/database/migrations/20260710100000-add-area-parent-fk.js +18 -0
|
@@ -23,7 +23,23 @@
|
|
|
23
23
|
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user diff src/modules/cart/cart-recovery.service.ts)",
|
|
24
24
|
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user add src/modules/cart/cart-recovery.service.ts)",
|
|
25
25
|
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user cherry-pick b59cf95)",
|
|
26
|
-
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); print\\(d['version']\\)\")"
|
|
26
|
+
"Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); print\\(d['version']\\)\")",
|
|
27
|
+
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user add src/modules/catalog/dto/catalog-list-filter.dto.ts src/modules/catalog/catalog-list.service.ts src/modules/popup-ad/ src/app.module.ts)",
|
|
28
|
+
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user commit -m \"Add popup-ad module and skus filter to catalog \\(products + bundles\\)\")",
|
|
29
|
+
"Bash(mkdir -p /Users/hosam/Documents/TatayabNewEra/Frontend/tatayab-all-dashboard/resources/js/pages/marketing/popup-ads)",
|
|
30
|
+
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Frontend/tatayab-all-dashboard add app/Models/PopupAd.php app/Http/Controllers/Api/PopupAdController.php resources/js/pages/marketing/popup-ads/index.vue routes/api.php resources/js/navigation/vertical/apps-and-pages.js)",
|
|
31
|
+
"Bash(git -C /Users/hosam/Documents/TatayabNewEra/Frontend/tatayab-all-dashboard commit -m \"Add Popup Ads module under Marketing \\(CRUD, store targeting, weighted CTA\\)\")",
|
|
32
|
+
"Bash(python3 /private/tmp/claude-501/-Users-hosam-Documents-TatayabNewEra-DB-tatayab-database-all/6a788c09-9718-4502-8db2-6713ea7c0f06/scratchpad/build_collection.py)",
|
|
33
|
+
"Bash(curl -s -X PUT -H 'X-API-Key: PMAK-6a4d14e8ef7e880001a1ac00-580a5446eaec7817c7b9f1ebc43edac421' -H 'Content-Type: application/json' -d @/private/tmp/claude-501/-Users-hosam-Documents-TatayabNewEra-DB-tatayab-database-all/6a788c09-9718-4502-8db2-6713ea7c0f06/scratchpad/tatayab_col_updated.json https://api.getpostman.com/collections/55461900-4dbf9438-685b-45e2-992b-61c0bf18e4fd)",
|
|
34
|
+
"Bash(git add *)",
|
|
35
|
+
"Bash(git commit *)",
|
|
36
|
+
"Bash(sudo npm install tt-entities@0.1.9)",
|
|
37
|
+
"Bash(unzip -l \"/Users/hosam/Downloads/New folder \\(2\\).zip\")",
|
|
38
|
+
"Bash(grep -v \"/$\")",
|
|
39
|
+
"Bash(awk '{print $NF}')",
|
|
40
|
+
"Bash(grep \"\\\\.png$\")",
|
|
41
|
+
"Bash(grep -v \"\\\\-1\\\\.png$\")",
|
|
42
|
+
"Bash(awk '{ *)"
|
|
27
43
|
]
|
|
28
44
|
}
|
|
29
45
|
}
|
|
@@ -32,13 +32,22 @@ __decorate([
|
|
|
32
32
|
__metadata("design:type", Number)
|
|
33
33
|
], Area.prototype, "countryId", void 0);
|
|
34
34
|
__decorate([
|
|
35
|
-
sequelize_typescript_1.
|
|
35
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Area),
|
|
36
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
36
37
|
__metadata("design:type", Number)
|
|
37
38
|
], Area.prototype, "parentId", void 0);
|
|
38
39
|
__decorate([
|
|
39
40
|
(0, sequelize_typescript_1.BelongsTo)(() => country_entity_1.Country),
|
|
40
41
|
__metadata("design:type", country_entity_1.Country)
|
|
41
42
|
], Area.prototype, "country", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Area, { foreignKey: 'parentId', as: 'parent' }),
|
|
45
|
+
__metadata("design:type", Area)
|
|
46
|
+
], Area.prototype, "parent", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.HasMany)(() => Area, { foreignKey: 'parentId', as: 'children' }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], Area.prototype, "children", void 0);
|
|
42
51
|
exports.Area = Area = __decorate([
|
|
43
52
|
sequelize_typescript_1.Table
|
|
44
53
|
], Area);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/area.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"area.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/area.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAO8B;AAC9B,qDAA2C;AAGpC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAK;CA0B9B,CAAA;AA1BY,oBAAI;AAEP;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oCACN;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;oCACN;AAOf;IALP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,oBAAoB,EAAE,EAAE;KACrD,CAAC;;uCACwB;AAIlB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC;IACtB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;sCACF;AAGlB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;qCAAC;AAGjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;8BAC/C,IAAI;oCAAC;AAGd;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC;;sCACtC;eAzBf,IAAI;IADhB,4BAAK;GACO,IAAI,CA0BhB"}
|
|
@@ -52,6 +52,10 @@ __decorate([
|
|
|
52
52
|
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true }),
|
|
53
53
|
__metadata("design:type", Number)
|
|
54
54
|
], ShippingRule.prototype, "freeShippingThreshold", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(5, 2), allowNull: false, defaultValue: 0 }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], ShippingRule.prototype, "vatPercentage", void 0);
|
|
55
59
|
__decorate([
|
|
56
60
|
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: true }),
|
|
57
61
|
__metadata("design:type", Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping-rule.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/shipping-rule.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAO8B;AAC9B,yDAA+C;AAC/C,qDAA2C;AAC3C,iDAAuC;AAGhC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAK;
|
|
1
|
+
{"version":3,"file":"shipping-rule.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/shipping-rule.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAO8B;AAC9B,yDAA+C;AAC/C,qDAA2C;AAC3C,iDAAuC;AAGhC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAK;CAuDtC,CAAA;AAvDY,oCAAY;AAIf;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;IAC3B,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDACD;AAKpB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACH;AAMlB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;IACvB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CACH;AAGjB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;6CACtB;AAGhB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;6CACtB;AAIhB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;iDACC;AAIrB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;kDAC9C;AAItB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;2DACpB;AAI/B;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;mDAC9C;AAGtB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;;8CACvB;AAGlB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;2CACL;AAKf;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,4BAAS,CAAC;8BACR,4BAAS;+CAAC;AAGrB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;6CAAC;AAGjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;8BACP,oBAAK;2CAAC;uBAtDX,YAAY;IADxB,4BAAK;GACO,YAAY,CAuDxB"}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
BelongsTo,
|
|
3
3
|
Column,
|
|
4
4
|
ForeignKey,
|
|
5
|
+
HasMany,
|
|
5
6
|
Model,
|
|
6
7
|
Table,
|
|
7
8
|
} from 'sequelize-typescript';
|
|
@@ -22,9 +23,16 @@ export class Area extends Model {
|
|
|
22
23
|
})
|
|
23
24
|
declare countryId: number;
|
|
24
25
|
|
|
25
|
-
@
|
|
26
|
+
@ForeignKey(() => Area)
|
|
27
|
+
@Column({ allowNull: true })
|
|
26
28
|
declare parentId?: number;
|
|
27
29
|
|
|
28
30
|
@BelongsTo(() => Country)
|
|
29
31
|
declare country: Country;
|
|
32
|
+
|
|
33
|
+
@BelongsTo(() => Area, { foreignKey: 'parentId', as: 'parent' })
|
|
34
|
+
declare parent?: Area;
|
|
35
|
+
|
|
36
|
+
@HasMany(() => Area, { foreignKey: 'parentId', as: 'children' })
|
|
37
|
+
declare children?: Area[];
|
|
30
38
|
}
|
|
@@ -46,6 +46,10 @@ export class ShippingRule extends Model {
|
|
|
46
46
|
@Column({ type: DataType.DECIMAL(10, 3), allowNull: true })
|
|
47
47
|
declare freeShippingThreshold?: number;
|
|
48
48
|
|
|
49
|
+
// VAT percentage applied on subtotal for this shipping rule (e.g. 5 = 5%)
|
|
50
|
+
@Column({ type: DataType.DECIMAL(5, 2), allowNull: false, defaultValue: 0 })
|
|
51
|
+
declare vatPercentage: number;
|
|
52
|
+
|
|
49
53
|
@Column({ allowNull: false, defaultValue: true })
|
|
50
54
|
declare isActive: boolean;
|
|
51
55
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.addColumn('ShippingRules', 'vatPercentage', {
|
|
6
|
+
type: Sequelize.DECIMAL(5, 2),
|
|
7
|
+
allowNull: false,
|
|
8
|
+
defaultValue: 0,
|
|
9
|
+
after: 'freeShippingThreshold',
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
async down(queryInterface) {
|
|
14
|
+
await queryInterface.removeColumn('ShippingRules', 'vatPercentage');
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface) {
|
|
5
|
+
await queryInterface.addConstraint('Areas', {
|
|
6
|
+
fields: ['parentId'],
|
|
7
|
+
type: 'foreign key',
|
|
8
|
+
name: 'fk_areas_parentId',
|
|
9
|
+
references: { table: 'Areas', field: 'id' },
|
|
10
|
+
onDelete: 'SET NULL',
|
|
11
|
+
onUpdate: 'CASCADE',
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
async down(queryInterface) {
|
|
16
|
+
await queryInterface.removeConstraint('Areas', 'fk_areas_parentId');
|
|
17
|
+
},
|
|
18
|
+
};
|