@admin-layout/schedule-module-server 3.0.0-alpha.98 → 3.1.1-alpha.10

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 (113) hide show
  1. package/lib/config/config.d.ts +3 -0
  2. package/lib/config/config.d.ts.map +1 -0
  3. package/lib/config/env-config.d.ts +17 -0
  4. package/lib/config/env-config.d.ts.map +1 -0
  5. package/lib/config/index.d.ts +2 -0
  6. package/lib/config/index.d.ts.map +1 -0
  7. package/lib/constants/constants.d.ts +1 -0
  8. package/lib/constants/constants.d.ts.map +1 -0
  9. package/lib/constants/constants.js +8 -0
  10. package/lib/constants/constants.js.map +1 -0
  11. package/lib/constants/index.d.ts +1 -0
  12. package/lib/constants/index.d.ts.map +1 -0
  13. package/lib/containers/containers.d.ts +1 -0
  14. package/lib/containers/containers.d.ts.map +1 -0
  15. package/lib/containers/containers.js +21 -0
  16. package/lib/containers/containers.js.map +1 -0
  17. package/lib/containers/index.d.ts +1 -0
  18. package/lib/containers/index.d.ts.map +1 -0
  19. package/lib/dataloader/cache.d.ts +1 -0
  20. package/lib/dataloader/cache.d.ts.map +1 -0
  21. package/lib/dataloader/counter-dataloader.d.ts +1 -0
  22. package/lib/dataloader/counter-dataloader.d.ts.map +1 -0
  23. package/lib/dataloader/index.d.ts +1 -0
  24. package/lib/dataloader/index.d.ts.map +1 -0
  25. package/lib/graphqlTypes/index.d.ts +4 -0
  26. package/lib/graphqlTypes/index.d.ts.map +1 -0
  27. package/lib/graphqlTypes/resolvers.d.ts +7 -0
  28. package/lib/graphqlTypes/resolvers.d.ts.map +1 -0
  29. package/lib/index.d.ts +1 -0
  30. package/lib/index.d.ts.map +1 -0
  31. package/lib/index.js +2 -989
  32. package/lib/index.js.map +1 -1
  33. package/lib/interfaces/generated-models.d.ts +36 -35
  34. package/lib/interfaces/generated-models.d.ts.map +1 -0
  35. package/lib/interfaces/index.d.ts +1 -0
  36. package/lib/interfaces/index.d.ts.map +1 -0
  37. package/lib/interfaces/schedule-repository.d.ts +1 -0
  38. package/lib/interfaces/schedule-repository.d.ts.map +1 -0
  39. package/lib/interfaces/schedule-service.d.ts +1 -0
  40. package/lib/interfaces/schedule-service.d.ts.map +1 -0
  41. package/lib/interfaces/timeline-repository.d.ts +1 -0
  42. package/lib/interfaces/timeline-repository.d.ts.map +1 -0
  43. package/lib/interfaces/timeline-service.d.ts +1 -0
  44. package/lib/interfaces/timeline-service.d.ts.map +1 -0
  45. package/lib/interfaces/timesheet-repository.d.ts +1 -0
  46. package/lib/interfaces/timesheet-repository.d.ts.map +1 -0
  47. package/lib/interfaces/timesheet-service.d.ts +1 -0
  48. package/lib/interfaces/timesheet-service.d.ts.map +1 -0
  49. package/lib/module.d.ts +1 -0
  50. package/lib/module.d.ts.map +1 -0
  51. package/lib/module.js +18 -0
  52. package/lib/module.js.map +1 -0
  53. package/lib/resolvers/index.d.ts +1 -0
  54. package/lib/resolvers/index.d.ts.map +1 -0
  55. package/lib/resolvers/index.js +2 -0
  56. package/lib/resolvers/index.js.map +1 -0
  57. package/lib/resolvers/schedule-resolver.d.ts +1 -0
  58. package/lib/resolvers/schedule-resolver.d.ts.map +1 -0
  59. package/lib/resolvers/schedule-resolver.js +24 -0
  60. package/lib/resolvers/schedule-resolver.js.map +1 -0
  61. package/lib/resolvers/timeline-resolver.d.ts +20 -0
  62. package/lib/resolvers/timeline-resolver.d.ts.map +1 -0
  63. package/lib/schema/index.d.ts +1 -0
  64. package/lib/schema/index.d.ts.map +1 -0
  65. package/lib/schema/index.js +3 -0
  66. package/lib/schema/index.js.map +1 -0
  67. package/lib/schema/schedule-schema.graphql.js +1 -0
  68. package/lib/schema/schedule-schema.graphql.js.map +1 -0
  69. package/lib/schema/timeline-schema.graphql.js +1 -0
  70. package/lib/schema/timeline-schema.graphql.js.map +1 -0
  71. package/lib/services/index.d.ts +1 -0
  72. package/lib/services/index.d.ts.map +1 -0
  73. package/lib/services/schedule-service.d.ts +2 -1
  74. package/lib/services/schedule-service.d.ts.map +1 -0
  75. package/lib/services/schedule-service.js +24 -0
  76. package/lib/services/schedule-service.js.map +1 -0
  77. package/lib/services/timeline-service.d.ts +1 -0
  78. package/lib/services/timeline-service.d.ts.map +1 -0
  79. package/lib/services/timeline-service.js +24 -0
  80. package/lib/services/timeline-service.js.map +1 -0
  81. package/lib/services/timesheet-service.d.ts +1 -0
  82. package/lib/services/timesheet-service.d.ts.map +1 -0
  83. package/lib/services/timesheet-service.js +24 -0
  84. package/lib/services/timesheet-service.js.map +1 -0
  85. package/lib/store/models/index.d.ts +1 -0
  86. package/lib/store/models/index.d.ts.map +1 -0
  87. package/lib/store/models/schedule-model.d.ts +2 -1
  88. package/lib/store/models/schedule-model.d.ts.map +1 -0
  89. package/lib/store/models/schedule-model.js +40 -0
  90. package/lib/store/models/schedule-model.js.map +1 -0
  91. package/lib/store/models/timeline-model.d.ts +2 -1
  92. package/lib/store/models/timeline-model.d.ts.map +1 -0
  93. package/lib/store/models/timeline-model.js +40 -0
  94. package/lib/store/models/timeline-model.js.map +1 -0
  95. package/lib/store/models/timesheet-model.d.ts +2 -1
  96. package/lib/store/models/timesheet-model.d.ts.map +1 -0
  97. package/lib/store/models/timesheet-model.js +42 -0
  98. package/lib/store/models/timesheet-model.js.map +1 -0
  99. package/lib/store/repository/index.d.ts +1 -0
  100. package/lib/store/repository/index.d.ts.map +1 -0
  101. package/lib/store/repository/schedule-repository.d.ts +1 -0
  102. package/lib/store/repository/schedule-repository.d.ts.map +1 -0
  103. package/lib/store/repository/schedule-repository.js +46 -0
  104. package/lib/store/repository/schedule-repository.js.map +1 -0
  105. package/lib/store/repository/timeline-repository.d.ts +1 -0
  106. package/lib/store/repository/timeline-repository.d.ts.map +1 -0
  107. package/lib/store/repository/timeline-repository.js +46 -0
  108. package/lib/store/repository/timeline-repository.js.map +1 -0
  109. package/lib/store/repository/timesheet-repository.d.ts +1 -0
  110. package/lib/store/repository/timesheet-repository.d.ts.map +1 -0
  111. package/lib/store/repository/timesheet-repository.js +46 -0
  112. package/lib/store/repository/timesheet-repository.js.map +1 -0
  113. package/package.json +4 -5
