@felloh-org/lambda-wrapper 1.0.3 → 1.0.7

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.
Files changed (29) hide show
  1. package/dist/entity/agent-data/booking/index.js +101 -4
  2. package/dist/entity/agent-data/index.js +5 -5
  3. package/dist/entity/agent-data/{customer → supplier}/index.js +4 -4
  4. package/dist/entity/agent-data/{organisation-supplier → supplier-type}/index.js +4 -4
  5. package/dist/entity/payment/index.js +7 -1
  6. package/dist/entity/payment/payment-link/index.js +126 -4
  7. package/dist/entity/payment/transaction/index.js +124 -4
  8. package/dist/entity/payment/transaction-event/index.js +37 -5
  9. package/dist/entity/{agent-data/organisation-supplier-type → payment/transaction-event-type}/index.js +5 -5
  10. package/dist/entity/payment/transaction-metadata/index.js +138 -0
  11. package/dist/entity/payment/transaction-method/index.js +1 -1
  12. package/dist/entity/payment/transaction-status/index.js +1 -1
  13. package/dist/entity/payment/transaction-type/index.js +39 -0
  14. package/dist/entity/user/organisation/index.js +2 -2
  15. package/dist/entity/user/user/index.js +10 -3
  16. package/dist/index.js +49 -27
  17. package/dist/migration/agent-data/1642121041760-inital.js +0 -2
  18. package/dist/migration/agent-data/1642121610577-organisation-suppliers.js +2 -2
  19. package/dist/migration/agent-data/1642121681610-organisation-suppliers-type.js +2 -2
  20. package/dist/migration/agent-data/1642505882721-booking-fields.js +29 -0
  21. package/dist/migration/agent-data/1642508385880-booking-id.js +19 -0
  22. package/dist/migration/{1642370449589-transaction.js → nuapay/1642370449589-transaction.js} +0 -0
  23. package/dist/migration/payment/1642514728358-payment-link-updates.js +39 -0
  24. package/dist/migration/payment/1642516017835-payment-link-add-booking.js +15 -0
  25. package/dist/migration/payment/1642519453365-transaction.js +63 -0
  26. package/dist/migration/payment/1642520774562-transaction-payment-link.js +15 -0
  27. package/dist/migration/payment/1642533711013-transaction-metadata.js +15 -0
  28. package/dist/migration/payment/1642540883807-transaction-event.js +27 -0
  29. package/package.json +1 -1
@@ -7,7 +7,15 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
+ var _user = _interopRequireDefault(require("../../user/user"));
11
+
12
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
13
+
14
+ var _transaction = _interopRequireDefault(require("../../payment/transaction"));
15
+
16
+ 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, _descriptor10;
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
19
 
12
20
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
13
21
 
