Update README.md to provide a comprehensive overview of The Order monorepo, including repository structure, quickstart guide, development workflow, and contribution guidelines.
This commit is contained in:
23
packages/schemas/src/deal.ts
Normal file
23
packages/schemas/src/deal.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const DealStatusSchema = z.enum(['draft', 'active', 'closed', 'archived']);
|
||||
|
||||
export const DealSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
name: z.string().min(1),
|
||||
status: DealStatusSchema,
|
||||
dataroomId: z.string().uuid().optional(),
|
||||
createdAt: z.date().or(z.string().datetime()),
|
||||
updatedAt: z.date().or(z.string().datetime()),
|
||||
});
|
||||
|
||||
export type Deal = z.infer<typeof DealSchema>;
|
||||
|
||||
export const CreateDealSchema = DealSchema.omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
});
|
||||
|
||||
export type CreateDeal = z.infer<typeof CreateDealSchema>;
|
||||
|
||||
24
packages/schemas/src/document.ts
Normal file
24
packages/schemas/src/document.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const DocumentTypeSchema = z.enum(['legal', 'treaty', 'finance', 'history']);
|
||||
|
||||
export const DocumentSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
title: z.string().min(1),
|
||||
type: DocumentTypeSchema,
|
||||
content: z.string().optional(),
|
||||
fileUrl: z.string().url().optional(),
|
||||
createdAt: z.date().or(z.string().datetime()),
|
||||
updatedAt: z.date().or(z.string().datetime()),
|
||||
});
|
||||
|
||||
export type Document = z.infer<typeof DocumentSchema>;
|
||||
|
||||
export const CreateDocumentSchema = DocumentSchema.omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
});
|
||||
|
||||
export type CreateDocument = z.infer<typeof CreateDocumentSchema>;
|
||||
|
||||
8
packages/schemas/src/index.ts
Normal file
8
packages/schemas/src/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* The Order Schemas
|
||||
*/
|
||||
|
||||
export * from './user';
|
||||
export * from './document';
|
||||
export * from './deal';
|
||||
|
||||
20
packages/schemas/src/user.ts
Normal file
20
packages/schemas/src/user.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const UserSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
email: z.string().email(),
|
||||
name: z.string().min(1),
|
||||
createdAt: z.date().or(z.string().datetime()),
|
||||
updatedAt: z.date().or(z.string().datetime()),
|
||||
});
|
||||
|
||||
export type User = z.infer<typeof UserSchema>;
|
||||
|
||||
export const CreateUserSchema = UserSchema.omit({
|
||||
id: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
});
|
||||
|
||||
export type CreateUser = z.infer<typeof CreateUserSchema>;
|
||||
|
||||
Reference in New Issue
Block a user