@mohasinac/appkit 2.6.8 → 2.7.0

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.
Files changed (34) hide show
  1. package/README.md +207 -0
  2. package/dist/_internal/server/jobs/core/onScamReportCreate.d.ts +12 -0
  3. package/dist/_internal/server/jobs/core/onScamReportCreate.js +50 -0
  4. package/dist/_internal/server/jobs/core/onScamReportRejected.d.ts +11 -0
  5. package/dist/_internal/server/jobs/core/onScamReportRejected.js +28 -0
  6. package/dist/_internal/server/jobs/core/onScamReportVerified.d.ts +11 -0
  7. package/dist/_internal/server/jobs/core/onScamReportVerified.js +28 -0
  8. package/dist/_internal/server/jobs/handlers/index.d.ts +2 -0
  9. package/dist/_internal/server/jobs/handlers/index.js +3 -0
  10. package/dist/_internal/server/jobs/handlers/onScamReportCreate.d.ts +2 -0
  11. package/dist/_internal/server/jobs/handlers/onScamReportCreate.js +7 -0
  12. package/dist/_internal/server/jobs/handlers/onScamReportUpdate.d.ts +2 -0
  13. package/dist/_internal/server/jobs/handlers/onScamReportUpdate.js +25 -0
  14. package/dist/client.d.ts +2 -0
  15. package/dist/client.js +1 -0
  16. package/dist/configs/next.js +2 -0
  17. package/dist/features/scams/components/ScamAwarenessModal.d.ts +5 -0
  18. package/dist/features/scams/components/ScamAwarenessModal.js +31 -0
  19. package/dist/features/scams/components/index.d.ts +2 -0
  20. package/dist/features/scams/components/index.js +1 -0
  21. package/dist/index.d.ts +4 -2
  22. package/dist/index.js +4 -5
  23. package/dist/jobs.d.ts +1 -1
  24. package/dist/jobs.js +2 -0
  25. package/dist/react/contexts/SessionContext.d.ts +1 -0
  26. package/dist/react/contexts/SessionContext.js +6 -0
  27. package/dist/seed/actions/demo-seed-actions.d.ts +1 -1
  28. package/dist/seed/index.d.ts +1 -0
  29. package/dist/seed/index.js +1 -0
  30. package/dist/seed/manifest.js +5 -0
  31. package/dist/seed/support-tickets-seed-data.d.ts +9 -0
  32. package/dist/seed/support-tickets-seed-data.js +135 -0
  33. package/dist/tailwind-utilities.css +1 -1
  34. package/package.json +210 -210
@@ -59,6 +59,7 @@ export { conversationsSeedData } from "./conversations-seed-data";
59
59
  export { groupedListingsSeedData } from "./grouped-listings-seed-data";
60
60
  // SB-UNI-V — bundlesSeedData merged into categoriesSeedData with categoryType:"bundle".
61
61
  export { scammersSeedData } from "./scammers-seed-data";
62
+ export { supportTicketsSeedData } from "./support-tickets-seed-data";
62
63
  export { productFeaturesSeedData } from "./product-features-seed-data";
63
64
  export { SEED_MANIFEST } from "./manifest";
64
65
  export { mergeFirestoreIndices, generateMergedFirestoreIndexFile, } from "./firestore-indexes";
@@ -37,6 +37,7 @@ import { conversationsSeedData } from "./conversations-seed-data";
37
37
  import { groupedListingsSeedData } from "./grouped-listings-seed-data";
38
38
  // SB-UNI-V — bundlesSeedData absorbed into categoriesSeedData.
39
39
  import { scammersSeedData } from "./scammers-seed-data";
40
+ import { supportTicketsSeedData } from "./support-tickets-seed-data";
40
41
  import { productFeaturesSeedData } from "./product-features-seed-data";
41
42
  function asArr(items) {
42
43
  return items ?? [];
@@ -158,6 +159,10 @@ export const SEED_MANIFEST = {
158
159
  ...s,
159
160
  name: s.displayNames?.[0] ?? s.id,
160
161
  }))),
