Todos service
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
{
|
||||
"name": "@todo-tests/common",
|
||||
"type": "module",
|
||||
"private": true
|
||||
"exports": {
|
||||
"./data": "./src/data/index.ts"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@effect/schema": "^0.68.12",
|
||||
"@thilawyn/thilalib": "^0.1.3",
|
||||
"effect": "^3.4.5"
|
||||
}
|
||||
}
|
||||
|
||||
16
packages/common/src/data/Todo.ts
Normal file
16
packages/common/src/data/Todo.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Schema as S } from "@effect/schema"
|
||||
import { Tag } from "@thilawyn/thilalib/effect/schema"
|
||||
import { Class } from "@thilawyn/thilalib/effect/schema/class"
|
||||
|
||||
|
||||
export class Todo extends Class<Todo>("Todo")({
|
||||
_tag: Tag("Todo"),
|
||||
|
||||
id: S.String,
|
||||
title: S.String,
|
||||
content: S.String,
|
||||
|
||||
due: S.optional(S.DateFromSelf, { as: "Option" }),
|
||||
createdAt: S.DateFromSelf,
|
||||
updatedAt: S.DateFromSelf,
|
||||
}) {}
|
||||
1
packages/common/src/data/index.ts
Normal file
1
packages/common/src/data/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./Todo"
|
||||
Reference in New Issue
Block a user