@mac777/project-pinecone-schema 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/events/events.schema.d.ts +289 -129
- package/dist/events/events.schema.js +99 -16
- package/dist/events/events.type.d.ts +4 -1
- package/package.json +1 -1
- package/src/events/events.schema.ts +119 -17
- package/src/events/events.type.ts +4 -1
|
@@ -1456,6 +1456,10 @@ export declare const protectedEventSchema: z.ZodObject<{
|
|
|
1456
1456
|
export declare const pendingApprovalEditSchema: z.ZodObject<{
|
|
1457
1457
|
eventId: z.ZodString;
|
|
1458
1458
|
hostId: z.ZodString;
|
|
1459
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1460
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
1461
|
+
highlights: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1462
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1459
1463
|
media: z.ZodObject<{
|
|
1460
1464
|
coverImage: z.ZodObject<{
|
|
1461
1465
|
alt: z.ZodString;
|
|
@@ -1506,7 +1510,32 @@ export declare const pendingApprovalEditSchema: z.ZodObject<{
|
|
|
1506
1510
|
url: string;
|
|
1507
1511
|
}[] | undefined;
|
|
1508
1512
|
}>;
|
|
1509
|
-
|
|
1513
|
+
additionalDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1514
|
+
type: z.ZodOptional<z.ZodEnum<["venue_booking", "permit", "insurance", "license", "portfolio", "other"]>>;
|
|
1515
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1516
|
+
filename: z.ZodString;
|
|
1517
|
+
objectKey: z.ZodString;
|
|
1518
|
+
}, "strip", z.ZodTypeAny, {
|
|
1519
|
+
filename: string;
|
|
1520
|
+
objectKey: string;
|
|
1521
|
+
type?: "other" | "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | undefined;
|
|
1522
|
+
url?: string | undefined;
|
|
1523
|
+
}, {
|
|
1524
|
+
filename: string;
|
|
1525
|
+
objectKey: string;
|
|
1526
|
+
type?: "other" | "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | undefined;
|
|
1527
|
+
url?: string | undefined;
|
|
1528
|
+
}>, "many">>;
|
|
1529
|
+
tickets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1530
|
+
_id: z.ZodString;
|
|
1531
|
+
benefits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1532
|
+
}, "strip", z.ZodTypeAny, {
|
|
1533
|
+
_id: string;
|
|
1534
|
+
benefits?: string[] | undefined;
|
|
1535
|
+
}, {
|
|
1536
|
+
_id: string;
|
|
1537
|
+
benefits?: string[] | undefined;
|
|
1538
|
+
}>, "many">>;
|
|
1510
1539
|
}, "strip", z.ZodTypeAny, {
|
|
1511
1540
|
media: {
|
|
1512
1541
|
coverImage: {
|
|
@@ -1520,9 +1549,22 @@ export declare const pendingApprovalEditSchema: z.ZodObject<{
|
|
|
1520
1549
|
url: string;
|
|
1521
1550
|
}[] | undefined;
|
|
1522
1551
|
};
|
|
1523
|
-
description: string;
|
|
1524
1552
|
eventId: string;
|
|
1525
1553
|
hostId: string;
|
|
1554
|
+
tagline?: string | undefined;
|
|
1555
|
+
description?: string | undefined;
|
|
1556
|
+
highlights?: string[] | undefined;
|
|
1557
|
+
tickets?: {
|
|
1558
|
+
_id: string;
|
|
1559
|
+
benefits?: string[] | undefined;
|
|
1560
|
+
}[] | undefined;
|
|
1561
|
+
languages?: string[] | undefined;
|
|
1562
|
+
additionalDocuments?: {
|
|
1563
|
+
filename: string;
|
|
1564
|
+
objectKey: string;
|
|
1565
|
+
type?: "other" | "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | undefined;
|
|
1566
|
+
url?: string | undefined;
|
|
1567
|
+
}[] | undefined;
|
|
1526
1568
|
}, {
|
|
1527
1569
|
media: {
|
|
1528
1570
|
coverImage: {
|
|
@@ -1536,13 +1578,30 @@ export declare const pendingApprovalEditSchema: z.ZodObject<{
|
|
|
1536
1578
|
url: string;
|
|
1537
1579
|
}[] | undefined;
|
|
1538
1580
|
};
|
|
1539
|
-
description: string;
|
|
1540
1581
|
eventId: string;
|
|
1541
1582
|
hostId: string;
|
|
1583
|
+
tagline?: string | undefined;
|
|
1584
|
+
description?: string | undefined;
|
|
1585
|
+
highlights?: string[] | undefined;
|
|
1586
|
+
tickets?: {
|
|
1587
|
+
_id: string;
|
|
1588
|
+
benefits?: string[] | undefined;
|
|
1589
|
+
}[] | undefined;
|
|
1590
|
+
languages?: string[] | undefined;
|
|
1591
|
+
additionalDocuments?: {
|
|
1592
|
+
filename: string;
|
|
1593
|
+
objectKey: string;
|
|
1594
|
+
type?: "other" | "venue_booking" | "permit" | "insurance" | "license" | "portfolio" | undefined;
|
|
1595
|
+
url?: string | undefined;
|
|
1596
|
+
}[] | undefined;
|
|
1542
1597
|
}>;
|
|
1543
|
-
export declare const approvedEventEditSchema: z.
|
|
1598
|
+
export declare const approvedEventEditSchema: z.ZodObject<{
|
|
1544
1599
|
eventId: z.ZodString;
|
|
1545
1600
|
hostId: z.ZodString;
|
|
1601
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1602
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
1603
|
+
highlights: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1604
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1546
1605
|
media: z.ZodObject<{
|
|
1547
1606
|
coverImage: z.ZodObject<{
|
|
1548
1607
|
alt: z.ZodString;
|
|
@@ -1593,95 +1652,68 @@ export declare const approvedEventEditSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1593
1652
|
url: string;
|
|
1594
1653
|
}[] | undefined;
|
|
1595
1654
|
}>;
|
|
1596
|
-
description: z.ZodString;
|
|
1597
1655
|
tickets: z.ZodArray<z.ZodObject<{
|
|
1598
1656
|
_id: z.ZodOptional<z.ZodString>;
|
|
1599
1657
|
name: z.ZodString;
|
|
1600
|
-
price: z.
|
|
1601
|
-
amount: z.ZodNumber;
|
|
1602
|
-
currency: z.ZodDefault<z.ZodString>;
|
|
1603
|
-
}, "strip", z.ZodTypeAny, {
|
|
1604
|
-
amount: number;
|
|
1605
|
-
currency: string;
|
|
1606
|
-
}, {
|
|
1607
|
-
amount: number;
|
|
1608
|
-
currency?: string | undefined;
|
|
1609
|
-
}>;
|
|
1658
|
+
price: z.ZodNumber;
|
|
1610
1659
|
quantity: z.ZodNumber;
|
|
1660
|
+
benefits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1661
|
+
wristbandColor: z.ZodDefault<z.ZodString>;
|
|
1662
|
+
isVisible: z.ZodDefault<z.ZodBoolean>;
|
|
1663
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
1611
1664
|
limits: z.ZodOptional<z.ZodObject<{
|
|
1612
|
-
minPerOrder: z.
|
|
1613
|
-
maxPerOrder: z.
|
|
1665
|
+
minPerOrder: z.ZodNumber;
|
|
1666
|
+
maxPerOrder: z.ZodNumber;
|
|
1614
1667
|
}, "strip", z.ZodTypeAny, {
|
|
1615
1668
|
minPerOrder: number;
|
|
1616
1669
|
maxPerOrder: number;
|
|
1617
1670
|
}, {
|
|
1618
|
-
minPerOrder
|
|
1619
|
-
maxPerOrder
|
|
1620
|
-
}>>;
|
|
1621
|
-
sold: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
1622
|
-
reserved: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
1623
|
-
wristbandColor: z.ZodOptional<z.ZodString>;
|
|
1624
|
-
isVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1625
|
-
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1626
|
-
benefits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1627
|
-
tier: z.ZodDefault<z.ZodString>;
|
|
1628
|
-
salesWindow: z.ZodOptional<z.ZodObject<{
|
|
1629
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
1630
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
1631
|
-
}, "strip", z.ZodTypeAny, {
|
|
1632
|
-
startDate?: string | undefined;
|
|
1633
|
-
endDate?: string | undefined;
|
|
1634
|
-
}, {
|
|
1635
|
-
startDate?: string | undefined;
|
|
1636
|
-
endDate?: string | undefined;
|
|
1671
|
+
minPerOrder: number;
|
|
1672
|
+
maxPerOrder: number;
|
|
1637
1673
|
}>>;
|
|
1638
1674
|
}, "strip", z.ZodTypeAny, {
|
|
1639
1675
|
name: string;
|
|
1640
|
-
price:
|
|
1641
|
-
amount: number;
|
|
1642
|
-
currency: string;
|
|
1643
|
-
};
|
|
1676
|
+
price: number;
|
|
1644
1677
|
quantity: number;
|
|
1645
|
-
|
|
1678
|
+
wristbandColor: string;
|
|
1679
|
+
isVisible: boolean;
|
|
1680
|
+
isActive: boolean;
|
|
1646
1681
|
_id?: string | undefined;
|
|
1647
1682
|
limits?: {
|
|
1648
1683
|
minPerOrder: number;
|
|
1649
1684
|
maxPerOrder: number;
|
|
1650
1685
|
} | undefined;
|
|
1651
|
-
sold?: number | undefined;
|
|
1652
|
-
reserved?: number | undefined;
|
|
1653
|
-
wristbandColor?: string | undefined;
|
|
1654
|
-
isVisible?: boolean | undefined;
|
|
1655
|
-
isActive?: boolean | undefined;
|
|
1656
1686
|
benefits?: string[] | undefined;
|
|
1657
|
-
salesWindow?: {
|
|
1658
|
-
startDate?: string | undefined;
|
|
1659
|
-
endDate?: string | undefined;
|
|
1660
|
-
} | undefined;
|
|
1661
1687
|
}, {
|
|
1662
1688
|
name: string;
|
|
1663
|
-
price:
|
|
1664
|
-
amount: number;
|
|
1665
|
-
currency?: string | undefined;
|
|
1666
|
-
};
|
|
1689
|
+
price: number;
|
|
1667
1690
|
quantity: number;
|
|
1668
1691
|
_id?: string | undefined;
|
|
1669
1692
|
limits?: {
|
|
1670
|
-
minPerOrder
|
|
1671
|
-
maxPerOrder
|
|
1693
|
+
minPerOrder: number;
|
|
1694
|
+
maxPerOrder: number;
|
|
1672
1695
|
} | undefined;
|
|
1673
|
-
sold?: number | undefined;
|
|
1674
|
-
reserved?: number | undefined;
|
|
1675
1696
|
wristbandColor?: string | undefined;
|
|
1676
1697
|
isVisible?: boolean | undefined;
|
|
1677
1698
|
isActive?: boolean | undefined;
|
|
1678
1699
|
benefits?: string[] | undefined;
|
|
1679
|
-
tier?: string | undefined;
|
|
1680
|
-
salesWindow?: {
|
|
1681
|
-
startDate?: string | undefined;
|
|
1682
|
-
endDate?: string | undefined;
|
|
1683
|
-
} | undefined;
|
|
1684
1700
|
}>, "many">;
|
|
1701
|
+
schedule: z.ZodEffects<z.ZodOptional<z.ZodObject<{
|
|
1702
|
+
startDate: z.ZodDate;
|
|
1703
|
+
endDate: z.ZodDate;
|
|
1704
|
+
}, "strip", z.ZodTypeAny, {
|
|
1705
|
+
startDate: Date;
|
|
1706
|
+
endDate: Date;
|
|
1707
|
+
}, {
|
|
1708
|
+
startDate: Date;
|
|
1709
|
+
endDate: Date;
|
|
1710
|
+
}>>, {
|
|
1711
|
+
startDate: Date;
|
|
1712
|
+
endDate: Date;
|
|
1713
|
+
} | undefined, {
|
|
1714
|
+
startDate: Date;
|
|
1715
|
+
endDate: Date;
|
|
1716
|
+
} | undefined>;
|
|
1685
1717
|
}, "strip", z.ZodTypeAny, {
|
|
1686
1718
|
media: {
|
|
1687
1719
|
coverImage: {
|
|
@@ -1695,33 +1727,30 @@ export declare const approvedEventEditSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1695
1727
|
url: string;
|
|
1696
1728
|
}[] | undefined;
|
|
1697
1729
|
};
|
|
1698
|
-
description: string;
|
|
1699
1730
|
tickets: {
|
|
1700
1731
|
name: string;
|
|
1701
|
-
price:
|
|
1702
|
-
amount: number;
|
|
1703
|
-
currency: string;
|
|
1704
|
-
};
|
|
1732
|
+
price: number;
|
|
1705
1733
|
quantity: number;
|
|
1706
|
-
|
|
1734
|
+
wristbandColor: string;
|
|
1735
|
+
isVisible: boolean;
|
|
1736
|
+
isActive: boolean;
|
|
1707
1737
|
_id?: string | undefined;
|
|
1708
1738
|
limits?: {
|
|
1709
1739
|
minPerOrder: number;
|
|
1710
1740
|
maxPerOrder: number;
|
|
1711
1741
|
} | undefined;
|
|
1712
|
-
sold?: number | undefined;
|
|
1713
|
-
reserved?: number | undefined;
|
|
1714
|
-
wristbandColor?: string | undefined;
|
|
1715
|
-
isVisible?: boolean | undefined;
|
|
1716
|
-
isActive?: boolean | undefined;
|
|
1717
1742
|
benefits?: string[] | undefined;
|
|
1718
|
-
salesWindow?: {
|
|
1719
|
-
startDate?: string | undefined;
|
|
1720
|
-
endDate?: string | undefined;
|
|
1721
|
-
} | undefined;
|
|
1722
1743
|
}[];
|
|
1723
1744
|
eventId: string;
|
|
1724
1745
|
hostId: string;
|
|
1746
|
+
tagline?: string | undefined;
|
|
1747
|
+
description?: string | undefined;
|
|
1748
|
+
highlights?: string[] | undefined;
|
|
1749
|
+
schedule?: {
|
|
1750
|
+
startDate: Date;
|
|
1751
|
+
endDate: Date;
|
|
1752
|
+
} | undefined;
|
|
1753
|
+
languages?: string[] | undefined;
|
|
1725
1754
|
}, {
|
|
1726
1755
|
media: {
|
|
1727
1756
|
coverImage: {
|
|
@@ -1735,35 +1764,65 @@ export declare const approvedEventEditSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1735
1764
|
url: string;
|
|
1736
1765
|
}[] | undefined;
|
|
1737
1766
|
};
|
|
1738
|
-
description: string;
|
|
1739
1767
|
tickets: {
|
|
1740
1768
|
name: string;
|
|
1741
|
-
price:
|
|
1742
|
-
amount: number;
|
|
1743
|
-
currency?: string | undefined;
|
|
1744
|
-
};
|
|
1769
|
+
price: number;
|
|
1745
1770
|
quantity: number;
|
|
1746
1771
|
_id?: string | undefined;
|
|
1747
1772
|
limits?: {
|
|
1748
|
-
minPerOrder
|
|
1749
|
-
maxPerOrder
|
|
1773
|
+
minPerOrder: number;
|
|
1774
|
+
maxPerOrder: number;
|
|
1750
1775
|
} | undefined;
|
|
1751
|
-
sold?: number | undefined;
|
|
1752
|
-
reserved?: number | undefined;
|
|
1753
1776
|
wristbandColor?: string | undefined;
|
|
1754
1777
|
isVisible?: boolean | undefined;
|
|
1755
1778
|
isActive?: boolean | undefined;
|
|
1756
1779
|
benefits?: string[] | undefined;
|
|
1757
|
-
tier?: string | undefined;
|
|
1758
|
-
salesWindow?: {
|
|
1759
|
-
startDate?: string | undefined;
|
|
1760
|
-
endDate?: string | undefined;
|
|
1761
|
-
} | undefined;
|
|
1762
1780
|
}[];
|
|
1763
1781
|
eventId: string;
|
|
1764
1782
|
hostId: string;
|
|
1765
|
-
|
|
1766
|
-
|
|
1783
|
+
tagline?: string | undefined;
|
|
1784
|
+
description?: string | undefined;
|
|
1785
|
+
highlights?: string[] | undefined;
|
|
1786
|
+
schedule?: {
|
|
1787
|
+
startDate: Date;
|
|
1788
|
+
endDate: Date;
|
|
1789
|
+
} | undefined;
|
|
1790
|
+
languages?: string[] | undefined;
|
|
1791
|
+
}>;
|
|
1792
|
+
export declare const publishedEventEditSchema: z.ZodObject<{
|
|
1793
|
+
eventId: z.ZodString;
|
|
1794
|
+
hostId: z.ZodString;
|
|
1795
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1796
|
+
highlights: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1797
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1798
|
+
media: z.ZodOptional<z.ZodObject<{
|
|
1799
|
+
coverImage: z.ZodObject<{
|
|
1800
|
+
alt: z.ZodString;
|
|
1801
|
+
thumbnailUrl: z.ZodString;
|
|
1802
|
+
url: z.ZodString;
|
|
1803
|
+
}, "strip", z.ZodTypeAny, {
|
|
1804
|
+
alt: string;
|
|
1805
|
+
thumbnailUrl: string;
|
|
1806
|
+
url: string;
|
|
1807
|
+
}, {
|
|
1808
|
+
alt: string;
|
|
1809
|
+
thumbnailUrl: string;
|
|
1810
|
+
url: string;
|
|
1811
|
+
}>;
|
|
1812
|
+
gallery: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1813
|
+
alt: z.ZodString;
|
|
1814
|
+
thumbnailUrl: z.ZodString;
|
|
1815
|
+
url: z.ZodString;
|
|
1816
|
+
}, "strip", z.ZodTypeAny, {
|
|
1817
|
+
alt: string;
|
|
1818
|
+
thumbnailUrl: string;
|
|
1819
|
+
url: string;
|
|
1820
|
+
}, {
|
|
1821
|
+
alt: string;
|
|
1822
|
+
thumbnailUrl: string;
|
|
1823
|
+
url: string;
|
|
1824
|
+
}>, "many">>;
|
|
1825
|
+
}, "strip", z.ZodTypeAny, {
|
|
1767
1826
|
coverImage: {
|
|
1768
1827
|
alt: string;
|
|
1769
1828
|
thumbnailUrl: string;
|
|
@@ -1774,36 +1833,78 @@ export declare const approvedEventEditSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1774
1833
|
thumbnailUrl: string;
|
|
1775
1834
|
url: string;
|
|
1776
1835
|
}[] | undefined;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
amount: number;
|
|
1783
|
-
currency: string;
|
|
1836
|
+
}, {
|
|
1837
|
+
coverImage: {
|
|
1838
|
+
alt: string;
|
|
1839
|
+
thumbnailUrl: string;
|
|
1840
|
+
url: string;
|
|
1784
1841
|
};
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1842
|
+
gallery?: {
|
|
1843
|
+
alt: string;
|
|
1844
|
+
thumbnailUrl: string;
|
|
1845
|
+
url: string;
|
|
1846
|
+
}[] | undefined;
|
|
1847
|
+
}>>;
|
|
1848
|
+
tickets: z.ZodArray<z.ZodObject<{
|
|
1849
|
+
_id: z.ZodString;
|
|
1850
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
1851
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
1852
|
+
benefits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1853
|
+
wristbandColor: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1854
|
+
isVisible: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1855
|
+
isActive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1856
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
1857
|
+
minPerOrder: z.ZodOptional<z.ZodNumber>;
|
|
1858
|
+
maxPerOrder: z.ZodOptional<z.ZodNumber>;
|
|
1859
|
+
}, "strip", z.ZodTypeAny, {
|
|
1860
|
+
minPerOrder?: number | undefined;
|
|
1861
|
+
maxPerOrder?: number | undefined;
|
|
1862
|
+
}, {
|
|
1863
|
+
minPerOrder?: number | undefined;
|
|
1864
|
+
maxPerOrder?: number | undefined;
|
|
1865
|
+
}>>;
|
|
1866
|
+
}, "strip", z.ZodTypeAny, {
|
|
1867
|
+
_id: string;
|
|
1868
|
+
wristbandColor: string;
|
|
1869
|
+
isVisible: boolean;
|
|
1870
|
+
isActive: boolean;
|
|
1871
|
+
price?: number | undefined;
|
|
1872
|
+
quantity?: number | undefined;
|
|
1788
1873
|
limits?: {
|
|
1789
|
-
minPerOrder
|
|
1790
|
-
maxPerOrder
|
|
1874
|
+
minPerOrder?: number | undefined;
|
|
1875
|
+
maxPerOrder?: number | undefined;
|
|
1876
|
+
} | undefined;
|
|
1877
|
+
benefits?: string[] | undefined;
|
|
1878
|
+
}, {
|
|
1879
|
+
_id: string;
|
|
1880
|
+
price?: number | undefined;
|
|
1881
|
+
quantity?: number | undefined;
|
|
1882
|
+
limits?: {
|
|
1883
|
+
minPerOrder?: number | undefined;
|
|
1884
|
+
maxPerOrder?: number | undefined;
|
|
1791
1885
|
} | undefined;
|
|
1792
|
-
sold?: number | undefined;
|
|
1793
|
-
reserved?: number | undefined;
|
|
1794
1886
|
wristbandColor?: string | undefined;
|
|
1795
1887
|
isVisible?: boolean | undefined;
|
|
1796
1888
|
isActive?: boolean | undefined;
|
|
1797
1889
|
benefits?: string[] | undefined;
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1890
|
+
}>, "many">;
|
|
1891
|
+
}, "strip", z.ZodTypeAny, {
|
|
1892
|
+
tickets: {
|
|
1893
|
+
_id: string;
|
|
1894
|
+
wristbandColor: string;
|
|
1895
|
+
isVisible: boolean;
|
|
1896
|
+
isActive: boolean;
|
|
1897
|
+
price?: number | undefined;
|
|
1898
|
+
quantity?: number | undefined;
|
|
1899
|
+
limits?: {
|
|
1900
|
+
minPerOrder?: number | undefined;
|
|
1901
|
+
maxPerOrder?: number | undefined;
|
|
1801
1902
|
} | undefined;
|
|
1903
|
+
benefits?: string[] | undefined;
|
|
1802
1904
|
}[];
|
|
1803
1905
|
eventId: string;
|
|
1804
1906
|
hostId: string;
|
|
1805
|
-
|
|
1806
|
-
media: {
|
|
1907
|
+
media?: {
|
|
1807
1908
|
coverImage: {
|
|
1808
1909
|
alt: string;
|
|
1809
1910
|
thumbnailUrl: string;
|
|
@@ -1814,34 +1915,93 @@ export declare const approvedEventEditSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1814
1915
|
thumbnailUrl: string;
|
|
1815
1916
|
url: string;
|
|
1816
1917
|
}[] | undefined;
|
|
1817
|
-
};
|
|
1818
|
-
description
|
|
1918
|
+
} | undefined;
|
|
1919
|
+
description?: string | undefined;
|
|
1920
|
+
highlights?: string[] | undefined;
|
|
1921
|
+
languages?: string[] | undefined;
|
|
1922
|
+
}, {
|
|
1819
1923
|
tickets: {
|
|
1820
|
-
|
|
1821
|
-
price
|
|
1822
|
-
|
|
1823
|
-
currency?: string | undefined;
|
|
1824
|
-
};
|
|
1825
|
-
quantity: number;
|
|
1826
|
-
_id?: string | undefined;
|
|
1924
|
+
_id: string;
|
|
1925
|
+
price?: number | undefined;
|
|
1926
|
+
quantity?: number | undefined;
|
|
1827
1927
|
limits?: {
|
|
1828
1928
|
minPerOrder?: number | undefined;
|
|
1829
1929
|
maxPerOrder?: number | undefined;
|
|
1830
1930
|
} | undefined;
|
|
1831
|
-
sold?: number | undefined;
|
|
1832
|
-
reserved?: number | undefined;
|
|
1833
1931
|
wristbandColor?: string | undefined;
|
|
1834
1932
|
isVisible?: boolean | undefined;
|
|
1835
1933
|
isActive?: boolean | undefined;
|
|
1836
1934
|
benefits?: string[] | undefined;
|
|
1837
|
-
tier?: string | undefined;
|
|
1838
|
-
salesWindow?: {
|
|
1839
|
-
startDate?: string | undefined;
|
|
1840
|
-
endDate?: string | undefined;
|
|
1841
|
-
} | undefined;
|
|
1842
1935
|
}[];
|
|
1843
1936
|
eventId: string;
|
|
1844
1937
|
hostId: string;
|
|
1938
|
+
media?: {
|
|
1939
|
+
coverImage: {
|
|
1940
|
+
alt: string;
|
|
1941
|
+
thumbnailUrl: string;
|
|
1942
|
+
url: string;
|
|
1943
|
+
};
|
|
1944
|
+
gallery?: {
|
|
1945
|
+
alt: string;
|
|
1946
|
+
thumbnailUrl: string;
|
|
1947
|
+
url: string;
|
|
1948
|
+
}[] | undefined;
|
|
1949
|
+
} | undefined;
|
|
1950
|
+
description?: string | undefined;
|
|
1951
|
+
highlights?: string[] | undefined;
|
|
1952
|
+
languages?: string[] | undefined;
|
|
1953
|
+
}>;
|
|
1954
|
+
export declare const liveEventEditSchema: z.ZodObject<{
|
|
1955
|
+
eventId: z.ZodString;
|
|
1956
|
+
hostId: z.ZodString;
|
|
1957
|
+
liveUpdate: z.ZodOptional<z.ZodString>;
|
|
1958
|
+
tickets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1959
|
+
_id: z.ZodString;
|
|
1960
|
+
quantity: z.ZodOptional<z.ZodNumber>;
|
|
1961
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
1962
|
+
}, "strip", z.ZodTypeAny, {
|
|
1963
|
+
_id: string;
|
|
1964
|
+
quantity?: number | undefined;
|
|
1965
|
+
isActive?: boolean | undefined;
|
|
1966
|
+
}, {
|
|
1967
|
+
_id: string;
|
|
1968
|
+
quantity?: number | undefined;
|
|
1969
|
+
isActive?: boolean | undefined;
|
|
1970
|
+
}>, "many">>;
|
|
1971
|
+
}, "strip", z.ZodTypeAny, {
|
|
1972
|
+
eventId: string;
|
|
1973
|
+
hostId: string;
|
|
1974
|
+
tickets?: {
|
|
1975
|
+
_id: string;
|
|
1976
|
+
quantity?: number | undefined;
|
|
1977
|
+
isActive?: boolean | undefined;
|
|
1978
|
+
}[] | undefined;
|
|
1979
|
+
liveUpdate?: string | undefined;
|
|
1980
|
+
}, {
|
|
1981
|
+
eventId: string;
|
|
1982
|
+
hostId: string;
|
|
1983
|
+
tickets?: {
|
|
1984
|
+
_id: string;
|
|
1985
|
+
quantity?: number | undefined;
|
|
1986
|
+
isActive?: boolean | undefined;
|
|
1987
|
+
}[] | undefined;
|
|
1988
|
+
liveUpdate?: string | undefined;
|
|
1989
|
+
}>;
|
|
1990
|
+
export declare const endedEventEditSchema: z.ZodObject<{
|
|
1991
|
+
eventId: z.ZodString;
|
|
1992
|
+
hostId: z.ZodString;
|
|
1993
|
+
recap: z.ZodOptional<z.ZodString>;
|
|
1994
|
+
eventPhotos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1995
|
+
}, "strip", z.ZodTypeAny, {
|
|
1996
|
+
eventId: string;
|
|
1997
|
+
hostId: string;
|
|
1998
|
+
recap?: string | undefined;
|
|
1999
|
+
eventPhotos?: string[] | undefined;
|
|
2000
|
+
}, {
|
|
2001
|
+
eventId: string;
|
|
2002
|
+
hostId: string;
|
|
2003
|
+
recap?: string | undefined;
|
|
2004
|
+
eventPhotos?: string[] | undefined;
|
|
1845
2005
|
}>;
|
|
1846
2006
|
export declare const submitEventSchema: z.ZodObject<{
|
|
1847
2007
|
title: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.draftEventSchema = exports.clientGetEventSchema = exports.submitEventSchema = exports.approvedEventEditSchema = exports.pendingApprovalEditSchema = exports.protectedEventSchema = exports.getEventSchema = exports.stepReviewSchema = exports.stepTicketsSchema = exports.stepVerifySchema = exports.stepLogisticsSchema = exports.stepDetailsSchema = exports.stepBasicsSchema = void 0;
|
|
3
|
+
exports.draftEventSchema = exports.clientGetEventSchema = exports.submitEventSchema = exports.endedEventEditSchema = exports.liveEventEditSchema = exports.publishedEventEditSchema = exports.approvedEventEditSchema = exports.pendingApprovalEditSchema = exports.protectedEventSchema = exports.getEventSchema = exports.stepReviewSchema = exports.stepTicketsSchema = exports.stepVerifySchema = exports.stepLogisticsSchema = exports.stepDetailsSchema = exports.stepBasicsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const event_type_schema_1 = require("./utils/event.type.schema");
|
|
6
6
|
const media_schema_1 = require("./utils/media.schema");
|
|
@@ -90,30 +90,113 @@ exports.protectedEventSchema = zod_1.z.object({
|
|
|
90
90
|
eventId: zod_1.z.string().regex(/^[0-9a-fA-F]{24}$/, 'Event not found'),
|
|
91
91
|
hostId: zod_1.z.string().regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
92
92
|
});
|
|
93
|
+
// Pending Approval
|
|
93
94
|
exports.pendingApprovalEditSchema = zod_1.z.object({
|
|
94
95
|
eventId: zod_1.z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/, 'Event not found'),
|
|
95
96
|
hostId: zod_1.z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
97
|
+
// Editable fields
|
|
98
|
+
description: zod_1.z.string().min(50, 'Description must be at least 50 characters').max(events_constants_1.MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${events_constants_1.MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
99
|
+
tagline: zod_1.z.string().max(150, 'Tagline must be at most 150 characters').optional(),
|
|
100
|
+
highlights: zod_1.z.array(zod_1.z.string().max(200, 'Each highlight cannot exceed 200 characters'), { required_error: 'Highlights must be an array of strings' }).max(10, 'Cannot have more than 10 highlights').optional(),
|
|
101
|
+
languages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
96
102
|
media: media_schema_1.mediaSchema,
|
|
97
|
-
|
|
103
|
+
// Can add docs, not remove
|
|
104
|
+
additionalDocuments: zod_1.z.array(document_schema_1.documentSchema).optional(),
|
|
105
|
+
// Can clarify benefits, not change structure
|
|
106
|
+
tickets: zod_1.z.array(zod_1.z.object({
|
|
107
|
+
_id: zod_1.z.string(),
|
|
108
|
+
benefits: zod_1.z.array(zod_1.z.string()).optional()
|
|
109
|
+
})).optional()
|
|
98
110
|
});
|
|
111
|
+
// Approved
|
|
99
112
|
exports.approvedEventEditSchema = zod_1.z.object({
|
|
100
113
|
eventId: zod_1.z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/, 'Event not found'),
|
|
101
114
|
hostId: zod_1.z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
115
|
+
// Marketing content
|
|
116
|
+
description: zod_1.z.string().min(50, 'Description must be at least 50 characters').max(events_constants_1.MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${events_constants_1.MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
117
|
+
tagline: zod_1.z.string().max(150, 'Tagline must be at most 150 characters').optional(),
|
|
118
|
+
highlights: zod_1.z.array(zod_1.z.string().max(200)).max(10).optional(),
|
|
119
|
+
languages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
102
120
|
media: media_schema_1.mediaSchema,
|
|
103
|
-
|
|
104
|
-
tickets: zod_1.z.array(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
// Tickets (full control, no sales yet)
|
|
122
|
+
tickets: zod_1.z.array(zod_1.z.object({
|
|
123
|
+
_id: zod_1.z.string().optional(), // Undefined = new tier
|
|
124
|
+
name: zod_1.z.string({ required_error: 'Ticket name is required' }),
|
|
125
|
+
price: zod_1.z.number({ required_error: 'Ticket price is required' }).min(0, 'Ticket price cannot be negative'),
|
|
126
|
+
quantity: zod_1.z.number({ required_error: 'Ticket quantity is required' }).min(1, 'Ticket quantity must be at least 1'),
|
|
127
|
+
benefits: zod_1.z.array(zod_1.z.string()).optional(),
|
|
128
|
+
wristbandColor: zod_1.z.string().default('#000000'),
|
|
129
|
+
isVisible: zod_1.z.boolean().default(true),
|
|
130
|
+
isActive: zod_1.z.boolean().default(true),
|
|
131
|
+
limits: zod_1.z.object({
|
|
132
|
+
minPerOrder: zod_1.z.number({ required_error: 'Min per order is required' }).min(1, 'Min per order must be at least 1'),
|
|
133
|
+
maxPerOrder: zod_1.z.number({ required_error: 'Max per order is required' }).min(1, 'Max per order must be at least 1')
|
|
134
|
+
}).optional()
|
|
135
|
+
})).min(1),
|
|
136
|
+
// Minor date adjustments (±2 hours)
|
|
137
|
+
schedule: zod_1.z.object({
|
|
138
|
+
startDate: zod_1.z.date(),
|
|
139
|
+
endDate: zod_1.z.date()
|
|
140
|
+
}).optional().refine(data => {
|
|
141
|
+
if (!data?.startDate || !data?.endDate)
|
|
142
|
+
return false;
|
|
143
|
+
const diff = Math.abs(data?.startDate?.getTime() - data?.endDate?.getTime());
|
|
144
|
+
return diff <= 2 * 60 * 60 * 1000;
|
|
145
|
+
}, {
|
|
146
|
+
message: 'Schedule must be within 2 hours of original',
|
|
147
|
+
path: ['schedule', 'endDate']
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
// Published
|
|
151
|
+
exports.publishedEventEditSchema = zod_1.z.object({
|
|
152
|
+
eventId: zod_1.z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
153
|
+
hostId: zod_1.z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
154
|
+
// Can add, not remove
|
|
155
|
+
description: zod_1.z.string().min(50, 'Description must be at least 50 characters').max(events_constants_1.MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${events_constants_1.MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
156
|
+
highlights: zod_1.z.array(zod_1.z.string().max(200, 'Each highlight cannot exceed 200 characters'), { required_error: 'Highlights must be an array of strings' }).max(10, 'Cannot have more than 10 highlights').optional(),
|
|
157
|
+
languages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
158
|
+
// Media (with warning)
|
|
159
|
+
media: media_schema_1.mediaSchema.optional(),
|
|
160
|
+
// Ticket updates (complex validation)
|
|
161
|
+
tickets: zod_1.z.array(zod_1.z.object({
|
|
162
|
+
_id: zod_1.z.string(),
|
|
163
|
+
// Price change validation happens in controller
|
|
164
|
+
price: zod_1.z.number().min(0).optional(),
|
|
165
|
+
// Quantity increase only (unless sold = 0)
|
|
166
|
+
quantity: zod_1.z.number().min(1).optional(),
|
|
167
|
+
// Can add benefits, not remove
|
|
168
|
+
benefits: zod_1.z.array(zod_1.z.string()).optional(),
|
|
169
|
+
// Operational controls
|
|
170
|
+
wristbandColor: zod_1.z.string().optional().default('#000000'),
|
|
171
|
+
isVisible: zod_1.z.boolean().optional().default(true),
|
|
172
|
+
isActive: zod_1.z.boolean().optional().default(true),
|
|
173
|
+
// Cannot change limits if sales exist
|
|
174
|
+
limits: zod_1.z.object({
|
|
175
|
+
minPerOrder: zod_1.z.number().min(1, 'Min per order must be at least 1').optional(),
|
|
176
|
+
maxPerOrder: zod_1.z.number().min(1, 'Max per order must be at least 1').optional()
|
|
177
|
+
}).optional()
|
|
178
|
+
}))
|
|
179
|
+
});
|
|
180
|
+
// Live
|
|
181
|
+
exports.liveEventEditSchema = zod_1.z.object({
|
|
182
|
+
eventId: zod_1.z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
183
|
+
hostId: zod_1.z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
184
|
+
// Live update only
|
|
185
|
+
liveUpdate: zod_1.z.string().max(500, 'Live update cannot exceed 500 characters').optional(),
|
|
186
|
+
// Ticket operational controls
|
|
187
|
+
tickets: zod_1.z.array(zod_1.z.object({
|
|
188
|
+
_id: zod_1.z.string(),
|
|
189
|
+
quantity: zod_1.z.number().min(1).optional(), // Increase only
|
|
190
|
+
isActive: zod_1.z.boolean().optional() // Pause sales
|
|
191
|
+
})).optional()
|
|
192
|
+
});
|
|
193
|
+
// Ended
|
|
194
|
+
exports.endedEventEditSchema = zod_1.z.object({
|
|
195
|
+
eventId: zod_1.z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
196
|
+
hostId: zod_1.z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
197
|
+
// Post-event content
|
|
198
|
+
recap: zod_1.z.string().max(2000, 'Recap cannot exceed 2000 characters').optional(),
|
|
199
|
+
eventPhotos: zod_1.z.array(zod_1.z.string()).max(20, 'Cannot have more than 20 event photos').optional()
|
|
117
200
|
});
|
|
118
201
|
// =============================================================================
|
|
119
202
|
// COMPOSITE SCHEMAS
|
|
@@ -7,7 +7,7 @@ import { documentSchema } from './utils/document.schema';
|
|
|
7
7
|
import { displayTicketSchema } from './utils/ticket.schema';
|
|
8
8
|
import { eventTypeSchema } from './utils/event.type.schema';
|
|
9
9
|
import { ageRestrictionSchema } from './utils/age.restriction.schema';
|
|
10
|
-
import { stepBasicsSchema, getEventSchema, protectedEventSchema, clientGetEventSchema, stepDetailsSchema, stepLogisticsSchema, stepVerifySchema, stepTicketsSchema, stepReviewSchema, submitEventSchema, draftEventSchema, pendingApprovalEditSchema, approvedEventEditSchema } from './events.schema';
|
|
10
|
+
import { stepBasicsSchema, getEventSchema, publishedEventEditSchema, liveEventEditSchema, endedEventEditSchema, protectedEventSchema, clientGetEventSchema, stepDetailsSchema, stepLogisticsSchema, stepVerifySchema, stepTicketsSchema, stepReviewSchema, submitEventSchema, draftEventSchema, pendingApprovalEditSchema, approvedEventEditSchema } from './events.schema';
|
|
11
11
|
export type Media = z.infer<typeof mediaSchema>;
|
|
12
12
|
export type CoverImage = z.infer<typeof mediaSchema.shape.coverImage>;
|
|
13
13
|
export type Gallery = z.infer<typeof mediaSchema.shape.gallery>;
|
|
@@ -37,3 +37,6 @@ export type ProtectedEventData = z.infer<typeof protectedEventSchema>;
|
|
|
37
37
|
export type ClientGetEventData = z.infer<typeof clientGetEventSchema>;
|
|
38
38
|
export type PendingApprovalEditData = z.infer<typeof pendingApprovalEditSchema>;
|
|
39
39
|
export type ApprovedEventEditData = z.infer<typeof approvedEventEditSchema>;
|
|
40
|
+
export type PublishedEventEditData = z.infer<typeof publishedEventEditSchema>;
|
|
41
|
+
export type LiveEventEditData = z.infer<typeof liveEventEditSchema>;
|
|
42
|
+
export type EndedEventEditData = z.infer<typeof endedEventEditSchema>;
|
package/package.json
CHANGED
|
@@ -98,32 +98,134 @@ export const protectedEventSchema = z.object({
|
|
|
98
98
|
hostId: z.string().regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
// Pending Approval
|
|
101
102
|
export const pendingApprovalEditSchema = z.object({
|
|
102
103
|
eventId: z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/, 'Event not found'),
|
|
103
104
|
hostId: z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
105
|
+
|
|
106
|
+
// Editable fields
|
|
107
|
+
description: z.string().min(50, 'Description must be at least 50 characters').max(MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
108
|
+
tagline: z.string().max(150, 'Tagline must be at most 150 characters').optional(),
|
|
109
|
+
highlights: z.array(z.string().max(200, 'Each highlight cannot exceed 200 characters'), { required_error: 'Highlights must be an array of strings' }).max(10, 'Cannot have more than 10 highlights').optional(),
|
|
110
|
+
languages: z.array(z.string()).optional(),
|
|
104
111
|
media: mediaSchema,
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
|
|
113
|
+
// Can add docs, not remove
|
|
114
|
+
additionalDocuments: z.array(documentSchema).optional(),
|
|
115
|
+
|
|
116
|
+
// Can clarify benefits, not change structure
|
|
117
|
+
tickets: z.array(z.object({
|
|
118
|
+
_id: z.string(),
|
|
119
|
+
benefits: z.array(z.string()).optional()
|
|
120
|
+
})).optional()
|
|
121
|
+
});
|
|
107
122
|
|
|
123
|
+
// Approved
|
|
108
124
|
export const approvedEventEditSchema = z.object({
|
|
109
125
|
eventId: z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/, 'Event not found'),
|
|
110
126
|
hostId: z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/, 'Unauthorized'),
|
|
127
|
+
|
|
128
|
+
// Marketing content
|
|
129
|
+
description: z.string().min(50, 'Description must be at least 50 characters').max(MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
130
|
+
tagline: z.string().max(150, 'Tagline must be at most 150 characters').optional(),
|
|
131
|
+
highlights: z.array(z.string().max(200)).max(10).optional(),
|
|
132
|
+
languages: z.array(z.string()).optional(),
|
|
111
133
|
media: mediaSchema,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
134
|
+
|
|
135
|
+
// Tickets (full control, no sales yet)
|
|
136
|
+
tickets: z.array(z.object({
|
|
137
|
+
_id: z.string().optional(), // Undefined = new tier
|
|
138
|
+
name: z.string({ required_error: 'Ticket name is required' }),
|
|
139
|
+
price: z.number({ required_error: 'Ticket price is required' }).min(0, 'Ticket price cannot be negative'),
|
|
140
|
+
quantity: z.number({ required_error: 'Ticket quantity is required' }).min(1, 'Ticket quantity must be at least 1'),
|
|
141
|
+
benefits: z.array(z.string()).optional(),
|
|
142
|
+
wristbandColor: z.string().default('#000000'),
|
|
143
|
+
isVisible: z.boolean().default(true),
|
|
144
|
+
isActive: z.boolean().default(true),
|
|
145
|
+
limits: z.object({
|
|
146
|
+
minPerOrder: z.number({ required_error: 'Min per order is required' }).min(1, 'Min per order must be at least 1'),
|
|
147
|
+
maxPerOrder: z.number({ required_error: 'Max per order is required' }).min(1, 'Max per order must be at least 1')
|
|
148
|
+
}).optional()
|
|
149
|
+
})).min(1),
|
|
150
|
+
|
|
151
|
+
// Minor date adjustments (±2 hours)
|
|
152
|
+
schedule: z.object({
|
|
153
|
+
startDate: z.date(),
|
|
154
|
+
endDate: z.date()
|
|
155
|
+
}).optional().refine(data => {
|
|
156
|
+
if (!data?.startDate || !data?.endDate) return false;
|
|
157
|
+
const diff = Math.abs(data?.startDate?.getTime() - data?.endDate?.getTime());
|
|
158
|
+
return diff <= 2 * 60 * 60 * 1000;
|
|
159
|
+
}, {
|
|
160
|
+
message: 'Schedule must be within 2 hours of original',
|
|
161
|
+
path: ['schedule', 'endDate']
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Published
|
|
166
|
+
export const publishedEventEditSchema = z.object({
|
|
167
|
+
eventId: z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
168
|
+
hostId: z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
169
|
+
|
|
170
|
+
// Can add, not remove
|
|
171
|
+
description: z.string().min(50, 'Description must be at least 50 characters').max(MAX_DESCRIPTION_LENGTH, `Description cannot exceed ${MAX_DESCRIPTION_LENGTH} characters`).optional(),
|
|
172
|
+
highlights: z.array(z.string().max(200, 'Each highlight cannot exceed 200 characters'), { required_error: 'Highlights must be an array of strings' }).max(10, 'Cannot have more than 10 highlights').optional(),
|
|
173
|
+
languages: z.array(z.string()).optional(),
|
|
174
|
+
|
|
175
|
+
// Media (with warning)
|
|
176
|
+
media: mediaSchema.optional(),
|
|
177
|
+
|
|
178
|
+
// Ticket updates (complex validation)
|
|
179
|
+
tickets: z.array(z.object({
|
|
180
|
+
_id: z.string(),
|
|
181
|
+
|
|
182
|
+
// Price change validation happens in controller
|
|
183
|
+
price: z.number().min(0).optional(),
|
|
184
|
+
|
|
185
|
+
// Quantity increase only (unless sold = 0)
|
|
186
|
+
quantity: z.number().min(1).optional(),
|
|
187
|
+
|
|
188
|
+
// Can add benefits, not remove
|
|
189
|
+
benefits: z.array(z.string()).optional(),
|
|
190
|
+
|
|
191
|
+
// Operational controls
|
|
192
|
+
wristbandColor: z.string().optional().default('#000000'),
|
|
193
|
+
isVisible: z.boolean().optional().default(true),
|
|
194
|
+
isActive: z.boolean().optional().default(true),
|
|
195
|
+
|
|
196
|
+
// Cannot change limits if sales exist
|
|
197
|
+
limits: z.object({
|
|
198
|
+
minPerOrder: z.number().min(1, 'Min per order must be at least 1').optional(),
|
|
199
|
+
maxPerOrder: z.number().min(1, 'Max per order must be at least 1').optional()
|
|
200
|
+
}).optional()
|
|
201
|
+
}))
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Live
|
|
205
|
+
export const liveEventEditSchema = z.object({
|
|
206
|
+
eventId: z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
207
|
+
hostId: z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
208
|
+
|
|
209
|
+
// Live update only
|
|
210
|
+
liveUpdate: z.string().max(500, 'Live update cannot exceed 500 characters').optional(),
|
|
211
|
+
|
|
212
|
+
// Ticket operational controls
|
|
213
|
+
tickets: z.array(z.object({
|
|
214
|
+
_id: z.string(),
|
|
215
|
+
quantity: z.number().min(1).optional(), // Increase only
|
|
216
|
+
isActive: z.boolean().optional() // Pause sales
|
|
217
|
+
})).optional()
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Ended
|
|
221
|
+
export const endedEventEditSchema = z.object({
|
|
222
|
+
eventId: z.string({ required_error: 'Event not found' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
223
|
+
hostId: z.string({ required_error: 'Unauthorized' }).regex(/^[0-9a-fA-F]{24}$/),
|
|
224
|
+
|
|
225
|
+
// Post-event content
|
|
226
|
+
recap: z.string().max(2000, 'Recap cannot exceed 2000 characters').optional(),
|
|
227
|
+
eventPhotos: z.array(z.string()).max(20, 'Cannot have more than 20 event photos').optional()
|
|
228
|
+
});
|
|
127
229
|
|
|
128
230
|
// =============================================================================
|
|
129
231
|
// COMPOSITE SCHEMAS
|
|
@@ -7,7 +7,7 @@ import { documentSchema } from './utils/document.schema';
|
|
|
7
7
|
import { displayTicketSchema } from './utils/ticket.schema';
|
|
8
8
|
import { eventTypeSchema } from './utils/event.type.schema';
|
|
9
9
|
import { ageRestrictionSchema } from './utils/age.restriction.schema';
|
|
10
|
-
import { stepBasicsSchema, getEventSchema, protectedEventSchema, clientGetEventSchema, stepDetailsSchema, stepLogisticsSchema, stepVerifySchema, stepTicketsSchema, stepReviewSchema, submitEventSchema, draftEventSchema, pendingApprovalEditSchema, approvedEventEditSchema } from './events.schema';
|
|
10
|
+
import { stepBasicsSchema, getEventSchema, publishedEventEditSchema, liveEventEditSchema, endedEventEditSchema, protectedEventSchema, clientGetEventSchema, stepDetailsSchema, stepLogisticsSchema, stepVerifySchema, stepTicketsSchema, stepReviewSchema, submitEventSchema, draftEventSchema, pendingApprovalEditSchema, approvedEventEditSchema } from './events.schema';
|
|
11
11
|
|
|
12
12
|
// =============================================================================
|
|
13
13
|
// TYPE EXPORTS
|
|
@@ -49,3 +49,6 @@ export type ProtectedEventData = z.infer<typeof protectedEventSchema>;
|
|
|
49
49
|
export type ClientGetEventData = z.infer<typeof clientGetEventSchema>;
|
|
50
50
|
export type PendingApprovalEditData = z.infer<typeof pendingApprovalEditSchema>;
|
|
51
51
|
export type ApprovedEventEditData = z.infer<typeof approvedEventEditSchema>;
|
|
52
|
+
export type PublishedEventEditData = z.infer<typeof publishedEventEditSchema>;
|
|
53
|
+
export type LiveEventEditData = z.infer<typeof liveEventEditSchema>;
|
|
54
|
+
export type EndedEventEditData = z.infer<typeof endedEventEditSchema>;
|