@admin-layout/timetracker-module-server 1.0.3-alpha.2 → 1.0.3-alpha.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
- import { ITimeRecordRequest, ITimeRecord, ITimeTracker } from '@admin-layout/timetracker-core';
1
+ import { ITimeRecordRequest, ITimeRecord } from '@admin-layout/timetracker-core';
2
2
  export interface ITimeRecordRepository {
3
3
  getTimeRecords(orgId: string, userId?: string, startTime?: Date, endTime?: Date): Promise<Array<ITimeRecord>>;
4
4
  getOrganizationTimeRecords(orgId: string): Promise<Array<ITimeRecord>>;
5
5
  getPlayingTimeRecord(userId: string, orgId: string): Promise<ITimeRecord>;
6
- createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeTracker>>;
7
- updateTimeRecord(userId: string, orgId: string, recordId: string, request: ITimeRecordRequest): Promise<Partial<ITimeTracker>>;
8
- removeTimeRecord(userId: string, orgId: string, recordId: string): Promise<Partial<ITimeTracker>>;
6
+ createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeRecord>>;
7
+ updateTimeRecord(userId: string, orgId: string, recordId: string, request: ITimeRecordRequest): Promise<Partial<ITimeRecord>>;
8
+ removeTimeRecord(userId: string, orgId: string, recordId: string): Promise<Partial<ITimeRecord>>;
9
9
  removeDurationTimeRecords(userId: string, orgId: string, startTime: Date, endTime: Date, projectId: string): Promise<boolean>;
10
10
  approveTimeRecords(orgId: string, sheetId: string, startDate: Date, endDate: Date): any;
11
11
  disapproveTimeRecords(orgId: string, sheetId: string): any;
@@ -1,9 +1,9 @@
1
- import { ITimeRecord, ITimeRecordRequest, ITimeTracker } from '@admin-layout/timetracker-core';
1
+ import { ITimeRecord, ITimeRecordRequest } from '@admin-layout/timetracker-core';
2
2
  export interface ITimeRecordService {
3
3
  getTimeRecords(orgId: string, userId?: string): Promise<Array<ITimeRecord>>;
4
4
  getDurationTimeRecords(orgId: string, startTime: Date, endTime: Date, userId?: string): Promise<Array<ITimeRecord>>;
5
5
  getPlayingTimeRecord(userId: string, orgId: string): Promise<ITimeRecord>;
6
- createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeTracker>>;
6
+ createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeRecord>>;
7
7
  updateTimeRecord(userId: string, orgId: string, recordId: string, request: ITimeRecordRequest): Promise<boolean>;
8
8
  removeTimeRecord(userId: string, orgId: string, recordId: string): Promise<boolean>;
9
9
  removeDurationTimeRecords(userId: string, orgId: string, startTime: Date, endTime: Date, projectId: string): Promise<boolean>;
@@ -0,0 +1,8 @@
1
+ import { Model, Document, Connection } from 'mongoose';
2
+ import { ITimeRecord } from '@admin-layout/timetracker-core';
3
+ export declare type Maybe<T> = T | null;
4
+ export interface ITimeRecordModel extends ITimeRecord, Document {
5
+ id?: any;
6
+ }
7
+ export declare type TimeRecordsModelType = Model<ITimeRecordModel>;
8
+ export declare const TimeRecordsModelFunc: (db: Connection) => TimeRecordsModelType;
@@ -0,0 +1,12 @@
1
+ import { Model, Document, Connection } from 'mongoose';
2
+ import { ITimesheets, ITimesheet } from '@admin-layout/timetracker-core';
3
+ export declare type Maybe<T> = T | null;
4
+ export interface ITimeSheetModel extends ITimesheet, Document {
5
+ id?: any;
6
+ }
7
+ export interface ITimesheetsModel extends ITimesheets, Document {
8
+ id: any;
9
+ timesheets: ITimeSheetModel[];
10
+ }
11
+ export declare type TimesheetsModelType = Model<ITimesheetsModel>;
12
+ export declare const TimesheetsModelFunc: (db: Connection) => TimesheetsModelType;
@@ -1,21 +1,21 @@
1
1
  import * as Logger from 'bunyan';
2
2
  import * as mongoose from 'mongoose';
3
- import { ITimeRecordRequest, ITimeRecord, ITimeTracker } from '@admin-layout/timetracker-core';
4
- import { ITimeRecordModel, ITimeTrackerModel } from '../models/timetracker-model';
3
+ import { ITimeRecordRequest, ITimeRecord } from '@admin-layout/timetracker-core';
5
4
  import { ITimeRecordRepository } from '../../interfaces';
5
+ import { ITimeRecordModel } from '../models/timerecords-model';
6
6
  export declare class TimeRecordRepository implements ITimeRecordRepository {
7
- private timeTrackerModel;
7
+ private timeRecordsModel;
8
8
  private logger;
9
9
  constructor(db: mongoose.Connection, logger: Logger);
10
- getTimeRecords(orgId: string, userId?: string | RegExp, from?: Date, until?: Date): Promise<any>;
10
+ getTimeRecords(orgId: string, userId?: string | RegExp, from?: Date, until?: Date): Promise<Array<ITimeRecord>>;
11
11
  getOrganizationTimeRecords(orgId: string): Promise<ITimeRecordModel[]>;
12
12
  getPlayingTimeRecord(userId: string, orgId: string): Promise<ITimeRecord>;
13
- createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeTracker>>;
14
- updateTimeRecord(userId: string, orgId: string, recordId: string, request: ITimeRecordRequest): Promise<Partial<ITimeTrackerModel>>;
13
+ createTimeRecord(userId: string, orgId: string, request: ITimeRecordRequest): Promise<Partial<ITimeRecord>>;
14
+ updateTimeRecord(userId: string, orgId: string, recordId: string, request: ITimeRecordRequest): Promise<Partial<ITimeRecordModel>>;
15
15
  removeTimeRecord(userId: string, orgId: string, recordId: string): Promise<{
16
16
  userId: string;
17
17
  orgId: string;
18
- timeRecords: ITimeRecord[];
18
+ _id: string;
19
19
  }>;
20
20
  removeDurationTimeRecords(userId: string, orgId: string, startTime: Date, endTime: Date, projectId: string): Promise<boolean>;
21
21
  approveTimeRecords(orgId: string, sheetId: string, startDate: Date, endDate: Date): Promise<void>;
@@ -2,11 +2,11 @@ import * as Logger from 'bunyan';
2
2
  import * as mongoose from 'mongoose';
3
3
  import { ITimesheetCreateRequest, ITimesheetState } from '@admin-layout/timetracker-core';
4
4
  import { ServiceBroker } from 'moleculer';
5
- import { ITimeSheetModel } from '../models/timetracker-model';
5
+ import { ITimeSheetModel } from '../models/timesheets-model';
6
6
  import { ITimesheetRepository } from '../../interfaces';
7
7
  export declare class TimesheetRepository implements ITimesheetRepository {
8
8
  private broker;
9
- private timeTrackerModel;
9
+ private timesheetsModel;
10
10
  private logger;
11
11
  constructor(db: mongoose.Connection, logger: Logger, broker: ServiceBroker);
12
12
  getOrganizationTimesheets(orgId: string): Promise<ITimeSheetModel[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/timetracker-module-server",
3
- "version": "1.0.3-alpha.2",
3
+ "version": "1.0.3-alpha.31",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -13,8 +13,6 @@
13
13
  "build:lib:watch": "npm run build:lib -- --watch",
14
14
  "jest": "./node_modules/.bin/jest",
15
15
  "prepublish": "npm run build",
16
- "schema:download": "./node_modules/.bin/apollo-codegen download-schema http://localhost:8080/graphql --output schema.json ",
17
- "schema:generate": "./node_modules/.bin/apollo-codegen generate src/browser/graphql/**/*.graphql --schema schema.json --target typescript --output src/browser/types/schema.ts",
18
16
  "test": "cross-env ENV_FILE=../../config/test/test.env jest",
19
17
  "test:debug": "npm test -- --runInBand",
20
18
  "test:watch": "npm test -- --watch",
@@ -40,7 +38,7 @@
40
38
  }
41
39
  },
42
40
  "dependencies": {
43
- "@admin-layout/timetracker-core": "1.0.3-alpha.2",
41
+ "@admin-layout/timetracker-core": "1.0.3-alpha.31",
44
42
  "@container-stack/mailing-api": "^0.0.26-61",
45
43
  "humanize-duration": "^3.24.0",
46
44
  "moment": "^2.29.1"
@@ -62,5 +60,5 @@
62
60
  "typescript": {
63
61
  "definition": "lib/index.d.ts"
64
62
  },
65
- "gitHead": "a2fd652c2eeddedb710bc8fc6c2f55ae0c8b3515"
63
+ "gitHead": "337e5f7d25e61d3be03a6833e83650b9ae5c4851"
66
64
  }