tt-entities 0.1.9 → 0.1.11

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.
@@ -30,7 +30,20 @@
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 '{ *)",
43
+ "Bash(git -C /Users/hosam/Documents/TatayabNewEra/DB/tatayab-database-all status)",
44
+ "Bash(git -C /Users/hosam/Documents/TatayabNewEra/Backend/tatayab-backend-user status)",
45
+ "Bash(git -C /Users/hosam/Documents/TatayabNewEra/Frontend/tatayab-all-dashboard status)",
46
+ "Bash(xargs cat)"
34
47
  ]
35
48
  }
36
49
  }
@@ -6,4 +6,6 @@ export declare class Area extends Model {
6
6
  countryId: number;
7
7
  parentId?: number;
8
8
  country: Country;
9
+ parent?: Area;
10
+ children?: Area[];
9
11
  }
@@ -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.Column,
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,+DAM8B;AAC9B,qDAA2C;AAGpC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAK;CAmB9B,CAAA;AAnBY,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;AAGlB;IADP,6BAAM;;sCACmB;AAGlB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;qCAAC;eAlBd,IAAI;IADhB,4BAAK;GACO,IAAI,CAmBhB"}
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"}
@@ -7,5 +7,6 @@ export declare enum StockMovementType {
7
7
  RETURNED_FROM_CUSTOMER = "returned_from_customer",
8
8
  RETURNED_TO_VENDOR = "returned_to_vendor",
9
9
  TRANSFER_IN = "transfer_in",
10
- TRANSFER_OUT = "transfer_out"
10
+ TRANSFER_OUT = "transfer_out",
11
+ ORDER_FULFILLED = "order_fulfilled"
11
12
  }
@@ -12,5 +12,6 @@ var StockMovementType;
12
12
  StockMovementType["RETURNED_TO_VENDOR"] = "returned_to_vendor";
13
13
  StockMovementType["TRANSFER_IN"] = "transfer_in";
14
14
  StockMovementType["TRANSFER_OUT"] = "transfer_out";
15
+ StockMovementType["ORDER_FULFILLED"] = "order_fulfilled";
15
16
  })(StockMovementType || (exports.StockMovementType = StockMovementType = {}));
16
17
  //# sourceMappingURL=stockMovementType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stockMovementType.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/utils/enums/stockMovementType.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAmBX;AAnBD,WAAY,iBAAiB;IAE3B,0CAAqB,CAAA;IAGrB,0CAAqB,CAAA;IACrB,kEAA6C,CAAA;IAG7C,sDAAiC,CAAA;IACjC,4DAAuC,CAAA;IAGvC,sEAAiD,CAAA;IACjD,8DAAyC,CAAA;IAGzC,gDAA2B,CAAA;IAC3B,kDAA6B,CAAA;AAC/B,CAAC,EAnBW,iBAAiB,iCAAjB,iBAAiB,QAmB5B"}
1
+ {"version":3,"file":"stockMovementType.js","sourceRoot":"","sources":["../../../../../libs/tatayab-entities-library/src/utils/enums/stockMovementType.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAE3B,0CAAqB,CAAA;IAGrB,0CAAqB,CAAA;IACrB,kEAA6C,CAAA;IAG7C,sDAAiC,CAAA;IACjC,4DAAuC,CAAA;IAGvC,sEAAiD,CAAA;IACjD,8DAAyC,CAAA;IAGzC,gDAA2B,CAAA;IAC3B,kDAA6B,CAAA;IAG7B,wDAAmC,CAAA;AACrC,CAAC,EAtBW,iBAAiB,iCAAjB,iBAAiB,QAsB5B"}
@@ -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
- @Column
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
  }
@@ -17,4 +17,7 @@ export enum StockMovementType {
17
17
  // Transfers
18
18
  TRANSFER_IN = 'transfer_in', // Moved in from another inventory
19
19
  TRANSFER_OUT = 'transfer_out', // Moved out to another inventory
20
+
21
+ // Order fulfillment
22
+ ORDER_FULFILLED = 'order_fulfilled', // Physical stock deducted when order is completed
20
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tt-entities",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Tatayab entities library",
5
5
  "main": "dist/libs/tatayab-entities-library/index.js",
6
6
  "types": "dist/libs/tatayab-entities-library/index.d.ts",
@@ -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
+ };
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface) {
5
+ await queryInterface.sequelize.query(`
6
+ ALTER TABLE \`StockMovements\`
7
+ MODIFY COLUMN \`movementType\` ENUM(
8
+ 'received',
9
+ 'reserved',
10
+ 'reservation_released',
11
+ 'adjustment_add',
12
+ 'adjustment_remove',
13
+ 'returned_from_customer',
14
+ 'returned_to_vendor',
15
+ 'transfer_in',
16
+ 'transfer_out',
17
+ 'order_fulfilled'
18
+ ) NOT NULL
19
+ `);
20
+ },
21
+
22
+ async down(queryInterface) {
23
+ await queryInterface.sequelize.query(`
24
+ ALTER TABLE \`StockMovements\`
25
+ MODIFY COLUMN \`movementType\` ENUM(
26
+ 'received',
27
+ 'reserved',
28
+ 'reservation_released',
29
+ 'adjustment_add',
30
+ 'adjustment_remove',
31
+ 'returned_from_customer',
32
+ 'returned_to_vendor',
33
+ 'transfer_in',
34
+ 'transfer_out'
35
+ ) NOT NULL
36
+ `);
37
+ },
38
+ };