Skip to content
New issue

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

test #20

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

test #20

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
3 changes: 2 additions & 1 deletion api/src/controllers/v1/checkout/createCheckoutSession.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Context } from 'koa'

import { CartItem } from '../../../types/cart'
Copy link
Owner Author

@cgarrovillo cgarrovillo May 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an edited comment

import { stripe } from '../../../util/stripe'
import { CONSTANTS } from '../../../util/constants'
import type { CartItem, Checkout } from '../../../types/usc'

import processCartItems from '../../../helpers/stripe/processCartItems'

Expand Down
38 changes: 0 additions & 38 deletions api/src/controllers/v1/collections/getAllProductsFromCollection.ts

This file was deleted.

40 changes: 0 additions & 40 deletions api/src/controllers/v1/prices/getPrice.ts

This file was deleted.

26 changes: 0 additions & 26 deletions api/src/controllers/v1/products/getAllProducts.ts

This file was deleted.

8 changes: 8 additions & 0 deletions api/src/types/cart.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import CGCommerce from './index'

export interface CartItem {
id: string
unit_amount: number
quantity: number
data: CGCommerce.Product
}
71 changes: 71 additions & 0 deletions api/src/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
declare namespace CGCommerce {
interface ProductVariant extends StrapiObject {
display_name: string
color: string
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
material: string
fulfillment: object
}

export interface Product extends StrapiObject {
name: string
display_name: string
stripe_id: string
unit_amount: number
product_variants: ProductVariant[]
images: StrapiImage[]
description: string
}

interface ProductCollection extends StrapiObject {
name: string
display_name: string
description: string
products: Product[]
}
}

/**
* Strapi Specific
*/
declare namespace CGCommerce {
interface StrapiObject {
_id: string
id: string
}

interface StrapiImageFormat {
name: string
hash: string
ext: string
mime: string
width: number
height: number
size: number
path: string
url: string
}

interface StrapiImage extends StrapiObject {
name: string
alternativeText: string
caption: string
hash: string
ext: string
mime: string
size: number
width: number
height: number
url: string
formats: {
thumbnail: StrapiImageFormat
large: StrapiImageFormat
medium: StrapiImageFormat
small: StrapiImageFormat
}
provider: string
related: string[]
}
}

export default CGCommerce
11 changes: 0 additions & 11 deletions api/src/types/usc.d.ts

This file was deleted.

16 changes: 16 additions & 0 deletions cms/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions cms/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
**/node_modules/**
27 changes: 27 additions & 0 deletions cms/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
parser: 'babel-eslint',
extends: 'eslint:recommended',
env: {
commonjs: true,
es6: true,
node: true,
browser: false,
},
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: false,
},
sourceType: 'module',
},
globals: {
strapi: true,
},
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
'no-console': 0,
quotes: ['error', 'single'],
semi: ['error', 'never'],
},
}
114 changes: 114 additions & 0 deletions cms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep

############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
node_modules
.node_history

############################
# Tests
############################

testApp
coverage

############################
# Strapi
############################

.env
license.txt
exports
*.cache
build
.strapi-updater.json
3 changes: 3 additions & 0 deletions cms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Strapi application

A quick description of your strapi application
3 changes: 3 additions & 0 deletions cms/admin/src/assets/images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
logo-strapi.png is for the dashboard page

logo_strapi.png is for the login page
Binary file added cms/admin/src/assets/images/logo-strapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cms/admin/src/assets/images/logo_strapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added cms/api/.gitkeep
Empty file.
Loading