-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
186 lines (170 loc) · 4.4 KB
/
Copy pathtypes.ts
File metadata and controls
186 lines (170 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
export interface User {
id: string;
name: string;
email: string;
companyName: string;
cnpj: string;
address: string;
onboardingCompleted: boolean;
plan: 'free' | 'basico' | 'pro' | 'personalite' | 'enterprise';
isAdmin?: boolean;
status?: 'active' | 'suspended';
status_assinatura?: 'active' | 'canceled' | 'past_due' | 'trialing'; // Added for Stripe integration
stripeCustomerId?: string; // For Stripe
stripeSubscriptionId?: string; // For Stripe
isOnline?: boolean;
createdAt: string;
lastLogin?: string;
achievements?: string[];
certificates?: ComplianceCertificate[];
doc_generation_count?: number;
doc_generation_last_reset?: string;
}
export interface ComplianceCertificate {
id: string;
processId: string;
issueDate: string;
expiryDate?: string;
status: 'active' | 'expired' | 'revoked';
qrCodeUrl?: string;
pdfUrl?: string;
version: number;
}
export interface AccessLog {
id?: string;
userId: string;
userName: string;
timestamp: string;
userAgent: string;
type: 'login' | 'logout' | 'activity';
}
export interface Achievement {
id: string;
title: string;
description: string;
type: 'bronze' | 'silver' | 'gold' | 'platinum';
icon: string;
}
export interface DataProcess {
id: string;
name: string;
description: string;
status: 'pending' | 'in_progress' | 'completed';
lastStep: number;
isCertified?: boolean;
currentCertificateId?: string;
answers?: SectorAnswers;
}
export interface SectorMapping {
id: string;
name: string;
isCustom: boolean;
processes: DataProcess[];
status?: 'pending' | 'in_progress' | 'completed';
lastStep?: number;
isLocked?: boolean;
}
export interface SectorAnswers {
processName: string;
responsibleRole: string;
purpose: string;
collectedData: string[];
hasSensitiveData: boolean;
dataSubjects: string[];
estimatedVolume: string;
legalBasis: string;
consentMechanism?: string;
hasConsentProof?: boolean;
storageType: 'Digital' | 'Físico' | 'Híbrido';
collectionChannels: string[];
cloudProvider?: string;
systemsUsed?: string;
hasBackups: boolean;
hasEncryption: boolean;
isSharedInternal: boolean;
isSharedExternal: boolean;
externalThirdParties?: string;
sharedExternalDocumentUrl?: string;
sharedExternalDocumentName?: string;
isInternationalTransfer: boolean;
accessControl: string;
hasMFA: boolean;
hasIncidentPlan: boolean;
hasStaffTraining: boolean;
retentionPeriod: string;
deletionMethod: string;
hasSecondaryUse: boolean;
secondaryUsePurpose?: string;
}
export interface QuestionnaireData {
companySize: 'MEI' | 'ME' | 'EPP' | 'EM' | 'EG';
industry: string;
sectors: SectorMapping[];
lastUpdated: string;
}
export interface ValidationResult {
isValid: boolean;
feedback: string;
missingElements: string[];
}
export interface ValidationHistoryEntry {
date: string;
evidence: string;
result: ValidationResult;
observations?: string;
}
export interface ComplianceTask {
id: string;
title: string;
description: string;
explanation: string;
priority: 'Alta' | 'Média' | 'Baixa';
status: 'Pendente' | 'Automatizada' | 'Concluída' | 'Revisar';
targetDocument: string;
processId?: string;
sectorId?: string;
dueDate?: string;
evidence?: string;
validationResult?: ValidationResult;
history?: ValidationHistoryEntry[];
observations?: string;
evidenceUrl?: string;
// Multi-tenancy & LGPD audit fields
ownerID?: string; // UID do proprietário do dado (isolamento)
user_id?: string; // UID do usuário que realizou a última ação (auditoria)
last_updated?: string; // ISO timestamp da última modificação atômica
}
export interface AuthState {
user: User | null;
isAuthenticated: boolean;
loading: boolean;
}
export interface SupportTicket {
id: string;
userId: string;
userName: string;
userEmail: string;
subject: string;
message: string;
status: 'open' | 'in_progress' | 'resolved';
createdAt: string;
internalNotes?: string;
attachment?: string;
}
export interface AuditLog {
id?: string;
adminId: string;
adminName: string;
action: string;
targetUserId: string;
details: string;
timestamp: string;
}
export interface Subscription {
id: string;
userId: string;
plan: 'free' | 'basico' | 'pro' | 'personalite' | 'enterprise';
status: 'active' | 'canceled' | 'past_due' | 'trialing';
currentPeriodEnd: string;
stripeSubscriptionId?: string;
}