@@ -18,19 +26,108 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
26
  let Booking = (_dec = (0, _typeorm.Entity)({
19
27
  name: 'booking',
20
28
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Booking {
29
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
30
+ type: "varchar",
31
+ length: "150"
32
+ }), _dec4 = (0, _typeorm.ManyToOne)(() => _user.default), _dec5 = (0, _typeorm.JoinColumn)({
33
+ name: 'user_id',
34
+ referencedColumnName: 'id'
35
+ }), _dec6 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.booking), _dec7 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec8 = (0, _typeorm.JoinColumn)({
36
+ name: 'organisation_id',
37
+ referencedColumnName: 'id'
38
+ }), _dec9 = (0, _typeorm.Column)({
39
+ type: "varchar",
40
+ length: "150"
41
+ }), _dec10 = (0, _typeorm.Column)({
42
+ type: "varchar",
43
+ length: "150"
44
+ }), _dec11 = (0, _typeorm.Column)({
45
+ type: "date",
46
+ nullable: true
47
+ }), _dec12 = (0, _typeorm.Column)({
48
+ type: "date",
49
+ nullable: true
50
+ }), _dec13 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Booking {
22
51
  constructor() {
23
52
  _initializerDefineProperty(this, "id", _descriptor, this);
24
53
 
25
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
54
+ _initializerDefineProperty(this, "email", _descriptor2, this);
55
+
56
+ _initializerDefineProperty(this, "user", _descriptor3, this);
57
+
58
+ _initializerDefineProperty(this, "transactions", _descriptor4, this);
59
+
60
+ _initializerDefineProperty(this, "organisation", _descriptor5, this);
61
+
62
+ _initializerDefineProperty(this, "customer_name", _descriptor6, this);
63
+
64
+ _initializerDefineProperty(this, "booking_reference", _descriptor7, this);
65
+
66
+ _initializerDefineProperty(this, "departure_date", _descriptor8, this);
67
+
68
+ _initializerDefineProperty(this, "return_date", _descriptor9, this);
69
+
70
+ _initializerDefineProperty(this, "created_at", _descriptor10, this);
26
71
  }
27
72
 
28
73
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
74
+ configurable: true,
75
+ enumerable: true,
76
+ writable: true,
77
+ initializer: function () {
78
+ return undefined;
79
+ }
80
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "email", [_dec3], {
81
+ configurable: true,
82
+ enumerable: true,
83
+ writable: true,
84
+ initializer: function () {
85
+ return "";
86
+ }
87
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec4, _dec5], {
88
+ configurable: true,
89
+ enumerable: true,
90
+ writable: true,
91
+ initializer: function () {
92
+ return _user.default;
93
+ }
94
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec6], {
95
+ configurable: true,
96
+ enumerable: true,
97
+ writable: true,
98
+ initializer: null
99
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec7, _dec8], {
100
+ configurable: true,
101
+ enumerable: true,
102
+ writable: true,
103
+ initializer: function () {
104
+ return _organisation.default;
105
+ }
106
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec9], {
107
+ configurable: true,
108
+ enumerable: true,
109
+ writable: true,
110
+ initializer: function () {
111
+ return "";
112
+ }
113
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec10], {
114
+ configurable: true,
115
+ enumerable: true,
116
+ writable: true,
117
+ initializer: function () {
118
+ return "";
119
+ }
120
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec11], {
121
+ configurable: true,
122
+ enumerable: true,
123
+ writable: true,
124
+ initializer: null
125
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec12], {
29
126
  configurable: true,
30
127
  enumerable: true,
31
128
  writable: true,
32
129
  initializer: null
33
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
130
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
34
131
  configurable: true,
35
132
  enumerable: true,
36
133
  writable: true,
@@ -7,18 +7,18 @@ exports.default = void 0;
7
7
 
8
8
  var _booking = _interopRequireDefault(require("./booking"));
9
9
 
10
- var _customer = _interopRequireDefault(require("./customer"));
11
-
12
10
  var _bookingComponent = _interopRequireDefault(require("./booking-component"));
13
11
 
14
12
  var _bookingComponentType = _interopRequireDefault(require("./booking-component-type"));
15
13
 
16
- var _organisationSupplier = _interopRequireDefault(require("./organisation-supplier"));
14
+ var _supplier = _interopRequireDefault(require("./supplier"));
15
+
16
+ var _supplierType = _interopRequireDefault(require("./supplier-type"));
17
17
 
18
- var _organisationSupplierType = _interopRequireDefault(require("./organisation-supplier-type"));
18
+ var _transactionEvent = _interopRequireDefault(require("../payment/transaction-event"));
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const ENTITIES = [_booking.default, _customer.default, _bookingComponent.default, _bookingComponentType.default, _organisationSupplier.default, _organisationSupplierType.default];
22
+ const ENTITIES = [_booking.default, _bookingComponent.default, _bookingComponentType.default, _supplier.default, _supplierType.default, _transactionEvent.default];
23
23
  var _default = ENTITIES;
24
24
  exports.default = _default;
@@ -15,10 +15,10 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
15
15
 
16
16
  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
17
17
 
18
- let Customer = (_dec = (0, _typeorm.Entity)({
19
- name: 'customer',
18
+ let Supplier = (_dec = (0, _typeorm.Entity)({
19
+ name: 'supplier',
20
20
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Customer {
21
+ }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Supplier {
22
22
  constructor() {
23
23
  _initializerDefineProperty(this, "id", _descriptor, this);
24
24
 
@@ -36,4 +36,4 @@ let Customer = (_dec = (0, _typeorm.Entity)({
36
36
  writable: true,
37
37
  initializer: null
38
38
  })), _class2)) || _class);
39
- exports.default = Customer;
39
+ exports.default = Supplier;
@@ -15,10 +15,10 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
15
15
 
16
16
  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
17
17
 
18
- let OrganisationSupplier = (_dec = (0, _typeorm.Entity)({
19
- name: 'organisation_supplier',
18
+ let SupplierType = (_dec = (0, _typeorm.Entity)({
19
+ name: 'supplier_type',
20
20
  schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class OrganisationSupplier {
21
+ }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class SupplierType {
22
22
  constructor() {
23
23
  _initializerDefineProperty(this, "id", _descriptor, this);
24
24
 
@@ -36,4 +36,4 @@ let OrganisationSupplier = (_dec = (0, _typeorm.Entity)({
36
36
  writable: true,
37
37
  initializer: null
38
38
  })), _class2)) || _class);
39
- exports.default = OrganisationSupplier;
39
+ exports.default = SupplierType;
@@ -11,12 +11,18 @@ var _transaction = _interopRequireDefault(require("./transaction"));
11
11
 
12
12
  var _transactionEvent = _interopRequireDefault(require("./transaction-event"));
13
13
 
14
+ var _transactionEventType = _interopRequireDefault(require("./transaction-event-type"));
15
+
14
16
  var _transactionMethod = _interopRequireDefault(require("./transaction-method"));
15
17
 
16
18
  var _transactionStatus = _interopRequireDefault(require("./transaction-status"));
17
19
 
20
+ var _transactionType = _interopRequireDefault(require("./transaction-type"));
21
+
22
+ var _transactionMetadata = _interopRequireDefault(require("./transaction-metadata"));
23
+
18
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
25
 
20
- const ENTITIES = [_paymentLink.default, _transaction.default, _transactionEvent.default, _transactionMethod.default, _transactionStatus.default];
26
+ const ENTITIES = [_paymentLink.default, _transaction.default, _transactionEvent.default, _transactionEventType.default, _transactionMethod.default, _transactionStatus.default, _transactionType.default, _transactionMetadata.default];
21
27
  var _default = ENTITIES;
22
28
  exports.default = _default;
@@ -7,7 +7,15 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
11
+
12
+ var _user = _interopRequireDefault(require("../../user/user"));
13
+
14
+ var _booking = _interopRequireDefault(require("../../agent-data/booking"));
15
+
16
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
19
 
12
20
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
13
21
 
@@ -18,19 +26,133 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
26
  let PaymentLink = (_dec = (0, _typeorm.Entity)({
19
27
  name: 'payment_Link',
20
28
  schema: 'payment'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
29
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _booking.default, {
30
+ nullable: true
31
+ }), _dec4 = (0, _typeorm.JoinColumn)({
32
+ name: 'booking_id',
33
+ referencedColumnName: 'id'
34
+ }), _dec5 = (0, _typeorm.ManyToOne)(() => _user.default), _dec6 = (0, _typeorm.JoinColumn)({
35
+ name: 'user_id',
36
+ referencedColumnName: 'id'
37
+ }), _dec7 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec8 = (0, _typeorm.JoinColumn)({
38
+ name: 'organisation_id',
39
+ referencedColumnName: 'id'
40
+ }), _dec9 = (0, _typeorm.Column)({
41
+ type: "int"
42
+ }), _dec10 = (0, _typeorm.Column)({
43
+ type: "varchar",
44
+ length: "250"
45
+ }), _dec11 = (0, _typeorm.Column)({
46
+ type: "varchar",
47
+ length: "200"
48
+ }), _dec12 = (0, _typeorm.Column)({
49
+ type: "varchar",
50
+ length: "200"
51
+ }), _dec13 = (0, _typeorm.Column)({
52
+ type: "varchar",
53
+ length: "200"
54
+ }), _dec14 = (0, _typeorm.Column)({
55
+ type: "timestamp with time zone"
56
+ }), _dec15 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
22
57
  constructor() {
23
58
  _initializerDefineProperty(this, "id", _descriptor, this);
24
59
 
25
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
60
+ _initializerDefineProperty(this, "booking", _descriptor2, this);
61
+
62
+ _initializerDefineProperty(this, "user", _descriptor3, this);
63
+
64
+ _initializerDefineProperty(this, "organisation", _descriptor4, this);
65
+
66
+ _initializerDefineProperty(this, "amount", _descriptor5, this);
67
+
68
+ _initializerDefineProperty(this, "description", _descriptor6, this);
69
+
70
+ _initializerDefineProperty(this, "success_url", _descriptor7, this);
71
+
72
+ _initializerDefineProperty(this, "failure_url", _descriptor8, this);
73
+
74
+ _initializerDefineProperty(this, "cancel_url", _descriptor9, this);
75
+
76
+ _initializerDefineProperty(this, "expires_at", _descriptor10, this);
77
+
78
+ _initializerDefineProperty(this, "created_at", _descriptor11, this);
79
+ }
80
+
81
+ generateExpiryDate() {
82
+ let date = new Date();
83
+ date.setDate(date.getDate() + 30);
84
+ return date;
26
85
  }
27
86
 
28
87
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
88
+ configurable: true,
89
+ enumerable: true,
90
+ writable: true,
91
+ initializer: function () {
92
+ return undefined;
93
+ }
94
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "booking", [_dec3, _dec4], {
95
+ configurable: true,
96
+ enumerable: true,
97
+ writable: true,
98
+ initializer: function () {
99
+ return _booking.default;
100
+ }
101
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec5, _dec6], {
102
+ configurable: true,
103
+ enumerable: true,
104
+ writable: true,
105
+ initializer: function () {
106
+ return _user.default;
107
+ }
108
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec7, _dec8], {
109
+ configurable: true,
110
+ enumerable: true,
111
+ writable: true,
112
+ initializer: function () {
113
+ return _organisation.default;
114
+ }
115
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec9], {
29
116
  configurable: true,
30
117
  enumerable: true,
31
118
  writable: true,
32
119
  initializer: null
33
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
120
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "description", [_dec10], {
121
+ configurable: true,
122
+ enumerable: true,
123
+ writable: true,
124
+ initializer: function () {
125
+ return "";
126
+ }
127
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "success_url", [_dec11], {
128
+ configurable: true,
129
+ enumerable: true,
130
+ writable: true,
131
+ initializer: function () {
132
+ return "";
133
+ }
134
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "failure_url", [_dec12], {
135
+ configurable: true,
136
+ enumerable: true,
137
+ writable: true,
138
+ initializer: function () {
139
+ return "";
140
+ }
141
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "cancel_url", [_dec13], {
142
+ configurable: true,
143
+ enumerable: true,
144
+ writable: true,
145
+ initializer: function () {
146
+ return "";
147
+ }
148
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "expires_at", [_dec14], {
149
+ configurable: true,
150
+ enumerable: true,
151
+ writable: true,
152
+ initializer: function () {
153
+ return this.generateExpiryDate();
154
+ }
155
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec15], {
34
156
  configurable: true,
35
157
  enumerable: true,
36
158
  writable: true,
@@ -7,7 +7,23 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
+ var _booking = _interopRequireDefault(require("../../agent-data/booking"));
11
+
12
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
13
+
14
+ var _transactionType = _interopRequireDefault(require("../transaction-type"));
15
+
16
+ var _transactionMethod = _interopRequireDefault(require("../transaction-method"));
17
+
18
+ var _transactionStatus = _interopRequireDefault(require("../transaction-status"));
19
+
20
+ var _paymentLink = _interopRequireDefault(require("../payment-link"));
21
+
22
+ var _transactionMetadata = _interopRequireDefault(require("../transaction-metadata"));
23
+
24
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
27
 
12
28
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
13
29
 
@@ -18,19 +34,123 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
34
  let Transaction = (_dec = (0, _typeorm.Entity)({
19
35
  name: 'transaction',
20
36
  schema: 'payment'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
37
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
38
+ type: "int"
39
+ }), _dec4 = (0, _typeorm.ManyToOne)(() => _booking.default, {
40
+ nullable: true
41
+ }), _dec5 = (0, _typeorm.JoinColumn)({
42
+ name: 'booking_id',
43
+ referencedColumnName: 'id'
44
+ }), _dec6 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec7 = (0, _typeorm.JoinColumn)({
45
+ name: 'organisation_id',
46
+ referencedColumnName: 'id'
47
+ }), _dec8 = (0, _typeorm.ManyToOne)(() => _transactionStatus.default), _dec9 = (0, _typeorm.JoinColumn)({
48
+ name: 'status_id',
49
+ referencedColumnName: 'id'
50
+ }), _dec10 = (0, _typeorm.ManyToOne)(() => _transactionMethod.default), _dec11 = (0, _typeorm.JoinColumn)({
51
+ name: 'method_id',
52
+ referencedColumnName: 'id'
53
+ }), _dec12 = (0, _typeorm.ManyToOne)(() => _transactionType.default), _dec13 = (0, _typeorm.JoinColumn)({
54
+ name: 'type_id',
55
+ referencedColumnName: 'id'
56
+ }), _dec14 = (0, _typeorm.ManyToOne)(() => _paymentLink.default, {
57
+ nullable: true
58
+ }), _dec15 = (0, _typeorm.JoinColumn)({
59
+ name: 'payment_link_id',
60
+ referencedColumnName: 'id'
61
+ }), _dec16 = (0, _typeorm.OneToOne)(() => _transactionMetadata.default, transactionMetadata => transactionMetadata.transaction), _dec17 = (0, _typeorm.Column)({
62
+ type: "timestamp with time zone",
63
+ nullable: true
64
+ }), _dec18 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
22
65
  constructor() {
23
66
  _initializerDefineProperty(this, "id", _descriptor, this);
24
67
 
25
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
68
+ _initializerDefineProperty(this, "amount", _descriptor2, this);
69
+
70
+ _initializerDefineProperty(this, "booking", _descriptor3, this);
71
+
72
+ _initializerDefineProperty(this, "organisation", _descriptor4, this);
73
+
74
+ _initializerDefineProperty(this, "status", _descriptor5, this);
75
+
76
+ _initializerDefineProperty(this, "method", _descriptor6, this);
77
+
78
+ _initializerDefineProperty(this, "type", _descriptor7, this);
79
+
80
+ _initializerDefineProperty(this, "payment_link", _descriptor8, this);
81
+
82
+ _initializerDefineProperty(this, "metadata", _descriptor9, this);
83
+
84
+ _initializerDefineProperty(this, "completed_at", _descriptor10, this);
85
+
86
+ _initializerDefineProperty(this, "created_at", _descriptor11, this);
26
87
  }
27
88
 
28
89
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
90
+ configurable: true,
91
+ enumerable: true,
92
+ writable: true,
93
+ initializer: function () {
94
+ return undefined;
95
+ }
96
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec3], {
97
+ configurable: true,
98
+ enumerable: true,
99
+ writable: true,
100
+ initializer: null
101
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "booking", [_dec4, _dec5], {
102
+ configurable: true,
103
+ enumerable: true,
104
+ writable: true,
105
+ initializer: function () {
106
+ return _booking.default;
107
+ }
108
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec6, _dec7], {
109
+ configurable: true,
110
+ enumerable: true,
111
+ writable: true,
112
+ initializer: function () {
113
+ return _organisation.default;
114
+ }
115
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "status", [_dec8, _dec9], {
116
+ configurable: true,
117
+ enumerable: true,
118
+ writable: true,
119
+ initializer: function () {
120
+ return _transactionStatus.default;
121
+ }
122
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "method", [_dec10, _dec11], {
123
+ configurable: true,
124
+ enumerable: true,
125
+ writable: true,
126
+ initializer: function () {
127
+ return _transactionMethod.default;
128
+ }
129
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec12, _dec13], {
130
+ configurable: true,
131
+ enumerable: true,
132
+ writable: true,
133
+ initializer: function () {
134
+ return _transactionType.default;
135
+ }
136
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "payment_link", [_dec14, _dec15], {
137
+ configurable: true,
138
+ enumerable: true,
139
+ writable: true,
140
+ initializer: function () {
141
+ return _paymentLink.default;
142
+ }
143
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "metadata", [_dec16], {
144
+ configurable: true,
145
+ enumerable: true,
146
+ writable: true,
147
+ initializer: null
148
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec17], {
29
149
  configurable: true,
30
150
  enumerable: true,
31
151
  writable: true,
32
152
  initializer: null
33
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
153
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec18], {
34
154
  configurable: true,
35
155
  enumerable: true,
36
156
  writable: true,
@@ -7,7 +7,13 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
+ var _transactionEventType = _interopRequireDefault(require("../transaction-event-type"));
11
+
12
+ var _transaction = _interopRequireDefault(require("../transaction"));
13
+
14
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
17
 
12
18
  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
13
19
 
@@ -18,19 +24,45 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
18
24
  let TransactionEvent = (_dec = (0, _typeorm.Entity)({
19
25
  name: 'transaction_event',
20
26
  schema: 'payment'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class TransactionEvent {
27
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _transaction.default), _dec4 = (0, _typeorm.JoinColumn)({
28
+ name: 'transaction_id',
29
+ referencedColumnName: 'id'
30
+ }), _dec5 = (0, _typeorm.ManyToOne)(() => _transactionEventType.default), _dec6 = (0, _typeorm.JoinColumn)({
31
+ name: 'event_type_id',
32
+ referencedColumnName: 'id'
33
+ }), _dec7 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class TransactionEvent {
22
34
  constructor() {
23
35
  _initializerDefineProperty(this, "id", _descriptor, this);
24
36
 
25
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
37
+ _initializerDefineProperty(this, "transaction", _descriptor2, this);
38
+
39
+ _initializerDefineProperty(this, "event_type", _descriptor3, this);
40
+
41
+ _initializerDefineProperty(this, "created_at", _descriptor4, this);
26
42
  }
27
43
 
28
44
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
29
45
  configurable: true,
30
46
  enumerable: true,
31
47
  writable: true,
32
- initializer: null
33
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
48
+ initializer: function () {
49
+ return undefined;
50
+ }
51
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec3, _dec4], {
52
+ configurable: true,
53
+ enumerable: true,
54
+ writable: true,
55
+ initializer: function () {
56
+ return _transaction.default;
57
+ }
58
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "event_type", [_dec5, _dec6], {
59
+ configurable: true,
60
+ enumerable: true,
61
+ writable: true,
62
+ initializer: function () {
63
+ return _transactionEventType.default;
64
+ }
65
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec7], {
34
66
  configurable: true,
35
67
  enumerable: true,
36
68
  writable: true,
@@ -15,10 +15,10 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
15
15
 
16
16
  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
17
17
 
18
- let OrganisationSupplierType = (_dec = (0, _typeorm.Entity)({
19
- name: 'organisation_supplier_type',
20
- schema: 'agent_data'
21
- }), _dec2 = (0, _typeorm.PrimaryGeneratedColumn)("uuid"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class OrganisationSupplierType {
18
+ let TransactionEventType = (_dec = (0, _typeorm.Entity)({
19
+ name: 'transaction_event_type',
20
+ schema: 'payment'
21
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class TransactionEventType {
22
22
  constructor() {
23
23
  _initializerDefineProperty(this, "id", _descriptor, this);
24
24
 
@@ -36,4 +36,4 @@ let OrganisationSupplierType = (_dec = (0, _typeorm.Entity)({
36
36
  writable: true,
37
37
  initializer: null
38
38
  })), _class2)) || _class);
39
- exports.default = OrganisationSupplierType;
39
+ exports.default = TransactionEventType;