Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 #243

Merged
merged 48 commits into from
Oct 28, 2023
Merged

V1 #243

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
050e463
Merge pull request #13 from alwinsimon/v1
alwinsimon Oct 4, 2023
918b253
Merge pull request #15 from alwinsimon/v1
alwinsimon Oct 5, 2023
f8503f3
Merge pull request #17 from alwinsimon/v1
alwinsimon Oct 5, 2023
1c0fa7c
Merge pull request #19 from alwinsimon/v1
alwinsimon Oct 6, 2023
12cabc1
Merge pull request #24 from alwinsimon/v1
alwinsimon Oct 6, 2023
23235c4
Merge pull request #26 from alwinsimon/v1
alwinsimon Oct 8, 2023
4b9dab3
Merge pull request #28 from alwinsimon/v1
alwinsimon Oct 8, 2023
5fb017c
Merge pull request #30 from alwinsimon/v1
alwinsimon Oct 9, 2023
0b700d8
Merge pull request #32 from alwinsimon/v1
alwinsimon Oct 9, 2023
48ea346
Merge pull request #35 from alwinsimon/v1
alwinsimon Oct 9, 2023
58f7970
Merge pull request #37 from alwinsimon/v1
alwinsimon Oct 10, 2023
21ddb83
Merge pull request #50 from alwinsimon/v1
alwinsimon Oct 11, 2023
1ebaba2
Merge pull request #52 from alwinsimon/v1
alwinsimon Oct 11, 2023
0b4cd94
Merge pull request #56 from alwinsimon/v1
alwinsimon Oct 13, 2023
7223af3
Merge pull request #69 from alwinsimon/v1
alwinsimon Oct 14, 2023
ffdbef4
Merge pull request #82 from alwinsimon/v1
alwinsimon Oct 15, 2023
4c14238
Merge pull request #94 from alwinsimon/v1
alwinsimon Oct 16, 2023
7b47a19
Merge pull request #103 from alwinsimon/v1
alwinsimon Oct 17, 2023
4e83a8d
Merge pull request #112 from alwinsimon/v1
alwinsimon Oct 17, 2023
afa8ff3
Merge pull request #114 from alwinsimon/v1
alwinsimon Oct 18, 2023
b74837c
Merge pull request #126 from alwinsimon/v1
alwinsimon Oct 19, 2023
e4d8e5d
Merge pull request #140 from alwinsimon/v1
alwinsimon Oct 20, 2023
05a4da9
Merge pull request #161 from alwinsimon/v1
alwinsimon Oct 21, 2023
274bfcf
Merge pull request #167 from alwinsimon/v1
alwinsimon Oct 21, 2023
26169c7
Merge pull request #181 from alwinsimon/v1
alwinsimon Oct 23, 2023
a8fcc4d
Merge pull request #196 from alwinsimon/v1
alwinsimon Oct 24, 2023
27023b9
Merge pull request #226 from alwinsimon/v1
alwinsimon Oct 25, 2023
28c099e
Merge pull request #228 from alwinsimon/v1
alwinsimon Oct 26, 2023
04c6566
Configured to make api call to complete payment with received token f…
alwinsimon Oct 27, 2023
a19f4af
Merge pull request #232 from alwinsimon/v1-tickets
alwinsimon Oct 27, 2023
3b7ed90
Merge pull request #233 from alwinsimon/v1
alwinsimon Oct 27, 2023
91cbbee
Added two new options in the Header.
alwinsimon Oct 27, 2023
c56758f
Added orders listing page to list order history of user.
alwinsimon Oct 27, 2023
1cfecd5
Modified the redirection - redirection configured to show orders page…
alwinsimon Oct 27, 2023
ddd4772
Merge pull request #234 from alwinsimon/v1-client
alwinsimon Oct 27, 2023
c90d63b
Merge pull request #235 from alwinsimon/v1
alwinsimon Oct 27, 2023
9f30b4c
Create CI - Tests - Auth Service.yml
alwinsimon Oct 28, 2023
da4fc7b
Configured CI Workflow for auth service tests.
alwinsimon Oct 28, 2023
a1c3b3c
Merge pull request #236 from alwinsimon/main
alwinsimon Oct 28, 2023
175b905
Merge pull request #237 from alwinsimon/v1
alwinsimon Oct 28, 2023
9f78a3a
Added Test Script for CI Testing.
alwinsimon Oct 28, 2023
44fac41
Merge pull request #238 from alwinsimon/v1-auth
alwinsimon Oct 28, 2023
18dadae
Merge pull request #239 from alwinsimon/v1
alwinsimon Oct 28, 2023
105be2b
Added script for CI Testing.
alwinsimon Oct 28, 2023
f100ce1
Merge pull request #240 from alwinsimon/v1-orders
alwinsimon Oct 28, 2023
115ae20
Merge pull request #241 from alwinsimon/v1
alwinsimon Oct 28, 2023
263f398
Added script for CI Testing.
alwinsimon Oct 28, 2023
f837454
Merge pull request #242 from alwinsimon/v1-payments
alwinsimon Oct 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/CI - Tests - Auth Service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ========================================= Main Branch ::: CI - Tests - Auth Service =========================================

