Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ lerna-debug.log*
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
.env
.serverless
80 changes: 5 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,5 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>

[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
[travis-url]: https://travis-ci.org/nestjs/nest
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
[linux-url]: https://travis-ci.org/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
endpoints:
ANY - <https://4ltg2yi7b5.execute-api.us-east-1.amazonaws.com/dev/>
ANY - <https://4ltg2yi7b5.execute-api.us-east-1.amazonaws.com/dev/{proxy+>}
functions:
main: rs-cart-api-dev-main
53 changes: 53 additions & 0 deletions db_scripts/cartApi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
create type cartstatus as enum ('OPEN', 'ORDERED');

create table carts (
id uuid primary key not null,
user_id uuid not null,
created_at date not null,
updated_at date not null,
status cartstatus not null
);

create table cart_items (
id uuid not null primary key,
cart_id uuid references carts(id),
product_id uuid,
count integer
);

create table orders (
id uuid not null primary key,
user_id uuid,
cart_id uuid references carts(id),
payment json,
delivery json,
comments text,
status cartstatus,
total INT
);

create table users (
id uuid not null primary key,
name text not null,
email text not null,
password text not null
);

insert into carts (id, user_id, created_at, updated_at, status) values
(gen_random_uuid(), gen_random_uuid(), '2023-05-06', '2023-05-16', 'OPEN'),
(gen_random_uuid(), gen_random_uuid(), '2023-04-06', '2023-04-16', 'ORDERED'),
(gen_random_uuid(), gen_random_uuid(), '2023-03-06', '2023-03-16', 'OPEN'),
(gen_random_uuid(), gen_random_uuid(), '2023-02-06', '2023-02-16', 'ORDERED');

insert into cart_items (id, cart_id, product_id, count) values
(gen_random_uuid(), '3a28e4e8-4800-4cb9-8f3b-fdd404fa09ce', gen_random_uuid(), 10),
(gen_random_uuid(), '3c41f9f8-7caa-4faa-b371-8711260e7a5a', gen_random_uuid(), 20),
(gen_random_uuid(), '8cae31c1-925c-43c7-b0ef-cecad22b80b2', gen_random_uuid(), 30),
(gen_random_uuid(), 'd4450dd5-6da8-4c24-8226-54ca2b7e25e7', gen_random_uuid(), 40);

insert into users(id, name, email, password) values
(gen_random_uuid(), 'user1', 'user1@gmail.com', '123456'),
(gen_random_uuid(), 'user2', 'user2@gmail.com', '123456');

insert into orders(id, user_id, cart_id, status, total) values
(gen_random_uuid(), '66d87d9d-2032-4216-b899-71ed2bd97d5f', '3c41f9f8-7caa-4faa-b371-8711260e7a5a', 'ORDERED', 123);
Loading