@@ -0,0 +1,24 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {TYPES}from'../constants/constants.js';let ScheduleService = class ScheduleService {
2
+ constructor(scheduleRepository, logger) {
3
+ this.scheduleRepository = scheduleRepository;
4
+ this.logger = logger;
5
+ }
6
+ async getScheduleEvents(userId) {
7
+ return this.scheduleRepository.getScheduleEvents(userId);
8
+ }
9
+ async createScheduleEvent(newEvent) {
10
+ return this.scheduleRepository.createScheduleEvent(newEvent);
11
+ }
12
+ async updateScheduleEvent(eventId, newEvent) {
13
+ return this.scheduleRepository.updateScheduleEvent(eventId, newEvent);
14
+ }
15
+ async removeScheduleEvent(eventId) {
16
+ return this.scheduleRepository.removeScheduleEvent(eventId);
17
+ }
18
+ };
19
+ ScheduleService = __decorate([
20
+ injectable(),
21
+ __param(0, inject(TYPES.IScheduleRepository)),
22
+ __param(1, inject('Logger')),
23
+ __metadata("design:paramtypes", [Object, Object])
24
+ ], ScheduleService);export{ScheduleService};//# sourceMappingURL=schedule-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-service.js","sources":["../../src/services/schedule-service.ts"],"sourcesContent":[null],"names":[],"mappings":"0IAUa,IAAA,eAAe,GAArB,MAAM,eAAe,CAAA;IAGxB,WAEc,CAAA,kBAAuC,EAGjD,MAAe,EAAA;QAHL,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAqB;AAKjD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;IAEM,MAAM,iBAAiB,CAAC,MAAc,EAAA;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;KAC5D;IAEM,MAAM,mBAAmB,CAAC,QAAgC,EAAA;QAC7D,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;KAChE;AAEM,IAAA,MAAM,mBAAmB,CAAC,OAAe,EAAE,QAAmB,EAAA;QACjE,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACzE;IAEM,MAAM,mBAAmB,CAAC,OAAe,EAAA;QAC5C,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;KAC/D;EACJ;AA5BY,eAAe,GAAA,UAAA,CAAA;AAD3B,IAAA,UAAU,EAAE;AAKJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAGjC,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;;AAPZ,CAAA,EAAA,eAAe,CA4B3B"}
@@ -10,3 +10,4 @@ export declare class TimelineService implements ITimelineService {
10
10
  updateTimelineEvent(eventId: string, newEvent: ITimeline): Promise<boolean>;
11
11
  removeTimelineEvent(eventId: string): Promise<boolean>;
12
12
  }
