tt-entities 0.1.9 → 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 +10 -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/libs/tatayab-entities-library/src/entities/area.entity.ts +9 -1
- package/package.json +1 -1
- package/src/database/migrations/20260710100000-add-area-parent-fk.js +18 -0
|
@@ -30,7 +30,16 @@
|
|
|
30
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
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
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)"
|
|
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 '{ *)"
|
|
34
43
|
]
|
|
35
44
|
}
|
|
36
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"}
|
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -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
|
+
};
|