Compare commits

..

8 Commits

Author SHA1 Message Date
omaroughriss
085713400c Simplify and clean up unused UI 2025-10-23 16:44:22 +02:00
omaroughriss
eaf5b653e9 Clean up unused modal 2025-10-23 16:43:10 +02:00
omaroughriss
6d736e3668 Simplify notifications 2025-10-23 16:41:57 +02:00
omaroughriss
4e35fa0237 Fix: correct modal component integration 2025-10-23 16:40:37 +02:00
omaroughriss
8b6b62e643 Restore complete 4NK integration workflow 2025-10-23 16:38:43 +02:00
omaroughriss
6d65014a45 Clean up unused state variables and imports 2025-10-23 16:36:42 +02:00
omaroughriss
a03cf5c8ed Adapt FolderData interface to simplified model 2025-10-23 16:33:40 +02:00
omaroughriss
48d3dbe21b Simplifiy FolderData model 2025-10-23 16:30:58 +02:00
2 changed files with 315 additions and 2287 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,12 @@
import { isFileBlob, type FileBlob } from "./Data";
import type { RoleDefinition } from "./Roles";
export interface FolderData {
folderNumber: string;
name: string;
deedType: string;
description: string;
archived_description: string;
status: string;
created_at: string;
updated_at: string;
customers: string[];
documents: FileBlob[];
notes: string[];
stakeholders: string[];
}
export function isFolderData(data: any): data is FolderData {
@ -22,10 +15,7 @@ export function isFolderData(data: any): data is FolderData {
const requiredStringFields = [
'folderNumber',
'name',
'deedType',
'description',
'archived_description',
'status',
'created_at',
'updated_at'
];
@ -34,26 +24,10 @@ export function isFolderData(data: any): data is FolderData {
if (typeof data[field] !== 'string') return false;
}
const requiredArrayFields = [
'customers',
'notes',
'stakeholders'
];
for (const field of requiredArrayFields) {
if (!Array.isArray(data[field]) || !data[field].every((item: any) => typeof item === 'string')) {
// Vérifier que notes est un tableau de chaînes
if (!Array.isArray(data.notes) || !data.notes.every((item: any) => typeof item === 'string')) {
return false;
}
}
const requiredFileBlobArrayFields = [
'documents',
];
for (const field of requiredFileBlobArrayFields) {
if (!Array.isArray(data[field])) return false;
if (data[field].length > 0 && !data[field].every(isFileBlob)) return false;
}
return true;
}
@ -61,16 +35,10 @@ export function isFolderData(data: any): data is FolderData {
const emptyFolderData: FolderData = {
folderNumber: '',
name: '',
deedType: '',
description: '',
archived_description: '',
status: '',
created_at: '',
updated_at: '',
customers: [],
documents: [],
notes: [],
stakeholders: []
notes: []
};
const folderDataFields: string[] = Object.keys(emptyFolderData);
@ -88,7 +56,7 @@ export interface FolderCreated {
data: FolderData,
}
export function setDefaultFolderRoles(ownerId: string, stakeholdersId: string[], customersId: string[]): Record<string, RoleDefinition> {
export function setDefaultFolderRoles(ownerId: string): Record<string, RoleDefinition> {
return {
demiurge: {
members: [ownerId],
@ -106,28 +74,6 @@ export function setDefaultFolderRoles(ownerId: string, stakeholdersId: string[],
],
storages: []
},
stakeholders: {
members: stakeholdersId,
validation_rules: [
{
quorum: 0.5,
fields: ['documents', 'notes'],
min_sig_member: 1,
},
],
storages: []
},
customers: {
members: customersId,
validation_rules: [
{
quorum: 0.0,
fields: folderDataFields,
min_sig_member: 0.0,
},
],
storages: []
},
apophis: {
members: [ownerId],
validation_rules: [],