feat: frontend
This commit is contained in:
136
ordr-ui/app/client/controllers/ItemController.ts
Normal file
136
ordr-ui/app/client/controllers/ItemController.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import {CreateItemQuery} from '../queries/CreateItemQuery'
|
||||
import {ItemPriceResponse} from '../response/ItemPriceResponse'
|
||||
import {OrderItemPriceResponse} from '../response/OrderItemPriceResponse'
|
||||
import {SetItemPriceQuery} from '../queries/SetItemPriceQuery'
|
||||
import {GetCurrentPriceQuery} from '../queries/GetCurrentPriceQuery'
|
||||
import {AddItemToOrderQuery} from '../queries/AddItemToOrderQuery'
|
||||
import {GetOrderItemsQuery} from '../queries/GetOrderItemsQuery'
|
||||
import {SetItemMadeRequest} from '../request/SetItemMadeRequest'
|
||||
import {OrderFilledResponse} from '../response/OrderFilledResponse'
|
||||
import {SetItemQuantityRequest} from '../request/SetItemQuantityRequest'
|
||||
import {DeleteOrderItemRequest} from '../request/DeleteOrderItemRequest'
|
||||
import { ItemHistoryResponse } from '../response/ItemHistoryResponse'
|
||||
|
||||
export const CreateItem = async (query: CreateItemQuery): Promise<ItemPriceResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_name: query.item_name,
|
||||
in_season: query.in_season,
|
||||
item_price: query.item_price
|
||||
})
|
||||
|
||||
const res = await axios.post(process.env.API_URL + `/item/create?${queryParams.toString()}`)
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const SetItemPrice = async (query: SetItemPriceQuery) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_id: query.item_id,
|
||||
item_price: query.item_price
|
||||
})
|
||||
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/item/price?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const GetCurrentPrice = async (query: GetCurrentPriceQuery): Promise<ItemPriceResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_id: query.item_id
|
||||
})
|
||||
|
||||
const res = await axios.get(process.env.API_URL + `/item/price?${queryParams.toString()}`)
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const AddItemToOrder = async (query: AddItemToOrderQuery): Promise<OrderItemPriceResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_id: query.item_id,
|
||||
order_id: query.order_id,
|
||||
quantity: query.quantity
|
||||
})
|
||||
|
||||
console.log(process.env.NEXT_PUBLIC_API_URL + `/order/item?${queryParams.toString()}`)
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/order/item?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
if (res.data?.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const GetOrderItems = async (query: GetOrderItemsQuery): Promise<OrderItemPriceResponse[]> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
order_id: query.order_id
|
||||
})
|
||||
|
||||
const res = await axios.get(process.env.NEXT_PUBLIC_API_URL + `/order/items?${queryParams.toString()}`, {withCredentials: true})
|
||||
if (res.data?.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data || []
|
||||
}
|
||||
|
||||
export const SetItemMade = async (request: SetItemMadeRequest): Promise<OrderFilledResponse> => {
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + '/item/made', request, {withCredentials: true})
|
||||
if (res.data?.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const SetItemQuantity = async (request: SetItemQuantityRequest): Promise<OrderFilledResponse> => {
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/item/quantity`, request, {withCredentials: true})
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const DeleteOrderItem = async (request: DeleteOrderItemRequest) => {
|
||||
const res = await axios.delete(process.env.API_URL + `/order/item?order_id=${request.order_id}&item_id=${request.item_id}`)
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const DeleteItem = async (itemId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
item_id: itemId.toString()
|
||||
})
|
||||
|
||||
const res = await axios.delete(process.env.API_URL + `/item?${queryParams.toString()}`)
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const GetItems = async (): Promise<ItemPriceResponse[]> => {
|
||||
const res = await axios.get(process.env.NEXT_PUBLIC_API_URL + `/items`, {withCredentials: true})
|
||||
|
||||
if (res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
return res.data
|
||||
}
|
||||
|
||||
export const GetItemHistory = async (itemId: number): Promise<ItemHistoryResponse[]> => {
|
||||
const res = await axios.get(process.env.NEXT_PUBLIC_API_URL + `/item/history?item_id=${itemId.toString()}`, {withCredentials: true})
|
||||
|
||||
return res.data
|
||||
}
|
||||
56
ordr-ui/app/client/controllers/OrderController.ts
Normal file
56
ordr-ui/app/client/controllers/OrderController.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import {OrderResponse} from '../response/OrderResponse'
|
||||
import {OrderTableQuery} from '../request/GetOrderTableRequest'
|
||||
|
||||
axios.interceptors.response.use(response => {
|
||||
return response;
|
||||
}, async error => {
|
||||
if (error.response.status === 401) {
|
||||
const resp = await axios.get(process.env.NEXT_PUBLIC_API_URL + "/auth/login", {withCredentials: true})
|
||||
window.location.href = resp.data.Location
|
||||
}
|
||||
return error
|
||||
})
|
||||
export const CreateOrder = async (orderer: string, dateDue: string): Promise<OrderResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
orderer: orderer,
|
||||
date_due: dateDue,
|
||||
date_placed: new Date().toISOString()
|
||||
})
|
||||
const res = await axios.post(process.env.NEXT_PUBLIC_API_URL + `/order/create?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
return res.data as OrderResponse
|
||||
}
|
||||
|
||||
export const GetOrderById = async (orderId: number): Promise<OrderResponse> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
order_id: orderId.toString()
|
||||
})
|
||||
const res = await axios.get(process.env.API_URL + `/order?${queryParams.toString()}`)
|
||||
return res.data as OrderResponse
|
||||
}
|
||||
|
||||
export const GetOrderTable = async (page: number, filter: number, searchParams: OrderTableQuery): Promise<OrderResponse[]> => {
|
||||
const queryParams = new URLSearchParams({
|
||||
page: page.toString(),
|
||||
filter: filter.toString()
|
||||
})
|
||||
|
||||
console.log(page)
|
||||
console.log(filter)
|
||||
console.log(searchParams)
|
||||
console.log(queryParams.toString())
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/order/table?${queryParams.toString()}`, searchParams, {withCredentials: true})
|
||||
if(res.data?.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
return res.data || []
|
||||
}
|
||||
|
||||
export const DeleteOrder = async (orderId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
order_id: orderId.toString()
|
||||
})
|
||||
|
||||
await axios.delete(process.env.API_URL + `/order?${queryParams}`)
|
||||
}
|
||||
81
ordr-ui/app/client/controllers/UserController.ts
Normal file
81
ordr-ui/app/client/controllers/UserController.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
import axios, { HttpStatusCode } from 'axios'
|
||||
import { UserResponse } from '../response/UserResponse'
|
||||
import { UserTable } from '../queries/UserTableQuery'
|
||||
import { LoginRedirectResponse } from '../response'
|
||||
|
||||
// import { cookies } from 'next/headers'
|
||||
|
||||
export const GetCurrentUser = async (): Promise<UserResponse | undefined> => {
|
||||
console.log(process.env.NEXT_PUBLIC_API_URL + "/user/current")
|
||||
const res = await axios.get(process.env.NEXT_PUBLIC_API_URL + "/user/current", {
|
||||
maxRedirects: 0,
|
||||
validateStatus: (status) => {
|
||||
return status >= 200 && status < 400
|
||||
}});
|
||||
if(res.data.Location) {
|
||||
window.location.href = res.data.Location
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
export const GetUserTable = async (page: number): Promise<UserResponse[]> => {
|
||||
const res = await axios.put(process.env.NEXT_PUBLIC_API_URL + `/users?page=${page.toString()}`, {
|
||||
name: "",
|
||||
jobPosition: ""
|
||||
}, {
|
||||
withCredentials: true
|
||||
});
|
||||
if (res.data.Location)
|
||||
window.location.href = res.data.Location
|
||||
return res.data || []
|
||||
}
|
||||
|
||||
export const SetUserName = async (userName: string) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_name: userName
|
||||
});
|
||||
await axios.put(process.env.NEXT_PUBLIC_API_URL + `/user/name?${queryParams.toString()}`)
|
||||
}
|
||||
|
||||
export const PromoteUser = async (userId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_id: userId.toString()
|
||||
});
|
||||
await axios.put(process.env.NEXT_PUBLIC_API_URL + `/user/promote?${queryParams.toString()}`, {}, {withCredentials: true});
|
||||
}
|
||||
|
||||
export const DemoteUser = async (userId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_id: userId.toString()
|
||||
})
|
||||
await axios.put(process.env.NEXT_PUBLIC_API_URL + `/user/demote?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
}
|
||||
|
||||
export const DeactivateUser = async (userId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_id: userId.toString()
|
||||
})
|
||||
await axios.delete(process.env.NEXT_PUBLIC_API_URL + `/user/deactivate?${queryParams.toString()}`, {withCredentials: true})
|
||||
}
|
||||
|
||||
export const ActivateUser = async (userId: number) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_id: userId.toString()
|
||||
})
|
||||
await axios.put(process.env.NEXT_PUBLIC_API_URL + `/user/activate?${queryParams.toString()}`, {}, {withCredentials: true})
|
||||
}
|
||||
|
||||
export const CreatePosition = async (positionName: string) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
position_name: positionName
|
||||
})
|
||||
await axios.post(process.env.NEXT_PUBLIC_API_URL + `/position/create?` + queryParams.toString())
|
||||
}
|
||||
|
||||
export const SetUserPosition = async (userId: number, positionName: string) => {
|
||||
const queryParams = new URLSearchParams({
|
||||
user_id: userId.toString(),
|
||||
position: positionName
|
||||
})
|
||||
await axios.put(process.env.NEXT_PUBLIC_API_URL + `/user/position?${queryParams.toString}`)
|
||||
}
|
||||
3
ordr-ui/app/client/controllers/index.ts
Normal file
3
ordr-ui/app/client/controllers/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './ItemController'
|
||||
export * from './OrderController'
|
||||
export * from './UserController'
|
||||
9
ordr-ui/app/client/queries/AddItemToOrderQuery.ts
Normal file
9
ordr-ui/app/client/queries/AddItemToOrderQuery.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
AddItemToOrder
|
||||
PUT: {{baseURL}}/order/item?item_id=2&order_id=2&quantity=8
|
||||
*/
|
||||
export interface AddItemToOrderQuery {
|
||||
item_id: string;
|
||||
order_id: string;
|
||||
quantity: string;
|
||||
}
|
||||
9
ordr-ui/app/client/queries/CreateItemQuery.ts
Normal file
9
ordr-ui/app/client/queries/CreateItemQuery.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
CreateItem
|
||||
POST: {{baseURL}}/item/create?item_name=4 Berry Pie&in_season=1&item_price=35.00
|
||||
*/
|
||||
export interface CreateItemQuery {
|
||||
item_name: string;
|
||||
in_season: string;
|
||||
item_price: string;
|
||||
}
|
||||
8
ordr-ui/app/client/queries/CreateOrderQuery.ts
Normal file
8
ordr-ui/app/client/queries/CreateOrderQuery.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
CreateOrder
|
||||
POST: {{baseURL}}/order/create?orderer=john roe&date_due=2026-01-01T23:59:59-07:00
|
||||
*/
|
||||
export interface CreateOrder {
|
||||
orderer: string;
|
||||
date_due: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/CreatePositionQuery.ts
Normal file
7
ordr-ui/app/client/queries/CreatePositionQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
CreatePosition
|
||||
POST: {{baseURL}}/position/create?position_name=Manager
|
||||
*/
|
||||
export interface CreatePosition {
|
||||
position_name: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/DeactivateUserQuery.ts
Normal file
7
ordr-ui/app/client/queries/DeactivateUserQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
DeactivateUser
|
||||
DELETE: {{baseURL}}/user/deactivate?user_id=4
|
||||
*/
|
||||
export interface DeactivateUser {
|
||||
user_id: string;
|
||||
}
|
||||
0
ordr-ui/app/client/queries/DeleteOrderQuery.ts
Normal file
0
ordr-ui/app/client/queries/DeleteOrderQuery.ts
Normal file
7
ordr-ui/app/client/queries/DemoteUserQuery.ts
Normal file
7
ordr-ui/app/client/queries/DemoteUserQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
DemoteUser
|
||||
PUT: {{baseURL}}/user/demote?user_id=1
|
||||
*/
|
||||
export interface DemoteUser {
|
||||
user_id: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/GetCurrentPriceQuery.ts
Normal file
7
ordr-ui/app/client/queries/GetCurrentPriceQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
GetCurrentPrice
|
||||
GET: {{baseURL}}/item/price/current?item_id=1
|
||||
*/
|
||||
export interface GetCurrentPriceQuery {
|
||||
item_id: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/GetOrderByIdQuery.ts
Normal file
7
ordr-ui/app/client/queries/GetOrderByIdQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
GetOrderById
|
||||
GET: http://localhost:8080/order?order_id=8
|
||||
*/
|
||||
export interface GetOrderById {
|
||||
order_id: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/GetOrderItemsQuery.ts
Normal file
7
ordr-ui/app/client/queries/GetOrderItemsQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
GetOrderItems
|
||||
GET: http://localhost:8080/order/items?order_id=1
|
||||
*/
|
||||
export interface GetOrderItemsQuery {
|
||||
order_id: string;
|
||||
}
|
||||
8
ordr-ui/app/client/queries/GetOrderTableQuery.ts
Normal file
8
ordr-ui/app/client/queries/GetOrderTableQuery.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
GetOrderTable
|
||||
GET: http://localhost:8080/order/table?page=0&filter=257
|
||||
*/
|
||||
export interface GetOrderTableQuery {
|
||||
page: string;
|
||||
filter: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/PromoteUserQuery.ts
Normal file
7
ordr-ui/app/client/queries/PromoteUserQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
PromoteUser
|
||||
PUT: {{baseURL}}/user/promote?user_id=1
|
||||
*/
|
||||
export interface PromoteUser {
|
||||
user_id: string;
|
||||
}
|
||||
8
ordr-ui/app/client/queries/SetItemPriceQuery.ts
Normal file
8
ordr-ui/app/client/queries/SetItemPriceQuery.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
SetItemPrice
|
||||
PUT: {{baseURL}}/item/price?item_id=1&item_price=36.99
|
||||
*/
|
||||
export interface SetItemPriceQuery {
|
||||
item_id: string;
|
||||
item_price: string;
|
||||
}
|
||||
8
ordr-ui/app/client/queries/SetUserPositionQuery.ts
Normal file
8
ordr-ui/app/client/queries/SetUserPositionQuery.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
SetUserPosition
|
||||
PUT: {{baseURL}}/user/position?user_id=2&position=Manager
|
||||
*/
|
||||
export interface SetUserPosition {
|
||||
user_id: string;
|
||||
position: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/UserNameQuery.ts
Normal file
7
ordr-ui/app/client/queries/UserNameQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
UserName
|
||||
PUT: {{baseURL}}/user/name?user_name=Ada%20Conway
|
||||
*/
|
||||
export interface UserName {
|
||||
user_name: string;
|
||||
}
|
||||
7
ordr-ui/app/client/queries/UserTableQuery.ts
Normal file
7
ordr-ui/app/client/queries/UserTableQuery.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
UserTable
|
||||
GET: {{baseURL}}/users?page=1
|
||||
*/
|
||||
export interface UserTable {
|
||||
page: string;
|
||||
}
|
||||
8
ordr-ui/app/client/request/DeleteOrderItemRequest.ts
Normal file
8
ordr-ui/app/client/request/DeleteOrderItemRequest.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
DeleteOrderItem
|
||||
DELETE: {{baseURL}}/order/item
|
||||
*/
|
||||
export interface DeleteOrderItemRequest {
|
||||
item_id: number;
|
||||
order_id: number;
|
||||
}
|
||||
9
ordr-ui/app/client/request/GetOrderTableRequest.ts
Normal file
9
ordr-ui/app/client/request/GetOrderTableRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
GetOrderTable
|
||||
GET: http://localhost:8080/order/table?page=0&filter=257
|
||||
*/
|
||||
export interface OrderTableQuery {
|
||||
orderer: string;
|
||||
date_due: string;
|
||||
date_placed: string;
|
||||
}
|
||||
9
ordr-ui/app/client/request/SetItemMadeRequest.ts
Normal file
9
ordr-ui/app/client/request/SetItemMadeRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
SetItemMade
|
||||
PUT: {{baseURL}}/item/made
|
||||
*/
|
||||
export interface SetItemMadeRequest {
|
||||
order_id: number;
|
||||
item_id: number;
|
||||
made: number;
|
||||
}
|
||||
5
ordr-ui/app/client/request/SetItemQuantityRequest.ts
Normal file
5
ordr-ui/app/client/request/SetItemQuantityRequest.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface SetItemQuantityRequest {
|
||||
order_id: number;
|
||||
item_id: number;
|
||||
quantity: number;
|
||||
}
|
||||
7
ordr-ui/app/client/request/UserNameRequest.ts
Normal file
7
ordr-ui/app/client/request/UserNameRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
UserName
|
||||
PUT: {{baseURL}}/user/name?user_name=Ada%20Conway
|
||||
*/
|
||||
export interface UserName {
|
||||
name: string;
|
||||
}
|
||||
7
ordr-ui/app/client/response/ItemHistoryResponse.ts
Normal file
7
ordr-ui/app/client/response/ItemHistoryResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type ItemHistoryResponse = {
|
||||
ItemId : string
|
||||
ItemName : string
|
||||
ItemPrice: string
|
||||
ValidFrom: string
|
||||
ValidTo : string
|
||||
}
|
||||
6
ordr-ui/app/client/response/ItemPriceResponse.ts
Normal file
6
ordr-ui/app/client/response/ItemPriceResponse.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface ItemPriceResponse {
|
||||
ItemId: number;
|
||||
ItemName: string;
|
||||
ItemPrice: number;
|
||||
InSeason: boolean
|
||||
}
|
||||
4
ordr-ui/app/client/response/LoginRedirectResponse.ts
Normal file
4
ordr-ui/app/client/response/LoginRedirectResponse.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export type LoginRedirectResponse = {
|
||||
status: string,
|
||||
location: string
|
||||
};
|
||||
4
ordr-ui/app/client/response/OrderFilledResponse.ts
Normal file
4
ordr-ui/app/client/response/OrderFilledResponse.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface OrderFilledResponse{
|
||||
OrderId: number;
|
||||
Filled: boolean;
|
||||
}
|
||||
10
ordr-ui/app/client/response/OrderItemPriceResponse.ts
Normal file
10
ordr-ui/app/client/response/OrderItemPriceResponse.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface OrderItemPriceResponse{
|
||||
ItemId: number;
|
||||
OrderId: number;
|
||||
ItemName: string;
|
||||
Quantity: number;
|
||||
Made: number;
|
||||
CreatedAt: Date;
|
||||
TotalPrice: number;
|
||||
UnitPrice: number;
|
||||
}
|
||||
12
ordr-ui/app/client/response/OrderResponse.ts
Normal file
12
ordr-ui/app/client/response/OrderResponse.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface OrderResponse{
|
||||
Id: number;
|
||||
UserId: number;
|
||||
Orderer: string;
|
||||
DateDue: string;
|
||||
DatePlaced: string;
|
||||
AmountPaid: number;
|
||||
OrderTotal: number;
|
||||
AmountDue: number;
|
||||
Filled: boolean;
|
||||
Delivered: boolean;
|
||||
}
|
||||
7
ordr-ui/app/client/response/UserResponse.ts
Normal file
7
ordr-ui/app/client/response/UserResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface UserResponse{
|
||||
Id: number;
|
||||
Name: string;
|
||||
JobPosition: string;
|
||||
Active: boolean;
|
||||
Admin: boolean;
|
||||
}
|
||||
7
ordr-ui/app/client/response/index.ts
Normal file
7
ordr-ui/app/client/response/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type {ItemPriceResponse} from './ItemPriceResponse'
|
||||
export type {OrderFilledResponse} from './OrderFilledResponse'
|
||||
export type {OrderItemPriceResponse} from './OrderItemPriceResponse'
|
||||
export type {OrderResponse} from './OrderResponse'
|
||||
export type {UserResponse} from './UserResponse'
|
||||
export type { LoginRedirectResponse} from './LoginRedirectResponse'
|
||||
export type {ItemHistoryResponse} from './ItemHistoryResponse'
|
||||
Reference in New Issue
Block a user