Make vendor nullable

This commit is contained in:
2026-06-18 11:04:59 +07:00
parent 2ad9e2f85f
commit c1d859ebdd
13 changed files with 88 additions and 39 deletions
+6 -6
View File
@@ -150,12 +150,12 @@ type PurchasingIngredientData struct {
// PurchasingVendorData represents purchasing analytics for a vendor
type PurchasingVendorData struct {
VendorID uuid.UUID `json:"vendor_id"`
VendorName string `json:"vendor_name"`
TotalCost float64 `json:"total_cost"`
PurchaseOrderCount int64 `json:"purchase_order_count"`
IngredientCount int64 `json:"ingredient_count"`
Quantity float64 `json:"quantity"`
VendorID *uuid.UUID `json:"vendor_id"`
VendorName string `json:"vendor_name"`
TotalCost float64 `json:"total_cost"`
PurchaseOrderCount int64 `json:"purchase_order_count"`
IngredientCount int64 `json:"ingredient_count"`
Quantity float64 `json:"quantity"`
}
// ProductAnalyticsRequest represents the request for product analytics
+3 -3
View File
@@ -9,7 +9,7 @@ import (
type PurchaseOrder struct {
ID uuid.UUID `json:"id"`
OrganizationID uuid.UUID `json:"organization_id"`
VendorID uuid.UUID `json:"vendor_id"`
VendorID *uuid.UUID `json:"vendor_id"`
PONumber string `json:"po_number"`
TransactionDate time.Time `json:"transaction_date"`
DueDate *time.Time `json:"due_date"`
@@ -44,7 +44,7 @@ type PurchaseOrderAttachment struct {
type PurchaseOrderResponse struct {
ID uuid.UUID `json:"id"`
OrganizationID uuid.UUID `json:"organization_id"`
VendorID uuid.UUID `json:"vendor_id"`
VendorID *uuid.UUID `json:"vendor_id"`
PONumber string `json:"po_number"`
TransactionDate time.Time `json:"transaction_date"`
DueDate *time.Time `json:"due_date"`
@@ -84,7 +84,7 @@ type PurchaseOrderAttachmentResponse struct {
}
type CreatePurchaseOrderRequest struct {
VendorID uuid.UUID `json:"vendor_id"`
VendorID *uuid.UUID `json:"vendor_id,omitempty"`
PONumber string `json:"po_number"`
TransactionDate time.Time `json:"transaction_date"`
DueDate *time.Time `json:"due_date,omitempty"`