13
+ //# sourceMappingURL=timeline-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-service.d.ts","sourceRoot":"","sources":["../../src/services/timeline-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGtE,qBACa,eAAgB,YAAW,gBAAgB;IAKhD,SAAS,CAAC,kBAAkB,EAAE,mBAAmB;IAJrD,OAAO,CAAC,MAAM,CAAoB;gBAIpB,kBAAkB,EAAE,mBAAmB,EAGjD,MAAM,EAAE,SAAS,CAAC,OAAO;IAKhB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAI5D,mBAAmB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvE,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3E,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGtE"}
@@ -0,0 +1,24 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {TYPES}from'../constants/constants.js';let TimelineService = class TimelineService {
2
+ constructor(timelineRepository, logger) {
3
+ this.timelineRepository = timelineRepository;
4
+ this.logger = logger;
5
+ }
6
+ async getTimelineEvents(userId) {
7
+ return this.timelineRepository.getTimelineEvents(userId);
8
+ }
9
+ async createTimelineEvent(newEvent) {
10
+ return this.timelineRepository.createTimelineEvent(newEvent);
11
+ }
12
+ async updateTimelineEvent(eventId, newEvent) {
13
+ return this.timelineRepository.updateTimelineEvent(eventId, newEvent);
14
+ }
15
+ async removeTimelineEvent(eventId) {
16
+ return this.timelineRepository.removeTimelineEvent(eventId);
17
+ }
18
+ };
19
+ TimelineService = __decorate([
20
+ injectable(),
21
+ __param(0, inject(TYPES.ITimelineRepository)),
22
+ __param(1, inject('Logger')),
23
+ __metadata("design:paramtypes", [Object, Object])
24
+ ], TimelineService);export{TimelineService};//# sourceMappingURL=timeline-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-service.js","sources":["../../src/services/timeline-service.ts"],"sourcesContent":[null],"names":[],"mappings":"0IASa,IAAA,eAAe,GAArB,MAAM,eAAe,CAAA;IAGxB,WAEc,CAAA,kBAAuC,EAGjD,MAAyB,EAAA;QAHf,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAqB;AAKjD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;IAEM,MAAM,iBAAiB,CAAC,MAAc,EAAA;QACzC,OAAO,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;KAC5D;IAEM,MAAM,mBAAmB,CAAC,QAAgC,EAAA;QAC7D,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;KAChE;AAEM,IAAA,MAAM,mBAAmB,CAAC,OAAe,EAAE,QAAmB,EAAA;QACjE,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACzE;IAEM,MAAM,mBAAmB,CAAC,OAAe,EAAA;QAC5C,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;KAC/D;EACJ;AA5BY,eAAe,GAAA,UAAA,CAAA;AAD3B,IAAA,UAAU,EAAE;AAKJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAGjC,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;;AAPZ,CAAA,EAAA,eAAe,CA4B3B"}
@@ -9,3 +9,4 @@ export declare class TimesheetService implements ITimesheetService {
9
9
  updateTimesheetEvent(eventId: string, newEvent: any): Promise<boolean>;
10
10
  removeTimesheetEvent(eventId: string): Promise<boolean>;
11
11
  }
12
+ //# sourceMappingURL=timesheet-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-service.d.ts","sourceRoot":"","sources":["../../src/services/timesheet-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGxE,qBACa,gBAAiB,YAAW,iBAAiB;IAKlD,SAAS,CAAC,mBAAmB,EAAE,oBAAoB;IAJvD,OAAO,CAAC,MAAM,CAAU;gBAIV,mBAAmB,EAAE,oBAAoB,EAGnD,MAAM,EAAE,OAAO;IAKN,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAIvD,oBAAoB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrD,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAItE,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGvE"}
@@ -0,0 +1,24 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import'bunyan';import {injectable,inject}from'inversify';import {TYPES}from'../constants/constants.js';let TimesheetService = class TimesheetService {
2
+ constructor(timesheetRepository, logger) {
3
+ this.timesheetRepository = timesheetRepository;
4
+ this.logger = logger;
5
+ }
6
+ async getTimesheetEvents(userId) {
7
+ return this.timesheetRepository.getTimesheetEvents(userId);
8
+ }
9
+ async createTimesheetEvent(newEvent) {
10
+ return this.timesheetRepository.createTimesheetEvent(newEvent);
11
+ }
12
+ async updateTimesheetEvent(eventId, newEvent) {
13
+ return this.timesheetRepository.updateTimesheetEvent(eventId, newEvent);
14
+ }
15
+ async removeTimesheetEvent(eventId) {
16
+ return this.timesheetRepository.removeTimesheetEvent(eventId);
17
+ }
18
+ };
19
+ TimesheetService = __decorate([
20
+ injectable(),
21
+ __param(0, inject(TYPES.ITimesheetRepository)),
22
+ __param(1, inject('Logger')),
23
+ __metadata("design:paramtypes", [Object, Object])
24
+ ], TimesheetService);export{TimesheetService};//# sourceMappingURL=timesheet-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-service.js","sources":["../../src/services/timesheet-service.ts"],"sourcesContent":[null],"names":[],"mappings":"yJAOa,IAAA,gBAAgB,GAAtB,MAAM,gBAAgB,CAAA;IAGzB,WAEc,CAAA,mBAAyC,EAGnD,MAAe,EAAA;QAHL,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAsB;AAKnD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;IAEM,MAAM,kBAAkB,CAAC,MAAc,EAAA;QAC1C,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;KAC9D;IAEM,MAAM,oBAAoB,CAAC,QAAa,EAAA;QAC3C,OAAO,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;KAClE;AAEM,IAAA,MAAM,oBAAoB,CAAC,OAAe,EAAE,QAAa,EAAA;QAC5D,OAAO,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3E;IAEM,MAAM,oBAAoB,CAAC,OAAe,EAAA;QAC7C,OAAO,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;KACjE;EACJ;AA5BY,gBAAgB,GAAA,UAAA,CAAA;AAD5B,IAAA,UAAU,EAAE;AAKJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;AAGlC,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;;AAPZ,CAAA,EAAA,gBAAgB,CA4B5B"}
@@ -1,3 +1,4 @@
1
1
  export * from './schedule-model';
