Apply Lang
This commit is contained in:
1 parent
f0f714e8e2
commit
7cb65bf5e7
7 files changed
+434
-159
No files matched your search
+83
-71
@@ -1,3 +1,5 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export interface Scent {
|
||||
id: number
|
||||
name: string
|
||||
@@ -211,84 +213,95 @@ export interface PageSection {
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
export interface HeroSectionPayload {
|
||||
tagline: string
|
||||
title: string
|
||||
description: string
|
||||
imageUrl: string
|
||||
buttonText: string
|
||||
buttonLink: string
|
||||
}
|
||||
export const LocalizedStringSchema = z.union([z.string(), z.record(z.string(), z.string())]);
|
||||
|
||||
export interface CategoriesSectionPayload {
|
||||
title: string
|
||||
subtitle?: string
|
||||
categoryIds?: number[]
|
||||
}
|
||||
export const HeroSectionPayloadSchema = z.object({
|
||||
tagline: LocalizedStringSchema,
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema,
|
||||
imageUrl: z.string().min(1),
|
||||
buttonText: LocalizedStringSchema,
|
||||
buttonLink: z.string(),
|
||||
});
|
||||
export type HeroSectionPayload = z.infer<typeof HeroSectionPayloadSchema>;
|
||||
|
||||
export interface ProductsSectionPayload {
|
||||
title: string
|
||||
subtitle?: string
|
||||
type: 'featured' | 'scent' | 'custom'
|
||||
scentId?: number
|
||||
productIds?: number[]
|
||||
limit?: number
|
||||
layout?: 'grid' | 'carousel'
|
||||
enableQuickShop?: boolean
|
||||
}
|
||||
export const CategoriesSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
subtitle: LocalizedStringSchema.optional(),
|
||||
categoryIds: z.array(z.number()).optional(),
|
||||
});
|
||||
export type CategoriesSectionPayload = z.infer<typeof CategoriesSectionPayloadSchema>;
|
||||
|
||||
export interface BannerSectionPayload {
|
||||
imageUrl: string
|
||||
linkUrl?: string
|
||||
title?: string
|
||||
description?: string
|
||||
buttonText?: string
|
||||
}
|
||||
export const ProductsSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
subtitle: LocalizedStringSchema.optional(),
|
||||
type: z.enum(['featured', 'scent', 'custom']),
|
||||
scentId: z.number().optional(),
|
||||
productIds: z.array(z.number()).optional(),
|
||||
limit: z.number().optional(),
|
||||
layout: z.enum(['grid', 'carousel']).optional(),
|
||||
enableQuickShop: z.boolean().optional(),
|
||||
});
|
||||
export type ProductsSectionPayload = z.infer<typeof ProductsSectionPayloadSchema>;
|
||||
|
||||
export interface TextSectionPayload {
|
||||
title?: string
|
||||
content: string
|
||||
textAlign?: 'left' | 'center' | 'right'
|
||||
}
|
||||
export const BannerSectionPayloadSchema = z.object({
|
||||
imageUrl: z.string().min(1),
|
||||
linkUrl: z.string().optional(),
|
||||
title: LocalizedStringSchema.optional(),
|
||||
description: LocalizedStringSchema.optional(),
|
||||
buttonText: LocalizedStringSchema.optional(),
|
||||
});
|
||||
export type BannerSectionPayload = z.infer<typeof BannerSectionPayloadSchema>;
|
||||
|
||||
export interface AnnouncementBarSectionPayload {
|
||||
slides: string[]
|
||||
backgroundColor?: string
|
||||
textColor?: string
|
||||
speed?: number
|
||||
}
|
||||
export const TextSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema.optional(),
|
||||
content: LocalizedStringSchema,
|
||||
textAlign: z.enum(['left', 'center', 'right']).optional(),
|
||||
});
|
||||
export type TextSectionPayload = z.infer<typeof TextSectionPayloadSchema>;
|
||||
|
||||
export interface NewsletterSectionPayload {
|
||||
title: string
|
||||
description: string
|
||||
buttonText: string
|
||||
placeholderText?: string
|
||||
showPrivacyCheckbox: boolean
|
||||
privacyText?: string;
|
||||
}
|
||||
export const AnnouncementBarSectionPayloadSchema = z.object({
|
||||
slides: z.array(LocalizedStringSchema).min(1),
|
||||
backgroundColor: z.string().optional(),
|
||||
textColor: z.string().optional(),
|
||||
speed: z.number().optional(),
|
||||
});
|
||||
export type AnnouncementBarSectionPayload = z.infer<typeof AnnouncementBarSectionPayloadSchema>;
|
||||
|
||||
export interface EditorialTileSectionPayload {
|
||||
title: string
|
||||
description: string
|
||||
imageUrl: string
|
||||
imagePosition: 'left' | 'right'
|
||||
buttonText?: string
|
||||
buttonLink?: string
|
||||
backgroundColor?: string
|
||||
textColor?: string
|
||||
}
|
||||
export const NewsletterSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema,
|
||||
buttonText: LocalizedStringSchema,
|
||||
placeholderText: z.string().optional(),
|
||||
showPrivacyCheckbox: z.boolean(),
|
||||
privacyText: z.string().optional(),
|
||||
});
|
||||
export type NewsletterSectionPayload = z.infer<typeof NewsletterSectionPayloadSchema>;
|
||||
|
||||
export interface EditorialCarouselSectionPayload {
|
||||
title: string
|
||||
slides: {
|
||||
category: string
|
||||
title: string
|
||||
description: string
|
||||
imageUrl: string
|
||||
buttonText?: string
|
||||
buttonLink?: string
|
||||
}[]
|
||||
}
|
||||
export const EditorialTileSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema,
|
||||
imageUrl: z.string().min(1),
|
||||
imagePosition: z.enum(['left', 'right']),
|
||||
buttonText: z.string().optional(),
|
||||
buttonLink: z.string().optional(),
|
||||
backgroundColor: z.string().optional(),
|
||||
textColor: z.string().optional(),
|
||||
});
|
||||
export type EditorialTileSectionPayload = z.infer<typeof EditorialTileSectionPayloadSchema>;
|
||||
|
||||
export const EditorialCarouselSectionPayloadSchema = z.object({
|
||||
title: LocalizedStringSchema,
|
||||
slides: z.array(z.object({
|
||||
category: LocalizedStringSchema,
|
||||
title: LocalizedStringSchema,
|
||||
description: LocalizedStringSchema,
|
||||
imageUrl: z.string().min(1),
|
||||
buttonText: z.string().optional(),
|
||||
buttonLink: z.string().optional(),
|
||||
})).min(1)
|
||||
});
|
||||
export type EditorialCarouselSectionPayload = z.infer<typeof EditorialCarouselSectionPayloadSchema>;
|
||||
|
||||
export interface CustomerAddress {
|
||||
id: number
|
||||
@@ -305,7 +318,6 @@ export interface CustomerAddress {
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
export const HeroArticlePayloadSchema = z.object({
|
||||
title: z.string().min(1, "Title is required"),
|
||||
|
||||
Reference in new issue
Block a user