รุ่นการเลี้ยง
CropControl
| ชื่อรุ่น | วันที่เปิด | วันที่ปิด | สถานะ | ซื้อสัตว์ (฿) | จำนวนเข้า | น้ำหนักเข้า (กก.) | บันทึกโดย | หมายเหตุ | จัดการ |
|---|
ซื้อสัตว์
CropPurchase
| รหัสซื้อ | วันที่ซื้อ | ซื้อจาก | รุ่น | จำนวน | แถม | น้ำหนักเข้า | น้ำหนักแถม | ราคา/ตัว | ราคา/กก. | รวมเงิน 🔢 | เฉลี่ย/ตัว 🔢 | สถานะ | ใบซื้อ | จัดการ |
|---|
องค์กร / ผู้ใช้งาน
Organizations · Users · Seats
🏢 ข้อมูลองค์กร
💺 Seats / สิทธิ์ใช้งาน
👥 ผู้ใช้งานในองค์กร
| ชื่อผู้ใช้ | อีเมล | บทบาท | สถานะ | Seat | วันเพิ่ม | เข้าสู่ระบบล่าสุด | จัดการ |
|---|
🗄️ โครงสร้าง Database — Schema Reference
ทุก table มี organization_id
รองรับ Multi-Tenant SaaS + Row Level Security (RLS) บน Supabase
organizations
id · name · slug · plan
max_seats · address
phone · logo_url
created_at · updated_at
max_seats · address
phone · logo_url
created_at · updated_at
users
organization_id
id · username · email
role · status
last_login · created_at
id · username · email
role · status
last_login · created_at
user_seats
organization_id
id · user_id · seat_type
valid_from · valid_until
is_active
id · user_id · seat_type
valid_from · valid_until
is_active
batches (CropControl)
organization_id
id · batch_name
open_date · close_date
status · note · created_by
id · batch_name
open_date · close_date
status · note · created_by
purchases (CropPurchase)
organization_id
id · batch_id · tx_id
purchase_date · from_farm
qty · weight · price
status · created_by
id · batch_id · tx_id
purchase_date · from_farm
qty · weight · price
status · created_by
ตารางถัดไป (รอสร้าง)
sales (CropSell)
expenses (CropExpense)
feed_stock
medicine_stock
reports (auto-calc)
expenses (CropExpense)
feed_stock
medicine_stock
reports (auto-calc)