@driveup/schema 0.2.6 → 0.2.9

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 (220) hide show
  1. package/lib/catalog/addon/addon.entity.d.ts +3 -3
  2. package/lib/catalog/addon/addon.entity.js +7 -7
  3. package/lib/catalog/addon/addon.entity.js.map +1 -1
  4. package/lib/catalog/addon/country.entity.d.ts +4 -4
  5. package/lib/catalog/addon/country.entity.js +5 -6
  6. package/lib/catalog/addon/country.entity.js.map +1 -1
  7. package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
  8. package/lib/catalog/priceplan/priceplan.entity.js +14 -7
  9. package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
  10. package/lib/catalog/product/country.entity.d.ts +6 -6
  11. package/lib/catalog/product/country.entity.js +9 -10
  12. package/lib/catalog/product/country.entity.js.map +1 -1
  13. package/lib/catalog/product/priceplan.entity.d.ts +9 -4
  14. package/lib/catalog/product/priceplan.entity.js +19 -9
  15. package/lib/catalog/product/priceplan.entity.js.map +1 -1
  16. package/lib/catalog/product/product.entity.d.ts +3 -3
  17. package/lib/catalog/product/product.entity.js +8 -8
  18. package/lib/catalog/product/product.entity.js.map +1 -1
  19. package/lib/catalog/program/program.entity.d.ts +2 -2
  20. package/lib/catalog/program/program.entity.js +7 -7
  21. package/lib/catalog/program/program.entity.js.map +1 -1
  22. package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
  23. package/lib/catalog/seed/assets/asset.entity.js +6 -6
  24. package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
  25. package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
  26. package/lib/catalog/seed/courses/course.entity.js +9 -9
  27. package/lib/catalog/seed/courses/course.entity.js.map +1 -1
  28. package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
  29. package/lib/catalog/seed/courses/lesson.entity.js +7 -7
  30. package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
  31. package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
  32. package/lib/catalog/seed/courses/topic.entity.js +8 -8
  33. package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
  34. package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
  35. package/lib/catalog/seed/expense/category.entity.js +6 -6
  36. package/lib/catalog/seed/expense/category.entity.js.map +1 -1
  37. package/lib/index.d.ts +2 -2
  38. package/lib/index.js +2 -2
  39. package/lib/index.js.map +1 -1
  40. package/lib/profile/agent/agent.entity.d.ts +13 -4
  41. package/lib/profile/agent/agent.entity.js +46 -20
  42. package/lib/profile/agent/agent.entity.js.map +1 -1
  43. package/lib/profile/agent/asset.entity.d.ts +1 -1
  44. package/lib/profile/agent/asset.entity.js +2 -2
  45. package/lib/profile/agent/asset.entity.js.map +1 -1
  46. package/lib/profile/agent/payout.entity.d.ts +3 -3
  47. package/lib/profile/agent/payout.entity.js +6 -6
  48. package/lib/profile/agent/payout.entity.js.map +1 -1
  49. package/lib/profile/agent/promotion.entity.d.ts +3 -3
  50. package/lib/profile/agent/promotion.entity.js +6 -6
  51. package/lib/profile/agent/promotion.entity.js.map +1 -1
  52. package/lib/profile/company/company.entity.d.ts +80 -9
  53. package/lib/profile/company/company.entity.js +246 -36
  54. package/lib/profile/company/company.entity.js.map +1 -1
  55. package/lib/profile/company/course/appointment.entity.d.ts +73 -4
  56. package/lib/profile/company/course/appointment.entity.js +247 -0
  57. package/lib/profile/company/course/appointment.entity.js.map +1 -1
  58. package/lib/profile/company/course/course.entity.d.ts +41 -8
  59. package/lib/profile/company/course/course.entity.js +58 -12
  60. package/lib/profile/company/course/course.entity.js.map +1 -1
  61. package/lib/profile/company/course/lesson.entity.d.ts +30 -7
  62. package/lib/profile/company/course/lesson.entity.js +93 -12
  63. package/lib/profile/company/course/lesson.entity.js.map +1 -1
  64. package/lib/profile/company/course/schedule.entity.d.ts +276 -0
  65. package/lib/profile/company/course/schedule.entity.js +744 -0
  66. package/lib/profile/company/course/schedule.entity.js.map +1 -0
  67. package/lib/profile/company/course/topic.entity.d.ts +9 -4
  68. package/lib/profile/company/course/topic.entity.js +14 -7
  69. package/lib/profile/company/course/topic.entity.js.map +1 -1
  70. package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
  71. package/lib/profile/company/finances/billing/bill.entity.js +38 -4
  72. package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
  73. package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
  74. package/lib/profile/company/finances/billing/item.entity.js +10 -6
  75. package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
  76. package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
  77. package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
  78. package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
  79. package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
  80. package/lib/profile/company/finances/expense/category.entity.js +4 -4
  81. package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
  82. package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
  83. package/lib/profile/company/finances/expense/expense.entity.js +32 -4
  84. package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
  85. package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
  86. package/lib/profile/company/finances/handover/handover.entity.js +6 -6
  87. package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
  88. package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
  89. package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
  90. package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
  91. package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
  92. package/lib/profile/company/finances/invoice/item.entity.js +4 -4
  93. package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
  94. package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
  95. package/lib/profile/company/finances/payment/method.entity.js +40 -5
  96. package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
  97. package/lib/profile/company/instructor/activity.entity.js.map +1 -1
  98. package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
  99. package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
  100. package/lib/profile/company/instructor/instructor.entity.js +143 -25
  101. package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
  102. package/lib/profile/company/instructor/task.entity.d.ts +2 -1
  103. package/lib/profile/company/instructor/task.entity.js +9 -4
  104. package/lib/profile/company/instructor/task.entity.js.map +1 -1
  105. package/lib/profile/company/medical/examination.entity.d.ts +4 -4
  106. package/lib/profile/company/medical/examination.entity.js +6 -6
  107. package/lib/profile/company/medical/examination.entity.js.map +1 -1
  108. package/lib/profile/company/medical/product.entity.d.ts +4 -5
  109. package/lib/profile/company/medical/product.entity.js +13 -14
  110. package/lib/profile/company/medical/product.entity.js.map +1 -1
  111. package/lib/profile/company/product/addon.entity.d.ts +3 -3
  112. package/lib/profile/company/product/addon.entity.js +6 -7
  113. package/lib/profile/company/product/addon.entity.js.map +1 -1
  114. package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
  115. package/lib/profile/company/product/priceplan.entity.js +20 -16
  116. package/lib/profile/company/product/priceplan.entity.js.map +1 -1
  117. package/lib/profile/company/product/product.entity.d.ts +34 -8
  118. package/lib/profile/company/product/product.entity.js +70 -12
  119. package/lib/profile/company/product/product.entity.js.map +1 -1
  120. package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
  121. package/lib/profile/company/product/vehicle.entity.js +4 -4
  122. package/lib/profile/company/product/vehicle.entity.js.map +1 -1
  123. package/lib/profile/instructor/instructor.entity.d.ts +6 -3
  124. package/lib/profile/instructor/instructor.entity.js +31 -9
  125. package/lib/profile/instructor/instructor.entity.js.map +1 -1
  126. package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
  127. package/lib/profile/student/program/licence/licence.entity.js +19 -8
  128. package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
  129. package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
  130. package/lib/profile/student/program/medical/certificate.entity.js +6 -6
  131. package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
  132. package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
  133. package/lib/profile/student/program/medical/examination.entity.js +14 -14
  134. package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
  135. package/lib/profile/student/program/program.entity.d.ts +4 -4
  136. package/lib/profile/student/program/program.entity.js +8 -13
  137. package/lib/profile/student/program/program.entity.js.map +1 -1
  138. package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
  139. package/lib/profile/student/program/training/appointment.entity.js +144 -21
  140. package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
  141. package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
  142. package/lib/profile/student/program/training/exam.entity.js +28 -12
  143. package/lib/profile/student/program/training/exam.entity.js.map +1 -1
  144. package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
  145. package/lib/profile/student/program/training/lesson.entity.js +28 -6
  146. package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
  147. package/lib/profile/student/program/training/request.entity.d.ts +6 -3
  148. package/lib/profile/student/program/training/request.entity.js +26 -5
  149. package/lib/profile/student/program/training/request.entity.js.map +1 -1
  150. package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
  151. package/lib/profile/student/program/training/topic.entity.js +36 -9
  152. package/lib/profile/student/program/training/topic.entity.js.map +1 -1
  153. package/lib/profile/student/program/training/training.entity.d.ts +50 -6
  154. package/lib/profile/student/program/training/training.entity.js +217 -33
  155. package/lib/profile/student/program/training/training.entity.js.map +1 -1
  156. package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
  157. package/lib/profile/student/program/training/transaction.entity.js +43 -6
  158. package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
  159. package/lib/profile/student/student.entity.d.ts +11 -6
  160. package/lib/profile/student/student.entity.js +59 -11
  161. package/lib/profile/student/student.entity.js.map +1 -1
  162. package/lib/system/campaign/campaign.entity.d.ts +4 -4
  163. package/lib/system/campaign/campaign.entity.js +10 -10
  164. package/lib/system/campaign/campaign.entity.js.map +1 -1
  165. package/lib/system/campaign/gifcode.entity.d.ts +4 -4
  166. package/lib/system/campaign/gifcode.entity.js +8 -8
  167. package/lib/system/campaign/gifcode.entity.js.map +1 -1
  168. package/lib/system/country/country.entity.d.ts +8 -6
  169. package/lib/system/country/country.entity.js +15 -9
  170. package/lib/system/country/country.entity.js.map +1 -1
  171. package/lib/system/currency/currency.entity.d.ts +1 -1
  172. package/lib/system/currency/currency.entity.js +4 -4
  173. package/lib/system/currency/currency.entity.js.map +1 -1
  174. package/lib/system/driving/category.entity.d.ts +7 -7
  175. package/lib/system/driving/category.entity.js +14 -14
  176. package/lib/system/driving/category.entity.js.map +1 -1
  177. package/lib/system/driving/vehicle.entity.d.ts +2 -2
  178. package/lib/system/driving/vehicle.entity.js +4 -4
  179. package/lib/system/driving/vehicle.entity.js.map +1 -1
  180. package/lib/system/event/event.entity.d.ts +2 -2
  181. package/lib/system/event/event.entity.js +4 -4
  182. package/lib/system/event/event.entity.js.map +1 -1
  183. package/lib/system/event/log.entity.d.ts +2 -2
  184. package/lib/system/event/log.entity.js +3 -3
  185. package/lib/system/event/log.entity.js.map +1 -1
  186. package/lib/system/ical/ical.entity.d.ts +63 -0
  187. package/lib/system/ical/ical.entity.js +70 -0
  188. package/lib/system/ical/ical.entity.js.map +1 -0
  189. package/lib/system/policy/policy.entity.d.ts +2 -2
  190. package/lib/system/policy/policy.entity.js +8 -8
  191. package/lib/system/policy/policy.entity.js.map +1 -1
  192. package/lib/system/staff/staff.entity.d.ts +1 -1
  193. package/lib/system/staff/staff.entity.js +5 -4
  194. package/lib/system/staff/staff.entity.js.map +1 -1
  195. package/lib/tsconfig.tsbuildinfo +1 -1
  196. package/lib/user/alert.entity.d.ts +4 -3
  197. package/lib/user/alert.entity.js +11 -4
  198. package/lib/user/alert.entity.js.map +1 -1
  199. package/lib/user/blocked.entity.js +2 -2
  200. package/lib/user/blocked.entity.js.map +1 -1
  201. package/lib/user/device.entity.d.ts +17 -2
  202. package/lib/user/device.entity.js +29 -3
  203. package/lib/user/device.entity.js.map +1 -1
  204. package/lib/user/notification.entity.d.ts +3 -3
  205. package/lib/user/notification.entity.js +8 -8
  206. package/lib/user/notification.entity.js.map +1 -1
  207. package/lib/user/ticket.entity.d.ts +8 -3
  208. package/lib/user/ticket.entity.js +16 -7
  209. package/lib/user/ticket.entity.js.map +1 -1
  210. package/lib/user/user.entity.d.ts +101 -89
  211. package/lib/user/user.entity.js +272 -270
  212. package/lib/user/user.entity.js.map +1 -1
  213. package/lib/user/verification.entity.js +2 -2
  214. package/lib/user/verification.entity.js.map +1 -1
  215. package/lib/utils/activity.helper.d.ts +2 -2
  216. package/lib/utils/activity.helper.js.map +1 -1
  217. package/lib/utils/trackable.d.ts +13 -2
  218. package/lib/utils/trackable.js +55 -0
  219. package/lib/utils/trackable.js.map +1 -1
  220. package/package.json +3 -3
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AgentAssetEntity = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const shared_1 = require("@driveup/shared");
15
13
  const common_1 = require("@driveup/common");
