2026-04-25 22:51:36 +12:00
|
|
|
import type {
|
|
|
|
|
ClientAccessAccount,
|
|
|
|
|
ClientAccessPowerBiExport,
|
|
|
|
|
Mix,
|
|
|
|
|
Product,
|
|
|
|
|
ProductCostBreakdown,
|
|
|
|
|
RawMaterial,
|
|
|
|
|
Scenario
|
|
|
|
|
} from '$lib/types';
|
2026-04-25 20:43:37 +12:00
|
|
|
|
|
|
|
|
export const mockRawMaterials: RawMaterial[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
name: 'Maize',
|
|
|
|
|
unit_of_measure: 'tonne',
|
|
|
|
|
kg_per_unit: 1000,
|
|
|
|
|
status: 'active',
|
|
|
|
|
current_price: {
|
|
|
|
|
market_value: 520,
|
|
|
|
|
waste_percentage: 0.02,
|
|
|
|
|
cost_per_kg: 0.5304,
|
|
|
|
|
effective_date: '2026-04-01'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
name: 'Barley',
|
|
|
|
|
unit_of_measure: 'tonne',
|
|
|
|
|
kg_per_unit: 1000,
|
|
|
|
|
status: 'active',
|
|
|
|
|
current_price: {
|
|
|
|
|
market_value: 470,
|
|
|
|
|
waste_percentage: 0.015,
|
|
|
|
|
cost_per_kg: 0.4771,
|
|
|
|
|
effective_date: '2026-04-01'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const mockMixes: Mix[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
2026-04-25 22:51:36 +12:00
|
|
|
client_name: 'Hunter Premium Produce',
|
|
|
|
|
name: 'Hunter Orchard Blend',
|
2026-04-25 20:43:37 +12:00
|
|
|
status: 'active',
|
|
|
|
|
ingredients: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
raw_material_id: 1,
|
|
|
|
|
raw_material_name: 'Maize',
|
|
|
|
|
quantity_kg: 180,
|
|
|
|
|
cost_per_kg: 0.5304,
|
|
|
|
|
line_cost: 95.472
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
raw_material_id: 2,
|
|
|
|
|
raw_material_name: 'Barley',
|
|
|
|
|
quantity_kg: 100,
|
|
|
|
|
cost_per_kg: 0.4771,
|
|
|
|
|
line_cost: 47.71
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
total_mix_kg: 280,
|
|
|
|
|
total_mix_cost: 143.18,
|
|
|
|
|
mix_cost_per_kg: 0.5114,
|
|
|
|
|
warnings: []
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const mockProducts: Product[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
2026-04-25 22:51:36 +12:00
|
|
|
name: 'Hunter Orchard Blend 20kg',
|
|
|
|
|
client_name: 'Hunter Premium Produce',
|
2026-04-25 20:43:37 +12:00
|
|
|
mix_id: 1,
|
2026-04-25 22:51:36 +12:00
|
|
|
mix_name: 'Hunter Orchard Blend',
|
2026-04-25 20:43:37 +12:00
|
|
|
sale_type: 'standard',
|
|
|
|
|
unit_of_measure: '20kg bag',
|
|
|
|
|
distributor_margin: 0.225,
|
|
|
|
|
wholesale_margin: 0.18
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const mockCosts: ProductCostBreakdown[] = [
|
|
|
|
|
{
|
|
|
|
|
product_id: 1,
|
2026-04-25 22:51:36 +12:00
|
|
|
product_name: 'Hunter Orchard Blend 20kg',
|
2026-04-25 20:43:37 +12:00
|
|
|
finished_product_delivered: 14.208,
|
|
|
|
|
distributor_price: 18.3329,
|
|
|
|
|
wholesale_price: 17.3268,
|
|
|
|
|
warnings: []
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const mockScenarios: Scenario[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
name: 'Current Standard',
|
|
|
|
|
status: 'approved',
|
|
|
|
|
description: 'Baseline approved pricing',
|
|
|
|
|
overrides: {}
|
|
|
|
|
}
|
|
|
|
|
];
|
2026-04-25 22:51:36 +12:00
|
|
|
|
|
|
|
|
export const mockClientAccess: ClientAccessAccount[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
tenant_id: 'hunter-premium-produce',
|
|
|
|
|
name: 'Hunter Premium Produce',
|
|
|
|
|
client_code: 'HPP',
|
|
|
|
|
status: 'active',
|
|
|
|
|
powerbi_workspace: 'hunter-premium-produce-prod',
|
|
|
|
|
notes: 'Primary production client for the Lean 101 admin and access workflows',
|
|
|
|
|
created_at: '2026-04-20T09:00:00',
|
|
|
|
|
active_user_count: 1,
|
|
|
|
|
new_user_count: 1,
|
|
|
|
|
enabled_feature_count: 6,
|
|
|
|
|
total_feature_count: 6,
|
|
|
|
|
users: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
full_name: 'Amelia Hart',
|
|
|
|
|
email: 'operator@example.com',
|
|
|
|
|
role: 'admin',
|
|
|
|
|
status: 'active',
|
|
|
|
|
is_new_user: false,
|
|
|
|
|
last_login_at: '2026-04-24T11:30:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
full_name: 'Ethan Cole',
|
|
|
|
|
email: 'ethan.cole@hunterpremiumproduce.example',
|
|
|
|
|
role: 'operator',
|
|
|
|
|
status: 'invited',
|
|
|
|
|
is_new_user: true,
|
|
|
|
|
last_login_at: null,
|
|
|
|
|
created_at: '2026-04-24T15:00:00'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
features: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'dashboard',
|
|
|
|
|
feature_name: 'Dashboard',
|
|
|
|
|
feature_group: 'workspace',
|
|
|
|
|
description: 'Top-level operational dashboard',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'raw_materials',
|
|
|
|
|
feature_name: 'Raw Materials',
|
|
|
|
|
feature_group: 'costing',
|
|
|
|
|
description: 'Maintain live material costs and versions',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'mix_master',
|
|
|
|
|
feature_name: 'Mix Master',
|
|
|
|
|
feature_group: 'costing',
|
|
|
|
|
description: 'Create and maintain mix worksheets',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 4,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'products',
|
|
|
|
|
feature_name: 'Products',
|
|
|
|
|
feature_group: 'pricing',
|
|
|
|
|
description: 'Review finished product pricing',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 5,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'scenarios',
|
|
|
|
|
feature_name: 'Scenarios',
|
|
|
|
|
feature_group: 'planning',
|
|
|
|
|
description: 'Run scenario overrides and comparisons',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 6,
|
|
|
|
|
client_account_id: 1,
|
|
|
|
|
feature_key: 'powerbi_export',
|
|
|
|
|
feature_name: 'Power BI Export',
|
|
|
|
|
feature_group: 'reporting',
|
|
|
|
|
description: 'Expose client access data to BI consumers',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-24T15:00:00',
|
|
|
|
|
created_at: '2026-04-20T09:00:00'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
tenant_id: 'loft-grains',
|
|
|
|
|
name: 'Loft Grains',
|
|
|
|
|
client_code: 'LOFT',
|
|
|
|
|
status: 'onboarding',
|
|
|
|
|
powerbi_workspace: 'farm-ops-sandbox',
|
|
|
|
|
notes: 'Onboarding workspace used to test staged user enablement',
|
|
|
|
|
created_at: '2026-04-21T10:00:00',
|
|
|
|
|
active_user_count: 1,
|
|
|
|
|
new_user_count: 0,
|
|
|
|
|
enabled_feature_count: 3,
|
|
|
|
|
total_feature_count: 6,
|
|
|
|
|
users: [
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
full_name: 'Ruby Singh',
|
|
|
|
|
email: 'ruby.singh@loftgrains.example',
|
|
|
|
|
role: 'viewer',
|
|
|
|
|
status: 'active',
|
|
|
|
|
is_new_user: false,
|
|
|
|
|
last_login_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
features: [
|
|
|
|
|
{
|
|
|
|
|
id: 7,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'dashboard',
|
|
|
|
|
feature_name: 'Dashboard',
|
|
|
|
|
feature_group: 'workspace',
|
|
|
|
|
description: 'Top-level operational dashboard',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 8,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'raw_materials',
|
|
|
|
|
feature_name: 'Raw Materials',
|
|
|
|
|
feature_group: 'costing',
|
|
|
|
|
description: 'Maintain live material costs and versions',
|
|
|
|
|
enabled: false,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 9,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'mix_master',
|
|
|
|
|
feature_name: 'Mix Master',
|
|
|
|
|
feature_group: 'costing',
|
|
|
|
|
description: 'Create and maintain mix worksheets',
|
|
|
|
|
enabled: false,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 10,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'products',
|
|
|
|
|
feature_name: 'Products',
|
|
|
|
|
feature_group: 'pricing',
|
|
|
|
|
description: 'Review finished product pricing',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 11,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'scenarios',
|
|
|
|
|
feature_name: 'Scenarios',
|
|
|
|
|
feature_group: 'planning',
|
|
|
|
|
description: 'Run scenario overrides and comparisons',
|
|
|
|
|
enabled: false,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 12,
|
|
|
|
|
client_account_id: 2,
|
|
|
|
|
feature_key: 'powerbi_export',
|
|
|
|
|
feature_name: 'Power BI Export',
|
|
|
|
|
feature_group: 'reporting',
|
|
|
|
|
description: 'Expose client access data to BI consumers',
|
|
|
|
|
enabled: true,
|
|
|
|
|
updated_at: '2026-04-22T09:10:00',
|
|
|
|
|
created_at: '2026-04-21T10:00:00'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const mockClientAccessExport: ClientAccessPowerBiExport = {
|
|
|
|
|
generated_at: '2026-04-25T09:00:00',
|
|
|
|
|
client_rows: mockClientAccess.map((client) => ({
|
|
|
|
|
client_id: client.id,
|
|
|
|
|
tenant_id: client.tenant_id,
|
|
|
|
|
client_name: client.name,
|
|
|
|
|
client_code: client.client_code,
|
|
|
|
|
client_status: client.status,
|
|
|
|
|
powerbi_workspace: client.powerbi_workspace,
|
|
|
|
|
active_user_count: client.active_user_count,
|
|
|
|
|
new_user_count: client.new_user_count,
|
|
|
|
|
enabled_feature_count: client.enabled_feature_count,
|
|
|
|
|
total_feature_count: client.total_feature_count
|
|
|
|
|
})),
|
|
|
|
|
user_rows: mockClientAccess.flatMap((client) =>
|
|
|
|
|
client.users.map((user) => ({
|
|
|
|
|
client_id: client.id,
|
|
|
|
|
client_name: client.name,
|
|
|
|
|
user_id: user.id,
|
|
|
|
|
full_name: user.full_name,
|
|
|
|
|
email: user.email,
|
|
|
|
|
role: user.role,
|
|
|
|
|
status: user.status,
|
|
|
|
|
is_new_user: user.is_new_user,
|
|
|
|
|
last_login_at: user.last_login_at,
|
|
|
|
|
created_at: user.created_at
|
|
|
|
|
}))
|
|
|
|
|
),
|
|
|
|
|
feature_rows: mockClientAccess.flatMap((client) =>
|
|
|
|
|
client.features.map((feature) => ({
|
|
|
|
|
client_id: client.id,
|
|
|
|
|
client_name: client.name,
|
|
|
|
|
feature_id: feature.id,
|
|
|
|
|
feature_key: feature.feature_key,
|
|
|
|
|
feature_name: feature.feature_name,
|
|
|
|
|
feature_group: feature.feature_group,
|
|
|
|
|
enabled: feature.enabled,
|
|
|
|
|
updated_at: feature.updated_at
|
|
|
|
|
}))
|
|
|
|
|
),
|
|
|
|
|
clients: mockClientAccess
|
|
|
|
|
};
|