2
2
  export * from './timeline-model';
3
3
  export * from './timesheet-model';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
@@ -3,5 +3,6 @@ import { ISchedule } from '@admin-layout/schedule-module-core';
3
3
  export interface IScheduleModel extends ISchedule, Document {
4
4
  id: any;
5
5
  }
6
- export declare type ScheduleModelType = Model<IScheduleModel>;
6
+ export type ScheduleModelType = Model<IScheduleModel>;
7
7
  export declare const ScheduleModelFunc: (db: Connection) => ScheduleModelType;
8
+ //# sourceMappingURL=schedule-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-model.d.ts","sourceRoot":"","sources":["../../../src/store/models/schedule-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE/D,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,QAAQ;IACvD,EAAE,EAAE,GAAG,CAAC;CACX;AA2CD,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,iBAAiB,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,iBACI,CAAC"}
@@ -0,0 +1,40 @@
1
+ import {Schema}from'mongoose';/* eslint-disable no-underscore-dangle */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ const ScheduleSchema = new Schema({
4
+ // Event title
5
+ title: { type: String, required: true },
6
+ // all day event ? true: false
7
+ allDay: { type: Boolean, default: false },
8
+ // start date
9
+ start: { type: Date },
10
+ // end date
11
+ end: { type: Date },
12
+ // description
13
+ desc: { type: String },
14
+ // userId
15
+ userId: { type: String },
16
+ // resouceId
17
+ resourceId: { type: String },
18
+ // tip
19
+ tooltip: { type: String },
20
+ // isBillable
21
+ isBillable: { type: Boolean, default: false },
22
+ // submitted date
23
+ submittedOn: { type: Date },
24
+ // reason
25
+ reason: { type: String },
26
+ // note
27
+ note: { type: String },
28
+ // approved date
29
+ approvedOn: { type: Date },
30
+ });
31
+ ScheduleSchema.virtual('id').get(function () {
32
+ return this._id.toHexString();
33
+ });
34
+ ScheduleSchema.set('toJSON', {
35
+ virtuals: true,
36
+ });
37
+ ScheduleSchema.set('toObject', {
38
+ virtuals: true,
39
+ });
40
+ const ScheduleModelFunc = (db) => db.model('schedule', ScheduleSchema);export{ScheduleModelFunc};//# sourceMappingURL=schedule-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-model.js","sources":["../../../src/store/models/schedule-model.ts"],"sourcesContent":[null],"names":[],"mappings":"8BAAA;AACA;AAQA,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;;IAE9B,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;;IAEvC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAEzC,IAAA,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAErB,IAAA,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAEnB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAE5B,IAAA,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;IAEzB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAE7C,IAAA,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAE3B,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;AAC7B,CAAA,CAAC,CAAC;AAEH,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,YAAA;AAC7B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE;AACzB,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAEH,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE;AAC3B,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAIU,MAAA,iBAAiB,GAA0C,CAAC,EAAE,KACvE,EAAE,CAAC,KAAK,CAAiB,UAAU,EAAE,cAAc"}
@@ -3,5 +3,6 @@ import { ITimeline } from '@admin-layout/schedule-module-core';
3
3
  export interface ITimelineModel extends ITimeline, Document {
4
4
  id: any;
5
5
  }
6
- export declare type TimelineModelType = Model<ITimelineModel>;
6
+ export type TimelineModelType = Model<ITimelineModel>;
7
7
  export declare const TimelineModelFunc: (db: Connection) => TimelineModelType;
