mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-21 12:10:17 -04:00
add basic types
This commit is contained in:
parent
ed8d9969e0
commit
e72b6e5135
|
@ -5,7 +5,7 @@
|
|||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
"start": "tsc; node dist/index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
|
|
34
src/types.ts
34
src/types.ts
|
@ -0,0 +1,34 @@
|
|||
namespace Carpool {
|
||||
interface Group {
|
||||
id: string;
|
||||
member_ids: string[];
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
}
|
||||
|
||||
interface Comment {
|
||||
id: string;
|
||||
body: string;
|
||||
author_id: string;
|
||||
}
|
||||
|
||||
type Status = "pending" | "cancelled" | "completed" | "interrupted";
|
||||
|
||||
interface Post {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
participant_ids: string[];
|
||||
driver_id: string;
|
||||
create_time: string;
|
||||
update_time: string;
|
||||
comments: Comment[];
|
||||
group_id: string;
|
||||
status: Status;
|
||||
capacity: number;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "dist/"
|
||||
"outDir": "dist/",
|
||||
},
|
||||
"files": ["src/types.ts"],
|
||||
"include": ["src/"],
|
||||
"exclude": ["node_modules/"],
|
||||
}
|
Loading…
Reference in New Issue
Block a user