14
+ const shared_1 = require("@driveup/shared");
15
+ const typeorm_1 = require("typeorm");
16
16
  const trackable_1 = require("../../utils/trackable");
17
17
  const agent_entity_1 = require("./agent.entity");
18
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"asset.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,4CAA4C;AAC5C,4CAAkD;AAClD,qDAAwD;AACxD,iDAA6C;AAE7C;;;;;;;GAOG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAsB;IA4C3D;;;OAGG;IACH,YAAY,KAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,OAAO;QACN,sCAAsC;QACtC,OAAO,IAAI,cAAK,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,sCAAsC;QACtC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QAClB,sCAAsC;QACtC,MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAhFY,4CAAgB;AAM5B;IADC,IAAA,gBAAM,GAAE;;iDACO;AAahB;IAPC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,kBAAS;QACf,OAAO,EAAE,kBAAS,CAAC,KAAK;QACxB,QAAQ,EAAE,KAAK;KACf,CAAC;;8CACc;AAUhB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAK;KACd,CAAC;;+CACY;AAOd;IADC,IAAA,gBAAM,GAAE;;6CACG;AAMZ;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;;+CACzB;2BA1Cf,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CAgF5B"}
1
+ {"version":3,"file":"asset.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAkD;AAClD,4CAA4C;AAC5C,qCAAoD;AAEpD,qDAAwD;AACxD,iDAA6C;AAE7C;;;;;;;GAOG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,2BAAsB;IA4C3D;;;OAGG;IACH,YAAY,KAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,OAAO;QACN,sCAAsC;QACtC,OAAO,IAAI,cAAK,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,SAAS;QACR,sCAAsC;QACtC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QAClB,sCAAsC;QACtC,MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAhFY,4CAAgB;AAM5B;IADC,IAAA,gBAAM,GAAE;;iDACO;AAahB;IAPC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,kBAAS;QACf,OAAO,EAAE,kBAAS,CAAC,KAAK;QACxB,QAAQ,EAAE,KAAK;KACf,CAAC;;8CACc;AAUhB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAK;KACd,CAAC;;+CACY;AAOd;IADC,IAAA,gBAAM,GAAE;;6CACG;AAMZ;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;;+CACzB;2BA1Cf,gBAAgB;IAD5B,IAAA,gBAAM,EAAC,aAAa,CAAC;;GACT,gBAAgB,CAgF5B"}
@@ -1,8 +1,8 @@
1
- import { StatusType } from '@driveup/shared';
2
- import { Activity, BankAccount, Payout } from '@driveup/common';
1
+ import { Activity, Payout } from '@driveup/common';
2
+ import { BankAccount, StatusType } from '@driveup/shared';
3
+ import { TrackableEntity } from '../../utils/trackable';
3
4
  import { AgentEntity } from './agent.entity';