8
+ //# sourceMappingURL=timeline-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-model.d.ts","sourceRoot":"","sources":["../../../src/store/models/timeline-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE/D,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,QAAQ;IACvD,EAAE,EAAE,GAAG,CAAC;CACX;AA2CD,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,iBAAiB,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,iBACI,CAAC"}
@@ -0,0 +1,40 @@
1
+ import {Schema}from'mongoose';/* eslint-disable no-underscore-dangle */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ const TimelineSchema = new Schema({
4
+ // Event title
5
+ title: { type: String, required: true },
6
+ // all day event ? true: false
7
+ allDay: { type: Boolean, default: false },
8
+ // start date
9
+ start: { type: Date },
10
+ // end date
11
+ end: { type: Date },
12
+ // description
13
+ desc: { type: String },
14
+ // userId
15
+ userId: { type: String },
16
+ // resouceId
17
+ resourceId: { type: String },
18
+ // tip
19
+ tooltip: { type: String },
20
+ // isBillable
21
+ isBillable: { type: Boolean, default: false },
22
+ // submitted date
23
+ submittedOn: { type: Date },
24
+ // reason
25
+ reason: { type: String },
26
+ // note
27
+ note: { type: String },
28
+ // approved date
29
+ approvedOn: { type: Date },
30
+ });
31
+ TimelineSchema.virtual('id').get(function () {
32
+ return this._id.toHexString();
33
+ });
34
+ TimelineSchema.set('toJSON', {
35
+ virtuals: true,
36
+ });
37
+ TimelineSchema.set('toObject', {
38
+ virtuals: true,
39
+ });
40
+ const TimelineModelFunc = (db) => db.model('timeline', TimelineSchema);export{TimelineModelFunc};//# sourceMappingURL=timeline-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-model.js","sources":["../../../src/store/models/timeline-model.ts"],"sourcesContent":[null],"names":[],"mappings":"8BAAA;AACA;AAQA,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;;IAE9B,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;;IAEvC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAEzC,IAAA,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAErB,IAAA,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAEnB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAE5B,IAAA,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;IAEzB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAE7C,IAAA,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAE3B,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;AAC7B,CAAA,CAAC,CAAC;AAEH,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,YAAA;AAC7B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE;AACzB,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAEH,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE;AAC3B,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAIU,MAAA,iBAAiB,GAA0C,CAAC,EAAE,KACvE,EAAE,CAAC,KAAK,CAAiB,UAAU,EAAE,cAAc"}
@@ -2,5 +2,6 @@ import { Model, Document, Connection } from 'mongoose';
2
2
  export interface ITimesheetModel extends Document {
3
3
  id: any;
4
4
  }
5
- export declare type TimesheetModelType = Model<ITimesheetModel>;
5
+ export type TimesheetModelType = Model<ITimesheetModel>;
6
6
  export declare const TimesheetModelFunc: (db: Connection) => TimesheetModelType;
7
+ //# sourceMappingURL=timesheet-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-model.d.ts","sourceRoot":"","sources":["../../../src/store/models/timesheet-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAS,QAAQ;IAC9C,EAAE,EAAE,GAAG,CAAC;CACX;AA6CD,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,kBAAkB,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,kBACM,CAAC"}
@@ -0,0 +1,42 @@
1
+ import {Schema}from'mongoose';/* eslint-disable no-underscore-dangle */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ const TimesheetSchema = new Schema({
4
+ // Event title
5
+ title: { type: String, required: true },
6
+ // all day event ? true: false
7
+ allDay: { type: Boolean, default: false },
8
+ // start date
9
+ start: { type: Date },
10
+ // end date
11
+ end: { type: Date },
12
+ // description
13
+ desc: { type: String },
14
+ // userId
15
+ userId: { type: String },
16
+ // resourceId
17
+ resourceId: { type: String },
18
+ // projectId
19
+ projectId: { type: String },
20
+ // tip
21
+ tooltip: { type: String },
22
+ // isBillable
23
+ isBillable: { type: Boolean, default: false },
24
+ // submitted date
25
+ submittedOn: { type: Date },
26
+ // reason
27
+ reason: { type: String },
28
+ // note
29
+ note: { type: String },
30
+ // approved date
31
+ approvedOn: { type: Date },
32
+ });
33
+ TimesheetSchema.virtual('id').get(function () {
34
+ return this._id.toHexString();
35
+ });
36
+ TimesheetSchema.set('toJSON', {
37
+ virtuals: true,
38
+ });
39
+ TimesheetSchema.set('toObject', {
40
+ virtuals: true,
41
+ });
42
+ const TimesheetModelFunc = (db) => db.model('timesheet', TimesheetSchema);export{TimesheetModelFunc};//# sourceMappingURL=timesheet-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-model.js","sources":["../../../src/store/models/timesheet-model.ts"],"sourcesContent":[null],"names":[],"mappings":"8BAAA;AACA;AAOA,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC;;IAE/B,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;;IAEvC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAEzC,IAAA,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAErB,IAAA,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAEnB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAE5B,IAAA,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAE3B,IAAA,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;IAEzB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;;AAE7C,IAAA,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;;AAE3B,IAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAExB,IAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;;AAEtB,IAAA,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;AAC7B,CAAA,CAAC,CAAC;AAEH,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,YAAA;AAC9B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE;AAC1B,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAEH,eAAe,CAAC,GAAG,CAAC,UAAU,EAAE;AAC5B,IAAA,QAAQ,EAAE,IAAI;AACjB,CAAA,CAAC,CAAC;AAIU,MAAA,kBAAkB,GAA2C,CAAC,EAAE,KACzE,EAAE,CAAC,KAAK,CAAkB,WAAW,EAAE,eAAe"}
@@ -1,3 +1,4 @@
1
1
  export * from './schedule-repository';
