Skip to content

Commit

Permalink
πŸ¦ƒπŸ§ž ↝ [SSM-30 SSM-31]: Stations are now being created with p/m config
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Oct 23, 2024
1 parent f89d120 commit 78c1268
Show file tree
Hide file tree
Showing 9 changed files with 433 additions and 310 deletions.
57 changes: 57 additions & 0 deletions app/api/gameplay/communityStations/projects/31011/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { NextRequest, NextResponse } from 'next/server';

interface Project {
id: string;
name: string;
identifier: string;
}

interface Mission {
id: string;
name: string;
type: string;
project: string;
missionRouteId?: number;
}

interface CommunityStationConfig {
stationName: string;
inventoryItemId: number;
projects: Project[];
missions: Mission[];
}

const greenhouseStation: CommunityStationConfig = {
stationName: "Greenhouse",
inventoryItemId: 31011,
projects: [
{
id: "1",
name: "Wildwatch Burrowing Owls",
identifier: "zoodex-burrOwls",
},
{
id: "2",
name: "Iguanas from Above",
identifier: "zoodex-iguanasFromAbove",
},
],
missions: [
{
id: "1",
name: "Spot an owl in the wild",
type: "Upload",
project: "1",
},
{
id: "2",
name: "Track iguana movement",
type: "Analysis",
project: "2",
},
],
};

export async function GET(req: NextRequest) {
return NextResponse.json(greenhouseStation);
};
61 changes: 61 additions & 0 deletions app/api/gameplay/communityStations/projects/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { NextRequest, NextResponse } from 'next/server';

interface Project {
id: string;
name: string;
identifier: string;
// isUnlocked: boolean;
// level: number;
}

interface Mission {
id: string;
name: string;
type: string;
// completionRate: number;
project: string;
// level: number;
// isUnlocked: boolean;
}

interface CommunityStationConfig {
stationName: string;
inventoryItemId: number;
projects: Project[];
missions: Mission[];
}

const greenhouseStation: CommunityStationConfig = {
stationName: "Greenhouse",
inventoryItemId: 31011,
projects: [
{
id: "1",
name: "Wildwatch Burrowing Owls",
identifier: "zoodex-burrOwls",
},
{
id: "2",
name: "Iguanas from Above",
identifier: "zoodex-iguanasFromAbove",
},
],
missions: [
{
id: "1",
name: "Spot an owl in the wild",
type: "Upload",
project: "1",
},
{
id: "2",
name: "Track iguana movement",
type: "Analysis",
project: "2",
},
],
};

export async function GET(req: NextRequest) {
return NextResponse.json(greenhouseStation);
};
15 changes: 11 additions & 4 deletions app/tests/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ import MissionPathway from "@/components/Missions/Pathway";
import ProfileCardModal from "@/components/profile/form";
import { CommunityScienceStation } from "@/components/Structures/Community/StationModal";
import { CreateCommunityStation } from "@/components/Structures/Build/MakeCommunityStation";
import StationsOnPlanet from "@/components/Structures/Community/ViewAllStations";

export default function TestPage() {
return (
<StarnetLayout>
<CreateCommunityStation />
<StationsOnPlanet />
</StarnetLayout>
);
};

/*
<CommunityScienceStation stationName = {"Greenhouse"}
projects = {[
{
Expand Down Expand Up @@ -47,7 +56,5 @@ export default function TestPage() {
"A hardened owl that is ready to be transported to another lush location.",
},
]} />
<CreateCommunityStation />
</StarnetLayout>
);
};
*/
Loading

0 comments on commit 78c1268

Please sign in to comment.