and so it begins
This commit is contained in:
14
packages/logic/domains/product/data.ts
Normal file
14
packages/logic/domains/product/data.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const productModel = z.object({
|
||||
id: z.string(),
|
||||
linkId: z.string(),
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
longDescription: z.string(),
|
||||
price: z.number(),
|
||||
discountPrice: z.number(),
|
||||
createdAt: z.coerce.string().optional(),
|
||||
updatedAt: z.coerce.string().optional(),
|
||||
});
|
||||
export type ProductModel = z.infer<typeof productModel>;
|
||||
15
packages/logic/domains/product/repository.ts
Normal file
15
packages/logic/domains/product/repository.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Database } from "@pkg/db";
|
||||
|
||||
export class ProductRepository {
|
||||
private db: Database;
|
||||
|
||||
constructor(db: Database) {
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
// TODO: compelte the crud method implementation
|
||||
async listAllProducts() {}
|
||||
async createProduct() {}
|
||||
async updateProduct() {}
|
||||
async deleteProduct() {}
|
||||
}
|
||||
Reference in New Issue
Block a user