Skip to content

Commit 3118d19

Browse files
committed
Added Sales types
1 parent 7f7f5e1 commit 3118d19

File tree

12 files changed

+103
-11
lines changed

12 files changed

+103
-11
lines changed

docs/drafts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ The points below are still in progress
77

88
- Static typecheckign with TypeScript for large scale projects
99
- Modular and scalable architecture
10-
- Built in JWT authentication
10+
- Function ready with pre-set REST API entities, sample data and a state management
11+
- Built in authentication with JWT
1112
- Typed data entities
12-
- Not just a dummy template
1313
- Uses react hooks
14-
- Simpler state management with Redux + Rematch for reducing Redux code boilerplate
14+
- Simpler state management with Redux + Rematch + Immer for reducing Redux code boilerplate
1515
- Material UI kit
16-
- Smart basic applications with real-world usage
16+
- Smart base applications with real-world usage (sales management, content management)
1717
- Users/Organizations roles with many-to-many relations
1818
- Designed in SAAS setup in mind, with subscription planes and global system roles
1919
- and more...
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export type CategoryId = number | string
2+
3+
export default interface Category {
4+
id?: CategoryId
5+
name: string
6+
description: string
7+
}
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
export default interface Customer {}
1+
export type CustomerId = number | string
2+
3+
export default interface Customer {
4+
id?: CustomerId
5+
name?: string
6+
email?: string
7+
details?: object
8+
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
export default interface Location {}
1+
export type LocationId = number | string
2+
3+
export default interface Location {
4+
id?: LocationId
5+
location?: {
6+
lat: number
7+
lng: number
8+
}
9+
name: string
10+
}

src/Dashboard/Sales/_types/Order.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
export default interface Order {}
1+
import { PaymentId } from './Payment'
2+
import { ProductId } from './Product'
3+
4+
export type OrderId = number | string
5+
export type OrderStatus =
6+
| 'received'
7+
| 'preparing'
8+
| 'shipped'
9+
| 'delivered'
10+
| 'rejected'
11+
| 'refunded'
12+
13+
export interface OrderSubmissionData {
14+
products?: any[]
15+
customerNotes?: string
16+
}
17+
18+
export default interface Order {
19+
id?: OrderId
20+
name?: string
21+
status: OrderStatus
22+
customerNotes?: string
23+
staffNotes?: string
24+
paymentId?: PaymentId
25+
products?: any[]
26+
}

src/Dashboard/Sales/_types/OrderPayment.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export type PaymentId = number | string
2+
3+
export default interface Payment {
4+
id?: PaymentId
5+
status?: string
6+
transactionId?: string
7+
transactionStatus?: string
8+
}
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
export default interface Product {}
1+
export type ProductId = number | string
2+
3+
export interface ProductVariation {
4+
name?: string
5+
price?: number
6+
details?: object
7+
}
8+
9+
export default interface Product {
10+
id?: ProductId
11+
name: string
12+
details?: object
13+
description: string
14+
variations: ProductVariation[]
15+
price: number
16+
}

src/Dashboard/Sales/_types/ProductRelCategory.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ProductId } from './Product'
2+
import { CategoryId } from './Category'
3+
4+
export default interface ProductToCategory {
5+
productId: ProductId
6+
categoryId: CategoryId
7+
}

0 commit comments

Comments
 (0)