@tomei/rental 0.17.1 → 0.19.0-staging.1

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 (135) hide show
  1. package/dist/src/components/rental/rental.d.ts +7 -0
  2. package/dist/src/components/rental/rental.js +135 -0
  3. package/dist/src/components/rental/rental.js.map +1 -1
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/package.json +11 -6
  6. package/src/ClassMappings/ItemClassMap.ts +7 -0
  7. package/src/ClassMappings/index.ts +3 -0
  8. package/src/components/rental/rental.ts +226 -0
  9. package/src/index.ts +2 -0
  10. package/dist/index.d.ts +0 -1
  11. package/dist/index.js +0 -18
  12. package/dist/index.js.map +0 -1
  13. package/dist/src/components/agreement/agreement.d.ts +0 -27
  14. package/dist/src/components/agreement/agreement.js +0 -137
  15. package/dist/src/components/agreement/agreement.js.map +0 -1
  16. package/dist/src/components/agreement/agreement.repository.d.ts +0 -8
  17. package/dist/src/components/agreement/agreement.repository.js +0 -67
  18. package/dist/src/components/agreement/agreement.repository.js.map +0 -1
  19. package/dist/src/components/agreement-history/agreement-history.d.ts +0 -17
  20. package/dist/src/components/agreement-history/agreement-history.js +0 -51
  21. package/dist/src/components/agreement-history/agreement-history.js.map +0 -1
  22. package/dist/src/components/agreement-history/agreement-history.repository.d.ts +0 -8
  23. package/dist/src/components/agreement-history/agreement-history.repository.js +0 -67
  24. package/dist/src/components/agreement-history/agreement-history.repository.js.map +0 -1
  25. package/dist/src/components/agreement-signature/agreement-signature.d.ts +0 -27
  26. package/dist/src/components/agreement-signature/agreement-signature.js +0 -112
  27. package/dist/src/components/agreement-signature/agreement-signature.js.map +0 -1
  28. package/dist/src/components/agreement-signature/agreement-signature.repository.d.ts +0 -8
  29. package/dist/src/components/agreement-signature/agreement-signature.repository.js +0 -68
  30. package/dist/src/components/agreement-signature/agreement-signature.repository.js.map +0 -1
  31. package/dist/src/components/booking/booking.d.ts +0 -46
  32. package/dist/src/components/booking/booking.js +0 -314
  33. package/dist/src/components/booking/booking.js.map +0 -1
  34. package/dist/src/components/booking/booking.repository.d.ts +0 -8
  35. package/dist/src/components/booking/booking.repository.js +0 -67
  36. package/dist/src/components/booking/booking.repository.js.map +0 -1
  37. package/dist/src/components/joint-hirer/joint-hirer.d.ts +0 -23
  38. package/dist/src/components/joint-hirer/joint-hirer.js +0 -106
  39. package/dist/src/components/joint-hirer/joint-hirer.js.map +0 -1
  40. package/dist/src/components/joint-hirer/joint-hirer.repository.d.ts +0 -8
  41. package/dist/src/components/joint-hirer/joint-hirer.repository.js +0 -67
  42. package/dist/src/components/joint-hirer/joint-hirer.repository.js.map +0 -1
  43. package/dist/src/components/rental/rental.repository.d.ts +0 -8
  44. package/dist/src/components/rental/rental.repository.js +0 -67
  45. package/dist/src/components/rental/rental.repository.js.map +0 -1
  46. package/dist/src/components/rental-price/rental-price.d.ts +0 -18
  47. package/dist/src/components/rental-price/rental-price.js +0 -79
  48. package/dist/src/components/rental-price/rental-price.js.map +0 -1
  49. package/dist/src/components/rental-price/rental-price.repository.d.ts +0 -8
  50. package/dist/src/components/rental-price/rental-price.repository.js +0 -67
  51. package/dist/src/components/rental-price/rental-price.repository.js.map +0 -1
  52. package/dist/src/database.d.ts +0 -4
  53. package/dist/src/database.js +0 -29
  54. package/dist/src/database.js.map +0 -1
  55. package/dist/src/enum/account-type.enum.d.ts +0 -4
  56. package/dist/src/enum/account-type.enum.js +0 -9
  57. package/dist/src/enum/account-type.enum.js.map +0 -1
  58. package/dist/src/enum/aggrement-status.enum.d.ts +0 -5
  59. package/dist/src/enum/aggrement-status.enum.js +0 -10
  60. package/dist/src/enum/aggrement-status.enum.js.map +0 -1
  61. package/dist/src/enum/agreement-signature-status.enum.d.ts +0 -4
  62. package/dist/src/enum/agreement-signature-status.enum.js +0 -9
  63. package/dist/src/enum/agreement-signature-status.enum.js.map +0 -1
  64. package/dist/src/enum/booking.enum.d.ts +0 -5
  65. package/dist/src/enum/booking.enum.js +0 -10
  66. package/dist/src/enum/booking.enum.js.map +0 -1
  67. package/dist/src/enum/hirer-type.enum.d.ts +0 -4
  68. package/dist/src/enum/hirer-type.enum.js +0 -9
  69. package/dist/src/enum/hirer-type.enum.js.map +0 -1
  70. package/dist/src/enum/index.d.ts +0 -7
  71. package/dist/src/enum/index.js +0 -16
  72. package/dist/src/enum/index.js.map +0 -1
  73. package/dist/src/enum/rental-status.enum.d.ts +0 -9
  74. package/dist/src/enum/rental-status.enum.js +0 -14
  75. package/dist/src/enum/rental-status.enum.js.map +0 -1
  76. package/dist/src/index.d.ts +0 -19
  77. package/dist/src/index.js +0 -51
  78. package/dist/src/index.js.map +0 -1
  79. package/dist/src/interfaces/agreemeent-signature-attr.interface.d.ts +0 -14
  80. package/dist/src/interfaces/agreemeent-signature-attr.interface.js +0 -3
  81. package/dist/src/interfaces/agreemeent-signature-attr.interface.js.map +0 -1
  82. package/dist/src/interfaces/agreement-attr.interface.d.ts +0 -7
  83. package/dist/src/interfaces/agreement-attr.interface.js +0 -3
  84. package/dist/src/interfaces/agreement-attr.interface.js.map +0 -1
  85. package/dist/src/interfaces/agreement-history-attr.interface.d.ts +0 -7
  86. package/dist/src/interfaces/agreement-history-attr.interface.js +0 -3
  87. package/dist/src/interfaces/agreement-history-attr.interface.js.map +0 -1
  88. package/dist/src/interfaces/booking-attr.interface.d.ts +0 -18
  89. package/dist/src/interfaces/booking-attr.interface.js +0 -3
  90. package/dist/src/interfaces/booking-attr.interface.js.map +0 -1
  91. package/dist/src/interfaces/booking-find-all-search-attr.interface.d.ts +0 -12
  92. package/dist/src/interfaces/booking-find-all-search-attr.interface.js +0 -3
  93. package/dist/src/interfaces/booking-find-all-search-attr.interface.js.map +0 -1
  94. package/dist/src/interfaces/index.d.ts +0 -9
  95. package/dist/src/interfaces/index.js +0 -3
  96. package/dist/src/interfaces/index.js.map +0 -1
  97. package/dist/src/interfaces/joint-hirer-attr.interface.d.ts +0 -10
  98. package/dist/src/interfaces/joint-hirer-attr.interface.js +0 -3
  99. package/dist/src/interfaces/joint-hirer-attr.interface.js.map +0 -1
  100. package/dist/src/interfaces/rental-attr.interface.d.ts +0 -24
  101. package/dist/src/interfaces/rental-attr.interface.js +0 -3
  102. package/dist/src/interfaces/rental-attr.interface.js.map +0 -1
  103. package/dist/src/interfaces/rental-find-all-search-attr.interface.d.ts +0 -10
  104. package/dist/src/interfaces/rental-find-all-search-attr.interface.js +0 -3
  105. package/dist/src/interfaces/rental-find-all-search-attr.interface.js.map +0 -1
  106. package/dist/src/interfaces/rental-price-attr.interface.d.ts +0 -7
  107. package/dist/src/interfaces/rental-price-attr.interface.js +0 -3
  108. package/dist/src/interfaces/rental-price-attr.interface.js.map +0 -1
  109. package/dist/src/interfaces/response-hirer-signature-attr.interface.d.ts +0 -14
  110. package/dist/src/interfaces/response-hirer-signature-attr.interface.js +0 -3
  111. package/dist/src/interfaces/response-hirer-signature-attr.interface.js.map +0 -1
  112. package/dist/src/models/agreement-history.entity.d.ts +0 -10
  113. package/dist/src/models/agreement-history.entity.js +0 -65
  114. package/dist/src/models/agreement-history.entity.js.map +0 -1
  115. package/dist/src/models/agreement-signature.entity.d.ts +0 -18
  116. package/dist/src/models/agreement-signature.entity.js +0 -101
  117. package/dist/src/models/agreement-signature.entity.js.map +0 -1
  118. package/dist/src/models/agreement.entity.d.ts +0 -14
  119. package/dist/src/models/agreement.entity.js +0 -70
  120. package/dist/src/models/agreement.entity.js.map +0 -1
  121. package/dist/src/models/booking.entity.d.ts +0 -21
  122. package/dist/src/models/booking.entity.js +0 -128
  123. package/dist/src/models/booking.entity.js.map +0 -1
  124. package/dist/src/models/index.d.ts +0 -8
  125. package/dist/src/models/index.js +0 -18
  126. package/dist/src/models/index.js.map +0 -1
  127. package/dist/src/models/joint-hirer.entity.d.ts +0 -13
  128. package/dist/src/models/joint-hirer.entity.js +0 -79
  129. package/dist/src/models/joint-hirer.entity.js.map +0 -1
  130. package/dist/src/models/rental-price.entity.d.ts +0 -8
  131. package/dist/src/models/rental-price.entity.js +0 -59
  132. package/dist/src/models/rental-price.entity.js.map +0 -1
  133. package/dist/src/models/rental.entity.d.ts +0 -29
  134. package/dist/src/models/rental.entity.js +0 -160
  135. package/dist/src/models/rental.entity.js.map +0 -1
