mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 22:35:45 +00:00
feat(FE-166-167-168): slicing ui create, edit dan detail sales order
This commit is contained in:
@@ -0,0 +1,285 @@
|
||||
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, // bisa diganti sesuai tipe 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, // bisa diganti sesuai tipe 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[] = [
|
||||
{
|
||||
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: 'Manager Approval',
|
||||
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'),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
status: 'PENDING',
|
||||
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: 1,
|
||||
step_name: 'Manager Approval',
|
||||
action: 'PENDING',
|
||||
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'),
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user