Spaces:
Runtime error

File size: 3,236 Bytes
ad79323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
export const APP_NAME = "Courtrix";
export const APP_TIME_ZONE = "Africa/Cairo";
export const SESSION_COOKIE_NAME =
  process.env.SESSION_COOKIE_NAME?.trim() || "courtrix_session";
export const SESSION_TTL_DAYS = Number(process.env.SESSION_TTL_DAYS || "30");
export const CUSTOMERS_PAGE_SIZE = 12;
export const CASES_PAGE_SIZE = 12;
export const SESSION_PAGE_SIZE = 20;
export const MAX_CASE_FILE_SIZE_BYTES = 25 * 1024 * 1024;
export const MINIO_BUCKET_NAME =
  process.env.MINIO_BUCKET_NAME?.trim() || "courtrix-case-files";
export const MINIO_ENDPOINT = process.env.MINIO_ENDPOINT?.trim() || "localhost";
export const MINIO_PORT = Number(process.env.MINIO_PORT || "9000");
export const MINIO_USE_SSL = process.env.MINIO_USE_SSL === "true";
export const MINIO_ACCESS_KEY =
  process.env.MINIO_ACCESS_KEY?.trim() || "courtrixminio";
export const MINIO_SECRET_KEY =
  process.env.MINIO_SECRET_KEY?.trim() || "courtrixminiosecret";
export const MINIO_PUBLIC_BASE_URL =
  process.env.MINIO_PUBLIC_BASE_URL?.trim() || "";
export const RAG_SERVICE_URL =
  process.env.RAG_SERVICE_URL?.trim() || "http://localhost:8001";
export const RAG_SERVICE_SECRET =
  process.env.RAG_SERVICE_SECRET?.trim() || "courtrix-rag-secret";
export const RAG_REQUEST_TIMEOUT_MS = Number(
  process.env.RAG_REQUEST_TIMEOUT_MS || "120000",
);

export const customerGenderValues = ["MALE", "FEMALE"] as const;
export type CustomerGenderValue = (typeof customerGenderValues)[number];

export const customerDatePresetValues = [
  "all",
  "today",
  "thisWeek",
  "thisMonth",
] as const;
export type CustomerDatePresetValue =
  (typeof customerDatePresetValues)[number];

export const caseTypeValues = [
  "CIVIL",
  "CRIMINAL",
  "PERSONAL_STATUS",
] as const;
export type CaseTypeValue = (typeof caseTypeValues)[number];

export const caseStatusValues = ["OPEN", "CLOSED"] as const;
export type CaseStatusValue = (typeof caseStatusValues)[number];

export const caseFileRagStatusValues = [
  "PENDING",
  "PROCESSING",
  "READY",
  "FAILED",
  "SKIPPED",
] as const;
export type CaseFileRagStatusValue = (typeof caseFileRagStatusValues)[number];

export const sessionDatePresetValues = [
  "all",
  "today",
  "tomorrow",
  "thisWeek",
  "thisMonth",
  "thisYear",
] as const;
export type SessionDatePresetValue = (typeof sessionDatePresetValues)[number];

export const calendarViewValues = ["week", "month"] as const;
export type CalendarViewValue = (typeof calendarViewValues)[number];

export const allowedCaseFileMimeTypes = [
  "application/pdf",
  "image/jpeg",
  "image/png",
  "image/webp",
  "image/gif",
  "image/svg+xml",
  "text/plain",
  "text/csv",
  "application/msword",
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "application/vnd.ms-excel",
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "application/vnd.ms-powerpoint",
  "application/vnd.openxmlformats-officedocument.presentationml.presentation",
] as const;

export const allowedCaseFileExtensions = [
  ".pdf",
  ".jpg",
  ".jpeg",
  ".png",
  ".webp",
  ".gif",
  ".svg",
  ".txt",
  ".csv",
  ".doc",
  ".docx",
  ".xls",
  ".xlsx",
  ".ppt",
  ".pptx",
] as const;

export const publicRoutePrefixes = ["/login", "/register"];