2
2
  export * from './timeline-repository';
3
3
  export * from './timesheet-repository';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/repository/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -11,3 +11,4 @@ export declare class ScheduleRepository implements IScheduleRepository {
11
11
  updateScheduleEvent(eventId: string, newEvent: IScheduleCreateRequest): Promise<boolean>;
12
12
  removeScheduleEvent(eventId: string): Promise<boolean>;
13
13
  }
14
+ //# sourceMappingURL=schedule-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-repository.d.ts","sourceRoot":"","sources":["../../../src/store/repository/schedule-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,qBACa,kBAAmB,YAAW,mBAAmB;IAC1D,OAAO,CAAC,aAAa,CAAoB;IAEzC,OAAO,CAAC,MAAM,CAAS;gBAInB,EAAE,EAAE,QAAQ,CAAC,UAAU,EAGvB,MAAM,EAAE,MAAM,EAId,OAAO,CAAC,EAAE,GAAG;IAMJ,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAK5D,mBAAmB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IASvE,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IASxF,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQtE"}
@@ -0,0 +1,46 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import'bunyan';import {injectable,inject,optional}from'inversify';import*as mongoose from'mongoose';import {ScheduleModelFunc}from'../models/schedule-model.js';let ScheduleRepository = class ScheduleRepository {
2
+ constructor(db, logger, options) {
3
+ this.logger = logger.child({ className: 'ScheduleRepository' });
4
+ this.scheduleModel = ScheduleModelFunc(db);
5
+ }
6
+ async getScheduleEvents(userId) {
7
+ if (userId === undefined)
8
+ return await this.scheduleModel.find({}).exec();
9
+ return await this.scheduleModel.find({ resourceId: userId }).exec();
10
+ }
11
+ async createScheduleEvent(newEvent) {
12
+ try {
13
+ await this.scheduleModel.create({ ...newEvent });
14
+ return true;
15
+ }
16
+ catch (e) {
17
+ throw new Error(e.message);
18
+ }
19
+ }
20
+ async updateScheduleEvent(eventId, newEvent) {
21
+ try {
22
+ await this.scheduleModel.update({ _id: eventId }, { ...newEvent });
23
+ return true;
24
+ }
25
+ catch (e) {
26
+ throw new Error(e.message);
27
+ }
28
+ }
29
+ async removeScheduleEvent(eventId) {
30
+ try {
31
+ await this.scheduleModel.remove({ _id: eventId });
32
+ return true;
33
+ }
34
+ catch (e) {
35
+ throw new Error(e.message);
36
+ }
37
+ }
38
+ };
39
+ ScheduleRepository = __decorate([
40
+ injectable(),
41
+ __param(0, inject('MongoDBConnection')),
42
+ __param(1, inject('Logger')),
43
+ __param(2, inject('MongoOptions')),
44
+ __param(2, optional()),
45
+ __metadata("design:paramtypes", [mongoose.Connection, Object, Object])
46
+ ], ScheduleRepository);export{ScheduleRepository};//# sourceMappingURL=schedule-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-repository.js","sources":["../../../src/store/repository/schedule-repository.ts"],"sourcesContent":[null],"names":[],"mappings":"kNAUa,IAAA,kBAAkB,GAAxB,MAAM,kBAAkB,CAAA;AAK3B,IAAA,WAAA,CAEI,EAAuB,EAGvB,MAAc,EAId,OAAa,EAAA;AAEb,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAChE,QAAA,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;KAC9C;IAEM,MAAM,iBAAiB,CAAC,MAAc,EAAA;QACzC,IAAI,MAAM,KAAK,SAAS;AAAE,YAAA,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1E,QAAA,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KACvE;IAEM,MAAM,mBAAmB,CAAC,QAAgC,EAAA;QAC7D,IAAI;YACA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;AAEM,IAAA,MAAM,mBAAmB,CAAC,OAAe,EAAE,QAAgC,EAAA;QAC9E,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACnE,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;IAEM,MAAM,mBAAmB,CAAC,OAAe,EAAA;QAC5C,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;EACJ;AAnDY,kBAAkB,GAAA,UAAA,CAAA;AAD9B,IAAA,UAAU,EAAE;AAOJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAG3B,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;AAGhB,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,OAAA,CAAA,CAAA,EAAA,QAAQ,EAAE,CAAA;AANP,IAAA,UAAA,CAAA,mBAAA,EAAA,CAAA,QAAQ,CAAC,UAAU,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAPlB,CAAA,EAAA,kBAAkB,CAmD9B"}
@@ -11,3 +11,4 @@ export declare class TimelineRepository implements ITimelineRepository {
11
11
  updateTimelineEvent(eventId: string, newEvent: ITimelineCreateRequest): Promise<boolean>;
12
12
  removeTimelineEvent(eventId: string): Promise<boolean>;
13
13
  }
