evo360-types 1.0.0

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.
@@ -0,0 +1,9 @@
1
+ // @evo360/types/index.ts
2
+ export * from "./types/shared";
3
+ export * from "./types/evo-core";
4
+ export * from "./types/evo-tenant";
5
+ export * from "./types/evo-people";
6
+ export * from "./types/evo-calendar";
7
+ export * from "./types/evo-task";
8
+ export * from "./types/evo-survey";
9
+ export * from "./types/evo-meeting";
@@ -0,0 +1,60 @@
1
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../shared";
2
+ import { MeetingType } from "../evo-meeting";
3
+
4
+ // ----- CalendarTypes
5
+ // Enum for Event Instance Status
6
+ export type EventStatus = "scheduled" | "completed" | "cancelled";
7
+ export enum IEventStatus {
8
+ Scheduled = "scheduled", // The event is scheduled and upcoming
9
+ Completed = "completed", // The event has been completed
10
+ Cancelled = "cancelled", // The event has been cancelled
11
+ }
12
+
13
+ // Enum for Event Types
14
+ export type EventType = "event" | "meeting" | "workshop" | "other";
15
+ export enum IEventType {
16
+ Event = "event", // A general event type
17
+ Meeting = "meeting", // A meeting event
18
+ Workshop = "workshop", // A workshop event
19
+ Other = "other", // Any other type of event
20
+ }
21
+
22
+ // Interface for Meeting within a Event (meetingTasks)
23
+ export interface IEventMeeting {
24
+ meetingRef: FirestoreDocumentReference; // Reference to the original task
25
+ type: MeetingType; // Type of meeting
26
+ readonly task_count?: number;
27
+ readonly talkingPoints_count?: number;
28
+ tags?: ITag[];
29
+ }
30
+
31
+ // Interface for Recurring Events (recurringEvents)
32
+ export interface IRecurringEvent extends IFireDoc {
33
+ title: string; // Title of the meeting
34
+ description?: string; // Optional description of the meeting
35
+ creatorName: string; // Name of the user who created the event
36
+ creatorRef: FirestoreDocumentReference; // reference to the user who created the event
37
+ participants: string[]; // List of participant IDs
38
+ startDate: Date; // Start date and time of the first meeting
39
+ endDate?: Date; // Optional end date and time of the recurring meeting
40
+ type: EventType; // Type of event
41
+ rrule: string; // Recurrence rule in RRULE format
42
+ exceptions: string[]; // List of instance IDs that represent exceptions
43
+ }
44
+
45
+ // Interface for Event Instances (eventInstances)
46
+ export interface IEvent extends IFireDoc {
47
+ recurringRef?: FirestoreDocumentReference; // Reference to the recurring event rule (optional)
48
+ title: string; // Title of the event
49
+ description?: string; // Optional description of the event
50
+ creatorName: string; // Name of the user who created the event
51
+ creatorRef: FirestoreDocumentReference; // reference to the user who created the event
52
+ participantNames?: string[]; // List of participant names
53
+ participantRefs?: FirestoreDocumentReference[]; // List of participant references
54
+ startDate: Date; // Start date and time of the event
55
+ endDate?: Date; // Optional end date and time of the event
56
+ type: EventType; // Type of event
57
+ tags?: ITag[];
58
+ meeting?: IEventMeeting;
59
+ status: EventStatus; // Status of the event
60
+ }
@@ -0,0 +1,48 @@
1
+ import { FirestoreDocumentReference, IFireDoc } from "../shared";
2
+
3
+ //UserTypes
4
+ export interface IUserSpecialRoles {
5
+ is_admin: boolean;
6
+ is_sys_admin: boolean;
7
+ }
8
+
9
+ export interface IUser extends IUserSpecialRoles, IFireDoc {
10
+ display_name: string;
11
+ email: string;
12
+ email_verified?: string;
13
+ full_name: string;
14
+ last_access: Date;
15
+ member_since: Date;
16
+ mobile_number?: string;
17
+ mobile_number_verified?: boolean;
18
+ phone_number?: null | string;
19
+ picture_url?: null | string;
20
+ role: number;
21
+ tenantRef?: FirestoreDocumentReference | null;
22
+ tenants?: string[];
23
+ sid?: null | string;
24
+ }
25
+
26
+ //AuthTypes
27
+ export interface ILogin {
28
+ id: string;
29
+ user?: FirestoreDocumentReference;
30
+ displayname?: string | null;
31
+ email?: string | null;
32
+ emailverif?: false | boolean;
33
+ providerId?: string | null;
34
+ }
35
+
36
+ export interface IAction {
37
+ code: number;
38
+ action: string;
39
+ created_at: Date;
40
+ args?: IActionArgs | string | unknown | null;
41
+ user?: FirestoreDocumentReference;
42
+ }
43
+
44
+ export interface IActionArgs {
45
+ old_values?: Record<string, any>;
46
+ new_values?: Record<string, any>;
47
+ deleted_at?: Date;
48
+ }
@@ -0,0 +1,68 @@
1
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../shared";
2
+ import { TaskPriority, TaskStatus } from "../evo-task";
3
+
4
+ // ----- MeetingTypes
5
+ export type MeetingType =
6
+ | "regular"
7
+ | "oneonone"
8
+ | "feedback"
9
+ | "presentation"
10
+ | "other";
11
+ export enum IMeetingType {
12
+ Regular = "regular", // A regular meeting
13
+ OneOnOne = "oneonone", // A one-on-one meeting
14
+ Feedback = "feedback", // A feedback session
15
+ Presentation = "presentation", // A presentation meeting
16
+ Other = "other", // Any other type of meeting
17
+ }
18
+
19
+ // Interface for Event within a Meeting (meetingEvent)
20
+ export interface IMeetingEvent {
21
+ eventRef: FirestoreDocumentReference; // Reference to the original event
22
+ participantNames: string[]; // List of participant names
23
+ participantRefs: FirestoreDocumentReference[]; // List of participant references
24
+ startDate: Date; // Start date and time of the event
25
+ endDate?: Date; // Optional end date and time of the event
26
+ }
27
+
28
+ // Interface for Tasks within a Meeting (meetingTasks)
29
+ export interface IMeetingTask {
30
+ taskRef: FirestoreDocumentReference; // Reference to the original task
31
+ title: string; // Title (copied from the original task)
32
+ status: TaskStatus; // Status (can be updated independently from the original task)
33
+ priority?: TaskPriority; // Priority (copied from the original task)
34
+ assigneeName?: string; // Name of the assignee (copied from the original task)
35
+ }
36
+
37
+ // Interface for Talking Point Templates (talkingPointTemplates)
38
+ export interface ITalkingPointTemplate extends IFireDoc {
39
+ title: string; // Title of the talking point
40
+ description?: string; // Optional detailed description
41
+ tags?: ITag[]; // Optional tags for categorization
42
+ }
43
+
44
+ // Interface for Talking Points within a Meeting (meetingTalkingPoints)
45
+ export interface IMeetingTalkingPoint {
46
+ templateRef: FirestoreDocumentReference; // Reference to the original template
47
+ title: string; // Title (can be copied from the template or edited)
48
+ description?: string; // Description (can be copied from the template or edited)
49
+ tags?: ITag[]; // Tags (can be copied from the template or edited)
50
+ discussed: boolean; // Flag to indicate if the talking point was discussed
51
+ notes?: string; // Optional field for notes taken during the discussion
52
+ assigneeName?: string; // Name of the assignee (optional)
53
+ assigneeRef?: FirestoreDocumentReference; // Reference to the assignee (optional)
54
+ }
55
+
56
+ // Interface for Meeting Instances (meetingInstances)
57
+ export interface IMeeting extends IFireDoc {
58
+ title: string; // Title of the meeting
59
+ description?: string; // Optional description of the meeting
60
+ creatorName: string; // Name of the user who created the meeting
61
+ creatorRef: FirestoreDocumentReference; // reference to the user who created the meeting
62
+ event: IMeetingEvent;
63
+ type: MeetingType; // Type of meeting
64
+ tasks?: IMeetingTask[];
65
+ talkingPoints?: IMeetingTalkingPoint[];
66
+ tags?: ITag[];
67
+ [key: string]: unknown; // index signature
68
+ }
@@ -0,0 +1,95 @@
1
+ import {
2
+ FirestoreDocumentReference,
3
+ IFireDoc,
4
+ IGeoPoint,
5
+ ITag,
6
+ } from "../shared";
7
+
8
+ // ----- PeopleTypes
9
+ // PeopleTypes
10
+ export type EmployeeStatus = "active" | "inactive" | "draft";
11
+ export enum IEmployeeStatus {
12
+ Active = "active",
13
+ Inactive = "inactive",
14
+ Draft = "draft",
15
+ }
16
+
17
+ export interface IEmployeeCounters {
18
+ active: number;
19
+ inactive: number;
20
+ draft: number;
21
+ deleted: number;
22
+ total: number;
23
+ }
24
+
25
+ export interface IProfile extends IFireDoc {
26
+ display_name: string;
27
+ last_name?: string | null;
28
+ first_name?: string | null;
29
+ gender?: string | null;
30
+ birthdate?: Date | null;
31
+ photo_ref?: string | null;
32
+ photo_url?: string | null;
33
+ }
34
+
35
+ export interface IEmployee extends IProfile {
36
+ employee_id?: string | null;
37
+ type?: string | null;
38
+ job_title?: string | null;
39
+ status?: EmployeeStatus;
40
+ company_name?: string | null;
41
+ companyRef?: FirestoreDocumentReference;
42
+ date_joining?: Date | null;
43
+ reporting_to_name?: string | null;
44
+ reporting_toRef?: FirestoreDocumentReference;
45
+ department_name?: string | null;
46
+ departmentRef?: FirestoreDocumentReference;
47
+ office_name?: string | null;
48
+ officeRef?: FirestoreDocumentReference;
49
+ work_email?: string | null;
50
+ work_phone?: string | null;
51
+ work_mobile?: string | null;
52
+ tags?: ITag[];
53
+ userRef?: FirestoreDocumentReference;
54
+ [key: string]: unknown; // index signature
55
+ }
56
+
57
+ export interface IDepartment extends IFireDoc {
58
+ code: string;
59
+ name: string;
60
+ lead_name?: string | null;
61
+ leadRef?: FirestoreDocumentReference;
62
+ parent_department_name?: string | null;
63
+ parent_departmentRef?: FirestoreDocumentReference | null;
64
+ readonly employee_counters?: IEmployeeCounters;
65
+ tags?: ITag[];
66
+ }
67
+
68
+ export interface IOffice extends IFireDoc {
69
+ code: string;
70
+ name: string;
71
+ timezone?: string | null;
72
+ company_name?: string | null;
73
+ companyRef?: FirestoreDocumentReference;
74
+ lead_name?: string | null;
75
+ leadRef?: FirestoreDocumentReference;
76
+ address_line1?: string;
77
+ address_line2?: string;
78
+ address_city?: string;
79
+ address_state?: string;
80
+ address_zip?: string;
81
+ address_country?: string;
82
+ address_geo?: IGeoPoint;
83
+ readonly employee_counters?: IEmployeeCounters;
84
+ tags?: ITag[];
85
+ }
86
+
87
+ export interface ICompany extends IFireDoc {
88
+ code: string;
89
+ name: string;
90
+ lead_name?: string | null;
91
+ leadRef?: FirestoreDocumentReference;
92
+ readonly employee_counters?: IEmployeeCounters;
93
+ tags?: ITag[];
94
+ [key: string]: unknown; // index signature
95
+ }
@@ -0,0 +1,155 @@
1
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../shared";
2
+ // ---- Survey
3
+ //Survey
4
+ export type SurveyPermission = "private" | "company" | "public";
5
+ export enum ISurveyPermission {
6
+ Private = "private",
7
+ Company = "company",
8
+ Public = "public",
9
+ }
10
+
11
+ export type SurveyType = "360" | "general";
12
+ export enum ISurveyType {
13
+ Review360 = "360",
14
+ General = "general",
15
+ }
16
+
17
+ export type SurveyStatus = "draft" | "ready" | "archived";
18
+ export enum ISurveyStatus {
19
+ Draft = "draft",
20
+ Ready = "ready",
21
+ Archived = "archived",
22
+ }
23
+
24
+ export type SurveyQuestionType = "scale" | "essay" | "options";
25
+ export enum ISurveyQuestionType {
26
+ Scale = "scale",
27
+ Essay = "essay",
28
+ Options = "options",
29
+ }
30
+
31
+ export interface IQuestion extends IFireDoc {
32
+ surveyId: string;
33
+ sectionId: string;
34
+ statement?: string;
35
+ description?: string;
36
+ description_text?: string;
37
+ order?: number;
38
+ required?: boolean;
39
+ tags?: ITag[];
40
+ type?: ISurveyQuestionType;
41
+ }
42
+
43
+ export interface IQuestionScale extends IQuestion {
44
+ type: ISurveyQuestionType.Scale;
45
+ scale_min?: number;
46
+ scale_max?: number;
47
+ }
48
+
49
+ export enum IQuestionScaleDefaultsScales {
50
+ Min = 0,
51
+ Max = 5,
52
+ }
53
+
54
+ export interface IQuestionEssay extends IQuestion {
55
+ type: ISurveyQuestionType.Essay;
56
+ length_min?: number;
57
+ length_max?: number;
58
+ }
59
+ export enum IQuestionEssayDefaultsLength {
60
+ Min = 0,
61
+ Max = 1024,
62
+ }
63
+
64
+ export interface IQuestionMultipleChoice extends IQuestion {
65
+ type: ISurveyQuestionType.Options;
66
+ options: string[];
67
+ allow_multiple_selections?: boolean;
68
+ }
69
+
70
+ export interface ISection extends IFireDoc {
71
+ surveyId: string;
72
+ name: string;
73
+ description: string;
74
+ order: number;
75
+ questions: (IQuestionEssay | IQuestionScale | IQuestionMultipleChoice)[];
76
+ readonly question_count?: number;
77
+ }
78
+
79
+ export interface ISurvey extends IFireDoc {
80
+ name: string;
81
+ description?: string;
82
+ status: SurveyStatus;
83
+ permission: SurveyPermission;
84
+ tags?: ITag[];
85
+ type: SurveyType;
86
+ sections?: ISection[];
87
+ readonly section_count?: number;
88
+ readonly question_count?: number;
89
+ }
90
+
91
+ export type SurveyDeploymentStatus =
92
+ | "draft"
93
+ | "open"
94
+ | "closed"
95
+ | "in_progress"
96
+ | "paused";
97
+ export enum ISurveyDeploymentStatus {
98
+ Draft = "draft", //A aplicação está sendo criada e ainda não foi aberta.
99
+ Open = "open", //A aplicação está aberta e disponível para submissões.
100
+ Closed = "closed", //A aplicação está fechada e não aceita mais submissões.
101
+ InProgress = "in_progress", // A aplicação está em andamento, mas ainda não foi fechada para novas
102
+ Paused = "paused", // A aplicação está pausada, está sem receber submissões temporariamente
103
+ }
104
+
105
+ export type SurveySubmissionStatus =
106
+ | "not_started"
107
+ | "in_progress"
108
+ | "completed";
109
+ export enum ISurveySubmissionStatus {
110
+ NotStarted = "not_started", //A submissão ainda não foi iniciada.
111
+ InProgress = "in_progress", //A submissão está em andamento.
112
+ Completed = "completed", //A submissão foi concluída.
113
+ }
114
+
115
+ export interface ISurveyResponse extends IFireDoc {
116
+ question_id: string;
117
+ answer: string | string[]; // String para resposta única, array de strings para múltipla escolha
118
+ date: Date;
119
+ }
120
+
121
+ export interface ISurveySubmission extends IFireDoc {
122
+ deploymentId?: string;
123
+ submission_date?: Date | null;
124
+ status: SurveySubmissionStatus;
125
+ modified_after_completion: boolean;
126
+ inviteeId?: string;
127
+ user_name?: string;
128
+ responses?: ISurveyResponse[];
129
+ }
130
+
131
+ export interface ISurveyInvitee extends IFireDoc {
132
+ name: string;
133
+ email?: string;
134
+ phone?: string;
135
+ responded: boolean;
136
+ }
137
+
138
+ export interface ISurveyDeployment extends IFireDoc {
139
+ name: string;
140
+ description?: string;
141
+ surveySourceRef?: FirestoreDocumentReference;
142
+ survey?: ISurvey | null;
143
+ start_date: Date | null;
144
+ end_date: Date | null;
145
+ status: SurveyDeploymentStatus;
146
+ allow_edit_answers: boolean;
147
+ allow_partial_submission: boolean;
148
+ invitees?: ISurveyInvitee[] | null;
149
+ readonly invitee_count?: number;
150
+ submissions?: ISurveySubmission[] | null;
151
+ readonly submission_count?: number;
152
+ readonly submission_not_started_count?: number;
153
+ readonly submission_in_progress_count?: number;
154
+ readonly submission_completed_count?: number;
155
+ }
@@ -0,0 +1,41 @@
1
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../shared";
2
+ // ----- TaskTypes
3
+ // Enum for Task Instance Status
4
+
5
+ export type TaskStatus =
6
+ | "not_started"
7
+ | "in_progress"
8
+ | "completed"
9
+ | "cancelled"
10
+ | "on_hold";
11
+
12
+ export enum ITaskStatus {
13
+ NotStarted = "not_started",
14
+ InProgress = "in_progress",
15
+ Completed = "completed",
16
+ Cancelled = "cancelled",
17
+ OnHold = "on_hold",
18
+ }
19
+
20
+ // Interface for Task Priority
21
+ export type TaskPriority = "low" | "medium" | "high";
22
+ export enum ITaskPriority {
23
+ Low = "low",
24
+ Medium = "medium",
25
+ High = "high",
26
+ }
27
+
28
+ // Interface for Task Instances (taskInstances)
29
+ export interface ITask extends IFireDoc {
30
+ title: string; // Title of the task
31
+ description?: string; // Optional description of the task
32
+ creatorName: string; // Name of the user who created the task
33
+ creatorRef: FirestoreDocumentReference; // reference to the user who created the task
34
+ startDate: Date; // Start date and time of the task
35
+ dueDate?: Date; // Optional due date and time of the task
36
+ status: TaskStatus; // Status of the task
37
+ priority?: TaskPriority; // Priority of the task (optional)
38
+ assigneeName?: string; // Name of the assignee (optional)
39
+ assigneeRef?: FirestoreDocumentReference; // Reference to the assignee (optional)
40
+ tags?: ITag[];
41
+ }
@@ -0,0 +1,26 @@
1
+ import { FirestoreDocumentReference, IFireDoc } from "../shared";
2
+
3
+ // ----- TenantTypes
4
+ //TenantTypes
5
+ export type TenantLanguage = "ptBR" | "en";
6
+ export enum ITenantLanguage {
7
+ ptBR = "ptBR",
8
+ en = "en",
9
+ }
10
+
11
+ export type TenantStatus = "draft" | "published" | "archived";
12
+ export enum ITenantStatus {
13
+ Draft = "draft",
14
+ Published = "published",
15
+ Archived = "archived",
16
+ }
17
+
18
+ export interface ITenant extends IFireDoc {
19
+ name: string;
20
+ url_alias: string;
21
+ date_format: "DD/MM/YYYY hh:mm:ss" | string;
22
+ language: TenantLanguage | "ptBR";
23
+ status: TenantStatus | "draft";
24
+ timezone: "(GMT +00:00) Lisbon" | string;
25
+ created_by?: FirestoreDocumentReference;
26
+ }
@@ -0,0 +1,30 @@
1
+ // ----- FirestoreTypes
2
+ // Definir o tipo unificado para DocumentReference
3
+ export interface FirestoreDocumentReference<T = any> {
4
+ id: string;
5
+ get(): Promise<T>;
6
+ // Outros métodos comuns que você utiliza
7
+ }
8
+
9
+ export interface IGeoPoint {
10
+ latitude: number;
11
+ longitude: number;
12
+ }
13
+
14
+ //fsTypes
15
+ export interface IFireDoc extends Record<string, unknown> {
16
+ readonly id: string;
17
+ readonly ref?: FirestoreDocumentReference;
18
+ tenant: string;
19
+ model_ver?: number;
20
+ created_at?: Date | null;
21
+ updated_at?: Date | null;
22
+ deleted_at?: Date | null;
23
+ }
24
+
25
+ // ----- TagTypes
26
+ export interface ITag {
27
+ name: string;
28
+ color?: string;
29
+ hidden: boolean;
30
+ }
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "evo360-types",
3
+ "version": "1.0.0",
4
+ "description": "HREVO360 Shared Types",
5
+ "main": "dist/index.d.ts",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc && copyfiles -u 1 src/**/*.d.ts dist"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/seu-usuario/seu-repositorio.git"
16
+ },
17
+ "author": "Luis Furtado",
18
+ "private": false,
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "zod": "^3.23.8"
22
+ }
23
+ }