v1.8.0: warehouse module (16 commits), docházka mzda model, leave_type=holiday removal, api.ts race fix
Highlights: - Warehouse module: receipts, issues, reservations, inventory, reports, dashboard, master data (categories, suppliers, locations), FIFO service, integration tests - Docházka: mzda PDF counting model (Odpracováno / Vč. svátků / Přesčas / Svátek / So/Ne / Noc) with Czech weekday names and decimal hours - AttendanceAdmin/AttendanceHistory KPI cards unified to mzda formula with fund bar colored by delta, badges for Práce/Dov/Nem/Sv/Nep - Remove leave_type=holiday entirely (auto-computed from Czech public holidays) - Allow multiple work shifts per day (overlap detection only) - Pre-flight refresh in api.ts eliminates spurious 401s on fresh page loads - Prisma: company_settings gets 6 nullable columns for warehouse numbering (PRI/VYD/INV prefixes, default patterns); migration seeds defaults
This commit is contained in:
@@ -119,7 +119,7 @@ export type CreateItemInput = z.infer<typeof CreateItemSchema>;
|
||||
export type UpdateItemInput = z.infer<typeof UpdateItemSchema>;
|
||||
|
||||
// === Receipts ===
|
||||
export const ReceiptLineSchema = z.object({
|
||||
export const ReceiptItemSchema = z.object({
|
||||
item_id: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
quantity: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
unit_price: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
@@ -138,8 +138,8 @@ export const CreateReceiptSchema = z.object({
|
||||
delivery_note_number: z.string().nullish(),
|
||||
delivery_note_date: z.union([z.string(), z.null()]).nullish(),
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(ReceiptLineSchema)
|
||||
items: z
|
||||
.array(ReceiptItemSchema)
|
||||
.min(1, "Příjem musí obsahovat alespoň jednu položku"),
|
||||
});
|
||||
export const UpdateReceiptSchema = z.object({
|
||||
@@ -150,17 +150,17 @@ export const UpdateReceiptSchema = z.object({
|
||||
delivery_note_number: z.string().nullish(),
|
||||
delivery_note_date: z.union([z.string(), z.null()]).nullish(),
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(ReceiptLineSchema)
|
||||
items: z
|
||||
.array(ReceiptItemSchema)
|
||||
.min(1, "Příjem musí obsahovat alespoň jednu položku")
|
||||
.optional(),
|
||||
});
|
||||
export type CreateReceiptInput = z.infer<typeof CreateReceiptSchema>;
|
||||
export type UpdateReceiptInput = z.infer<typeof UpdateReceiptSchema>;
|
||||
export type ReceiptLineInput = z.infer<typeof ReceiptLineSchema>;
|
||||
export type ReceiptItemInput = z.infer<typeof ReceiptItemSchema>;
|
||||
|
||||
// === Issues ===
|
||||
export const IssueLineSchema = z.object({
|
||||
export const IssueItemSchema = z.object({
|
||||
item_id: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
batch_id: z
|
||||
.union([z.number(), z.string()])
|
||||
@@ -181,8 +181,8 @@ export const IssueLineSchema = z.object({
|
||||
export const CreateIssueSchema = z.object({
|
||||
project_id: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(IssueLineSchema)
|
||||
items: z
|
||||
.array(IssueItemSchema)
|
||||
.min(1, "Výdej musí obsahovat alespoň jednu položku"),
|
||||
});
|
||||
export const UpdateIssueSchema = z.object({
|
||||
@@ -191,14 +191,14 @@ export const UpdateIssueSchema = z.object({
|
||||
.transform((v) => Number(v))
|
||||
.optional(),
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(IssueLineSchema)
|
||||
items: z
|
||||
.array(IssueItemSchema)
|
||||
.min(1, "Výdej musí obsahovat alespoň jednu položku")
|
||||
.optional(),
|
||||
});
|
||||
export type CreateIssueInput = z.infer<typeof CreateIssueSchema>;
|
||||
export type UpdateIssueInput = z.infer<typeof UpdateIssueSchema>;
|
||||
export type IssueLineInput = z.infer<typeof IssueLineSchema>;
|
||||
export type IssueItemInput = z.infer<typeof IssueItemSchema>;
|
||||
|
||||
// === Reservations ===
|
||||
export const CreateReservationSchema = z.object({
|
||||
@@ -210,7 +210,7 @@ export const CreateReservationSchema = z.object({
|
||||
export type CreateReservationInput = z.infer<typeof CreateReservationSchema>;
|
||||
|
||||
// === Inventory ===
|
||||
export const InventoryLineSchema = z.object({
|
||||
export const InventoryItemSchema = z.object({
|
||||
item_id: z.union([z.number(), z.string()]).transform((v) => Number(v)),
|
||||
location_id: z
|
||||
.union([z.number(), z.string(), z.null()])
|
||||
@@ -222,14 +222,14 @@ export const InventoryLineSchema = z.object({
|
||||
|
||||
export const CreateInventorySessionSchema = z.object({
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(InventoryLineSchema)
|
||||
items: z
|
||||
.array(InventoryItemSchema)
|
||||
.min(1, "Inventura musí obsahovat alespoň jednu položku"),
|
||||
});
|
||||
export const UpdateInventorySessionSchema = z.object({
|
||||
notes: z.string().nullish(),
|
||||
lines: z
|
||||
.array(InventoryLineSchema)
|
||||
items: z
|
||||
.array(InventoryItemSchema)
|
||||
.min(1, "Inventura musí obsahovat alespoň jednu položku")
|
||||
.optional(),
|
||||
});
|
||||
@@ -239,4 +239,4 @@ export type CreateInventorySessionInput = z.infer<
|
||||
export type UpdateInventorySessionInput = z.infer<
|
||||
typeof UpdateInventorySessionSchema
|
||||
>;
|
||||
export type InventoryLineInput = z.infer<typeof InventoryLineSchema>;
|
||||
export type InventoryItemInput = z.infer<typeof InventoryItemSchema>;
|
||||
|
||||
Reference in New Issue
Block a user