@tomei/rental 0.4.4 → 0.5.0
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/.gitlab-ci.yml +16 -0
- package/dist/src/components/booking/booking.d.ts +38 -0
- package/dist/src/components/booking/booking.js +200 -0
- package/dist/src/components/booking/booking.js.map +1 -0
- package/dist/src/components/booking/booking.repository.d.ts +8 -0
- package/dist/src/components/booking/booking.repository.js +67 -0
- package/dist/src/components/booking/booking.repository.js.map +1 -0
- package/dist/src/components/rental/rental.d.ts +1 -1
- package/dist/src/components/rental/rental.js +6 -6
- package/dist/src/components/rental/rental.js.map +1 -1
- package/dist/src/database.js +2 -0
- package/dist/src/database.js.map +1 -1
- package/dist/src/enum/booking.enum.d.ts +5 -0
- package/dist/src/enum/booking.enum.js +10 -0
- package/dist/src/enum/booking.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +2 -1
- package/dist/src/enum/index.js +3 -1
- package/dist/src/enum/index.js.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces/booking-attr.interface.d.ts +18 -0
- package/dist/src/interfaces/booking-attr.interface.js +3 -0
- package/dist/src/interfaces/booking-attr.interface.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +2 -1
- package/dist/src/models/booking.entity.d.ts +21 -0
- package/dist/src/models/booking.entity.js +128 -0
- package/dist/src/models/booking.entity.js.map +1 -0
- package/dist/src/models/index.d.ts +2 -1
- package/dist/src/models/index.js +3 -1
- package/dist/src/models/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/booking-table-migration.js +79 -0
- package/package.json +9 -5
- package/sonar-project.properties +13 -0
- package/src/components/booking/booking.repository.ts +51 -0
- package/src/components/booking/booking.ts +283 -0
- package/src/components/rental/rental.ts +6 -6
- package/src/database.ts +2 -0
- package/src/enum/booking.enum.ts +5 -0
- package/src/enum/index.ts +2 -1
- package/src/index.ts +4 -0
- package/src/interfaces/booking-attr.interface.ts +19 -0
- package/src/interfaces/index.ts +7 -1
- package/src/models/booking.entity.ts +105 -0
- package/src/models/index.ts +2 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
DataType,
|
|
4
|
+
Table,
|
|
5
|
+
Model,
|
|
6
|
+
ForeignKey,
|
|
7
|
+
BelongsTo,
|
|
8
|
+
CreatedAt,
|
|
9
|
+
UpdatedAt,
|
|
10
|
+
} from 'sequelize-typescript';
|
|
11
|
+
import { RentalPriceModel } from './rental-price.entity';
|
|
12
|
+
import { BookingStatusEnum } from '../enum/booking.enum';
|
|
13
|
+
|
|
14
|
+
@Table({
|
|
15
|
+
tableName: 'booking_Booking',
|
|
16
|
+
})
|
|
17
|
+
export class BookingModel extends Model {
|
|
18
|
+
@Column({
|
|
19
|
+
primaryKey: true,
|
|
20
|
+
allowNull: false,
|
|
21
|
+
type: DataType.STRING(30),
|
|
22
|
+
})
|
|
23
|
+
BookingNo: string;
|
|
24
|
+
|
|
25
|
+
@Column({
|
|
26
|
+
allowNull: false,
|
|
27
|
+
type: DataType.STRING(30),
|
|
28
|
+
})
|
|
29
|
+
CustomerId: string;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
allowNull: false,
|
|
33
|
+
type: DataType.STRING(30),
|
|
34
|
+
})
|
|
35
|
+
CustomerType: string;
|
|
36
|
+
|
|
37
|
+
@Column({
|
|
38
|
+
allowNull: false,
|
|
39
|
+
type: DataType.STRING(30),
|
|
40
|
+
})
|
|
41
|
+
ItemId: string;
|
|
42
|
+
|
|
43
|
+
@Column({
|
|
44
|
+
allowNull: false,
|
|
45
|
+
type: DataType.STRING(30),
|
|
46
|
+
})
|
|
47
|
+
ItemType: string;
|
|
48
|
+
|
|
49
|
+
@ForeignKey(() => RentalPriceModel)
|
|
50
|
+
@Column({
|
|
51
|
+
allowNull: false,
|
|
52
|
+
type: DataType.STRING(30),
|
|
53
|
+
})
|
|
54
|
+
PriceId: string;
|
|
55
|
+
|
|
56
|
+
@Column({
|
|
57
|
+
allowNull: false,
|
|
58
|
+
type: DataType.DATE,
|
|
59
|
+
})
|
|
60
|
+
ScheduledStartDateTime: Date;
|
|
61
|
+
|
|
62
|
+
@Column({
|
|
63
|
+
allowNull: false,
|
|
64
|
+
type: DataType.DATE,
|
|
65
|
+
})
|
|
66
|
+
ScheduledEndDateTime: Date;
|
|
67
|
+
|
|
68
|
+
@Column({
|
|
69
|
+
allowNull: true,
|
|
70
|
+
type: DataType.DECIMAL(10, 2),
|
|
71
|
+
})
|
|
72
|
+
BookingFee: number;
|
|
73
|
+
|
|
74
|
+
@Column({
|
|
75
|
+
allowNull: false,
|
|
76
|
+
type: DataType.STRING(20),
|
|
77
|
+
})
|
|
78
|
+
Status: BookingStatusEnum;
|
|
79
|
+
|
|
80
|
+
@Column({
|
|
81
|
+
type: DataType.STRING(3000),
|
|
82
|
+
})
|
|
83
|
+
CancelRemarks: string;
|
|
84
|
+
|
|
85
|
+
@Column({
|
|
86
|
+
allowNull: false,
|
|
87
|
+
type: DataType.STRING(30),
|
|
88
|
+
})
|
|
89
|
+
CreatedById: string;
|
|
90
|
+
|
|
91
|
+
@CreatedAt
|
|
92
|
+
CreatedAt: Date;
|
|
93
|
+
|
|
94
|
+
@Column({
|
|
95
|
+
allowNull: false,
|
|
96
|
+
type: DataType.STRING(30),
|
|
97
|
+
})
|
|
98
|
+
UpdatedById: string;
|
|
99
|
+
|
|
100
|
+
@UpdatedAt
|
|
101
|
+
UpdatedAt: Date;
|
|
102
|
+
|
|
103
|
+
@BelongsTo(() => RentalPriceModel)
|
|
104
|
+
RentalPrice: RentalPriceModel;
|
|
105
|
+
}
|
package/src/models/index.ts
CHANGED