14
+ //# sourceMappingURL=timeline-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-repository.d.ts","sourceRoot":"","sources":["../../../src/store/repository/timeline-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,qBACa,kBAAmB,YAAW,mBAAmB;IAC1D,OAAO,CAAC,aAAa,CAAoB;IAEzC,OAAO,CAAC,MAAM,CAAS;gBAInB,EAAE,EAAE,QAAQ,CAAC,UAAU,EAGvB,MAAM,EAAE,MAAM,EAId,OAAO,CAAC,EAAE,GAAG;IAMJ,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAK5D,mBAAmB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IASvE,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IASxF,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQtE"}
@@ -0,0 +1,46 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import'bunyan';import {injectable,inject,optional}from'inversify';import*as mongoose from'mongoose';import'../models/schedule-model.js';import {TimelineModelFunc}from'../models/timeline-model.js';import'../models/timesheet-model.js';let TimelineRepository = class TimelineRepository {
2
+ constructor(db, logger, options) {
3
+ this.logger = logger.child({ className: 'TimelineRepository' });
4
+ this.timelineModel = TimelineModelFunc(db);
5
+ }
6
+ async getTimelineEvents(userId) {
7
+ if (userId === undefined)
8
+ return await this.timelineModel.find({}).exec();
9
+ return await this.timelineModel.find({ resourceId: userId }).exec();
10
+ }
11
+ async createTimelineEvent(newEvent) {
12
+ try {
13
+ await this.timelineModel.create({ ...newEvent });
14
+ return true;
15
+ }
16
+ catch (e) {
17
+ throw new Error(e.message);
18
+ }
19
+ }
20
+ async updateTimelineEvent(eventId, newEvent) {
21
+ try {
22
+ await this.timelineModel.update({ _id: eventId }, { ...newEvent });
23
+ return true;
24
+ }
25
+ catch (e) {
26
+ throw new Error(e.message);
27
+ }
28
+ }
29
+ async removeTimelineEvent(eventId) {
30
+ try {
31
+ await this.timelineModel.remove({ _id: eventId });
32
+ return true;
33
+ }
34
+ catch (e) {
35
+ throw new Error(e.message);
36
+ }
37
+ }
38
+ };
39
+ TimelineRepository = __decorate([
40
+ injectable(),
41
+ __param(0, inject('MongoDBConnection')),
42
+ __param(1, inject('Logger')),
43
+ __param(2, inject('MongoOptions')),
44
+ __param(2, optional()),
45
+ __metadata("design:paramtypes", [mongoose.Connection, Object, Object])
46
+ ], TimelineRepository);export{TimelineRepository};//# sourceMappingURL=timeline-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline-repository.js","sources":["../../../src/store/repository/timeline-repository.ts"],"sourcesContent":[null],"names":[],"mappings":"2RAUa,IAAA,kBAAkB,GAAxB,MAAM,kBAAkB,CAAA;AAK3B,IAAA,WAAA,CAEI,EAAuB,EAGvB,MAAc,EAId,OAAa,EAAA;AAEb,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;AAChE,QAAA,IAAI,CAAC,aAAa,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;KAC9C;IAEM,MAAM,iBAAiB,CAAC,MAAc,EAAA;QACzC,IAAI,MAAM,KAAK,SAAS;AAAE,YAAA,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1E,QAAA,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KACvE;IAEM,MAAM,mBAAmB,CAAC,QAAgC,EAAA;QAC7D,IAAI;YACA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;AAEM,IAAA,MAAM,mBAAmB,CAAC,OAAe,EAAE,QAAgC,EAAA;QAC9E,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACnE,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;IAEM,MAAM,mBAAmB,CAAC,OAAe,EAAA;QAC5C,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;EACJ;AAnDY,kBAAkB,GAAA,UAAA,CAAA;AAD9B,IAAA,UAAU,EAAE;AAOJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAG3B,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;AAGhB,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,OAAA,CAAA,CAAA,EAAA,QAAQ,EAAE,CAAA;AANP,IAAA,UAAA,CAAA,mBAAA,EAAA,CAAA,QAAQ,CAAC,UAAU,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAPlB,CAAA,EAAA,kBAAkB,CAmD9B"}
@@ -10,3 +10,4 @@ export declare class TimesheetRepository implements ITimesheetRepository {
10
10
  updateTimesheetEvent(eventId: string, newEvent: any): Promise<boolean>;
11
11
  removeTimesheetEvent(eventId: string): Promise<boolean>;
12
12
  }
