@felloh-org/lambda-wrapper 1.1.27 → 1.1.28

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.
@@ -13,7 +13,9 @@ var _supplier = _interopRequireDefault(require("../supplier"));
13
13
 
14
14
  var _booking = _interopRequireDefault(require("../booking"));
15
15
 
16
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
16
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
17
+
18
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
@@ -34,21 +36,24 @@ let BookingComponent = (_dec = (0, _typeorm.Entity)({
34
36
  }), _dec6 = (0, _typeorm.JoinColumn)({
35
37
  name: 'supplier_id',
36
38
  referencedColumnName: 'id'
37
- }), _dec7 = (0, _typeorm.Column)({
39
+ }), _dec7 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec8 = (0, _typeorm.JoinColumn)({
40
+ name: 'organisation_id',
41
+ referencedColumnName: 'id'
42
+ }), _dec9 = (0, _typeorm.Column)({
38
43
  type: "int",
39
44
  nullable: true
40
- }), _dec8 = (0, _typeorm.Column)({
45
+ }), _dec10 = (0, _typeorm.Column)({
41
46
  type: "varchar",
42
47
  length: "150",
43
48
  nullable: true
44
- }), _dec9 = (0, _typeorm.Column)({
49
+ }), _dec11 = (0, _typeorm.Column)({
45
50
  type: "varchar",
46
51
  length: "10",
47
52
  nullable: true
48
- }), _dec10 = (0, _typeorm.Column)({
53
+ }), _dec12 = (0, _typeorm.Column)({
49
54
  type: "varchar",
50
55
  length: "40"
51
- }), _dec11 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
56
+ }), _dec13 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
52
57
  constructor() {
53
58
  _initializerDefineProperty(this, "id", _descriptor, this);
54
59
 
@@ -56,25 +61,34 @@ let BookingComponent = (_dec = (0, _typeorm.Entity)({
56
61
 
57
62
  _initializerDefineProperty(this, "supplier", _descriptor3, this);
58
63
 
59
- _initializerDefineProperty(this, "amount", _descriptor4, this);
64
+ _initializerDefineProperty(this, "organisation", _descriptor4, this);
65
+
66
+ _initializerDefineProperty(this, "amount", _descriptor5, this);
60
67
 
61
- _initializerDefineProperty(this, "booking_reference", _descriptor5, this);
68
+ _initializerDefineProperty(this, "booking_reference", _descriptor6, this);
62
69
 
63
- _initializerDefineProperty(this, "destination_air", _descriptor6, this);
70
+ _initializerDefineProperty(this, "destination_air", _descriptor7, this);
64
71
 
65
- _initializerDefineProperty(this, "type", _descriptor7, this);
72
+ _initializerDefineProperty(this, "type", _descriptor8, this);
66
73
 
67
- _initializerDefineProperty(this, "created_at", _descriptor8, this);
74
+ _initializerDefineProperty(this, "created_at", _descriptor9, this);
68
75
  }
69
76
 
70
77
  getPublicCompactData() {
71
- return {
78
+ const response = {
72
79
  id: this.id,
73
80
  supplier: this.supplier,
74
81
  amount: this.amount,
75
82
  booking_reference: this.booking_reference,
76
- destination_air: this.destination_air
83
+ destination_air: this.destination_air,
84
+ type: this.type
77
85
  };
86
+
87
+ if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
88
+ response.organisation = this.organisation.getPublicCompactData();
89
+ }
90
+
91
+ return response;
78
92
  }
79
93
 
80
94
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -98,33 +112,40 @@ let BookingComponent = (_dec = (0, _typeorm.Entity)({
98
112
  initializer: function () {
99
113
  return _supplier.default;
100
114
  }
101
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec7], {
115
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec7, _dec8], {
116
+ configurable: true,
117
+ enumerable: true,
118
+ writable: true,
119
+ initializer: function () {
120
+ return _organisation.default;
121
+ }
122
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec9], {
102
123
  configurable: true,
103
124
  enumerable: true,
104
125
  writable: true,
105
126
  initializer: null
106
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec8], {
127
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec10], {
107
128
  configurable: true,
108
129
  enumerable: true,
109
130
  writable: true,
110
131
  initializer: function () {
111
132
  return null;
112
133
  }
113
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "destination_air", [_dec9], {
134
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "destination_air", [_dec11], {
114
135
  configurable: true,
115
136
  enumerable: true,
116
137
  writable: true,
117
138
  initializer: function () {
118
139
  return null;
119
140
  }
120
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec10], {
141
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec12], {
121
142
  configurable: true,
122
143
  enumerable: true,
123
144
  writable: true,
124
145
  initializer: function () {
125
146
  return null;
126
147
  }
127
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec11], {
148
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
128
149
  configurable: true,
129
150
  enumerable: true,
130
151
  writable: true,
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class bookingComponentsOrganisation1656422133900 {
4
+ name = 'bookingComponentsOrganisation1656422133900'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "organisation_id" character varying(150)`);
8
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD CONSTRAINT "FK_73a6d52c40bb11da01800c5f7ed" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP CONSTRAINT "FK_73a6d52c40bb11da01800c5f7ed"`);
13
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "organisation_id"`);
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {