80 lines
1.7 KiB
TypeScript
80 lines
1.7 KiB
TypeScript
export interface VesselData {
|
|
imo: string;
|
|
vesselName: string;
|
|
type: string;
|
|
length: number;
|
|
width: number;
|
|
estimatedEnginePower: number;
|
|
}
|
|
|
|
export interface CarbonCalculation {
|
|
yearlyEmissions: number;
|
|
offsetCost: number;
|
|
recommendedProjects: Array<{
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
costPerTon: number;
|
|
}>;
|
|
}
|
|
|
|
export interface CarbonEstimate {
|
|
fuelConsumption: number; // liters per year
|
|
co2Emissions: number; // tons per year
|
|
}
|
|
|
|
export interface TripEstimate {
|
|
distance: number; // nautical miles
|
|
duration: number; // hours
|
|
fuelConsumption: number; // liters
|
|
co2Emissions: number; // tons
|
|
}
|
|
|
|
export interface Currency {
|
|
code: string;
|
|
symbol: string;
|
|
rate: number; // Exchange rate relative to USD
|
|
}
|
|
|
|
export type CurrencyCode = 'USD' | 'EUR' | 'GBP' | 'CHF';
|
|
|
|
export interface Portfolio {
|
|
id: number;
|
|
name: string;
|
|
description: string;
|
|
projects: OffsetProject[];
|
|
pricePerTon: number;
|
|
currency: CurrencyCode;
|
|
}
|
|
|
|
export interface OffsetProject {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
shortDescription: string;
|
|
imageUrl: string;
|
|
pricePerTon: number;
|
|
percentage?: number; // Added percentage field for project's contribution to portfolio
|
|
location: string;
|
|
type: string;
|
|
verificationStandard: string;
|
|
impactMetrics: {
|
|
co2Reduced: number;
|
|
treesPlanted?: number;
|
|
livelihoodsImproved?: number;
|
|
};
|
|
}
|
|
|
|
export interface OffsetOrder {
|
|
id: string;
|
|
amountCharged: number; // Amount in cents
|
|
currency: CurrencyCode;
|
|
tons: number;
|
|
portfolio: Portfolio;
|
|
status: 'pending' | 'completed' | 'failed';
|
|
createdAt: string;
|
|
dryRun: boolean;
|
|
}
|
|
|
|
export type CalculatorType = 'trip' | 'annual';
|