-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restruktur data dan menambahkan tipe
ProductMovement
- Loading branch information
1 parent
4bf8d31
commit 15d98a8
Showing
12 changed files
with
99 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
type Base64Blob = string | ||
|
||
export default Base64Blob | ||
export type Base64Blob = string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type ISODate = string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/(authenticated user)/data/products/_components/product-form/_props.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { UUID } from 'crypto' | ||
import type { Warehouse } from './warehouse' | ||
import type { Product } from './product' | ||
import type { Base64Blob } from '@/@types/base-64-blob' | ||
import type { ISODate } from '@/@types/iso-date' | ||
|
||
export interface ProductMovement { | ||
uuid: Readonly<UUID> | ||
|
||
at: ISODate | ||
type: 'sale' | 'purchase' | 'return' | 'adjustment' | ||
note?: string | ||
|
||
warehouse_state: Readonly<Warehouse> | ||
|
||
details: { | ||
product_state: Readonly<Product> | ||
|
||
qty: number | ||
price: number | ||
}[] | ||
|
||
additional_costs: { | ||
name: string | ||
value: number | ||
}[] | ||
|
||
created_at: ISODate | ||
updated_at: ISODate | ||
|
||
files: { | ||
blob: Base64Blob | ||
description?: string | ||
}[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
import type Base64Blob from '@/@types/base-64-blob' | ||
import type { Base64Blob } from '@/@types/base-64-blob' | ||
import type { ISODate } from '@/@types/iso-date' | ||
import type { Warehouse } from './warehouse' | ||
|
||
export interface Product { | ||
id: Readonly<number> | ||
|
||
interface Product { | ||
id: number | ||
code?: string | ||
barcode_reg_id?: string | ||
|
||
name: string | ||
description?: string | ||
category?: string | ||
|
||
qty: number | ||
image_file?: Base64Blob | ||
|
||
created_at: ISODate | ||
updated_at: ISODate | ||
deleted_at?: ISODate | ||
|
||
qty_unit: string | ||
default_price: number // per unit | ||
|
||
base_cost: number | ||
default_price: number | ||
low_qty_threshold?: number | ||
|
||
image_file?: Base64Blob | ||
stocks: { | ||
warehouse_id: Warehouse['id'] | ||
|
||
created_at: string | ||
updated_at: string | ||
deleted_at?: string | ||
qty: number | ||
cost: number // per unit | ||
default_price?: number // use parent product.default_price_per_unit if not set | ||
low_qty_threshold?: number // use parent product.low_qty_threshold if not set | ||
}[] | ||
} | ||
|
||
export default Product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { ISODate } from '@/@types/iso-date' | ||
|
||
export interface Warehouse { | ||
id: Readonly<number> | ||
name: string | ||
note?: string | ||
|
||
created_at: ISODate | ||
updated_at: ISODate | ||
deleted_at?: ISODate | ||
} |