4
5
  import { AgentPromotionEntity } from './promotion.entity';
5
- import { TrackableEntity } from '../../utils/trackable';
6
6
  /**
7
7
  * Represents a payout to an agent for their earned commissions.
8
8
  * Payouts aggregate multiple promotions and track the payment status,
@@ -10,14 +10,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AgentPayoutEntity = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const shared_1 = require("@driveup/shared");
15
13
  const common_1 = require("@driveup/common");
14
+ const shared_1 = require("@driveup/shared");
15
+ const typeorm_1 = require("typeorm");
16
16
  const staff_entity_1 = require("../../system/staff/staff.entity");
17
+ const activity_helper_1 = require("../../utils/activity.helper");
18
+ const trackable_1 = require("../../utils/trackable");
17
19
  const agent_entity_1 = require("./agent.entity");
18
20
  const promotion_entity_1 = require("./promotion.entity");
19
- const trackable_1 = require("../../utils/trackable");
20
- const activity_helper_1 = require("../../utils/activity.helper");
21
21
  /**
22
22
  * Represents a payout to an agent for their earned commissions.
23
23
  * Payouts aggregate multiple promotions and track the payment status,
@@ -43,7 +43,7 @@ let AgentPayoutEntity = class AgentPayoutEntity extends trackable_1.TrackableEnt
43
43
  id: this.id,
44
44
  status: this.status,
45
45
  amount: this.amount,
46
- bankAccount: common_1.BankAccount.toInstance(this.bankAccount)
46
+ bankAccount: shared_1.BankAccount.toInstance(this.bankAccount)
47
47
  });
48
48
  }
49
49
  /**
@@ -99,7 +99,7 @@ __decorate([
99
99
  nullable: true,
100
100
  default: null
101
101
  }),
102
- __metadata("design:type", common_1.BankAccount)
102
+ __metadata("design:type", shared_1.BankAccount)
103
103
  ], AgentPayoutEntity.prototype, "bankAccount", void 0);
104
104
  __decorate([
105
105
  (0, typeorm_1.Column)({ nullable: true, default: null }),
@@ -1 +1 @@
1
- {"version":3,"file":"payout.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/payout.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+D;AAC/D,4CAA2D;AAC3D,4CAAgE;AAChE,kEAA8D;AAC9D,iDAA6C;AAC7C,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ACjB;QACD,OAAO,EAAE,mBAAU,CAAC,OAAO;QAC3B,QAAQ,EAAE,KAAK;KACf,CAAC;;iDACiB;AAcnB;IAPC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,KAAK;KACf,CAAC;;iDACa;AAUf;IALC,IAAA,gBAAM,EAAC;QACP,IAAI,EAAE,aAAa;QACnB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;8BACW,oBAAW;sDAAC;AAMzB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAClC,IAAI;iDAAC;AAMb;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAMf;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;gDACzB;AAM5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAoB,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;qDACzB;4BAtEhC,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,cAAc,CAAC;;GACV,iBAAiB,CAiH7B"}
@@ -1,9 +1,9 @@
1
1
  import { Activity, PayoutItem } from '@driveup/common';
2
- import { AgentEntity } from './agent.entity';
3
- import { AgentPayoutEntity } from './payout.entity';
2
+ import { TrackableEntity } from '../../utils/trackable';
4
3
  import { CompanyEntity } from '../company/company.entity';
5
4
  import { CompanyBillTransactionEntity } from '../company/finances/billing/transaction.entity';
6
- import { TrackableEntity } from '../../utils/trackable';
5
+ import { AgentEntity } from './agent.entity';
6
+ import { AgentPayoutEntity } from './payout.entity';
7
7
  /**
8
8
  * Represents a promotion generated by an agent.
9
9
  * Tracks the relationship between an agent, a referred company, and the
@@ -10,15 +10,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AgentPromotionEntity = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const shared_1 = require("@driveup/shared");
15
13
  const common_1 = require("@driveup/common");
16
- const agent_entity_1 = require("./agent.entity");
17
- const payout_entity_1 = require("./payout.entity");
14
+ const shared_1 = require("@driveup/shared");
15
+ const typeorm_1 = require("typeorm");
16
+ const activity_helper_1 = require("../../utils/activity.helper");
17
+ const trackable_1 = require("../../utils/trackable");
18
18
  const company_entity_1 = require("../company/company.entity");
19
19
  const transaction_entity_1 = require("../company/finances/billing/transaction.entity");
20
- const trackable_1 = require("../../utils/trackable");
21
- const activity_helper_1 = require("../../utils/activity.helper");
20
+ const agent_entity_1 = require("./agent.entity");
21
+ const payout_entity_1 = require("./payout.entity");
22
22
  /**
23
23
  * Represents a promotion generated by an agent.
24
24
  * Tracks the relationship between an agent, a referred company, and the
@@ -1 +1 @@
1
- {"version":3,"file":"promotion.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/promotion.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAC1E,4CAA+C;AAC/C,4CAA+D;AAC/D,iDAA6C;AAC7C,mDAAoD;AACpD,8DAA0D;AAC1D,uFAA8F;AAC9F,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;GAMG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,2BAA2B;IA6EpE;;;OAGG;IACH,YAAY,KAAqC;QAChD,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,OAAO,IAAI,mBAAU,CAAC;YACrB,EAAE,EAAE,IAAI,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IAAI,EAAE,OAAO,EAAE,IAAI,EAAG,CAAC;8BAChC,IAAI;uDAAC;AAMhB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BACjC,IAAI;qDAAC;AAMd;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;;mDAC5B;AAM5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC;;qDACnC;AAOhC;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iCAAiB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC;;oDAC7B;AAOnC;IAFC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,iDAA4B,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC;IACvF,IAAA,oBAAU,GAAE;;yDACsC;+BA3EvC,oBAAoB;IADhC,IAAA,gBAAM,EAAC,iBAAiB,CAAC;;GACb,oBAAoB,CAyHhC"}
@@ -1,18 +1,19 @@
1
- import { AccountStatus, Language, AddonType } from '@driveup/shared';
2
- import { Company, Activity, WorkingHours, Holiday, Address } from '@driveup/common';
3
- import { BankAccount, Tax, Link, Customer, Preference } from '@driveup/common';
1
+ import { Activity, Company } from '@driveup/common';
2
+ import { Address, BankAccount, Holiday, Link, Period, Person, Preference, Tax, WorkingHours } from '@driveup/shared';
3
+ import { AccountStatus, AddonType, Language, PreferenceScope } from '@driveup/shared';
4
+ import { EntityManager } from 'typeorm';
4
5
  import { CountryEntity } from '../../system/country/country.entity';
5
- import { CompanyExpenseEntity } from './finances/expense/expense.entity';
6
+ import { TrackableEntity } from '../../utils/trackable';
7
+ import { AgentPromotionEntity } from '../agent/promotion.entity';
8
+ import { CompanyBillEntity } from './finances/billing/bill.entity';
6
9
  import { CompanyExpenseCategoryEntity } from './finances/expense/category.entity';
10
+ import { CompanyExpenseEntity } from './finances/expense/expense.entity';
7
11
  import { CompanyHandoverEntity } from './finances/handover/handover.entity';
8
12
  import { CompanyInvoiceEntity } from './finances/invoice/invoice.entity';
9
13
  import { CompanyPaymentMethodEntity } from './finances/payment/method.entity';
10
- import { CompanyBillEntity } from './finances/billing/bill.entity';
11
- import { CompanyProductEntity } from './product/product.entity';
12
14
  import { CompanyInstructorEntity } from './instructor/instructor.entity';
13
- import { AgentPromotionEntity } from '../agent/promotion.entity';
14
- import { TrackableEntity } from '../../utils/trackable';
15
15
  import { CompanyAddonEntity } from './product/addon.entity';
16
+ import { CompanyProductEntity } from './product/product.entity';
16
17
  /**
17
18
  * Represents a driving school company in the system.
18
19
  * Companies offer training products, manage instructors and students,
@@ -106,10 +107,26 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
106
107
  * Can be used by payments if company product credit is not enough
107
108
  */
