@glissandoo/lib 1.0.3 → 1.0.4

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.
@@ -1,12 +1,23 @@
1
- import * as firestore from '@google-cloud/firestore';
1
+ import { DocumentSnapshot } from '@google-cloud/firestore';
2
2
  import Model from '../../Model';
3
- import { GroupAnalyticsData } from './types';
4
- export default class GroupAnalytics extends Model<GroupAnalyticsData> {
5
- constructor(doc: firestore.DocumentSnapshot);
6
- get groupId(): string;
7
- get satisfactionIndex(): number;
8
- get satisfactionIndexElements(): Record<import("./types").SatisfactionIndexElements, import("./types").SITypes>;
9
- get createdAt(): firestore.Timestamp;
10
- get weekDate(): Date;
11
- get status(): string;
3
+ import { GroupCountersData } from './types';
4
+ export default class GroupCounters extends Model<GroupCountersData> {
5
+ constructor(doc: DocumentSnapshot);
6
+ get admin_count(): number;
7
+ get member_count(): number;
8
+ get communication_count(): number;
9
+ get events_count(): number;
10
+ get eventsActiveCount(): number;
11
+ get eventsRollcalledCount(): number;
12
+ get repertoryCount(): number;
13
+ get eventsRepertoryCount(): number;
14
+ get eventsSumAnswerAverage(): number;
15
+ get attendanceRatioSumAverage(): number;
16
+ get eventsPassedCount(): number;
17
+ get createdAt(): FirebaseFirestore.Timestamp;
18
+ get eventsFutureCount(): number;
19
+ get satisfactionIndex(): {
20
+ current: number;
21
+ last: number;
22
+ };
12
23
  }
@@ -3,30 +3,52 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const date_fns_1 = require("date-fns");
7
- const lodash_1 = require("lodash");
8
6
  const Model_1 = __importDefault(require("../../Model"));
9
- class GroupAnalytics extends Model_1.default {
7
+ class GroupCounters extends Model_1.default {
10
8
  constructor(doc) {
11
9
  super(doc);
12
10
  }
13
- get groupId() {
14
- return lodash_1.get(this.ref, 'parent.parent.id');
11
+ get admin_count() {
12
+ return this.data.admin_count || 0;
15
13
  }
16
- get satisfactionIndex() {
17
- return this.data.satisfactionIndex || 0;
14
+ get member_count() {
15
+ return this.data.member_count || 0;
16
+ }
17
+ get communication_count() {
18
+ return this.data.communication_count || 0;
19
+ }
20
+ get events_count() {
21
+ return this.data.events_count || 0;
22
+ }
23
+ get eventsActiveCount() {
24
+ return this.data.eventsActiveCount || 0;
25
+ }
26
+ get eventsRollcalledCount() {
27
+ return this.data.eventsRollcalledCount || 0;
18
28
  }
19
- get satisfactionIndexElements() {
20
- return this.data.satisfactionIndexElements || {};
29
+ get repertoryCount() {
30
+ return this.data.repertory_count || 0;
31
+ }
32
+ get eventsRepertoryCount() {
33
+ return this.data.eventsRepertoryCount || 0;
34
+ }
35
+ get eventsSumAnswerAverage() {
36
+ return this.data.eventsSumAnswerAverage || 0;
37
+ }
38
+ get attendanceRatioSumAverage() {
39
+ return this.data.attendanceRatioSumAverage || 0;
40
+ }
41
+ get eventsPassedCount() {
42
+ return this.data.eventsPassedCount || 0;
21
43
  }
22
44
  get createdAt() {
23
45
  return this.data.createdAt;
24
46
  }
25
- get weekDate() {
26
- return date_fns_1.parse(this.id, 'yyyyMMdd', new Date());
47
+ get eventsFutureCount() {
48
+ return this.data.eventsFutureCount || 0;
27
49
  }
28
- get status() {
29
- return this.data.status;
50
+ get satisfactionIndex() {
51
+ return this.data.satisfactionIndex || { current: 0, last: 0 };
30
52
  }
31
53
  }
32
- exports.default = GroupAnalytics;
54
+ exports.default = GroupCounters;
@@ -1,25 +1,20 @@
1
1
  import { Timestamp } from '@google-cloud/firestore';
2
- export declare enum SatisfactionIndexElements {
3
- ROLLCALLED_EVENTS_RATIO = "ROLLCALLED_EVENTS_RATIO",
4
- ADMIN_COUNT = "ADMIN_COUNT",
5
- MEMBERS_COUNT = "MEMBERS_COUNT",
6
- EVENTS_PER_WEEK = "EVENTS_PER_WEEK",
7
- ATTENDANCE_PREVISION_RATIO = "ATTENDANCE_PREVISION_RATIO",
8
- EVENTS_ANSWER_PERCENTAGE = "EVENTS_ANSWER_PERCENTAGE",
9
- EVENTS_WITH_REPERTORY_PERCENTAGE = "EVENTS_WITH_REPERTORY_PERCENTAGE",
10
- REPERTORY_COUNT = "REPERTORY_COUNT",
11
- COMMUNICATION_COUNT = "COMMUNICATION_COUNT",
12
- EVENTS_COUNT = "EVENTS_COUNT",
13
- EVENTS_FUTURE_COUNT = "EVENTS_FUTURE_COUNT"
14
- }
15
- export interface SITypes {
16
- value: number;
17
- threshold: number;
18
- result: number;
19
- }
20
- export interface GroupAnalyticsData {
21
- satisfactionIndexElements: Record<SatisfactionIndexElements, SITypes>;
22
- satisfactionIndex: number;
2
+ export interface GroupCountersData {
3
+ eventsPassedCount: number;
23
4
  createdAt: Timestamp;
24
- status: string;
5
+ eventsFutureCount: number;
6
+ events_count: number;
7
+ admin_count: number;
8
+ member_count: number;
9
+ communication_count: number;
10
+ repertory_count: number;
11
+ eventsActiveCount: number;
12
+ eventsRollcalledCount: number;
13
+ eventsRepertoryCount: number;
14
+ eventsSumAnswerAverage: number;
15
+ attendanceRatioSumAverage: number;
16
+ satisfactionIndex: {
17
+ current: number;
18
+ last: number;
19
+ };
25
20
  }
@@ -1,17 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SatisfactionIndexElements = void 0;
4
- var SatisfactionIndexElements;
5
- (function (SatisfactionIndexElements) {
6
- SatisfactionIndexElements["ROLLCALLED_EVENTS_RATIO"] = "ROLLCALLED_EVENTS_RATIO";
7
- SatisfactionIndexElements["ADMIN_COUNT"] = "ADMIN_COUNT";
8
- SatisfactionIndexElements["MEMBERS_COUNT"] = "MEMBERS_COUNT";
9
- SatisfactionIndexElements["EVENTS_PER_WEEK"] = "EVENTS_PER_WEEK";
10
- SatisfactionIndexElements["ATTENDANCE_PREVISION_RATIO"] = "ATTENDANCE_PREVISION_RATIO";
11
- SatisfactionIndexElements["EVENTS_ANSWER_PERCENTAGE"] = "EVENTS_ANSWER_PERCENTAGE";
12
- SatisfactionIndexElements["EVENTS_WITH_REPERTORY_PERCENTAGE"] = "EVENTS_WITH_REPERTORY_PERCENTAGE";
13
- SatisfactionIndexElements["REPERTORY_COUNT"] = "REPERTORY_COUNT";
14
- SatisfactionIndexElements["COMMUNICATION_COUNT"] = "COMMUNICATION_COUNT";
15
- SatisfactionIndexElements["EVENTS_COUNT"] = "EVENTS_COUNT";
16
- SatisfactionIndexElements["EVENTS_FUTURE_COUNT"] = "EVENTS_FUTURE_COUNT";
17
- })(SatisfactionIndexElements = exports.SatisfactionIndexElements || (exports.SatisfactionIndexElements = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -12,8 +12,8 @@
12
12
  "lint": "eslint --ext .ts ./src",
13
13
  "prepare": "npm run build",
14
14
  "preversion": "npm run lint",
15
- "version": "npm run format && git add -A src",
16
- "postversion": "git push && git push --tags && ./publish.sh",
15
+ "version": "npm run format && git add -A src && ./publish.sh",
16
+ "postversion": "git push && git push --tags",
17
17
  "publish:beta": "npm publish --tag beta"
18
18
  },
19
19
  "author": "Glissandoo",
@@ -1,12 +0,0 @@
1
- import * as firestore from '@google-cloud/firestore';
2
- import Model from '../../Model';
3
- import { GroupAnalyticsData } from './types';
4
- export default class GroupAnalytics extends Model<GroupAnalyticsData> {
5
- constructor(doc: firestore.DocumentSnapshot);
6
- get groupId(): string;
7
- get satisfactionIndex(): number;
8
- get satisfactionIndexElements(): Record<import("./types").SatisfactionIndexElements, import("./types").SITypes>;
9
- get createdAt(): firestore.Timestamp;
10
- get weekDate(): Date;
11
- get status(): string;
12
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const date_fns_1 = require("date-fns");
7
- const lodash_1 = require("lodash");
8
- const Model_1 = __importDefault(require("../../Model"));
9
- class GroupAnalytics extends Model_1.default {
10
- constructor(doc) {
11
- super(doc);
12
- }
13
- get groupId() {
14
- return lodash_1.get(this.ref, 'parent.parent.id');
15
- }
16
- get satisfactionIndex() {
17
- return this.data.satisfactionIndex || 0;
18
- }
19
- get satisfactionIndexElements() {
20
- return this.data.satisfactionIndexElements || {};
21
- }
22
- get createdAt() {
23
- return this.data.createdAt;
24
- }
25
- get weekDate() {
26
- return date_fns_1.parse(this.id, 'yyyyMMdd', new Date());
27
- }
28
- get status() {
29
- return this.data.status;
30
- }
31
- }
32
- exports.default = GroupAnalytics;
@@ -1,25 +0,0 @@
1
- import { Timestamp } from '@google-cloud/firestore';
2
- export declare enum SatisfactionIndexElements {
3
- ROLLCALLED_EVENTS_RATIO = "ROLLCALLED_EVENTS_RATIO",
4
- ADMIN_COUNT = "ADMIN_COUNT",
5
- MEMBERS_COUNT = "MEMBERS_COUNT",
6
- EVENTS_PER_WEEK = "EVENTS_PER_WEEK",
7
- ATTENDANCE_PREVISION_RATIO = "ATTENDANCE_PREVISION_RATIO",
8
- EVENTS_ANSWER_PERCENTAGE = "EVENTS_ANSWER_PERCENTAGE",
9
- EVENTS_WITH_REPERTORY_PERCENTAGE = "EVENTS_WITH_REPERTORY_PERCENTAGE",
10
- REPERTORY_COUNT = "REPERTORY_COUNT",
11
- COMMUNICATION_COUNT = "COMMUNICATION_COUNT",
12
- EVENTS_COUNT = "EVENTS_COUNT",
13
- EVENTS_FUTURE_COUNT = "EVENTS_FUTURE_COUNT"
14
- }
15
- export interface SITypes {
16
- value: number;
17
- threshold: number;
18
- result: number;
19
- }
20
- export interface GroupAnalyticsData {
21
- satisfactionIndexElements: Record<SatisfactionIndexElements, SITypes>;
22
- satisfactionIndex: number;
23
- createdAt: Timestamp;
24
- status: string;
25
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SatisfactionIndexElements = void 0;
4
- var SatisfactionIndexElements;
5
- (function (SatisfactionIndexElements) {
6
- SatisfactionIndexElements["ROLLCALLED_EVENTS_RATIO"] = "ROLLCALLED_EVENTS_RATIO";
7
- SatisfactionIndexElements["ADMIN_COUNT"] = "ADMIN_COUNT";
8
- SatisfactionIndexElements["MEMBERS_COUNT"] = "MEMBERS_COUNT";
9
- SatisfactionIndexElements["EVENTS_PER_WEEK"] = "EVENTS_PER_WEEK";
10
- SatisfactionIndexElements["ATTENDANCE_PREVISION_RATIO"] = "ATTENDANCE_PREVISION_RATIO";
11
- SatisfactionIndexElements["EVENTS_ANSWER_PERCENTAGE"] = "EVENTS_ANSWER_PERCENTAGE";
12
- SatisfactionIndexElements["EVENTS_WITH_REPERTORY_PERCENTAGE"] = "EVENTS_WITH_REPERTORY_PERCENTAGE";
13
- SatisfactionIndexElements["REPERTORY_COUNT"] = "REPERTORY_COUNT";
14
- SatisfactionIndexElements["COMMUNICATION_COUNT"] = "COMMUNICATION_COUNT";
15
- SatisfactionIndexElements["EVENTS_COUNT"] = "EVENTS_COUNT";
16
- SatisfactionIndexElements["EVENTS_FUTURE_COUNT"] = "EVENTS_FUTURE_COUNT";
17
- })(SatisfactionIndexElements = exports.SatisfactionIndexElements || (exports.SatisfactionIndexElements = {}));