13
+ //# sourceMappingURL=timesheet-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-repository.d.ts","sourceRoot":"","sources":["../../../src/store/repository/timesheet-repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,qBACa,mBAAoB,YAAW,oBAAoB;IAC5D,OAAO,CAAC,cAAc,CAAqB;IAE3C,OAAO,CAAC,MAAM,CAAS;gBAInB,EAAE,EAAE,QAAQ,CAAC,UAAU,EAGvB,MAAM,EAAE,MAAM,EAId,OAAO,CAAC,EAAE,GAAG;IAMJ,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAKvD,oBAAoB,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IASrD,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAStE,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQvE"}
@@ -0,0 +1,46 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import'bunyan';import {injectable,inject,optional}from'inversify';import*as mongoose from'mongoose';import'../models/schedule-model.js';import'../models/timeline-model.js';import {TimesheetModelFunc}from'../models/timesheet-model.js';let TimesheetRepository = class TimesheetRepository {
2
+ constructor(db, logger, options) {
3
+ this.logger = logger.child({ className: 'TimesheetRepository' });
4
+ this.timesheetModel = TimesheetModelFunc(db);
5
+ }
6
+ async getTimesheetEvents(userId) {
7
+ if (userId === undefined)
8
+ return await this.timesheetModel.find({}).exec();
9
+ return await this.timesheetModel.find({ resourceId: userId }).exec();
10
+ }
11
+ async createTimesheetEvent(newEvent) {
12
+ try {
13
+ await this.timesheetModel.create({ ...newEvent });
14
+ return true;
15
+ }
16
+ catch (e) {
17
+ throw new Error(e.message);
18
+ }
19
+ }
20
+ async updateTimesheetEvent(eventId, newEvent) {
21
+ try {
22
+ await this.timesheetModel.update({ _id: eventId }, { ...newEvent });
23
+ return true;
24
+ }
25
+ catch (e) {
26
+ throw new Error(e.message);
27
+ }
28
+ }
29
+ async removeTimesheetEvent(eventId) {
30
+ try {
31
+ await this.timesheetModel.remove({ _id: eventId });
32
+ return true;
33
+ }
34
+ catch (e) {
35
+ throw new Error(e.message);
36
+ }
37
+ }
38
+ };
39
+ TimesheetRepository = __decorate([
40
+ injectable(),
41
+ __param(0, inject('MongoDBConnection')),
42
+ __param(1, inject('Logger')),
43
+ __param(2, inject('MongoOptions')),
44
+ __param(2, optional()),
45
+ __metadata("design:paramtypes", [mongoose.Connection, Object, Object])
46
+ ], TimesheetRepository);export{TimesheetRepository};//# sourceMappingURL=timesheet-repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timesheet-repository.js","sources":["../../../src/store/repository/timesheet-repository.ts"],"sourcesContent":[null],"names":[],"mappings":"4RASa,IAAA,mBAAmB,GAAzB,MAAM,mBAAmB,CAAA;AAK5B,IAAA,WAAA,CAEI,EAAuB,EAGvB,MAAc,EAId,OAAa,EAAA;AAEb,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACjE,QAAA,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;KAChD;IAEM,MAAM,kBAAkB,CAAC,MAAc,EAAA;QAC1C,IAAI,MAAM,KAAK,SAAS;AAAE,YAAA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3E,QAAA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KACxE;IAEM,MAAM,oBAAoB,CAAC,QAAa,EAAA;QAC3C,IAAI;YACA,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AAClD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;AAEM,IAAA,MAAM,oBAAoB,CAAC,OAAe,EAAE,QAAa,EAAA;QAC5D,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;AACpE,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;IAEM,MAAM,oBAAoB,CAAC,OAAe,EAAA;QAC7C,IAAI;AACA,YAAA,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AACnD,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC9B,SAAA;KACJ;EACJ;AAnDY,mBAAmB,GAAA,UAAA,CAAA;AAD/B,IAAA,UAAU,EAAE;AAOJ,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAG3B,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;AAGhB,IAAA,OAAA,CAAA,CAAA,EAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,OAAA,CAAA,CAAA,EAAA,QAAQ,EAAE,CAAA;AANP,IAAA,UAAA,CAAA,mBAAA,EAAA,CAAA,QAAQ,CAAC,UAAU,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAPlB,CAAA,EAAA,mBAAmB,CAmD/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/schedule-module-server",
3
- "version": "3.0.0-alpha.98",
3
+ "version": "3.1.1-alpha.10",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "build": "yarn build:clean && yarn build:lib",
11
11
  "build:clean": "rimraf lib",
12
- "build:lib": "webpack",
12
+ "build:lib": "rollup -c rollup.config.mjs",
13
13
  "build:lib:watch": "yarn build:lib -- --watch",
14
14
  "jest": "./node_modules/.bin/jest",
15
15
  "prepublish": "yarn build",
@@ -19,8 +19,7 @@
19
19
  "watch": "yarn build:lib:watch"
20
20
  },
21
21
  "dependencies": {
22
- "@admin-layout/schedule-module-core": "3.0.0-alpha.98",
23
- "@admin-layout/timetracker-core": "1.0.3-alpha.78"
22
+ "@admin-layout/schedule-module-core": "3.1.1-alpha.10"
24
23
  },
25
24
  "publishConfig": {
26
25
  "access": "public"
@@ -28,5 +27,5 @@
28
27
  "typescript": {
29
28
  "definition": "lib/index.d.ts"
30
29
  },
31
- "gitHead": "70aa2c61d6f61a248935c47517a0c2d221defcfe"
30
+ "gitHead": "7253c5499845dcf8600515630935c7dee152c133"
32
31
  }