108
109
  credit: number;
110
+ /**
111
+ * Temprary field
112
+ * Company balance
113
+ */
114
+ balance: number;
115
+ /**
116
+ * Temprary field
117
+ * Number of free benefits (free trainings) the company has
118
+ */
119
+ freeBenefits: number;
109
120
  /**
110
121
  * Tax configuration for invoicing
111
122
  */
112
123
  tax: Tax;
124
+ /**
125
+ * The obligation period set by the company. If the students cancel their driving appointments outside of this period, they will not be charged for the session
126
+ *
127
+ * Calculated in number of hours
128
+ */
129
+ obligationPeriod: number;
113
130
  /**
114
131
  * Weekly working hours schedule
115
132
  */
@@ -195,7 +212,7 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
195
212
  * Converts the entity to a Customer model for invoicing purposes
196
213
  * @returns Customer model with company information
197
214
  */
198
- toCustomer(): Customer;
215
+ toCustomer(): Person;
199
216
  /**
200
217
  * Retrieves the owner of this company
201
218
  * @returns Promise resolving to the CompanyInstructorEntity with Owner role
@@ -228,6 +245,28 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
228
245
  * @returns Formatted address string with location, address, and zip code
229
246
  */
230
247
  getFullAddress(): string;
248
+ /**
249
+ * Retrieves the active payment method for the company
250
+ * @returns CompanyPaymentMethodEntity - the active company payment method
251
+ */
252
+ getActivePaymentMethod(): Promise<CompanyPaymentMethodEntity>;
253
+ /**
254
+ * Retrieves the active payment method for the company
255
+ * @returns CompanyPaymentMethodEntity - the active company payment method
256
+ */
257
+ getPendingPaymentMethod(): Promise<CompanyPaymentMethodEntity>;
258
+ /**
259
+ * Finds if there are any failed payments (unpaid bills) for the company
260
+ */
261
+ hasFailedTransactions(): Promise<boolean>;
262
+ getHolidays(period: Period): Holiday[];
263
+ /**
264
+ * Check if a given period collides with any of the company's holidays
265
+ * @param Period
266
+ * @returns boolean - true if the period collides with any of the company's holidays
267
+ */
268
+ collidesWithHolidays(period: Period): boolean;
269
+ getNonWorkingHours(period: Period): Period[];
231
270
  /**
232
271
  * Retrieves activity history for this company
233
272
  * @returns Promise resolving to array of Activity instances tracking creation, updates, and closure
@@ -240,4 +279,36 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
240
279
  */
