@tomei/rental 0.16.2 → 0.16.3

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 (64) 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.js +15 -15
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/eslint.config.mjs +58 -58
  12. package/jest.config.js +10 -10
  13. package/migrations/booking-table-migration.js +79 -79
  14. package/migrations/hirer-signature-table-migration.js +64 -64
  15. package/migrations/joint-hirer-table-migration.js +52 -52
  16. package/migrations/rental-aggreement-history-migration.js +41 -41
  17. package/migrations/rental-aggrement-table-migration.js +30 -30
  18. package/migrations/rental-price-table-migration.js +32 -32
  19. package/migrations/rental-table-migrations.js +96 -96
  20. package/package.json +75 -75
  21. package/sonar-project.properties +12 -12
  22. package/src/components/agreement/agreement.repository.ts +54 -54
  23. package/src/components/agreement/agreement.ts +180 -180
  24. package/src/components/agreement-history/agreement-history.repository.ts +54 -54
  25. package/src/components/agreement-history/agreement-history.ts +57 -57
  26. package/src/components/booking/booking.repository.ts +51 -51
  27. package/src/components/booking/booking.ts +492 -492
  28. package/src/components/hirer-signature/hirer-signature.repository.ts +54 -54
  29. package/src/components/hirer-signature/hirer-signature.ts +140 -140
  30. package/src/components/joint-hirer/joint-hirer.repository.ts +54 -54
  31. package/src/components/joint-hirer/joint-hirer.ts +137 -137
  32. package/src/components/rental/rental.repository.ts +51 -51
  33. package/src/components/rental/rental.ts +1116 -1116
  34. package/src/components/rental-price/rental-price.repository.ts +54 -54
  35. package/src/components/rental-price/rental-price.ts +100 -100
  36. package/src/database.ts +31 -31
  37. package/src/enum/account-type.enum.ts +4 -4
  38. package/src/enum/booking.enum.ts +5 -5
  39. package/src/enum/hirer-signature-status.enum.ts +4 -4
  40. package/src/enum/hirer-type.enum.ts +4 -4
  41. package/src/enum/index.ts +15 -15
  42. package/src/enum/rental-status.enum.ts +39 -39
  43. package/src/index.ts +36 -36
  44. package/src/interfaces/agreement-attr.interface.ts +7 -7
  45. package/src/interfaces/agreement-history-attr.interface.ts +7 -7
  46. package/src/interfaces/booking-attr.interface.ts +19 -19
  47. package/src/interfaces/booking-find-all-search-attr.interface.ts +12 -12
  48. package/src/interfaces/hirer-signature-attr.interface.ts +15 -15
  49. package/src/interfaces/index.ts +19 -19
  50. package/src/interfaces/joint-hirer-attr.interface.ts +10 -10
  51. package/src/interfaces/rental-attr.interface.ts +25 -25
  52. package/src/interfaces/rental-find-all-search-attr.interface.ts +11 -11
  53. package/src/interfaces/rental-price-attr.interface.ts +7 -7
  54. package/src/interfaces/response-hirer-signature-attr.interface.ts +15 -15
  55. package/src/models/agreement-history.entity.ts +51 -51
  56. package/src/models/agreement.entity.ts +47 -47
  57. package/src/models/booking.entity.ts +105 -105
  58. package/src/models/hirer-signature.entity.ts +81 -81
  59. package/src/models/index.ts +17 -17
  60. package/src/models/joint-hirer.entity.ts +63 -63
  61. package/src/models/rental-price.entity.ts +38 -38
  62. package/src/models/rental.entity.ts +133 -133
  63. package/tsconfig.build.json +5 -5
  64. 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
+ }