mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 14:55:44 +00:00
365 lines
9.9 KiB
TypeScript
365 lines
9.9 KiB
TypeScript
import { format } from 'date-fns';
|
|
import { Area } from '@/types/api/master-data/area';
|
|
import { Location } from '@/types/api/master-data/location';
|
|
import { Kandang } from '@/types/api/master-data/kandang';
|
|
import { Warehouse } from '@/types/api/master-data/warehouse';
|
|
import { ProductWarehouse } from '@/types/api/inventory/product-warehouse';
|
|
import { Marketing } from '@/types/api/marketing/marketing';
|
|
import { CreatedUser } from '@/types/api/api-general';
|
|
import { Product } from '@/types/api/master-data/product';
|
|
|
|
// ======================
|
|
// 👤 Created User
|
|
// ======================
|
|
export const createdUser: CreatedUser = {
|
|
id: 1,
|
|
id_user: 1,
|
|
email: 'admin@example.com',
|
|
name: 'Admin Utama',
|
|
};
|
|
|
|
// ======================
|
|
// 📍 Area Dummy
|
|
// ======================
|
|
export const dummyAreas: Area[] = [
|
|
{
|
|
id: 1,
|
|
name: 'Bandung Barat',
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 2,
|
|
name: 'Cimahi Utara',
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|
|
|
|
// ======================
|
|
// 🏢 Location Dummy
|
|
// ======================
|
|
export const dummyLocations: Location[] = [
|
|
{
|
|
id: 1,
|
|
name: 'Gudang A',
|
|
address: 'Jl. Sukajadi No. 12',
|
|
area: dummyAreas[0],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 2,
|
|
name: 'Gudang B',
|
|
address: 'Jl. Setiabudi No. 45',
|
|
area: dummyAreas[1],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|
|
|
|
// ======================
|
|
// 🐔 Kandang Dummy
|
|
// ======================
|
|
export const dummyKandangs: Kandang[] = [
|
|
{
|
|
id: 1,
|
|
name: 'Kandang Ayam Layer 1',
|
|
status: 'AKTIF',
|
|
capacity: 500,
|
|
location: dummyLocations[0],
|
|
pic: createdUser,
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 2,
|
|
name: 'Kandang Ayam Broiler 2',
|
|
status: 'NONAKTIF',
|
|
capacity: 300,
|
|
location: dummyLocations[1],
|
|
pic: createdUser,
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|
|
|
|
// ======================
|
|
// 🏭 Warehouse Dummy
|
|
// ======================
|
|
export const dummyWarehouses: Warehouse[] = [
|
|
{
|
|
id: 1,
|
|
type: 'AREA',
|
|
name: 'Gudang Wilayah Bandung Barat',
|
|
area: dummyAreas[0],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 2,
|
|
type: 'LOKASI',
|
|
name: 'Gudang Produksi Sukajadi',
|
|
area: dummyAreas[0],
|
|
location: { ...dummyLocations[0], area: dummyAreas[0] },
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 3,
|
|
type: 'KANDANG',
|
|
name: 'Gudang Kandang Layer 1',
|
|
area: dummyAreas[0],
|
|
location: { ...dummyLocations[0], area: dummyAreas[0] },
|
|
kandang: {
|
|
...dummyKandangs[0],
|
|
location: dummyLocations[0],
|
|
pic: createdUser,
|
|
},
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|
|
|
|
// ======================
|
|
// 📦 Product Warehouse Dummy
|
|
// ======================
|
|
export const dummyProductWarehouses: ProductWarehouse[] = [
|
|
{
|
|
id: 1,
|
|
product_id: 101,
|
|
warehouse_id: 1,
|
|
quantity: 1000,
|
|
product: {
|
|
id: 101,
|
|
name: 'Pakan Ayam Premium',
|
|
sku: 'PAK-001',
|
|
category: 'PAKAN',
|
|
} as unknown as Product,
|
|
warehouse: dummyWarehouses[0],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
{
|
|
id: 2,
|
|
product_id: 102,
|
|
warehouse_id: 2,
|
|
quantity: 500,
|
|
product: {
|
|
id: 102,
|
|
name: 'Vitamin Ayam Super',
|
|
sku: 'VIT-002',
|
|
category: 'VITAMIN',
|
|
} as unknown as Product,
|
|
warehouse: dummyWarehouses[1],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|
|
|
|
// ======================
|
|
// 💼 Marketing Dummy
|
|
// ======================
|
|
export const dummyMarketings: Marketing[] = [
|
|
// Step 1: Pengajuan Order
|
|
{
|
|
id: 1,
|
|
status: 'APPROVED',
|
|
so_number: 'SO-001-2025',
|
|
so_docs: 'https://example.com/docs/so001.pdf',
|
|
so_date: format(new Date(), 'yyyy-MM-dd'),
|
|
customer: {
|
|
id: 1,
|
|
name: 'PT Maju Jaya',
|
|
pic_id: 1,
|
|
pic: createdUser,
|
|
type: 'Distributor',
|
|
address: 'Jl. Merdeka No. 1',
|
|
phone: '081212121212',
|
|
email: 'contact@majujaya.com',
|
|
account_number: '1234567890',
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
sales_person: createdUser,
|
|
notes: 'Pengiriman awal bulan.',
|
|
grand_total: 7500000,
|
|
approval: {
|
|
step_number: 1,
|
|
step_name: 'Pengajuan Order',
|
|
action: 'APPROVED',
|
|
action_by: createdUser,
|
|
action_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
marketing_products: [
|
|
{
|
|
id: 1,
|
|
qty: 100,
|
|
unit_price: 75000,
|
|
avg_weight: 2.5,
|
|
total_weight: 250,
|
|
total_price: 7500000,
|
|
product_warehouse: dummyProductWarehouses[0],
|
|
marketing_delivery_products: {
|
|
id: 1,
|
|
qty: 100,
|
|
unit_price: 75000,
|
|
avg_weight: 2.5,
|
|
total_weight: 250,
|
|
total_price: 7500000,
|
|
delivery_date: format(new Date(), 'yyyy-MM-dd'),
|
|
vehicle_number: 'B 1234 XY',
|
|
},
|
|
},
|
|
],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
|
|
// Step 2: Sales Order
|
|
{
|
|
id: 2,
|
|
status: 'APPROVED',
|
|
so_number: 'SO-002-2025',
|
|
so_docs: 'https://example.com/docs/so002.pdf',
|
|
so_date: format(new Date(), 'yyyy-MM-dd'),
|
|
customer: {
|
|
id: 2,
|
|
name: 'CV Sumber Sehat',
|
|
pic_id: 2,
|
|
pic: createdUser,
|
|
type: 'Retail',
|
|
address: 'Jl. Cihampelas No. 5',
|
|
phone: '082222222222',
|
|
email: 'info@sumbersehat.com',
|
|
account_number: '9876543210',
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
sales_person: createdUser,
|
|
notes: 'Pesanan kedua untuk stok akhir tahun.',
|
|
grand_total: 3750000,
|
|
approval: {
|
|
step_number: 2,
|
|
step_name: 'Sales Order',
|
|
action: 'APPROVED',
|
|
action_by: createdUser,
|
|
action_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
marketing_products: [
|
|
{
|
|
id: 2,
|
|
qty: 50,
|
|
unit_price: 75000,
|
|
avg_weight: 2.5,
|
|
total_weight: 125,
|
|
total_price: 3750000,
|
|
product_warehouse: dummyProductWarehouses[1],
|
|
marketing_delivery_products: {
|
|
id: 2,
|
|
qty: 50,
|
|
unit_price: 75000,
|
|
avg_weight: 2.5,
|
|
total_weight: 125,
|
|
total_price: 3750000,
|
|
delivery_date: format(new Date(), 'yyyy-MM-dd'),
|
|
vehicle_number: 'B 5678 YZ',
|
|
},
|
|
},
|
|
],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
|
|
// Step 3: Delivery Order
|
|
{
|
|
id: 3,
|
|
status: 'APPROVED',
|
|
so_number: 'SO-003-2025',
|
|
so_docs: 'https://example.com/docs/so003.pdf',
|
|
so_date: format(new Date(), 'yyyy-MM-dd'),
|
|
customer: {
|
|
id: 3,
|
|
name: 'UD Ternak Sejahtera',
|
|
pic_id: 3,
|
|
pic: createdUser,
|
|
type: 'Reseller',
|
|
address: 'Jl. Pasteur No. 88',
|
|
phone: '083333333333',
|
|
email: 'halo@ternaksejahtera.com',
|
|
account_number: '1122334455',
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
sales_person: createdUser,
|
|
notes: 'Order untuk pengiriman ke luar kota.',
|
|
grand_total: 5600000,
|
|
approval: {
|
|
step_number: 3,
|
|
step_name: 'Delivery Order',
|
|
action: 'APPROVED',
|
|
action_by: createdUser,
|
|
action_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
marketing_products: [
|
|
{
|
|
id: 3,
|
|
qty: 80,
|
|
unit_price: 70000,
|
|
avg_weight: 2.4,
|
|
total_weight: 192,
|
|
total_price: 5600000,
|
|
product_warehouse: dummyProductWarehouses[0],
|
|
marketing_delivery_products: {
|
|
id: 3,
|
|
qty: 80,
|
|
unit_price: 70000,
|
|
avg_weight: 2.4,
|
|
total_weight: 192,
|
|
total_price: 5600000,
|
|
delivery_date: format(new Date(), 'yyyy-MM-dd'),
|
|
vehicle_number: 'D 9090 ZZ',
|
|
},
|
|
},
|
|
{
|
|
id: 4,
|
|
qty: 80,
|
|
unit_price: 70000,
|
|
avg_weight: 2.4,
|
|
total_weight: 192,
|
|
total_price: 5600000,
|
|
product_warehouse: dummyProductWarehouses[0],
|
|
marketing_delivery_products: {
|
|
id: 3,
|
|
qty: 80,
|
|
unit_price: 70000,
|
|
avg_weight: 2.4,
|
|
total_weight: 192,
|
|
total_price: 5600000,
|
|
delivery_date: format(new Date(), 'yyyy-MM-dd'),
|
|
vehicle_number: 'D 9090 ZZ',
|
|
},
|
|
},
|
|
],
|
|
created_user: createdUser,
|
|
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
},
|
|
];
|