+
+
+
+
);
-}
+}
\ No newline at end of file
diff --git a/components/SellerStats.tsx b/components/SellerStats.tsx
deleted file mode 100644
index e5cc283..0000000
--- a/components/SellerStats.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-// ** React Imports
-import { ReactElement } from 'react'
-
-// ** MUI Imports
-import Box from '@mui/material/Box'
-import Grid from '@mui/material/Grid'
-import Card from '@mui/material/Card'
-import Avatar from '@mui/material/Avatar'
-import CardHeader from '@mui/material/CardHeader'
-import IconButton from '@mui/material/IconButton'
-import Typography from '@mui/material/Typography'
-import CardContent from '@mui/material/CardContent'
-
-// ** Icons Imports
-import TrendingUp from 'mdi-material-ui/TrendingUp'
-import CurrencyUsd from 'mdi-material-ui/CurrencyUsd'
-import DotsVertical from 'mdi-material-ui/DotsVertical'
-import CellphoneLink from 'mdi-material-ui/CellphoneLink'
-import AccountOutline from 'mdi-material-ui/AccountOutline'
-import CompareArrowsIcon from '@mui/icons-material/CompareArrows';
-
-// ** Types
-import { ThemeColor } from '../core/layouts/types'
-import { Person } from '@mui/icons-material'
-
-interface DataType {
- stats: string
- title: string
- color: ThemeColor
- icon: ReactElement
-}
-
-const salesData: DataType[] = [
- {
- stats: '0',
- title: 'Customers',
- color: 'primary',
- icon:
- },
- {
- stats: '0',
- title: 'Accepted',
- color: 'success',
- icon:
- },
- {
- stats: '0',
- color: 'warning',
- title: 'Denied',
- icon:
- },
- {
- stats: '$0.00',
- color: 'info',
- title: 'Revenue',
- icon:
- }
-]
-
-const renderStats = () => {
- return salesData.map((item: DataType, index: number) => (
-
-
-
- {item.icon}
-
-
- {item.title}
- {item.stats}
-
-
-
- ))
-}
-
-const SellerStats = () => {
- return (
-
-
-
- Total 0% growth
- {' '}
- 😎 this month
-
- }
- titleTypographyProps={{
- sx: {
- mb: 2.5,
- lineHeight: '2rem !important',
- letterSpacing: '0.15px !important'
- }
- }}
- />
- `${theme.spacing(3)} !important` }}>
-
- {renderStats()}
-
-
-
- )
-}
-
-export default SellerStats
diff --git a/components/requestDialog.tsx b/components/requestDialog.tsx
new file mode 100644
index 0000000..3b931d8
--- /dev/null
+++ b/components/requestDialog.tsx
@@ -0,0 +1,61 @@
+import * as React from 'react';
+import Box from '@mui/material/Box';
+import Button from '@mui/material/Button';
+import Dialog, { DialogProps } from '@mui/material/Dialog';
+import DialogActions from '@mui/material/DialogActions';
+import DialogContent from '@mui/material/DialogContent';
+import DialogContentText from '@mui/material/DialogContentText';
+import DialogTitle from '@mui/material/DialogTitle';
+import FormControl from '@mui/material/FormControl';
+import FormControlLabel from '@mui/material/FormControlLabel';
+import InputLabel from '@mui/material/InputLabel';
+import MenuItem from '@mui/material/MenuItem';
+import Select, { SelectChangeEvent } from '@mui/material/Select';
+import Switch from '@mui/material/Switch';
+
+export default function RequestDialog() {
+ const [open, setOpen] = React.useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ return (
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/components/withOnboardingRequired.tsx b/components/withOnboardingRequired.tsx
index e69de29..967341d 100644
--- a/components/withOnboardingRequired.tsx
+++ b/components/withOnboardingRequired.tsx
@@ -0,0 +1,325 @@
+import * as React from 'react';
+import Box from '@mui/material/Box';
+import Stepper from '@mui/material/Stepper';
+import Step from '@mui/material/Step';
+import StepLabel from '@mui/material/StepLabel';
+import StepContent from '@mui/material/StepContent';
+import Button from '@mui/material/Button';
+import Paper from '@mui/material/Paper';
+import Typography from '@mui/material/Typography';
+import Grid from '@mui/material/Grid'
+import TextField from '@mui/material/TextField';
+import ArtistDashboardRequest from '../components/OLd/artistDashboardRequest';
+import ArtistPortfolio from '../components/OLd/artistPortfolio';
+import EditableArtistPortfolio from '../components/OLd/editableArtistPortfolio';
+import { useEffect, useState } from "react";
+
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import {Card, CardContent, CardHeader, Divider } from '@mui/material';
+
+
+const steps = [
+ {
+ label: 'Request Access As Artist',
+ description: `In order to start selling your art on our platform, you need to request access. Please include links to your social media and tag or DM us on the platform (@RequestDotBox). We may reach out for further verification and examples of your work.`,
+ },
+ {
+ label: 'Onboard On Stripe',
+ description:
+ 'Our platform uses Stripe as a payment processor. You will be required to onboard with them with all of your payout information and business information.',
+ },
+ {
+ label: 'Setup Your Portfolio',
+ description: `This is where you can setup your initial portfolio. You can upload any image format file to your portfolio. It will be automatically displayed on your artist page. You can add and remove from this later.`,
+ },
+ {
+ label: 'Configure Your Artist Page',
+ description: `Every artist gets their own public facing page that they can send to anyone or post anywhere. You have full control over the colors, logos, and more of this page.`,
+ },
+];
+
+export default function onboarding() {
+ const [activeStep, setActiveStep] = React.useState(0);
+ const [sellerRequestData, setArtistRequestData] = React.useState(null);
+ const [profileData, setArtistData] = React.useState(null);
+ const [isStripeOnboarded, setIsStripeOnboarded] = React.useState(false);
+ const [onBoardUrl, setOnBoardUrl] = React.useState("");
+
+
+
+ const handleNext = () => {
+ setActiveStep((prevActiveStep) => prevActiveStep + 1);
+ };
+
+ const handleBack = () => {
+ setActiveStep((prevActiveStep) => prevActiveStep - 1);
+ };
+
+ const handleReset = () => {
+ setActiveStep(0);
+ };
+
+ const getData = async () => {
+ const onboardCheckRequest = await fetch('/api/artist/onboarded', { method: "GET" });
+ const onboardCheckResponse = await onboardCheckRequest.json();
+ setIsStripeOnboarded(onboardCheckResponse["onboarded"]);
+ const onboardUrlRequest = await fetch('/api/artist/onboardurl', { method: "GET" });
+ const onboardUrlResponse = await onboardUrlRequest.json();
+ setOnBoardUrl(onboardUrlResponse["onboardUrl"]);
+ const response = await fetch('/api/artist/request');
+ const sellerRequest = await response.json();
+ setArtistRequestData(sellerRequest);
+ const profileResponse = await fetch('/api/artist/profile');
+ const sellerProfile = await profileResponse.json();
+ setArtistData(sellerProfile);
+
+ setTimeout(getData, 5000); // Poll every 5 seconds (adjust as needed)
+ }
+ React.useEffect(() => {
+ getData();
+ }, []);
+
+ const requestButton = () => {
+ fetch('/api/artist/newRequest').then((response) => {
+ if (response.ok) {
+ fetch('/api/artist/request').then((requestResponse) => {
+ requestResponse.json().then((sellerRequest) => {
+ setArtistRequestData(sellerRequest);
+ });
+ });
+ }
+ });
+ }
+
+ let formattedTime = ""
+ if (sellerRequestData) {
+ const date = new Date(sellerRequestData["requestDate"]);
+ formattedTime = date.toLocaleTimeString('en-US', { month: 'long', day: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }); // Example format
+ }
+
+ if(activeStep==4){
+ window.location.href="/dashboard"
+ }
+
+ return (
+
+
+ {steps.map((step, index) => (
+
+ Last step
+ ) : null
+ }
+ >
+ {step.label}
+
+ {(index==0) ? (
+
+
+
+ {step.description}
+
+
+
+ {(sellerRequestData && Object.keys(sellerRequestData).length>0) ? (
+
+
+
+ ):(
+
+
+
+ )}
+
+
+
+ {(sellerRequestData && Object.keys(sellerRequestData).length>0) ? (
+ (sellerRequestData["accepted"]) ? (
+
+ ) : (
+
+ )
+ ):
+ (
+
+
+ )}
+
+
+
+ ): null}
+ {(index==1) ? (
+
+
+
+ {step.description}
+
+
+
+
+ {isStripeOnboarded==true ? (
+
+ ):(
+
+
+ )}
+
+
+
+ ): null}
+ {(index==2) ? (
+
+
+
+ {step.description}
+
+
+
+
+
+
+
+
+
+
+
+ ): null}
+ {(index==3) ? (
+
+
+
+ {step.description}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Artist Name
+
+
+
+
+
+ Biography
+
+
+
+
+
+ TAwehtwaehrewaoioirewaoihroiewahroiewahriewaohroiewahroiweahroiewahrhweaoirhewaiorhewaoirhewaoirhewaoirhweah
+
+
+
+
+ Portfolio
+
+
+
+
+
+
+
+
+ Requests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ): null}
+
+ ))}
+
+ {activeStep === steps.length && (
+
+ All steps completed - you're finished
+
+
+ )}
+
+ );
+}
\ No newline at end of file
diff --git a/layouts/components/vertical/AppBarContent.tsx b/layouts/components/vertical/AppBarContent.tsx
index 8a2afb9..51862f2 100644
--- a/layouts/components/vertical/AppBarContent.tsx
+++ b/layouts/components/vertical/AppBarContent.tsx
@@ -23,7 +23,7 @@ import { Settings } from '../../../core/context/settingsContext'
import ModeToggler from '../../../core/layouts/components/shared-components/ModeToggler'
import UserDropdown from '../../../core/layouts/components/shared-components/UserDropdown'
import NotificationDropdown from '../../../core/layouts/components/shared-components/NotificationDropdown'
-
+import { useEffect, useState } from 'react'
interface Props {
hidden: boolean
settings: Settings
@@ -38,7 +38,18 @@ const AppBarContent = (props: Props) => {
// ** Hook
const hiddenSm = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'))
- return (
+ const [profileData, setProfileData] = useState(null);
+
+ const getData = async () => {
+ const artistProfileRequest = await fetch('/api/me', { method: "GET" });
+ const artistProfileResponse = await artistProfileRequest.json();
+ setProfileData(artistProfileResponse);
+ }
+
+ //console.log(profileData)
+ useEffect(() => {
+ getData();
+ }, []); return (
{hidden ? (
@@ -52,12 +63,13 @@ const AppBarContent = (props: Props) => {
) : null}
-
-
+ {(profileData ? (
+
{({ unseenCount }) => }
+ ):null)}
diff --git a/navigation/vertical/index.ts b/navigation/vertical/index.ts
index cc5e3e6..001a6e1 100644
--- a/navigation/vertical/index.ts
+++ b/navigation/vertical/index.ts
@@ -7,80 +7,99 @@ import SettingsApplicationsIcon from '@mui/icons-material/SettingsApplications';
// ** Type import
import { VerticalNavItemsType } from '../../core/layouts/types'
-import { BankTransfer, PageFirst } from 'mdi-material-ui'
+import { BankTransfer, Cart, Clipboard, PageFirst } from 'mdi-material-ui'
import { DocumentScanner, FileOpen, Settings } from '@mui/icons-material'
import { useState, useEffect } from 'react'
const navigation = (): VerticalNavItemsType => {
const [isStripeOnboarded, setIsStripeOnboarded] = useState(false);
+ const [profileData, setProfileData] = useState(null);
+ const [userData, setUserData] = useState(null);
const getData = async () => {
+
const onboardCheckRequest = await fetch('/api/artist/onboarded', { method: "GET" });
const onboardCheckResponse = await onboardCheckRequest.json();
setIsStripeOnboarded(onboardCheckResponse["onboarded"]);
+
+ const artistProfileRequest = await fetch('/api/artist/profile', { method: "GET" });
+ const artistProfileResponse = await artistProfileRequest.json();
+ setProfileData(artistProfileResponse);
+
+ const userRequest = await fetch('/api/me', { method: "GET" });
+ const userResponse = await userRequest.json();
+ setUserData(userResponse);
+ ////console.log(roleResponse)
}
+
useEffect(() => {
getData();
}, []);
- if(isStripeOnboarded){
- return [
- {
- sectionTitle: 'General'
- },
- {
- title: 'Dashboard',
- icon: HomeOutline,
- path: '/dashboard'
- },
- {
- title: 'Account Settings',
- icon: Settings,
- path: '/dashboard/settings'
- },
+ var result = [
+ {
+ sectionTitle: 'Admin'
+ },
+ {
+ title: 'Artist Requests',
+ icon: Clipboard,
+ path: '/dashboard/admin/requests'
+ },
+ {
+ sectionTitle: 'General'
+ },
+ {
+ title: 'Dashboard',
+ icon: HomeOutline,
+ path: '/dashboard'
+ },
+ {
+ title: 'Account Settings',
+ icon: Settings,
+ path: '/dashboard/settings'
+ },
+ {
+ title: 'Your Requests',
+ icon: Cart,
+ path: '/dashboard/requests'
+ }
+ ];
+
+ if (isStripeOnboarded) {
+ result.push(
{
sectionTitle: 'Artist'
},
+ {
+ title: 'Incoming Requests',
+ icon: CubeOutline,
+ path: '/dashboard/artist/requests'
+ },
+ {
+ title: 'Payments/Payouts',
+ icon: BankTransfer,
+ path: '/dashboard/payout'
+ },
{
title: 'Shop Settings',
icon: SettingsApplicationsIcon,
path: '/dashboard/artist/artistsettings'
},
- {
- title: 'Payout Portal',
- icon: BankTransfer,
- path: '/payoutportal'
- },
{
title: 'Page Settings',
icon: DocumentScanner,
path: '/dashboard/artist/pagesettings'
},
{
- title: 'Preview Page',
+ title: 'Your Page',
icon: FileOpen,
- path: '/artist/pagesettings'
+ path: '/box/' + (userData ? userData["displayName"] : "")
}
- ]
+ );
}
- else{
- return [
- {
- sectionTitle: 'General'
- },
- {
- title: 'Dashboard',
- icon: HomeOutline,
- path: '/dashboard'
- },
- {
- title: 'Account Settings',
- icon: Settings,
- path: '/dashboard/settings'
- },
- ]
- }
+ return result;
}
-export default navigation
+export default navigation;
+
diff --git a/package-lock.json b/package-lock.json
index e1af21f..95d384d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -20,6 +20,7 @@
"apexcharts": "^3.45.2",
"dayjs": "^1.11.10",
"formidable": "^3.5.1",
+ "jwt-decode": "^4.0.0",
"mdi-material-ui": "^7.8.0",
"mui-color-input": "^2.0.2",
"next": "latest",
@@ -1931,6 +1932,14 @@
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
+ "node_modules/jwt-decode": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
+ "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/libphonenumber-js": {
"version": "1.10.54",
"resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.54.tgz",
diff --git a/package.json b/package.json
index e7c1bb4..8de24bf 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"apexcharts": "^3.45.2",
"dayjs": "^1.11.10",
"formidable": "^3.5.1",
+ "jwt-decode": "^4.0.0",
"mdi-material-ui": "^7.8.0",
"mui-color-input": "^2.0.2",
"next": "latest",
diff --git a/pages/advanced/api-profile.tsx b/pages/advanced/api-profile.tsx
index 348dc39..2e2c13c 100644
--- a/pages/advanced/api-profile.tsx
+++ b/pages/advanced/api-profile.tsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { useUser } from "@auth0/nextjs-auth0/client";
-import Layout from "../../components/OLd/layout";
+import Layout from "../../components/Old/layout";
const ApiProfile = () => {
const { user, isLoading } = useUser();
diff --git a/pages/api/admin/requests.tsx b/pages/api/admin/requests.tsx
new file mode 100644
index 0000000..722f666
--- /dev/null
+++ b/pages/api/admin/requests.tsx
@@ -0,0 +1,17 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/admin/requests/[userId].tsx b/pages/api/admin/requests/[userId].tsx
new file mode 100644
index 0000000..763cece
--- /dev/null
+++ b/pages/api/admin/requests/[userId].tsx
@@ -0,0 +1,19 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const { userId } = req.query;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests/'+userId, {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ },
+ method: req.method
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/newRequest.tsx b/pages/api/artist/newRequest.tsx
index 707560e..49fec01 100644
--- a/pages/api/artist/newRequest.tsx
+++ b/pages/api/artist/newRequest.tsx
@@ -2,11 +2,13 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a
export default withApiAuthRequired(async function products(req, res) {
const { accessToken } = await getAccessToken(req, res);
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist', {
headers: {
- "Authorization": `Bearer ${accessToken}`
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
},
- method: 'POST'
+ method: 'POST',
+ body: req.body
});
let result = await response.json();
res.status(200).json(result);
diff --git a/pages/api/artist/onboarded.tsx b/pages/api/artist/onboarded.tsx
index 5216573..bf47abe 100644
--- a/pages/api/artist/onboarded.tsx
+++ b/pages/api/artist/onboarded.tsx
@@ -2,12 +2,15 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a
export default withApiAuthRequired(async function onboardUrl(req, res) {
const { accessToken } = await getAccessToken(req, res);
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile/Onboard', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Onboard', {
headers: {
"Authorization": `Bearer ${accessToken}`
}
});
-
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
let result = await response.json();
res.status(200).json(result);
});
diff --git a/pages/api/artist/onboardurl.tsx b/pages/api/artist/onboardurl.tsx
index c7b624a..628d56b 100644
--- a/pages/api/artist/onboardurl.tsx
+++ b/pages/api/artist/onboardurl.tsx
@@ -2,7 +2,7 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a
export default withApiAuthRequired(async function onboardUrl(req, res) {
const { accessToken } = await getAccessToken(req, res);
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile/Onboard/Url', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Onboard/Url', {
headers: {
"Authorization": `Bearer ${accessToken}`
}
diff --git a/pages/api/artist/page.tsx b/pages/api/artist/page.tsx
new file mode 100644
index 0000000..dc44472
--- /dev/null
+++ b/pages/api/artist/page.tsx
@@ -0,0 +1,29 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function pageSettings(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ if(req.method !== 'GET') {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Page', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ "Content-Type": "application/json"
+ },
+ method: "PUT",
+ body: JSON.stringify(req.body)
+ });
+ let result = await response.json();
+ res.status(200).json(result);
+ }
+ else{
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Page', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+
+ //console.log(response)
+ let result = await response.json();
+ res.status(200).json(result);
+ }
+});
+
diff --git a/pages/api/artist/payout.tsx b/pages/api/artist/payout.tsx
new file mode 100644
index 0000000..8721fee
--- /dev/null
+++ b/pages/api/artist/payout.tsx
@@ -0,0 +1,21 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ ////console.log(accessToken)
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Payout', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ },
+ method: 'GET'
+ });
+ if(response.status == 404)
+ {
+ res.status(200).json({})
+ }
+ else{
+ let result = await response.json();
+ res.status(200).json(result);
+ }
+});
+
diff --git a/pages/api/artist/portfolio.tsx b/pages/api/artist/portfolio.tsx
index 61df741..8417429 100644
--- a/pages/api/artist/portfolio.tsx
+++ b/pages/api/artist/portfolio.tsx
@@ -26,7 +26,7 @@ export default withApiAuthRequired(async function handler(req, res) {
const file = files["newImage"]; // Assuming your file input field name is 'file'
try {
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL + '/api/SellerProfile/Portfolio', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL + '/api/Artist/Portfolio', {
method: 'POST',
headers: {
"Authorization": `Bearer ${accessToken}`,
diff --git a/pages/api/artist/portfolio/[id]/delete.tsx b/pages/api/artist/portfolio/[id]/delete.tsx
index 25b2981..f953f79 100644
--- a/pages/api/artist/portfolio/[id]/delete.tsx
+++ b/pages/api/artist/portfolio/[id]/delete.tsx
@@ -16,7 +16,7 @@ export default withApiAuthRequired(async function handler(req, res) {
const { accessToken } = await getAccessToken(req, res);
const { id } = req.query;
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL + '/api/SellerProfile/Portfolio/'+id, {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL + '/api/Artist/Portfolio/'+id, {
method: 'DELETE',
headers: {
"Authorization": `Bearer ${accessToken}`
diff --git a/pages/api/artist/profile.tsx b/pages/api/artist/profile.tsx
index 1aa8d76..f61e047 100644
--- a/pages/api/artist/profile.tsx
+++ b/pages/api/artist/profile.tsx
@@ -3,7 +3,7 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a
export default withApiAuthRequired(async function sellerProfile(req, res) {
const { accessToken } = await getAccessToken(req, res);
if(req.method !== 'GET') {
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist', {
headers: {
"Authorization": `Bearer ${accessToken}`,
"Content-Type": "application/json"
@@ -16,7 +16,7 @@ export default withApiAuthRequired(async function sellerProfile(req, res) {
res.status(200).json(result);
}
else{
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile', {
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist', {
headers: {
"Authorization": `Bearer ${accessToken}`
}
diff --git a/pages/api/artist/request.tsx b/pages/api/artist/request.tsx
index 2006b13..22787fc 100644
--- a/pages/api/artist/request.tsx
+++ b/pages/api/artist/request.tsx
@@ -2,7 +2,8 @@ import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-a
export default withApiAuthRequired(async function products(req, res) {
const { accessToken } = await getAccessToken(req, res);
- const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/SellerProfile/Request', {
+ ////console.log(accessToken)
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Request', {
headers: {
"Authorization": `Bearer ${accessToken}`
},
diff --git a/pages/api/artist/requestcount.tsx b/pages/api/artist/requestcount.tsx
new file mode 100644
index 0000000..d6956ab
--- /dev/null
+++ b/pages/api/artist/requestcount.tsx
@@ -0,0 +1,19 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const { completed, declined, accepted, paid, offset, pageSize } = req.body;
+ const apiUrl = `${process.env.NEXT_PUBLIC_API_URL}/api/Requests/Artist/Count?completed=${completed}&declined=${declined}&accepted=${accepted}&paid=${paid}&offset=${offset}&pageSize=${pageSize}`;
+ const response = await fetch(apiUrl, {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/requests.tsx b/pages/api/artist/requests.tsx
new file mode 100644
index 0000000..c0a230a
--- /dev/null
+++ b/pages/api/artist/requests.tsx
@@ -0,0 +1,19 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const { completed, declined, accepted, paid, offset, pageSize } = req.body;
+ const apiUrl = `${process.env.NEXT_PUBLIC_API_URL}/api/Requests/Artist?completed=${completed}&declined=${declined}&accepted=${accepted}&paid=${paid}&offset=${offset}&pageSize=${pageSize}`;
+ const response = await fetch(apiUrl, {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/requests/[requestId]/accept.tsx b/pages/api/artist/requests/[requestId]/accept.tsx
new file mode 100644
index 0000000..020fff5
--- /dev/null
+++ b/pages/api/artist/requests/[requestId]/accept.tsx
@@ -0,0 +1,16 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const requestId = req.query.requestId;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Requests/Artist/'+requestId+'/Accept', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ },
+ method: 'PUT'
+ });
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/requests/[requestId]/complete.tsx b/pages/api/artist/requests/[requestId]/complete.tsx
new file mode 100644
index 0000000..a33b708
--- /dev/null
+++ b/pages/api/artist/requests/[requestId]/complete.tsx
@@ -0,0 +1,17 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const requestId = req.query.requestId;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Requests/Artist/'+requestId+'/Complete', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ },
+ method: 'PUT'
+ });
+ console.log(response)
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/requests/[requestId]/deny.tsx b/pages/api/artist/requests/[requestId]/deny.tsx
new file mode 100644
index 0000000..cb853a3
--- /dev/null
+++ b/pages/api/artist/requests/[requestId]/deny.tsx
@@ -0,0 +1,16 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const requestId = req.query.requestId;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Requests/Artist/'+requestId+'/Deny', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ },
+ method: 'PUT'
+ });
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/artist/stats.tsx b/pages/api/artist/stats.tsx
new file mode 100644
index 0000000..47e11e9
--- /dev/null
+++ b/pages/api/artist/stats.tsx
@@ -0,0 +1,21 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ ////console.log(accessToken)
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Stats', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ },
+ method: 'GET'
+ });
+ if(response.status == 404)
+ {
+ res.status(200).json({})
+ }
+ else{
+ let result = await response.json();
+ res.status(200).json(result);
+ }
+});
+
diff --git a/pages/api/auth/[...auth0].tsx b/pages/api/auth/[...auth0].tsx
index 5c189a0..990e06f 100644
--- a/pages/api/auth/[...auth0].tsx
+++ b/pages/api/auth/[...auth0].tsx
@@ -1,3 +1,6 @@
import { handleAuth } from "@auth0/nextjs-auth0";
-
+exports.onExecutePostLogin = async (event, api) => {
+ const namespace = 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role';
+ //console.log(event.authorization)
+ }
export default handleAuth();
diff --git a/pages/api/box/[artistName].tsx b/pages/api/box/[artistName].tsx
new file mode 100644
index 0000000..b5a4e59
--- /dev/null
+++ b/pages/api/box/[artistName].tsx
@@ -0,0 +1,14 @@
+import { useRouter } from 'next/router'
+
+
+export default async function handler(req, res ): Promise
{
+ const { artistName } = req.query;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${artistName}/Page`;
+ const response = await fetch(url);
+ //console.log(response)
+ if (!response.ok) {
+ throw new Error('Failed to fetch seller');
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+}
\ No newline at end of file
diff --git a/pages/api/box/newRequest.tsx b/pages/api/box/newRequest.tsx
new file mode 100644
index 0000000..f7fd12b
--- /dev/null
+++ b/pages/api/box/newRequest.tsx
@@ -0,0 +1,24 @@
+import { useRouter } from 'next/router'
+import { getAccessToken } from '@auth0/nextjs-auth0';
+
+
+export default async function handler(req, res ): Promise {
+ const { artistName } = req.query;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Requests/Request`;
+ const { accessToken } = await getAccessToken(req, res);
+ const response = await fetch(url,{
+ method: 'POST',
+ headers: {
+
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ },
+ body: req.body
+ });
+ //console.log(response)
+ if (!response.ok) {
+ throw new Error('Failed to fetch seller');
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+}
\ No newline at end of file
diff --git a/pages/api/discovery/artist/[sellerId].tsx b/pages/api/discovery/artist/[sellerId].tsx
index 05680f8..f8ec93c 100644
--- a/pages/api/discovery/artist/[sellerId].tsx
+++ b/pages/api/discovery/artist/[sellerId].tsx
@@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
export default async function handler(req, res ): Promise {
const { sellerId } = req.query;
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${sellerId}`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller');
diff --git a/pages/api/discovery/artist/[sellerId]/portfolio.tsx b/pages/api/discovery/artist/[sellerId]/portfolio.tsx
index de058e0..b82c6fb 100644
--- a/pages/api/discovery/artist/[sellerId]/portfolio.tsx
+++ b/pages/api/discovery/artist/[sellerId]/portfolio.tsx
@@ -1,6 +1,6 @@
export default async function handler(req, res ): Promise {
const { sellerId } = req.query;
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${sellerId}/Portfolio`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Portfolio`;
(url)
const response = await fetch(url);
if (!response.ok) {
diff --git a/pages/api/discovery/artists.tsx b/pages/api/discovery/artists.tsx
index 30c0889..25e5335 100644
--- a/pages/api/discovery/artists.tsx
+++ b/pages/api/discovery/artists.tsx
@@ -1,5 +1,5 @@
export default async function handler(req, res): Promise {
- let url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers`;
+ let url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch sellers');
diff --git a/pages/api/me.tsx b/pages/api/me.tsx
index 6c5b116..4da21ba 100644
--- a/pages/api/me.tsx
+++ b/pages/api/me.tsx
@@ -5,7 +5,7 @@ import { getAccessToken } from '@auth0/nextjs-auth0';
export default withApiAuthRequired(async function me(req, res) {
if(req.method !== 'GET') {
- console.log(req.body)
+ ////console.log(req.body)
const { accessToken } = await getAccessToken(req, res);
const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/User', {
headers: {
diff --git a/pages/api/requestcount.tsx b/pages/api/requestcount.tsx
new file mode 100644
index 0000000..1b04bda
--- /dev/null
+++ b/pages/api/requestcount.tsx
@@ -0,0 +1,19 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const { completed, declined, accepted, paid, offset, pageSize } = req.body;
+ const apiUrl = `${process.env.NEXT_PUBLIC_API_URL}/api/Requests/Customer/Count?completed=${completed}&declined=${declined}&accepted=${accepted}&paid=${paid}&offset=${offset}&pageSize=${pageSize}`;
+ const response = await fetch(apiUrl, {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/requests.tsx b/pages/api/requests.tsx
new file mode 100644
index 0000000..2d175e8
--- /dev/null
+++ b/pages/api/requests.tsx
@@ -0,0 +1,19 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function onboardUrl(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const { completed, declined, accepted, paid, offset, pageSize } = req.body;
+ const apiUrl = `${process.env.NEXT_PUBLIC_API_URL}/api/Requests/Customer?completed=${completed}&declined=${declined}&accepted=${accepted}&paid=${paid}&offset=${offset}&pageSize=${pageSize}`;
+ const response = await fetch(apiUrl, {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`
+ }
+ });
+ if(response.ok==false){
+ res.status(200).json({})
+ return;
+ }
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/requests/[requestId]/payment.tsx b/pages/api/requests/[requestId]/payment.tsx
new file mode 100644
index 0000000..5d87cc5
--- /dev/null
+++ b/pages/api/requests/[requestId]/payment.tsx
@@ -0,0 +1,15 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const requestId = req.query.requestId;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Requests/Customer/'+requestId+'/Payment', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ }
+ });
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/api/requests/[requestId]/references.tsx b/pages/api/requests/[requestId]/references.tsx
new file mode 100644
index 0000000..b6fc74f
--- /dev/null
+++ b/pages/api/requests/[requestId]/references.tsx
@@ -0,0 +1,17 @@
+import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
+
+export default withApiAuthRequired(async function products(req, res) {
+ const { accessToken } = await getAccessToken(req, res);
+ const requestId = req.query.requestId;
+ const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Requests/Customer/'+requestId+'/Reference', {
+ headers: {
+ "Authorization": `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json'
+ },
+ method: req.method,
+ body: req.body
+ });
+ let result = await response.json();
+ res.status(200).json(result);
+});
+
diff --git a/pages/box/[artistName].tsx b/pages/box/[artistName].tsx
new file mode 100644
index 0000000..681c11e
--- /dev/null
+++ b/pages/box/[artistName].tsx
@@ -0,0 +1,317 @@
+import { withPageAuthRequired } from "@auth0/nextjs-auth0/client";
+import Grid from '@mui/material/Grid';
+import Card from '@mui/material/Card';
+import CardActions from '@mui/material/CardActions';
+import CardContent from '@mui/material/CardContent';
+import CardMedia from '@mui/material/CardMedia';
+import Button from '@mui/material/Button';
+import Typography from '@mui/material/Typography';
+import { useEffect, useState } from "react";
+import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';
+import Rating from '@mui/material/Rating';
+import Dialog from '@mui/material/Dialog';
+import DialogTitle from '@mui/material/DialogTitle';
+import DialogContent from '@mui/material/DialogContent';
+import DialogContentText from '@mui/material/DialogContentText';
+import DialogActions from '@mui/material/DialogActions';
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import TextField from '@mui/material/TextField';
+import ArtistPortfolio from "../../components/Old/artistPortfolio";
+import { RouterNetwork } from "mdi-material-ui";
+import { useRouter } from "next/router";
+import { profile } from "console";
+import FileOpen from "@mui/icons-material/FileOpen";
+
+const Profile = () => {
+
+ const [profileData, setArtistData] = useState(null);
+ const [description, setDescription] = useState("");
+ const [guidelines, setGuidelines] = useState("");
+
+ const [requestMessage, setRequestMessage] = useState("");
+ const [requestPrice, setRequestPrice] = useState(100.00);
+ const [file, setFile] = useState(null);
+
+ const handleFileChange = (event) => {
+ const files = event.target.files;
+ setFile(files); // Set files to state
+ }
+
+
+ const handleRequestMessageChange = (event) => {
+ setRequestMessage(event.target.value);
+ }
+
+ const handleRequestPriceChange = (event) => {
+ setRequestPrice(event.target.value);
+ }
+
+
+ const router = useRouter();
+ const [open, setOpen] = useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ const submitRequest = async (payload) => {
+ const formData = new FormData();
+ formData.append("artistId", payload.artistId);
+ formData.append("message", payload.message);
+ formData.append("amount", payload.amount);
+ formData.append("file", payload.file); // Append the file to FormData
+
+ const requestResponse = await fetch('/api/box/newRequest', {
+ method: 'POST',
+ body: formData // Pass FormData containing the file
+ });
+
+ if(requestResponse.ok){
+ router.push("/dashboard/requests")
+ } else {
+ alert("Error submitting request")
+ }
+ }
+
+ const getData = async () => {
+ if(router.query.artistName!=null){
+ const profileResponse = await fetch('/api/discovery/artist/'+router.query.artistName);
+ const sellerProfile = await profileResponse.json();
+ setArtistData(sellerProfile);
+
+ setDescription(sellerProfile["description"]);
+ setGuidelines(sellerProfile["requestGuidelines"]);
+ }
+ }
+
+ useEffect(() => {
+ getData()
+ }, [router.query.artistName]);
+
+ const columns: GridColDef[] = [
+ {
+ field: 'message',
+ headerName: 'Review',
+ flex: 0.75
+ },
+ {
+ field: 'rating',
+ headerName: 'Rating',
+ flex: 0.25,
+ renderCell: (params: GridValueGetterParams) => (
+
+ ),
+ },
+ ];
+
+ const rows = [
+ { id: 1, message: 'Great work!', rating: 5 },
+ { id: 2, message: 'BAD work!', rating: 1 },
+ { id: 3, message: 'Okay work!', rating: 4 },
+ { id: 4, message: 'Meh work!', rating: 2 },
+ { id: 5, message: 'Great work!', rating: 5 },
+ { id: 6, message: 'Mid work!', rating: 3 },
+ { id: 7, message: 'HORRIBLE work!', rating: 1 },
+ ];
+
+ return (
+ <>
+
+
+
+
+
+
+ STORE HEADER
+
+
+
+
+
+
+
+
+ BIOGRAPHY HEADER
+
+ {description}
+
+
+
+
+
+
+
+
+
+ GUIDELINES HEADER
+
+ {guidelines}
+
+
+
+
+ By clicking "Start New Request" you are agreeing to the terms above and to the terms of service.
+
+
+ [TERMS OF SERVICE]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ REVIEWS HEADER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PORTFOLIO HEADER
+
+
+
+ {profileData!=null ? (
+
+ ):null}
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+// Protected route, checking user authentication client-side.(CSR)
+export default withPageAuthRequired(Profile);
+
+
diff --git a/pages/dashboard/admin/requests.tsx b/pages/dashboard/admin/requests.tsx
new file mode 100644
index 0000000..a9c8389
--- /dev/null
+++ b/pages/dashboard/admin/requests.tsx
@@ -0,0 +1,50 @@
+import { useUser,withPageAuthRequired } from "@auth0/nextjs-auth0/client";
+import { Grid, Typography } from "@mui/material";
+import Card from "@mui/material/Card";
+import CardContent from "@mui/material/CardContent";
+import EditableArtistPortfolio from "../../../components/Old/editableArtistPortfolio";
+import { useEffect, useState } from "react";
+import TextField from '@mui/material/TextField';
+import Button from '@mui/material/Button';
+import Switch from '@mui/material/Switch';
+import Divider from '@mui/material/Divider';
+import ArtistRequest from "../../../components/ArtistRequest";
+
+const ArtistRequests = () => {
+ const {user, isLoading} = useUser();
+ const [artistRequestData, setArtistRequestData] = useState(null);
+ const getData = () => {
+ fetch('/api/admin/requests').then(response => response.json().then(data => setArtistRequestData(data)))
+ }
+ useEffect(() => {
+ getData()
+ }, []);
+ return (
+
+ {(artistRequestData != null && Object.keys(artistRequestData).length>0) ? (
+ (artistRequestData.map((request) => {
+
+ let formattedTime = "";
+ if (artistRequestData) {
+ const date = new Date(request["requestDate"]);
+ formattedTime = date.toLocaleTimeString('en-US', {
+ month: 'long',
+ day: '2-digit',
+ year: 'numeric',
+ hour12: true,
+ hour: '2-digit',
+ minute: '2-digit'
+ }); // Example format
+ }
+ return (
+
+ )
+ }
+ ))
+ ):(No requests)}
+
+ );
+};
+
+// Protected route, checking user authentication client-side.(CSR)
+export default withPageAuthRequired(ArtistRequests);
diff --git a/pages/dashboard/artist/artistsettings.tsx b/pages/dashboard/artist/artistsettings.tsx
index b086ab1..a7a0b49 100644
--- a/pages/dashboard/artist/artistsettings.tsx
+++ b/pages/dashboard/artist/artistsettings.tsx
@@ -1,5 +1,5 @@
import { useUser,withPageAuthRequired } from "@auth0/nextjs-auth0/client";
-import { Grid, Typography } from "@mui/material";
+import { CircularProgress, Grid, Typography } from "@mui/material";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import EditableArtistPortfolio from "../../../components/Old/editableArtistPortfolio";
@@ -8,9 +8,12 @@ import TextField from '@mui/material/TextField';
import Button from '@mui/material/Button';
import Switch from '@mui/material/Switch';
import Divider from '@mui/material/Divider';
+import ArtistRequest from "../../../components/ArtistRequest";
+import Box from '@mui/material/Box';
const ArtistSettings = () => {
const {user, isLoading} = useUser();
+ const [loading, setLoading] = useState(true);
const [name, setName] = useState("");
const [description, setDescription] = useState("");
@@ -21,7 +24,7 @@ const ArtistSettings = () => {
const [guidelines, setGuidelines] = useState("");
const [saved, setSaved] = useState(false);
- const [profileData, setSellerProfileData] = useState(null);
+ const [profileData, setArtistData] = useState(null);
const handleDisplayNameChange = (event) => {
setName(event.target.value);
@@ -64,13 +67,22 @@ const saveChanges = async () => {
setSocial3(sellerProfile["socialMeidaLink3"]);
setSocial4(sellerProfile["socialMeidaLink4"]);
setGuidelines(sellerProfile["requestGuidelines"]);
- setSellerProfileData(sellerProfile);
+ setArtistData(sellerProfile);
+ setLoading(false);
}
useEffect(() => {
getData()
}, []);
return (
+ <>
+ {(loading) ? (
+
+
+
+ ):
+ (
+
@@ -83,7 +95,7 @@ const saveChanges = async () => {
-
+
@@ -93,7 +105,7 @@ const saveChanges = async () => {
-
+
@@ -124,6 +136,8 @@ const saveChanges = async () => {
+ )}
+ >
);
};
diff --git a/pages/dashboard/artist/pagesettings.tsx b/pages/dashboard/artist/pagesettings.tsx
index f986089..907203c 100644
--- a/pages/dashboard/artist/pagesettings.tsx
+++ b/pages/dashboard/artist/pagesettings.tsx
@@ -1,602 +1,185 @@
import { withPageAuthRequired } from "@auth0/nextjs-auth0/client";
import Grid from '@mui/material/Grid';
import Card from '@mui/material/Card';
+import CardActions from '@mui/material/CardActions';
import CardContent from '@mui/material/CardContent';
+import CardMedia from '@mui/material/CardMedia';
import Button from '@mui/material/Button';
-import { Accordion, Typography } from "@mui/material";
+import Typography from '@mui/material/Typography';
import { useEffect, useState } from "react";
-import Switch from '@mui/material/Switch';
-import Divider from '@mui/material/Divider';
-import TextField from '@mui/material/TextField';
-import { MuiColorInput } from 'mui-color-input'
-import { AccordionSummary } from "@mui/material";
-import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
-import AccordionDetails from '@mui/material/AccordionDetails';
-import Slider from '@mui/material/Slider';
-import ArtistPortfolio from '../../../components/Old/artistPortfolio';
-import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import EditableArtistPortfolio from "../../../components/Old/editableArtistPortfolio";
+import ArtistPortfolio from "../../../components/Old/artistPortfolio";
+import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';
+import Rating from '@mui/material/Rating';
+import CircularProgress from '@mui/material/CircularProgress';
import Box from '@mui/material/Box';
const Profile = () => {
- const [profileData, setSellerProfileData] = useState(null);
+ const [profileData, setArtistData] = useState(null);
+ const [description, setDescription] = useState("");
+ const [guidelines, setGuidelines] = useState("");
- const [backgroundColor, setBackgroundColor] = useState('rgb(126, 115, 115)');
-
- const [headerColor, setHeaderColor] = useState('rgb(194, 187, 187)');
- const [headerIsImage, setHeaderImage] = useState(false);
- const [headerImageUrl, setHeaderImageUrl] = useState('');
- const [headerText, setHeaderText] = useState('Shop');
- const [headerSize, setHeaderSize] = useState(5);
- const headerVariant = [
- 'h6', // Size 1
- 'h5', // Size 2
- 'h4', // Size 3
- 'h3', // Size 4
- 'h2', // Size 5
- 'h1', // Size 6
- ][headerSize - 1] || 'h6';
-
-
- const [bioColor, setBioColor] = useState('rgb(186, 186, 186)');
- const [bioBgColor, setBioBgColor] = useState('rgb(78, 73, 73)');
- const [bioHeaderColor, setBioHeaderColor] = useState('rgb(194, 187, 187)');
- const [bioHeaderIsImage, setBioHeaderImage] = useState(false);
- const [bioHeaderImageUrl, setBioHeaderImageUrl] = useState('');
- const [bioHeaderText, setBioHeaderText] = useState('Biography');
- const [bioHeaderSize, setBioHeaderSize] = useState(3);
- const [bioSize, setBioSize] = useState(1);
- const bioHeaderVariant = [
- 'h6', // Size 1
- 'h5', // Size 2
- 'h4', // Size 3
- 'h3', // Size 4
- 'h2', // Size 5
- 'h1', // Size 6
- ][bioHeaderSize - 1] || 'h6';
- const bioVariant = [
- 'h6', // Size 1
- 'h5', // Size 2
- 'h4', // Size 3
- 'h3', // Size 4
- 'h2', // Size 5
- 'h1', // Size 6
- ][bioSize - 1] || 'h6';
-
- const [portfolioHeaderColor, setPortfolioHeaderColor] = useState('rgb(194, 187, 187)');
- const [portfolioHeaderIsImage, setPortfolioHeaderImage] = useState(false);
- const [portfolioHeaderImageUrl, setPortfolioHeaderImageUrl] = useState('');
- const [portfolioHeaderText, setPortfolioHeaderText] = useState('Portfolio');
- const [portfolioHeaderSize, setPortfolioHeaderSize] = useState(3);
- const [portfolioBgColor, setPortfolioBgColor] = useState('rgb(78, 73, 73)');
- const [portfolioColumns, setPotrfolioColumns] = useState(2);
- const [portfolioWoven, setPortfolioWoven] = useState(true);
- const [portfolioShouldScroll, setPortfolioShouldScroll] = useState(true);
- const [portfolioSize, setPortfolioSize] = useState(25);
- const portfolioVariant = [
- 'h6', // Size 1
- 'h5', // Size 2
- 'h4', // Size 3
- 'h3', // Size 4
- 'h2', // Size 5
- 'h1', // Size 6
- ][portfolioHeaderSize - 1] || 'h6';
-
-
-
-
- const [requestHeaderColor, setRequestHeaderColor] = useState('rgb(194, 187, 187)');
- const [requestHeaderIsImage, setRequestHeaderImage] = useState(false);
- const [requestHeaderImageUrl, setRequestHeaderImageUrl] = useState('');
- const [requestHeaderText, setRequestHeaderText] = useState('Requests');
- const [requestHeaderSize, setRequestHeaderSize] = useState(3);
- const [requestBgColor, setRequestBgColor] = useState('rgb(78, 73, 73)');
- const [requestTermsTextColor, setRequestTermsTextColor] = useState('rgb(194, 187, 187)');
- const [requestButtonBGColor, setRequestButtonBGColor] = useState('rgb(101, 97, 97)');
- const [requestButtonTextColor, setRequestButtonTextColor] = useState('rgb(194, 187, 187)');
- const [requestHoverButtonBGColor, setRequestHoverButtonBGColor] = useState('rgb(98, 98, 98)');
- const [requestHoverButtonTextColor, setRequestHoverButtonTextColor] = useState('rgb(194, 187, 187)');
- const requestVariant = [
- 'h6', // Size 1
- 'h5', // Size 2
- 'h4', // Size 3
- 'h3', // Size 4
- 'h2', // Size 5
- 'h1', // Size 6
- ][requestHeaderSize - 1] || 'h6';
+ const [loading, setLoading] = useState(true);
const getData = async () => {
- const profileResponse = await fetch('/api/artist/profile');
- const sellerProfile = await profileResponse.json();
- setSellerProfileData(sellerProfile);
+ const profileResponse = await fetch('/api/artist/profile');
+ const sellerProfile = await profileResponse.json();
+ setArtistData(sellerProfile);
+
+ setDescription(sellerProfile["description"]);
+ setGuidelines(sellerProfile["requestGuidelines"]);
+ setLoading(false);
}
useEffect(() => {
getData()
}, []);
- const handleBackgroundColorChange = (newValue) => {
- setBackgroundColor(newValue)
- }
-
- const handleHeaderTextChange = (e) => {
- setHeaderText(e.target.value)
- }
-
- const handleHeaderImageUrl = (e) => {
- setHeaderImageUrl(e.target.value)
- }
- const handleHeaderImageToggle = (e) => {
- setHeaderImage(e.target.checked)
- };
-
- const handleHeaderSize = (e, newValue) => {
- setHeaderSize(newValue)
- }
-
- const handleHeaderColorChange = (newValue) => {
- setHeaderColor(newValue)
- }
-
-
-
- const handleBioHeaderTextChange = (e) => {
- setBioHeaderText(e.target.value)
- }
-
- const handleBioHeaderImageUrl = (e) => {
- setBioHeaderImageUrl(e.target.value)
- }
- const handleBioHeaderImageToggle = (e) => {
- setBioHeaderImage(e.target.checked)
- };
-
- const handleBioHeaderSize = (e, newValue) => {
- setBioHeaderSize(newValue)
- }
- const handleBioSize = (e, newValue) => {
- setBioSize(newValue)
- }
-
- const handleBioHeaderColorChange = (newValue) => {
- setBioHeaderColor(newValue)
- }
- const handleBioColorChange = (newValue) => {
- setBioColor(newValue)
- }
-
- const handleBioBgColorChange = (newValue) => {
- setBioBgColor(newValue)
- }
-
-
-
-
- const handlePortfolioBgColor = (newValue) => {
- setPortfolioBgColor(newValue)
- }
-
- const handlePortfolioColumns = (e, newValue) => {
- setPotrfolioColumns(newValue)
- }
- const handlePortfolioWoven = (e) => {
- setPortfolioWoven(e.target.checked)
- };
- const handlePortfolioShouldScroll = (e) => {
- setPortfolioShouldScroll(e.target.checked)
- console.log(portfolioShouldScroll)
- };
- const handlePortfolioSize = (e, newValue) => {
- setPortfolioSize(newValue)
- }
-
- const handlePortfolioHeaderTextChange = (e) => {
- setPortfolioHeaderText(e.target.value)
- }
-
- const handlePortfolioHeaderImageUrl = (e) => {
- setPortfolioHeaderImageUrl(e.target.value)
- }
- const handlePortfolioHeaderImageToggle = (e) => {
- setPortfolioHeaderImage(e.target.checked)
- };
-
- const handlePortfolioHeaderSize = (e, newValue) => {
- setPortfolioHeaderSize(newValue)
- }
- const handlePortfolioHeaderColorChange = (newValue) => {
- setPortfolioHeaderColor(newValue)
- }
-
-
-
-
-
- const handleRequestBgColor = (newValue) => {
- setRequestBgColor(newValue)
- }
-
- const handleRequestHeaderTextChange = (e) => {
- setRequestHeaderText(e.target.value)
- }
-
- const handleRequestHeaderImageUrl = (e) => {
- setRequestHeaderImageUrl(e.target.value)
- }
- const handleRequestHeaderImageToggle = (e) => {
- setRequestHeaderImage(e.target.checked)
- };
-
- const handleRequestHeaderSize = (e, newValue) => {
- setRequestHeaderSize(newValue)
- }
- const handleRequestHeaderColorChange = (newValue) => {
- setRequestHeaderColor(newValue)
- }
- const handleRequestTermsTextColorChange = (newValue) => {
- setRequestTermsTextColor(newValue)
- }
- const handleRequestButtonBGColorChange = (newValue) => {
- setRequestButtonBGColor(newValue)
- }
- const handleRequestButtonTextColorChange = (newValue) => {
- setRequestButtonTextColor(newValue)
- }
- const handleRequestHoverButtonBGColorChange = (newValue) => {
- setRequestHoverButtonBGColor(newValue)
- }
- const handleRequestHoverButtonTextColorChange = (newValue) => {
- setRequestHoverButtonTextColor(newValue)
- }
-
+ const columns: GridColDef[] = [
+ {
+ field: 'message',
+ headerName: 'Review',
+ flex: 0.75
+ },
+ {
+ field: 'rating',
+ headerName: 'Rating',
+ flex: 0.25,
+ renderCell: (params: GridValueGetterParams) => (
+
+ ),
+ },
+ ];
+
+ const rows = [
+ { id: 1, message: 'Great work!', rating: 5 },
+ { id: 2, message: 'BAD work!', rating: 1 },
+ { id: 3, message: 'Okay work!', rating: 4 },
+ { id: 4, message: 'Meh work!', rating: 2 },
+ { id: 5, message: 'Great work!', rating: 5 },
+ { id: 6, message: 'Mid work!', rating: 3 },
+ { id: 7, message: 'HORRIBLE work!', rating: 1 },
+ ];
+
return (
+ (loading) ? (
+
+
+
+ ):(
+
-
-
-
-
-
-
- Customize Your Page
-
+
+
+
+ STORE HEADER
+
+
+
+
+
+
+
+
+ BIOGRAPHY HEADER
+
+ {description}
+
+
+
-
-
-
-
-
-
-
-
- }
- aria-controls="panel1-content"
- >
- Background
-
-
-
-
-
-
-
-
-
-
-
-
- }
- aria-controls="panel1-content"
- >
- Header
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Text Size
-
-
-
-
-
-
-
-
-
-
-
- }
- aria-controls="panel1-content"
- >
- Biography
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Header Size
-
-
-
-
-
-
-
- Text Size
-
-
-
-
-
-
-
-
-
-
-
- }
- aria-controls="panel1-content"
- >
- Portfolio
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Header Size
-
-
-
-
-
-
-
-
-
-
- Masonry Layout Enabled
-
-
-
-
-
-
-
- Columns
-
-
-
-
-
-
-
- Enable Scrolling
-
-
-
-
-
-
-
- Max Size
-
-
-
-
-
-
-
-
-
-
-
-
- }
- aria-controls="panel1-content"
- >
- Requests
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Header Size
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {(headerIsImage) ? (
-
- ) : (
-
- {headerText}
-
- )}
-
-
-
-
- {(bioHeaderIsImage) ? (
-
- ) : (
-
- {bioHeaderText}
-
- )}
- {(profileData ? profileData["biography"]:null)}
+
+
+
+
+
+ GUIDELINES HEADER
+
+ {guidelines}
-
-
+
+
+
+ By clicking "Start New Request" you are agreeing to the terms above and to the terms of service.
+
+
+ [TERMS OF SERVICE]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ REVIEWS HEADER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PORTFOLIO HEADER
-
-
-
- {(portfolioHeaderIsImage) ? (
-
- ) : (
-
- {portfolioHeaderText}
-
- )}
-
-
- {(portfolioShouldScroll)?(
-
- {(profileData ? (
-
- ):null)}
-
- ):(
-
- {(profileData ? (
-
- ):null)}
-
- )}
-
-
-
-
-
-
-
- {(requestHeaderIsImage) ? (
-
- ) : (
-
- {requestHeaderText}
-
- )}
-
-
-
- TERMS
-
-
-
- By clicking the button below, you agree to the
- terms and conditions.
-
-
-
-
-
-
-
-
-
+
+
+ {profileData!=null ? (
+
+ ):null}
+
-
+
+
+
+ )
);
};
// Protected route, checking user authentication client-side.(CSR)
export default withPageAuthRequired(Profile);
+
+
diff --git a/pages/dashboard/artist/requests.tsx b/pages/dashboard/artist/requests.tsx
new file mode 100644
index 0000000..7b722d3
--- /dev/null
+++ b/pages/dashboard/artist/requests.tsx
@@ -0,0 +1,322 @@
+import * as React from 'react';
+import { DataGrid } from '@mui/x-data-grid';
+import { GridColDef } from '@mui/x-data-grid';
+import TextField from '@mui/material/TextField';
+import { Button, CardContent, IconButton, Typography } from '@mui/material';
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import { DateField } from '@mui/x-date-pickers/DateField';
+import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
+import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
+import X from '@mui/icons-material/X';
+import { Close, Upload } from '@mui/icons-material';
+import Tooltip from '@mui/material/Tooltip';
+import dayjs from 'dayjs';
+import { useRouter } from 'next/router';
+import { ClipboardCheck, OpenInNew } from 'mdi-material-ui';
+import Chip from '@mui/material/Chip';
+
+import {Check, Refresh } from '@mui/icons-material';
+import PriceCheckIcon from '@mui/icons-material/PriceCheck';
+import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn';
+import AssignmentLateIcon from '@mui/icons-material/AssignmentLate';
+import { Card, CardHeader } from '@mui/material';
+import { Dialog, DialogActions, DialogContent, DialogTitle, Grid, Stack } from '@mui/material';
+import RequestReferenceImage from '../../../components/Old/requestReferencesImage';
+import RequestReferences from '../../../components/Old/requestReferences';
+
+
+export default function ServerPaginationGrid() {
+ const router = useRouter();
+ const columns = [
+ { field: 'id', headerName: 'ID', flex: 0.1},
+ { field: 'status', headerName: 'Status', flex: 0.15,
+ renderCell: (params) => {
+ if(params.row.completed){
+ return } label="Completed" variant="filled" color="success" />
+ }
+ else if(params.row.paid){
+ return } label="Paid" variant="filled" color="success" />
+ }
+ else if(params.row.accepted && params.row.paid==false){
+ return } label="Pending Payment" variant="filled" color="warning" />
+ }
+ else if(params.row.accepted && params.row.paid){
+ return } label="Accepted" variant="filled" color="info" />
+ }
+ else if(params.row.declined){
+ return } label="Declined" variant="filled" color="error" />
+ }
+ else{
+ return } label="Pending" variant="filled" color="secondary" />
+ }
+ }
+ },
+ { field: 'message', headerName: 'Message', flex: 0.5,
+ renderCell: (params) => {
+ return ;
+ }},
+ { field: 'amount', headerName: 'Amount', flex: 0.1, renderCell: (params) => {
+ return ;
+ }},
+ { field: 'requestDate', headerName: 'Request Date', flex:0.15,
+ renderCell: (params) =>{
+
+ let formattedTime = ""
+ const date = new Date(params.row.requestDate);
+ formattedTime = date.toLocaleTimeString('en-US', { month: 'long', day: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }); // Example format
+ return
+ } },
+ { field: 'action', headerName: '', flex:0.15,
+ renderCell: (params) =>{
+
+ const acceptRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/accept", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+
+ const viewRequest = async () => {
+
+ }
+
+ const denyRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/deny", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+
+ const completeRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/complete", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+
+ const [open, setOpen] = React.useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ let formattedTime = ""
+ const date = new Date(params.row.requestDate);
+ formattedTime = date.toLocaleTimeString('en-US', { month: 'long', day: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }); // Example format
+
+ return (<>
+
+
+ {((params.row.accepted==false && params.row.declined==false && params.row.completed==false) ? (
+ <>
+
+
+
+
+
+
+ >
+ ): null
+ )}
+ {((params.row.accepted==true && params.row.declined==false && params.row.completed==false && params.row.paid==true) ? (
+ <>
+
+
+
+ >
+ ): null
+ )}
+ >
+ )
+ } }
+ ];
+ const [isLoading, setIsLoading] = React.useState(true);
+ const [requestCount, setRequestCount] = React.useState(null);
+ const [requestData, setRequestData] = React.useState({});
+ const [paginationModel, setPaginationModel] = React.useState({
+ page: 0,
+ pageSize: 5,
+ });
+
+
+ const handlePageChange = async (params) => {
+ setPaginationModel(params);
+ }
+
+ const getRequests = async () => {
+ setIsLoading(true);
+ const response = await fetch('/api/artist/requests', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ completed: true, // Example query parameter
+ declined: true, // Example query parameter
+ accepted: true, // Example query parameter
+ paid: true, // Example query parameter
+ offset: paginationModel.page*paginationModel.pageSize, // Example query parameter
+ pageSize: paginationModel.pageSize
+ }),
+ });
+ const data = await response.json();
+ setRequestData(data);
+ setIsLoading(false);
+ }
+ const getRequestsCount = async () => {
+ const response = await fetch('/api/artist/requestcount', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ completed: true, // Example query parameter
+ declined: true, // Example query parameter
+ accepted: true, // Example query parameter
+ paid: true, // Example query parameter
+ offset: paginationModel.page*paginationModel.pageSize, // Example query parameter
+ pageSize: paginationModel.pageSize
+ })
+ });
+ const data = await response.json();
+ setRequestCount(data);
+ setRowCountState((prevRowCountState) =>
+ data !== undefined
+ ? data
+ : prevRowCountState,
+ );
+ return data;
+ }
+
+ // Some API clients return undefined while loading
+ // Following lines are here to prevent `rowCountState` from being undefined during the loading
+ const [rowCountState, setRowCountState] = React.useState(0);
+ React.useEffect(() => {
+ getRequestsCount();
+ getRequests();
+ }, [requestCount, setRowCountState,paginationModel]);
+
+ return (
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/pages/dashboard/index.tsx b/pages/dashboard/index.tsx
index 35a5d49..91ac0aa 100644
--- a/pages/dashboard/index.tsx
+++ b/pages/dashboard/index.tsx
@@ -25,16 +25,19 @@ import router from 'next/router'
import { isObject } from 'util'
import Orders from '../../components/Orders'
import StatisticsCard from '../../views/dashboard/StatisticsCard'
-import SellerStats from '../../components/SellerStats'
+import ArtistStats from '../../components/ArtistStats'
import { Clipboard } from 'mdi-material-ui'
+import CircularProgress from '@mui/material/CircularProgress'
+import Box from '@mui/material/Box'
const Dashboard = () => {
- const [profileData, setSellerProfileData] = useState(null);
- const [requestData, setSellerRequestData] = useState(null);
+ const [profileData, setArtistData] = useState(null);
+ const [requestData, setArtistRequestData] = useState(null);
const [onboardData, setOnboardedData] = useState(false);
-
+ const [statsData, setStatsData] = useState(null);
+ const [loading, setLoading] = useState(true);
const [onboarding, setOnboarding] = useState(false);
const [onboarded, setOnboarded] = useState(false);
@@ -45,10 +48,13 @@ const Dashboard = () => {
const getData = async () => {
const profileResponse = await fetch('/api/artist/profile');
const sellerProfile = await profileResponse.json();
- setSellerProfileData(sellerProfile);
+ setArtistData(sellerProfile);
+ const statsResponse = await fetch('/api/artist/stats');
+ const statsResponseData = await statsResponse.json();
+ setStatsData(statsResponseData);
const requestResponse = await fetch('/api/artist/request');
const sellerRequest = await requestResponse.json();
- setSellerRequestData(sellerRequest);
+ setArtistRequestData(sellerRequest);
const onboardedResponse = await fetch('/api/artist/onboarded');
const onboardedData = await onboardedResponse.json();
setOnboardedData(onboardedData["onboarded"]);
@@ -59,94 +65,108 @@ const Dashboard = () => {
setOnboarding(true)
}
if(sellerProfile!=null && Object.keys(sellerProfile).length>0 && sellerRequest["accepted"]){
+ ////console.log("Test")
setOnboarded(true)
}
+ setLoading(false);
}
useEffect(() => {
getData();
}, []);
return (
+ <>
+ {(loading) ? (
+
+
+
+ ):(
+
-
+
-
-
-
-
-
-
- My Orders
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Requests
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
- {( onboarding==true && onboardData==false ) ? (
-
-
-
- ):(
- (onboarding) ? (
-
+
+ {( onboarding==true && onboarded==false || onboardData==false ) ? (
+
+
+
+ ):(
+ (onboarded && onboardData==true && onboarding) ? (
+
+
+
+
+
+ {(statsData!=null && isObject(statsData)) ? (
+ ):(
+ null
+ )}
+
+
+ http://localhost:3000/box/"{(profileData["name"].replace(/\s+/g, '-') ?? "")}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) : (
+
-
-
-
-
-
- "http://localhost:3000/shops/neroshi"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
- ) : (
-
-
-
-
-
-
-
-
-
-
-
- )
- )}
-
-
+ )
+ )}
+
+
+ )}
+ >
)
}
diff --git a/pages/dashboard/payout.tsx b/pages/dashboard/payout.tsx
new file mode 100644
index 0000000..8afb1e8
--- /dev/null
+++ b/pages/dashboard/payout.tsx
@@ -0,0 +1,63 @@
+import { useUser,withPageAuthRequired } from "@auth0/nextjs-auth0/client";
+import { CardHeader, Grid, Typography } from "@mui/material";
+import Card from "@mui/material/Card";
+import CardContent from "@mui/material/CardContent";
+import { useEffect, useState } from "react";
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import Button from '@mui/material/Button';
+import { OpenInNew } from "@mui/icons-material";
+import CircularProgress from '@mui/material/CircularProgress';
+import Box from '@mui/material/Box';
+
+const Payout = () => {
+ const {user, isLoading} = useUser();
+ const [loading, setLoading] = useState(true);
+ const [payoutData, setPayoutData] = useState(null);
+ const getData = async () => {
+ var payoutResponse = await fetch('/api/artist/payout');
+ var payoutData = await payoutResponse.json();
+ setPayoutData(payoutData);
+ setLoading(false);
+ }
+ useEffect(() => {
+ getData()
+ }, []);
+ return (
+ <>
+ {(loading) ? (
+
+
+
+ ):(
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ >
+ );
+};
+
+// Protected route, checking user authentication client-side.(CSR)
+export default withPageAuthRequired(Payout);
diff --git a/pages/dashboard/requests.tsx b/pages/dashboard/requests.tsx
new file mode 100644
index 0000000..dfa7fd0
--- /dev/null
+++ b/pages/dashboard/requests.tsx
@@ -0,0 +1,310 @@
+import * as React from 'react';
+import { DataGrid } from '@mui/x-data-grid';
+import { GridColDef } from '@mui/x-data-grid';
+import TextField from '@mui/material/TextField';
+import { Button, Stack, Typography } from '@mui/material';
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import { DateField } from '@mui/x-date-pickers/DateField';
+import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
+import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
+import Chip from '@mui/material/Chip';
+import {Check, Close, Download, OpenInFull, OpenInNew, Refresh, Upload } from '@mui/icons-material';
+import PriceCheckIcon from '@mui/icons-material/PriceCheck';
+import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn';
+import AssignmentLateIcon from '@mui/icons-material/AssignmentLate';
+import ShoppingCartCheckoutIcon from '@mui/icons-material/ShoppingCartCheckout';
+import { IconButton } from '@mui/material';
+import Tooltip from '@mui/material/Tooltip';
+import { Card, CardContent } from '@mui/material';
+
+
+import dayjs from 'dayjs';
+import { DownloadBox } from 'mdi-material-ui';
+import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, FormControl, InputLabel, Box } from '@mui/material';
+import RequestDialog from '../../components/requestDialog';
+import { Grid } from '@mui/material';
+import { useRouter } from 'next/router';
+
+
+export default function ServerPaginationGrid() {
+ const router = useRouter();
+ const columns = [
+ { field: 'id', headerName: 'ID', flex: 0.1},
+ { field: 'status', headerName: 'Status', flex: 0.15,
+ renderCell: (params) => {
+ if(params.row.completed){
+ return } label="Completed" variant="filled" color="success" />
+ }
+ else if(params.row.paid){
+ return } label="Paid" variant="filled" color="success" />
+ }
+ else if(params.row.accepted && params.row.paid==false){
+ return } label="Pending Payment" variant="filled" color="warning" />
+ }
+ else if(params.row.accepted && params.row.paid){
+ return } label="Accepted" variant="filled" color="info" />
+ }
+ else if(params.row.declined){
+ return } label="Declined" variant="filled" color="error" />
+ }
+ else{
+ return } label="Pending" variant="filled" color="secondary" />
+ }
+ }
+ },
+ { field: 'message', headerName: 'Message', flex: 0.5,
+ renderCell: (params) => {
+ return ;
+ }},
+ { field: 'amount', headerName: 'Amount', flex: 0.1, renderCell: (params) => {
+ return ;
+ }},
+ { field: 'requestDate', headerName: 'Request Date', flex:0.15,
+ renderCell: (params) =>{
+
+ let formattedTime = ""
+ const date = new Date(params.row.requestDate);
+ formattedTime = date.toLocaleTimeString('en-US', { month: 'long', day: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }); // Example format
+ return
+ } },
+ { field: 'download', headerName: '', flex:0.1,
+ renderCell: (params) =>{
+ const acceptRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/accept", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+
+ const viewRequest = async () => {
+
+ }
+
+ const denyRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/deny", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+
+ const completeRequest = async () => {
+ let response = await fetch('/api/artist/requests/'+params.row["id"]+"/complete", { method: 'PUT' })
+ if(response.status === 200){
+ router.reload()
+ }
+ else{
+ alert("Error accepting request.")
+ }
+ }
+ const handlePay = async () => {
+ var paymentUrlRequest = await fetch('/api/requests/'+params.row.id+'/payment')
+ //console.log(paymentUrlRequest);
+ var paymentUrlJson = await paymentUrlRequest.json();
+ var paymentUrl = paymentUrlJson.paymentUrl;
+ window.open(paymentUrl);
+ }
+ const [open, setOpen] = React.useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ let formattedTime = ""
+ const date = new Date(params.row.requestDate);
+ formattedTime = date.toLocaleTimeString('en-US', { month: 'long', day: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' }); // Example format
+
+ return (<>
+
+
+ {((params.row.accepted==true &¶ms.row.declined==false && params.row.paid==false) ? (
+
+ ): null
+ )}
+ {((params.row.completed) ? (
+
+ ): null
+ )}
+ >
+ )
+ } }
+ ];
+ const [isLoading, setIsLoading] = React.useState(true);
+ const [requestCount, setRequestCount] = React.useState(null);
+ const [requestData, setRequestData] = React.useState({});
+ const [paginationModel, setPaginationModel] = React.useState({
+ page: 0,
+ pageSize: 5,
+ });
+
+
+ const getRequests = async () => {
+ setIsLoading(true);
+ const response = await fetch('/api/requests', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ completed: true, // Example query parameter
+ declined: true, // Example query parameter
+ accepted: true, // Example query parameter
+ paid: true, // Example query parameter
+ offset: paginationModel.page*paginationModel.pageSize, // Example query parameter
+ pageSize: paginationModel.pageSize
+ }),
+ });
+ const data = await response.json();
+ setRequestData(data);
+ setIsLoading(false);
+ }
+ const getRequestsCount = async () => {
+ const response = await fetch('/api/requestcount', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ completed: true, // Example query parameter
+ declined: true, // Example query parameter
+ accepted: true, // Example query parameter
+ paid: true, // Example query parameter
+ offset: paginationModel.page*paginationModel.pageSize, // Example query parameter
+ pageSize: paginationModel.pageSize
+ })
+ });
+ const data = await response.json();
+ setRequestCount(data);
+ setRowCountState((prevRowCountState) =>
+ data !== undefined
+ ? data
+ : prevRowCountState,
+ );
+ return data;
+ }
+
+ // Some API clients return undefined while loading
+ // Following lines are here to prevent `rowCountState` from being undefined during the loading
+ const [rowCountState, setRowCountState] = React.useState(0);
+ React.useEffect(() => {
+ getRequests();
+ getRequestsCount();
+ }, [requestCount, setRowCountState,paginationModel]);
+
+ return (
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/pages/dashboard/requests/[requestId].tsx b/pages/dashboard/requests/[requestId].tsx
new file mode 100644
index 0000000..cbad4f9
--- /dev/null
+++ b/pages/dashboard/requests/[requestId].tsx
@@ -0,0 +1,280 @@
+import { withPageAuthRequired } from "@auth0/nextjs-auth0/client";
+import Grid from '@mui/material/Grid';
+import Card from '@mui/material/Card';
+import CardActions from '@mui/material/CardActions';
+import CardContent from '@mui/material/CardContent';
+import CardMedia from '@mui/material/CardMedia';
+import Button from '@mui/material/Button';
+import Typography from '@mui/material/Typography';
+import { useEffect, useState } from "react";
+import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid';
+import Rating from '@mui/material/Rating';
+import Dialog from '@mui/material/Dialog';
+import DialogTitle from '@mui/material/DialogTitle';
+import DialogContent from '@mui/material/DialogContent';
+import DialogContentText from '@mui/material/DialogContentText';
+import DialogActions from '@mui/material/DialogActions';
+import CurrencyTextField from '@lupus-ai/mui-currency-textfield';
+import TextField from '@mui/material/TextField';
+import ArtistPortfolio from "../../../components/Old/artistPortfolio";
+import { RouterNetwork } from "mdi-material-ui";
+import { useRouter } from "next/router";
+import { profile } from "console";
+
+const Profile = () => {
+
+ const [profileData, setArtistData] = useState(null);
+ const [description, setDescription] = useState("");
+ const [guidelines, setGuidelines] = useState("");
+
+ const [requestMessage, setRequestMessage] = useState("");
+ const [requestPrice, setRequestPrice] = useState(100.00);
+
+ const handleRequestMessageChange = (event) => {
+ setRequestMessage(event.target.value);
+ }
+
+ const handleRequestPriceChange = (event) => {
+ setRequestPrice(event.target.value);
+ }
+
+
+ const router = useRouter();
+ const [open, setOpen] = useState(false);
+
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ const submitRequest = async () => {
+ var payload = JSON.stringify({
+ "artistId": profileData["id"],
+ "message": requestMessage,
+ "amount": requestPrice
+ });
+ //console.log(payload)
+ const requestResponse = await fetch('/api/box/newRequest', {
+ method: 'POST',
+ body: payload
+ })
+ if(requestResponse.ok){
+ router.push("/dashboard/requests")
+ }
+ else{
+ alert("Error submitting request")
+ }
+ }
+
+ const getData = async () => {
+ if(router.query.artistName!=null){
+ const profileResponse = await fetch('/api/discovery/artist/'+router.query.artistName);
+ const sellerProfile = await profileResponse.json();
+ setArtistData(sellerProfile);
+
+ setDescription(sellerProfile["description"]);
+ setGuidelines(sellerProfile["requestGuidelines"]);
+ }
+ }
+
+ useEffect(() => {
+ getData()
+ }, [router.query.artistName]);
+
+ const columns: GridColDef[] = [
+ {
+ field: 'message',
+ headerName: 'Review',
+ flex: 0.75
+ },
+ {
+ field: 'rating',
+ headerName: 'Rating',
+ flex: 0.25,
+ renderCell: (params: GridValueGetterParams) => (
+
+ ),
+ },
+ ];
+
+ const rows = [
+ { id: 1, message: 'Great work!', rating: 5 },
+ { id: 2, message: 'BAD work!', rating: 1 },
+ { id: 3, message: 'Okay work!', rating: 4 },
+ { id: 4, message: 'Meh work!', rating: 2 },
+ { id: 5, message: 'Great work!', rating: 5 },
+ { id: 6, message: 'Mid work!', rating: 3 },
+ { id: 7, message: 'HORRIBLE work!', rating: 1 },
+ ];
+
+
+ return (
+ <>
+
+
+
+
+
+
+ STORE HEADER
+
+
+
+
+
+
+
+
+ BIOGRAPHY HEADER
+
+ {description}
+
+
+
+
+
+
+
+
+
+ GUIDELINES HEADER
+
+ {guidelines}
+
+
+
+
+ By clicking "Start New Request" you are agreeing to the terms above and to the terms of service.
+
+
+ [TERMS OF SERVICE]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ REVIEWS HEADER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PORTFOLIO HEADER
+
+
+
+ {profileData!=null ? (
+
+ ):null}
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
+// Protected route, checking user authentication client-side.(CSR)
+export default withPageAuthRequired(Profile);
+
+
diff --git a/pages/dashboard/settings.tsx b/pages/dashboard/settings.tsx
index 7dc0398..04955eb 100644
--- a/pages/dashboard/settings.tsx
+++ b/pages/dashboard/settings.tsx
@@ -1,10 +1,12 @@
import { useUser, withPageAuthRequired } from "@auth0/nextjs-auth0/client";
-import { Grid, Typography } from "@mui/material";
+import { CircularProgress, Grid, Typography } from "@mui/material";
import { useEffect, useState } from "react";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import TextField from '@mui/material/TextField';
import Button from '@mui/material/Button';
+import Box from '@mui/material/Box';
+import * as React from 'react';
const ArtistSettings = () => {
@@ -14,6 +16,9 @@ const ArtistSettings = () => {
const [biography, setBiography] = useState("");
const [saved, setSaved] = useState(false);
+ const [loading, setLoading] = useState(true);
+
+
const handleDisplayNameChange = (event) => {
setDisplayName(event.target.value);
}
@@ -41,8 +46,15 @@ const ArtistSettings = () => {
setDisplayName(user["displayName"])
setBiography(user["biography"])
setAppUser(user);
+ setLoading(false);
}
return (
+ <>
+ {(loading) ? (
+
+
+
+ ):(
@@ -61,14 +73,13 @@ const ArtistSettings = () => {
-
-
-
+ )}
+ >
);
};
diff --git a/pages/index.tsx b/pages/index.tsx
index 266b865..ee62927 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -15,7 +15,8 @@ import Pricing from '../components/Pricing';
import BetaAccess from '../components/BetaAccess';
import FAQ from '../components/FAQ';
import Footer from '../components/Footer';
-import { useUser } from "@auth0/nextjs-auth0/client";
+import { useUser, } from "@auth0/nextjs-auth0/client";
+import { getSession } from "@auth0/nextjs-auth0";
const defaultTheme = createTheme({});
interface ToggleCustomThemeProps {
@@ -68,11 +69,7 @@ export default function LandingPage() {
const [showCustomTheme, setShowCustomTheme] = React.useState(true);
const { user, isLoading } = useUser();
-
- const toggleCustomTheme = () => {
- setShowCustomTheme((prev) => !prev);
- };
-
+
return (
diff --git a/services/DiscoveryService.ts b/services/DiscoveryService.ts
index cd143bd..a739430 100644
--- a/services/DiscoveryService.ts
+++ b/services/DiscoveryService.ts
@@ -3,9 +3,9 @@
-export async function fetchSellerPortfolio(id): Promise {
+export async function fetchArtistPortfolio(id): Promise {
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${id}/Portfolio`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${id}/Portfolio`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
@@ -15,7 +15,7 @@ export async function fetchSellerPortfolio(id): Promise {
export async function fetchServicePortfolio(sellerId, serviceId): Promise {
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${sellerId}/Services/${serviceId}/Portfolio`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}/Portfolio`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
@@ -25,7 +25,7 @@ export async function fetchServicePortfolio(sellerId, serviceId): Promise {
export async function fetchService(sellerId, serviceId): Promise {
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${sellerId}/Services/${serviceId}`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${sellerId}/Services/${serviceId}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error('Failed to fetch seller portfolio');
@@ -36,6 +36,6 @@ export async function fetchService(sellerId, serviceId): Promise {
export function getPortfolioUrl(id, pieceId): string {
- var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Sellers/${id}/Portfolio/${pieceId}`;
+ var url = process.env.NEXT_PUBLIC_API_URL+`/api/Discovery/Artists/${id}/Portfolio/${pieceId}`;
return url;
}
\ No newline at end of file
diff --git a/swagger.json b/swagger.json
deleted file mode 100644
index fb84825..0000000
--- a/swagger.json
+++ /dev/null
@@ -1,2555 +0,0 @@
-{
- "openapi": "3.0.1",
- "info": {
- "title": "API Documentation",
- "description": "",
- "version": "v1.0"
- },
- "paths": {
- "/api/admin/AdminOrders": {
- "get": {
- "tags": [
- "AdminOrders"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminOrders/Count": {
- "get": {
- "tags": [
- "AdminOrders"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminOrders/{orderId}": {
- "get": {
- "tags": [
- "AdminOrders"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "post": {
- "tags": [
- "AdminOrders"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "type": "string"
- }
- },
- "text/json": {
- "schema": {
- "type": "string"
- }
- },
- "application/*+json": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminOrders/{orderId}/Terminate": {
- "put": {
- "tags": [
- "AdminOrders"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellerRequests": {
- "get": {
- "tags": [
- "AdminSellerRequests"
- ],
- "summary": "Gets a list of all of the requests from users to become a seller.",
- "parameters": [
- {
- "name": "offset",
- "in": "query",
- "description": "The offset to start at.",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "description": "The amount of records to return.",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellerRequests/Count": {
- "get": {
- "tags": [
- "AdminSellerRequests"
- ],
- "summary": "Gets the amount of requests there are from users to become a seller.",
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellerRequests/{userId}": {
- "put": {
- "tags": [
- "AdminSellerRequests"
- ],
- "summary": "Accepts a request to become a seller from a user.",
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "description": "The ID of the user to accept the request for.",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers": {
- "get": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/Count": {
- "get": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}": {
- "get": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}/Orders": {
- "get": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}/Suspend": {
- "put": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "reason",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "days",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}/Unsuspend": {
- "put": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}/Terminate": {
- "put": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminSellers/{sellerId}/SetBiography": {
- "put": {
- "tags": [
- "AdminSellers"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "type": "string"
- }
- },
- "text/json": {
- "schema": {
- "type": "string"
- }
- },
- "application/*+json": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers": {
- "get": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/Count": {
- "get": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}": {
- "get": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/Orders": {
- "get": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/Suspend": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "reason",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "days",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/Unsuspend": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/Ban": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "reason",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "days",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/Unban": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/SetDisplayName": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "type": "string"
- }
- },
- "text/json": {
- "schema": {
- "type": "string"
- }
- },
- "application/*+json": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/admin/AdminUsers/{userId}/SetBiography": {
- "put": {
- "tags": [
- "AdminUsers"
- ],
- "parameters": [
- {
- "name": "userId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "type": "string"
- }
- },
- "text/json": {
- "schema": {
- "type": "string"
- }
- },
- "application/*+json": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers/Count": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "search",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "string",
- "default": ""
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers/{sellerId}/Services": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers/{sellerId}/Services/Count": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers/{sellerId}/Services/{serviceId}/Reviews": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "serviceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Discovery/Sellers/{sellerId}/Services/{serviceId}/Reviews/Count": {
- "get": {
- "tags": [
- "Discovery"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "serviceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Order/PaymentWebhook": {
- "post": {
- "tags": [
- "Order"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders": {
- "get": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- },
- {
- "name": "status",
- "in": "query",
- "style": "form",
- "schema": {
- "$ref": "#/components/schemas/EnumOrderStatus"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}": {
- "get": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- },
- {
- "name": "status",
- "in": "query",
- "style": "form",
- "schema": {
- "$ref": "#/components/schemas/EnumOrderStatus"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "delete": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Sellers/{sellerId}/Services/{serviceId}": {
- "post": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "sellerId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "serviceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/AcceptPrice": {
- "put": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Payment": {
- "put": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Accept": {
- "put": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Deny": {
- "delete": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Review": {
- "post": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderReviewModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderReviewModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderReviewModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Messages": {
- "get": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Message": {
- "post": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/Orders/{orderId}/Message/{messageId}/Attachment": {
- "post": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "messageId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
- }
- }
- },
- "encoding": {
- "file": {
- "style": "form"
- }
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "get": {
- "tags": [
- "Order"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "messageId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders": {
- "get": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- },
- {
- "name": "status",
- "in": "query",
- "style": "form",
- "schema": {
- "$ref": "#/components/schemas/EnumOrderStatus"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}": {
- "get": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- },
- {
- "name": "status",
- "in": "query",
- "style": "form",
- "schema": {
- "$ref": "#/components/schemas/EnumOrderStatus"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Cancel": {
- "delete": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Accept": {
- "put": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Start": {
- "put": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/AdjustPrice": {
- "put": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "price",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "number",
- "format": "double"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/CompleteRevision": {
- "put": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Messages": {
- "get": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Message": {
- "post": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceOrderMessageModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerOrders/{orderId}/Message/{messageId}/Attachment": {
- "post": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "messageId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
- }
- }
- },
- "encoding": {
- "file": {
- "style": "form"
- }
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "get": {
- "tags": [
- "SellerOrder"
- ],
- "parameters": [
- {
- "name": "orderId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "messageId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerProfile": {
- "get": {
- "tags": [
- "SellerProfile"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "put": {
- "tags": [
- "SellerProfile"
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "post": {
- "tags": [
- "SellerProfile"
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerProfileModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerProfile/{sellerServiceId}/Portfolio/{portfolioId}": {
- "get": {
- "tags": [
- "SellerProfile"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "portfolioId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerProfile/Portfolio": {
- "get": {
- "tags": [
- "SellerProfile"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "post": {
- "tags": [
- "SellerProfile"
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
- }
- }
- },
- "encoding": {
- "file": {
- "style": "form"
- }
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerProfile/Portfolio/{portfolioId}": {
- "delete": {
- "tags": [
- "SellerProfile"
- ],
- "parameters": [
- {
- "name": "portfolioId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerProfile/Payment": {
- "post": {
- "tags": [
- "SellerProfile"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "get": {
- "tags": [
- "SellerProfile"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerService": {
- "get": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "offset",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 0
- }
- },
- {
- "name": "pageSize",
- "in": "query",
- "style": "form",
- "schema": {
- "type": "integer",
- "format": "int32",
- "default": 10
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "post": {
- "tags": [
- "SellerService"
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceCreateModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceCreateModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceCreateModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerService/Count": {
- "get": {
- "tags": [
- "SellerService"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerService/{sellerServiceId}": {
- "put": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceUpdateModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceUpdateModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/SellerServiceUpdateModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "delete": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerService/{sellerServiceId}/Portfolio": {
- "get": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "post": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
- }
- }
- },
- "encoding": {
- "file": {
- "style": "form"
- }
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/SellerService/{sellerServiceId}/Portfolio/{portfolioId}": {
- "get": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "portfolioId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "delete": {
- "tags": [
- "SellerService"
- ],
- "parameters": [
- {
- "name": "portfolioId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "name": "sellerServiceId",
- "in": "path",
- "required": true,
- "style": "simple",
- "schema": {
- "type": "string"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- },
- "/api/User": {
- "get": {
- "tags": [
- "User"
- ],
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- },
- "put": {
- "tags": [
- "User"
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UserInfoUpdateModel"
- }
- },
- "text/json": {
- "schema": {
- "$ref": "#/components/schemas/UserInfoUpdateModel"
- }
- },
- "application/*+json": {
- "schema": {
- "$ref": "#/components/schemas/UserInfoUpdateModel"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Success"
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "EnumOrderStatus": {
- "enum": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7
- ],
- "type": "integer",
- "format": "int32"
- },
- "SellerProfileModel": {
- "type": "object",
- "properties": {
- "socialMediaLinks": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "nullable": true
- },
- "biography": {
- "type": "string",
- "nullable": true
- },
- "prepaymentRequired": {
- "type": "boolean"
- }
- },
- "additionalProperties": false
- },
- "SellerServiceCreateModel": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "nullable": true
- },
- "description": {
- "type": "string",
- "nullable": true
- },
- "price": {
- "type": "number",
- "format": "double"
- }
- },
- "additionalProperties": false
- },
- "SellerServiceOrderMessageModel": {
- "type": "object",
- "properties": {
- "message": {
- "type": "string",
- "nullable": true
- }
- },
- "additionalProperties": false
- },
- "SellerServiceOrderReviewModel": {
- "type": "object",
- "properties": {
- "rating": {
- "type": "integer",
- "format": "int32"
- },
- "review": {
- "type": "string",
- "nullable": true
- }
- },
- "additionalProperties": false
- },
- "SellerServiceUpdateModel": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "nullable": true
- },
- "description": {
- "type": "string",
- "nullable": true
- },
- "price": {
- "type": "number",
- "format": "double"
- }
- },
- "additionalProperties": false
- },
- "UserInfoUpdateModel": {
- "type": "object",
- "properties": {
- "displayName": {
- "type": "string",
- "nullable": true
- },
- "biography": {
- "type": "string",
- "nullable": true
- }
- },
- "additionalProperties": false
- }
- },
- "securitySchemes": {
- "oauth2": {
- "type": "oauth2",
- "flows": {
- "implicit": {
- "authorizationUrl": "https://dev-12mb5yq82dow1twh.us.auth0.com/authorize?audience=https://api.artplatform.com",
- "tokenUrl": "https://dev-12mb5yq82dow1twh.us.auth0.com/oauth/token",
- "scopes": {
- "openid": "OpenId",
- "email": "Email",
- "profile": "Profile",
- "read:user": "Read your profile information.",
- "write:user": "Update your profile information.",
- "read:billing-information": "Read your billing information.",
- "write:billing-information": "Update your billing information.",
- "read:seller-profile": "Read your seller profile information.",
- "write:seller-profile": "Update your seller profile information.",
- "write:seller-profile-request": "Accept seller profile requests.",
- "read:seller-profile-request": "Read seller profile requests.",
- "read:seller-service": "Read services on your seller profile.",
- "write:seller-service": "Update services on your seller profile.",
- "write:orders": "Create new orders and take action against existing ones.",
- "read:orders": "View your orders.",
- "read:seller-orders": "View orders on your seller profile.",
- "write:seller-orders": "Update orders on your seller profile."
- }
- }
- }
- }
- }
- },
- "security": [
- {
- "oauth2": [
- "openid",
- "email",
- "profile"
- ]
- }
- ]
-}
\ No newline at end of file