Compare commits

..

4 Commits

Author SHA1 Message Date
louiscklaw
c1b71fca64 add helloworld API endpoint for product module with test case 2025-06-15 13:54:35 +08:00
louiscklaw
08642a2bf6 "update EventItem model schema with reordered and reorganized fields" 2025-06-15 13:54:24 +08:00
louiscklaw
043d45862c update markdown files and instructions in AI workspace 2025-06-15 13:16:53 +08:00
louiscklaw
8444b947a4 "update product list rendering" 2025-06-15 13:07:47 +08:00
8 changed files with 58 additions and 68 deletions

View File

@@ -1146,46 +1146,47 @@ model EventReview {
// NOTE: need to consider with Event
// mapped to IEventItem
// a.k.a. PartyEvent party-event
model EventItem {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
//
sku String
name String
code String
price Float
taxes Float
tags String[]
sizes String[]
publish String
gender String[]
coverUrl String
images String[]
colors String[]
quantity Int
category String
available Int
totalSold Int
category String
code String
colors String[]
coverUrl String
description String
gender String[]
images String[]
inventoryType String
name String
newLabel Json
price Float
priceSale Float?
publish String
quantity Int
ratings Json[]
saleLabel Json
sizes String[]
sku String
subDescription String
tags String[]
taxes Float
totalRatings Float
totalReviews Int
inventoryType String
subDescription String
priceSale Float?
newLabel Json
saleLabel Json
ratings Json[]
totalSold Int
//
eventDate DateTime @default(now())
joinMembers Json[]
title String
currency String
duration_m Float
ageBottom Float
ageTop Float
location String
avatar String[]
currency String
duration_m Float
eventDate DateTime @default(now())
joinMembers Json[]
location String
title String
//
reviews EventReview[]
}

View File

@@ -0,0 +1,16 @@
import type { NextRequest, NextResponse } from 'next/server';
import { STATUS, response, handleError } from 'src/utils/response';
/**
***************************************
* GET - helloworld
***************************************
*/
export async function GET(req: NextRequest, res: NextResponse) {
try {
return response({ helloworld: 'product' }, STATUS.OK);
} catch (error) {
return handleError('Helloworld - Get all', error);
}
}

View File

@@ -0,0 +1,4 @@
###
GET /api/product/helloworld HTTP/1.1
Host: localhost:7272

View File

@@ -1,30 +0,0 @@
// src/app/api/product/image/upload/route.ts
//
// PURPOSE:
// handle upload product image
//
// RULES:
// T.B.A.
import type { NextRequest } from 'next/server';
import { STATUS, response, handleError } from 'src/utils/response';
// import prisma from '../../../lib/prisma';
// ----------------------------------------------------------------------
/** **************************************
* GET - Products
*************************************** */
export async function POST(req: NextRequest) {
try {
const { data } = await req.json();
console.log('helloworld');
return response({ hello: 'world' }, STATUS.OK);
} catch (error) {
console.log({ hello: 'world' });
return handleError('Product - store product image', error);
}
}

View File

@@ -17,15 +17,13 @@ export function ProductList({ products, loading, sx, ...other }: Props) {
const renderLoading = () => <ProductItemSkeleton />;
const renderList = () =>
products.map((product) => {
return (
<ProductItem
key={product.id}
product={product}
detailsHref={paths.product.details(product.id)}
/>
);
});
products.map((product) => (
<ProductItem
key={product.id}
product={product}
detailsHref={paths.product.details(product.id)}
/>
));
return (
<>

View File

@@ -0,0 +1 @@
T.B.A.

View File

@@ -1,6 +1,6 @@
```markdown
# Greetings
```markdown
Hi,
Imagine you are a software engineer and i will send you the guideline.

View File

@@ -25,7 +25,7 @@ T.B.A.
1 AI tools/co-pilot
```prompt
please read and follow steps in the markdown files in `98_AI_workspace` folder thanks.
please read and follow steps in the markdown files in `98_AI_workspace/software-engineer` folder thanks.
```
<!-- AI: please fill the step to setup project below -->