tt-entities 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libs/tatayab-entities-library/src/entities/brand.entity.d.ts +12 -0
- package/dist/libs/tatayab-entities-library/src/entities/brand.entity.js +56 -0
- package/dist/libs/tatayab-entities-library/src/entities/brand.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.d.ts +14 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.js +65 -0
- package/dist/libs/tatayab-entities-library/src/entities/category.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.d.ts +16 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.js +66 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory-stock.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.d.ts +15 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.js +63 -0
- package/dist/libs/tatayab-entities-library/src/entities/inventory.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.d.ts +16 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.js +62 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-media.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.d.ts +8 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.js +44 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-store.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.d.ts +5 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.js +32 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant-option.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.d.ts +15 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.js +64 -0
- package/dist/libs/tatayab-entities-library/src/entities/product-variant.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.d.ts +27 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.js +104 -0
- package/dist/libs/tatayab-entities-library/src/entities/product.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.d.ts +25 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.js +88 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.d.ts +27 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.js +108 -0
- package/dist/libs/tatayab-entities-library/src/entities/purchase-order.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.d.ts +23 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.js +92 -0
- package/dist/libs/tatayab-entities-library/src/entities/stock-movement.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.d.ts +6 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.js +36 -0
- package/dist/libs/tatayab-entities-library/src/entities/store-inventory.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.d.ts +21 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.js +86 -0
- package/dist/libs/tatayab-entities-library/src/entities/store.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.js +50 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-option.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.d.ts +7 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.js +37 -0
- package/dist/libs/tatayab-entities-library/src/entities/variant-type.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.d.ts +19 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.js +78 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor-product.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.d.ts +19 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.js +82 -0
- package/dist/libs/tatayab-entities-library/src/entities/vendor.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/index.d.ts +21 -0
- package/dist/libs/tatayab-entities-library/src/index.js +81 -1
- package/dist/libs/tatayab-entities-library/src/index.js.map +1 -1
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.d.ts +8 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.js +13 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.js.map +1 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.js +16 -0
- package/dist/libs/tatayab-entities-library/src/utils/enums/stockMovementType.js.map +1 -0
- package/dist/src/main.js +1437 -1
- package/libs/tatayab-entities-library/src/entities/brand.entity.ts +32 -0
- package/libs/tatayab-entities-library/src/entities/category.entity.ts +47 -0
- package/libs/tatayab-entities-library/src/entities/inventory-stock.entity.ts +55 -0
- package/libs/tatayab-entities-library/src/entities/inventory.entity.ts +47 -0
- package/libs/tatayab-entities-library/src/entities/product-media.entity.ts +45 -0
- package/libs/tatayab-entities-library/src/entities/product-store.entity.ts +31 -0
- package/libs/tatayab-entities-library/src/entities/product-variant-option.entity.ts +19 -0
- package/libs/tatayab-entities-library/src/entities/product-variant.entity.ts +51 -0
- package/libs/tatayab-entities-library/src/entities/product.entity.ts +82 -0
- package/libs/tatayab-entities-library/src/entities/purchase-order-item.entity.ts +73 -0
- package/libs/tatayab-entities-library/src/entities/purchase-order.entity.ts +86 -0
- package/libs/tatayab-entities-library/src/entities/stock-movement.entity.ts +74 -0
- package/libs/tatayab-entities-library/src/entities/store-inventory.entity.ts +24 -0
- package/libs/tatayab-entities-library/src/entities/store.entity.ts +68 -0
- package/libs/tatayab-entities-library/src/entities/variant-option.entity.ts +35 -0
- package/libs/tatayab-entities-library/src/entities/variant-type.entity.ts +18 -0
- package/libs/tatayab-entities-library/src/entities/vendor-product.entity.ts +65 -0
- package/libs/tatayab-entities-library/src/entities/vendor.entity.ts +63 -0
- package/libs/tatayab-entities-library/src/index.ts +95 -2
- package/libs/tatayab-entities-library/src/utils/enums/purchaseOrderStatus.ts +8 -0
- package/libs/tatayab-entities-library/src/utils/enums/stockMovementType.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
Column,
|
|
4
|
+
Model,
|
|
5
|
+
ForeignKey,
|
|
6
|
+
BelongsTo,
|
|
7
|
+
HasMany,
|
|
8
|
+
BelongsToMany,
|
|
9
|
+
DataType,
|
|
10
|
+
} from 'sequelize-typescript';
|
|
11
|
+
import { Country } from './country.entity';
|
|
12
|
+
import { ProductStore } from './product-store.entity';
|
|
13
|
+
import { Product } from './product.entity';
|
|
14
|
+
import { StoreInventory } from './store-inventory.entity';
|
|
15
|
+
import { Inventory } from './inventory.entity';
|
|
16
|
+
import { Status } from '../utils/enums/status';
|
|
17
|
+
|
|
18
|
+
@Table
|
|
19
|
+
export class Store extends Model {
|
|
20
|
+
@Column({ allowNull: false })
|
|
21
|
+
declare nameEn: string;
|
|
22
|
+
|
|
23
|
+
@Column({ allowNull: false })
|
|
24
|
+
declare nameAr: string;
|
|
25
|
+
|
|
26
|
+
@Column({ type: DataType.TEXT, allowNull: true })
|
|
27
|
+
declare descriptionEn?: string;
|
|
28
|
+
|
|
29
|
+
@Column({ type: DataType.TEXT, allowNull: true })
|
|
30
|
+
declare descriptionAr?: string;
|
|
31
|
+
|
|
32
|
+
@Column({ allowNull: true })
|
|
33
|
+
declare logo?: string;
|
|
34
|
+
|
|
35
|
+
// ISO currency code e.g. KWD, SAR, QAR, USD
|
|
36
|
+
@Column({ allowNull: false, defaultValue: 'USD' })
|
|
37
|
+
declare currency: string;
|
|
38
|
+
|
|
39
|
+
@Column({ allowNull: true })
|
|
40
|
+
declare currencySymbolEn?: string;
|
|
41
|
+
|
|
42
|
+
@Column({ allowNull: true })
|
|
43
|
+
declare currencySymbolAr?: string;
|
|
44
|
+
|
|
45
|
+
@ForeignKey(() => Country)
|
|
46
|
+
@Column({ allowNull: true })
|
|
47
|
+
declare countryId?: number;
|
|
48
|
+
|
|
49
|
+
@Column({ defaultValue: false })
|
|
50
|
+
declare isGlobal: boolean;
|
|
51
|
+
|
|
52
|
+
@Column({
|
|
53
|
+
type: DataType.ENUM(...Object.values(Status)),
|
|
54
|
+
defaultValue: Status.ACTIVE,
|
|
55
|
+
})
|
|
56
|
+
declare status: Status;
|
|
57
|
+
|
|
58
|
+
// ─── Associations ─────────────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
@BelongsTo(() => Country)
|
|
61
|
+
declare country: Country;
|
|
62
|
+
|
|
63
|
+
@BelongsToMany(() => Product, () => ProductStore)
|
|
64
|
+
declare products: Product[];
|
|
65
|
+
|
|
66
|
+
@BelongsToMany(() => Inventory, () => StoreInventory)
|
|
67
|
+
declare inventories: Inventory[];
|
|
68
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
Column,
|
|
4
|
+
Model,
|
|
5
|
+
ForeignKey,
|
|
6
|
+
BelongsTo,
|
|
7
|
+
DataType,
|
|
8
|
+
} from 'sequelize-typescript';
|
|
9
|
+
import { VariantType } from './variant-type.entity';
|
|
10
|
+
import { Status } from '../utils/enums/status';
|
|
11
|
+
|
|
12
|
+
@Table
|
|
13
|
+
export class VariantOption extends Model {
|
|
14
|
+
@ForeignKey(() => VariantType)
|
|
15
|
+
@Column({ allowNull: false })
|
|
16
|
+
declare variantTypeId: number;
|
|
17
|
+
|
|
18
|
+
@Column({ allowNull: false })
|
|
19
|
+
declare nameEn: string;
|
|
20
|
+
|
|
21
|
+
@Column({ allowNull: false })
|
|
22
|
+
declare nameAr: string;
|
|
23
|
+
|
|
24
|
+
@Column({ defaultValue: 0 })
|
|
25
|
+
declare sortOrder: number;
|
|
26
|
+
|
|
27
|
+
@Column({
|
|
28
|
+
type: DataType.ENUM(...Object.values(Status)),
|
|
29
|
+
defaultValue: Status.ACTIVE,
|
|
30
|
+
})
|
|
31
|
+
declare status: Status;
|
|
32
|
+
|
|
33
|
+
@BelongsTo(() => VariantType)
|
|
34
|
+
declare variantType: VariantType;
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Table, Column, Model, HasMany } from 'sequelize-typescript';
|
|
2
|
+
import { Status } from '../utils/enums/status';
|
|
3
|
+
import { DataType } from 'sequelize-typescript';
|
|
4
|
+
|
|
5
|
+
@Table
|
|
6
|
+
export class VariantType extends Model {
|
|
7
|
+
@Column({ allowNull: false })
|
|
8
|
+
declare nameEn: string;
|
|
9
|
+
|
|
10
|
+
@Column({ allowNull: false })
|
|
11
|
+
declare nameAr: string;
|
|
12
|
+
|
|
13
|
+
@Column({
|
|
14
|
+
type: DataType.ENUM(...Object.values(Status)),
|
|
15
|
+
defaultValue: Status.ACTIVE,
|
|
16
|
+
})
|
|
17
|
+
declare status: Status;
|
|
18
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
Column,
|
|
4
|
+
Model,
|
|
5
|
+
ForeignKey,
|
|
6
|
+
BelongsTo,
|
|
7
|
+
DataType,
|
|
8
|
+
} from 'sequelize-typescript';
|
|
9
|
+
import { Vendor } from './vendor.entity';
|
|
10
|
+
import { Product } from './product.entity';
|
|
11
|
+
import { ProductVariant } from './product-variant.entity';
|
|
12
|
+
import { Status } from '../utils/enums/status';
|
|
13
|
+
|
|
14
|
+
@Table
|
|
15
|
+
export class VendorProduct extends Model {
|
|
16
|
+
@ForeignKey(() => Vendor)
|
|
17
|
+
@Column({ allowNull: false })
|
|
18
|
+
declare vendorId: number;
|
|
19
|
+
|
|
20
|
+
@ForeignKey(() => Product)
|
|
21
|
+
@Column({ allowNull: false })
|
|
22
|
+
declare productId: number;
|
|
23
|
+
|
|
24
|
+
// null = applies to product with no variants
|
|
25
|
+
@ForeignKey(() => ProductVariant)
|
|
26
|
+
@Column({ allowNull: true })
|
|
27
|
+
declare productVariantId?: number;
|
|
28
|
+
|
|
29
|
+
// Vendor's cost price to us
|
|
30
|
+
@Column({ type: DataType.DECIMAL(10, 3), allowNull: false })
|
|
31
|
+
declare costPrice: number;
|
|
32
|
+
|
|
33
|
+
// Vendor's SKU/reference code for this product
|
|
34
|
+
@Column({ allowNull: true })
|
|
35
|
+
declare vendorSku?: string;
|
|
36
|
+
|
|
37
|
+
// Typical lead time in days from this vendor
|
|
38
|
+
@Column({ allowNull: true })
|
|
39
|
+
declare leadTimeDays?: number;
|
|
40
|
+
|
|
41
|
+
// Minimum order quantity
|
|
42
|
+
@Column({ defaultValue: 1 })
|
|
43
|
+
declare moq: number;
|
|
44
|
+
|
|
45
|
+
// Is this the preferred/default vendor for this product?
|
|
46
|
+
@Column({ defaultValue: false })
|
|
47
|
+
declare isPreferred: boolean;
|
|
48
|
+
|
|
49
|
+
@Column({
|
|
50
|
+
type: DataType.ENUM(...Object.values(Status)),
|
|
51
|
+
defaultValue: Status.ACTIVE,
|
|
52
|
+
})
|
|
53
|
+
declare status: Status;
|
|
54
|
+
|
|
55
|
+
// ─── Associations ─────────────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
@BelongsTo(() => Vendor)
|
|
58
|
+
declare vendor: Vendor;
|
|
59
|
+
|
|
60
|
+
@BelongsTo(() => Product)
|
|
61
|
+
declare product: Product;
|
|
62
|
+
|
|
63
|
+
@BelongsTo(() => ProductVariant)
|
|
64
|
+
declare variant?: ProductVariant;
|
|
65
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
Column,
|
|
4
|
+
Model,
|
|
5
|
+
ForeignKey,
|
|
6
|
+
BelongsTo,
|
|
7
|
+
HasMany,
|
|
8
|
+
DataType,
|
|
9
|
+
} from 'sequelize-typescript';
|
|
10
|
+
import { Country } from './country.entity';
|
|
11
|
+
import { Status } from '../utils/enums/status';
|
|
12
|
+
|
|
13
|
+
@Table
|
|
14
|
+
export class Vendor extends Model {
|
|
15
|
+
@Column({ allowNull: false })
|
|
16
|
+
declare nameEn: string;
|
|
17
|
+
|
|
18
|
+
@Column({ allowNull: false })
|
|
19
|
+
declare nameAr: string;
|
|
20
|
+
|
|
21
|
+
@Column({ allowNull: true })
|
|
22
|
+
declare contactPerson?: string;
|
|
23
|
+
|
|
24
|
+
@Column({ allowNull: true })
|
|
25
|
+
declare email?: string;
|
|
26
|
+
|
|
27
|
+
@Column({ allowNull: true })
|
|
28
|
+
declare phone?: string;
|
|
29
|
+
|
|
30
|
+
@Column({ type: DataType.TEXT, allowNull: true })
|
|
31
|
+
declare addressEn?: string;
|
|
32
|
+
|
|
33
|
+
@Column({ type: DataType.TEXT, allowNull: true })
|
|
34
|
+
declare addressAr?: string;
|
|
35
|
+
|
|
36
|
+
@ForeignKey(() => Country)
|
|
37
|
+
@Column({ allowNull: true })
|
|
38
|
+
declare countryId?: number;
|
|
39
|
+
|
|
40
|
+
@Column({ allowNull: true })
|
|
41
|
+
declare taxNumber?: string;
|
|
42
|
+
|
|
43
|
+
@Column({ allowNull: true })
|
|
44
|
+
declare commercialRegNumber?: string;
|
|
45
|
+
|
|
46
|
+
// Default payment terms in days (e.g. 30 = NET30)
|
|
47
|
+
@Column({ defaultValue: 0 })
|
|
48
|
+
declare paymentTermsDays: number;
|
|
49
|
+
|
|
50
|
+
@Column({ allowNull: true })
|
|
51
|
+
declare notes?: string;
|
|
52
|
+
|
|
53
|
+
@Column({
|
|
54
|
+
type: DataType.ENUM(...Object.values(Status)),
|
|
55
|
+
defaultValue: Status.ACTIVE,
|
|
56
|
+
})
|
|
57
|
+
declare status: Status;
|
|
58
|
+
|
|
59
|
+
// ─── Associations ─────────────────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
@BelongsTo(() => Country)
|
|
62
|
+
declare country: Country;
|
|
63
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModelCtor } from 'sequelize-typescript';
|
|
2
2
|
|
|
3
|
+
// ─── Existing ─────────────────────────────────────────────────────────────────
|
|
3
4
|
import { Country } from './entities/country.entity';
|
|
4
5
|
import { Translation } from './entities/translation.entity';
|
|
5
6
|
import { Area } from './entities/area.entity';
|
|
@@ -9,7 +10,37 @@ import { User } from './entities/user.entity';
|
|
|
9
10
|
import { UserDevice } from './entities/userDevice.entity';
|
|
10
11
|
import { ApiKey } from './entities/apikey.entity';
|
|
11
12
|
|
|
12
|
-
//
|
|
13
|
+
// ─── Catalogue ────────────────────────────────────────────────────────────────
|
|
14
|
+
import { Category } from './entities/category.entity';
|
|
15
|
+
import { Brand } from './entities/brand.entity';
|
|
16
|
+
import { VariantType } from './entities/variant-type.entity';
|
|
17
|
+
import { VariantOption } from './entities/variant-option.entity';
|
|
18
|
+
import { Product } from './entities/product.entity';
|
|
19
|
+
import { ProductMedia } from './entities/product-media.entity';
|
|
20
|
+
import { ProductVariant } from './entities/product-variant.entity';
|
|
21
|
+
import { ProductVariantOption } from './entities/product-variant-option.entity';
|
|
22
|
+
|
|
23
|
+
// ─── Stores ───────────────────────────────────────────────────────────────────
|
|
24
|
+
import { Store } from './entities/store.entity';
|
|
25
|
+
import { ProductStore } from './entities/product-store.entity';
|
|
26
|
+
|
|
27
|
+
// ─── Inventory ────────────────────────────────────────────────────────────────
|
|
28
|
+
import { Inventory } from './entities/inventory.entity';
|
|
29
|
+
import { StoreInventory } from './entities/store-inventory.entity';
|
|
30
|
+
import { InventoryStock } from './entities/inventory-stock.entity';
|
|
31
|
+
import { StockMovement } from './entities/stock-movement.entity';
|
|
32
|
+
|
|
33
|
+
// ─── Purchasing ───────────────────────────────────────────────────────────────
|
|
34
|
+
import { Vendor } from './entities/vendor.entity';
|
|
35
|
+
import { VendorProduct } from './entities/vendor-product.entity';
|
|
36
|
+
import { PurchaseOrder } from './entities/purchase-order.entity';
|
|
37
|
+
import { PurchaseOrderItem } from './entities/purchase-order-item.entity';
|
|
38
|
+
|
|
39
|
+
// =============================================================================
|
|
40
|
+
// EXPORTS
|
|
41
|
+
// =============================================================================
|
|
42
|
+
|
|
43
|
+
// ─── Existing ─────────────────────────────────────────────────────────────────
|
|
13
44
|
export { ApiKey } from './entities/apikey.entity';
|
|
14
45
|
export { Country } from './entities/country.entity';
|
|
15
46
|
export { Translation } from './entities/translation.entity';
|
|
@@ -19,16 +50,52 @@ export { SysUser } from './entities/sys.user.entity';
|
|
|
19
50
|
export { User } from './entities/user.entity';
|
|
20
51
|
export { UserDevice } from './entities/userDevice.entity';
|
|
21
52
|
|
|
22
|
-
//
|
|
53
|
+
// ─── Catalogue ────────────────────────────────────────────────────────────────
|
|
54
|
+
export { Category } from './entities/category.entity';
|
|
55
|
+
export { Brand } from './entities/brand.entity';
|
|
56
|
+
export { VariantType } from './entities/variant-type.entity';
|
|
57
|
+
export { VariantOption } from './entities/variant-option.entity';
|
|
58
|
+
export { Product } from './entities/product.entity';
|
|
59
|
+
export { ProductMedia, MediaType } from './entities/product-media.entity';
|
|
60
|
+
export { ProductVariant } from './entities/product-variant.entity';
|
|
61
|
+
export { ProductVariantOption } from './entities/product-variant-option.entity';
|
|
62
|
+
|
|
63
|
+
// ─── Stores ───────────────────────────────────────────────────────────────────
|
|
64
|
+
export { Store } from './entities/store.entity';
|
|
65
|
+
export { ProductStore } from './entities/product-store.entity';
|
|
66
|
+
|
|
67
|
+
// ─── Inventory ────────────────────────────────────────────────────────────────
|
|
68
|
+
export { Inventory } from './entities/inventory.entity';
|
|
69
|
+
export { StoreInventory } from './entities/store-inventory.entity';
|
|
70
|
+
export { InventoryStock } from './entities/inventory-stock.entity';
|
|
71
|
+
export { StockMovement } from './entities/stock-movement.entity';
|
|
72
|
+
|
|
73
|
+
// ─── Purchasing ───────────────────────────────────────────────────────────────
|
|
74
|
+
export { Vendor } from './entities/vendor.entity';
|
|
75
|
+
export { VendorProduct } from './entities/vendor-product.entity';
|
|
76
|
+
export { PurchaseOrder } from './entities/purchase-order.entity';
|
|
77
|
+
export {
|
|
78
|
+
PurchaseOrderItem,
|
|
79
|
+
PurchaseOrderItemStatus,
|
|
80
|
+
} from './entities/purchase-order-item.entity';
|
|
81
|
+
|
|
82
|
+
// ─── Enums ────────────────────────────────────────────────────────────────────
|
|
23
83
|
export { OsName } from './utils/enums/osName';
|
|
24
84
|
export { ProductApp } from './utils/enums/productApp';
|
|
25
85
|
export { VersionType } from './utils/enums/versiontype';
|
|
26
86
|
export { Language } from './utils/enums/language';
|
|
27
87
|
export { Status } from './utils/enums/status';
|
|
28
88
|
export { Gender } from './utils/enums/gender';
|
|
89
|
+
export { PurchaseOrderStatus } from './utils/enums/purchaseOrderStatus';
|
|
90
|
+
export { StockMovementType } from './utils/enums/stockMovementType';
|
|
91
|
+
|
|
92
|
+
// =============================================================================
|
|
93
|
+
// MODEL REGISTRY
|
|
94
|
+
// =============================================================================
|
|
29
95
|
|
|
30
96
|
export function getDbModels(): ModelCtor[] {
|
|
31
97
|
return [
|
|
98
|
+
// Existing
|
|
32
99
|
ApiKey,
|
|
33
100
|
Area,
|
|
34
101
|
Country,
|
|
@@ -37,5 +104,31 @@ export function getDbModels(): ModelCtor[] {
|
|
|
37
104
|
Translation,
|
|
38
105
|
User,
|
|
39
106
|
UserDevice,
|
|
107
|
+
|
|
108
|
+
// Catalogue
|
|
109
|
+
Category,
|
|
110
|
+
Brand,
|
|
111
|
+
VariantType,
|
|
112
|
+
VariantOption,
|
|
113
|
+
Product,
|
|
114
|
+
ProductMedia,
|
|
115
|
+
ProductVariant,
|
|
116
|
+
ProductVariantOption,
|
|
117
|
+
|
|
118
|
+
// Stores
|
|
119
|
+
Store,
|
|
120
|
+
ProductStore,
|
|
121
|
+
|
|
122
|
+
// Inventory
|
|
123
|
+
Inventory,
|
|
124
|
+
StoreInventory,
|
|
125
|
+
InventoryStock,
|
|
126
|
+
StockMovement,
|
|
127
|
+
|
|
128
|
+
// Purchasing
|
|
129
|
+
Vendor,
|
|
130
|
+
VendorProduct,
|
|
131
|
+
PurchaseOrder,
|
|
132
|
+
PurchaseOrderItem,
|
|
40
133
|
];
|
|
41
134
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export enum StockMovementType {
|
|
2
|
+
// Stock coming in
|
|
3
|
+
RECEIVED = 'received', // PO received into inventory
|
|
4
|
+
|
|
5
|
+
// Stock going out or being held
|
|
6
|
+
RESERVED = 'reserved', // Reserved for a pending order
|
|
7
|
+
RESERVATION_RELEASED = 'reservation_released', // Order cancelled, stock freed
|
|
8
|
+
|
|
9
|
+
// Manual adjustments
|
|
10
|
+
ADJUSTMENT_ADD = 'adjustment_add', // Manual stock increase
|
|
11
|
+
ADJUSTMENT_REMOVE = 'adjustment_remove', // Manual stock decrease (damage, loss)
|
|
12
|
+
|
|
13
|
+
// Returns
|
|
14
|
+
RETURNED_FROM_CUSTOMER = 'returned_from_customer',
|
|
15
|
+
RETURNED_TO_VENDOR = 'returned_to_vendor',
|
|
16
|
+
|
|
17
|
+
// Transfers
|
|
18
|
+
TRANSFER_IN = 'transfer_in', // Moved in from another inventory
|
|
19
|
+
TRANSFER_OUT = 'transfer_out', // Moved out to another inventory
|
|
20
|
+
}
|
package/package.json
CHANGED