We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
below APIs need user authentication first,
type Vehicle = { id: number brand: string model: string year: number }
get-users-vehicles.service
type Input = { userId: number vehicleId: number | null // when null retrieve all } type Output = Promise<Vehicle[]>
create-users-vehicles.service
type Input = { userId: number vehicle: CreateVehicleData } type Output = Promise<Vehicle>
update-users-vehicles.service
type Input = { userId: number vehicleId: number vehicle: UpdateVehicleData } type Output = Promise<Vehicle>
delete-users-vehicles.service
type Input = { userId: number vehicleId: number } type Output = Promise<void>
export type UserVehicle = { userId: number; vehicle: Vehicle; }; export type CreateVehicleData = Omit<Vehicle, "id">; export type UpdateVehicleData = Omit<Vehicle, "id">; type Result = { succeed: boolean; reason: string | null; }; export interface VehicleDatabase { getAll(userId: number): Promise<UserVehicle[]>; getOne(userId: number, vehicleId: number): Promise<UserVehicle | null>; create(userId: number, vehicle: CreateVehicleData): Promise<UserVehicle>; updateOne( userId: number, vehicleId: number, vehicle: UpdateVehicleData, ): Promise<UserVehicle | Result>; deleteOne(userId: number, vehicleId: number): Promise<Result>; clear(): Promise<void>; }
The text was updated successfully, but these errors were encountered:
Jun4928
No branches or pull requests
Goals
API Spec
below APIs need user authentication first,
Types
Service Interfaces
get-users-vehicles.service
create-users-vehicles.service
update-users-vehicles.service
delete-users-vehicles.service
In-memory database
Tests
The text was updated successfully, but these errors were encountered: