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