name: CI - Tests - Auth Service

on: pull_request

jobs:
Production-Branch-Pre-Integration-Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: cd auth && npm install && npm run test:ci
3 changes: 2 additions & 1 deletion auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"test": "jest --watchAll --no-cache"
"test": "jest --watchAll --no-cache",
"test:ci": "jest"
},
"jest": {
"preset": "ts-jest",
Expand Down
8 changes: 5 additions & 3 deletions client/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import Link from "next/link";

export default ({ currentUser }) => {
const Links = [
!currentUser && { label: "Sign Up", href: "auth/signup" },
!currentUser && { label: "Sign In", href: "auth/signin" },
currentUser && { label: "Sign Out", href: "auth/signout" },
!currentUser && { label: "Sign Up", href: "/auth/signup" },
!currentUser && { label: "Sign In", href: "/auth/signin" },
currentUser && { label: "Sell Tickets", href: "/tickets/new" },
currentUser && { label: "My Orders", href: "/orders" },
currentUser && { label: "Sign Out", href: "/auth/signout" },
]
.filter((validLinks) => validLinks)
.map(({ label, href }) => {
Expand Down
15 changes: 14 additions & 1 deletion client/pages/orders/[orderId].js
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import { useEffect, useState } from "react";
import Router from "next/router";
import StripeCheckout from "react-stripe-checkout";
import useRequest from "../../hooks/use-request";

const OrderShow = ({ order, currentUser }) => {
const [timeLeft, setTimeLeft] = useState(0);
const [makeRequest, errors] = useRequest({
url: "/api/payments",
method: "post",
body: {
orderId: order.id,
},
onSuccess: (payment) => {
Router.push("/orders");
},
});

useEffect(() => {
const findTimeLeft = () => {
Expand Down Expand Up @@ -33,12 +45,13 @@ const OrderShow = ({ order, currentUser }) => {
Time left to complete payment: {timeLeft} seconds.
<StripeCheckout
token={(token) => {
console.log(token);
makeRequest({ token: token.id });
}}
stripeKey="pk_test_51O53zRSJtuYafghXhYNZzaJqYAh6afqRduQ3UAMs6Wm4vkv30ayq09gBPgU3jYkQPXrofQa9aRbIlb4uuCp3FC6O000J86xaKc"
amount={order.ticket.price * 100}
email={currentUser.email}
/>
{errors}
</div>
);
};
Expand Down
23 changes: 23 additions & 0 deletions client/pages/orders/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const OrderIndex = ({ orders }) => {
return (
<>
<ul>
{orders.map((order) => {
return (
<li key={orders.id}>
{order.ticket.title} - {order.status}
</li>
);
})}
</ul>
</>
);
};

OrderIndex.getInitialProps = async (context, client) => {
const response = await client.get("/api/orders");

return { orders: response.data };
};

export default OrderIndex;
3 changes: 2 additions & 1 deletion orders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"test": "jest --watchAll --no-cache"
"test": "jest --watchAll --no-cache",
"test:ci": "jest"
},
"jest": {
"preset": "ts-jest",
Expand Down
3 changes: 2 additions & 1 deletion payments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"test": "jest --watchAll --no-cache"
"test": "jest --watchAll --no-cache",
"test:ci": "jest"
},
"jest": {
"preset": "ts-jest",
Expand Down