diff --git a/src/verticals/hospitality/seed.ts b/src/verticals/hospitality/seed.ts deleted file mode 100644 index 55d1b75..0000000 --- a/src/verticals/hospitality/seed.ts +++ /dev/null @@ -1,757 +0,0 @@ -import type { BookingInput } from "@/modules/bookings"; -import type { CatalogItem } from "@/modules/catalog"; -import type { Customer } from "@/modules/customers"; -import type { PurchaseOrder, StockItem } from "@/modules/inventory"; -import type { Party } from "@/modules/parties"; -import type { Area, Resource } from "@/modules/resources"; -import type { Shift, StaffMember } from "@/modules/staff"; - -/** - * Hospitality mock data in the generic contracts: the bookings screen reads this day through the data seam. Times are - * minutes from midnight; "now" is 20:40. Guests that are not customers are named by `contactName`. - */ - -export const BUSINESS_DAY = "2026-10-31"; -const EUR = "EUR"; -const at = (hours: number, minutes = 0) => hours * 60 + minutes; -const eur = (amountMinor: number) => ({ amountMinor, currency: EUR }); - -export const areas: Area[] = [ - { id: "dining", label: "Dining room", levelId: "street", ext: { outdoor: false } }, - { id: "bar", label: "Bar", levelId: "street", ext: { outdoor: false } }, - { id: "terrace", label: "Terrace", levelId: "rooftop", ext: { outdoor: true } }, -]; - -const table = (id: string, areaId: string, shape: "rect" | "square" | "round", capacity: number): Resource => ({ - id, - kind: "table", - label: id, - areaId, - capacity, - active: true, - ext: { shape }, -}); - -export const resources: Resource[] = [ - table("S1", "dining", "rect", 4), - table("S2", "dining", "square", 2), - table("S3", "dining", "rect", 4), - table("S4", "dining", "square", 2), - table("S5", "dining", "round", 4), - table("S6", "dining", "rect", 6), - table("S7", "dining", "rect", 4), - table("S8", "dining", "round", 2), - table("B1", "bar", "round", 2), - table("B2", "bar", "round", 2), - table("B3", "bar", "round", 2), - table("B4", "bar", "round", 2), - table("T1", "terrace", "square", 2), - table("T2", "terrace", "square", 2), - table("T3", "terrace", "rect", 4), - table("T4", "terrace", "square", 2), - table("T5", "terrace", "rect", 4), - table("T6", "terrace", "rect", 4), - table("T7", "terrace", "round", 3), - table("T8", "terrace", "square", 2), -]; - -const customerFigures = (visits: number, averageSpend: number, lastVisit: string, noShows = 0) => ({ - visits, - spend: eur(visits * averageSpend * 100), - lastVisit: `${lastVisit}T00:00:00Z`, - noShows, -}); - -export const customers: Customer[] = [ - { - id: "C-iglesias", - name: "Iglesias", - phone: "+34600000101", - locale: "es", - consent: { marketing: true }, - tags: ["Regular"], - vip: false, - blocked: false, - notes: [], - figures: customerFigures(14, 58, "2026-10-17"), - ext: { allergens: [], dietaryRestrictions: [] }, - }, - { - id: "C-ortega", - name: "Ortega", - phone: "+34600000102", - email: "ortega@example.com", - locale: "es", - consent: { marketing: false }, - tags: [], - vip: false, - blocked: false, - notes: [ - { - id: "note-ortega-1", - text: "One guest is coeliac", - authorId: "demo-owner", - authorName: "Alex Morgan", - day: "2026-09-30", - minute: 21 * 60, - }, - ], - figures: customerFigures(6, 52, "2026-09-30"), - ext: { allergens: ["gluten"], dietaryRestrictions: ["Gluten-free"] }, - }, - { - id: "C-bravo", - name: "Bravo", - phone: "+34600000103", - locale: "es", - consent: { marketing: true }, - tags: ["Regular"], - vip: true, - blocked: false, - notes: [], - figures: customerFigures(8, 61, "2026-10-24"), - ext: { allergens: ["milk"], dietaryRestrictions: ["Lactose-free"] }, - }, - { - id: "C-calvo", - name: "Calvo", - email: "calvo@example.com", - locale: "es", - consent: { marketing: false }, - tags: ["Company"], - vip: false, - blocked: false, - notes: [], - figures: { visits: 1, spend: null, lastVisit: null, noShows: 0 }, - ext: { allergens: ["nuts"], dietaryRestrictions: [] }, - }, -]; - -const text = (en: string, es: string, de: string, fr: string) => ({ source: en, translations: { en, es, de, fr } }); - -export const catalog: CatalogItem[] = [ - { - id: "dish-croquetas", - kind: "product", - name: text("Ham croquettes", "Croquetas de jamón", "Schinkenkroketten", "Croquettes au jambon"), - categoryId: "starters", - price: eur(1100), - status: "active", - media: [], - tags: [], - ext: { allergens: ["gluten", "milk", "eggs"] }, - }, - { - id: "dish-arroz", - kind: "product", - name: text("Seafood rice", "Arroz del señorito", "Reis mit Meeresfrüchten", "Riz aux fruits de mer"), - categoryId: "mains", - price: eur(2400), - status: "active", - media: [], - tags: ["Signature"], - ext: { allergens: ["crustaceans", "molluscs", "fish"], pairing: "Albariño" }, - }, - { - id: "dish-flan", - kind: "product", - name: text("House flan", "Flan de la casa", "Flan des Hauses", "Flan maison"), - categoryId: "desserts", - price: eur(750), - status: "active", - media: [], - tags: [], - ext: { allergens: ["milk", "eggs"] }, - }, - { - id: "dish-of-the-day", - kind: "product", - name: text("Catch of the day", "Pescado del día", "Fisch des Tages", "Poisson du jour"), - categoryId: "mains", - price: eur(2600), - status: "active", - media: [], - tags: ["Daily"], - ext: { allergens: ["fish"], dishOfTheDay: true }, - }, - { - id: "menu-tasting", - kind: "bundle", - name: text("Tasting menu", "Menú degustación", "Degustationsmenü", "Menu dégustation"), - categoryId: "menus", - price: eur(5200), - durationMin: 120, - status: "active", - media: [], - tags: ["Whole table"], - sections: [ - { id: "course-1", name: text("Starter", "Entrante", "Vorspeise", "Entrée"), itemIds: ["dish-croquetas"] }, - { - id: "course-2", - name: text("Main", "Principal", "Hauptgang", "Plat"), - itemIds: ["dish-arroz", "dish-of-the-day"], - }, - { id: "course-3", name: text("Dessert", "Postre", "Nachspeise", "Dessert"), itemIds: ["dish-flan"] }, - ], - ext: { allergens: ["gluten", "milk", "eggs", "crustaceans", "molluscs", "fish"] }, - }, - { - id: "shop-olive-oil", - kind: "product", - name: text( - "House olive oil, 500 ml", - "Aceite de oliva de la casa, 500 ml", - "Olivenöl des Hauses, 500 ml", - "Huile d'olive maison, 500 ml", - ), - categoryId: "shop", - price: eur(1400), - status: "active", - media: [], - tags: [], - ext: { allergens: [] }, - }, - { - id: "shop-red-wine", - kind: "product", - name: text( - "House red wine, bottle", - "Vino tinto de la casa, botella", - "Rotwein des Hauses, Flasche", - "Vin rouge maison, bouteille", - ), - categoryId: "shop", - price: eur(1800), - status: "active", - media: [], - tags: [], - ext: { allergens: ["sulphites"] }, - }, - { - id: "shop-paprika", - kind: "product", - name: text( - "Smoked paprika, tin", - "Pimentón de la Vera, lata", - "Geräuchertes Paprikapulver, Dose", - "Paprika fumé, boîte", - ), - categoryId: "shop", - price: eur(650), - status: "active", - media: [], - tags: [], - ext: { allergens: [] }, - }, -]; - -export const staff: StaffMember[] = [ - { - id: "staff-marta", - name: "Marta", - roleIds: ["manager"], - status: "active", - locationIds: ["venue"], - skills: ["host", "sommelier"], - contract: { type: "full_time", startDate: "2022-03-01", hoursPerWeek: 40 }, - ext: { crew: "floor" }, - }, - { - id: "staff-iker", - name: "Iker", - roleIds: ["staff"], - status: "active", - locationIds: ["venue"], - skills: ["waiter"], - ext: { crew: "floor" }, - }, - { - id: "staff-lucia", - name: "Lucía", - roleIds: ["staff"], - status: "active", - locationIds: ["venue"], - skills: ["grill", "pastry"], - ext: { crew: "kitchen" }, - }, -]; - -export const shifts: Shift[] = [ - { id: "shift-marta", staffId: "staff-marta", businessDay: BUSINESS_DAY, startMin: at(17), endMin: at(24) }, - { id: "shift-iker", staffId: "staff-iker", businessDay: BUSINESS_DAY, startMin: at(18, 30), endMin: at(24) }, - { id: "shift-lucia", staffId: "staff-lucia", businessDay: BUSINESS_DAY, startMin: at(17, 30), endMin: at(23, 30) }, -]; - -const base = { businessDay: BUSINESS_DAY, staffIds: [], lines: [] }; - -export const bookings: BookingInput[] = [ - { - ...base, - id: "R-1041", - status: "in_progress", - startMin: at(19), - endMin: at(20, 30), - resourceIds: ["S2"], - staffIds: ["staff-iker"], - customerId: "C-iglesias", - partySize: 2, - origin: "online", - channel: "web", - staffNote: "Asked for the bill", - tags: ["Regular"], - }, - { - ...base, - id: "R-1042", - status: "in_progress", - startMin: at(19), - endMin: at(20, 45), - resourceIds: ["T6"], - partySize: 4, - origin: "online", - channel: "web", - tags: [], - contactName: "Mora", - }, - { - ...base, - id: "R-1043", - status: "in_progress", - startMin: at(19, 15), - endMin: at(21), - resourceIds: ["S3"], - staffIds: ["staff-iker"], - customerId: "C-ortega", - partySize: 4, - origin: "staff", - channel: "phone", - guestNote: "One guest is coeliac", - tags: ["Gluten-free"], - }, - { - ...base, - id: "R-1044", - status: "in_progress", - startMin: at(19, 30), - endMin: at(21), - resourceIds: ["T2"], - partySize: 2, - origin: "online", - channel: "web", - guestNote: "Candle on the dessert", - tags: ["Gluten-free", "Anniversary"], - contactName: "Valdés", - }, - { - ...base, - id: "R-1045", - status: "in_progress", - startMin: at(20), - endMin: at(21, 45), - resourceIds: ["T7"], - partySize: 3, - origin: "online", - channel: "web", - tags: [], - contactName: "Sanz", - }, - { - ...base, - id: "R-1046", - status: "confirmed", - startMin: at(20, 15), - endMin: at(21, 45), - resourceIds: ["T8"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Castaño", - }, - { - ...base, - id: "R-1047", - status: "in_progress", - startMin: at(20, 20), - endMin: at(21, 50), - resourceIds: ["T1"], - partySize: 2, - origin: "walk_in", - tags: [], - }, - { - ...base, - id: "R-1048", - status: "confirmed", - deposit: { amount: eur(4000), status: "captured" }, - startMin: at(20, 30), - endMin: at(22, 15), - resourceIds: ["S5"], - customerId: "C-bravo", - partySize: 4, - origin: "staff", - channel: "phone", - tags: ["Lactose-free"], - }, - { - ...base, - id: "R-1049", - status: "confirmed", - startMin: at(20, 45), - endMin: at(22, 15), - resourceIds: ["B1"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Peña", - }, - { - ...base, - id: "R-1050", - status: "confirmed", - startMin: at(20, 45), - endMin: at(22, 30), - resourceIds: ["S7"], - partySize: 4, - origin: "online", - channel: "web", - guestNote: "Bring the cake out with the coffees", - tags: ["Birthday cake"], - contactName: "Cano", - }, - { - ...base, - id: "R-1051", - status: "confirmed", - startMin: at(21), - endMin: at(22, 45), - resourceIds: ["S1"], - partySize: 4, - origin: "online", - channel: "web", - tags: ["Regular"], - contactName: "Ruiz", - }, - { - ...base, - id: "R-1052", - status: "confirmed", - startMin: at(21), - endMin: at(23), - resourceIds: ["S6"], - partySize: 6, - origin: "online", - channel: "web", - guestNote: "Needs space for a stroller", - tags: ["Stroller"], - contactName: "Soto", - }, - { - ...base, - id: "R-1053", - status: "confirmed", - startMin: at(21), - endMin: at(22, 30), - resourceIds: ["T4"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Ferrer", - }, - { - ...base, - id: "R-1054", - status: "confirmed", - startMin: at(21), - endMin: at(22, 30), - resourceIds: ["T5"], - partySize: 2, - origin: "assistant", - channel: "web", - tags: ["Gluten-free"], - contactName: "Lozano", - }, - { - ...base, - id: "R-1055", - status: "confirmed", - startMin: at(21, 15), - endMin: at(22, 45), - resourceIds: [], - partySize: 4, - origin: "staff", - channel: "phone", - guestNote: "Prefers a quiet corner", - tags: ["Quiet table"], - contactName: "Rey", - }, - { - ...base, - id: "R-1056", - status: "confirmed", - startMin: at(21, 15), - endMin: at(23), - resourceIds: ["T3"], - partySize: 4, - origin: "online", - channel: "web", - tags: [], - contactName: "Cabrera", - }, - { - ...base, - id: "R-1057", - status: "pending", - startMin: at(21, 30), - endMin: at(23), - resourceIds: ["S4"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Marín", - }, - { - ...base, - id: "R-1058", - status: "confirmed", - startMin: at(22), - endMin: at(23, 30), - resourceIds: ["T7"], - partySize: 3, - origin: "online", - channel: "web", - tags: [], - contactName: "Blanco", - }, - { - ...base, - id: "R-1059", - status: "awaiting_payment", - deposit: { amount: eur(20_000), status: "due" }, - startMin: at(22), - endMin: at(24), - resourceIds: [], - customerId: "C-calvo", - partySize: 8, - lines: [{ catalogItemId: "menu-tasting", qty: 8, durationMin: 120, unitPrice: eur(5200) }], - origin: "staff", - channel: "phone", - guestNote: "Asked for a set menu for the whole table", - tags: ["Company dinner"], - ext: { type: "event", occasion: "Company dinner" }, - }, - { - ...base, - id: "R-1060", - status: "confirmed", - startMin: at(22, 30), - endMin: at(24), - resourceIds: ["S2"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Lara", - }, - { - ...base, - id: "R-1061", - status: "completed", - startMin: at(19), - endMin: at(20, 15), - resourceIds: ["B2"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Navarro", - }, - { - ...base, - id: "R-1062", - status: "cancelled", - startMin: at(20), - endMin: at(21, 30), - resourceIds: [], - partySize: 2, - origin: "online", - channel: "web", - staffNote: "Cancelled by the guest this afternoon", - tags: [], - contactName: "Vidal", - }, - { - ...base, - id: "R-1063", - status: "no_show", - startMin: at(19, 45), - endMin: at(21, 15), - resourceIds: [], - partySize: 3, - origin: "staff", - channel: "phone", - tags: [], - contactName: "Herrera", - }, - { - ...base, - businessDay: "2026-11-02", - id: "R-1101", - status: "confirmed", - startMin: at(20), - endMin: at(21, 30), - resourceIds: ["S8"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Aranda", - }, - { - ...base, - businessDay: "2026-11-02", - id: "R-1102", - status: "confirmed", - startMin: at(21), - endMin: at(22, 30), - resourceIds: ["B3"], - partySize: 2, - origin: "online", - channel: "web", - tags: [], - contactName: "Pons", - }, -]; - -/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ -export const parties: Party[] = [ - { - id: "servicios-levante", - kind: "company", - legalName: "Servicios Corporativos Levante S.L.", - taxId: "B00000201", - addressLines: ["Calle del Comercio 12", "46002 Valencia", "Spain"], - countryCode: "ES", - email: "facturas@servicios-levante.example", - roles: ["client"], - }, - { - id: "mediterranea-eventos", - kind: "company", - legalName: "Mediterránea de Eventos S.A.", - taxId: "A00000202", - addressLines: ["Avenida del Puerto 45", "03001 Alicante", "Spain"], - countryCode: "ES", - email: "administracion@mediterranea-eventos.example", - roles: ["client"], - }, - { - id: "laura-gomez", - kind: "person", - legalName: "Laura Gómez Ruiz", - taxId: "00000203Z", - addressLines: ["Calle Mayor 3", "30001 Murcia", "Spain"], - countryCode: "ES", - email: "laura.gomez@correo.example", - roles: ["client"], - }, - { - id: "food-distributor", - kind: "company", - legalName: "Distribuciones Alimentarias del Mediterráneo S.L.", - tradeName: "Alimentarias del Mediterráneo", - taxId: "B00000204", - addressLines: ["Polígono Industrial Norte 8", "46930 Quart de Poblet", "Spain"], - countryCode: "ES", - email: "pedidos@alimentarias-mediterraneo.example", - roles: ["supplier"], - }, - { - id: "winery", - kind: "company", - legalName: "Bodegas Sierra Alta S.L.", - tradeName: "Bodegas Sierra Alta", - taxId: "B00000205", - addressLines: ["Camino de la Viña 2", "46340 Requena", "Spain"], - countryCode: "ES", - email: "ventas@bodegas-sierra-alta.example", - roles: ["supplier"], - }, -]; - -/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ -export const stockItems: StockItem[] = [ - { - id: "stock-olive-oil", - name: text("Olive oil, 500 ml", "Aceite de oliva, 500 ml", "Olivenöl, 500 ml", "Huile d’olive, 500 ml"), - sku: "OO-500", - catalogItemId: "shop-olive-oil", - unit: "bottle", - onHand: 18, - reorderPoint: 8, - supplierId: "food-distributor", - }, - { - id: "stock-red-wine", - name: text("Red wine, 75 cl", "Vino tinto, 75 cl", "Rotwein, 75 cl", "Vin rouge, 75 cl"), - sku: "RW-075", - catalogItemId: "shop-red-wine", - unit: "bottle", - onHand: 30, - reorderPoint: 24, - supplierId: "winery", - }, - { - id: "stock-paprika", - name: text( - "Smoked paprika, 75 g", - "Pimentón ahumado, 75 g", - "Geräuchertes Paprikapulver, 75 g", - "Paprika fumé, 75 g", - ), - sku: "PP-075", - catalogItemId: "shop-paprika", - unit: "tin", - onHand: 4, - reorderPoint: 10, - supplierId: "food-distributor", - }, -]; - -export const purchaseOrders: PurchaseOrder[] = [ - { - id: "PO-H-1", - supplierId: "food-distributor", - status: "sent", - lines: [ - { stockItemId: "stock-paprika", qty: 24, unitCost: eur(320) }, - { stockItemId: "stock-olive-oil", qty: 12, unitCost: eur(640) }, - ], - orderedOn: "2026-10-30", - expectedOn: "2026-11-03", - }, - { - id: "PO-H-2", - supplierId: "winery", - status: "received", - lines: [{ stockItemId: "stock-red-wine", qty: 48, unitCost: eur(540) }], - orderedOn: "2026-10-20", - expectedOn: "2026-10-25", - }, -]; - -export const hospitalitySeed = { - areas, - resources, - customers, - parties, - catalog, - stockItems, - purchaseOrders, - staff, - shifts, - bookings, -} as const; diff --git a/src/verticals/hospitality/seed/bookings.ts b/src/verticals/hospitality/seed/bookings.ts new file mode 100644 index 0000000..df1d8b5 --- /dev/null +++ b/src/verticals/hospitality/seed/bookings.ts @@ -0,0 +1,347 @@ +import type { BookingInput } from "@/modules/bookings"; + +import { at, BUSINESS_DAY, eur } from "./shared"; + +const base = { businessDay: BUSINESS_DAY, staffIds: [], lines: [] }; + +export const bookings: BookingInput[] = [ + { + ...base, + id: "R-1041", + status: "in_progress", + startMin: at(19), + endMin: at(20, 30), + resourceIds: ["S2"], + staffIds: ["staff-iker"], + customerId: "C-iglesias", + partySize: 2, + origin: "online", + channel: "web", + staffNote: "Asked for the bill", + tags: ["Regular"], + }, + { + ...base, + id: "R-1042", + status: "in_progress", + startMin: at(19), + endMin: at(20, 45), + resourceIds: ["T6"], + partySize: 4, + origin: "online", + channel: "web", + tags: [], + contactName: "Mora", + }, + { + ...base, + id: "R-1043", + status: "in_progress", + startMin: at(19, 15), + endMin: at(21), + resourceIds: ["S3"], + staffIds: ["staff-iker"], + customerId: "C-ortega", + partySize: 4, + origin: "staff", + channel: "phone", + guestNote: "One guest is coeliac", + tags: ["Gluten-free"], + }, + { + ...base, + id: "R-1044", + status: "in_progress", + startMin: at(19, 30), + endMin: at(21), + resourceIds: ["T2"], + partySize: 2, + origin: "online", + channel: "web", + guestNote: "Candle on the dessert", + tags: ["Gluten-free", "Anniversary"], + contactName: "Valdés", + }, + { + ...base, + id: "R-1045", + status: "in_progress", + startMin: at(20), + endMin: at(21, 45), + resourceIds: ["T7"], + partySize: 3, + origin: "online", + channel: "web", + tags: [], + contactName: "Sanz", + }, + { + ...base, + id: "R-1046", + status: "confirmed", + startMin: at(20, 15), + endMin: at(21, 45), + resourceIds: ["T8"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Castaño", + }, + { + ...base, + id: "R-1047", + status: "in_progress", + startMin: at(20, 20), + endMin: at(21, 50), + resourceIds: ["T1"], + partySize: 2, + origin: "walk_in", + tags: [], + }, + { + ...base, + id: "R-1048", + status: "confirmed", + deposit: { amount: eur(4000), status: "captured" }, + startMin: at(20, 30), + endMin: at(22, 15), + resourceIds: ["S5"], + customerId: "C-bravo", + partySize: 4, + origin: "staff", + channel: "phone", + tags: ["Lactose-free"], + }, + { + ...base, + id: "R-1049", + status: "confirmed", + startMin: at(20, 45), + endMin: at(22, 15), + resourceIds: ["B1"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Peña", + }, + { + ...base, + id: "R-1050", + status: "confirmed", + startMin: at(20, 45), + endMin: at(22, 30), + resourceIds: ["S7"], + partySize: 4, + origin: "online", + channel: "web", + guestNote: "Bring the cake out with the coffees", + tags: ["Birthday cake"], + contactName: "Cano", + }, + { + ...base, + id: "R-1051", + status: "confirmed", + startMin: at(21), + endMin: at(22, 45), + resourceIds: ["S1"], + partySize: 4, + origin: "online", + channel: "web", + tags: ["Regular"], + contactName: "Ruiz", + }, + { + ...base, + id: "R-1052", + status: "confirmed", + startMin: at(21), + endMin: at(23), + resourceIds: ["S6"], + partySize: 6, + origin: "online", + channel: "web", + guestNote: "Needs space for a stroller", + tags: ["Stroller"], + contactName: "Soto", + }, + { + ...base, + id: "R-1053", + status: "confirmed", + startMin: at(21), + endMin: at(22, 30), + resourceIds: ["T4"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Ferrer", + }, + { + ...base, + id: "R-1054", + status: "confirmed", + startMin: at(21), + endMin: at(22, 30), + resourceIds: ["T5"], + partySize: 2, + origin: "assistant", + channel: "web", + tags: ["Gluten-free"], + contactName: "Lozano", + }, + { + ...base, + id: "R-1055", + status: "confirmed", + startMin: at(21, 15), + endMin: at(22, 45), + resourceIds: [], + partySize: 4, + origin: "staff", + channel: "phone", + guestNote: "Prefers a quiet corner", + tags: ["Quiet table"], + contactName: "Rey", + }, + { + ...base, + id: "R-1056", + status: "confirmed", + startMin: at(21, 15), + endMin: at(23), + resourceIds: ["T3"], + partySize: 4, + origin: "online", + channel: "web", + tags: [], + contactName: "Cabrera", + }, + { + ...base, + id: "R-1057", + status: "pending", + startMin: at(21, 30), + endMin: at(23), + resourceIds: ["S4"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Marín", + }, + { + ...base, + id: "R-1058", + status: "confirmed", + startMin: at(22), + endMin: at(23, 30), + resourceIds: ["T7"], + partySize: 3, + origin: "online", + channel: "web", + tags: [], + contactName: "Blanco", + }, + { + ...base, + id: "R-1059", + status: "awaiting_payment", + deposit: { amount: eur(20_000), status: "due" }, + startMin: at(22), + endMin: at(24), + resourceIds: [], + customerId: "C-calvo", + partySize: 8, + lines: [{ catalogItemId: "menu-tasting", qty: 8, durationMin: 120, unitPrice: eur(5200) }], + origin: "staff", + channel: "phone", + guestNote: "Asked for a set menu for the whole table", + tags: ["Company dinner"], + ext: { type: "event", occasion: "Company dinner" }, + }, + { + ...base, + id: "R-1060", + status: "confirmed", + startMin: at(22, 30), + endMin: at(24), + resourceIds: ["S2"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Lara", + }, + { + ...base, + id: "R-1061", + status: "completed", + startMin: at(19), + endMin: at(20, 15), + resourceIds: ["B2"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Navarro", + }, + { + ...base, + id: "R-1062", + status: "cancelled", + startMin: at(20), + endMin: at(21, 30), + resourceIds: [], + partySize: 2, + origin: "online", + channel: "web", + staffNote: "Cancelled by the guest this afternoon", + tags: [], + contactName: "Vidal", + }, + { + ...base, + id: "R-1063", + status: "no_show", + startMin: at(19, 45), + endMin: at(21, 15), + resourceIds: [], + partySize: 3, + origin: "staff", + channel: "phone", + tags: [], + contactName: "Herrera", + }, + { + ...base, + businessDay: "2026-11-02", + id: "R-1101", + status: "confirmed", + startMin: at(20), + endMin: at(21, 30), + resourceIds: ["S8"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Aranda", + }, + { + ...base, + businessDay: "2026-11-02", + id: "R-1102", + status: "confirmed", + startMin: at(21), + endMin: at(22, 30), + resourceIds: ["B3"], + partySize: 2, + origin: "online", + channel: "web", + tags: [], + contactName: "Pons", + }, +]; diff --git a/src/verticals/hospitality/seed/catalog.ts b/src/verticals/hospitality/seed/catalog.ts new file mode 100644 index 0000000..932efb8 --- /dev/null +++ b/src/verticals/hospitality/seed/catalog.ts @@ -0,0 +1,119 @@ +import type { CatalogItem } from "@/modules/catalog"; + +import { eur, text } from "./shared"; + +export const catalog: CatalogItem[] = [ + { + id: "dish-croquetas", + kind: "product", + name: text("Ham croquettes", "Croquetas de jamón", "Schinkenkroketten", "Croquettes au jambon"), + categoryId: "starters", + price: eur(1100), + status: "active", + media: [], + tags: [], + ext: { allergens: ["gluten", "milk", "eggs"] }, + }, + { + id: "dish-arroz", + kind: "product", + name: text("Seafood rice", "Arroz del señorito", "Reis mit Meeresfrüchten", "Riz aux fruits de mer"), + categoryId: "mains", + price: eur(2400), + status: "active", + media: [], + tags: ["Signature"], + ext: { allergens: ["crustaceans", "molluscs", "fish"], pairing: "Albariño" }, + }, + { + id: "dish-flan", + kind: "product", + name: text("House flan", "Flan de la casa", "Flan des Hauses", "Flan maison"), + categoryId: "desserts", + price: eur(750), + status: "active", + media: [], + tags: [], + ext: { allergens: ["milk", "eggs"] }, + }, + { + id: "dish-of-the-day", + kind: "product", + name: text("Catch of the day", "Pescado del día", "Fisch des Tages", "Poisson du jour"), + categoryId: "mains", + price: eur(2600), + status: "active", + media: [], + tags: ["Daily"], + ext: { allergens: ["fish"], dishOfTheDay: true }, + }, + { + id: "menu-tasting", + kind: "bundle", + name: text("Tasting menu", "Menú degustación", "Degustationsmenü", "Menu dégustation"), + categoryId: "menus", + price: eur(5200), + durationMin: 120, + status: "active", + media: [], + tags: ["Whole table"], + sections: [ + { id: "course-1", name: text("Starter", "Entrante", "Vorspeise", "Entrée"), itemIds: ["dish-croquetas"] }, + { + id: "course-2", + name: text("Main", "Principal", "Hauptgang", "Plat"), + itemIds: ["dish-arroz", "dish-of-the-day"], + }, + { id: "course-3", name: text("Dessert", "Postre", "Nachspeise", "Dessert"), itemIds: ["dish-flan"] }, + ], + ext: { allergens: ["gluten", "milk", "eggs", "crustaceans", "molluscs", "fish"] }, + }, + { + id: "shop-olive-oil", + kind: "product", + name: text( + "House olive oil, 500 ml", + "Aceite de oliva de la casa, 500 ml", + "Olivenöl des Hauses, 500 ml", + "Huile d'olive maison, 500 ml", + ), + categoryId: "shop", + price: eur(1400), + status: "active", + media: [], + tags: [], + ext: { allergens: [] }, + }, + { + id: "shop-red-wine", + kind: "product", + name: text( + "House red wine, bottle", + "Vino tinto de la casa, botella", + "Rotwein des Hauses, Flasche", + "Vin rouge maison, bouteille", + ), + categoryId: "shop", + price: eur(1800), + status: "active", + media: [], + tags: [], + ext: { allergens: ["sulphites"] }, + }, + { + id: "shop-paprika", + kind: "product", + name: text( + "Smoked paprika, tin", + "Pimentón de la Vera, lata", + "Geräuchertes Paprikapulver, Dose", + "Paprika fumé, boîte", + ), + categoryId: "shop", + price: eur(650), + status: "active", + media: [], + tags: [], + ext: { allergens: [] }, + }, +]; diff --git a/src/verticals/hospitality/seed/customers.ts b/src/verticals/hospitality/seed/customers.ts new file mode 100644 index 0000000..9d09a67 --- /dev/null +++ b/src/verticals/hospitality/seed/customers.ts @@ -0,0 +1,75 @@ +import type { Customer } from "@/modules/customers"; + +import { eur } from "./shared"; + +const customerFigures = (visits: number, averageSpend: number, lastVisit: string, noShows = 0) => ({ + visits, + spend: eur(visits * averageSpend * 100), + lastVisit: `${lastVisit}T00:00:00Z`, + noShows, +}); + +export const customers: Customer[] = [ + { + id: "C-iglesias", + name: "Iglesias", + phone: "+34600000101", + locale: "es", + consent: { marketing: true }, + tags: ["Regular"], + vip: false, + blocked: false, + notes: [], + figures: customerFigures(14, 58, "2026-10-17"), + ext: { allergens: [], dietaryRestrictions: [] }, + }, + { + id: "C-ortega", + name: "Ortega", + phone: "+34600000102", + email: "ortega@example.com", + locale: "es", + consent: { marketing: false }, + tags: [], + vip: false, + blocked: false, + notes: [ + { + id: "note-ortega-1", + text: "One guest is coeliac", + authorId: "demo-owner", + authorName: "Alex Morgan", + day: "2026-09-30", + minute: 21 * 60, + }, + ], + figures: customerFigures(6, 52, "2026-09-30"), + ext: { allergens: ["gluten"], dietaryRestrictions: ["Gluten-free"] }, + }, + { + id: "C-bravo", + name: "Bravo", + phone: "+34600000103", + locale: "es", + consent: { marketing: true }, + tags: ["Regular"], + vip: true, + blocked: false, + notes: [], + figures: customerFigures(8, 61, "2026-10-24"), + ext: { allergens: ["milk"], dietaryRestrictions: ["Lactose-free"] }, + }, + { + id: "C-calvo", + name: "Calvo", + email: "calvo@example.com", + locale: "es", + consent: { marketing: false }, + tags: ["Company"], + vip: false, + blocked: false, + notes: [], + figures: { visits: 1, spend: null, lastVisit: null, noShows: 0 }, + ext: { allergens: ["nuts"], dietaryRestrictions: [] }, + }, +]; diff --git a/src/verticals/hospitality/seed/index.ts b/src/verticals/hospitality/seed/index.ts new file mode 100644 index 0000000..18734a1 --- /dev/null +++ b/src/verticals/hospitality/seed/index.ts @@ -0,0 +1,26 @@ +/** + * Hospitality mock data in the generic contracts: the bookings screen reads this day through the data seam. Times are + * minutes from midnight; "now" is 20:40. Guests that are not customers are named by `contactName`. + */ +import { bookings } from "./bookings"; +import { catalog } from "./catalog"; +import { customers } from "./customers"; +import { purchaseOrders, stockItems } from "./inventory"; +import { parties } from "./parties"; +import { areas, resources } from "./resources"; +import { shifts, staff } from "./staff"; + +export { BUSINESS_DAY } from "./shared"; + +export const hospitalitySeed = { + areas, + resources, + customers, + parties, + catalog, + stockItems, + purchaseOrders, + staff, + shifts, + bookings, +} as const; diff --git a/src/verticals/hospitality/seed/inventory.ts b/src/verticals/hospitality/seed/inventory.ts new file mode 100644 index 0000000..5d0a420 --- /dev/null +++ b/src/verticals/hospitality/seed/inventory.ts @@ -0,0 +1,64 @@ +import type { PurchaseOrder, StockItem } from "@/modules/inventory"; + +import { eur, text } from "./shared"; + +/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ +export const stockItems: StockItem[] = [ + { + id: "stock-olive-oil", + name: text("Olive oil, 500 ml", "Aceite de oliva, 500 ml", "Olivenöl, 500 ml", "Huile d’olive, 500 ml"), + sku: "OO-500", + catalogItemId: "shop-olive-oil", + unit: "bottle", + onHand: 18, + reorderPoint: 8, + supplierId: "food-distributor", + }, + { + id: "stock-red-wine", + name: text("Red wine, 75 cl", "Vino tinto, 75 cl", "Rotwein, 75 cl", "Vin rouge, 75 cl"), + sku: "RW-075", + catalogItemId: "shop-red-wine", + unit: "bottle", + onHand: 30, + reorderPoint: 24, + supplierId: "winery", + }, + { + id: "stock-paprika", + name: text( + "Smoked paprika, 75 g", + "Pimentón ahumado, 75 g", + "Geräuchertes Paprikapulver, 75 g", + "Paprika fumé, 75 g", + ), + sku: "PP-075", + catalogItemId: "shop-paprika", + unit: "tin", + onHand: 4, + reorderPoint: 10, + supplierId: "food-distributor", + }, +]; + +export const purchaseOrders: PurchaseOrder[] = [ + { + id: "PO-H-1", + supplierId: "food-distributor", + status: "sent", + lines: [ + { stockItemId: "stock-paprika", qty: 24, unitCost: eur(320) }, + { stockItemId: "stock-olive-oil", qty: 12, unitCost: eur(640) }, + ], + orderedOn: "2026-10-30", + expectedOn: "2026-11-03", + }, + { + id: "PO-H-2", + supplierId: "winery", + status: "received", + lines: [{ stockItemId: "stock-red-wine", qty: 48, unitCost: eur(540) }], + orderedOn: "2026-10-20", + expectedOn: "2026-10-25", + }, +]; diff --git a/src/verticals/hospitality/seed/parties.ts b/src/verticals/hospitality/seed/parties.ts new file mode 100644 index 0000000..ccb5441 --- /dev/null +++ b/src/verticals/hospitality/seed/parties.ts @@ -0,0 +1,57 @@ +import type { Party } from "@/modules/parties"; + +/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ +export const parties: Party[] = [ + { + id: "servicios-levante", + kind: "company", + legalName: "Servicios Corporativos Levante S.L.", + taxId: "B00000201", + addressLines: ["Calle del Comercio 12", "46002 Valencia", "Spain"], + countryCode: "ES", + email: "facturas@servicios-levante.example", + roles: ["client"], + }, + { + id: "mediterranea-eventos", + kind: "company", + legalName: "Mediterránea de Eventos S.A.", + taxId: "A00000202", + addressLines: ["Avenida del Puerto 45", "03001 Alicante", "Spain"], + countryCode: "ES", + email: "administracion@mediterranea-eventos.example", + roles: ["client"], + }, + { + id: "laura-gomez", + kind: "person", + legalName: "Laura Gómez Ruiz", + taxId: "00000203Z", + addressLines: ["Calle Mayor 3", "30001 Murcia", "Spain"], + countryCode: "ES", + email: "laura.gomez@correo.example", + roles: ["client"], + }, + { + id: "food-distributor", + kind: "company", + legalName: "Distribuciones Alimentarias del Mediterráneo S.L.", + tradeName: "Alimentarias del Mediterráneo", + taxId: "B00000204", + addressLines: ["Polígono Industrial Norte 8", "46930 Quart de Poblet", "Spain"], + countryCode: "ES", + email: "pedidos@alimentarias-mediterraneo.example", + roles: ["supplier"], + }, + { + id: "winery", + kind: "company", + legalName: "Bodegas Sierra Alta S.L.", + tradeName: "Bodegas Sierra Alta", + taxId: "B00000205", + addressLines: ["Camino de la Viña 2", "46340 Requena", "Spain"], + countryCode: "ES", + email: "ventas@bodegas-sierra-alta.example", + roles: ["supplier"], + }, +]; diff --git a/src/verticals/hospitality/seed/resources.ts b/src/verticals/hospitality/seed/resources.ts new file mode 100644 index 0000000..26f2013 --- /dev/null +++ b/src/verticals/hospitality/seed/resources.ts @@ -0,0 +1,40 @@ +import type { Area, Resource } from "@/modules/resources"; + +export const areas: Area[] = [ + { id: "dining", label: "Dining room", levelId: "street", ext: { outdoor: false } }, + { id: "bar", label: "Bar", levelId: "street", ext: { outdoor: false } }, + { id: "terrace", label: "Terrace", levelId: "rooftop", ext: { outdoor: true } }, +]; + +export const table = (id: string, areaId: string, shape: "rect" | "square" | "round", capacity: number): Resource => ({ + id, + kind: "table", + label: id, + areaId, + capacity, + active: true, + ext: { shape }, +}); + +export const resources: Resource[] = [ + table("S1", "dining", "rect", 4), + table("S2", "dining", "square", 2), + table("S3", "dining", "rect", 4), + table("S4", "dining", "square", 2), + table("S5", "dining", "round", 4), + table("S6", "dining", "rect", 6), + table("S7", "dining", "rect", 4), + table("S8", "dining", "round", 2), + table("B1", "bar", "round", 2), + table("B2", "bar", "round", 2), + table("B3", "bar", "round", 2), + table("B4", "bar", "round", 2), + table("T1", "terrace", "square", 2), + table("T2", "terrace", "square", 2), + table("T3", "terrace", "rect", 4), + table("T4", "terrace", "square", 2), + table("T5", "terrace", "rect", 4), + table("T6", "terrace", "rect", 4), + table("T7", "terrace", "round", 3), + table("T8", "terrace", "square", 2), +]; diff --git a/src/verticals/hospitality/seed/shared.ts b/src/verticals/hospitality/seed/shared.ts new file mode 100644 index 0000000..f63637b --- /dev/null +++ b/src/verticals/hospitality/seed/shared.ts @@ -0,0 +1,9 @@ +export const BUSINESS_DAY = "2026-10-31"; +const EUR = "EUR"; +export const at = (hours: number, minutes = 0) => hours * 60 + minutes; +export const eur = (amountMinor: number) => ({ amountMinor, currency: EUR }); + +export const text = (en: string, es: string, de: string, fr: string) => ({ + source: en, + translations: { en, es, de, fr }, +}); diff --git a/src/verticals/hospitality/seed/staff.ts b/src/verticals/hospitality/seed/staff.ts new file mode 100644 index 0000000..44d5052 --- /dev/null +++ b/src/verticals/hospitality/seed/staff.ts @@ -0,0 +1,40 @@ +import type { Shift, StaffMember } from "@/modules/staff"; + +import { at, BUSINESS_DAY } from "./shared"; + +export const staff: StaffMember[] = [ + { + id: "staff-marta", + name: "Marta", + roleIds: ["manager"], + status: "active", + locationIds: ["venue"], + skills: ["host", "sommelier"], + contract: { type: "full_time", startDate: "2022-03-01", hoursPerWeek: 40 }, + ext: { crew: "floor" }, + }, + { + id: "staff-iker", + name: "Iker", + roleIds: ["staff"], + status: "active", + locationIds: ["venue"], + skills: ["waiter"], + ext: { crew: "floor" }, + }, + { + id: "staff-lucia", + name: "Lucía", + roleIds: ["staff"], + status: "active", + locationIds: ["venue"], + skills: ["grill", "pastry"], + ext: { crew: "kitchen" }, + }, +]; + +export const shifts: Shift[] = [ + { id: "shift-marta", staffId: "staff-marta", businessDay: BUSINESS_DAY, startMin: at(17), endMin: at(24) }, + { id: "shift-iker", staffId: "staff-iker", businessDay: BUSINESS_DAY, startMin: at(18, 30), endMin: at(24) }, + { id: "shift-lucia", staffId: "staff-lucia", businessDay: BUSINESS_DAY, startMin: at(17, 30), endMin: at(23, 30) }, +]; diff --git a/src/verticals/salon/seed.ts b/src/verticals/salon/seed.ts deleted file mode 100644 index 06a911b..0000000 --- a/src/verticals/salon/seed.ts +++ /dev/null @@ -1,345 +0,0 @@ -import type { BookingInput } from "@/modules/bookings"; -import type { CatalogItem } from "@/modules/catalog"; -import type { Customer } from "@/modules/customers"; -import type { PurchaseOrder, StockItem } from "@/modules/inventory"; -import type { Party } from "@/modules/parties"; -import type { Area, Resource } from "@/modules/resources"; -import type { Shift, StaffMember } from "@/modules/staff"; - -/** Salon mock data in the generic contracts: stylist = staffIds, chair = resourceIds, services = lines. */ - -export const BUSINESS_DAY = "2026-10-31"; -const at = (hours: number, minutes = 0) => hours * 60 + minutes; -const eur = (amountMinor: number) => ({ amountMinor, currency: "EUR" }); -const text = (en: string, es: string, de: string, fr: string) => ({ source: en, translations: { en, es, de, fr } }); - -export const areas: Area[] = [{ id: "floor", label: "Salon floor" }]; - -const chair = (id: string): Resource => ({ id, kind: "chair", label: id, areaId: "floor", active: true }); - -export const resources: Resource[] = [chair("chair-1"), chair("chair-2"), chair("chair-3")]; - -export const catalog: CatalogItem[] = [ - { - id: "svc-cut", - kind: "service", - name: text("Cut and finish", "Corte y peinado", "Schnitt und Styling", "Coupe et coiffage"), - categoryId: "hair", - price: eur(3800), - durationMin: 45, - status: "active", - media: [], - tags: [], - ext: { requiredSkill: "cut", commissionBp: 4000 }, - }, - { - id: "svc-colour", - kind: "service", - name: text("Full colour", "Tinte completo", "Komplettfärbung", "Coloration complète"), - categoryId: "hair", - price: eur(6500), - durationMin: 75, - status: "active", - media: [], - tags: [], - ext: { requiredSkill: "colour", commissionBp: 3500 }, - }, - { - id: "svc-treatment", - kind: "service", - name: text("Deep treatment", "Tratamiento intensivo", "Intensivkur", "Soin intensif"), - categoryId: "care", - price: eur(2200), - durationMin: 20, - status: "active", - media: [], - tags: [], - ext: { requiredSkill: "colour", commissionBp: 3000 }, - }, - { - id: "retail-shampoo", - kind: "product", - name: text( - "Repair shampoo, 250 ml", - "Champú reparador, 250 ml", - "Reparatur-Shampoo, 250 ml", - "Shampooing réparateur, 250 ml", - ), - categoryId: "shop", - price: eur(1600), - status: "active", - media: [], - tags: [], - ext: { commissionBp: 1000 }, - }, - { - id: "retail-conditioner", - kind: "product", - name: text( - "Hydrating conditioner, 250 ml", - "Acondicionador hidratante, 250 ml", - "Feuchtigkeitsspülung, 250 ml", - "Après-shampooing hydratant, 250 ml", - ), - categoryId: "shop", - price: eur(1700), - status: "active", - media: [], - tags: [], - ext: { commissionBp: 1000 }, - }, - { - id: "retail-wax", - kind: "product", - name: text("Styling wax, 75 ml", "Cera de peinado, 75 ml", "Stylingwachs, 75 ml", "Cire coiffante, 75 ml"), - categoryId: "shop", - price: eur(1200), - status: "active", - media: [], - tags: [], - ext: { commissionBp: 1000 }, - }, -]; - -export const staff: StaffMember[] = [ - { - id: "stylist-ines", - name: "Inés", - roleIds: ["staff"], - status: "active", - locationIds: ["salon"], - skills: ["cut", "colour"], - contract: { type: "employee", startDate: "2021-09-01" }, - ext: { commissionBp: 4000 }, - }, - { - id: "stylist-pau", - name: "Pau", - roleIds: ["staff"], - status: "active", - locationIds: ["salon"], - skills: ["cut"], - ext: { commissionBp: 3500 }, - }, -]; - -export const shifts: Shift[] = [ - { id: "shift-ines", staffId: "stylist-ines", businessDay: BUSINESS_DAY, startMin: at(9), endMin: at(17) }, - { id: "shift-pau", staffId: "stylist-pau", businessDay: BUSINESS_DAY, startMin: at(10), endMin: at(18) }, -]; - -export const customers: Customer[] = [ - { - id: "client-nora", - name: "Nora", - phone: "+34600000201", - consent: { marketing: true }, - tags: [], - vip: true, - blocked: false, - notes: [], - figures: { visits: 12, spend: eur(52_000), lastVisit: "2026-09-26T00:00:00Z", noShows: 0 }, - ext: { colourFormula: "6.3 + 7.1, 1:1.5, 35 min" }, - }, - { - id: "client-leo", - name: "Leo", - email: "leo@example.com", - consent: { marketing: false }, - tags: [], - vip: false, - blocked: false, - notes: [], - figures: { visits: 2, spend: eur(7600), lastVisit: "2026-08-14T00:00:00Z", noShows: 1 }, - ext: {}, - }, -]; - -const base = { businessDay: BUSINESS_DAY, tags: [] }; - -export const bookings: BookingInput[] = [ - { - ...base, - id: "A-201", - status: "confirmed", - startMin: at(10), - endMin: at(12), - resourceIds: ["chair-1"], - staffIds: ["stylist-ines"], - customerId: "client-nora", - lines: [ - { catalogItemId: "svc-colour", qty: 1, durationMin: 75, unitPrice: eur(6500) }, - { catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }, - ], - origin: "staff", - channel: "phone", - }, - { - ...base, - id: "A-202", - status: "awaiting_payment", - deposit: { amount: eur(1000), status: "due" }, - startMin: at(11), - endMin: at(11, 45), - resourceIds: ["chair-2"], - staffIds: ["stylist-pau"], - customerId: "client-leo", - lines: [{ catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }], - origin: "online", - channel: "instagram", - guestNote: "Wants a shorter fade", - }, - { - ...base, - id: "A-203", - status: "in_progress", - startMin: at(12), - endMin: at(12, 20), - resourceIds: ["chair-3"], - staffIds: ["stylist-ines"], - lines: [{ catalogItemId: "svc-treatment", qty: 1, durationMin: 20, unitPrice: eur(2200) }], - origin: "walk_in", - }, - { - ...base, - id: "A-204", - status: "confirmed", - startMin: at(14), - endMin: at(14, 45), - resourceIds: ["chair-2"], - staffIds: ["stylist-pau"], - contactName: "Elena", - lines: [{ catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }], - origin: "staff", - channel: "phone", - }, -]; - -/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ -export const parties: Party[] = [ - { - id: "hotel-spa", - kind: "company", - legalName: "Hotel Balneario Costa Azul S.L.", - tradeName: "Spa Costa Azul", - taxId: "B00000206", - addressLines: ["Paseo Marítimo 20", "03503 Benidorm", "Spain"], - countryCode: "ES", - email: "administracion@balneario-costa-azul.example", - roles: ["client"], - }, - { - id: "photo-studio", - kind: "company", - legalName: "Estudio Fotográfico Luz Norte S.L.", - tradeName: "Luz Norte", - taxId: "B00000207", - addressLines: ["Calle de la Luz 7", "03002 Alicante", "Spain"], - countryCode: "ES", - email: "facturas@luz-norte.example", - roles: ["client"], - }, - { - id: "cosmetics-distributor", - kind: "company", - legalName: "Distribuciones Cosméticas Profesionales S.L.", - tradeName: "Cosméticas Profesionales", - taxId: "B00000208", - addressLines: ["Calle del Taller 15", "28045 Madrid", "Spain"], - countryCode: "ES", - email: "pedidos@cosmeticas-profesionales.example", - roles: ["supplier"], - }, -]; - -/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ -export const stockItems: StockItem[] = [ - { - id: "stock-shampoo", - name: text( - "Repair shampoo, 250 ml", - "Champú reparador, 250 ml", - "Reparaturshampoo, 250 ml", - "Shampooing réparateur, 250 ml", - ), - sku: "SH-250", - catalogItemId: "retail-shampoo", - unit: "bottle", - onHand: 12, - reorderPoint: 6, - supplierId: "cosmetics-distributor", - }, - { - id: "stock-conditioner", - name: text("Conditioner, 250 ml", "Acondicionador, 250 ml", "Spülung, 250 ml", "Après-shampooing, 250 ml"), - sku: "CO-250", - catalogItemId: "retail-conditioner", - unit: "bottle", - onHand: 9, - reorderPoint: 6, - supplierId: "cosmetics-distributor", - }, - { - id: "stock-wax", - name: text("Styling wax, 75 ml", "Cera de peinado, 75 ml", "Stylingwachs, 75 ml", "Cire coiffante, 75 ml"), - sku: "WX-075", - catalogItemId: "retail-wax", - unit: "jar", - onHand: 3, - reorderPoint: 5, - supplierId: "cosmetics-distributor", - }, - { - id: "stock-dye", - name: text("Hair dye, 60 ml tube", "Tinte capilar, tubo 60 ml", "Haarfarbe, 60-ml-Tube", "Coloration, tube 60 ml"), - sku: "DY-060", - unit: "tube", - onHand: 24, - reorderPoint: 10, - supplierId: "cosmetics-distributor", - }, - { - id: "stock-developer", - name: text("Developer, 1 litre", "Oxidante, 1 litro", "Entwickler, 1 Liter", "Oxydant, 1 litre"), - sku: "DV-1000", - unit: "litre", - onHand: 5, - reorderPoint: 4, - supplierId: "cosmetics-distributor", - }, -]; - -export const purchaseOrders: PurchaseOrder[] = [ - { - id: "PO-S-1", - supplierId: "cosmetics-distributor", - status: "sent", - lines: [ - { stockItemId: "stock-wax", qty: 6, unitCost: eur(780) }, - { stockItemId: "stock-dye", qty: 12, unitCost: eur(420) }, - ], - orderedOn: "2026-10-28", - expectedOn: "2026-11-04", - }, - { - id: "PO-S-2", - supplierId: "cosmetics-distributor", - status: "received", - lines: [{ stockItemId: "stock-developer", qty: 6, unitCost: eur(690) }], - orderedOn: "2026-10-14", - expectedOn: "2026-10-18", - }, -]; - -export const salonSeed = { - areas, - resources, - customers, - parties, - catalog, - stockItems, - purchaseOrders, - staff, - shifts, - bookings, -} as const; diff --git a/src/verticals/salon/seed/bookings.ts b/src/verticals/salon/seed/bookings.ts new file mode 100644 index 0000000..7ea37c2 --- /dev/null +++ b/src/verticals/salon/seed/bookings.ts @@ -0,0 +1,63 @@ +import type { BookingInput } from "@/modules/bookings"; + +import { at, BUSINESS_DAY, eur } from "./shared"; + +const base = { businessDay: BUSINESS_DAY, tags: [] }; + +export const bookings: BookingInput[] = [ + { + ...base, + id: "A-201", + status: "confirmed", + startMin: at(10), + endMin: at(12), + resourceIds: ["chair-1"], + staffIds: ["stylist-ines"], + customerId: "client-nora", + lines: [ + { catalogItemId: "svc-colour", qty: 1, durationMin: 75, unitPrice: eur(6500) }, + { catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }, + ], + origin: "staff", + channel: "phone", + }, + { + ...base, + id: "A-202", + status: "awaiting_payment", + deposit: { amount: eur(1000), status: "due" }, + startMin: at(11), + endMin: at(11, 45), + resourceIds: ["chair-2"], + staffIds: ["stylist-pau"], + customerId: "client-leo", + lines: [{ catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }], + origin: "online", + channel: "instagram", + guestNote: "Wants a shorter fade", + }, + { + ...base, + id: "A-203", + status: "in_progress", + startMin: at(12), + endMin: at(12, 20), + resourceIds: ["chair-3"], + staffIds: ["stylist-ines"], + lines: [{ catalogItemId: "svc-treatment", qty: 1, durationMin: 20, unitPrice: eur(2200) }], + origin: "walk_in", + }, + { + ...base, + id: "A-204", + status: "confirmed", + startMin: at(14), + endMin: at(14, 45), + resourceIds: ["chair-2"], + staffIds: ["stylist-pau"], + contactName: "Elena", + lines: [{ catalogItemId: "svc-cut", qty: 1, durationMin: 45, unitPrice: eur(3800) }], + origin: "staff", + channel: "phone", + }, +]; diff --git a/src/verticals/salon/seed/catalog.ts b/src/verticals/salon/seed/catalog.ts new file mode 100644 index 0000000..6ef6067 --- /dev/null +++ b/src/verticals/salon/seed/catalog.ts @@ -0,0 +1,85 @@ +import type { CatalogItem } from "@/modules/catalog"; + +import { eur, text } from "./shared"; + +export const catalog: CatalogItem[] = [ + { + id: "svc-cut", + kind: "service", + name: text("Cut and finish", "Corte y peinado", "Schnitt und Styling", "Coupe et coiffage"), + categoryId: "hair", + price: eur(3800), + durationMin: 45, + status: "active", + media: [], + tags: [], + ext: { requiredSkill: "cut", commissionBp: 4000 }, + }, + { + id: "svc-colour", + kind: "service", + name: text("Full colour", "Tinte completo", "Komplettfärbung", "Coloration complète"), + categoryId: "hair", + price: eur(6500), + durationMin: 75, + status: "active", + media: [], + tags: [], + ext: { requiredSkill: "colour", commissionBp: 3500 }, + }, + { + id: "svc-treatment", + kind: "service", + name: text("Deep treatment", "Tratamiento intensivo", "Intensivkur", "Soin intensif"), + categoryId: "care", + price: eur(2200), + durationMin: 20, + status: "active", + media: [], + tags: [], + ext: { requiredSkill: "colour", commissionBp: 3000 }, + }, + { + id: "retail-shampoo", + kind: "product", + name: text( + "Repair shampoo, 250 ml", + "Champú reparador, 250 ml", + "Reparatur-Shampoo, 250 ml", + "Shampooing réparateur, 250 ml", + ), + categoryId: "shop", + price: eur(1600), + status: "active", + media: [], + tags: [], + ext: { commissionBp: 1000 }, + }, + { + id: "retail-conditioner", + kind: "product", + name: text( + "Hydrating conditioner, 250 ml", + "Acondicionador hidratante, 250 ml", + "Feuchtigkeitsspülung, 250 ml", + "Après-shampooing hydratant, 250 ml", + ), + categoryId: "shop", + price: eur(1700), + status: "active", + media: [], + tags: [], + ext: { commissionBp: 1000 }, + }, + { + id: "retail-wax", + kind: "product", + name: text("Styling wax, 75 ml", "Cera de peinado, 75 ml", "Stylingwachs, 75 ml", "Cire coiffante, 75 ml"), + categoryId: "shop", + price: eur(1200), + status: "active", + media: [], + tags: [], + ext: { commissionBp: 1000 }, + }, +]; diff --git a/src/verticals/salon/seed/customers.ts b/src/verticals/salon/seed/customers.ts new file mode 100644 index 0000000..493cf7c --- /dev/null +++ b/src/verticals/salon/seed/customers.ts @@ -0,0 +1,30 @@ +import type { Customer } from "@/modules/customers"; + +import { eur } from "./shared"; + +export const customers: Customer[] = [ + { + id: "client-nora", + name: "Nora", + phone: "+34600000201", + consent: { marketing: true }, + tags: [], + vip: true, + blocked: false, + notes: [], + figures: { visits: 12, spend: eur(52_000), lastVisit: "2026-09-26T00:00:00Z", noShows: 0 }, + ext: { colourFormula: "6.3 + 7.1, 1:1.5, 35 min" }, + }, + { + id: "client-leo", + name: "Leo", + email: "leo@example.com", + consent: { marketing: false }, + tags: [], + vip: false, + blocked: false, + notes: [], + figures: { visits: 2, spend: eur(7600), lastVisit: "2026-08-14T00:00:00Z", noShows: 1 }, + ext: {}, + }, +]; diff --git a/src/verticals/salon/seed/index.ts b/src/verticals/salon/seed/index.ts new file mode 100644 index 0000000..8a629d0 --- /dev/null +++ b/src/verticals/salon/seed/index.ts @@ -0,0 +1,23 @@ +/** Salon mock data in the generic contracts: stylist = staffIds, chair = resourceIds, services = lines. */ +import { bookings } from "./bookings"; +import { catalog } from "./catalog"; +import { customers } from "./customers"; +import { purchaseOrders, stockItems } from "./inventory"; +import { parties } from "./parties"; +import { areas, resources } from "./resources"; +import { shifts, staff } from "./staff"; + +export { BUSINESS_DAY } from "./shared"; + +export const salonSeed = { + areas, + resources, + customers, + parties, + catalog, + stockItems, + purchaseOrders, + staff, + shifts, + bookings, +} as const; diff --git a/src/verticals/salon/seed/inventory.ts b/src/verticals/salon/seed/inventory.ts new file mode 100644 index 0000000..efac8cd --- /dev/null +++ b/src/verticals/salon/seed/inventory.ts @@ -0,0 +1,82 @@ +import type { PurchaseOrder, StockItem } from "@/modules/inventory"; + +import { eur, text } from "./shared"; + +/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ +export const stockItems: StockItem[] = [ + { + id: "stock-shampoo", + name: text( + "Repair shampoo, 250 ml", + "Champú reparador, 250 ml", + "Reparaturshampoo, 250 ml", + "Shampooing réparateur, 250 ml", + ), + sku: "SH-250", + catalogItemId: "retail-shampoo", + unit: "bottle", + onHand: 12, + reorderPoint: 6, + supplierId: "cosmetics-distributor", + }, + { + id: "stock-conditioner", + name: text("Conditioner, 250 ml", "Acondicionador, 250 ml", "Spülung, 250 ml", "Après-shampooing, 250 ml"), + sku: "CO-250", + catalogItemId: "retail-conditioner", + unit: "bottle", + onHand: 9, + reorderPoint: 6, + supplierId: "cosmetics-distributor", + }, + { + id: "stock-wax", + name: text("Styling wax, 75 ml", "Cera de peinado, 75 ml", "Stylingwachs, 75 ml", "Cire coiffante, 75 ml"), + sku: "WX-075", + catalogItemId: "retail-wax", + unit: "jar", + onHand: 3, + reorderPoint: 5, + supplierId: "cosmetics-distributor", + }, + { + id: "stock-dye", + name: text("Hair dye, 60 ml tube", "Tinte capilar, tubo 60 ml", "Haarfarbe, 60-ml-Tube", "Coloration, tube 60 ml"), + sku: "DY-060", + unit: "tube", + onHand: 24, + reorderPoint: 10, + supplierId: "cosmetics-distributor", + }, + { + id: "stock-developer", + name: text("Developer, 1 litre", "Oxidante, 1 litro", "Entwickler, 1 Liter", "Oxydant, 1 litre"), + sku: "DV-1000", + unit: "litre", + onHand: 5, + reorderPoint: 4, + supplierId: "cosmetics-distributor", + }, +]; + +export const purchaseOrders: PurchaseOrder[] = [ + { + id: "PO-S-1", + supplierId: "cosmetics-distributor", + status: "sent", + lines: [ + { stockItemId: "stock-wax", qty: 6, unitCost: eur(780) }, + { stockItemId: "stock-dye", qty: 12, unitCost: eur(420) }, + ], + orderedOn: "2026-10-28", + expectedOn: "2026-11-04", + }, + { + id: "PO-S-2", + supplierId: "cosmetics-distributor", + status: "received", + lines: [{ stockItemId: "stock-developer", qty: 6, unitCost: eur(690) }], + orderedOn: "2026-10-14", + expectedOn: "2026-10-18", + }, +]; diff --git a/src/verticals/salon/seed/parties.ts b/src/verticals/salon/seed/parties.ts new file mode 100644 index 0000000..489691e --- /dev/null +++ b/src/verticals/salon/seed/parties.ts @@ -0,0 +1,38 @@ +import type { Party } from "@/modules/parties"; + +/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ +export const parties: Party[] = [ + { + id: "hotel-spa", + kind: "company", + legalName: "Hotel Balneario Costa Azul S.L.", + tradeName: "Spa Costa Azul", + taxId: "B00000206", + addressLines: ["Paseo Marítimo 20", "03503 Benidorm", "Spain"], + countryCode: "ES", + email: "administracion@balneario-costa-azul.example", + roles: ["client"], + }, + { + id: "photo-studio", + kind: "company", + legalName: "Estudio Fotográfico Luz Norte S.L.", + tradeName: "Luz Norte", + taxId: "B00000207", + addressLines: ["Calle de la Luz 7", "03002 Alicante", "Spain"], + countryCode: "ES", + email: "facturas@luz-norte.example", + roles: ["client"], + }, + { + id: "cosmetics-distributor", + kind: "company", + legalName: "Distribuciones Cosméticas Profesionales S.L.", + tradeName: "Cosméticas Profesionales", + taxId: "B00000208", + addressLines: ["Calle del Taller 15", "28045 Madrid", "Spain"], + countryCode: "ES", + email: "pedidos@cosmeticas-profesionales.example", + roles: ["supplier"], + }, +]; diff --git a/src/verticals/salon/seed/resources.ts b/src/verticals/salon/seed/resources.ts new file mode 100644 index 0000000..6ff5fa1 --- /dev/null +++ b/src/verticals/salon/seed/resources.ts @@ -0,0 +1,7 @@ +import type { Area, Resource } from "@/modules/resources"; + +export const areas: Area[] = [{ id: "floor", label: "Salon floor" }]; + +export const chair = (id: string): Resource => ({ id, kind: "chair", label: id, areaId: "floor", active: true }); + +export const resources: Resource[] = [chair("chair-1"), chair("chair-2"), chair("chair-3")]; diff --git a/src/verticals/salon/seed/shared.ts b/src/verticals/salon/seed/shared.ts new file mode 100644 index 0000000..64c72a2 --- /dev/null +++ b/src/verticals/salon/seed/shared.ts @@ -0,0 +1,7 @@ +export const BUSINESS_DAY = "2026-10-31"; +export const at = (hours: number, minutes = 0) => hours * 60 + minutes; +export const eur = (amountMinor: number) => ({ amountMinor, currency: "EUR" }); +export const text = (en: string, es: string, de: string, fr: string) => ({ + source: en, + translations: { en, es, de, fr }, +}); diff --git a/src/verticals/salon/seed/staff.ts b/src/verticals/salon/seed/staff.ts new file mode 100644 index 0000000..47f6a6b --- /dev/null +++ b/src/verticals/salon/seed/staff.ts @@ -0,0 +1,30 @@ +import type { Shift, StaffMember } from "@/modules/staff"; + +import { at, BUSINESS_DAY } from "./shared"; + +export const staff: StaffMember[] = [ + { + id: "stylist-ines", + name: "Inés", + roleIds: ["staff"], + status: "active", + locationIds: ["salon"], + skills: ["cut", "colour"], + contract: { type: "employee", startDate: "2021-09-01" }, + ext: { commissionBp: 4000 }, + }, + { + id: "stylist-pau", + name: "Pau", + roleIds: ["staff"], + status: "active", + locationIds: ["salon"], + skills: ["cut"], + ext: { commissionBp: 3500 }, + }, +]; + +export const shifts: Shift[] = [ + { id: "shift-ines", staffId: "stylist-ines", businessDay: BUSINESS_DAY, startMin: at(9), endMin: at(17) }, + { id: "shift-pau", staffId: "stylist-pau", businessDay: BUSINESS_DAY, startMin: at(10), endMin: at(18) }, +]; diff --git a/src/verticals/workshop/seed.ts b/src/verticals/workshop/seed.ts deleted file mode 100644 index d25e2cb..0000000 --- a/src/verticals/workshop/seed.ts +++ /dev/null @@ -1,284 +0,0 @@ -import type { BookingInput } from "@/modules/bookings"; -import type { CatalogItem } from "@/modules/catalog"; -import type { Asset, Customer } from "@/modules/customers"; -import type { PurchaseOrder, StockItem } from "@/modules/inventory"; -import type { Party } from "@/modules/parties"; -import type { Area, Resource } from "@/modules/resources"; -import type { StaffMember } from "@/modules/staff"; - -/** Workshop seed sketch: a drop-off on a bay, a vehicle as a customer asset, parts and labour as catalog items. */ - -export const BUSINESS_DAY = "2026-10-31"; -const at = (hours: number, minutes = 0) => hours * 60 + minutes; -const eur = (amountMinor: number) => ({ amountMinor, currency: "EUR" }); -const text = (en: string, es: string, de: string, fr: string) => ({ source: en, translations: { en, es, de, fr } }); - -export const areas: Area[] = [{ id: "shop", label: "Shop floor" }]; - -export const resources: Resource[] = [{ id: "bay-1", kind: "bay", label: "Bay 1", areaId: "shop", active: true }]; - -export const customers: Customer[] = [ - { - id: "cust-carmen", - name: "Carmen", - phone: "+34600000301", - tags: [], - vip: false, - blocked: false, - notes: [], - figures: { visits: 3, spend: eur(41_000), lastVisit: "2026-04-02T00:00:00Z", noShows: 0 }, - }, -]; - -export const assets: Asset[] = [ - { - id: "veh-1", - customerId: "cust-carmen", - kind: "vehicle", - label: "Hatchback 2018", - ext: { plate: "0000-ABC", make: "Seat", model: "Ibiza", mileageKm: 84_500 }, - }, -]; - -export const catalog: CatalogItem[] = [ - { - id: "part-brake-pads", - kind: "product", - name: text("Front brake pads", "Pastillas de freno delanteras", "Bremsbeläge vorne", "Plaquettes de frein avant"), - categoryId: "parts", - price: eur(4900), - status: "active", - media: [], - tags: [], - }, - { - id: "labour-brakes", - kind: "service", - name: text("Brake service labour", "Mano de obra frenos", "Arbeit Bremsen", "Main-d'œuvre freins"), - categoryId: "labour", - price: eur(7200), - durationMin: 90, - status: "active", - media: [], - tags: [], - ext: { rateClass: "standard" }, - }, - { - id: "part-oil-filter", - kind: "product", - name: text("Oil filter", "Filtro de aceite", "Ölfilter", "Filtre à huile"), - categoryId: "parts", - price: eur(1200), - status: "active", - media: [], - tags: [], - }, - { - id: "part-air-filter", - kind: "product", - name: text("Air filter", "Filtro de aire", "Luftfilter", "Filtre à air"), - categoryId: "parts", - price: eur(1800), - status: "active", - media: [], - tags: [], - }, - { - id: "part-wiper-blades", - kind: "product", - name: text( - "Wiper blades, pair", - "Escobillas limpiaparabrisas, par", - "Scheibenwischerblätter, Paar", - "Balais d'essuie-glace, paire", - ), - categoryId: "parts", - price: eur(2200), - status: "active", - media: [], - tags: [], - }, -]; - -export const staff: StaffMember[] = [ - { - id: "mech-rafa", - name: "Rafa", - roleIds: ["staff"], - status: "active", - locationIds: ["branch"], - skills: ["brakes", "diagnostics"], - contract: { type: "employee", startDate: "2019-05-13", hoursPerWeek: 40 }, - ext: { certifications: ["EV safety"] }, - }, -]; - -export const bookings: BookingInput[] = [ - { - id: "W-301", - status: "confirmed", - businessDay: BUSINESS_DAY, - startMin: at(8), - endMin: at(9, 30), - resourceIds: ["bay-1"], - staffIds: ["mech-rafa"], - customerId: "cust-carmen", - lines: [ - { catalogItemId: "part-brake-pads", qty: 1, durationMin: 0, unitPrice: eur(4900) }, - { catalogItemId: "labour-brakes", qty: 1, durationMin: 90, unitPrice: eur(7200) }, - ], - origin: "staff", - channel: "phone", - guestNote: "Squeak when braking", - tags: [], - ext: { assetId: "veh-1" }, - }, -]; - -/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ -export const parties: Party[] = [ - { - id: "fleet-company", - kind: "company", - legalName: "Transportes Rápidos del Sur S.L.", - tradeName: "Rápidos del Sur", - taxId: "B00000209", - addressLines: ["Polígono Las Salinas 4", "30169 San Ginés", "Spain"], - countryCode: "ES", - email: "flota@rapidos-del-sur.example", - roles: ["client"], - }, - { - id: "insurer", - kind: "company", - legalName: "Aseguradora Mediterránea S.A.", - taxId: "A00000210", - addressLines: ["Avenida de la Constitución 30", "46009 Valencia", "Spain"], - countryCode: "ES", - email: "siniestros@aseguradora-mediterranea.example", - roles: ["client"], - }, - { - id: "distribuciones-levante", - kind: "company", - legalName: "Distribuciones Levante", - taxId: "B00000211", - addressLines: ["Calle del Recambio 9", "46013 Valencia", "Spain"], - countryCode: "ES", - email: "pedidos@distribuciones-levante.example", - roles: ["supplier"], - }, - { - id: "recambios-norte", - kind: "company", - legalName: "Recambios Norte", - taxId: "B00000212", - addressLines: ["Polígono Industrial Ebro 21", "50014 Zaragoza", "Spain"], - countryCode: "ES", - email: "ventas@recambios-norte.example", - roles: ["supplier"], - }, -]; - -/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ -/** A catalog item's name, so a stock item bought as the part it is sold as carries the same words. */ -const catalogName = (id: string) => { - const item = catalog.find((candidate) => candidate.id === id); - if (item === undefined) throw new Error(`No catalog item ${id}`); - return item.name; -}; - -export const stockItems: StockItem[] = [ - { - id: "stock-brake-pads", - name: catalogName("part-brake-pads"), - sku: "BP-F-118", - catalogItemId: "part-brake-pads", - unit: "set", - onHand: 6, - reorderPoint: 3, - supplierId: "distribuciones-levante", - }, - { - id: "stock-oil-filter", - name: catalogName("part-oil-filter"), - sku: "OF-204", - catalogItemId: "part-oil-filter", - unit: "unit", - onHand: 14, - reorderPoint: 5, - supplierId: "distribuciones-levante", - }, - { - id: "stock-air-filter", - name: catalogName("part-air-filter"), - sku: "AF-311", - catalogItemId: "part-air-filter", - unit: "unit", - onHand: 9, - reorderPoint: 4, - supplierId: "recambios-norte", - }, - { - id: "stock-wiper-blades", - name: catalogName("part-wiper-blades"), - sku: "WB-450", - catalogItemId: "part-wiper-blades", - unit: "pair", - onHand: 4, - reorderPoint: 6, - supplierId: "recambios-norte", - }, -]; - -export const purchaseOrders: PurchaseOrder[] = [ - { - id: "PO-W-1", - supplierId: "distribuciones-levante", - status: "received", - lines: [ - { stockItemId: "stock-brake-pads", qty: 4, unitCost: eur(2800) }, - { stockItemId: "stock-oil-filter", qty: 10, unitCost: eur(650) }, - ], - orderedOn: "2026-10-12", - expectedOn: "2026-10-16", - }, - { - id: "PO-W-2", - supplierId: "recambios-norte", - status: "sent", - lines: [ - { stockItemId: "stock-wiper-blades", qty: 8, unitCost: eur(1100) }, - { stockItemId: "stock-air-filter", qty: 6, unitCost: eur(900) }, - ], - orderedOn: "2026-10-29", - expectedOn: "2026-11-03", - }, - { - id: "PO-W-3", - supplierId: "distribuciones-levante", - status: "draft", - lines: [{ stockItemId: "stock-brake-pads", qty: 6, unitCost: eur(2800) }], - orderedOn: "2026-10-31", - }, - { - id: "PO-W-4", - supplierId: "recambios-norte", - status: "cancelled", - lines: [{ stockItemId: "stock-air-filter", qty: 12, unitCost: eur(950) }], - orderedOn: "2026-10-05", - }, -]; - -export const workshopSeed = { - areas, - resources, - customers, - assets, - parties, - catalog, - stockItems, - purchaseOrders, - staff, - bookings, -} as const; diff --git a/src/verticals/workshop/seed/bookings.ts b/src/verticals/workshop/seed/bookings.ts new file mode 100644 index 0000000..4a33500 --- /dev/null +++ b/src/verticals/workshop/seed/bookings.ts @@ -0,0 +1,25 @@ +import type { BookingInput } from "@/modules/bookings"; + +import { at, BUSINESS_DAY, eur } from "./shared"; + +export const bookings: BookingInput[] = [ + { + id: "W-301", + status: "confirmed", + businessDay: BUSINESS_DAY, + startMin: at(8), + endMin: at(9, 30), + resourceIds: ["bay-1"], + staffIds: ["mech-rafa"], + customerId: "cust-carmen", + lines: [ + { catalogItemId: "part-brake-pads", qty: 1, durationMin: 0, unitPrice: eur(4900) }, + { catalogItemId: "labour-brakes", qty: 1, durationMin: 90, unitPrice: eur(7200) }, + ], + origin: "staff", + channel: "phone", + guestNote: "Squeak when braking", + tags: [], + ext: { assetId: "veh-1" }, + }, +]; diff --git a/src/verticals/workshop/seed/catalog.ts b/src/verticals/workshop/seed/catalog.ts new file mode 100644 index 0000000..db3e63d --- /dev/null +++ b/src/verticals/workshop/seed/catalog.ts @@ -0,0 +1,63 @@ +import type { CatalogItem } from "@/modules/catalog"; + +import { eur, text } from "./shared"; + +export const catalog: CatalogItem[] = [ + { + id: "part-brake-pads", + kind: "product", + name: text("Front brake pads", "Pastillas de freno delanteras", "Bremsbeläge vorne", "Plaquettes de frein avant"), + categoryId: "parts", + price: eur(4900), + status: "active", + media: [], + tags: [], + }, + { + id: "labour-brakes", + kind: "service", + name: text("Brake service labour", "Mano de obra frenos", "Arbeit Bremsen", "Main-d'œuvre freins"), + categoryId: "labour", + price: eur(7200), + durationMin: 90, + status: "active", + media: [], + tags: [], + ext: { rateClass: "standard" }, + }, + { + id: "part-oil-filter", + kind: "product", + name: text("Oil filter", "Filtro de aceite", "Ölfilter", "Filtre à huile"), + categoryId: "parts", + price: eur(1200), + status: "active", + media: [], + tags: [], + }, + { + id: "part-air-filter", + kind: "product", + name: text("Air filter", "Filtro de aire", "Luftfilter", "Filtre à air"), + categoryId: "parts", + price: eur(1800), + status: "active", + media: [], + tags: [], + }, + { + id: "part-wiper-blades", + kind: "product", + name: text( + "Wiper blades, pair", + "Escobillas limpiaparabrisas, par", + "Scheibenwischerblätter, Paar", + "Balais d'essuie-glace, paire", + ), + categoryId: "parts", + price: eur(2200), + status: "active", + media: [], + tags: [], + }, +]; diff --git a/src/verticals/workshop/seed/customers.ts b/src/verticals/workshop/seed/customers.ts new file mode 100644 index 0000000..cda72ae --- /dev/null +++ b/src/verticals/workshop/seed/customers.ts @@ -0,0 +1,26 @@ +import type { Asset, Customer } from "@/modules/customers"; + +import { eur } from "./shared"; + +export const customers: Customer[] = [ + { + id: "cust-carmen", + name: "Carmen", + phone: "+34600000301", + tags: [], + vip: false, + blocked: false, + notes: [], + figures: { visits: 3, spend: eur(41_000), lastVisit: "2026-04-02T00:00:00Z", noShows: 0 }, + }, +]; + +export const assets: Asset[] = [ + { + id: "veh-1", + customerId: "cust-carmen", + kind: "vehicle", + label: "Hatchback 2018", + ext: { plate: "0000-ABC", make: "Seat", model: "Ibiza", mileageKm: 84_500 }, + }, +]; diff --git a/src/verticals/workshop/seed/index.ts b/src/verticals/workshop/seed/index.ts new file mode 100644 index 0000000..6b1ad02 --- /dev/null +++ b/src/verticals/workshop/seed/index.ts @@ -0,0 +1,23 @@ +/** Workshop seed sketch: a drop-off on a bay, a vehicle as a customer asset, parts and labour as catalog items. */ +import { bookings } from "./bookings"; +import { catalog } from "./catalog"; +import { assets, customers } from "./customers"; +import { purchaseOrders, stockItems } from "./inventory"; +import { parties } from "./parties"; +import { areas, resources } from "./resources"; +import { staff } from "./staff"; + +export { BUSINESS_DAY } from "./shared"; + +export const workshopSeed = { + areas, + resources, + customers, + assets, + parties, + catalog, + stockItems, + purchaseOrders, + staff, + bookings, +} as const; diff --git a/src/verticals/workshop/seed/inventory.ts b/src/verticals/workshop/seed/inventory.ts new file mode 100644 index 0000000..10f595f --- /dev/null +++ b/src/verticals/workshop/seed/inventory.ts @@ -0,0 +1,94 @@ +import type { PurchaseOrder, StockItem } from "@/modules/inventory"; + +import { catalog } from "./catalog"; +import { eur } from "./shared"; + +/** What the business keeps (ADR 0018 §1); `supplierId` names a supplier in `parties`. */ +/** A catalog item's name, so a stock item bought as the part it is sold as carries the same words. */ +const catalogName = (id: string) => { + const item = catalog.find((candidate) => candidate.id === id); + if (item === undefined) throw new Error(`No catalog item ${id}`); + return item.name; +}; + +export const stockItems: StockItem[] = [ + { + id: "stock-brake-pads", + name: catalogName("part-brake-pads"), + sku: "BP-F-118", + catalogItemId: "part-brake-pads", + unit: "set", + onHand: 6, + reorderPoint: 3, + supplierId: "distribuciones-levante", + }, + { + id: "stock-oil-filter", + name: catalogName("part-oil-filter"), + sku: "OF-204", + catalogItemId: "part-oil-filter", + unit: "unit", + onHand: 14, + reorderPoint: 5, + supplierId: "distribuciones-levante", + }, + { + id: "stock-air-filter", + name: catalogName("part-air-filter"), + sku: "AF-311", + catalogItemId: "part-air-filter", + unit: "unit", + onHand: 9, + reorderPoint: 4, + supplierId: "recambios-norte", + }, + { + id: "stock-wiper-blades", + name: catalogName("part-wiper-blades"), + sku: "WB-450", + catalogItemId: "part-wiper-blades", + unit: "pair", + onHand: 4, + reorderPoint: 6, + supplierId: "recambios-norte", + }, +]; + +export const purchaseOrders: PurchaseOrder[] = [ + { + id: "PO-W-1", + supplierId: "distribuciones-levante", + status: "received", + lines: [ + { stockItemId: "stock-brake-pads", qty: 4, unitCost: eur(2800) }, + { stockItemId: "stock-oil-filter", qty: 10, unitCost: eur(650) }, + ], + orderedOn: "2026-10-12", + expectedOn: "2026-10-16", + }, + { + id: "PO-W-2", + supplierId: "recambios-norte", + status: "sent", + lines: [ + { stockItemId: "stock-wiper-blades", qty: 8, unitCost: eur(1100) }, + { stockItemId: "stock-air-filter", qty: 6, unitCost: eur(900) }, + ], + orderedOn: "2026-10-29", + expectedOn: "2026-11-03", + }, + { + id: "PO-W-3", + supplierId: "distribuciones-levante", + status: "draft", + lines: [{ stockItemId: "stock-brake-pads", qty: 6, unitCost: eur(2800) }], + orderedOn: "2026-10-31", + }, + { + id: "PO-W-4", + supplierId: "recambios-norte", + status: "cancelled", + lines: [{ stockItemId: "stock-air-filter", qty: 12, unitCost: eur(950) }], + orderedOn: "2026-10-05", + }, +]; diff --git a/src/verticals/workshop/seed/parties.ts b/src/verticals/workshop/seed/parties.ts new file mode 100644 index 0000000..5a5a071 --- /dev/null +++ b/src/verticals/workshop/seed/parties.ts @@ -0,0 +1,46 @@ +import type { Party } from "@/modules/parties"; + +/** Fictitious fiscal directory (ADR 0019 §5): tax IDs that cannot be real and `.example` addresses. */ +export const parties: Party[] = [ + { + id: "fleet-company", + kind: "company", + legalName: "Transportes Rápidos del Sur S.L.", + tradeName: "Rápidos del Sur", + taxId: "B00000209", + addressLines: ["Polígono Las Salinas 4", "30169 San Ginés", "Spain"], + countryCode: "ES", + email: "flota@rapidos-del-sur.example", + roles: ["client"], + }, + { + id: "insurer", + kind: "company", + legalName: "Aseguradora Mediterránea S.A.", + taxId: "A00000210", + addressLines: ["Avenida de la Constitución 30", "46009 Valencia", "Spain"], + countryCode: "ES", + email: "siniestros@aseguradora-mediterranea.example", + roles: ["client"], + }, + { + id: "distribuciones-levante", + kind: "company", + legalName: "Distribuciones Levante", + taxId: "B00000211", + addressLines: ["Calle del Recambio 9", "46013 Valencia", "Spain"], + countryCode: "ES", + email: "pedidos@distribuciones-levante.example", + roles: ["supplier"], + }, + { + id: "recambios-norte", + kind: "company", + legalName: "Recambios Norte", + taxId: "B00000212", + addressLines: ["Polígono Industrial Ebro 21", "50014 Zaragoza", "Spain"], + countryCode: "ES", + email: "ventas@recambios-norte.example", + roles: ["supplier"], + }, +]; diff --git a/src/verticals/workshop/seed/resources.ts b/src/verticals/workshop/seed/resources.ts new file mode 100644 index 0000000..39de231 --- /dev/null +++ b/src/verticals/workshop/seed/resources.ts @@ -0,0 +1,5 @@ +import type { Area, Resource } from "@/modules/resources"; + +export const areas: Area[] = [{ id: "shop", label: "Shop floor" }]; + +export const resources: Resource[] = [{ id: "bay-1", kind: "bay", label: "Bay 1", areaId: "shop", active: true }]; diff --git a/src/verticals/workshop/seed/shared.ts b/src/verticals/workshop/seed/shared.ts new file mode 100644 index 0000000..64c72a2 --- /dev/null +++ b/src/verticals/workshop/seed/shared.ts @@ -0,0 +1,7 @@ +export const BUSINESS_DAY = "2026-10-31"; +export const at = (hours: number, minutes = 0) => hours * 60 + minutes; +export const eur = (amountMinor: number) => ({ amountMinor, currency: "EUR" }); +export const text = (en: string, es: string, de: string, fr: string) => ({ + source: en, + translations: { en, es, de, fr }, +}); diff --git a/src/verticals/workshop/seed/staff.ts b/src/verticals/workshop/seed/staff.ts new file mode 100644 index 0000000..76be1d6 --- /dev/null +++ b/src/verticals/workshop/seed/staff.ts @@ -0,0 +1,14 @@ +import type { StaffMember } from "@/modules/staff"; + +export const staff: StaffMember[] = [ + { + id: "mech-rafa", + name: "Rafa", + roleIds: ["staff"], + status: "active", + locationIds: ["branch"], + skills: ["brakes", "diagnostics"], + contract: { type: "employee", startDate: "2019-05-13", hoursPerWeek: 40 }, + ext: { certifications: ["EV safety"] }, + }, +];