53 lines
3.1 KiB
JavaScript
53 lines
3.1 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const srcAppDir = path.join(__dirname, 'src', 'app');
|
|
const solutionsDir = path.join(srcAppDir, 'solutions');
|
|
|
|
if (!fs.existsSync(solutionsDir)) {
|
|
fs.mkdirSync(solutionsDir, { recursive: true });
|
|
}
|
|
|
|
const routes = {
|
|
// Department
|
|
'administration/page.tsx': `export { default } from "../../(features)/SolutionPage/department/AdministrationPage";`,
|
|
'finance/page.tsx': `export { default } from "../../(features)/SolutionPage/department/FinancePage";`,
|
|
'hr/page.tsx': `export { default } from "../../(features)/SolutionPage/department/HrPage";`,
|
|
'procurement/page.tsx': `export { default } from "../../(features)/SolutionPage/department/ProcurementPage";`,
|
|
'sales/page.tsx': `export { default } from "../../(features)/SolutionPage/department/SalesPage";`,
|
|
|
|
// Industry
|
|
'construction/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/ConstructionPage";`,
|
|
'education/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/EducationPage";`,
|
|
'government/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/GovernmentPage";`,
|
|
'healthcare/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/HealthcarePage";`,
|
|
'insurance/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/InsurancePage";`,
|
|
'logistics/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/LogisticsPage";`,
|
|
'manufacturing/page.tsx': `export { default } from "../../(features)/SolutionPage/industry/ManufacturingPage";`,
|
|
|
|
// Use Case
|
|
'client-onboarding/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/ClientOnboardingPage";`,
|
|
'contract-management/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/ContractManagementPage";`,
|
|
'document-archiving/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/DocumentArchivingPage";`,
|
|
'employee-onboarding/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/EmployeeOnboardingPage";`,
|
|
'invoice-approvals/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/InvoiceApprovalsPage";`,
|
|
'lease-agreements/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/LeaseAgreementsPage";`,
|
|
'leave-requests/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/LeaveRequestsPage";`,
|
|
'purchase-requests/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/PurchaseRequestsPage";`,
|
|
'site-inspection/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/SiteInspectionPage";`,
|
|
'vendor-approvals/page.tsx': `export { default } from "../../(features)/SolutionPage/usecase/VendorApprovalsPage";`,
|
|
};
|
|
|
|
for (const [routePath, content] of Object.entries(routes)) {
|
|
const fullPath = path.join(solutionsDir, routePath);
|
|
const dir = path.dirname(fullPath);
|
|
|
|
if (!fs.existsSync(dir)) {
|
|
fs.mkdirSync(dir, { recursive: true });
|
|
}
|
|
|
|
fs.writeFileSync(fullPath, content, 'utf8');
|
|
}
|
|
|
|
console.log('Solution routes generated successfully.');
|