This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:21-alpine | |
WORKDIR /app/api | |
COPY . . | |
RUN npm install --silent --legacy-peer-deps | |
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext, useContext, useMemo } from 'react'; | |
import type { CSSProperties, PropsWithChildren } from 'react'; | |
import type { DraggableSyntheticListeners, UniqueIdentifier } from '@dnd-kit/core'; | |
import { useSortable } from '@dnd-kit/sortable'; | |
import { CSS } from '@dnd-kit/utilities'; | |
import { Icon, IconProps } from '../Icon'; | |
import { Button, ListItem, ListItemProps } from '@chakra-ui/react'; | |
import styled from '@emotion/styled'; | |
type Props = ListItemProps & { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{#=}}( (IF({{equals(issue.Reach.value, "25%")}}, .25, 0)+IF({{equals(issue.Reach.value, "50%")}}, .5, 0)+IF({{equals(issue.Reach.value, "75%")}}, .75, 0)+IF({{equals(issue.Reach.value, "100%")}}, 1, 0)) * (IF({{equals(issue.Impact Score.value,"Massive Impact")}},3, 0) + IF({{equals(issue.Impact Score.value,"High Impact")}},2, 0) + IF({{equals(issue.Impact Score.value,"Medium Impact")}},1, 0) + IF({{equals(issue.Impact Score.value,"Low Impact")}},0.5, 0) + IF({{equals(issue.Impact Score.value,"Minimal Impact")}},0.25, 0)) * (IF({{equals(issue.Confidence.value,"100%")}}, 1, 0) + IF({{equals(issue.Confidence.value,"80%")}}, 0.8, 0) + IF({{equals(issue.Confidence.value,"50%")}}, 0.5, 0)) ) / (IF({{equals(issue.Effort.value, "Extremely High")}},5, 0) + IF({{equals(issue.Effort.value, "High")}},4, 0) + IF({{equals(issue.Effort.value, "Medium")}},3, 0) + IF({{equals(issue.Effort.value, "Low")}},2, 0) + IF({{equals(issue.Effort.value, "Insignificant")}}, 1, 0)){{/}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DatabaseModel { | |
id: number; | |
name: string; | |
description: string; | |
createdAt: Date; | |
updatedAt: Date; | |
archived: boolean; | |
} | |
type PutAPIModel = Partial<DatabaseModel>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request } from "express"; | |
import orderRepository from "../data"; | |
const itemRouter = express.Router(); | |
itemRouter | |
.route("/:id/item") | |
.post(async (req: Request<{ id: string }, {}, { product_id: number; quantity: number }, {}>, res) => { | |
const { body, params } = req; | |
const { product_id, quantity } = body; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request } from "express"; | |
import itemRouter from "./item"; | |
import orderRepository from "./data"; | |
const orderRouter = express.Router(); | |
orderRouter | |
.route("/") | |
.get(async (req: Request<{}, {}, {}, {}>, res) => { | |
const orders = await orderRepository.list(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as s from "zapatos/schema"; | |
import * as db from "zapatos/db"; | |
import pool from "../pool"; | |
class OrderRepository { | |
addOrderItem = async (order_id: number, product_id: number, quantity: number) => { | |
const order_query = this.getOrder(order_id); | |
const product_query = db.selectExactlyOne("Product", { product_id }).run(pool); | |
const [order, product] = await Promise.all([order_query, product_query]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request } from "express"; | |
import * as db from "zapatos/db"; | |
import pool from "../pool"; | |
const orderRouter = express.Router(); | |
orderRouter | |
.route("/") | |
.get(async (req: Request<{}, {}, {}, {}>, res) => { | |
const orders = await db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request } from "express"; | |
import * as db from "zapatos/db"; | |
import type * as s from "zapatos/schema"; | |
import pool from "../pool"; | |
const productRouter = express.Router(); | |
productRouter | |
.route("/") | |
.get(async (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Request } from "express"; | |
import * as db from "zapatos/db"; | |
import type * as s from "zapatos/schema"; | |
import pool from "../pool"; | |
const userRouter = express.Router(); | |
userRouter | |
.route("/") | |
.get(async (req, res) => { |