241
280
  log(event: string, metadata?: any): Promise<void>;
242
281
  getAddonByType(type: AddonType): Promise<CompanyAddonEntity>;
282
+ getPreferences(): Preference<boolean>[];
283
+ setPreference(name: string, value: any, scope: PreferenceScope): Promise<Preference<boolean>[]>;
284
+ removePreference(name: string): Promise<Preference<boolean>[]>;
285
+ /**
286
+ * Get the one company bill with the status "open"
287
+ */
288
+ getCurrentBill(manager?: EntityManager): Promise<CompanyBillEntity>;
289
+ /**
290
+ * Checks if there are any company bills with the status "unpaid"
291
+ */
292
+ hasUnpaidBills(): Promise<boolean>;
293
+ /**
294
+ * Gets all unpaid bills of the company, INCLUDING current month's bill
295
+ * @returns CompanyBillEntity[] - All bills that are active, or have not been paid yet (both current month's bill and bill for which the payment has failed)
296
+ */
297
+ getUnpaidBills(): Promise<CompanyBillEntity[]>;
298
+ /**
299
+ * Gets the total amount of unpaid bills subTotalPrice (sum of all unpaid bills' subTotalPrice)
300
+ * @param manager EntityManager - Used with transactions to ensure data integrity
301
+ * @returns number - Total amount of unpaid bills
302
+ */
303
+ getTotalUnpaidAmount(manager?: EntityManager): Promise<number>;
304
+ /**
305
+ * * Remaining company credit calculation steps
306
+ * 1. Get all unpaid bills (bills which are active or unpaid)
307
+ * 2. If there are no unpaid bills (which is frankly impossible), remainingCredit = company.credit
308
+ * 3. Sum the subtotal prices of all unpaid bills to get totalUnpaidAmount
309
+ * 4. If company credit is less than totalUnpaidAmount, remainingCredit is 0
310
+ * 5. Otherwise, remainingCredit = company.credit - totalUnpaidAmount
311
+ * @returns number - Remaining company credit
312
+ */
313
+ getRemainingCredit(manager?: EntityManager): Promise<number>;
243
314
  }