@@ -1,8 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import { AgreementHistoryModel } from '../../models/agreement-history.entity';
3
- export declare class AgreementHistoryRepository extends RepositoryBase<AgreementHistoryModel> implements IRepositoryBase<AgreementHistoryModel> {
4
- constructor();
5
- findByPk(id: string, transaction?: any): Promise<AgreementHistoryModel | null>;
6
- delete(AgreementNo: string, dbTransaction?: any): Promise<void>;
7
- findAndCountAll(options?: any): Promise<any>;
8
- }
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AgreementHistoryRepository = void 0;
13
- const general_1 = require("@tomei/general");
14
- const agreement_history_entity_1 = require("../../models/agreement-history.entity");
15
- class AgreementHistoryRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(agreement_history_entity_1.AgreementHistoryModel);
18
- }
19
- findByPk(id, transaction) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- const result = yield agreement_history_entity_1.AgreementHistoryModel.findByPk(parseInt(id), {
23
- transaction: transaction,
24
- });
25
- return result;
26
- }
27
- catch (error) {
28
- throw new Error(`An Error occured when fetching : ${error.message}`);
29
- }
30
- });
31
- }
32
- delete(AgreementNo, dbTransaction) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- try {
35
- const options = {
36
- where: {
37
- AgreementNo,
38
- },
39
- transaction: dbTransaction,
40
- };
41
- yield agreement_history_entity_1.AgreementHistoryModel.destroy(options);
42
- }
43
- catch (error) {
44
- throw new Error(`An Error occured when delete : ${error.message}`);
45
- }
46
- });
47
- }
48
- findAndCountAll(options) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- try {
51
- let Agreements;
52
- if (options) {
53
- Agreements = yield agreement_history_entity_1.AgreementHistoryModel.findAndCountAll(options);
54
- }
55
- else {
56
- Agreements = yield agreement_history_entity_1.AgreementHistoryModel.findAndCountAll();
57
- }
58
- return Agreements;
59
- }
60
- catch (error) {
61
- throw new Error(`An Error occured when retriving : ${error.message}`);
62
- }
63
- });
64
- }
65
- }
66
- exports.AgreementHistoryRepository = AgreementHistoryRepository;
67
- //# sourceMappingURL=agreement-history.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agreement-history.repository.js","sourceRoot":"","sources":["../../../../src/components/agreement-history/agreement-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,oFAA8E;AAE9E,MAAa,0BACX,SAAQ,wBAAqC;IAG7C;QACE,KAAK,CAAC,gDAAqB,CAAC,CAAC;IAC/B,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,gDAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;oBAChE,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,WAAmB,EAAE,aAAmB;;YACnD,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,WAAW;qBACZ;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,gDAAqB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI,CAAC;gBACH,IAAI,UAAe,CAAC;gBACpB,IAAI,OAAO,EAAE,CAAC;oBACZ,UAAU,GAAG,MAAM,gDAAqB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACN,UAAU,GAAG,MAAM,gDAAqB,CAAC,eAAe,EAAE,CAAC;gBAC7D,CAAC;gBACD,OAAO,UAAU,CAAC;YACpB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;KAAA;CACF;AAlDD,gEAkDC"}
@@ -1,27 +0,0 @@
1
- import { ObjectBase } from '@tomei/general';
2
- import { AgreementSignatureRepository } from './agreement-signature.repository';
3
- import { IAgreementSignatureAttr } from '../../interfaces/agreemeent-signature-attr.interface';
4
- import { LoginUser } from '@tomei/sso';
5
- import { AgreementSignatureStatusEnum } from '../../enum/agreement-signature-status.enum';
6
- export declare class AgreementSignature extends ObjectBase implements IAgreementSignatureAttr {
7
- ObjectId: string;
8
- ObjectName: string;
9
- ObjectType: string;
10
- TableName: string;
11
- AgreementNo: string;
12
- Party: string;
13
- PartyId: string;
14
- PartyType: string;
15
- SignatureStatus: AgreementSignatureStatusEnum;
16
- SignedAt: Date;
17
- CreatedById: string;
18
- CreatedAt: Date;
19
- UpdatedById: string;
20
- UpdatedAt: Date;
21
- get SignatureId(): string;
22
- set SignatureId(value: string);
23
- protected static _Repository: AgreementSignatureRepository;
24
- protected constructor(AgreementSignatureAttr?: IAgreementSignatureAttr);
25
- static init(AgreementSignatureId?: string, dbTransaction?: any): Promise<AgreementSignature>;
26
- create(loginUser: LoginUser, dbTransaction?: any): Promise<this>;
27
- }
@@ -1,112 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AgreementSignature = void 0;
13
- const general_1 = require("@tomei/general");
14
- const agreement_signature_repository_1 = require("./agreement-signature.repository");
15
- const config_1 = require("@tomei/config");
16
- const activity_history_1 = require("@tomei/activity-history");
17
- class AgreementSignature extends general_1.ObjectBase {
18
- get SignatureId() {
19
- return this.ObjectId;
20
- }
21
- set SignatureId(value) {
22
- this.ObjectId = value;
23
- }
24
- constructor(AgreementSignatureAttr) {
25
- super();
26
- this.ObjectType = 'AgreementSignature';
27
- this.TableName = 'rental_AgreementSignature';
28
- if (AgreementSignatureAttr) {
29
- this.SignatureId = AgreementSignatureAttr.SignatureId;
30
- this.AgreementNo = AgreementSignatureAttr.AgreementNo;
31
- this.Party = AgreementSignatureAttr.Party;
32
- this.PartyId = AgreementSignatureAttr.PartyId;
33
- this.PartyType = AgreementSignatureAttr.PartyType;
34
- this.SignatureStatus = AgreementSignatureAttr.SignatureStatus;
35
- this.SignedAt = AgreementSignatureAttr.SignedAt;
36
- this.CreatedById = AgreementSignatureAttr.CreatedById;
37
- this.CreatedAt = AgreementSignatureAttr.CreatedAt;
38
- this.UpdatedById = AgreementSignatureAttr.UpdatedById;
39
- this.UpdatedAt = AgreementSignatureAttr.UpdatedAt;
40
- }
41
- }
42
- static init(AgreementSignatureId, dbTransaction) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- try {
45
- if (AgreementSignatureId) {
46
- const hs = yield AgreementSignature._Repository.findByPk(AgreementSignatureId, dbTransaction);
47
- if (hs) {
48
- return new AgreementSignature(hs.get({ plain: true }));
49
- }
50
- else {
51
- throw new general_1.ClassError('AgreementSignature', 'AgreementSignatureErrMsg01', 'AgreementSignature not found');
52
- }
53
- }
54
- return new AgreementSignature();
55
- }
56
- catch (error) {
57
- throw error;
58
- }
59
- });
60
- }
61
- create(loginUser, dbTransaction) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- try {
64
- const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
65
- const isPrivileged = yield loginUser.checkPrivileges(systemCode, 'AgreementSignature - Create');
66
- if (!isPrivileged) {
67
- throw new general_1.ClassError('AgreementSignature', 'AgreementSignatureErrMsg00', "You do not have 'AgreementSignature - Create' privilege.");
68
- }
69
- if (!this.AgreementNo || !this.PartyId || !this.PartyType) {
70
- throw new general_1.ClassError('AgreementSignature', 'AgreementSignatureErrMsg03', 'AgreementNo, PartyId and PartyType are required.');
71
- }
72
- this.ObjectId = this.createId();
73
- this.CreatedById = loginUser.ObjectId;
74
- this.CreatedAt = new Date();
75
- this.UpdatedById = loginUser.ObjectId;
76
- this.UpdatedAt = new Date();
77
- const entityValueAfter = {
78
- SignatureId: this.SignatureId,
79
- AgreementNo: this.AgreementNo,
80
- Party: this.Party,
81
- PartyId: this.PartyId,
82
- PartyType: this.PartyType,
83
- SignatureStatus: this.SignatureStatus,
84
- SignedAt: this.SignedAt,
85
- CreatedById: this.CreatedById,
86
- CreatedAt: this.CreatedAt,
87
- UpdatedById: this.UpdatedById,
88
- UpdatedAt: this.UpdatedAt,
89
- };
90
- yield AgreementSignature._Repository.create(entityValueAfter, {
91
- transaction: dbTransaction,
92
- });
93
- const activity = new activity_history_1.Activity();
94
- activity.ObjectId = this.createId();
95
- activity.Action = activity_history_1.ActionEnum.CREATE;
96
- activity.Description = 'Add Joint Hirer Signature';
97
- activity.EntityId = this.ObjectId;
98
- activity.EntityType = this.ObjectType;
99
- activity.EntityValueBefore = JSON.stringify({});
100
- activity.EntityValueAfter = JSON.stringify(entityValueAfter);
101
- yield activity.create(loginUser.ObjectId, dbTransaction);
102
- return this;
103
- }
104
- catch (error) {
105
- throw error;
106
- }
107
- });
108
- }
109
- }
110
- exports.AgreementSignature = AgreementSignature;
111
- AgreementSignature._Repository = new agreement_signature_repository_1.AgreementSignatureRepository();
112
- //# sourceMappingURL=agreement-signature.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agreement-signature.js","sourceRoot":"","sources":["../../../../src/components/agreement-signature/agreement-signature.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AACxD,qFAAgF;AAEhF,0CAAkD;AAElD,8DAA+D;AAG/D,MAAa,kBACX,SAAQ,oBAAU;IAkBlB,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAID,YAAsB,sBAAgD;QACpE,KAAK,EAAE,CAAC;QAxBV,eAAU,GAAW,oBAAoB,CAAC;QAC1C,cAAS,GAAW,2BAA2B,CAAC;QAwB9C,IAAI,sBAAsB,EAAE,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,sBAAsB,CAAC,WAAW,CAAC;YACtD,IAAI,CAAC,WAAW,GAAG,sBAAsB,CAAC,WAAW,CAAC;YACtD,IAAI,CAAC,KAAK,GAAG,sBAAsB,CAAC,KAAK,CAAC;YAC1C,IAAI,CAAC,OAAO,GAAG,sBA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AAC,CAAC;gBAEH,MAAM,QAAQ,GAAG,IAAI,2BAAQ,EAAE,CAAC;gBAChC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpC,QAAQ,CAAC,MAAM,GAAG,6BAAU,CAAC,MAAM,CAAC;gBACpC,QAAQ,CAAC,WAAW,GAAG,2BAA2B,CAAC;gBACnD,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAClC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;gBACtC,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAChD,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAE7D,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBAEzD,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;KAAA;;AArIH,gDAsIC;AA3GkB,8BAAW,GAAG,IAAI,6DAA4B,EAAE,AAArC,CAAsC"}
@@ -1,8 +0,0 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import { AgreementSignatureModel } from '../../models/agreement-signature.entity';
3
- export declare class AgreementSignatureRepository extends RepositoryBase<AgreementSignatureModel> implements IRepositoryBase<AgreementSignatureModel> {
4
- constructor();
5
- findByPk(id: string, transaction?: any): Promise<AgreementSignatureModel | null>;
6
- delete(partyId: string, dbTransaction?: any): Promise<void>;
7
- findAndCountAll(options?: any): Promise<any>;
8
- }
@@ -1,68 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AgreementSignatureRepository = void 0;
13
- const general_1 = require("@tomei/general");
14
- const agreement_signature_entity_1 = require("../../models/agreement-signature.entity");
15
- class AgreementSignatureRepository extends general_1.RepositoryBase {
16
- constructor() {
17
- super(agreement_signature_entity_1.AgreementSignatureModel);
18
- }
19
- findByPk(id, transaction) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- const result = yield agreement_signature_entity_1.AgreementSignatureModel.findByPk(id, {
23
- transaction: transaction,
24
- });
25
- return result;
26
- }
27
- catch (error) {
28
- throw new Error(`An Error occured when fetching : ${error.message}`);
29
- }
30
- });
31
- }
32
- delete(partyId, dbTransaction) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- try {
35
- const options = {
36
- where: {
37
- PartyId: partyId,
38
- },
39
- transaction: dbTransaction,
40
- };
41
- yield agreement_signature_entity_1.AgreementSignatureModel.destroy(options);
42
- }
43
- catch (error) {
44
- throw new Error(`An Error occured when delete : ${error.message}`);
45
- }
46
- });
47
- }
48
- findAndCountAll(options) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- try {
51
- let AgreementSignature;
52
- if (options) {
53
- AgreementSignature =
54
- yield agreement_signature_entity_1.AgreementSignatureModel.findAndCountAll(options);
55
- }
56
- else {
57
- AgreementSignature = yield agreement_signature_entity_1.AgreementSignatureModel.findAndCountAll();
58
- }
59
- return AgreementSignature;
60
- }
61
- catch (error) {
62
- throw new Error(`An Error occured when retriving : ${error.message}`);
63
- }
64
- });
65
- }
66
- }
67
- exports.AgreementSignatureRepository = AgreementSignatureRepository;
68
- //# sourceMappingURL=agreement-signature.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agreement-signature.repository.js","sourceRoot":"","sources":["../../../../src/components/agreement-signature/agreement-signature.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAiE;AACjE,wFAAkF;AAElF,MAAa,4BACX,SAAQ,wBAAuC;IAG/C;QACE,KAAK,CAAC,oDAAuB,CAAC,CAAC;IACjC,CAAC;IAEK,QAAQ,CACZ,EAAU,EACV,WAAiB;;YAEjB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,oDAAuB,CAAC,QAAQ,CAAC,EAAE,EAAE;oBACxD,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;KAAA;IAEK,MAAM,CAAC,OAAe,EAAE,aAAmB;;YAC/C,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,OAAO;qBACjB;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,oDAAuB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;KAAA;IAEK,eAAe,CAAC,OAAa;;YACjC,IAAI,CAAC;gBACH,IAAI,kBAAuB,CAAC;gBAC5B,IAAI,OAAO,EAAE,CAAC;oBACZ,kBAAkB;wBAChB,MAAM,oDAAuB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC3D,CAAC;qBAAM,CAAC;oBACN,kBAAkB,GAAG,MAAM,oDAAuB,CAAC,eAAe,EAAE,CAAC;gBACvE,CAAC;gBACD,OAAO,kBAAkB,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;KAAA;CACF;AAnDD,oEAmDC"}
@@ -1,46 +0,0 @@
1
- import { ObjectBase } from '@tomei/general';
2
- import { BookingStatusEnum } from '../../enum/booking.enum';
3
- import { IBookingAttr } from '../../interfaces/booking-attr.interface';
4
- import { BookingRepository } from './booking.repository';
5
- import { LoginUser } from '@tomei/sso';
6
- import { RentalPrice } from '../rental-price/rental-price';
7
- import { WhereOptions } from 'sequelize';
8
- import { IBookingFindAllSearchAttr } from '../../interfaces/booking-find-all-search-attr.interface';
9
- export declare class Booking extends ObjectBase {
10
- ObjectId: string;
11
- ObjectName: string;
12
- ObjectType: string;
13
- TableName: string;
14
- CustomerId: string;
15
- CustomerType: string;
16
- ItemId: string;
17
- ItemType: string;
18
- PriceId: string;
19
- protected _ScheduledStartDateTime: Date;
20
- protected _ScheduledEndDateTime: Date;
21
- BookingFee: number;
22
- Status: BookingStatusEnum;
23
- CancelRemarks: string;
24
- protected _CreatedById: string;
25
- protected _CreatedAt: Date;
26
- protected _UpdatedById: string;
27
- protected _UpdatedAt: Date;
28
- protected static _Repo: BookingRepository;
29
- get BookingNo(): string;
30
- set BookingNo(value: string);
31
- get CreatedById(): string;
32
- get CreatedAt(): Date;
33
- get UpdatedById(): string;
34
- get UpdatedAt(): Date;
35
- get ScheduledStartDateTime(): Date;
36
- get ScheduledEndDateTime(): Date;
37
- setScheduledStartDateTime(datetime: Date): Promise<void>;
38
- setScheduledEndDateTime(datetime: Date): Promise<void>;
39
- protected constructor(bookingAttr?: IBookingAttr);
40
- static init(dbTransaction?: any, bookingNo?: string): Promise<Booking>;
41
- create(dbTransaction: any, loginUser: LoginUser, rentalPrice: RentalPrice): Promise<this>;
42
- static isBookingItemAvailable(dbTransaction: any, itemId: string, itemType: string, startDateTime: Date, endDateTime: Date): Promise<boolean>;
43
- static findAll(dbTransaction: any, page?: number, row?: number, search?: IBookingFindAllSearchAttr): Promise<any>;
44
- static findOne(loginUser: LoginUser, dbTransaction: any, searchOptions: WhereOptions): Promise<Booking>;
45
- static updateLeadToCustomer(loginUser: LoginUser, dbTransaction: any, LeadId: string, CustomerId: string): Promise<void>;
46
- }