162
+ supportTickets: pick(asArr(supportTicketsSeedData).map((t) => ({
163
+ ...t,
164
+ name: t.subject ?? t.id,
165
+ }))),
161
166
  productFeatures: pick(asArr(productFeaturesSeedData).map((f) => ({
162
167
  ...f,
163
168
  name: f.label ?? f.id,
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Support Tickets Seed Data — 6 tickets across all statuses and categories.
3
+ *
4
+ * Covers: open, in_progress, waiting_on_user, resolved, closed (2).
5
+ * Users: mix of buyers (rahul-sharma, priya-patel, arjun-singh, meera-nair).
6
+ * Employee assignee: user-simran-kaur (employee role).
7
+ */
8
+ import type { SupportTicketDocument } from "../features/support/schemas/firestore";
9
+ export declare const supportTicketsSeedData: Partial<SupportTicketDocument>[];
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Support Tickets Seed Data — 6 tickets across all statuses and categories.
3
+ *
4
+ * Covers: open, in_progress, waiting_on_user, resolved, closed (2).
5
+ * Users: mix of buyers (rahul-sharma, priya-patel, arjun-singh, meera-nair).
6
+ * Employee assignee: user-simran-kaur (employee role).
7
+ */
8
+ function msg(id, authorId, authorRole, body, daysAgo) {
9
+ const createdAt = new Date(Date.now() - daysAgo * 24 * 60 * 60 * 1000);
10
+ return { id, authorId, authorRole, body, createdAt };
11
+ }
12
+ const BASE = Date.now();
13
+ function daysBack(n) {
14
+ return new Date(BASE - n * 24 * 60 * 60 * 1000);
15
+ }
16
+ export const supportTicketsSeedData = [
17
+ // ── 1. Order issue — in progress ─────────────────────────────────────────
18
+ {
19
+ id: "ticket-rahul-order-001",
20
+ userId: "user-rahul-sharma",
21
+ userEmail: "rahul.sharma@example.com",
22
+ userDisplayName: "Rahul Sharma",
23
+ category: "order_issue",
24
+ subject: "Order delivered but item is missing from the box",
25
+ description: "I received order #order-rahul-001-pokemon-etb but the ETB box arrived empty — only the outer packaging was present. Please help.",
26
+ orderId: "order-rahul-001-pokemon-etb",
27
+ status: "in_progress",
28
+ priority: "high",
29
+ assignedTo: "user-simran-kaur",
30
+ assignedToName: "Simran Kaur",
31
+ messages: [
32
+ msg("msg-rahul-001-u1", "user-rahul-sharma", "user", "I received my order but it was empty! The seal was broken on arrival.", 5),
33
+ msg("msg-rahul-001-s1", "user-simran-kaur", "support", "Hi Rahul, we're sorry to hear this. I've raised a claim with the courier. Could you please share a photo of the packaging?", 4),
34
+ msg("msg-rahul-001-u2", "user-rahul-sharma", "user", "Photos attached. The outer tape was clearly cut and resealed.", 3),
35
+ ],
36
+ createdAt: daysBack(5),
37
+ updatedAt: daysBack(3),
38
+ },
39
+ // ── 2. Open ticket — refund request ───────────────────────────────────────
40
+ {
41
+ id: "ticket-priya-refund-001",
42
+ userId: "user-priya-patel",
43
+ userEmail: "priya.patel@example.com",
44
+ userDisplayName: "Priya Patel",
45
+ category: "refund_request",
46
+ subject: "Requesting refund for cancelled pre-order",
47
+ description: "I placed a pre-order for the Nendoroid Rem figure 3 months ago. The store has now closed. I would like a full refund of ₹2,499.",
48
+ status: "open",
49
+ priority: "normal",
50
+ messages: [
51
+ msg("msg-priya-001-u1", "user-priya-patel", "user", "The store closed without shipping. I paid via Razorpay. Transaction ID: pay_test_abc123.", 2),
52
+ ],
53
+ createdAt: daysBack(2),
54
+ updatedAt: daysBack(2),
55
+ },
56
+ // ── 3. Waiting on user — account recovery ─────────────────────────────────
57
+ {
58
+ id: "ticket-arjun-account-001",
59
+ userId: "user-arjun-singh",
60
+ userEmail: "arjun.singh@example.com",
61
+ userDisplayName: "Arjun Singh",
62
+ category: "account",
63
+ subject: "Cannot log in — OTP not arriving on new phone number",
64
+ description: "I changed my phone number and now OTP for login is going to the old number. I cannot access my account.",
65
+ status: "waiting_on_user",
66
+ priority: "normal",
67
+ assignedTo: "user-simran-kaur",
68
+ assignedToName: "Simran Kaur",
69
+ messages: [
70
+ msg("msg-arjun-001-u1", "user-arjun-singh", "user", "I'm locked out. My old number is no longer active.", 7),
71
+ msg("msg-arjun-001-s1", "user-simran-kaur", "support", "Hi Arjun, to verify ownership we need your registered email and last 4 digits of the payment card used on this account. Please reply here.", 6),
72
+ ],
73
+ createdAt: daysBack(7),
74
+ updatedAt: daysBack(6),
75
+ },
76
+ // ── 4. Resolved — listing dispute ─────────────────────────────────────────
77
+ {
78
+ id: "ticket-meera-dispute-001",
79
+ userId: "user-meera-nair",
80
+ userEmail: "meera.nair@example.com",
81
+ userDisplayName: "Meera Nair",
82
+ category: "listing_dispute",
83
+ subject: "Product description says mint condition but item is heavily played",
84
+ description: "The Beyblade BX-01 I received is scratched and worn. The listing said mint/unused. I want to return it.",
85
+ status: "resolved",
86
+ priority: "normal",
87
+ assignedTo: "user-simran-kaur",
88
+ assignedToName: "Simran Kaur",
89
+ messages: [
90
+ msg("msg-meera-001-u1", "user-meera-nair", "user", "The item is clearly not mint. Here are photos showing the scratches.", 12),
91
+ msg("msg-meera-001-s1", "user-simran-kaur", "support", "Thank you for the photos Meera. We've contacted the seller and initiated a return + full refund.", 11),
92
+ msg("msg-meera-001-s2", "user-simran-kaur", "support", "Refund of ₹1,200 has been processed back to your original payment method. This ticket is now resolved.", 8),
93
+ ],
94
+ resolvedAt: daysBack(8),
95
+ createdAt: daysBack(12),
96
+ updatedAt: daysBack(8),
97
+ },
98
+ // ── 5. Closed — auction dispute (terminal) ────────────────────────────────
99
+ {
100
+ id: "ticket-rahul-auction-001",
101
+ userId: "user-rahul-sharma",
102
+ userEmail: "rahul.sharma@example.com",
103
+ userDisplayName: "Rahul Sharma",
104
+ category: "auction_dispute",
105
+ subject: "Winning bid was removed from auction",
106
+ description: "I won the PSA 9 Charizard auction but my winning bid was removed without explanation.",
107
+ status: "closed",
108
+ priority: "low",
109
+ messages: [
110
+ msg("msg-rahul-002-u1", "user-rahul-sharma", "user", "My winning bid was cancelled. I have a screenshot.", 20),
111
+ msg("msg-rahul-002-s1", "user-simran-kaur", "support", "Hi Rahul, after reviewing the auction logs we found a duplicate bid was submitted. The correct winning bid remains active. No action needed.", 18),
112
+ msg("msg-rahul-002-u2", "user-rahul-sharma", "user", "Understood, thanks for clarifying.", 17),
113
+ ],
114
+ closedAt: daysBack(17),
115
+ createdAt: daysBack(20),
116
+ updatedAt: daysBack(17),
117
+ },
118
+ // ── 6. Open — general inquiry ─────────────────────────────────────────────
119
+ {
120
+ id: "ticket-kavya-general-001",
121
+ userId: "user-kavya-iyer",
122
+ userEmail: "kavya.iyer@example.com",
123
+ userDisplayName: "Kavya Iyer",
124
+ category: "general",
125
+ subject: "How do I become a verified seller?",
126
+ description: "I would like to start selling Pokémon cards on LetItRip. What are the steps to get verified and open a store?",
127
+ status: "open",
128
+ priority: "low",
129
+ messages: [
130
+ msg("msg-kavya-001-u1", "user-kavya-iyer", "user", "I've read the FAQ but couldn't find the exact verification requirements.", 1),
131
+ ],
132
+ createdAt: daysBack(1),
133
+ updatedAt: daysBack(1),
134
+ },
135
+ ];