@tomei/rental 0.16.3 → 0.16.4

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 (70) hide show
  1. package/.commitlintrc.json +22 -22
  2. package/.gitlab-ci.yml +16 -16
  3. package/.husky/commit-msg +15 -15
  4. package/.husky/pre-commit +7 -7
  5. package/.prettierrc +4 -4
  6. package/Jenkinsfile +51 -51
  7. package/README.md +8 -8
  8. package/dist/src/components/agreement/agreement.js +7 -7
  9. package/dist/src/components/rental/rental.d.ts +3 -3
  10. package/dist/src/components/rental/rental.js +20 -18
  11. package/dist/src/components/rental/rental.js.map +1 -1
  12. package/dist/src/enum/rental-status.enum.d.ts +1 -2
  13. package/dist/src/enum/rental-status.enum.js +0 -1
  14. package/dist/src/enum/rental-status.enum.js.map +1 -1
  15. package/dist/src/interfaces/rental-attr.interface.d.ts +1 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/eslint.config.mjs +58 -58
  18. package/jest.config.js +10 -10
  19. package/migrations/booking-table-migration.js +79 -79
  20. package/migrations/hirer-signature-table-migration.js +64 -64
  21. package/migrations/joint-hirer-table-migration.js +52 -52
  22. package/migrations/rental-aggreement-history-migration.js +41 -41
  23. package/migrations/rental-aggrement-table-migration.js +30 -30
  24. package/migrations/rental-price-table-migration.js +32 -32
  25. package/migrations/rental-table-migrations.js +96 -96
  26. package/package.json +75 -75
  27. package/sonar-project.properties +12 -12
  28. package/src/components/agreement/agreement.repository.ts +54 -54
  29. package/src/components/agreement/agreement.ts +180 -180
  30. package/src/components/agreement-history/agreement-history.repository.ts +54 -54
  31. package/src/components/agreement-history/agreement-history.ts +57 -57
  32. package/src/components/booking/booking.repository.ts +51 -51
  33. package/src/components/booking/booking.ts +492 -492
  34. package/src/components/hirer-signature/hirer-signature.repository.ts +54 -54
  35. package/src/components/hirer-signature/hirer-signature.ts +140 -140
  36. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  37. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  38. package/src/components/rental/rental.repository.ts +51 -51
  39. package/src/components/rental/rental.ts +1119 -1116
  40. package/src/components/rental-price/rental-price.repository.ts +54 -54
  41. package/src/components/rental-price/rental-price.ts +100 -100
  42. package/src/database.ts +31 -31
  43. package/src/enum/account-type.enum.ts +4 -4
  44. package/src/enum/booking.enum.ts +5 -5
  45. package/src/enum/hirer-signature-status.enum.ts +4 -4
  46. package/src/enum/hirer-type.enum.ts +4 -4
  47. package/src/enum/index.ts +15 -15
  48. package/src/enum/rental-status.enum.ts +34 -39
  49. package/src/index.ts +36 -36
  50. package/src/interfaces/agreement-attr.interface.ts +7 -7
  51. package/src/interfaces/agreement-history-attr.interface.ts +7 -7
  52. package/src/interfaces/booking-attr.interface.ts +19 -19
  53. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  54. package/src/interfaces/hirer-signature-attr.interface.ts +15 -15
  55. package/src/interfaces/index.ts +19 -19
  56. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  57. package/src/interfaces/rental-attr.interface.ts +25 -25
  58. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  59. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  60. package/src/interfaces/response-hirer-signature-attr.interface.ts +15 -15
  61. package/src/models/agreement-history.entity.ts +51 -51
  62. package/src/models/agreement.entity.ts +47 -47
  63. package/src/models/booking.entity.ts +105 -105
  64. package/src/models/hirer-signature.entity.ts +81 -81
  65. package/src/models/index.ts +17 -17
  66. package/src/models/joint-hirer.entity.ts +63 -63
  67. package/src/models/rental-price.entity.ts +38 -38
  68. package/src/models/rental.entity.ts +133 -133
  69. package/tsconfig.build.json +5 -5
  70. package/tsconfig.json +24 -24
@@ -1,51 +1,51 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import { BookingModel } from '../../models/booking.entity';
3
-
4
- export class BookingRepository
5
- extends RepositoryBase<BookingModel>
6
- implements IRepositoryBase<BookingModel>
7
- {
8
- constructor() {
9
- super(BookingModel);
10
- }
11
-
12
- async findByPk(id: string, transaction?: any): Promise<BookingModel | null> {
13
- try {
14
- const result = await BookingModel.findByPk(id, {
15
- transaction: transaction,
16
- });
17
-
18
- return result;
19
- } catch (error) {
20
- throw new Error(`An Error occured when fetching : ${error.message}`);
21
- }
22
- }
23
-
24
- async delete(BookingNo: string, dbTransaction?: any) {
25
- try {
26
- const options = {
27
- where: {
28
- BookingNo: BookingNo,
29
- },
30
- transaction: dbTransaction,
31
- };
32
- await BookingModel.destroy(options);
33
- } catch (error) {
34
- throw new Error(`An Error occured when delete : ${error.message}`);
35
- }
36
- }
37
-
38
- async findAndCountAll(options?: any) {
39
- try {
40
- let Bookings: any;
41
- if (options) {
42
- Bookings = await BookingModel.findAndCountAll(options);
43
- } else {
44
- Bookings = await BookingModel.findAndCountAll();
45
- }
46
- return Bookings;
47
- } catch (error) {
48
- throw new Error(`An Error occured when retriving : ${error.message}`);
49
- }
50
- }
51
- }
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import { BookingModel } from '../../models/booking.entity';
3
+
4
+ export class BookingRepository
5
+ extends RepositoryBase<BookingModel>
6
+ implements IRepositoryBase<BookingModel>
7
+ {
8
+ constructor() {
9
+ super(BookingModel);
10
+ }
11
+
12
+ async findByPk(id: string, transaction?: any): Promise<BookingModel | null> {
13
+ try {
14
+ const result = await BookingModel.findByPk(id, {
15
+ transaction: transaction,
16
+ });
17
+
18
+ return result;
19
+ } catch (error) {
20
+ throw new Error(`An Error occured when fetching : ${error.message}`);
21
+ }
22
+ }
23
+
24
+ async delete(BookingNo: string, dbTransaction?: any) {
25
+ try {
26
+ const options = {
27
+ where: {
28
+ BookingNo: BookingNo,
29
+ },
30
+ transaction: dbTransaction,
31
+ };
32
+ await BookingModel.destroy(options);
33
+ } catch (error) {
34
+ throw new Error(`An Error occured when delete : ${error.message}`);
35
+ }
36
+ }
37
+
38
+ async findAndCountAll(options?: any) {
39
+ try {
40
+ let Bookings: any;
41
+ if (options) {
42
+ Bookings = await BookingModel.findAndCountAll(options);
43
+ } else {
44
+ Bookings = await BookingModel.findAndCountAll();
45
+ }
46
+ return Bookings;
47
+ } catch (error) {
48
+ throw new Error(`An Error occured when retriving : ${error.message}`);
49
+ }
50
+ }
51
+ }