You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
5.5 KiB
190 lines
5.5 KiB
import type { RequestHandler } from "@sveltejs/kit"
|
|
|
|
import type { StandaloneItem } from "$lib/models/item"
|
|
import type { StandaloneRequirement } from "$lib/models/project"
|
|
import type { ScopeEntry } from "$lib/models/scope"
|
|
import Status from "$lib/models/status"
|
|
import type { StandaloneSprint } from "$lib/models/sprint"
|
|
|
|
export const get: RequestHandler = async({}) => {
|
|
const scopes: ScopeEntry[] = [
|
|
{id: 1, name: "3D Modeling", abbreviation: "3D"},
|
|
{id: 2, name: "Roleplay", abbreviation: "RP"},
|
|
{id: 3, name: "Minecraft", abbreviation: "MC"},
|
|
{id: 4, name: "Coding", abbreviation: "CODE"},
|
|
{id: 5, name: "System Administration", abbreviation: "SA"},
|
|
]
|
|
|
|
const items: StandaloneItem[] = [
|
|
{
|
|
id: 1, scope: scopes[0],
|
|
name: "Table",
|
|
description: "A table for the Redrock rec-room.",
|
|
acquireDate: "2022-03-14T00:00:00Z",
|
|
stats: [
|
|
{id: 1, name: "Asset", weight: 0.2, required: 1, acquired: 1},
|
|
{id: 2, name: "Complexity", weight: 1, required: 3, acquired: 5},
|
|
],
|
|
project: {
|
|
id: 443,
|
|
name: "3D Maps: Proving the concept",
|
|
status: Status.Active
|
|
}
|
|
},
|
|
{
|
|
id: 2, scope: scopes[0],
|
|
name: "Datapad Set",
|
|
description: "I need one, at least, but more is better.",
|
|
stats: [
|
|
{id: 1, name: "Asset", weight: 0.2, required: 1, acquired: 0},
|
|
{id: 2, name: "Complexity", weight: 1, required: 3, acquired: 0},
|
|
{id: 3, name: "Hard Surface", weight: 0.333, required: 1, acquired: 0},
|
|
],
|
|
project: {
|
|
id: 443,
|
|
name: "3D Maps: Proving the concept",
|
|
status: Status.Active
|
|
}
|
|
},
|
|
{
|
|
id: 3, scope: scopes[1],
|
|
name: "Enila/Renala: Technicalities",
|
|
description: "Renala is answering Leah's concern and takes the shift at the Respite.",
|
|
stats: [
|
|
{id: 1, name: "Story", weight: 3, required: 1, acquired: 0},
|
|
{id: 2, name: "Story Word", weight: 0.002, required: 500, acquired: 0},
|
|
],
|
|
project: {
|
|
id: 1,
|
|
name: "Background Stories",
|
|
status: Status.Active
|
|
}
|
|
},
|
|
]
|
|
|
|
const requirements: StandaloneRequirement[] = [
|
|
{
|
|
id: 1,
|
|
name: "Basic Furniture",
|
|
description: "I need a lot of it.",
|
|
project: {
|
|
id: 443,
|
|
name: "3D Maps: Proving the concept",
|
|
status: Status.Active
|
|
},
|
|
status: Status.Active,
|
|
stats: [
|
|
{id: 1, name: "Asset", weight: 0.2, acquired: 8, required: 15},
|
|
{id: 2, name: "Complexity", weight: 1, acquired: 69, required: 30},
|
|
{id: 3, name: "Hard Surface", weight: 0.333, acquired: 20, required: 5},
|
|
],
|
|
scope: scopes[0],
|
|
},
|
|
{
|
|
id: 2,
|
|
name: "Catching Up",
|
|
description: "Write a few stories to get back up to speed with less written characters.",
|
|
project: {
|
|
id: 1,
|
|
name: "Background Stories",
|
|
status: Status.Active
|
|
},
|
|
status: Status.Active,
|
|
stats: [
|
|
{id: 1, name: "Story", weight: 3, required: 10, acquired: 3},
|
|
{id: 2, name: "Story Word", weight: 0.002, required: 5000, acquired: 2173},
|
|
{id: 3, name: "Worldbuilding", weight: 0.5, required: 5, acquired: 1},
|
|
],
|
|
scope: scopes[1],
|
|
},
|
|
{
|
|
id: 3,
|
|
name: "Chapter 3",
|
|
description: "it's go time",
|
|
project: {
|
|
id: 1,
|
|
name: "Wenera's Job",
|
|
status: Status.Active
|
|
},
|
|
status: Status.Active,
|
|
stats: [
|
|
{id: 1, name: "Story", weight: 3, required: 5, acquired: 1},
|
|
{id: 2, name: "Story Word", weight: 0.002, required: 4000, acquired: 759},
|
|
],
|
|
scope: scopes[1],
|
|
}
|
|
]
|
|
|
|
const sprints: StandaloneSprint[] = [
|
|
{
|
|
id: 553,
|
|
name: "March Sprint",
|
|
description: "Hey kid, wanna model some trees?",
|
|
from: "2022-03-01T00:00:00+0200",
|
|
to: "2022-03-30T23:59:59+0200",
|
|
coarse: false,
|
|
kind: "stats",
|
|
scope: scopes[0],
|
|
timed: true,
|
|
stats: [
|
|
{id: 1, name: "Asset", weight: 0, acquired: 13, required: 15},
|
|
{id: 2, name: "Complexity", weight: 1, acquired: 37, required: 30},
|
|
{id: 3, name: "Hard Surface", weight: 0.25, acquired: 8, required: 5},
|
|
{id: 4, name: "UV Mapping", weight: 0.25, acquired: 3, required: 5},
|
|
],
|
|
items: [],
|
|
requirements: [],
|
|
aggregateRequired: 40,
|
|
},
|
|
{
|
|
id: 643,
|
|
name: "March Sprint",
|
|
description: "Crank out stories",
|
|
from: "2022-03-01T00:00:00+0200",
|
|
to: "2022-03-30T23:59:59+0200",
|
|
coarse: false,
|
|
kind: "requirements",
|
|
scope: scopes[1],
|
|
timed: true,
|
|
stats: [],
|
|
items: [],
|
|
requirements: [
|
|
requirements[1],
|
|
requirements[2],
|
|
],
|
|
aggregateRequired: 0,
|
|
},
|
|
{
|
|
id: 771,
|
|
name: "March Sprint",
|
|
description: "Do these",
|
|
from: "2022-03-01T00:00:00+0200",
|
|
to: "2022-03-30T23:59:59+0200",
|
|
coarse: false,
|
|
kind: "item",
|
|
scope: scopes[0],
|
|
timed: true,
|
|
stats: [
|
|
{id: 1, name: "Asset", weight: 0.2, required: 2, acquired: 1},
|
|
{id: 2, name: "Complexity", weight: 1, required: 8, acquired: 5},
|
|
{id: 3, name: "Hard Surface", weight: 0.333, required: 1, acquired: 0},
|
|
],
|
|
items: [
|
|
items[0],
|
|
items[1],
|
|
],
|
|
requirements: [],
|
|
aggregateRequired: 0,
|
|
}
|
|
]
|
|
|
|
return {
|
|
status: 200,
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({
|
|
scopes, items, requirements, sprints
|
|
}),
|
|
}
|
|
}
|