@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.
- package/lib/catalog/addon/addon.entity.d.ts +3 -3
- package/lib/catalog/addon/addon.entity.js +7 -7
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +4 -4
- package/lib/catalog/addon/country.entity.js +5 -6
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.d.ts +8 -3
- package/lib/catalog/priceplan/priceplan.entity.js +14 -7
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.d.ts +6 -6
- package/lib/catalog/product/country.entity.js +9 -10
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.d.ts +9 -4
- package/lib/catalog/product/priceplan.entity.js +19 -9
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.d.ts +3 -3
- package/lib/catalog/product/product.entity.js +8 -8
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.d.ts +2 -2
- package/lib/catalog/program/program.entity.js +7 -7
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.d.ts +2 -2
- package/lib/catalog/seed/assets/asset.entity.js +6 -6
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.d.ts +4 -4
- package/lib/catalog/seed/courses/course.entity.js +9 -9
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/lesson.entity.js +7 -7
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.d.ts +3 -3
- package/lib/catalog/seed/courses/topic.entity.js +8 -8
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.d.ts +2 -2
- package/lib/catalog/seed/expense/category.entity.js +6 -6
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +13 -4
- package/lib/profile/agent/agent.entity.js +46 -20
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/asset.entity.d.ts +1 -1
- package/lib/profile/agent/asset.entity.js +2 -2
- package/lib/profile/agent/asset.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.d.ts +3 -3
- package/lib/profile/agent/payout.entity.js +6 -6
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.d.ts +3 -3
- package/lib/profile/agent/promotion.entity.js +6 -6
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +80 -9
- package/lib/profile/company/company.entity.js +246 -36
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +73 -4
- package/lib/profile/company/course/appointment.entity.js +247 -0
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +41 -8
- package/lib/profile/company/course/course.entity.js +58 -12
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +30 -7
- package/lib/profile/company/course/lesson.entity.js +93 -12
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/schedule.entity.d.ts +276 -0
- package/lib/profile/company/course/schedule.entity.js +744 -0
- package/lib/profile/company/course/schedule.entity.js.map +1 -0
- package/lib/profile/company/course/topic.entity.d.ts +9 -4
- package/lib/profile/company/course/topic.entity.js +14 -7
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.d.ts +9 -2
- package/lib/profile/company/finances/billing/bill.entity.js +38 -4
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +8 -3
- package/lib/profile/company/finances/billing/item.entity.js +10 -6
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.d.ts +7 -5
- package/lib/profile/company/finances/billing/transaction.entity.js +6 -6
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.d.ts +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +4 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.d.ts +6 -2
- package/lib/profile/company/finances/expense/expense.entity.js +32 -4
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.d.ts +3 -3
- package/lib/profile/company/finances/handover/handover.entity.js +6 -6
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.d.ts +8 -7
- package/lib/profile/company/finances/invoice/invoice.entity.js +15 -14
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/invoice/item.entity.js +4 -4
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.d.ts +24 -4
- package/lib/profile/company/finances/payment/method.entity.js +40 -5
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.js.map +1 -1
- package/lib/profile/company/instructor/calendar-state.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +34 -17
- package/lib/profile/company/instructor/instructor.entity.js +143 -25
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.d.ts +2 -1
- package/lib/profile/company/instructor/task.entity.js +9 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.d.ts +4 -4
- package/lib/profile/company/medical/examination.entity.js +6 -6
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.d.ts +4 -5
- package/lib/profile/company/medical/product.entity.js +13 -14
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +3 -3
- package/lib/profile/company/product/addon.entity.js +6 -7
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.d.ts +15 -13
- package/lib/profile/company/product/priceplan.entity.js +20 -16
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +34 -8
- package/lib/profile/company/product/product.entity.js +70 -12
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.d.ts +2 -2
- package/lib/profile/company/product/vehicle.entity.js +4 -4
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +6 -3
- package/lib/profile/instructor/instructor.entity.js +31 -9
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.d.ts +13 -5
- package/lib/profile/student/program/licence/licence.entity.js +19 -8
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.d.ts +3 -3
- package/lib/profile/student/program/medical/certificate.entity.js +6 -6
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.d.ts +4 -4
- package/lib/profile/student/program/medical/examination.entity.js +14 -14
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.d.ts +4 -4
- package/lib/profile/student/program/program.entity.js +8 -13
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +32 -9
- package/lib/profile/student/program/training/appointment.entity.js +144 -21
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.d.ts +9 -2
- package/lib/profile/student/program/training/exam.entity.js +28 -12
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.d.ts +8 -3
- package/lib/profile/student/program/training/lesson.entity.js +28 -6
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.d.ts +6 -3
- package/lib/profile/student/program/training/request.entity.js +26 -5
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.d.ts +16 -4
- package/lib/profile/student/program/training/topic.entity.js +36 -9
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +50 -6
- package/lib/profile/student/program/training/training.entity.js +217 -33
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.d.ts +8 -3
- package/lib/profile/student/program/training/transaction.entity.js +43 -6
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +11 -6
- package/lib/profile/student/student.entity.js +59 -11
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.d.ts +4 -4
- package/lib/system/campaign/campaign.entity.js +10 -10
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +4 -4
- package/lib/system/campaign/gifcode.entity.js +8 -8
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.d.ts +8 -6
- package/lib/system/country/country.entity.js +15 -9
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.d.ts +1 -1
- package/lib/system/currency/currency.entity.js +4 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.d.ts +7 -7
- package/lib/system/driving/category.entity.js +14 -14
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.d.ts +2 -2
- package/lib/system/driving/vehicle.entity.js +4 -4
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.d.ts +2 -2
- package/lib/system/event/event.entity.js +4 -4
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +2 -2
- package/lib/system/event/log.entity.js +3 -3
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/ical/ical.entity.d.ts +63 -0
- package/lib/system/ical/ical.entity.js +70 -0
- package/lib/system/ical/ical.entity.js.map +1 -0
- package/lib/system/policy/policy.entity.d.ts +2 -2
- package/lib/system/policy/policy.entity.js +8 -8
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.d.ts +1 -1
- package/lib/system/staff/staff.entity.js +5 -4
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.d.ts +4 -3
- package/lib/user/alert.entity.js +11 -4
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +2 -2
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.d.ts +17 -2
- package/lib/user/device.entity.js +29 -3
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.d.ts +3 -3
- package/lib/user/notification.entity.js +8 -8
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.d.ts +8 -3
- package/lib/user/ticket.entity.js +16 -7
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +101 -89
- package/lib/user/user.entity.js +272 -270
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +2 -2
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +2 -2
- package/lib/utils/activity.helper.js.map +1 -1
- package/lib/utils/trackable.d.ts +13 -2
- package/lib/utils/trackable.js +55 -0
- package/lib/utils/trackable.js.map +1 -1
- 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,
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
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",
|
|
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;
|
|
1
|
+
{"version":3,"file":"payout.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/payout.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAmD;AACnD,4CAAwE;AACxE,qCAA+D;AAE/D,kEAA8D;AAC9D,iEAAyD;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YACL,mBAAU,CAAC,OAAO;YAClB,mBAAU,CAAC,IAAI;YACf,mBAAU,CAAC,MAAM;SACjB;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 {
|
|
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 {
|
|
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
|
|
17
|
-
const
|
|
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
|
|
21
|
-
const
|
|
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,
|
|
1
|
+
{"version":3,"file":"promotion.entity.js","sourceRoot":"","sources":["../../../src/profile/agent/promotion.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA+D;AAC/D,4CAA+C;AAC/C,qCAA0E;AAE1E,iEAAyD;AACzD,qDAAwD;AACxD,8DAA0D;AAC1D,uFAA8F;AAC9F,iDAA6C;A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AMlB;IADC,IAAA,gBAAM,GAAE;;2DACa;AAUtB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;KACb,CAAC;;sDACe;AASjB;IAJC,IAAA,gBAAM,EAAC;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC;KACV,CAAC;;oDACa;AAMf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 {
|
|
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():
|
|
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
|
}
|