update,
This commit is contained in:
@@ -2,27 +2,34 @@
|
||||
|
||||
## getting started
|
||||
|
||||
Imagine there is a software developer and a QA engineer to solve the problems together
|
||||
|
||||
They will:
|
||||
|
||||
no need to reply me what you are going on and your digest in this phase.
|
||||
just reply me "OK" when done
|
||||
|
||||
base_dir=`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project`
|
||||
|
||||
please read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||
- read `<base_dir>/001_documentation/Requirements/REQ0006/schema.dbml`
|
||||
this is file in dbml syntax state the main database
|
||||
|
||||
please read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||
- read `<base_dir>/002_source/cms/src/db/schema.json`
|
||||
this is the file of live pocketbase schema output
|
||||
|
||||
please read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/constants.ts`
|
||||
- read `/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/constants.ts`
|
||||
this is the content of `@/constants`
|
||||
|
||||
please look into the md files in folder `<base_dir>/002_source/cms/_AI_GUIDELINE`
|
||||
- look into the md files in folder `<base_dir>/002_source/cms/_AI_GUIDELINE`
|
||||
|
||||
- read, remember and link up the ideas in file stated above,
|
||||
i will tell them the task afterwards
|
||||
|
||||
The software engineer will provide solutions, while QA engineer will feedback the opinion.
|
||||
|
||||
please read, remember and link up the ideas in file stated above,
|
||||
i will tell you the task afterwards
|
||||
|
||||
this is now not in debug phase,
|
||||
so, no need to reply me what you are going on or your insight throught the prompt.
|
||||
so, no need to reply me what they are going on or their insight throught the prompt.
|
||||
just reply me "OK" when done
|
||||
|
||||
---
|
||||
|
12
002_source/cms/src/db/QuizLPCategories/Create.tsx
Normal file
12
002_source/cms/src/db/QuizLPCategories/Create.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
interface CreateForm {
|
||||
// TODO: Add QuizLPCategories fields
|
||||
}
|
||||
|
||||
export default function createQuizLPCategory(data: CreateForm): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).create(data);
|
||||
}
|
7
002_source/cms/src/db/QuizLPCategories/Delete.tsx
Normal file
7
002_source/cms/src/db/QuizLPCategories/Delete.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function deleteQuizLPCategories(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).delete(id);
|
||||
}
|
8
002_source/cms/src/db/QuizLPCategories/GetAll.tsx
Normal file
8
002_source/cms/src/db/QuizLPCategories/GetAll.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getAllQuizLPCategories(): Promise<RecordModel[]> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).getFullList();
|
||||
}
|
9
002_source/cms/src/db/QuizLPCategories/GetAllCount.tsx
Normal file
9
002_source/cms/src/db/QuizLPCategories/GetAllCount.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetAllCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, {});
|
||||
return count;
|
||||
}
|
8
002_source/cms/src/db/QuizLPCategories/GetById.tsx
Normal file
8
002_source/cms/src/db/QuizLPCategories/GetById.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getQuizLPCategoryById(id: string): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).getOne(id);
|
||||
}
|
14
002_source/cms/src/db/QuizLPCategories/GetHiddenCount.tsx
Normal file
14
002_source/cms/src/db/QuizLPCategories/GetHiddenCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function getHiddenQuizLPCategoriesCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
002_source/cms/src/db/QuizLPCategories/GetVisibleCount.tsx
Normal file
14
002_source/cms/src/db/QuizLPCategories/GetVisibleCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function getVisibleQuizLPCategoriesCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LP_CATEGORIES).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
9
002_source/cms/src/db/QuizLPCategories/Update.tsx
Normal file
9
002_source/cms/src/db/QuizLPCategories/Update.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
import type { CreateFormProps } from '@/components/dashboard/lp_categories/type';
|
||||
|
||||
export default function updateQuizLPCategory(id: string, data: CreateFormProps): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).update(id, data);
|
||||
}
|
18
002_source/cms/src/db/QuizLPCategories/_PROMPT.md
Normal file
18
002_source/cms/src/db/QuizLPCategories/_PROMPT.md
Normal file
@@ -0,0 +1,18 @@
|
||||
please help to review the `tsx` file in this folder
|
||||
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizLPCategories`
|
||||
|
||||
it was clone from
|
||||
`MFCategories`
|
||||
please help to modify to
|
||||
`LPCategories`
|
||||
|
||||
please also help to modify the name of
|
||||
`variables`, `constants`, `functions`, `classes`, components's name, paths
|
||||
|
||||
the db fields structures between them are the same
|
||||
|
||||
do not move the files
|
||||
do not create directories
|
||||
keep current folder structure is important
|
||||
|
||||
thanks
|
12
002_source/cms/src/db/QuizLPQuestions/Create.tsx
Normal file
12
002_source/cms/src/db/QuizLPQuestions/Create.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
interface CreateForm {
|
||||
// TODO: Add QuizLPQuestions fields
|
||||
}
|
||||
|
||||
export default function createQuizLPQuestion(data: CreateForm): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_QUESTIONS).create(data);
|
||||
}
|
7
002_source/cms/src/db/QuizLPQuestions/Delete.tsx
Normal file
7
002_source/cms/src/db/QuizLPQuestions/Delete.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function deleteQuizLPQuestions(id: string): Promise<boolean> {
|
||||
return pb.collection(COL_QUIZ_LP_QUESTIONS).delete(id);
|
||||
}
|
8
002_source/cms/src/db/QuizLPQuestions/GetAll.tsx
Normal file
8
002_source/cms/src/db/QuizLPQuestions/GetAll.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getAllQuizLPQuestions(): Promise<RecordModel[]> {
|
||||
return pb.collection(COL_QUIZ_LP_QUESTIONS).getFullList();
|
||||
}
|
9
002_source/cms/src/db/QuizLPQuestions/GetAllCount.tsx
Normal file
9
002_source/cms/src/db/QuizLPQuestions/GetAllCount.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function GetAllCount(): Promise<number> {
|
||||
const { totalItems: count } = await pb.collection(COL_QUIZ_LP_QUESTIONS).getList(1, 9999, {});
|
||||
return count;
|
||||
}
|
8
002_source/cms/src/db/QuizLPQuestions/GetById.tsx
Normal file
8
002_source/cms/src/db/QuizLPQuestions/GetById.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default function getQuizLPQuestionById(id: string): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_QUESTIONS).getOne(id);
|
||||
}
|
14
002_source/cms/src/db/QuizLPQuestions/GetHiddenCount.tsx
Normal file
14
002_source/cms/src/db/QuizLPQuestions/GetHiddenCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function getHiddenQuizLPQuestionsCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LP_QUESTIONS).getList(1, 9999, { filter: 'visible = "hidden"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
14
002_source/cms/src/db/QuizLPQuestions/GetVisibleCount.tsx
Normal file
14
002_source/cms/src/db/QuizLPQuestions/GetVisibleCount.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// REQ0006
|
||||
import { COL_QUIZ_LP_QUESTIONS } from '@/constants';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
|
||||
export default async function getVisibleQuizLPQuestionsCount(): Promise<number> {
|
||||
try {
|
||||
const result = await pb.collection(COL_QUIZ_LP_QUESTIONS).getList(1, 9999, { filter: 'visible = "visible"' });
|
||||
const { totalItems: count } = result;
|
||||
return count;
|
||||
} catch (error) {
|
||||
return 0;
|
||||
}
|
||||
}
|
9
002_source/cms/src/db/QuizLPQuestions/Update.tsx
Normal file
9
002_source/cms/src/db/QuizLPQuestions/Update.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { COL_QUIZ_LP_CATEGORIES } from '@/constants';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
|
||||
import { pb } from '@/lib/pb';
|
||||
import type { CreateFormProps } from '@/components/dashboard/lp_categories/type';
|
||||
|
||||
export default function updateQuizLPCategory(id: string, data: CreateFormProps): Promise<RecordModel> {
|
||||
return pb.collection(COL_QUIZ_LP_CATEGORIES).update(id, data);
|
||||
}
|
18
002_source/cms/src/db/QuizLPQuestions/_PROMPT.md
Normal file
18
002_source/cms/src/db/QuizLPQuestions/_PROMPT.md
Normal file
@@ -0,0 +1,18 @@
|
||||
please help to review the `tsx` file in this folder
|
||||
`/home/logic/_wsl_workspace/001_github_ws/lettersoup-online-ws/lettersoup-online/project/002_source/cms/src/db/QuizLPQuestions`
|
||||
|
||||
it was clone from
|
||||
`LPCategories`
|
||||
please help to modify to
|
||||
`LPQuestions`
|
||||
|
||||
please also help to modify the name of
|
||||
`variables`, `constants`, `functions`, `classes`, components's name, paths
|
||||
|
||||
the db fields structures between them are the same
|
||||
|
||||
do not move the files
|
||||
do not create directories
|
||||
keep current folder structure is important
|
||||
|
||||
thanks
|
@@ -1479,6 +1479,109 @@
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1125157303",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "cat_name",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "file2034676914",
|
||||
"maxSelect": 1,
|
||||
"maxSize": 0,
|
||||
"mimeTypes": [],
|
||||
"name": "cat_image",
|
||||
"presentable": false,
|
||||
"protected": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"thumbs": [],
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number2161764012",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "pos",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "json3915970527",
|
||||
"maxSize": 0,
|
||||
"name": "init_answer",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "json"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2058414169",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "visible",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2560465762",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "slug",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text1156222427",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "remarks",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"convertURLs": false,
|
||||
"hidden": false,
|
||||
"id": "editor1843675174",
|
||||
"maxSize": 0,
|
||||
"name": "description",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "editor"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate2990389176",
|
||||
@@ -1685,6 +1788,20 @@
|
||||
"presentable": false,
|
||||
"system": false,
|
||||
"type": "autodate"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "text2058414169",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "visible",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"indexes": [],
|
||||
@@ -2701,4 +2818,4 @@
|
||||
"indexes": [],
|
||||
"system": false
|
||||
}
|
||||
]
|
||||
]
|
Reference in New Issue
Block a user