@driveup/schema 0.2.3 → 0.2.5
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.js +4 -8
- package/lib/catalog/addon/addon.entity.js.map +1 -1
- package/lib/catalog/addon/country.entity.d.ts +2 -2
- package/lib/catalog/addon/country.entity.js +6 -10
- package/lib/catalog/addon/country.entity.js.map +1 -1
- package/lib/catalog/priceplan/priceplan.entity.js +2 -4
- package/lib/catalog/priceplan/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/country.entity.js +4 -8
- package/lib/catalog/product/country.entity.js.map +1 -1
- package/lib/catalog/product/priceplan.entity.js +4 -8
- package/lib/catalog/product/priceplan.entity.js.map +1 -1
- package/lib/catalog/product/product.entity.js +4 -8
- package/lib/catalog/product/product.entity.js.map +1 -1
- package/lib/catalog/program/program.entity.js +4 -8
- package/lib/catalog/program/program.entity.js.map +1 -1
- package/lib/catalog/seed/assets/asset.entity.js +2 -4
- package/lib/catalog/seed/assets/asset.entity.js.map +1 -1
- package/lib/catalog/seed/courses/course.entity.js +2 -4
- package/lib/catalog/seed/courses/course.entity.js.map +1 -1
- package/lib/catalog/seed/courses/lesson.entity.js +2 -4
- package/lib/catalog/seed/courses/lesson.entity.js.map +1 -1
- package/lib/catalog/seed/courses/topic.entity.js +2 -4
- package/lib/catalog/seed/courses/topic.entity.js.map +1 -1
- package/lib/catalog/seed/expense/category.entity.js +2 -4
- package/lib/catalog/seed/expense/category.entity.js.map +1 -1
- package/lib/profile/agent/agent.entity.d.ts +2 -4
- package/lib/profile/agent/agent.entity.js +8 -12
- package/lib/profile/agent/agent.entity.js.map +1 -1
- package/lib/profile/agent/payout.entity.js +2 -4
- package/lib/profile/agent/payout.entity.js.map +1 -1
- package/lib/profile/agent/promotion.entity.js +2 -4
- package/lib/profile/agent/promotion.entity.js.map +1 -1
- package/lib/profile/company/company.entity.d.ts +5 -3
- package/lib/profile/company/company.entity.js +17 -12
- package/lib/profile/company/company.entity.js.map +1 -1
- package/lib/profile/company/course/appointment.entity.d.ts +96 -6
- package/lib/profile/company/course/appointment.entity.js +336 -29
- package/lib/profile/company/course/appointment.entity.js.map +1 -1
- package/lib/profile/company/course/course.entity.d.ts +5 -3
- package/lib/profile/company/course/course.entity.js +21 -28
- package/lib/profile/company/course/course.entity.js.map +1 -1
- package/lib/profile/company/course/lesson.entity.d.ts +11 -3
- package/lib/profile/company/course/lesson.entity.js +41 -10
- package/lib/profile/company/course/lesson.entity.js.map +1 -1
- package/lib/profile/company/course/topic.entity.d.ts +7 -0
- package/lib/profile/company/course/topic.entity.js +35 -6
- package/lib/profile/company/course/topic.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/bill.entity.js +2 -4
- package/lib/profile/company/finances/billing/bill.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/item.entity.d.ts +2 -2
- package/lib/profile/company/finances/billing/item.entity.js +3 -5
- package/lib/profile/company/finances/billing/item.entity.js.map +1 -1
- package/lib/profile/company/finances/billing/transaction.entity.js +3 -3
- package/lib/profile/company/finances/billing/transaction.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/category.entity.js +2 -4
- package/lib/profile/company/finances/expense/category.entity.js.map +1 -1
- package/lib/profile/company/finances/expense/expense.entity.js +4 -8
- package/lib/profile/company/finances/expense/expense.entity.js.map +1 -1
- package/lib/profile/company/finances/handover/handover.entity.js +1 -2
- package/lib/profile/company/finances/handover/handover.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/invoice.entity.js +5 -10
- package/lib/profile/company/finances/invoice/invoice.entity.js.map +1 -1
- package/lib/profile/company/finances/invoice/item.entity.js +2 -4
- package/lib/profile/company/finances/invoice/item.entity.js.map +1 -1
- package/lib/profile/company/finances/payment/method.entity.js +2 -4
- package/lib/profile/company/finances/payment/method.entity.js.map +1 -1
- package/lib/profile/company/instructor/activity.entity.d.ts +11 -1
- package/lib/profile/company/instructor/activity.entity.js +14 -0
- package/lib/profile/company/instructor/activity.entity.js.map +1 -1
- package/lib/profile/company/instructor/instructor.entity.d.ts +6 -7
- package/lib/profile/company/instructor/instructor.entity.js +26 -20
- package/lib/profile/company/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/company/instructor/task.entity.js +2 -4
- package/lib/profile/company/instructor/task.entity.js.map +1 -1
- package/lib/profile/company/medical/examination.entity.js +2 -4
- package/lib/profile/company/medical/examination.entity.js.map +1 -1
- package/lib/profile/company/medical/product.entity.js +2 -4
- package/lib/profile/company/medical/product.entity.js.map +1 -1
- package/lib/profile/company/product/addon.entity.d.ts +7 -8
- package/lib/profile/company/product/addon.entity.js +41 -38
- package/lib/profile/company/product/addon.entity.js.map +1 -1
- package/lib/profile/company/product/priceplan.entity.js +2 -4
- package/lib/profile/company/product/priceplan.entity.js.map +1 -1
- package/lib/profile/company/product/product.entity.d.ts +9 -3
- package/lib/profile/company/product/product.entity.js +29 -13
- package/lib/profile/company/product/product.entity.js.map +1 -1
- package/lib/profile/company/product/vehicle.entity.js +2 -4
- package/lib/profile/company/product/vehicle.entity.js.map +1 -1
- package/lib/profile/instructor/instructor.entity.d.ts +2 -4
- package/lib/profile/instructor/instructor.entity.js +8 -12
- package/lib/profile/instructor/instructor.entity.js.map +1 -1
- package/lib/profile/student/program/licence/licence.entity.js +2 -4
- package/lib/profile/student/program/licence/licence.entity.js.map +1 -1
- package/lib/profile/student/program/medical/certificate.entity.js +2 -4
- package/lib/profile/student/program/medical/certificate.entity.js.map +1 -1
- package/lib/profile/student/program/medical/examination.entity.js +2 -4
- package/lib/profile/student/program/medical/examination.entity.js.map +1 -1
- package/lib/profile/student/program/program.entity.js +6 -5
- package/lib/profile/student/program/program.entity.js.map +1 -1
- package/lib/profile/student/program/training/appointment.entity.d.ts +12 -8
- package/lib/profile/student/program/training/appointment.entity.js +21 -9
- package/lib/profile/student/program/training/appointment.entity.js.map +1 -1
- package/lib/profile/student/program/training/exam.entity.js +2 -4
- package/lib/profile/student/program/training/exam.entity.js.map +1 -1
- package/lib/profile/student/program/training/lesson.entity.js +2 -4
- package/lib/profile/student/program/training/lesson.entity.js.map +1 -1
- package/lib/profile/student/program/training/request.entity.js +4 -8
- package/lib/profile/student/program/training/request.entity.js.map +1 -1
- package/lib/profile/student/program/training/topic.entity.js +3 -6
- package/lib/profile/student/program/training/topic.entity.js.map +1 -1
- package/lib/profile/student/program/training/training.entity.d.ts +13 -1
- package/lib/profile/student/program/training/training.entity.js +27 -14
- package/lib/profile/student/program/training/training.entity.js.map +1 -1
- package/lib/profile/student/program/training/transaction.entity.js +2 -4
- package/lib/profile/student/program/training/transaction.entity.js.map +1 -1
- package/lib/profile/student/student.entity.d.ts +15 -4
- package/lib/profile/student/student.entity.js +44 -12
- package/lib/profile/student/student.entity.js.map +1 -1
- package/lib/system/campaign/campaign.entity.js +2 -4
- package/lib/system/campaign/campaign.entity.js.map +1 -1
- package/lib/system/campaign/gifcode.entity.d.ts +1 -1
- package/lib/system/campaign/gifcode.entity.js +4 -6
- package/lib/system/campaign/gifcode.entity.js.map +1 -1
- package/lib/system/country/country.entity.js +4 -8
- package/lib/system/country/country.entity.js.map +1 -1
- package/lib/system/currency/currency.entity.js +2 -4
- package/lib/system/currency/currency.entity.js.map +1 -1
- package/lib/system/driving/category.entity.js +4 -8
- package/lib/system/driving/category.entity.js.map +1 -1
- package/lib/system/driving/vehicle.entity.js +2 -4
- package/lib/system/driving/vehicle.entity.js.map +1 -1
- package/lib/system/event/event.entity.js +3 -4
- package/lib/system/event/event.entity.js.map +1 -1
- package/lib/system/event/log.entity.d.ts +12 -12
- package/lib/system/event/log.entity.js +12 -12
- package/lib/system/event/log.entity.js.map +1 -1
- package/lib/system/policy/policy.entity.js +4 -8
- package/lib/system/policy/policy.entity.js.map +1 -1
- package/lib/system/staff/staff.entity.js +2 -4
- package/lib/system/staff/staff.entity.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/alert.entity.js +4 -5
- package/lib/user/alert.entity.js.map +1 -1
- package/lib/user/blocked.entity.js +1 -4
- package/lib/user/blocked.entity.js.map +1 -1
- package/lib/user/device.entity.js +2 -4
- package/lib/user/device.entity.js.map +1 -1
- package/lib/user/notification.entity.js +2 -4
- package/lib/user/notification.entity.js.map +1 -1
- package/lib/user/ticket.entity.js +4 -8
- package/lib/user/ticket.entity.js.map +1 -1
- package/lib/user/user.entity.d.ts +0 -4
- package/lib/user/user.entity.js +2 -12
- package/lib/user/user.entity.js.map +1 -1
- package/lib/user/verification.entity.js +2 -4
- package/lib/user/verification.entity.js.map +1 -1
- package/lib/utils/activity.helper.d.ts +1 -1
- package/lib/utils/activity.helper.js +9 -9
- package/lib/utils/activity.helper.js.map +1 -1
- package/package.json +6 -6
- package/lib/profile/student/program/medical/examination.model.d.ts +0 -63
- package/lib/profile/student/program/medical/examination.model.js +0 -158
- package/lib/profile/student/program/medical/examination.model.js.map +0 -1
- package/lib/system/campaigne/campaign.entity.d.ts +0 -69
- package/lib/system/campaigne/campaign.entity.js +0 -153
- package/lib/system/campaigne/campaign.entity.js.map +0 -1
- package/lib/system/campaigne/gifcode.entity.d.ts +0 -54
- package/lib/system/campaigne/gifcode.entity.js +0 -102
- package/lib/system/campaigne/gifcode.entity.js.map +0 -1
- package/lib/system/event/business.entity.d.ts +0 -75
- package/lib/system/event/business.entity.js +0 -128
- package/lib/system/event/business.entity.js.map +0 -1
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/index.js +0 -21
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/json-metrics.transform.d.ts +0 -35
- package/lib/utils/json-metrics.transform.js +0 -83
- package/lib/utils/json-metrics.transform.js.map +0 -1
- package/lib/utils/trackable.entity.d.ts +0 -82
- package/lib/utils/trackable.entity.js +0 -69
- package/lib/utils/trackable.entity.js.map +0 -1
|
@@ -60,10 +60,8 @@ let AgentPayoutEntity = class AgentPayoutEntity extends trackable_1.TrackableEnt
|
|
|
60
60
|
*/
|
|
61
61
|
async getActivities() {
|
|
62
62
|
const activities = [];
|
|
63
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, shared_1.ActivityType.
|
|
64
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
65
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.paidBy, shared_1.ActivityType.paidBy, staff_entity_1.StaffEntity));
|
|
66
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.paidOn, shared_1.ActivityType.paidOn));
|
|
63
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created, staff_entity_1.StaffEntity));
|
|
64
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated, staff_entity_1.StaffEntity));
|
|
67
65
|
return activities.filter(a => a);
|
|
68
66
|
}
|
|
69
67
|
};
|
|
@@ -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,yDAA0D;AAC1D,qDAAwD;AACxD,iEAAyD;AAEzD;;;;;;GAMG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAuB;IAwE7D;;;OAGG;IACH,YAAY,KAAkC;QAC7C,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACZ,OAAO,IAAI,eAAM,CAAC;YACjB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,oBAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;SACrD,CAAC,CAAC;IACJ,CAAC;IAED;;;OA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AAS,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"}
|
|
@@ -64,10 +64,8 @@ let AgentPromotionEntity = class AgentPromotionEntity extends trackable_1.Tracka
|
|
|
64
64
|
*/
|
|
65
65
|
async getActivities() {
|
|
66
66
|
const activities = [];
|
|
67
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, shared_1.ActivityType.
|
|
68
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
69
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, shared_1.ActivityType.updatedBy));
|
|
70
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, shared_1.ActivityType.updatedOn));
|
|
67
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
68
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
71
69
|
return activities.filter(a => a);
|
|
72
70
|
}
|
|
73
71
|
};
|
|
@@ -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,CAAC,EAAE;YACX,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,eAAM,CAAC;gBAClB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;aACrB,CAAC;YACF,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE;SAC5C,CAAC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS;QACd,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,UAAU,GAAe,EAAE,CAAC;QAClC,UAAU,CAAC,IAAI,CAAC,MAAM,IAAA,4BAAU,EAAC,IAAI,CAAC,SAAS,EAAE,
|
|
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,CAAC,EAAE;YACX,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,eAAM,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E,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,4 +1,4 @@
|
|
|
1
|
-
import { AccountStatus, Language } from '@driveup/shared';
|
|
1
|
+
import { AccountStatus, Language, AddonType } from '@driveup/shared';
|
|
2
2
|
import { Company, Activity, WorkingHours, Holiday, Address } from '@driveup/common';
|
|
3
3
|
import { BankAccount, Tax, Link, Customer, Preference } from '@driveup/common';
|
|
4
4
|
import { CountryEntity } from '../../system/country/country.entity';
|
|
@@ -12,6 +12,7 @@ import { CompanyProductEntity } from './product/product.entity';
|
|
|
12
12
|
import { CompanyInstructorEntity } from './instructor/instructor.entity';
|
|
13
13
|
import { AgentPromotionEntity } from '../agent/promotion.entity';
|
|
14
14
|
import { TrackableEntity } from '../../utils/trackable';
|
|
15
|
+
import { CompanyAddonEntity } from './product/addon.entity';
|
|
15
16
|
/**
|
|
16
17
|
* Represents a driving school company in the system.
|
|
17
18
|
* Companies offer training products, manage instructors and students,
|
|
@@ -137,6 +138,7 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
|
|
|
137
138
|
* Company products relation
|
|
138
139
|
*/
|
|
139
140
|
products: Promise<CompanyProductEntity[]>;
|
|
141
|
+
addons: Promise<CompanyAddonEntity[]>;
|
|
140
142
|
/**
|
|
141
143
|
* Company bills relation
|
|
142
144
|
*/
|
|
@@ -235,7 +237,7 @@ export declare class CompanyEntity extends TrackableEntity<Company> {
|
|
|
235
237
|
* Log company event
|
|
236
238
|
* @param event Event type
|
|
237
239
|
* @param metadata Content render data (in company language)
|
|
238
|
-
* @param entityId Optional related entity ID
|
|
239
240
|
*/
|
|
240
|
-
log(event: string, metadata?: any
|
|
241
|
+
log(event: string, metadata?: any): Promise<void>;
|
|
242
|
+
getAddonByType(type: AddonType): Promise<CompanyAddonEntity>;
|
|
241
243
|
}
|
|
@@ -27,6 +27,7 @@ const instructor_entity_1 = require("./instructor/instructor.entity");
|
|
|
27
27
|
const promotion_entity_1 = require("../agent/promotion.entity");
|
|
28
28
|
const trackable_1 = require("../../utils/trackable");
|
|
29
29
|
const activity_helper_1 = require("../../utils/activity.helper");
|
|
30
|
+
const addon_entity_1 = require("./product/addon.entity");
|
|
30
31
|
/**
|
|
31
32
|
* Represents a driving school company in the system.
|
|
32
33
|
* Companies offer training products, manage instructors and students,
|
|
@@ -124,7 +125,7 @@ let CompanyEntity = class CompanyEntity extends trackable_1.TrackableEntity {
|
|
|
124
125
|
* @param active - Optional flag to filter only active instructors
|
|
125
126
|
* @returns Promise resolving to array of CompanyInstructorEntity
|
|
126
127
|
*/
|
|
127
|
-
async getInstructors(active) {
|
|
128
|
+
async getInstructors(active = true) {
|
|
128
129
|
const instructors = (await this.instructors) || [];
|
|
129
130
|
return active ? instructors.filter(i => i.status === shared_1.AccountStatus.Active) : instructors;
|
|
130
131
|
}
|
|
@@ -133,7 +134,7 @@ let CompanyEntity = class CompanyEntity extends trackable_1.TrackableEntity {
|
|
|
133
134
|
* @param active - Optional flag to filter only active managers
|
|
134
135
|
* @returns Promise resolving to array of CompanyInstructorEntity with manager roles
|
|
135
136
|
*/
|
|
136
|
-
async getManagers(active) {
|
|
137
|
+
async getManagers(active = true) {
|
|
137
138
|
const instructors = await this.getInstructors(active);
|
|
138
139
|
const managerRoles = [shared_1.Role.Owner, shared_1.Role.Manager];
|
|
139
140
|
return instructors?.filter(i => managerRoles.includes(i.role));
|
|
@@ -174,29 +175,29 @@ let CompanyEntity = class CompanyEntity extends trackable_1.TrackableEntity {
|
|
|
174
175
|
*/
|
|
175
176
|
async getActivities() {
|
|
176
177
|
const activities = [];
|
|
177
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, shared_1.ActivityType.
|
|
178
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
179
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.
|
|
180
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.updatedOn, shared_1.ActivityType.updatedOn));
|
|
181
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.closedBy, shared_1.ActivityType.closedBy));
|
|
182
|
-
activities.push(await (0, activity_helper_1.toActivity)(this.closedOn, shared_1.ActivityType.closedOn));
|
|
178
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.createdBy, this.createdOn, shared_1.ActivityType.created));
|
|
179
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.updatedBy, this.updatedOn, shared_1.ActivityType.updated));
|
|
180
|
+
activities.push(await (0, activity_helper_1.toActivity)(this.closedBy, this.closedOn, shared_1.ActivityType.updated));
|
|
183
181
|
return activities.filter(a => a);
|
|
184
182
|
}
|
|
185
183
|
/**
|
|
186
184
|
* Log company event
|
|
187
185
|
* @param event Event type
|
|
188
186
|
* @param metadata Content render data (in company language)
|
|
189
|
-
* @param entityId Optional related entity ID
|
|
190
187
|
*/
|
|
191
|
-
async log(event, metadata
|
|
188
|
+
async log(event, metadata) {
|
|
192
189
|
await log_entity_1.LogEntity.from({
|
|
193
190
|
type: shared_1.LogType.Company,
|
|
191
|
+
profile: shared_1.ProfileType.Company,
|
|
194
192
|
event: event,
|
|
195
|
-
entityId:
|
|
196
|
-
profile: { type: shared_1.ProfileType.Company, id: this.id },
|
|
193
|
+
entityId: this.id,
|
|
197
194
|
content: log_entity_1.LogEntity.toCompanyContent(event, this.language, metadata)
|
|
198
195
|
});
|
|
199
196
|
}
|
|
197
|
+
async getAddonByType(type) {
|
|
198
|
+
const addons = await this.addons;
|
|
199
|
+
return addons?.find(i => i.type === type);
|
|
200
|
+
}
|
|
200
201
|
};
|
|
201
202
|
exports.CompanyEntity = CompanyEntity;
|
|
202
203
|
__decorate([
|
|
@@ -388,6 +389,10 @@ __decorate([
|
|
|
388
389
|
(0, typeorm_1.OneToMany)(() => product_entity_1.CompanyProductEntity, product => product.company),
|
|
389
390
|
__metadata("design:type", Promise)
|
|
390
391
|
], CompanyEntity.prototype, "products", void 0);
|
|
392
|
+
__decorate([
|
|
393
|
+
(0, typeorm_1.OneToMany)(() => addon_entity_1.CompanyAddonEntity, addon => addon.company),
|
|
394
|
+
__metadata("design:type", Promise)
|
|
395
|
+
], CompanyEntity.prototype, "addons", void 0);
|
|
391
396
|
__decorate([
|
|
392
397
|
(0, typeorm_1.OneToMany)(() => bill_entity_1.CompanyBillEntity, bill => bill.company),
|
|
393
398
|
__metadata("design:type", Promise)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.entity.js","sourceRoot":"","sources":["../../../src/profile/company/company.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"company.entity.js","sourceRoot":"","sources":["../../../src/profile/company/company.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0E;AAC1E,4CAA2H;AAC3H,4CAAoF;AACpF,4CAA+E;AAC/E,wEAAoE;AACpE,8DAA0D;AAC1D,sEAAyE;AACzE,wEAAkF;AAClF,yEAA4E;AAC5E,sEAAyE;AACzE,oEAA8E;AAC9E,gEAAmE;AACn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,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;kDAC3B;AAMhD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAoB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;+CACxB;AAM1C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8CAA4B,EAAE,eAAe,CAAC,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC;;wDAC/B;AAM3D;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAqB,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;gDACzB;AAM5C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAoB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;+CACxB;AAM1C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAoB,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;sDACrB;wBA9SrC,aAAa;IADzB,IAAA,gBAAM,EAAC,WAAW,CAAC;;GACP,aAAa,CA8dzB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Activity, RecurringAppointment } from '@driveup/common';
|
|
1
|
+
import { Activity, Appointment, Period, RecurringAppointment } from '@driveup/common';
|
|
3
2
|
import { CompanyCourseLessonEntity } from './lesson.entity';
|
|
4
3
|
import { StudentTrainingAppointmentEntity } from '../../student/program/training/appointment.entity';
|
|
5
4
|
import { CompanyInstructorEntity } from '../instructor/instructor.entity';
|
|
6
5
|
import { TrackableEntity } from '../../../utils/trackable';
|
|
6
|
+
import { IDateAssignment, IDateDuration, IDateUpdate, WeekDay } from '@driveup/shared';
|
|
7
|
+
import { DateTime } from 'luxon';
|
|
7
8
|
/**
|
|
8
9
|
* Represents a series of training appointment offers managed by the company.
|
|
9
10
|
*
|
|
@@ -26,7 +27,7 @@ import { TrackableEntity } from '../../../utils/trackable';
|
|
|
26
27
|
* @see {@link CompanyCourseLessonEntity} for the associated course lesson
|
|
27
28
|
* @see {@link StudentTrainingEntity} for student bookings
|
|
28
29
|
*/
|
|
29
|
-
export declare class
|
|
30
|
+
export declare class CompanyCourseScheduleEntity extends TrackableEntity<RecurringAppointment> {
|
|
30
31
|
/**
|
|
31
32
|
* Company course lesson
|
|
32
33
|
*/
|
|
@@ -87,12 +88,12 @@ export declare class CompanyCourseAppointmentEntity extends TrackableEntity<Recu
|
|
|
87
88
|
* Student training appointments relation
|
|
88
89
|
* - Will not be used for driving courses
|
|
89
90
|
*/
|
|
90
|
-
|
|
91
|
+
studentSchedule: Promise<StudentTrainingAppointmentEntity[]>;
|
|
91
92
|
/**
|
|
92
|
-
* Creates a new
|
|
93
|
+
* Creates a new CompanyCourseScheduleEntity instance
|
|
93
94
|
* @param props - Partial properties to initialize the entity with
|
|
94
95
|
*/
|
|
95
|
-
constructor(props?: Partial<
|
|
96
|
+
constructor(props?: Partial<CompanyCourseScheduleEntity>);
|
|
96
97
|
/**
|
|
97
98
|
* Converts the entity to a RecurringAppointment model instance
|
|
98
99
|
* @returns Promise resolving to RecurringAppointment model with lesson, instructor, and scheduling details
|
|
@@ -109,4 +110,93 @@ export declare class CompanyCourseAppointmentEntity extends TrackableEntity<Recu
|
|
|
109
110
|
* @returns Promise resolving to array of Activity objects filtered to exclude null values
|
|
110
111
|
*/
|
|
111
112
|
getActivities(): Promise<Activity[]>;
|
|
113
|
+
getCompany(): Promise<import("../company.entity").CompanyEntity>;
|
|
114
|
+
getCourse(): Promise<import("./course.entity").CompanyCourseEntity>;
|
|
115
|
+
getInstructor(): Promise<CompanyInstructorEntity>;
|
|
116
|
+
getInstructorByDate(date: Date): Promise<CompanyInstructorEntity>;
|
|
117
|
+
/**
|
|
118
|
+
* Load all appointments of the definition within the given period
|
|
119
|
+
* @description currently only works for flexible course schedules, and will return an empty array if the related course is fixed. but can and must be extended in the future to return the entire appointment list of the schedule, even if the appointment is fixed, or for another product type entirely.
|
|
120
|
+
* @param period Period
|
|
121
|
+
* @param instructorIds number[] - instructorId to filter by (return only appointments related to this instructor id)
|
|
122
|
+
* @param searchPhrase string - optional search phrase to filter appointments by (course title / part title / registered student name)
|
|
123
|
+
* @returns All appointments of the definition within the given period, filtered by instructorId if provided
|
|
124
|
+
*/
|
|
125
|
+
getAppointments(period: Period, instructorIds?: number[], searchPhrase?: string): Promise<Appointment[]>;
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @param period Period
|
|
129
|
+
* @returns DateTime if a first appointment is found, null otherwise
|
|
130
|
+
*/
|
|
131
|
+
getFirstAppointmentDateInPeriod(period: Period): DateTime;
|
|
132
|
+
/**
|
|
133
|
+
* @description Get detailed information about an appointment
|
|
134
|
+
* @param date - DateTime - is presumed to be related to an appointment in this definition
|
|
135
|
+
* @param filteredInstructorIds - number - optional - instrucotr id to filter the appointment by
|
|
136
|
+
* @returns Appointment - appointment information (id, start and end date, instructor information)
|
|
137
|
+
*/
|
|
138
|
+
getAppointmentInformation(date: DateTime, filteredInstructorIds?: number[]): Promise<Appointment>;
|
|
139
|
+
/**
|
|
140
|
+
* @description Only for repeted definitions (repetition = true)
|
|
141
|
+
* @description Finds the final date of the appointment, considering any date updates (updates in the startDate)
|
|
142
|
+
* @description If no date updates are found, the original date will be returned
|
|
143
|
+
* @param date DateTime - original date of the appointment (default return value, if no date updates are found)
|
|
144
|
+
* @returns DateTime - final date of the appointment
|
|
145
|
+
*/
|
|
146
|
+
private getUpdatedDate;
|
|
147
|
+
/**
|
|
148
|
+
* @description Only for repeted definitions (repetition = true)
|
|
149
|
+
* @description Checks wether or not the appointment related to the given date has been removed from schedule (pushed in the skippedDates array)
|
|
150
|
+
* @param date DateTime - date of the appointment
|
|
151
|
+
* @returns DateTime - true if the appointment is skipped, false otherwise
|
|
152
|
+
*/
|
|
153
|
+
private isDateSkipped;
|
|
154
|
+
/**
|
|
155
|
+
* @description Only for repeted definitions (repetition = true)
|
|
156
|
+
* @description Finds the final duration of the appointment, considering any duration updates
|
|
157
|
+
* @description If no duration updates are found, this.duration will be returned by default
|
|
158
|
+
* @param date DateTime - date of the appointment
|
|
159
|
+
* @returns number - duration of the appointment (in minutes)
|
|
160
|
+
*/
|
|
161
|
+
getAppointmentDuration(date: DateTime): number;
|
|
162
|
+
/**
|
|
163
|
+
* @description Checks weather or not there is a student with a matching name registered in this schedule for the given appointment
|
|
164
|
+
* @description Currently only works for flexible course trainings (MVP logic), and will always return false for fixed course trainings
|
|
165
|
+
* Must be renamed and extended in the future to support fixed course trainings as well, but will remain as is for the sake of MVP Migration
|
|
166
|
+
* @param appointment Appointment - appointment to check for registered students
|
|
167
|
+
* @param studentName string - name of the student to check for registration
|
|
168
|
+
* @returns boolean - Weather or not there a student with the given name registered for the appointment
|
|
169
|
+
*/
|
|
170
|
+
isStudentRegistered(appointment: Appointment, studentName: string): Promise<boolean>;
|
|
171
|
+
/**
|
|
172
|
+
* @description Doesn't check for the definition's endDate, or updates and skippedDates
|
|
173
|
+
* @returns the next appointment based on repetition logic and weekdays assigned
|
|
174
|
+
*/
|
|
175
|
+
private getNextAppointmentDate;
|
|
176
|
+
/**
|
|
177
|
+
* Get the instructor registered for the appointment (works for repeated and single appointments)
|
|
178
|
+
* @param date Date - the date of the appointment
|
|
179
|
+
* @returns Instructor - simple instructor model
|
|
180
|
+
*/
|
|
181
|
+
getAppointmentInstructor(date: DateTime): Promise<{
|
|
182
|
+
id: number;
|
|
183
|
+
name: string;
|
|
184
|
+
image: string;
|
|
185
|
+
phone: string;
|
|
186
|
+
role: import("@driveup/shared").Role;
|
|
187
|
+
status: import("@driveup/shared").AccountStatus;
|
|
188
|
+
canReinstate: boolean;
|
|
189
|
+
calendarLinks: import("@driveup/common").Link[];
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* @param date DateTime - is presumed to belong to an existing appointment
|
|
193
|
+
* @returns number - instructor id for the appointment of the given date
|
|
194
|
+
*/
|
|
195
|
+
getAppointmentInstructorId(date: DateTime): number;
|
|
196
|
+
/**
|
|
197
|
+
* Find instructor by id and map with simple information to User model
|
|
198
|
+
* @param id instructor id
|
|
199
|
+
* @returns Object - For the MVP it returns an object mapped like CompanyInstructorMapper.toSimple with the same interface. should be replaced with Person model in the future
|
|
200
|
+
*/
|
|
201
|
+
private getInstructorById;
|
|
112
202
|
}
|