227 lines
5.3 KiB
TypeScript
227 lines
5.3 KiB
TypeScript
export interface Project {
|
|
id: string;
|
|
name: string;
|
|
client: string;
|
|
startDate: string | null;
|
|
endDate: string | null;
|
|
environment: string | null;
|
|
technician: string | null;
|
|
weightKg?: number | null;
|
|
paintedWeight?: number;
|
|
createdAt?: string;
|
|
updatedAt?: string;
|
|
parts?: Part[];
|
|
paintingSchemes?: PaintingScheme[];
|
|
applicationRecords?: ApplicationRecord[];
|
|
inspections?: Inspection[];
|
|
createdBy?: string;
|
|
}
|
|
|
|
export interface Part {
|
|
id: string;
|
|
projectId: string;
|
|
description: string;
|
|
dimensions?: string;
|
|
weight?: number;
|
|
type?: string;
|
|
area?: number;
|
|
complexity?: number;
|
|
quantity: number;
|
|
notes?: string;
|
|
}
|
|
|
|
export interface PaintingScheme {
|
|
id: string;
|
|
projectId: string;
|
|
name: string;
|
|
type?: string;
|
|
coat?: string; // Primer, Intermediate, Finish, Stripe Coat
|
|
solidsVolume?: number;
|
|
yieldTheoretical?: number;
|
|
epsMin?: number;
|
|
epsMax?: number;
|
|
dilution?: number;
|
|
manufacturer?: string;
|
|
color?: string;
|
|
notes?: string;
|
|
// Consumption Planning
|
|
paintConsumption?: number;
|
|
thinnerConsumption?: number;
|
|
paintId?: string | TechnicalDataSheet; // ID or Populated
|
|
thinnerId?: string | TechnicalDataSheet; // ID or Populated
|
|
colorHex?: string;
|
|
thinnerSymbol?: string;
|
|
createdBy?: string;
|
|
}
|
|
|
|
export interface ApplicationRecord {
|
|
id: string;
|
|
projectId: string;
|
|
coatStage: string;
|
|
pieceDescription?: string;
|
|
date?: string;
|
|
operator?: string;
|
|
realWeight?: number;
|
|
volumeUsed?: number;
|
|
areaPainted?: number;
|
|
wetThicknessAvg?: number;
|
|
dryThicknessCalc?: number;
|
|
realYield?: number;
|
|
method?: string;
|
|
diluentUsed?: number;
|
|
notes?: string;
|
|
items?: {
|
|
partId: string;
|
|
quantity: number;
|
|
}[];
|
|
createdBy?: string;
|
|
}
|
|
|
|
export interface Inspection {
|
|
id: string;
|
|
projectId: string;
|
|
applicationRecordId?: string; // Link to Lote
|
|
stockItemId?: string | {
|
|
_id: string;
|
|
batchNumber: string;
|
|
dataSheetId: {
|
|
name: string;
|
|
type?: string;
|
|
manufacturer?: string;
|
|
};
|
|
}; // Link to Stock Item (Paint)
|
|
instrumentId?: string | {
|
|
_id: string;
|
|
name: string;
|
|
serialNumber: string;
|
|
type: string;
|
|
}; // Link to Instrument
|
|
type?: 'painting' | 'surface_treatment';
|
|
|
|
// Common
|
|
date?: string;
|
|
inspector?: string;
|
|
partTemperature?: number;
|
|
weightKg?: number;
|
|
appearance?: string; // 'approved' | 'rejected' | 'notes'
|
|
defects?: string;
|
|
photos?: string[];
|
|
|
|
// Painting
|
|
pieceDescription?: string;
|
|
epsPoints?: (number | null)[];
|
|
adhesionTest?: string;
|
|
|
|
// Surface Treatment
|
|
batch?: string;
|
|
treatmentExecutor?: string;
|
|
treatmentType?: string;
|
|
cleaningDegree?: string;
|
|
roughnessReadings?: (number | null)[];
|
|
flashRust?: string;
|
|
temperature?: number;
|
|
relativeHumidity?: number;
|
|
period?: 'morning' | 'afternoon' | 'night';
|
|
createdBy?: string;
|
|
}
|
|
|
|
export interface TechnicalDataSheet {
|
|
id: string;
|
|
_id?: string;
|
|
name: string;
|
|
manufacturer?: string;
|
|
type?: string;
|
|
fileUrl: string;
|
|
uploadDate: string;
|
|
|
|
solidsVolume?: number;
|
|
density?: number;
|
|
mixingRatio?: string;
|
|
yieldTheoretical?: number;
|
|
wftMin?: number;
|
|
wftMax?: number;
|
|
dftMin?: number;
|
|
dftMax?: number;
|
|
reducer?: string;
|
|
mixingRatioWeight?: string;
|
|
mixingRatioVolume?: string;
|
|
dftReference?: number;
|
|
yieldFactor?: number;
|
|
dilution?: number;
|
|
notes?: string;
|
|
manufacturerCode?: string;
|
|
minStock?: number;
|
|
typicalApplication?: string;
|
|
}
|
|
|
|
export interface PieceCategory {
|
|
id: string;
|
|
name: string;
|
|
weight: number;
|
|
area?: number;
|
|
historicalYield: number;
|
|
historicalDft: number;
|
|
efficiency: number;
|
|
litrosPeso?: number; // Consumo calculado por peso
|
|
litrosArea?: number; // Consumo calculado por área
|
|
}
|
|
|
|
export interface YieldStudy {
|
|
id: string;
|
|
name: string;
|
|
dataSheetId: string;
|
|
targetDft: number;
|
|
dilutionPercent: number;
|
|
categories: PieceCategory[];
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
|
|
totalWeight: number;
|
|
estimatedPaintVolume: number; // Por peso (kg)
|
|
estimatedReducerVolume: number; // Por peso (kg)
|
|
estimatedPaintVolumeByArea?: number; // Por área (m²)
|
|
estimatedReducerVolumeByArea?: number; // Por área (m²)
|
|
averageComplexity: number;
|
|
}
|
|
|
|
// User Roles System
|
|
export type UserRole = 'guest' | 'user' | 'admin';
|
|
|
|
export interface AppUser {
|
|
id: string;
|
|
_id?: string;
|
|
clerkId: string;
|
|
email: string;
|
|
name: string;
|
|
role: UserRole;
|
|
isBanned: boolean;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
organizationId?: string | null;
|
|
organizationRole?: UserRole | null;
|
|
}
|
|
|
|
|
|
export interface GeometryType {
|
|
id: string;
|
|
_id?: string;
|
|
name: string;
|
|
efficiencyLoss?: number;
|
|
updatedAt?: string;
|
|
}
|
|
|
|
export type NotificationType = 'info' | 'warning' | 'error' | 'success';
|
|
|
|
export interface INotification {
|
|
_id: string;
|
|
title: string;
|
|
message: string;
|
|
type: NotificationType;
|
|
isRead: boolean;
|
|
isArchived: boolean;
|
|
archivedBy: string[];
|
|
deletedBy: string[];
|
|
createdAt: string;
|
|
metadata?: Record<string, unknown>;
|
|
}
|