add i18n, products, productors and forms as tables

This commit is contained in:
2026-02-12 00:30:28 +01:00
parent 1813e2893e
commit 025b78d5dd
43 changed files with 1623 additions and 527 deletions

View File

@@ -0,0 +1,47 @@
import type { Productor } from "@/services/resources/productors";
import type { Shipment, ShipmentInputs } from "@/services/resources/shipments";
import type { User } from "@/services/resources/users";
export type Form = {
id: number;
name: string;
season: string;
start: string;
end: string;
productor: Productor;
referer: User;
shipments: Shipment[];
}
export type FormCreate = {
name: string;
season: string;
start: string;
end: string;
productor_id: number;
referer_id: number;
}
export type FormEdit = {
name?: string | null;
season?: string | null;
start?: string | null;
end?: string | null;
productor_id?: number | null;
referer_id?: number | null;
}
export type FormEditPayload = {
id: number;
form: FormEdit;
}
export type FormInputs = {
name: string;
season: string;
start: string | null;
end: string | null;
productor_id: string;
referer_id: string;
shipments: ShipmentInputs[];
}

View File

@@ -0,0 +1,33 @@
export type Productor = {
id: number;
name: string;
address: string;
payment: string;
type: string;
}
export type ProductorCreate = {
name: string;
address: string;
payment: string;
type: string;
}
export type ProductorEdit = {
name: string | null;
address: string | null;
payment: string | null;
type: string | null;
}
export type ProductorInputs = {
name: string;
address: string;
payment: string;
type: string;
}
export type ProductorEditPayload = {
productor: ProductorEdit;
id: number;
}

View File

@@ -0,0 +1,49 @@
import type { Productor } from "@/services/resources/productors";
import type { Shipment } from "@/services/resources/shipments";
export type Product = {
id: number;
productor: Productor;
name: string;
unit: number;
price: number;
priceKg: number | null;
weight: number;
type: number;
shipments: Shipment[];
}
export type ProductCreate = {
productor_id: Productor;
name: string;
unit: number;
price: number;
priceKg: number | null;
weight: number;
type: number;
}
export type ProductEdit = {
productor_id: Productor | null;
name: string | null;
unit: number | null;
price: number | null;
priceKg: number | null;
weight: number | null;
type: number | null;
}
export type ProductInputs = {
productor_id: number | null;
name: string;
unit: number | null;
price: number | null;
priceKg: number | null;
weight: number | null;
type: string;
}
export type ProductEditPayload = {
product: ProductEdit;
id: number;
}

View File

@@ -0,0 +1,30 @@
export type Shipment = {
name: string;
date: string;
id: number;
form_id: number;
}
export type ShipmentCreate = {
name: string;
date: string;
form_id: number;
}
export type ShipmentEdit = {
name: string | null;
date: string | null;
form_id: number | null;
}
export type ShipmentEditPayload = {
id: number;
shipment: ShipmentEdit;
}
export type ShipmentInputs = {
name: string | null;
date: string | null;
id: number | null;
form_id: number | null;
}

View File

@@ -0,0 +1,8 @@
import type { Product } from "@/services/resources/products";
export type User = {
id: number;
name: string;
email: string;
products: Product[];
}