Skip to content

Commit

Permalink
feat: task3
Browse files Browse the repository at this point in the history
  • Loading branch information
Guria committed Oct 12, 2022
1 parent 182a37e commit a07bc4c
Show file tree
Hide file tree
Showing 58 changed files with 3,730 additions and 5,868 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
# slugify branch ref
slug=$(echo ${{ github.event.pull_request.head.ref || 'stg' }} | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-+\|-+$//g')
body="$(npm run deploy -- --stage $slug 2>&1)"
body="$(npm run deploy -- --stage $slug 2>&1 || true)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
Expand Down
1 change: 1 addition & 0 deletions commons/constants/api-paths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const PRODUCTS_API_PATH = "products";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OrderStatus } from "~/constants/order";
import { CartItem } from "~/models/CartItem";
import { Order } from "~/models/Order";
import { AvailableProduct, Product } from "~/models/Product";
import { OrderStatus } from "../models/Order";
import { CartItem } from "../models/CartItem";
import { Order } from "../models/Order";
import { AvailableProduct, Product } from "../models/Product";

export const products: Product[] = [
{
Expand All @@ -24,7 +24,7 @@ export const products: Product[] = [
},
{
description: "Short Product Description4",
id: "7567ec4b-b10c-48c5-9345-fc73348a80a1",
id: "7567ec4b-b10c-48c5-9345-fc73348a80a4",
price: 15,
title: "ProductTest",
},
Expand All @@ -36,7 +36,7 @@ export const products: Product[] = [
},
{
description: "Short Product Description7",
id: "7567ec4b-b10c-45c5-9345-fc73c48a80a1",
id: "7567ec4b-b10c-45c5-9345-fc73c48a80a5",
price: 15,
title: "ProductName",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Product } from "~/models/Product";
import { Product } from "./Product";

export type CartItem = {
product: Product;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import * as Yup from "yup";
import { OrderStatus } from "~/constants/order";

export enum OrderStatus {
Open = "OPEN",
Approved = "APPROVED",
Confirmed = "CONFIRMED",
Sent = "SENT",
Completed = "COMPLETED",
Cancelled = "CANCELLED",
}

export const ORDER_STATUS_FLOW = Object.values(OrderStatus);

export const AddressSchema = Yup.object({
firstName: Yup.string().required().default(""),
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions commons/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@guria.dev/aws-js-practitioner-commons",
"version": "1.0.0",
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"yup": "^0.32.11"
}
}
17 changes: 17 additions & 0 deletions commons/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": true,
"sourceMap": true,
"target": "ES2020",
"outDir": "lib"
},
"include": ["serverless.ts", "*.ts", "mocks/*", "models/*", "constants/*"],
"exclude": [
"node_modules/**/*",
".serverless/**/*"
]
}
Loading

0 comments on commit a07bc4c

Please sign in to comment.