This commit is contained in:
shafi54 2026-10-13 13:51:16 +05:30
parent 9f1ba08feb
commit a7456473e9
36 changed files with 1923 additions and 588 deletions

View file

@ -317,7 +317,7 @@ INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_lin
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(332,438,0,'Neha Nahid','9581983703','Aayesha manzil ','','Mahabubnagar','Telangana','509001',16.7310199,77.989817,'2026-05-12 04:57:54',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(333,441,0,'Syeda sara ','8897511092','Shah shab gutta , DO NAL ,TIPU SULTAN CHOWK','A.R CLINIC,SMS BUILDING ','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-05-12 08:42:56',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(334,412,1,'Mohd shezan','8125912433','Shah sahab gutta near kakatiya school ','','Mahabubnagar','Telangana','509001',16.7478762,78.0087191,'2026-05-12 19:32:42',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(335,444,1,'K Ravi Prakash ','9849767367','7-5-115/2 laxminagar colony ','Mahbubnagar ','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-05-13 02:14:17',NULL,16.75587,78.0188336,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(335,444,1,'K Ravi Prakash ','9849767367','7-5-115/2 laxminagar colony ','Mahbubnagar ','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-05-13 02:14:17',NULL,16.7560587,78.0188354,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(336,22,1,'14-2-105/3, Madhuranagar Colony, Near Hanuman Temple, Mahabubnagar, Telangana 509001','9066454938','N','','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-05-13 06:16:14',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(337,178,0,'Khadhar','7799492001','Najha Pride apartment door no 304 near district court beside Shiva dental clinic ','','Mahabubnagar','Telangana','509001',16.7329562,77.990655,'2026-05-13 14:35:45',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(338,447,0,'Chandu','9052466966','Near Hero Showroom, opposite Kallu dukhnam','Old palamoor, Ambedkar statue','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-05-14 05:44:41',NULL,NULL,NULL,NULL);
@ -485,7 +485,7 @@ INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_lin
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(506,692,0,'Arkanti','7731850260','1st floor RS super market','Balaji Nagar Colony','Mahabubnagar','Telangana','509001',16.731537426355906,77.99689417378941,'2026-07-14 04:12:09',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(507,693,1,'Vineeth ','8074137261','Shiva shakti nagar','','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-07-14 08:17:27',NULL,NULL,NULL,'https://maps.app.goo.gl/yksVAjnxvkBUd6fS9');
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(508,695,1,'Ayam','9553889447','4-2-24, Ramaiahbowli, MBNR','','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-07-14 15:25:21',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(509,679,1,'Santosh ','9603705128','Newtown opposite to malabar','','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-07-15 11:51:00',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(509,679,1,'Santosh ','9603705128','Newtown opposite to malabar','','Mahabubnagar','Telangana','509001',16.7113319,78.0250026,'2026-07-15 11:51:00',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(510,586,1,'Syed Ibrahim Hashmi','7396199405','Bk reddy colony ','','Mahabubnagar','Telangana','509001',16.7403003,78.0079772,'2026-07-15 20:56:51',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(511,696,0,'Meraj ','8099235943','Rajendra Nagar، near railway station mahabunag ','1-3-75/38','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-07-16 08:21:40',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(512,683,0,'Abdul raheem','7675938678','H.no: 5-4-85/F14/4','Opp Amena masjid, Tayyab nagar','Mahabubnagar','Telangana','509001',16.7375051,77.9926007,'2026-07-17 06:15:42',NULL,NULL,NULL,NULL);
@ -766,7 +766,7 @@ INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_lin
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(788,1203,0,'G Lingareddy ','9912090428','PBR residency 3rd floor b block 3016','Near pista House bypass 🛣️','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-09-19 15:55:49',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(789,1204,1,'Anil Kumar','9182449569','Near SR mart, Dist Sagara (uppara) Committee Hall','Yenugonda','Mahabubnagar','Telangana','509001',16.7511042,78.0341519,'2026-09-20 01:17:59',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(790,1206,1,'M RAMANA','9553257224','Near Chaithanya Central school ','Yenugonda near Kendriya vidyalaya','Mahabubnagar','Telangana','509001',16.7621603,78.0462386,'2026-09-20 02:18:53',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(791,1207,1,'Vijay','7989347494','1-6-9/3 palsab gutta opp lane to sri ramulu hospital','','Mahabubnagar','Telangana','509001',16.7535639,77.9991416,'2026-09-20 02:33:38',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(791,1207,0,'Vijay','7989347494','1-6-9/3 palsab gutta opp lane to sri ramulu hospital','','Mahabubnagar','Telangana','509001',16.7535639,77.9991416,'2026-09-20 02:33:38',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(792,1208,0,'Teja sri','7601018548','Ayodhya nagar colony ','Christanpally','Mahabubnagar','Telangana','509001',16.7258081,78.0096389,'2026-09-20 03:19:17',NULL,16.7254208,78.0097279,'https://maps.app.goo.gl/ESZA7HD9z6e9R5yH7');
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(793,1048,0,'G Umesh Kumar ','9912564056','Market Road','Near Samreen Chickhen Center','Mahabubnagar','Telangana','509001',16.7475781,77.9854545,'2026-09-20 03:39:19',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(794,1209,1,'Swetha ','6301975348','Ayodhya nagar chirstian pally','Hunman temple ','Mahabubnagar','Telangana','509001',16.7248072,78.0079245,'2026-09-20 03:44:49',NULL,NULL,NULL,NULL);
@ -810,7 +810,7 @@ INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_lin
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(832,1240,1,'Hafsa ','8121052035','4-1-116/7/e/1','Nimra cafe, Ramaiah bowli','Mahabubnagar','Telangana','509001',16.74141140037474,77.99183470574646,'2026-09-26 13:00:07',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(833,1255,1,'M umadevi','7382268404','Near chaithanya central school','Srieam colony yenugonda','Mahabubnagar','Telangana','509001',16.7621669,78.0461954,'2026-09-27 01:41:06',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(834,1256,1,'C vinodkumar ','9985440716','Flatno 416,manatown apartments','Nalanda autostart,shashabgutta','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-09-27 01:56:09',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(835,1257,0,'Hajra','6302068018','1-1-81/A4','Mothinagar','Mahabubnagar','Telangana','509001',16.7557058,77.9933981,'2026-09-27 02:41:05',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(835,1257,0,'Hajra','6302068018','1-1-81/A4','Mothinagar','Mahabubnagar','Telangana','509001',16.7557058,77.9933981,'2026-09-27 02:41:05',NULL,16.755685,77.9933083,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(836,1258,1,'Kusuma','9701920124','7-5-18','Venkateshwara colony ','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-09-27 03:11:52',NULL,16.7555812,78.0143206,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(837,1259,1,'Samyukta','9704905100','H.No 14-2-90/68/B, Srirama colony',' christianpally','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-09-27 03:37:20',NULL,16.7282973,78.0135654,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(838,1261,0,'Devayani','9951464320','Christian pally , double bed room','Bhagiratha , adharshnagar','Mahabubnagar','Telangana','509001',16.7191348,78.0111408,'2026-09-27 04:32:42',NULL,NULL,NULL,NULL);
@ -856,6 +856,8 @@ INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_lin
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(878,1313,0,'vamshi','8523031242','House no. 14-3-68, NEAR Fatima vidhyalayam school, christianpally Ayodhyanagar','','Mahabubnagar','Telangana','509001',16.7263356,78.0086242,'2026-10-10 08:59:42',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(879,1316,1,'Mudassir ','8688942045','10-7-17/2, Near SV Mart, Srinivasa Colony','','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-10-10 17:58:52',NULL,16.7512383,78.0254683,'https://maps.app.goo.gl/EW66q4XDntduJ24T7?g_st=ac');
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(880,1160,0,'SHANKAR','9505751237','8-5-42/A Dhanalaxmi Colony ','Abhaya Anjaneya Swamy temple,Teachers colony Mettugadda ','Mahabubnagar','Telangana','509001',16.7489837,78.0153721,'2026-10-11 08:48:07',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(881,679,0,'Priyanka ','8919926863','Sarika township ','','Mahabubnagar','Telangana','509001',16.7112532,78.0250534,'2026-10-12 04:15:13',NULL,NULL,NULL,NULL);
INSERT INTO "addresses" ("id","user_id","is_default","name","phone","address_line1","address_line2","city","state","pincode","latitude","longitude","created_at","zone_id","admin_latitude","admin_longitude","google_maps_url") VALUES(882,1207,1,'Vijay','7989347494','1-6-9/3 palsab gutta','Opp lane to sri ramulu hospital','Mahabubnagar','Telangana','509001',NULL,NULL,'2026-10-12 05:03:14',NULL,NULL,NULL,NULL);
CREATE TABLE IF NOT EXISTS "complaints" ("id" INTEGER PRIMARY KEY, "user_id" INTEGER NOT NULL, "order_id" INTEGER, "complaint_body" TEXT NOT NULL, "is_resolved" INTEGER NOT NULL DEFAULT false, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "response" TEXT, "images" TEXT);
INSERT INTO "complaints" ("id","user_id","order_id","complaint_body","is_resolved","created_at","response","images") VALUES(4,17,NULL,'Hello',1,'2025-12-19T08:34:32.924Z','Hi',NULL);
INSERT INTO "complaints" ("id","user_id","order_id","complaint_body","is_resolved","created_at","response","images") VALUES(5,17,NULL,'Hello',1,'2025-12-19T09:32:59.187Z','','["complaint-images/1766136777180-0"]');
@ -2756,6 +2758,16 @@ INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active"
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2046,'2026-10-12T10:30:00.000Z','2026-10-12T10:00:00.000Z',1,'{}',0,'[12,11,10,9,8,5]',0,'[1,2,3,5,7,8,9,10,11,13,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,76,77,78,79,80,81,82,88,89,90,91,92,94,95,96,97,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,129,130,131,132,133,134,135,136,137,138,139,140,141,144,145,146,147,148,149]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2047,'2026-10-12T12:30:00.000Z','2026-10-12T12:00:00.000Z',1,'{}',0,'[12,11,10,9,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,2,3,10,21,23,24,36,40,41,42,80,137]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2048,'2026-10-12T13:30:00.000Z','2026-10-12T13:00:00.000Z',1,'{}',0,'[12,11,10,9,5]',0,'[2,3,6,7,8,9,10,11,13,21,22,23,24,25,26,36,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,80,81,82,96,100,102,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,129,130,131,132,133,134,135,137,148]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2049,'2026-10-13T01:30:00.000Z','2026-10-13T01:20:00.000Z',1,'{}',0,'[9,8,7,5]',0,'[9,22,81,82,102,5,6,13,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2050,'2026-10-13T02:30:00.000Z','2026-10-13T02:20:00.000Z',1,'{}',0,'[12,11,10,9,8,7,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2051,'2026-10-13T05:30:00.000Z','2026-10-13T05:20:00.000Z',1,'{}',0,'[12,11,10,9,8,7,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2052,'2026-10-13T06:30:00.000Z','2026-10-13T06:20:00.000Z',1,'{}',0,'[12,11,10,9,8,7,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2053,'2026-10-13T09:30:00.000Z','2026-10-13T09:20:00.000Z',1,'{}',0,'[12,11,10,9,8,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2054,'2026-10-13T10:30:00.000Z','2026-10-13T10:20:00.000Z',1,'{}',0,'[12,11,10,9,8,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,136,138]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2055,'2026-10-13T12:30:00.000Z','2026-10-13T12:20:00.000Z',1,'{}',0,'[12,11,10,9,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,2,3,10,21,23,24,36,40,41,42,80,137,141]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2056,'2026-10-13T13:30:00.000Z','2026-10-13T13:20:00.000Z',1,'{}',0,'[12,11,10,9,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,2,3,10,21,23,24,36,40,41,42,80,137,141]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2057,'2026-10-14T01:30:00.000Z','2026-10-14T01:20:00.000Z',1,'{}',0,'[9,8,7,5]',0,'[9,22,81,82,102,5,6,13,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,140,139,138,136]');
INSERT INTO "delivery_slot_info" ("id","delivery_time","freeze_time","is_active","delivery_sequence","is_flash","group_ids","is_capacity_full","sku_ids") VALUES(2058,'2026-10-14T02:30:00.000Z','2026-10-14T02:20:00.000Z',1,'{}',0,'[12,11,10,9,8,7,5]',0,'[129,130,131,132,133,134,135,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,148,6,7,8,11,13,25,26,38,39,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,73,96,100,125,126,9,22,81,82,102,5,16,17,18,19,27,28,29,30,31,32,33,37,45,64,65,66,67,68,69,70,71,72,74,76,77,78,79,88,89,90,91,92,94,95,97,101,103,127,144,145,146,4,14,35,86,98,99,2,3,10,21,23,24,36,40,41,42,80,137,149,147,141,140,139,138,136]');
CREATE TABLE IF NOT EXISTS "home_banners" ("id" INTEGER PRIMARY KEY, "name" TEXT NOT NULL, "image_url" TEXT NOT NULL, "description" TEXT, "redirect_url" TEXT, "serial_num" INTEGER, "is_active" INTEGER NOT NULL DEFAULT false, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "last_updated" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "sku_ids" TEXT);
INSERT INTO "home_banners" ("id","name","image_url","description","redirect_url","serial_num","is_active","created_at","last_updated","sku_ids") VALUES(9,'10%off ','1770281046297.jpg',NULL,NULL,NULL,0,'2026-02-05T08:44:06.996Z','2026-09-04T15:04:56.030Z','[1,2,3,4,5,6,8,7,9,11,13,12,10]');
INSERT INTO "home_banners" ("id","name","image_url","description","redirect_url","serial_num","is_active","created_at","last_updated","sku_ids") VALUES(11,'Daily veggies ','store-images/1770429593455.jpg','Under 19 ',NULL,3,0,'2026-02-07T01:59:57.566Z','2026-08-19T04:14:07.794Z','[45,72,76,97,70,32,74,77,33]');
@ -2768,7 +2780,7 @@ INSERT INTO "key_val_store" ("key","value") VALUES('deliveryCharge','15');
INSERT INTO "key_val_store" ("key","value") VALUES('flashDeliveryCharge','39.0');
INSERT INTO "key_val_store" ("key","value") VALUES('flashFreeDeliveryThreshold','399');
INSERT INTO "key_val_store" ("key","value") VALUES('freeDeliveryThreshold','249');
INSERT INTO "key_val_store" ("key","value") VALUES('isFlashDeliveryEnabled','false');
INSERT INTO "key_val_store" ("key","value") VALUES('isFlashDeliveryEnabled','true');
INSERT INTO "key_val_store" ("key","value") VALUES('minRegularOrderValue','249');
INSERT INTO "key_val_store" ("key","value") VALUES('playStoreUrl','https://info.freshyo.in/qr-based-download');
INSERT INTO "key_val_store" ("key","value") VALUES('popularItems','40,109,9,75,98,6,24,59');
@ -2777,9 +2789,9 @@ INSERT INTO "key_val_store" ("key","value") VALUES('supportEmail','qushammohd@gm
INSERT INTO "key_val_store" ("key","value") VALUES('supportMobile','9000885620');
INSERT INTO "key_val_store" ("key","value") VALUES('tester','value41');
INSERT INTO "key_val_store" ("key","value") VALUES('versionNum','1.2.0');
INSERT INTO "key_val_store" ("key","value") VALUES('cache_version','768');
INSERT INTO "key_val_store" ("key","value") VALUES('slots_version_num','655');
INSERT INTO "key_val_store" ("key","value") VALUES('availability_version_num','109');
INSERT INTO "key_val_store" ("key","value") VALUES('cache_version','769');
INSERT INTO "key_val_store" ("key","value") VALUES('slots_version_num','666');
INSERT INTO "key_val_store" ("key","value") VALUES('availability_version_num','110');
INSERT INTO "key_val_store" ("key","value") VALUES('tagsOrder','9,1,2,4,5,8,3,7,6');
CREATE TABLE IF NOT EXISTS "notif_creds" ("id" INTEGER PRIMARY KEY, "token" TEXT NOT NULL, "added_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "user_id" INTEGER NOT NULL, "last_verified" TEXT);
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(3,'ExponentPushToken[iv6POIJTUIiGpkElL84fG7]','2026-02-07T16:46:24.831Z',7,'2026-10-10T17:57:30.367Z');
@ -2803,25 +2815,25 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(24,'ExponentPushToken[B2zWnHNaumIgbeFFKO-15D]','2026-02-09T19:53:37.594Z',113,'2026-02-10T07:43:48.632Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(25,'ExponentPushToken[wIhrdlAmwj0Eytvz3W3TTZ]','2026-02-10T11:09:24.848Z',127,'2026-04-18T06:53:49.329Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(26,'ExponentPushToken[hFUlPFOKMdAUgtDP7EtSzM]','2026-02-10T11:33:43.821Z',3,'2026-02-24T11:16:46.799Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(27,'ExponentPushToken[NymZTEED3G7YCyDg7ihgBA]','2026-02-11T03:16:04.540Z',2,'2026-10-11T13:24:38.971Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(27,'ExponentPushToken[NymZTEED3G7YCyDg7ihgBA]','2026-02-11T03:16:04.540Z',2,'2026-10-13T01:59:56.710Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(28,'ExponentPushToken[ARCT4KD7CJ_pFF_GkywepP]','2026-02-11T11:34:32.238Z',115,'2026-10-11T08:16:00.995Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(29,'ExponentPushToken[NN4v16BFslBX8ryVXDwQIg]','2026-02-12T08:46:42.421Z',128,'2026-02-17T19:04:12.936Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(30,'ExponentPushToken[qbteKBC1wbLMCe1ltpul7u]','2026-02-12T13:28:00.376Z',129,'2026-02-12T13:28:00.375Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(31,'ExponentPushToken[PfjMc_CTRvSvOWtSNmaHhL]','2026-02-14T10:25:41.451Z',131,'2026-10-11T12:52:17.790Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(31,'ExponentPushToken[PfjMc_CTRvSvOWtSNmaHhL]','2026-02-14T10:25:41.451Z',131,'2026-10-13T06:20:51.433Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(32,'ExponentPushToken[dugZtvNyRBevvIcQED783-]','2026-02-14T18:42:44.549Z',120,'2026-10-11T03:28:44.506Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(33,'ExponentPushToken[5AOIo1AxGkk5zpoVANRRxq]','2026-02-15T04:35:26.237Z',132,'2026-10-10T12:29:32.906Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(33,'ExponentPushToken[5AOIo1AxGkk5zpoVANRRxq]','2026-02-15T04:35:26.237Z',132,'2026-10-13T04:51:49.909Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(34,'ExponentPushToken[1ZJ_ubPRINgtgfF4JcRz7Q]','2026-02-15T06:45:32.122Z',133,'2026-02-15T06:45:32.121Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(35,'ExponentPushToken[pIQ2waNDjjSHjQYJbXKD8m]','2026-02-15T07:14:10.912Z',9,'2026-02-15T07:14:10.910Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(37,'ExponentPushToken[kq0I8ADfcQ4VcsZ0yK0Mlc]','2026-02-16T04:01:56.375Z',102,'2026-07-05T14:39:51.366Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(38,'ExponentPushToken[8wH85rFtQRMk7ciFszmirX]','2026-02-16T09:30:32.930Z',134,'2026-09-08T07:22:34.339Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(39,'ExponentPushToken[YJRSQmMUEUbaI2VCZLaoN_]','2026-02-16T09:49:56.439Z',6,'2026-10-11T07:45:56.290Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(39,'ExponentPushToken[YJRSQmMUEUbaI2VCZLaoN_]','2026-02-16T09:49:56.439Z',6,'2026-10-13T05:14:17.480Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(40,'ExponentPushToken[QoWbURL2N8-3jRhQwfnRP_]','2026-02-17T08:59:14.561Z',135,'2026-02-17T08:59:14.561Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(41,'ExponentPushToken[sz_g75Il_CNAG6KpEAxYUH]','2026-02-17T12:56:33.589Z',136,'2026-02-21T08:42:45.220Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(42,'ExponentPushToken[JMEvkUHKT0n34hcs-MiJAJ]','2026-02-17T14:22:02.805Z',137,'2026-02-17T18:35:14.821Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(43,'ExponentPushToken[1msqBjJghAi4y8iYwJU-mS]','2026-02-17T14:36:43.131Z',138,'2026-02-23T07:55:49.796Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(44,'ExponentPushToken[Wvc-xZKA5atNZTuIldtSIw]','2026-02-17T14:52:56.267Z',139,'2026-02-22T09:24:47.956Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(45,'ExponentPushToken[cZOImkGKtoAxHQZgVtqP2K]','2026-02-17T19:17:10.364Z',140,'2026-02-20T09:47:44.482Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(46,'ExponentPushToken[Z9RdieHVKXjshIx5Fde2N_]','2026-02-18T01:14:42.642Z',141,'2026-10-09T02:43:00.335Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(46,'ExponentPushToken[Z9RdieHVKXjshIx5Fde2N_]','2026-02-18T01:14:42.642Z',141,'2026-10-12T03:44:37.150Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(47,'ExponentPushToken[y_gztJB3YIgxaTIe90h081]','2026-02-18T03:09:14.285Z',26,'2026-08-29T06:18:28.107Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(48,'ExponentPushToken[PwdA7uENlBKK9zfX0IUQHX]','2026-02-18T03:53:25.609Z',142,'2026-02-18T03:58:05.274Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(49,'ExponentPushToken[I9t84QIYuJ2wkBXTQCrWiO]','2026-02-18T04:24:14.079Z',143,'2026-02-20T07:23:38.305Z');
@ -2937,7 +2949,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(178,'ExponentPushToken[7GSJrGD9NaX281KgJzBLLH]','2026-03-03T14:06:35.808Z',253,'2026-03-03T14:06:35.807Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(179,'ExponentPushToken[UcUA5tEEV70FB2Ntz-oFJ2]','2026-03-03T16:06:53.662Z',254,'2026-03-20T07:56:23.132Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(181,'ExponentPushToken[1ls_ZXJwn3uuvQh4ePvAne]','2026-03-04T04:13:02.637Z',255,'2026-03-04T04:20:17.120Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(182,'ExponentPushToken[M_HyPqPheUp3I3i9Z5stZt]','2026-03-04T08:31:03.048Z',256,'2026-10-06T06:23:50.978Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(182,'ExponentPushToken[M_HyPqPheUp3I3i9Z5stZt]','2026-03-04T08:31:03.048Z',256,'2026-10-13T06:15:13.381Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(183,'ExponentPushToken[qvh_3nP9G4GL0AEDqg7SGg]','2026-03-04T09:19:36.095Z',257,'2026-03-10T19:55:04.631Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(184,'ExponentPushToken[E_ph_sC9qUQOUhnQmTcaCO]','2026-03-04T09:38:31.976Z',258,'2026-03-16T12:25:30.120Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(185,'ExponentPushToken[GrgPQsDgwa5N3D4zYWM6Bq]','2026-03-04T10:37:39.397Z',259,'2026-03-09T15:41:51.843Z');
@ -2979,7 +2991,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(227,'ExponentPushToken[KrzenZDKrmKjs9nnlDdqVp]','2026-03-18T12:07:56.003Z',295,'2026-03-20T16:17:15.569Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(228,'ExponentPushToken[6jP5awEVcOkUF3xzx3sY7g]','2026-03-18T14:53:18.855Z',296,'2026-03-20T15:10:45.983Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(229,'ExponentPushToken[SjZtCwG48V9kckmazhCxBU]','2026-03-18T15:00:21.098Z',297,'2026-03-18T15:00:21.097Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(230,'ExponentPushToken[4VLV_PLSbgxLfKYSwZHxpk]','2026-03-19T09:24:17.902Z',299,'2026-10-10T12:35:51.773Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(230,'ExponentPushToken[4VLV_PLSbgxLfKYSwZHxpk]','2026-03-19T09:24:17.902Z',299,'2026-10-13T01:20:07.686Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(231,'ExponentPushToken[YZHGJjG1PTLMLMrm4X4YAv]','2026-03-19T10:02:09.265Z',300,'2026-03-20T11:21:41.947Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(233,'ExponentPushToken[QzIvHhP38LpZlCk4Yoy7YW]','2026-03-20T06:54:00.415Z',227,'2026-03-21T15:29:41.502Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(236,'ExponentPushToken[aYViaUOIQOkf4RLpcMFgWY]','2026-03-21T01:24:29.259Z',303,'2026-03-26T15:13:31.451Z');
@ -3071,7 +3083,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(324,'ExponentPushToken[vWtCMdGn-7K6jWyQk2lFKx]','2026-04-24 01:12:19',389,'2026-09-13T04:46:40.892Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(325,'ExponentPushToken[TJHw09Gpo526UDmzi9NQdO]','2026-04-24 12:52:45',392,'2026-06-01T06:19:48.396Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(326,'ExponentPushToken[iZh0JmFuUYDghpLdjpvRW3]','2026-04-25 09:42:12',311,'2026-10-09T09:09:27.937Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(327,'ExponentPushToken[tfiAuQDclBJ1ExvmA97AtP]','2026-04-26 05:27:43',178,'2026-10-11T02:40:19.924Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(327,'ExponentPushToken[tfiAuQDclBJ1ExvmA97AtP]','2026-04-26 05:27:43',178,'2026-10-13T07:01:14.162Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(328,'ExponentPushToken[-TfvgjCm-H5f5KUd_dst3z]','2026-04-26 06:54:10',393,'2026-04-26T06:54:10.942Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(329,'ExponentPushToken[YRUnjbHj5rGddo3s1Jt1w_]','2026-04-26 12:20:32',394,'2026-04-27T13:58:37.560Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(330,'ExponentPushToken[Y-FOBnKHoufsS0qOs7JgIo]','2026-04-26 19:07:59',395,'2026-05-06T10:55:07.749Z');
@ -3099,7 +3111,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(352,'ExponentPushToken[ARCT4KD7CJ_pFF_GkywepP]','2026-05-03 07:42:43',252,'2026-08-04T06:47:49.709Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(353,'ExponentPushToken[7cM08dMnBGFHy6xI2JNg92]','2026-05-03 08:25:16',415,'2026-05-03T12:46:28.748Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(354,'ExponentPushToken[1iTOA2PRmS1yXMkeACyNhn]','2026-05-03 08:35:06',414,'2026-06-11T02:08:20.049Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(355,'ExponentPushToken[hiF_0uHNzkgGH-mGGzfN2Y]','2026-05-03 17:18:45',416,'2026-10-11T13:49:45.297Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(355,'ExponentPushToken[hiF_0uHNzkgGH-mGGzfN2Y]','2026-05-03 17:18:45',416,'2026-10-12T16:43:06.171Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(356,'ExponentPushToken[yBptF0NDaIJ6Zhf1IqyTUe]','2026-05-04 08:43:26',417,'2026-05-04T08:43:26.929Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(357,'ExponentPushToken[b5wNLBOa8Jce4cOmzgvVMr]','2026-05-04 12:38:42',415,'2026-05-04T12:59:40.224Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(358,'ExponentPushToken[Z9CZXEK7YJHkZexvhbYVdk]','2026-05-05 08:39:11',418,'2026-05-12T04:05:26.268Z');
@ -3126,7 +3138,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(379,'ExponentPushToken[VY1lpUFK2Fw6V6aJ5LokIt]','2026-05-12 06:03:32',439,'2026-06-10T04:33:08.668Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(380,'ExponentPushToken[GA8vDtGZGSLyXTIw8p73Z2]','2026-05-12 07:14:36',440,'2026-10-07T02:10:55.325Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(381,'ExponentPushToken[nTI6kIOJyQjAEsl9kLdguv]','2026-05-12 08:40:29',441,'2026-05-15T17:29:56.071Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(382,'ExponentPushToken[BwD4IWC1zCruWA2ZZcRZ9n]','2026-05-13 02:12:47',444,'2026-09-28T14:24:54.242Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(382,'ExponentPushToken[BwD4IWC1zCruWA2ZZcRZ9n]','2026-05-13 02:12:47',444,'2026-10-13T05:27:00.418Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(383,'ExponentPushToken[89CRhTI7hACC4Z7qHwx0Ol]','2026-05-13 04:22:12',96,'2026-05-13T04:22:12.371Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(384,'ExponentPushToken[nWqqVRF6SKgTNTezkCW9pi]','2026-05-13 10:55:35',446,'2026-05-13T10:55:35.073Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(385,'ExponentPushToken[kVgsNRKL-vXKdfihxkHK69]','2026-05-14 05:41:13',447,'2026-05-14T05:41:13.163Z');
@ -3172,7 +3184,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(425,'ExponentPushToken[PowDUOG3Bormg6-1SBsuiu]','2026-05-22 03:17:23',491,'2026-05-30T07:59:12.100Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(426,'ExponentPushToken[tioFveItRlA7fTirESkDg6]','2026-05-22 05:06:05',492,'2026-10-05T15:34:46.197Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(427,'ExponentPushToken[FILgJIA4CF8h6Th5PrBj-m]','2026-05-22 06:32:38',493,'2026-07-31T14:01:28.590Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(428,'ExponentPushToken[ixGazvOfrCBIMFMjov2-qW]','2026-05-22 14:02:48',494,'2026-10-08T09:57:03.760Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(428,'ExponentPushToken[ixGazvOfrCBIMFMjov2-qW]','2026-05-22 14:02:48',494,'2026-10-12T14:06:34.564Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(429,'ExponentPushToken[F8ugp5MHbdW2gq6IU-mTj9]','2026-05-23 06:59:51',496,'2026-05-23T06:59:51.427Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(430,'ExponentPushToken[mYGulxOHjS3smtYG6104Gj]','2026-05-23 07:00:44',497,'2026-06-03T07:46:58.286Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(431,'ExponentPushToken[e25COGDjnLy9hJWwyZ3lwN]','2026-05-23 07:06:01',498,'2026-07-20T13:47:26.421Z');
@ -3358,7 +3370,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(611,'ExponentPushToken[FPAgKfBKS1sh8jq517sevp]','2026-07-08 12:22:26',677,'2026-07-17T10:21:58.054Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(612,'ExponentPushToken[oIarlYEtOCUFkVSqcc53O3]','2026-07-08 15:14:41',54,'2026-07-08T15:14:41.913Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(613,'ExponentPushToken[3UNORxC2myXTjhYAds782V]','2026-07-09 12:32:51',678,'2026-09-15T15:04:23.177Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(614,'ExponentPushToken[q_KN8qFGPp3PakQnlphN4p]','2026-07-09 12:34:16',679,'2026-10-01T14:29:03.158Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(614,'ExponentPushToken[q_KN8qFGPp3PakQnlphN4p]','2026-07-09 12:34:16',679,'2026-10-12T04:59:35.792Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(615,'ExponentPushToken[9MrERFDg6xP8pX26WBdHmn]','2026-07-10 00:46:23',680,'2026-08-09T07:14:59.003Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(616,'ExponentPushToken[-c_Wi0EyO9S76beCpMviRu]','2026-07-10 13:32:38',683,'2026-08-08T13:50:45.234Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(617,'ExponentPushToken[GSDi_oBQR1t6a4oYAbYymO]','2026-07-10 14:50:57',36,'2026-09-26T13:20:58.081Z');
@ -3385,19 +3397,19 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(638,'ExponentPushToken[dOlEajFNIax8rdaTbBkNlc]','2026-07-21 02:30:00',706,'2026-08-07T04:10:38.432Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(639,'ExponentPushToken[jW54u-I5_OejWjAkT2qUfE]','2026-07-23 16:57:18',287,'2026-09-12T12:33:12.087Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(640,'ExponentPushToken[a_386KOA4xwSpcIkT0mGUi]','2026-07-25 10:18:36',709,'2026-07-25T10:18:36.972Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(641,'ExponentPushToken[2NZqtPL16Um00KZCcMh0us]','2026-07-25 15:14:10',710,'2026-10-11T11:15:24.883Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(641,'ExponentPushToken[2NZqtPL16Um00KZCcMh0us]','2026-07-25 15:14:10',710,'2026-10-12T04:49:41.735Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(642,'ExponentPushToken[8hKXOnIpaUkmy10OUlclHN]','2026-07-25 15:17:25',711,'2026-09-19T03:34:28.425Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(643,'ExponentPushToken[7h7wnsIG9HYUoyBvb4X8wS]','2026-07-26 02:54:02',677,'2026-09-28T02:22:48.903Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(644,'ExponentPushToken[OKi6lkFWT3Qg5yj9DXJDO_]','2026-07-26 10:42:54',712,'2026-07-26T10:42:54.332Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(645,'ExponentPushToken[8fp2aLMdcCfmHVIDQpXeAA]','2026-07-27 03:27:39',713,'2026-07-27T03:45:30.720Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(646,'ExponentPushToken[BEVARONVXrlap4i5FLPKdf]','2026-07-28 06:28:09',714,'2026-09-29T05:06:55.257Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(647,'ExponentPushToken[tMg5fFP6YY0DQ8rueB_S7m]','2026-07-28 12:55:09',704,'2026-09-30T07:32:50.341Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(648,'ExponentPushToken[FILgJIA4CF8h6Th5PrBj-m]','2026-07-31 14:01:52',517,'2026-10-11T04:57:36.790Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(648,'ExponentPushToken[FILgJIA4CF8h6Th5PrBj-m]','2026-07-31 14:01:52',517,'2026-10-13T03:39:53.402Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(649,'ExponentPushToken[_fOMzgDKDz8CqLHUhEpLEk]','2026-08-01 01:08:10',715,'2026-08-01T01:08:10.898Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(650,'ExponentPushToken[M1y705Lz8R6qQ1oxHcBoZw]','2026-08-01 10:52:12',716,'2026-08-06T11:51:50.451Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(651,'ExponentPushToken[vos5rCCZVRHtLzGPjohv12]','2026-08-01 17:36:52',717,'2026-08-01T17:36:52.283Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(652,'ExponentPushToken[f8LbUiDGtYwWAIY9O_1UQj]','2026-08-02 04:52:04',718,'2026-08-02T04:52:04.723Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(653,'ExponentPushToken[Qvv6yxDQHnsGehZ3M427Lf]','2026-08-03 03:41:15',721,'2026-10-10T03:41:46.243Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(653,'ExponentPushToken[Qvv6yxDQHnsGehZ3M427Lf]','2026-08-03 03:41:15',721,'2026-10-12T10:35:16.820Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(654,'ExponentPushToken[lDQPQJLUVLFCcYGB1FQ2qR]','2026-08-03 04:32:25',722,'2026-08-03T04:32:25.734Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(655,'ExponentPushToken[b4QA-aJ-ucaKCezt_Uyd4o]','2026-08-03 09:51:13',723,'2026-09-03T02:31:43.779Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(656,'ExponentPushToken[lIHkB5A_on888D0p5-NW54]','2026-08-03 14:07:41',724,'2026-08-04T06:47:24.830Z');
@ -3457,8 +3469,8 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(710,'ExponentPushToken[DfXROmDG8YJTmvfcfVxMpe]','2026-08-23 04:49:05',773,'2026-09-27T04:20:25.487Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(711,'ExponentPushToken[tQsJhjJzn-50yVdmhNgCV6]','2026-08-23 12:41:26',774,'2026-10-01T13:02:10.973Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(712,'ExponentPushToken[A7oX6UATJaJSzbqtsn0yr7]','2026-08-25 12:51:53',775,'2026-08-25T12:51:53.370Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(713,'ExponentPushToken[RQkA2GC-Bx6xDJte59EcBq]','2026-08-26 03:07:00',631,'2026-10-08T01:17:43.219Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(714,'ExponentPushToken[FtW_9WFmvw03mvp8R_IlWO]','2026-08-26 04:49:34',777,'2026-10-04T01:53:35.745Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(713,'ExponentPushToken[RQkA2GC-Bx6xDJte59EcBq]','2026-08-26 03:07:00',631,'2026-10-12T06:26:21.868Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(714,'ExponentPushToken[FtW_9WFmvw03mvp8R_IlWO]','2026-08-26 04:49:34',777,'2026-10-12T23:57:36.919Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(715,'ExponentPushToken[T0eGUjNcmCOQ7NPLybYuA9]','2026-08-28 00:23:22',778,'2026-09-12T05:10:33.056Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(716,'ExponentPushToken[x6SwyVAH1qfqZLVbCVQkex]','2026-08-28 04:02:04',753,'2026-08-28T04:02:04.916Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(717,'ExponentPushToken[n7SxWSMs2W7ui6TYUgAEbK]','2026-08-28 13:47:11',779,'2026-09-22T13:05:37.131Z');
@ -3467,7 +3479,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(720,'ExponentPushToken[xrdiTHAyODb8MC2Ods51zE]','2026-08-29 13:42:13',783,'2026-08-29T13:42:13.252Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(721,'ExponentPushToken[MngcWzOVupG2jCP92aFAHU]','2026-08-29 15:28:31',784,'2026-09-27T03:02:00.567Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(722,'ExponentPushToken[An3bpDJv4ViVBBpzCzM44a]','2026-08-30 01:19:31',29,'2026-08-30T01:19:31.979Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(723,'ExponentPushToken[t3FYXoICjlyY0mLg8oJk83]','2026-08-30 02:02:58',785,'2026-10-11T05:12:53.621Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(723,'ExponentPushToken[t3FYXoICjlyY0mLg8oJk83]','2026-08-30 02:02:58',785,'2026-10-13T06:28:02.440Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(724,'ExponentPushToken[cqGWnjOjW7qpXvF00rCIwY]','2026-08-30 04:10:48',787,'2026-10-05T12:06:12.922Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(725,'ExponentPushToken[loVe35LpngZFsQIIQLmHnS]','2026-08-30 14:44:23',788,'2026-10-10T15:23:27.423Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(726,'ExponentPushToken[jMAuL9Kx7xb-v6TQ3-YEQ-]','2026-09-04 08:44:41',789,'2026-09-07T17:53:58.352Z');
@ -3545,7 +3557,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(799,'ExponentPushToken[xD2AcXHpeT_IKIPzIxh4Sx]','2026-09-11 15:11:29',871,'2026-09-25T07:42:47.463Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(800,'ExponentPushToken[Y8svYUGlN_BRtJ00DSdxYr]','2026-09-11 15:12:07',857,'2026-09-21T14:09:43.139Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(801,'ExponentPushToken[FH0qtYJCfctA8uPKYKG0ak]','2026-09-11 15:13:33',872,'2026-10-03T05:13:24.995Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(802,'ExponentPushToken[e05_NhNcgYuIFWMxrqoP0X]','2026-09-11 15:13:51',846,'2026-10-11T11:49:11.058Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(802,'ExponentPushToken[e05_NhNcgYuIFWMxrqoP0X]','2026-09-11 15:13:51',846,'2026-10-12T05:12:29.626Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(803,'ExponentPushToken[D2234ZJ9eR5EGO9vm46n-6]','2026-09-11 15:14:11',873,'2026-09-12T03:06:29.450Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(804,'ExponentPushToken[kkHqX-K2DqsBAjmwn2lsue]','2026-09-11 15:14:14',874,'2026-09-13T06:34:05.086Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(805,'ExponentPushToken[HtMoeZOHzv9tNf109UlRw9]','2026-09-11 15:25:15',875,'2026-10-09T02:49:59.745Z');
@ -3557,7 +3569,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(811,'ExponentPushToken[Zpv0h8PmNMVjTBbE6VPDOW]','2026-09-11 15:40:07',881,'2026-09-11T15:40:07.099Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(812,'ExponentPushToken[Czll9XPe6JW6Y_pwmVt7Yl]','2026-09-11 15:44:20',882,'2026-09-29T02:52:27.943Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(813,'ExponentPushToken[PNKVoYFDkwMX4z1vlTBJZv]','2026-09-11 15:54:39',883,'2026-09-13T04:09:34.293Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(814,'ExponentPushToken[IN99jWFmKwUzfS8slyGooW]','2026-09-11 15:54:50',884,'2026-09-15T05:56:28.007Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(814,'ExponentPushToken[IN99jWFmKwUzfS8slyGooW]','2026-09-11 15:54:50',884,'2026-10-13T02:42:47.712Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(815,'ExponentPushToken[S6e577KGRa5M8CVOC06FCC]','2026-09-11 15:56:35',885,'2026-10-08T06:09:50.935Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(816,'ExponentPushToken[i2sfxDIRgo5tDmTrJc-Rht]','2026-09-11 15:59:25',886,'2026-09-27T10:03:30.506Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(817,'ExponentPushToken[2CcucpFt9MYNsF3PFlgxt4]','2026-09-11 16:02:26',887,'2026-09-27T12:27:43.091Z');
@ -3570,7 +3582,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(824,'ExponentPushToken[gwiCY_CTyAwHuYJCIXrlbl]','2026-09-11 16:14:01',894,'2026-09-11T16:14:01.637Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(825,'ExponentPushToken[8og40zCvY95XruXNZmJuWV]','2026-09-11 16:15:54',895,'2026-09-11T16:24:32.458Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(826,'ExponentPushToken[HMyHoaCdsbphjB4cA6bJ26]','2026-09-11 16:17:21',896,'2026-10-04T08:11:08.581Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(827,'ExponentPushToken[dvG0gYNqkghs8mPmAIwpkz]','2026-09-11 16:18:00',898,'2026-10-06T17:03:22.513Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(827,'ExponentPushToken[dvG0gYNqkghs8mPmAIwpkz]','2026-09-11 16:18:00',898,'2026-10-12T07:53:40.021Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(828,'ExponentPushToken[lHJDcbPm2rj9OFPEA3vkO3]','2026-09-11 16:25:26',899,'2026-09-11T16:25:26.365Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(829,'ExponentPushToken[6DbNeELLtm9itYXHz4zJR9]','2026-09-11 16:25:40',900,'2026-09-23T08:43:29.962Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(830,'ExponentPushToken[n_L0AMOt4pPuOVgChD3tsF]','2026-09-11 16:42:18',901,'2026-09-11T16:42:18.251Z');
@ -3579,7 +3591,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(833,'ExponentPushToken[kp0ymeGSIVOeWaxtNhaw2V]','2026-09-11 16:52:18',905,'2026-09-17T16:26:42.026Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(834,'ExponentPushToken[b-zUibBhQhoRMgD7KGtOc2]','2026-09-11 16:53:44',906,'2026-09-12T12:40:33.633Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(835,'ExponentPushToken[SL8AsVMaVxKonkaj0Qk39t]','2026-09-11 16:55:49',907,'2026-09-30T18:45:59.067Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(836,'ExponentPushToken[3g85aaNTX1PpJpU0L7P1-0]','2026-09-11 16:59:07',908,'2026-10-03T12:32:12.342Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(836,'ExponentPushToken[3g85aaNTX1PpJpU0L7P1-0]','2026-09-11 16:59:07',908,'2026-10-13T07:19:15.775Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(837,'ExponentPushToken[y2FkqzKWrzwVA2jeCT1NSa]','2026-09-11 17:00:23',909,'2026-09-11T17:00:23.413Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(838,'ExponentPushToken[zAxCaBNbOkZH_ICKffPhTg]','2026-09-11 17:01:03',910,'2026-09-12T10:19:35.881Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(839,'ExponentPushToken[D3kDcNIAI0aCH92MjDjWp_]','2026-09-11 17:01:07',911,'2026-09-15T03:29:14.216Z');
@ -3597,7 +3609,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(851,'ExponentPushToken[2zRCZ2IkPA-rmsr_3khxaG]','2026-09-11 18:20:41',925,'2026-09-27T08:11:09.293Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(852,'ExponentPushToken[V4OTyvDkGRPWLQ9m3-ZPum]','2026-09-11 18:21:35',926,'2026-10-10T05:58:14.893Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(853,'ExponentPushToken[Ai8DO-CqkdBB-Gf9JefRLI]','2026-09-11 18:24:29',927,'2026-09-11T20:51:53.421Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(854,'ExponentPushToken[ScbtN_A9XahHNF5-eA-4gF]','2026-09-11 18:27:51',928,'2026-09-28T13:30:12.148Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(854,'ExponentPushToken[ScbtN_A9XahHNF5-eA-4gF]','2026-09-11 18:27:51',928,'2026-10-12T18:32:30.352Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(855,'ExponentPushToken[9IKUiPKAZQFXNEIH63pPcq]','2026-09-11 18:40:50',929,'2026-09-29T11:46:09.210Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(856,'ExponentPushToken[wI4x-wBDmfrzhaYS8kGHOE]','2026-09-11 18:46:56',930,'2026-09-11T18:46:56.692Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(857,'ExponentPushToken[Ookr5KJvOm6DKZSgqL8ZLk]','2026-09-11 18:58:45',931,'2026-09-11T18:58:45.321Z');
@ -3623,7 +3635,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(877,'ExponentPushToken[Hj3rjFEUlL28rQiTH0Q-L6]','2026-09-12 02:04:29',955,'2026-10-08T11:21:44.391Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(878,'ExponentPushToken[-9mhnGCZKic8qQZveVKccG]','2026-09-12 02:11:26',956,'2026-09-12T17:34:55.714Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(879,'ExponentPushToken[uDBMyUAB_qbPAE1pW9nsZ-]','2026-09-12 02:11:41',957,'2026-09-15T12:51:44.974Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(880,'ExponentPushToken[hF8wbDCFGGtxmnvbynIXxB]','2026-09-12 02:15:50',958,'2026-09-20T06:40:54.653Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(880,'ExponentPushToken[hF8wbDCFGGtxmnvbynIXxB]','2026-09-12 02:15:50',958,'2026-10-12T04:16:35.116Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(881,'ExponentPushToken[3u3FgANS2Z3bParIQ1jlc8]','2026-09-12 02:19:49',959,'2026-09-13T02:00:22.770Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(882,'ExponentPushToken[f_Glq1MSqZdAr1GPIDIk6H]','2026-09-12 02:20:35',960,'2026-09-12T02:20:35.148Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(883,'ExponentPushToken[UkoslbIX1w8yhYQcdIVHa1]','2026-09-12 02:39:53',831,'2026-09-13T08:06:25.990Z');
@ -3660,13 +3672,13 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(914,'ExponentPushToken[UBamoTKWcyeg2I8YxvZB-N]','2026-09-12 06:01:48',999,'2026-09-12T06:01:48.818Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(915,'ExponentPushToken[4VHSfIBkxU06tTdt95sNXf]','2026-09-12 06:06:23',198,'2026-09-27T04:18:38.168Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(916,'ExponentPushToken[7hrqY9NGTYgwbOfKr0hxCw]','2026-09-12 06:28:19',1000,'2026-09-18T14:12:18.381Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(917,'ExponentPushToken[aITcTXM3kUTvLkCku51RVY]','2026-09-12 06:51:04',1001,'2026-09-19T03:38:45.890Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(917,'ExponentPushToken[aITcTXM3kUTvLkCku51RVY]','2026-09-12 06:51:04',1001,'2026-10-13T01:09:28.166Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(918,'ExponentPushToken[fE-36BJAe4BrdZtboLvp4F]','2026-09-12 07:04:21',1002,'2026-09-12T07:04:21.069Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(919,'ExponentPushToken[jUovkwKziUmllKK6xy0THV]','2026-09-12 07:07:55',1003,'2026-09-12T07:07:55.687Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(920,'ExponentPushToken[yoginqEu07w8QGrlJkq-fq]','2026-09-12 07:12:06',1006,'2026-09-28T14:27:02.835Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(921,'ExponentPushToken[ceqKVyFD0U8CUtECPCErHD]','2026-09-12 07:12:33',1007,'2026-09-20T08:00:44.074Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(922,'ExponentPushToken[G04tsDHh8i7hJbjofA07m3]','2026-09-12 07:20:52',1008,'2026-10-11T07:00:21.170Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(923,'ExponentPushToken[ZSldxmD8RXsz-HXinaVO3M]','2026-09-12 07:20:54',1009,'2026-10-10T08:22:08.067Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(922,'ExponentPushToken[G04tsDHh8i7hJbjofA07m3]','2026-09-12 07:20:52',1008,'2026-10-12T12:23:57.111Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(923,'ExponentPushToken[ZSldxmD8RXsz-HXinaVO3M]','2026-09-12 07:20:54',1009,'2026-10-13T05:10:30.369Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(924,'ExponentPushToken[Ec-YZlJi14sZmFnBJMsaD4]','2026-09-12 07:28:19',1012,'2026-09-30T15:13:49.327Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(925,'ExponentPushToken[qJx-_AF4AVCayQ9gliKogm]','2026-09-12 07:36:49',1014,'2026-09-12T07:36:49.806Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(926,'ExponentPushToken[1ys58PAxbdv1srboHb095_]','2026-09-12 08:04:01',1015,'2026-09-19T09:48:45.111Z');
@ -3684,7 +3696,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(938,'ExponentPushToken[QfvlTDDSSW9BJ1vOZy0lpO]','2026-09-12 09:56:18',1029,'2026-09-12T09:56:18.645Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(939,'ExponentPushToken[ybmjZeA26-BwM7ymuKI-tr]','2026-09-12 10:05:49',1030,'2026-09-12T10:05:49.000Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(940,'ExponentPushToken[b97mnTAPGJ8mZSs7G2pC0d]','2026-09-12 10:20:06',1032,'2026-09-12T10:20:06.220Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(941,'ExponentPushToken[A2lMsIFcwxNt1tcln5RRpc]','2026-09-12 10:26:37',1033,'2026-10-10T06:56:42.455Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(941,'ExponentPushToken[A2lMsIFcwxNt1tcln5RRpc]','2026-09-12 10:26:37',1033,'2026-10-12T15:28:15.069Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(942,'ExponentPushToken[rf34CSCKTZ8lu5FhIDvgyW]','2026-09-12 10:39:38',1034,'2026-09-12T10:39:38.855Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(943,'ExponentPushToken[iQXX1pIVCsJJJGy0Ai7r7L]','2026-09-12 11:15:20',1035,'2026-09-13T12:24:42.495Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(944,'ExponentPushToken[mnOUodAfRrKayYT4a5oMei]','2026-09-12 11:54:22',1036,'2026-09-12T12:24:20.829Z');
@ -3697,7 +3709,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(951,'ExponentPushToken[wijAQlAYzzj7IX9djyaCxP]','2026-09-12 12:30:30',1043,'2026-09-12T12:30:30.672Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(952,'ExponentPushToken[J_SRfgFnrrM82Hroefuu8J]','2026-09-12 12:33:43',1044,'2026-09-12T12:33:43.553Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(953,'ExponentPushToken[PHSVWDAZm57G6IKOf0hkyu]','2026-09-12 12:36:04',1045,'2026-09-22T02:53:28.861Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(954,'ExponentPushToken[5GlJFIFh8ny-NSOynaQ1JO]','2026-09-12 12:37:07',1046,'2026-09-12T12:37:07.275Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(954,'ExponentPushToken[5GlJFIFh8ny-NSOynaQ1JO]','2026-09-12 12:37:07',1046,'2026-10-13T04:23:07.919Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(955,'ExponentPushToken[h7ROA1Pii6Pln89N-luMOa]','2026-09-12 12:50:42',1048,'2026-09-20T03:36:36.197Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(956,'ExponentPushToken[TdVlGKMS3GLG4qKg3rLr_A]','2026-09-12 13:24:17',1052,'2026-09-18T14:30:04.302Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(957,'ExponentPushToken[-pV9W1C1D8WpMXa5fdIRY0]','2026-09-12 13:36:14',1053,'2026-09-12T13:36:14.240Z');
@ -3758,7 +3770,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1013,'ExponentPushToken[L3yKDYPdb6ywdzKh5zTxQ2]','2026-09-13 11:33:05',1112,'2026-09-13T11:42:09.330Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1014,'ExponentPushToken[N5P1BlNaIgCZuRyw0mttc-]','2026-09-13 11:42:04',1113,'2026-09-30T01:27:07.123Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1015,'ExponentPushToken[V6phOrD8N5laDCKsOKkJSw]','2026-09-13 12:01:26',1114,'2026-10-04T05:21:51.585Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1016,'ExponentPushToken[VBvJX0B613r4nNDvM4iSqN]','2026-09-13 12:35:53',1116,'2026-09-28T15:20:24.119Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1016,'ExponentPushToken[VBvJX0B613r4nNDvM4iSqN]','2026-09-13 12:35:53',1116,'2026-10-13T01:17:31.503Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1017,'ExponentPushToken[sdtYWqPKk88x7980vODiGM]','2026-09-13 12:49:57',1117,'2026-09-13T12:49:57.422Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1018,'ExponentPushToken[vHEBbTIGOT2JPjRj1fUKn3]','2026-09-13 13:37:46',1118,'2026-09-13T13:37:46.001Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1019,'ExponentPushToken[AjR4jCMiJaLzTWN8G7sS-9]','2026-09-13 14:00:12',1119,'2026-09-22T10:02:28.421Z');
@ -3784,8 +3796,8 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1040,'ExponentPushToken[jRSrAHENnwF7QZfsUhsP0Z]','2026-09-14 16:04:43',1140,'2026-09-15T05:25:17.478Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1041,'ExponentPushToken[Sf2Oj8FGMXAaviqsHi5nEV]','2026-09-14 19:22:45',1142,'2026-09-30T04:55:48.428Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1042,'ExponentPushToken[_eOuGGJJ9BgI2032XP0FI1]','2026-09-15 01:05:33',1143,'2026-10-11T02:36:18.323Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1043,'ExponentPushToken[16jaqrPx3FzyO_d1hHiGHg]','2026-09-15 01:40:21',1144,'2026-10-02T07:46:33.600Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1044,'ExponentPushToken[QHpVTGLrRHYPMOHIukqWm-]','2026-09-15 01:40:30',1145,'2026-10-10T04:24:12.222Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1043,'ExponentPushToken[16jaqrPx3FzyO_d1hHiGHg]','2026-09-15 01:40:21',1144,'2026-10-13T03:13:24.527Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1044,'ExponentPushToken[QHpVTGLrRHYPMOHIukqWm-]','2026-09-15 01:40:30',1145,'2026-10-13T02:53:11.673Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1045,'ExponentPushToken[nCJ-e2JOLKdt1vAPNTnDl6]','2026-09-15 04:12:54',1146,'2026-09-16T05:55:47.489Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1046,'ExponentPushToken[WB3b2vGIAMbIP9GQZ5hO7Q]','2026-09-15 05:06:42',1147,'2026-10-09T05:07:01.797Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1047,'ExponentPushToken[YKeR0jCFe_PLXoT2aM4XbR]','2026-09-15 05:34:59',1148,'2026-09-19T07:19:48.963Z');
@ -3823,7 +3835,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1079,'ExponentPushToken[ye7MxxDDR0AwyeQGgFo8fd]','2026-09-16 13:30:36',1180,'2026-09-16T13:30:36.005Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1080,'ExponentPushToken[SEESKaBxsoIYTZLVY_K1sM]','2026-09-16 13:59:04',1181,'2026-10-07T14:54:07.352Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1081,'ExponentPushToken[D7fhIqNks_2h7Ehe5jlrJq]','2026-09-16 14:45:45',621,'2026-09-16T14:45:45.138Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1082,'ExponentPushToken[-4qSKkCdK0SXapQiMDNtns]','2026-09-16 15:01:02',1182,'2026-10-11T04:27:54.662Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1082,'ExponentPushToken[-4qSKkCdK0SXapQiMDNtns]','2026-09-16 15:01:02',1182,'2026-10-13T04:18:47.001Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1083,'ExponentPushToken[y8nVWRKuKgTA34bujyeLqJ]','2026-09-16 15:33:14',1183,'2026-10-04T10:38:51.995Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1084,'ExponentPushToken[Zx-QUbFXu-Kt4XasJVNfCB]','2026-09-16 17:02:48',1184,'2026-10-06T05:21:41.904Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1085,'ExponentPushToken[WNFDt7O_XwLLi9o4Kzkxh1]','2026-09-16 17:05:05',1141,'2026-09-16T17:05:05.695Z');
@ -3846,7 +3858,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1102,'ExponentPushToken[3uZhBQJSl7zx0qs_zjHy96]','2026-09-18 14:13:19',1199,'2026-09-28T13:07:41.246Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1103,'ExponentPushToken[tMoHveEoDz0OonLg1Pk3Cy]','2026-09-18 14:16:07',1000,'2026-09-29T14:13:31.991Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1104,'ExponentPushToken[BJwjKOBp3xFUnSdLaZ0yiz]','2026-09-19 12:14:28',1201,'2026-09-19T12:14:28.952Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1105,'ExponentPushToken[sYn2CnJV_Focrm9PgNacHQ]','2026-09-19 15:53:55',1203,'2026-09-19T16:29:08.044Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1105,'ExponentPushToken[sYn2CnJV_Focrm9PgNacHQ]','2026-09-19 15:53:55',1203,'2026-10-13T05:31:21.054Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1106,'ExponentPushToken[ZG7Fh9C5LLnFyvla3a_3Jn]','2026-09-20 01:12:46',1204,'2026-10-04T02:52:13.956Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1107,'ExponentPushToken[HMXpGGGvmTBCh7B61lF2U0]','2026-09-20 01:53:21',1100,'2026-10-04T09:34:36.839Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1108,'ExponentPushToken[HMXpGGGvmTBCh7B61lF2U0]','2026-09-20 01:54:47',1205,'2026-09-20T01:54:47.445Z');
@ -3893,11 +3905,11 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1149,'ExponentPushToken[__M9CLEVj_j9IpU3AsUdDC]','2026-09-26 05:51:38',119,'2026-09-26T05:51:38.509Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1150,'ExponentPushToken[mMJ-_6Ev70Hz-OnSi1oRY5]','2026-09-26 15:43:02',1254,'2026-10-04T14:39:21.788Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1151,'ExponentPushToken[cPo8IVBjvLXvjV1AFZoi68]','2026-09-27 01:27:58',1255,'2026-10-02T13:35:56.856Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1152,'ExponentPushToken[TCFYIgFGUV7DFhrEMK3JqP]','2026-09-27 02:18:58',1257,'2026-10-11T10:41:06.170Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1152,'ExponentPushToken[TCFYIgFGUV7DFhrEMK3JqP]','2026-09-27 02:18:58',1257,'2026-10-12T13:33:31.459Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1153,'ExponentPushToken[kXfKFoI9a0ydsNoCA2Ox4F]','2026-09-27 02:59:14',1258,'2026-10-11T04:50:39.136Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1154,'ExponentPushToken[a_TjBGIQuTFQFw9ZxIekcq]','2026-09-27 03:34:51',1259,'2026-10-05T13:33:57.163Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1155,'ExponentPushToken[H3VmShFfGbFHrDDmaQGcd9]','2026-09-27 04:28:20',1261,'2026-10-09T12:09:03.077Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1156,'ExponentPushToken[RNP4FZNLcX77qQR4HTZbD6]','2026-09-27 04:35:24',1262,'2026-10-09T13:55:11.035Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1156,'ExponentPushToken[RNP4FZNLcX77qQR4HTZbD6]','2026-09-27 04:35:24',1262,'2026-10-12T05:17:08.996Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1157,'ExponentPushToken[p8BSpIIv3AIgIwzmgm4FBD]','2026-09-27 05:06:59',1263,'2026-10-10T05:10:58.620Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1158,'ExponentPushToken[2WvYJ4EPGylmNQeHzYkCpy]','2026-09-27 05:49:57',1264,'2026-10-10T15:38:19.213Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1159,'ExponentPushToken[8T5k3AFi81wJwzH5pPkG43]','2026-09-27 09:43:04',1266,'2026-10-04T11:55:05.309Z');
@ -3914,7 +3926,7 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1170,'ExponentPushToken[sRFHdUK_qStCNkB0RFAOuY]','2026-09-29 00:46:12',1235,'2026-10-11T02:05:45.136Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1171,'ExponentPushToken[U2j41LIuA4ZqK-_keYGAzw]','2026-09-29 03:42:22',1221,'2026-10-04T04:37:33.017Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1172,'ExponentPushToken[HElBhxNE_Vv_5fB-VXVrBo]','2026-09-29 13:10:40',1279,'2026-10-05T11:58:12.981Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1173,'ExponentPushToken[-9hmGvKmFnYseUN643bZBf]','2026-09-29 15:22:57',1280,'2026-10-11T08:04:18.115Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1173,'ExponentPushToken[-9hmGvKmFnYseUN643bZBf]','2026-09-29 15:22:57',1280,'2026-10-12T17:03:19.597Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1174,'ExponentPushToken[FBpPOANc_R9a2U1AZT39AL]','2026-09-30 03:23:15',1281,'2026-09-30T03:23:15.752Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1175,'ExponentPushToken[hDWGA_O70ynKLkeymva6tV]','2026-09-30 08:20:55',1282,'2026-10-09T09:05:34.355Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1176,'ExponentPushToken[VhggFNCqqwrX-sH6HHN-8J]','2026-09-30 10:54:47',1283,'2026-10-08T11:18:27.117Z');
@ -3927,11 +3939,11 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1183,'ExponentPushToken[YqTvn4OCS3sf5UNuYGHdfC]','2026-10-02 03:09:59',988,'2026-10-03T15:14:46.226Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1184,'ExponentPushToken[4dMyItFoZPR9MiLxNrIKqz]','2026-10-02 03:37:50',1288,'2026-10-10T12:53:20.136Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1185,'ExponentPushToken[4PvgQAObU_b4Z_I2lSyL8g]','2026-10-02 05:07:34',992,'2026-10-02T05:07:33.999Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1186,'ExponentPushToken[FSNk6WM1J7U1Jvja48EHsE]','2026-10-02 08:38:31',1289,'2026-10-11T04:26:49.379Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1186,'ExponentPushToken[FSNk6WM1J7U1Jvja48EHsE]','2026-10-02 08:38:31',1289,'2026-10-13T01:13:15.920Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1187,'ExponentPushToken[iXaOH8D5iAsn6lh66GuWRa]','2026-10-02 12:51:37',1290,'2026-10-05T01:03:11.369Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1188,'ExponentPushToken[ycucWsL8Ci-AWWKiL6Na6R]','2026-10-03 02:19:44',1292,'2026-10-03T02:19:44.722Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1189,'ExponentPushToken[m4tPqTJay2E2_l8TrIEpJT]','2026-10-03 04:04:45',1293,'2026-10-05T11:14:48.980Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1190,'ExponentPushToken[Y7kb0KFKDbU4YiK6DTORKV]','2026-10-03 07:35:55',1291,'2026-10-11T04:16:44.748Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1190,'ExponentPushToken[Y7kb0KFKDbU4YiK6DTORKV]','2026-10-03 07:35:55',1291,'2026-10-13T07:44:07.092Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1191,'ExponentPushToken[iex6cpCl0n8JzF4Zu-VTTY]','2026-10-03 08:05:45',1295,'2026-10-06T18:09:08.740Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1192,'ExponentPushToken[gv4jP3Gd6hSD0r2rU86quf]','2026-10-03 11:30:28',1296,'2026-10-10T15:36:33.612Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1193,'ExponentPushToken[sAknjMCm2jKoeWHqDX7z9C]','2026-10-03 11:32:22',1004,'2026-10-09T11:21:57.442Z');
@ -3956,6 +3968,9 @@ INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VA
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1212,'ExponentPushToken[DtDZaYDoZ_TwpWVnbF733T]','2026-10-11 02:11:24',1205,'2026-10-11T02:11:24.376Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1213,'ExponentPushToken[nLYwtpFq3SAzUAEEV1HTPu]','2026-10-11 03:02:24',1317,'2026-10-11T03:02:24.222Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1214,'ExponentPushToken[_BXZshK2lSQuRCICuLTHiD]','2026-10-11 05:12:17',1318,'2026-10-11T05:12:17.723Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1215,'ExponentPushToken[m60i1MPwY_u8XMTFEHSQSm]','2026-10-11 17:14:19',1319,'2026-10-11T17:14:19.431Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1216,'ExponentPushToken[dQOhbqI5Xa2oazaM-X-FcN]','2026-10-13 00:54:25',1215,'2026-10-13T00:54:25.140Z');
INSERT INTO "notif_creds" ("id","token","added_at","user_id","last_verified") VALUES(1217,'ExponentPushToken[_DdgjbH_6x9XoI59oucbpZ]','2026-10-13 04:12:36',1262,'2026-10-13T06:21:42.193Z');
CREATE TABLE IF NOT EXISTS "notifications" ("id" INTEGER PRIMARY KEY, "user_id" INTEGER NOT NULL, "title" TEXT NOT NULL, "body" TEXT NOT NULL, "type" TEXT, "is_read" INTEGER NOT NULL DEFAULT false, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS "order_status" ("id" INTEGER PRIMARY KEY, "order_time" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "user_id" INTEGER NOT NULL, "order_id" INTEGER NOT NULL, "is_packaged" INTEGER NOT NULL DEFAULT false, "is_delivered" INTEGER NOT NULL DEFAULT false, "is_cancelled" INTEGER NOT NULL DEFAULT false, "cancel_reason" TEXT, "payment_state" TEXT NOT NULL DEFAULT 'pending', "cancellation_user_notes" TEXT, "cancellation_admin_notes" TEXT, "cancellation_reviewed" INTEGER NOT NULL DEFAULT false, "cancellation_reviewed_at" TEXT, "refund_coupon_id" INTEGER, "is_cancelled_by_admin" INTEGER);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(105,'2025-12-24T02:50:33.284Z',22,105,0,0,1,'E','cod','E',NULL,0,NULL,NULL,NULL);
@ -6252,8 +6267,8 @@ INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged"
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2457,'2026-10-08 06:18:04',1063,2463,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2458,'2026-10-08 06:20:46',82,2464,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2459,'2026-10-08 06:20:46',82,2465,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2460,'2026-10-08 06:27:41',388,2466,0,0,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2461,'2026-10-08 06:27:41',388,2467,0,0,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2460,'2026-10-08 06:27:41',388,2466,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2461,'2026-10-08 06:27:41',388,2467,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2462,'2026-10-08 07:43:33',499,2468,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2463,'2026-10-08 08:04:33',494,2469,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2464,'2026-10-08 08:55:40',1063,2470,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
@ -6304,6 +6319,29 @@ INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged"
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2509,'2026-10-11 10:18:07',785,2515,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2510,'2026-10-11 11:36:30',785,2516,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2511,'2026-10-11 12:58:14',131,2517,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2512,'2026-10-11 14:16:03',132,2518,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2513,'2026-10-12 03:14:22',631,2519,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2514,'2026-10-12 03:17:37',1257,2520,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2515,'2026-10-12 04:14:06',1145,2521,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2516,'2026-10-12 04:15:17',679,2522,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2517,'2026-10-12 04:53:05',710,2523,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2518,'2026-10-12 05:03:33',1207,2524,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2519,'2026-10-12 12:01:08',1063,2525,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2520,'2026-10-12 12:54:21',416,2526,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2521,'2026-10-12 15:42:38',494,2527,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2522,'2026-10-12 15:42:38',494,2528,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2523,'2026-10-12 23:37:28',1294,2529,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2524,'2026-10-12 23:37:28',1294,2530,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2525,'2026-10-13 00:54:35',1215,2531,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2526,'2026-10-13 01:42:15',299,2532,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2527,'2026-10-13 03:56:14',256,2533,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2528,'2026-10-13 04:08:59',785,2534,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2529,'2026-10-13 04:12:52',131,2535,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2530,'2026-10-13 04:13:25',1262,2536,0,0,1,'No response from customer wantedly not lifting calls','cod',NULL,'No response from customer wantedly not lifting calls',1,'2026-10-13T07:24:14.679Z',NULL,1);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2531,'2026-10-13 04:28:25',132,2537,0,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2532,'2026-10-13 05:19:44',1009,2538,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2533,'2026-10-13 05:28:23',444,2539,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
INSERT INTO "order_status" ("id","order_time","user_id","order_id","is_packaged","is_delivered","is_cancelled","cancel_reason","payment_state","cancellation_user_notes","cancellation_admin_notes","cancellation_reviewed","cancellation_reviewed_at","refund_coupon_id","is_cancelled_by_admin") VALUES(2534,'2026-10-13 05:33:33',1203,2540,1,1,0,NULL,'cod',NULL,NULL,0,NULL,NULL,NULL);
CREATE TABLE IF NOT EXISTS "orders" ("id" INTEGER PRIMARY KEY, "user_id" INTEGER NOT NULL, "address_id" INTEGER NOT NULL, "slot_id" INTEGER, "total_amount" REAL NOT NULL, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "is_cod" INTEGER NOT NULL DEFAULT false, "is_online_payment" INTEGER NOT NULL DEFAULT false, "payment_info_id" INTEGER, "readable_id" INTEGER NOT NULL, "admin_notes" TEXT, "user_notes" TEXT, "delivery_charge" REAL NOT NULL DEFAULT '0', "order_group_id" TEXT, "order_group_proportion" REAL, "is_flash_delivery" INTEGER NOT NULL DEFAULT false, `delivered_at` text);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(105,22,31,9,7700,'2025-12-24T02:50:33.284Z',1,0,NULL,147,NULL,NULL,0,NULL,NULL,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(106,15,24,8,92,'2025-12-24T10:32:01.957Z',1,0,NULL,149,NULL,NULL,20,NULL,NULL,0,NULL);
@ -8657,6 +8695,29 @@ INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","crea
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2515,785,574,2038,644,'2026-10-11 10:18:07',1,0,NULL,-1,NULL,'Please send fresh fruits',0,'1791713887168-785',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2516,785,574,2039,366,'2026-10-11 11:36:30',1,0,NULL,-1,NULL,'Fresh fruits please ',0,'1791718590026-785',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2517,131,577,2040,257,'2026-10-11 12:58:14',1,0,NULL,-1,NULL,NULL,0,'1791723494656-131',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2518,132,123,2041,449,'2026-10-11 14:16:03',1,0,NULL,-1,NULL,NULL,0,'1791728163935-132',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2519,631,457,2043,758,'2026-10-12 03:14:22',1,0,NULL,-1,NULL,NULL,0,'1791774862064-631',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2520,1257,835,2043,754,'2026-10-12 03:17:37',1,0,NULL,-1,NULL,NULL,0,'1791775057208-1257',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2521,1145,749,2043,214,'2026-10-12 04:14:06',1,0,NULL,-1,NULL,NULL,15,'1791778446443-1145',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2522,679,881,2043,304,'2026-10-12 04:15:17',1,0,NULL,-1,NULL,NULL,0,'1791778517895-679',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2523,710,542,2043,281,'2026-10-12 04:53:05',1,0,NULL,-1,NULL,NULL,0,'1791780785129-710',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2524,1207,791,NULL,304,'2026-10-12 05:03:33',1,0,NULL,-1,NULL,NULL,39,'1791781413426-1207',1,1,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2525,1063,701,2047,167,'2026-10-12 12:01:07',1,0,NULL,-1,NULL,NULL,15,'1791806467670-1063',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2526,416,312,2048,167,'2026-10-12 12:54:20',1,0,NULL,-1,NULL,NULL,15,'1791809660640-416',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2527,494,369,2050,386,'2026-10-12 15:42:38',1,0,NULL,-1,NULL,NULL,0,'1791819756158-494',0.5105820105820106,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2528,494,369,2049,370,'2026-10-12 15:42:38',1,0,NULL,-1,NULL,NULL,0,'1791819756158-494',0.4894179894179894,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2529,1294,866,2050,676,'2026-10-12 23:37:28',1,0,NULL,-1,NULL,NULL,0,'1791848248238-1294',0.5822566752799311,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2530,1294,866,2049,485,'2026-10-12 23:37:28',1,0,NULL,-1,NULL,NULL,0,'1791848248238-1294',0.4177433247200689,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2531,1215,801,2049,214,'2026-10-13 00:54:35',1,0,NULL,-1,NULL,NULL,15,'1791852875863-1215',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2532,299,220,2050,250,'2026-10-13 01:42:15',1,0,NULL,-1,NULL,NULL,0,'1791855735271-299',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2533,256,191,2051,388,'2026-10-13 03:56:14',1,0,NULL,-1,NULL,NULL,0,'1791863773841-256',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2534,785,574,2051,451,'2026-10-13 04:08:59',1,0,NULL,-1,NULL,'Please leg piece please ',0,'1791864539483-785',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2535,131,577,2051,449,'2026-10-13 04:12:52',1,0,NULL,-1,NULL,NULL,0,'1791864771882-131',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2536,1262,839,2051,351,'2026-10-13 04:13:24',1,0,NULL,-1,NULL,'Beside laxmi narsimha kiranam shop',0,'1791864804861-1262',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2537,132,123,2051,294,'2026-10-13 04:28:25',1,0,NULL,-1,NULL,NULL,0,'1791865705105-132',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2538,1009,686,2051,275,'2026-10-13 05:19:44',1,0,NULL,-1,NULL,NULL,0,'1791868783938-1009',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2539,444,335,2052,399,'2026-10-13 05:28:23',1,0,NULL,-1,NULL,NULL,0,'1791869303033-444',1,0,NULL);
INSERT INTO "orders" ("id","user_id","address_id","slot_id","total_amount","created_at","is_cod","is_online_payment","payment_info_id","readable_id","admin_notes","user_notes","delivery_charge","order_group_id","order_group_proportion","is_flash_delivery","delivered_at") VALUES(2540,1203,787,NULL,456,'2026-10-13 05:33:32',1,0,NULL,-1,NULL,NULL,0,'1791869612764-1203',1,1,NULL);
CREATE TABLE IF NOT EXISTS "payment_info" ("id" INTEGER PRIMARY KEY, "status" TEXT NOT NULL, "gateway" TEXT NOT NULL, "order_id" TEXT, "token" TEXT, "merchant_order_id" TEXT NOT NULL, "payload" TEXT);
INSERT INTO "payment_info" ("id","status","gateway","order_id","token","merchant_order_id","payload") VALUES(1,'pending','phonepe',NULL,NULL,'order_1763563896010',NULL);
INSERT INTO "payment_info" ("id","status","gateway","order_id","token","merchant_order_id","payload") VALUES(2,'pending','phonepe',NULL,NULL,'order_1763564910006',NULL);
@ -8999,6 +9060,7 @@ INSERT INTO "refunds" ("id","order_id","refund_amount","refund_status","merchant
INSERT INTO "refunds" ("id","order_id","refund_amount","refund_status","merchant_refund_id","refund_processed_at","created_at") VALUES(282,2476,NULL,'na',NULL,NULL,'2026-10-08 14:18:26');
INSERT INTO "refunds" ("id","order_id","refund_amount","refund_status","merchant_refund_id","refund_processed_at","created_at") VALUES(283,2477,NULL,'na',NULL,NULL,'2026-10-08 14:18:39');
INSERT INTO "refunds" ("id","order_id","refund_amount","refund_status","merchant_refund_id","refund_processed_at","created_at") VALUES(284,2479,NULL,'na',NULL,NULL,'2026-10-09 02:05:52');
INSERT INTO "refunds" ("id","order_id","refund_amount","refund_status","merchant_refund_id","refund_processed_at","created_at") VALUES(285,2536,NULL,'na',NULL,NULL,'2026-10-13 07:24:14');
CREATE TABLE IF NOT EXISTS "reserved_coupons" ("id" INTEGER PRIMARY KEY, "secret_code" TEXT NOT NULL, "coupon_code" TEXT NOT NULL, "discount_percent" REAL, "flat_discount" REAL, "min_order" REAL, "sku_ids" TEXT, "max_value" REAL, "valid_till" TEXT, "max_limit_for_user" INTEGER, "exclusive_apply" INTEGER NOT NULL DEFAULT false, "is_redeemed" INTEGER NOT NULL DEFAULT false, "redeemed_by" INTEGER, "redeemed_at" TEXT, "created_by" INTEGER NOT NULL, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, `is_first_order_only` integer DEFAULT false NOT NULL);
INSERT INTO "reserved_coupons" ("id","secret_code","coupon_code","discount_percent","flat_discount","min_order","sku_ids","max_value","valid_till","max_limit_for_user","exclusive_apply","is_redeemed","redeemed_by","redeemed_at","created_by","created_at","is_first_order_only") VALUES(1,'RESERVE_TEST34','RESERVE_TEST34',25,NULL,1000,'[]',250,'2026-01-30T13:16:00.000Z',2,0,1,NULL,'2026-01-12T08:58:20.468Z',6,'2026-01-07T13:16:53.387Z',0);
INSERT INTO "reserved_coupons" ("id","secret_code","coupon_code","discount_percent","flat_discount","min_order","sku_ids","max_value","valid_till","max_limit_for_user","exclusive_apply","is_redeemed","redeemed_by","redeemed_at","created_by","created_at","is_first_order_only") VALUES(2,'TEST50OFF','TEST50OFF',10,NULL,250,'[]',500,'2026-08-13T02:30:00.000Z',1,0,1,6,'2026-08-12T16:15:10.211Z',4,'2026-08-12 16:14:27',0);
@ -9936,7 +9998,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(377,'ExponentPushToken[KzS5P5F_tai5UTsmqICPEt]','2026-04-04T14:47:22.276Z','2026-04-07T07:37:24.102Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(381,'ExponentPushToken[ajyGklEpPuaF0semXEHmyh]','2026-04-05T11:48:04.798Z','2026-04-08T13:40:10.672Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(384,'ExponentPushToken[Gys045OR7dHYbQ2CPTMqAE]','2026-04-05T18:30:16.243Z','2026-04-29T08:13:52.853Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(385,'ExponentPushToken[UBKsoGEwMZLkm4B3wUtx5S]','2026-04-05T18:34:52.401Z','2026-10-04T05:33:49.020Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(385,'ExponentPushToken[UBKsoGEwMZLkm4B3wUtx5S]','2026-04-05T18:34:52.401Z','2026-10-12T04:27:53.320Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(389,'ExponentPushToken[q-CLMSMS5OX9ZwjRwfk2qp]','2026-04-06T15:10:01.277Z','2026-04-07T12:27:02.134Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(393,'ExponentPushToken[JMEvkUHKT0n34hcs-MiJAJ]','2026-04-07T05:11:31.283Z','2026-09-04T02:49:54.354Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(394,'ExponentPushToken[7phYIiLzUvAb8FKupVlpPz]','2026-04-07T07:11:45.731Z','2026-04-07T07:11:45.730Z');
@ -10205,7 +10267,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(799,'ExponentPushToken[Pe4vf3NBMKEUCH8XnSAarJ]','2026-06-06 12:34:20','2026-06-06T12:34:20.550Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(800,'ExponentPushToken[t94Qi7PwylitxJ9SEc33ST]','2026-06-06 15:06:06','2026-08-31T14:23:28.098Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(801,'ExponentPushToken[tEO2BSMaOYta_ySFk9-Xgv]','2026-06-06 16:05:33','2026-06-24T09:07:38.228Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(802,'ExponentPushToken[tfH3Z5Nh1Bhi--an9eZ_Mi]','2026-06-06 16:10:51','2026-10-05T02:24:25.441Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(802,'ExponentPushToken[tfH3Z5Nh1Bhi--an9eZ_Mi]','2026-06-06 16:10:51','2026-10-12T09:01:16.184Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(803,'ExponentPushToken[851EHSGWWQq55c_EOj92IM]','2026-06-06 17:39:55','2026-07-02T15:54:44.521Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(805,'ExponentPushToken[8SZ3aeIlY5Nu309zzGhxms]','2026-06-07 04:11:45','2026-06-07T06:15:32.738Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(806,'ExponentPushToken[wWBd_dLudieLX2on-NiKDo]','2026-06-07 08:07:14','2026-06-07T08:07:14.786Z');
@ -10460,7 +10522,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1118,'ExponentPushToken[iUT0D6LFpXi71mAnqOQDd_]','2026-07-07 14:24:08','2026-07-07T14:24:08.886Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1119,'ExponentPushToken[1EcQuAAg2ZFfp5oZNRAA2n]','2026-07-07 14:37:44','2026-10-11T12:42:51.037Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1120,'ExponentPushToken[J-NPonMMXWXAajTocXsSDy]','2026-07-08 04:43:24','2026-07-12T17:02:30.272Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1121,'ExponentPushToken[nZjhjRFgxQyStzudkKK44-]','2026-07-08 08:44:37','2026-09-26T14:08:03.300Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1121,'ExponentPushToken[nZjhjRFgxQyStzudkKK44-]','2026-07-08 08:44:37','2026-10-11T15:15:13.435Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1122,'ExponentPushToken[Gmmv-4LJ4HVJpwFuWb3-9y]','2026-07-08 19:30:32','2026-07-09T16:34:20.489Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1123,'ExponentPushToken[U9gHvGGFa7wGkKjITJLYpK]','2026-07-09 04:41:02','2026-09-10T08:38:52.843Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1124,'ExponentPushToken[igmC8WIEnkK2g4Ym9fuCTG]','2026-07-09 05:51:39','2026-07-09T05:51:39.233Z');
@ -10687,7 +10749,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1427,'ExponentPushToken[TX6Z-ROaA9Pf5MUu5kW5gz]','2026-09-11 13:23:45','2026-09-11T13:23:45.515Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1429,'ExponentPushToken[qCvmq6O2FTKYRrA5Qjik2i]','2026-09-11 13:24:09','2026-09-12T06:41:02.360Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1431,'ExponentPushToken[vCdkhuInqaTjejakAhIdRT]','2026-09-11 13:25:50','2026-09-11T13:25:50.539Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1432,'ExponentPushToken[fOl_D8JtZsQHEjeIAihPgu]','2026-09-11 13:26:25','2026-10-06T13:12:27.266Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1432,'ExponentPushToken[fOl_D8JtZsQHEjeIAihPgu]','2026-09-11 13:26:25','2026-10-12T11:54:28.939Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1434,'ExponentPushToken[1rIYucAokgb-SE-ij2z77f]','2026-09-11 13:26:34','2026-09-11T19:19:53.977Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1435,'ExponentPushToken[PHkU7cGZVe-8bDgWOULXxl]','2026-09-11 13:27:07','2026-10-10T09:12:43.982Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1437,'ExponentPushToken[TpUNN0MNBdsU0IwvRllvQS]','2026-09-11 13:28:17','2026-09-11T13:28:17.587Z');
@ -11034,7 +11096,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1933,'ExponentPushToken[IIZlsyDWcIQtUi_jEj-myT]','2026-09-12 09:15:08','2026-09-26T08:24:34.152Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1934,'ExponentPushToken[5PcRccOLXYBsQr8vgRg10P]','2026-09-12 09:15:25','2026-09-12T09:15:25.261Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1935,'ExponentPushToken[8HUWaKGdwMj6gyHn6Vfhao]','2026-09-12 09:17:50','2026-09-12T09:17:50.599Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1936,'ExponentPushToken[lWe3ZNJBWissM0ReHbTzg7]','2026-09-12 09:20:04','2026-10-05T03:55:42.799Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1936,'ExponentPushToken[lWe3ZNJBWissM0ReHbTzg7]','2026-09-12 09:20:04','2026-10-12T03:45:34.656Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1938,'ExponentPushToken[uo5mioA2THYhTnu4gskiPu]','2026-09-12 09:27:58','2026-09-12T09:27:58.655Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1939,'ExponentPushToken[rbOcmbGd9wVfSKnZ6ViMho]','2026-09-12 09:30:24','2026-09-12T09:30:24.102Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(1940,'ExponentPushToken[UC5pKNCXpLRUyextZ6CjZ9]','2026-09-12 09:31:39','2026-09-12T09:31:39.864Z');
@ -11251,7 +11313,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2212,'ExponentPushToken[Y1xmsQPVnH2UNvlGtr0Nt4]','2026-09-20 16:15:33','2026-09-20T16:15:33.362Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2213,'ExponentPushToken[wy3nWjHVy48OYm2KEMDNwj]','2026-09-20 19:17:42','2026-09-21T08:05:48.498Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2214,'ExponentPushToken[RpaDZ0GDZ0REU2tRacAOYZ]','2026-09-21 03:06:49','2026-09-21T03:06:49.181Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2215,'ExponentPushToken[lngJ7lL_1UAC636GXM7Yav]','2026-09-21 03:22:16','2026-10-11T12:36:56.221Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2215,'ExponentPushToken[lngJ7lL_1UAC636GXM7Yav]','2026-09-21 03:22:16','2026-10-12T08:06:42.325Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2216,'ExponentPushToken[KCMpszLJRkko9txHhb8aHI]','2026-09-21 05:41:57','2026-09-21T05:42:47.752Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2217,'ExponentPushToken[SlTUoWOqXf7ntBxBT2aZMn]','2026-09-21 08:37:21','2026-10-10T12:56:12.480Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2218,'ExponentPushToken[O2Jt5xA6TxGjW-zSPd7NmQ]','2026-09-21 08:50:32','2026-09-27T02:15:26.373Z');
@ -11349,7 +11411,7 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2322,'ExponentPushToken[VjojTWHgDMbjQTGxCEzBHG]','2026-10-05 16:28:14','2026-10-05T16:28:17.494Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2323,'ExponentPushToken[lq78-dLjnT_SzMAXfv8WTr]','2026-10-06 05:02:03','2026-10-06T05:02:03.589Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2324,'ExponentPushToken[VUqliPCvttnKYG9YKPOvVG]','2026-10-06 05:21:44','2026-10-06T05:22:50.004Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2325,'ExponentPushToken[L1bfdoLoTkcw9qozhkNDM5]','2026-10-07 03:19:08','2026-10-08T01:33:17.671Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2325,'ExponentPushToken[L1bfdoLoTkcw9qozhkNDM5]','2026-10-07 03:19:08','2026-10-11T15:38:39.519Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2326,'ExponentPushToken[ojutPgA8s-meD1d83hvajC]','2026-10-07 11:53:55','2026-10-07T11:53:55.005Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2327,'ExponentPushToken[QslZxBOLZB8NSvNMeV2O0F]','2026-10-07 14:44:31','2026-10-07T14:44:31.183Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2328,'ExponentPushToken[qVUNieLihvoBi95FFlLwfr]','2026-10-07 16:14:14','2026-10-10T11:10:15.832Z');
@ -11369,6 +11431,12 @@ INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VAL
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2343,'ExponentPushToken[_OkaD2N_fNYBjHMOavDLp8]','2026-10-11 09:16:48','2026-10-11T09:16:48.349Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2344,'ExponentPushToken[_OkaD2N_fNYBjHMOavDLp8]','2026-10-11 09:16:48','2026-10-11T09:16:48.470Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2345,'ExponentPushToken[z8e6rCKmazVIPPozFZ9USn]','2026-10-11 12:54:43','2026-10-11T12:54:43.684Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2346,'ExponentPushToken[ag_N_XPLt8OSWxLLZWiVa9]','2026-10-11 15:43:17','2026-10-11T15:43:17.157Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2348,'ExponentPushToken[jh9OpsBESTlmoufy0PYJIi]','2026-10-11 17:08:24','2026-10-11T17:08:24.135Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2349,'ExponentPushToken[tBmqsUG-rRzp86sn13MGqG]','2026-10-12 05:43:03','2026-10-12T05:43:03.123Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2350,'ExponentPushToken[E8zmZIOr5954A7jmCnvmy-]','2026-10-12 06:34:02','2026-10-12T06:34:01.990Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2352,'ExponentPushToken[MoHqpvOqYdvNcJVwySrR35]','2026-10-12 16:41:06','2026-10-13T06:21:42.119Z');
INSERT INTO "unlogged_user_tokens" ("id","token","added_at","last_verified") VALUES(2353,'ExponentPushToken[aITcTXM3kUTvLkCku51RVY]','2026-10-13 01:09:38','2026-10-13T01:09:38.688Z');
CREATE TABLE IF NOT EXISTS "upload_url_status" ("id" INTEGER PRIMARY KEY, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "key" TEXT NOT NULL, "status" TEXT NOT NULL DEFAULT 'pending');
INSERT INTO "upload_url_status" ("id","created_at","key","status") VALUES(35,'2025-12-07T08:58:13.136Z','review-images/1765097892914.jpg','pending');
INSERT INTO "upload_url_status" ("id","created_at","key","status") VALUES(36,'2025-12-07T08:58:13.347Z','review-images/1765097893129.png','pending');
@ -11720,6 +11788,7 @@ INSERT INTO "user_incidents" ("id","user_id","order_id","date_added","admin_comm
INSERT INTO "user_incidents" ("id","user_id","order_id","date_added","admin_comment","added_by","negativity_score") VALUES(12,1215,2235,'2026-09-23 03:00:24','Not lifting calls ',4,90);
INSERT INTO "user_incidents" ("id","user_id","order_id","date_added","admin_comment","added_by","negativity_score") VALUES(13,793,2280,'2026-09-26 03:17:15','Emergency user and not lifting calls ',4,40);
INSERT INTO "user_incidents" ("id","user_id","order_id","date_added","admin_comment","added_by","negativity_score") VALUES(14,1295,NULL,'2026-10-03 10:16:31','Not lifting calls wantedly ',4,1000);
INSERT INTO "user_incidents" ("id","user_id","order_id","date_added","admin_comment","added_by","negativity_score") VALUES(15,1262,2536,'2026-10-13 07:23:36','Wantedly not lifting call',4,1000);
CREATE TABLE IF NOT EXISTS "user_notifications" ("id" INTEGER PRIMARY KEY, "image_url" TEXT, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "body" TEXT NOT NULL, "applicable_users" TEXT, "title" TEXT NOT NULL);
INSERT INTO "user_notifications" ("id","image_url","created_at","body","applicable_users","title") VALUES(21,NULL,'2026-02-09T05:21:32.312Z',replace(replace('Van Winkle liked hunting, too. He liked going to the mountains to shoot squirrels. \r\nHe also liked sitting in the mountains and watching the world below—the','\r',char(13)),'\n',char(10)),'[1]','Hii');
INSERT INTO "user_notifications" ("id","image_url","created_at","body","applicable_users","title") VALUES(22,NULL,'2026-02-09T08:58:19.744Z','Test Notification','[65]','Hello');
@ -13051,6 +13120,8 @@ INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1315,NULL
INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1316,'Mohammed Mudassir Zama','mohammedmudassirzama50@gmail.com','8688942045','2026-10-10 16:55:12');
INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1317,NULL,NULL,'9912563434','2026-10-11 03:02:22');
INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1318,NULL,NULL,'7893626601','2026-10-11 05:12:16');
INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1319,NULL,NULL,'7402636363','2026-10-11 17:14:18');
INSERT INTO "users" ("id","name","email","mobile","created_at") VALUES(1320,NULL,NULL,'9177185837','2026-10-12 13:33:27');
CREATE TABLE IF NOT EXISTS "vendor_snippets" ("id" INTEGER PRIMARY KEY, "snippet_code" TEXT NOT NULL, "slot_id" INTEGER, "sku_ids" TEXT NOT NULL, "valid_till" TEXT, "created_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, "is_permanent" INTEGER NOT NULL DEFAULT false);
INSERT INTO "vendor_snippets" ("id","snippet_code","slot_id","sku_ids","valid_till","created_at","is_permanent") VALUES(55,'Allvegetables1',NULL,'[88,66,70,64,91,19,71,27,79,32,5,65,45,77,74,17,16,72,33,13,89,29,78,30,69,31,76,90,18,68]','2027-01-27T17:56:00.000Z','2026-01-27T18:03:18.974Z',1);
INSERT INTO "vendor_snippets" ("id","snippet_code","slot_id","sku_ids","valid_till","created_at","is_permanent") VALUES(56,'AllMuttonitems',NULL,'[34,85,14,87,35,84,28,86,4,12,99,98,20]','2027-03-31T02:51:00.000Z','2026-01-28T02:52:14.560Z',1);
@ -13304,7 +13375,7 @@ INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_com
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(75,75,NULL,'["product-images/1768817786453-0","product-images/1768817786455-1"]',0,0,0,'2026-01-18T05:38:16.173Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(76,76,NULL,'["product-images/1768727264220-0"]',0,0,0,'2026-01-18T09:07:45.047Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(77,77,NULL,'["product-images/1769396724595-0"]',0,0,0,'2026-01-18T14:26:30.867Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(78,78,NULL,'["product-images/1769241234003-0"]',0,0,0,'2026-01-18T14:33:36.108Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(78,78,NULL,'[]',0,0,0,'2026-01-18T14:33:36.108Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(79,79,NULL,'["product-images/1768822893380-0"]',0,0,0,'2026-01-19T11:41:34.210Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(80,80,NULL,'["product-images/1769063336125-0"]',0,0,0,'2026-01-22T06:28:57.053Z');
INSERT INTO "product_skus" ("id","product_id","name","images","is_offer","is_combo_only","is_deleted","created_at") VALUES(81,81,NULL,'["product-images/1769063467386-0"]',0,0,0,'2026-01-22T06:31:08.364Z');
@ -13455,7 +13526,6 @@ INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(74,74,'quantity','1.0Pc');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(76,76,'quantity','1.0Pc');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(77,77,'quantity','8.0Pc');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(78,78,'quantity','0.25Kg');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(79,79,'quantity','0.5Kg');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(80,80,'quantity','1.0Kg');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(82,82,'quantity','0.75Kg');
@ -13534,6 +13604,7 @@ INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(176,136,'quantity','15 pc');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(179,45,'quantity','0.5Kg');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(180,138,'quantity','7');
INSERT INTO "sku_features" ("id","sku_id","feature_name","feature_value") VALUES(182,78,'quantity','0.25Kg');
CREATE TABLE `product_market_stats` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`sku_id` integer NOT NULL,
@ -13622,7 +13693,7 @@ INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(75,75,'599','529',0,'529',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(76,76,'39.0','29.0',1,'39.0',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(77,77,'20.0','15.0',0,'15.0',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(78,78,'19.0','15.0',1,'15.0',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(78,78,'30','25',1,'28',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(79,79,'47.0','39.0',1,NULL,1,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(80,80,'569','799',0,'819',0,0);
INSERT INTO "product_market_stats" ("id","sku_id","market_price","our_price","is_flash_available","flash_price","is_out_of_stock","is_suspended") VALUES(81,81,'599','569',1,'569',0,0);
@ -21753,8 +21824,8 @@ INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discount
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8273,2464,76,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8274,2464,77,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8275,2465,97,'1','19.0','19.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8276,2466,7,'1','69.0','69.0',0,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8277,2467,23,'1','152','152',0,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8276,2466,7,'1','69.0','69.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8277,2467,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8278,2468,23,'2','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8279,2468,45,'2','25','25',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8280,2468,32,'1','19.0','19.0',1,0,NULL);
@ -21925,6 +21996,113 @@ INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discount
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8445,2516,61,'1','109.0','109.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8446,2517,6,'2','109.0','109.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8447,2517,118,'1','39.0','39.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8448,2518,98,'1','449','449',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8449,2519,72,'3','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8450,2519,33,'3','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8451,2519,19,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8452,2519,18,'2','69','69',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8453,2519,76,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8454,2519,67,'2','35','35',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8455,2519,16,'1','16.0','16.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8456,2519,5,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8457,2519,78,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8458,2519,31,'3','16','16',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8459,2519,45,'3','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8460,2519,66,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8461,2519,71,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8462,2519,69,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8463,2519,94,'1','18','18',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8464,2519,95,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8465,2519,103,'4','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8466,2520,33,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8467,2520,72,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8468,2520,18,'1','69','69',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8469,2520,30,'1','17.0','17.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8470,2520,127,'1','33.0','33.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8471,2520,45,'2','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8472,2520,95,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8473,2520,19,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8474,2520,92,'1','35.0','35.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8475,2520,98,'1','449','449',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8476,2521,136,'1','199','199',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8477,2522,23,'2','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8478,2523,45,'2','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8479,2523,66,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8480,2523,72,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8481,2523,71,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8482,2523,101,'1','19.0','19.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8483,2523,146,'1','15','15',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8484,2523,103,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8485,2523,94,'1','18','18',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8486,2523,19,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8487,2523,78,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8488,2523,32,'1','19.0','19.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8489,2523,31,'1','16','16',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8490,2524,101,'1','20.0','20.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8491,2524,48,'1','59','59',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8492,2524,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8493,2524,32,'1','19.0','19.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8494,2524,71,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8495,2525,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8496,2526,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8497,2527,46,'1','109.0','109.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8498,2527,48,'1','79','79',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8499,2527,8,'1','129','129',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8500,2527,7,'1','69.0','69.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8501,2528,45,'2','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8502,2528,2,'1','233','233',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8503,2528,5,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8504,2528,69,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8505,2528,72,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8506,2528,144,'1','15','15',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8507,2528,65,'1','16.0','16.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8508,2529,7,'1','69.0','69.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8509,2529,35,'1','449','449',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8510,2529,48,'2','79','79',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8511,2530,6,'1','109.0','109.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8512,2530,30,'2','17.0','17.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8513,2530,19,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8514,2530,31,'4','16','16',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8515,2530,37,'1','49.0','49.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8516,2530,77,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8517,2530,94,'2','18','18',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8518,2530,95,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8519,2530,103,'2','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8520,2530,146,'2','15','15',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8521,2530,69,'2','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8522,2531,136,'1','199','199',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8523,2532,103,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8524,2532,29,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8525,2532,69,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8526,2532,95,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8527,2532,71,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8528,2532,45,'1','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8529,2532,72,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8530,2532,46,'1','109.0','109.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8531,2533,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8532,2533,7,'1','69.0','69.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8533,2533,31,'2','16','16',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8534,2533,37,'1','49.0','49.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8535,2533,101,'1','19.0','19.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8536,2533,19,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8537,2533,29,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8538,2533,45,'1','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8539,2534,10,'1','299','299',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8540,2534,23,'1','152','152',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8541,2535,98,'1','449','449',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8542,2536,136,'1','199','199',0,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8543,2536,23,'1','152','152',0,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8544,2537,24,'1','235','235',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8545,2537,73,'1','59.0','59.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8546,2538,31,'4','16','16',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8547,2538,45,'2','23','23',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8548,2538,103,'1','29.0','29.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8549,2538,58,'1','89','89',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8550,2538,19,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8551,2538,72,'1','15.0','15.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8552,2538,30,'1','17.0','17.0',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8553,2539,82,'1','399','399',1,0,NULL);
INSERT INTO "order_items" ("id","order_id","sku_id","quantity","price","discounted_price","is_packaged","is_package_verified","packaged_at") VALUES(8554,2540,23,'3','152','152',1,0,NULL);
CREATE TABLE IF NOT EXISTS "special_deals" (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`sku_id` integer NOT NULL,
@ -22363,15 +22541,15 @@ CREATE TABLE `staff_notif_creds` (
FOREIGN KEY (`staff_user_id`) REFERENCES `staff_users`(`id`) ON UPDATE no action ON DELETE no action
);
INSERT INTO "staff_notif_creds" ("id","token","added_at","staff_user_id","last_verified") VALUES(1,'ExponentPushToken[HyU1kPNunSJaasQweODhvH]','2026-10-02 10:49:17',6,'2026-10-04T07:19:37.555Z');
INSERT INTO "staff_notif_creds" ("id","token","added_at","staff_user_id","last_verified") VALUES(2,'ExponentPushToken[QydqxGMsUfzHuiqxel0nA9]','2026-10-02 10:49:27',4,'2026-10-11T12:55:18.553Z');
INSERT INTO "staff_notif_creds" ("id","token","added_at","staff_user_id","last_verified") VALUES(3,'ExponentPushToken[bqqW02IeK4XcC4iuzpkQIG]','2026-10-05 01:28:42',4,'2026-10-11T13:16:02.427Z');
INSERT INTO "staff_notif_creds" ("id","token","added_at","staff_user_id","last_verified") VALUES(2,'ExponentPushToken[QydqxGMsUfzHuiqxel0nA9]','2026-10-02 10:49:27',4,'2026-10-13T07:23:08.580Z');
INSERT INTO "staff_notif_creds" ("id","token","added_at","staff_user_id","last_verified") VALUES(3,'ExponentPushToken[bqqW02IeK4XcC4iuzpkQIG]','2026-10-05 01:28:42',4,'2026-10-13T07:50:31.719Z');
DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('product_skus',150);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('sku_features',180);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('sku_features',182);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('product_market_stats',150);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('product_info',150);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('cart_items',128);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('order_items',8447);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('order_items',8554);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('special_deals',12);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('coupon_applicable_products',1);
INSERT INTO "sqlite_sequence" ("name","seq") VALUES('product_tags',604);

View file

@ -15,7 +15,7 @@ export const createApp = () => {
// CORS middleware
app.use(cors({
origin: ['http://localhost:5174', 'http://localhost:4174', 'http://localhost:4176', 'http://localhost:4175', 'https://ui.freshyo.in', 'https://www.freshyo.in', 'https://webui.freshyo.in', 'https://app.freshyo.in', 'https://admin.freshyo.in', 'https://superadmin.freshyo.in', 'http://192.168.100.126:4175'],
origin: ['http://localhost:5174', 'http://localhost:4174', 'http://localhost:4176', 'http://localhost:4175', 'https://ui.freshyo.in', 'https://www.freshyo.in', 'https://webui.freshyo.in', 'https://app.freshyo.in', 'https://admin.freshyo.in', 'https://superadmin.freshyo.in', 'http://192.168.100.126:4175', 'https://localsuperadmin.freshyo.in', 'https://localuserweb.freshyo.in'],
allowMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
allowHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization', 'Caller-Interface'],
credentials: true,

View file

@ -0,0 +1,81 @@
import { polygon as turfPolygon, point as turfPoint } from '@turf/helpers'
import { booleanPointInPolygon } from '@turf/boolean-point-in-polygon'
import type { RegionGeoJson, ResolvedRegion } from '@packages/shared'
import { getAllRegionsWithBounds, getRegionWithBounds } from '@/src/dbService'
export type BoundPolygon = ReturnType<typeof turfPolygon>
/**
* A bound's GeoJSON is a FeatureCollection; each feature geometry may be a
* Polygon or MultiPolygon. Flatten them into turf polygons for containment tests.
*/
export function boundToPolygons(geojson: RegionGeoJson): BoundPolygon[] {
const polygons: BoundPolygon[] = []
for (const feature of geojson?.features ?? []) {
const geometry = feature?.geometry
if (!geometry) continue
if (geometry.type === 'Polygon') {
polygons.push(turfPolygon(geometry.coordinates as any))
} else if (geometry.type === 'MultiPolygon') {
for (const coordinates of geometry.coordinates as any[]) {
polygons.push(turfPolygon(coordinates))
}
}
}
return polygons
}
/**
* Resolve a point to the bound of a region that contains it. Bounds are checked
* least-priority first (lowest number wins), matching `resolveRegionByLocation`.
* Returns `null` when the region is unknown or the point is outside every bound.
*/
export async function resolveBoundInRegion(
regionId: number,
lat: number,
lng: number
): Promise<number | null> {
const region = await getRegionWithBounds(regionId)
if (!region) return null
const point = turfPoint([lng, lat]) // GeoJSON: [longitude, latitude]
for (const bound of region.bounds) {
const polygons = boundToPolygons(bound.geojson)
if (polygons.length > 0 && polygons.some((poly) => booleanPointInPolygon(point, poly))) {
return bound.id
}
}
return null
}
/**
* Resolve a point to the region + bound that contains it, scanning every region
* (regions by id, bounds least-priority first). Returns `null` when the point
* falls outside all bounds. This is the authoritative coords -> region mapping
* used for address creation and order placement.
*/
export async function resolveRegionAndBound(
lat: number,
lng: number
): Promise<ResolvedRegion | null> {
const regions = await getAllRegionsWithBounds()
const point = turfPoint([lng, lat]) // GeoJSON: [longitude, latitude]
for (const region of regions) {
for (const bound of region.bounds) {
const polygons = boundToPolygons(bound.geojson)
if (polygons.length > 0 && polygons.some((poly) => booleanPointInPolygon(point, poly))) {
return {
region: { id: region.id, name: region.name, description: region.description },
bound: {
id: bound.id,
regionId: bound.regionId,
description: bound.description,
priority: bound.priority,
},
}
}
}
}
return null
}

View file

@ -5,15 +5,15 @@ import {
healthCheck,
getBoundById,
getAllRegions,
getAllRegionsWithBounds,
getEffectiveRegionSettings,
getBoundsForRegion,
getEffectiveBoundId,
getUserAddresses,
} from '@/src/dbService'
import type { StoresSummaryResponse, RegionGeoJson, ResolvedRegion } from '@packages/shared'
import type { StoresSummaryResponse, ResolvedRegion } from '@packages/shared'
import { polygon as turfPolygon, point as turfPoint } from '@turf/helpers';
import { booleanPointInPolygon } from '@turf/boolean-point-in-polygon';
import { resolveBoundInRegion, resolveRegionAndBound } from '@/src/lib/region-geo'
import { z } from 'zod';
import { mbnrGeoJson } from '@/src/lib/mbnr-geojson'
import { generateUploadUrl } from '@/src/lib/s3-client'
@ -28,26 +28,6 @@ import { getAssetsDomain, getApiCacheKey } from '@/src/lib/env-exporter'
const polygon = turfPolygon(mbnrGeoJson.features[0].geometry.coordinates);
type BoundPolygon = ReturnType<typeof turfPolygon>
// A bound's GeoJSON is a FeatureCollection; each feature geometry may be a
// Polygon or MultiPolygon. Flatten them into turf polygons for containment tests.
function boundToPolygons(geojson: RegionGeoJson): BoundPolygon[] {
const polygons: BoundPolygon[] = []
for (const feature of geojson?.features ?? []) {
const geometry = feature?.geometry
if (!geometry) continue
if (geometry.type === 'Polygon') {
polygons.push(turfPolygon(geometry.coordinates as any))
} else if (geometry.type === 'MultiPolygon') {
for (const coordinates of geometry.coordinates as any[]) {
polygons.push(turfPolygon(coordinates))
}
}
}
return polygons
}
export async function scaffoldEssentialConsts(boundId: number) {
const bound = await getBoundById(boundId)
if (!bound) throw new ApiError('Bound not found', 404)
@ -207,27 +187,24 @@ export const commonApiRouter = router({
lng: z.number().min(-180).max(180),
}))
.query(async ({ input }): Promise<ResolvedRegion | null> => {
const point = turfPoint([input.lng, input.lat]); // GeoJSON: [longitude, latitude]
const regions = await getAllRegionsWithBounds();
return resolveRegionAndBound(input.lat, input.lng)
}),
for (const region of regions) {
for (const bound of region.bounds) {
const polygons = boundToPolygons(bound.geojson);
if (polygons.some((poly) => booleanPointInPolygon(point, poly))) {
return {
region: { id: region.id, name: region.name, description: region.description },
bound: {
id: bound.id,
regionId: bound.regionId,
description: bound.description,
priority: bound.priority,
},
};
}
}
// Resolve a point to the bound of a chosen region (used by the add-address
// flow: pick a region, then pick a point on the map). Throws when the point
// is outside every bound of that region.
resolveBound: publicProcedure
.input(z.object({
regionId: z.number().int().positive(),
lat: z.number().min(-90).max(90),
lng: z.number().min(-180).max(180),
}))
.query(async ({ input }): Promise<{ regionId: number; boundId: number }> => {
const boundId = await resolveBoundInRegion(input.regionId, input.lat, input.lng)
if (boundId == null) {
throw new ApiError('Selected location is outside this region’s delivery area', 422)
}
return null;
return { regionId: input.regionId, boundId }
}),
// Effective business settings (from the region's lowest-priority bound).

View file

@ -1,7 +1,8 @@
import { router, protectedProcedure } from '@/src/trpc/trpc-index'
import { z } from 'zod'
import { extractCoordsFromRedirectUrl } from '@/src/lib/license-util'
import { ApiError } from '@/src/lib/api-error'
import { extractCoordsFromRedirectUrl } from '@/src/lib/license-util'
import { resolveBoundInRegion } from '@/src/lib/region-geo'
import {
getUserDefaultAddress as getDefaultAddressInDb,
getUserAddresses as getUserAddressesInDb,
@ -11,6 +12,7 @@ import {
updateUserAddress as updateUserAddressInDb,
deleteUserAddress as deleteUserAddressInDb,
hasOngoingOrdersForAddress as hasOngoingOrdersForAddressInDb,
getEffectiveBoundId as getEffectiveBoundIdInDb,
} from '@/src/dbService'
import type {
UserAddressResponse,
@ -43,7 +45,6 @@ export const addressRouter = router({
createAddress: protectedProcedure
.input(z.object({
regionId: z.number().int().positive('Region is required'),
boundId: z.number().int().positive().optional(),
name: z.string().min(1, 'Name is required'),
phone: z.string().trim().min(1, 'Phone is required')
.regex(PHONE_REGEX, 'Phone must be a 10-digit number starting with 6, 7, 8 or 9'),
@ -54,8 +55,11 @@ export const addressRouter = router({
pincode: z.string().trim().min(1, 'Pincode is required')
.regex(PINCODE_REGEX, 'Pincode must be 6 digits'),
isDefault: z.boolean().optional(),
latitude: z.number().optional(),
longitude: z.number().optional(),
// Coordinates picked on the map. The user app always sends them; the web
// app may omit them (legacy), in which case the bound falls back to the
// region's effective bound.
latitude: z.number().min(-90).max(90).optional(),
longitude: z.number().min(-180).max(180).optional(),
googleMapsUrl: z.string().optional(),
}))
.mutation(async ({ input, ctx }): Promise<UserAddressResponse> => {
@ -64,7 +68,8 @@ export const addressRouter = router({
let { latitude, longitude } = input;
if (googleMapsUrl && latitude === undefined && longitude === undefined) {
// Legacy: a pasted Google Maps URL is a fallback source of coordinates.
if (latitude === undefined && longitude === undefined && googleMapsUrl) {
const coords = await extractCoordsFromRedirectUrl(googleMapsUrl);
if (coords) {
latitude = Number(coords.latitude);
@ -72,6 +77,16 @@ export const addressRouter = router({
}
}
// Coordinates present -> derive the containing bound (reject out-of-area).
// Absent -> fall back to the region's effective bound.
const boundId =
latitude != null && longitude != null
? await resolveBoundInRegion(input.regionId, latitude, longitude)
: await getEffectiveBoundIdInDb(input.regionId)
if (boundId == null) {
throw new ApiError('Selected location is outside this region’s delivery area', 422)
}
// Validate required fields
if (!name || !phone || !addressLine1 || !city || !state || !pincode) {
throw new Error('Missing required fields');
@ -89,7 +104,7 @@ export const addressRouter = router({
const newAddress = await createUserAddressInDb({
userId,
regionId: input.regionId,
boundId: input.boundId,
boundId,
name,
phone,
addressLine1,
@ -110,7 +125,6 @@ export const addressRouter = router({
.input(z.object({
id: z.number().int().positive(),
regionId: z.number().int().positive('Region is required'),
boundId: z.number().int().positive().optional(),
name: z.string().min(1, 'Name is required'),
phone: z.string().trim().min(1, 'Phone is required')
.regex(PHONE_REGEX, 'Phone must be a 10-digit number starting with 6, 7, 8 or 9'),
@ -121,8 +135,9 @@ export const addressRouter = router({
pincode: z.string().trim().min(1, 'Pincode is required')
.regex(PINCODE_REGEX, 'Pincode must be 6 digits'),
isDefault: z.boolean().optional(),
latitude: z.number().optional(),
longitude: z.number().optional(),
// See createAddress: coordinates are optional for the legacy web client.
latitude: z.number().min(-90).max(90).optional(),
longitude: z.number().min(-180).max(180).optional(),
googleMapsUrl: z.string().optional(),
}))
.mutation(async ({ input, ctx }): Promise<UserAddressResponse> => {
@ -131,7 +146,8 @@ export const addressRouter = router({
let { latitude, longitude } = input;
if (googleMapsUrl && latitude === undefined && longitude === undefined) {
// Legacy: a pasted Google Maps URL is a fallback source of coordinates.
if (latitude === undefined && longitude === undefined && googleMapsUrl) {
const coords = await extractCoordsFromRedirectUrl(googleMapsUrl);
if (coords) {
latitude = Number(coords.latitude);
@ -145,6 +161,23 @@ export const addressRouter = router({
throw new Error('Address not found')
}
// Coordinates present -> containing bound (reject out-of-area). Absent ->
// region's effective bound.
const boundId =
latitude != null && longitude != null
? await resolveBoundInRegion(input.regionId, latitude, longitude)
: await getEffectiveBoundIdInDb(input.regionId)
if (boundId == null) {
throw new ApiError('Selected location is outside this region’s delivery area', 422)
}
// A previously backfilled address becomes "real" once its coordinates are
// changed by the user; otherwise the flag is preserved.
const coordsChanged =
latitude != null &&
longitude != null &&
(existingAddress.latitude !== latitude || existingAddress.longitude !== longitude)
// If setting as default, unset other defaults
if (isDefault) {
await clearDefaultAddressInDb(userId)
@ -154,7 +187,7 @@ export const addressRouter = router({
userId,
addressId: id,
regionId: input.regionId,
boundId: input.boundId,
boundId,
name,
phone,
addressLine1,
@ -167,6 +200,7 @@ export const addressRouter = router({
googleMapsUrl,
latitude,
longitude,
vagueBackfilledCoords: coordsChanged ? false : existingAddress.vagueBackfilledCoords,
})
return { success: true, data: updatedAddress }

View file

@ -29,6 +29,7 @@ import {
} from "@/src/dbService";
import { scaffoldAssetUrl } from "@/src/lib/s3-client";
import { ApiError } from "@/src/lib/api-error";
import { resolveRegionAndBound } from "@/src/lib/region-geo";
import type { DeliveryStatus, OrderStatus } from "@packages/shared";
import { computeCartPricing, type CartLine } from "@packages/shared";
import { CONST_KEYS } from "@/src/lib/const-store";
@ -74,25 +75,33 @@ const placeOrderUtil = async (params: {
throw new ApiError("Invalid address", 400);
}
// The address and the checkout must belong to the same region.
if (address.regionId != null && address.regionId !== params.regionId) {
throw new ApiError(
"Selected address belongs to a different region. Switch region and rebuild your cart to order there.",
409
);
// The delivery address's coordinates are authoritative: they decide the
// region (and bound) the order is placed into, so a stale or spoofed client
// regionId cannot mis-scope pricing, products or slots. When the address has
// no coordinates we fall back to its stored region, then the client's.
let regionId = params.regionId;
let resolvedBoundId: number | null = null;
if (address.latitude != null && address.longitude != null) {
const resolved = await resolveRegionAndBound(address.latitude, address.longitude);
if (resolved) {
regionId = resolved.region.id;
resolvedBoundId = resolved.bound.id;
}
} else if (address.regionId != null) {
regionId = address.regionId;
}
// Bound-level constants (delivery charge/thresholds/min order) come from the bound the
// delivery address belongs to, so pricing cannot be changed by a client-supplied id.
// delivery address resolves to, so pricing cannot be changed by a client-supplied id.
// Only when the address carries no bound do we fall back to the bound the client is
// browsing in, then to the region's effective bound. This mirrors the customer app, which
// already prices the selected address's bound (prominent-api-hooks useGetEssentialConsts).
// Region-level constants are shared across the region's bounds.
const boundId =
address.boundId ?? params.boundId ?? (await getEffectiveBoundId(params.regionId));
resolvedBoundId ?? address.boundId ?? params.boundId ?? (await getEffectiveBoundId(regionId));
const effective =
(boundId != null ? await getRegionSettingsForBound(params.regionId, boundId) : null) ??
(await getEffectiveRegionSettings(params.regionId));
(boundId != null ? await getRegionSettingsForBound(regionId, boundId) : null) ??
(await getEffectiveRegionSettings(regionId));
const boundSettings = effective?.settings ?? {};
const numSetting = (key: string): number => {
const raw = boundSettings[key];
@ -117,7 +126,7 @@ const placeOrderUtil = async (params: {
>();
for (const item of selectedItems) {
const product = await getOrderProductById(item.skuId, params.regionId);
const product = await getOrderProductById(item.skuId, regionId);
if (!product) {
throw new ApiError(`Product ${item.skuId} not found`, 400);
}
@ -126,7 +135,7 @@ const placeOrderUtil = async (params: {
// GLOBAL: the catalogue reads (stores/products) serve it in every region by the same rule, so it
// is accepted anywhere — only another region's product is rejected.
const productRegionId = product.product?.regionId ?? null
if (productRegionId !== null && productRegionId !== params.regionId) {
if (productRegionId !== null && productRegionId !== regionId) {
throw new ApiError(
`Product ${item.skuId} is not available in this region`,
409
@ -151,7 +160,7 @@ const placeOrderUtil = async (params: {
if (params.isFlash) {
for (const item of selectedItems) {
const product = await getOrderProductById(item.skuId, params.regionId);
const product = await getOrderProductById(item.skuId, regionId);
if (!product?.isFlashAvailable) {
throw new ApiError(`Product ${item.skuId} is not available for flash delivery`, 400);
}
@ -171,7 +180,7 @@ const placeOrderUtil = async (params: {
throw new ApiError("Selected delivery slot not found", 400);
}
if (slot.regionId !== params.regionId) {
if (slot.regionId !== regionId) {
throw new ApiError("Selected delivery slot belongs to a different region", 409);
}
@ -223,7 +232,7 @@ const placeOrderUtil = async (params: {
const validatedCoupons = await validateAndGetUserCoupons({
couponIds: couponIds ?? [],
userId,
regionId: params.regionId,
regionId: regionId,
items: subOrderInputs.flatMap((so) => so.items),
});
@ -263,7 +272,7 @@ const placeOrderUtil = async (params: {
const order: Omit<typeof orders.$inferInsert, "id"> = {
userId,
regionId: params.regionId,
regionId: regionId,
addressId,
slotId: params.isFlash ? null : slotId,
isCod: paymentMethod === "cod",

View file

@ -9,7 +9,7 @@ import { cloudflare } from "@cloudflare/vite-plugin";
const config = defineConfig({
resolve: { tsconfigPaths: true },
server: { port: 4175 },
server: { port: 4175, allowedHosts: ['.freshyo.in'] },
plugins: [
devtools(),
tailwindcss(),

View file

@ -1,6 +1,6 @@
import React, { useState } from 'react';
import type { UserAddress } from '@packages/shared'
import { View, Alert } from 'react-native';
import { View, Alert, Dimensions } from 'react-native';
import { useRouter } from 'expo-router';
import { AppContainer, MyText, tw, useMarkDataFetchers, MyFlatList, MyTouchableOpacity, BottomDialog, RawBottomDialog } from 'common-ui';
import { trpc } from '@/src/trpc-client';
@ -161,6 +161,9 @@ export default function Addresses() {
state: addressToUpdate.state,
pincode: addressToUpdate.pincode,
isDefault: true,
// Keep the stored coordinates so the bound is not re-derived from a fallback.
latitude: addressToUpdate.latitude ?? undefined,
longitude: addressToUpdate.longitude ?? undefined,
}, {
onSuccess: () => {
refetch();
@ -257,25 +260,27 @@ export default function Addresses() {
/>
<RawBottomDialog open={modalVisible} onClose={() => setModalVisible(false)}>
<AddressForm
onSuccess={handleAddressSubmit}
initialValues={editingAddress ? {
id: editingAddress.id,
regionId: editingAddress.regionId ?? undefined,
name: editingAddress.name,
phone: editingAddress.phone,
addressLine1: editingAddress.addressLine1,
addressLine2: editingAddress.addressLine2 || '',
city: editingAddress.city,
state: editingAddress.state,
pincode: editingAddress.pincode,
isDefault: editingAddress.isDefault,
latitude: editingAddress.googleMapsUrl ? undefined : (editingAddress.latitude ?? undefined),
longitude: editingAddress.googleMapsUrl ? undefined : (editingAddress.longitude ?? undefined),
googleMapsUrl: editingAddress.googleMapsUrl ?? undefined,
} : undefined}
isEdit={!!editingAddress}
/>
<View style={[tw`bg-white rounded-t-2xl`, { height: Dimensions.get('window').height * 0.85 }]}>
<AddressForm
onSuccess={handleAddressSubmit}
initialValues={editingAddress ? {
id: editingAddress.id,
regionId: editingAddress.regionId ?? undefined,
name: editingAddress.name,
phone: editingAddress.phone,
addressLine1: editingAddress.addressLine1,
addressLine2: editingAddress.addressLine2 || '',
city: editingAddress.city,
state: editingAddress.state,
pincode: editingAddress.pincode,
isDefault: editingAddress.isDefault,
latitude: editingAddress.googleMapsUrl ? undefined : (editingAddress.latitude ?? undefined),
longitude: editingAddress.googleMapsUrl ? undefined : (editingAddress.longitude ?? undefined),
googleMapsUrl: editingAddress.googleMapsUrl ?? undefined,
} : undefined}
isEdit={!!editingAddress}
/>
</View>
</RawBottomDialog>
<BottomDialog open={deleteError !== null} onClose={() => setDeleteError(null)}>

View file

@ -2,13 +2,13 @@ import React, { useState } from 'react';
import { View, ScrollView } from 'react-native';
import { useRouter } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { AppContainer, BottomDialog, MyText, tw, MyTouchableOpacity, ProfileImage, colors } from 'common-ui';
import { AppContainer, MyText, tw, MyTouchableOpacity, ProfileImage, colors } from 'common-ui';
import TabLayoutWrapper from '@/components/TabLayoutWrapper';
import LocationBar from '@/src/components/LocationBar';
import { LinearGradient } from 'expo-linear-gradient';
import { Ionicons } from '@expo/vector-icons';
import NextOrderGlimpse from '@/components/NextOrderGlimpse';
import RegionSelector from '@/src/components/RegionSelector';
import AddressSwitcherSheet from '@/src/components/location/AddressSwitcherSheet';
import { useRegion } from '@/src/hooks/useRegion';
import { useAuth } from '@/src/contexts/AuthContext';
import { useNavigationTarget } from 'common-ui/hooks/useNavigationTarget';
@ -18,7 +18,7 @@ export default function Me() {
const { logout } = useAuth();
const { getNavigationTarget } = useNavigationTarget();
const [regionDialogOpen, setRegionDialogOpen] = useState(false);
const { region: selectedRegion, regionId } = useRegion();
const { region: selectedRegion } = useRegion();
useFocusEffect(() => {
const target = getNavigationTarget();
@ -66,11 +66,11 @@ export default function Me() {
subtitle: 'Manage delivery locations'
},
{
title: 'Delivery Region',
title: 'Delivery Address',
icon: 'globe-outline',
color: '#0EA5E9',
onPress: () => setRegionDialogOpen(true),
subtitle: selectedRegion?.name ? `Browsing ${selectedRegion.name}` : 'Choose your region'
subtitle: selectedRegion?.name ? `Delivering in ${selectedRegion.name}` : 'Choose or add an address'
},
{
title: 'Profile Settings',
@ -177,16 +177,7 @@ export default function Me() {
</View>
</ScrollView>
<BottomDialog open={regionDialogOpen} onClose={() => setRegionDialogOpen(false)}>
<View style={tw`h-96`}>
<RegionSelector
mode="switch"
selectedRegionId={regionId}
onComplete={() => setRegionDialogOpen(false)}
onCancel={() => setRegionDialogOpen(false)}
/>
</View>
</BottomDialog>
<AddressSwitcherSheet open={regionDialogOpen} onClose={() => setRegionDialogOpen(false)} />
</View>

View file

@ -26,6 +26,8 @@ import { RefreshProvider } from "../../../packages/ui/src/lib/refresh-context";
import WebViewWrapper from "@/components/WebViewWrapper";
import BackHandlerWrapper from "@/components/BackHandler";
import AddToCartDialog from "@/src/components/AddToCartDialog";
import PendingAddressSync from "@/src/components/PendingAddressSync";
import LocationTestWrapper from "@/components/LocationTestWrapper";
import React from "react";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import NotifChecker from "@/services/notif-service/notif-checker";
@ -70,7 +72,9 @@ export default function RootLayout() {
<WebViewWrapper>
<FirstUserWrapper>
<AuthProvider>
<NotificationProvider>
<PendingAddressSync />
<LocationTestWrapper>
<NotificationProvider>
<NotifChecker />
<PaperProvider>
<RefreshProvider queryClient={queryClient}>
@ -82,6 +86,7 @@ export default function RootLayout() {
</RefreshProvider>
</PaperProvider>
</NotificationProvider>
</LocationTestWrapper>
</AuthProvider>
</FirstUserWrapper>
</WebViewWrapper>

View file

@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'
import { View } from 'react-native'
import { MyButton, StorageServiceCasual, tw, MyText } from 'common-ui'
import type { ReactParentComponent } from '@packages/shared'
import LocationTestWrapper from '@/components/LocationTestWrapper'
const FirstUserWrapper: React.FC<ReactParentComponent> = ({ children }) => {
const [isFirstTime, setIsFirstTime] = useState<boolean | null>(null)
@ -35,7 +34,7 @@ const FirstUserWrapper: React.FC<ReactParentComponent> = ({ children }) => {
)
}
return <LocationTestWrapper>{children}</LocationTestWrapper>
return <>{children}</>
}
export default FirstUserWrapper

View file

@ -4,7 +4,7 @@ import { MyText, theme, tw } from 'common-ui'
import type { ReactParentComponent } from '@packages/shared'
import { trpc } from '../src/trpc-client'
import { useRegion } from '@/src/hooks/useRegion'
import RegionSelector from '@/src/components/RegionSelector'
import LocationFallbackFlow from '@/src/components/location/LocationFallbackFlow'
const LoadingScreen: React.FC<{ label?: string }> = ({ label }) => (
<View style={tw`flex-1 justify-center items-center bg-white`}>
@ -58,10 +58,10 @@ const LocationTestWrapper: React.FC<ReactParentComponent> = ({ children }) => {
return <LoadingScreen label="Finding your region..." />
}
// Location unavailable / denied / out of area -> choose a region manually.
// Location unavailable / denied / out of area -> pick an address or add one.
return (
<View style={tw`flex-1 bg-white`}>
<RegionSelector mode="gate" selectedRegionId={regionId} />
<LocationFallbackFlow />
</View>
)
}

View file

@ -1,33 +1,76 @@
import React, { useState } from 'react';
import { View, ScrollView, Dimensions } from 'react-native';
import { useMutation } from '@tanstack/react-query';
import React, { useCallback, useEffect, useState } from 'react';
import { View, Modal, ScrollView, KeyboardAvoidingView, Platform } from 'react-native';
import { Formik } from 'formik';
import * as Yup from 'yup';
import { tw, MyText, MyTouchableOpacity , Checkbox , MyTextInput , LoadingDialog } from 'common-ui';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { trpc } from '../trpc-client';
import LocationAttacher from './LocationAttacher';
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view';
import LocationMapStep from './location/LocationMapStep';
import type { AddressFormProps } from '@packages/shared';
import { useRegion } from '@/src/hooks/useRegion';
import { savePendingAddress } from '@/src/lib/pending-address';
const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isEdit = false }) => {
type Coords = { latitude: number; longitude: number };
type ResolvedRegion = { regionId: number; boundId: number | null };
const AddressForm: React.FC<AddressFormProps> = ({
onSuccess,
initialValues,
isEdit = false,
draftMode = false,
onResolvedRegion,
}) => {
const [isSubmitting, setIsSubmitting] = useState(false);
const [submitError, setSubmitError] = useState<string | null>(null);
const [showGoogleMapsField, setShowGoogleMapsField] = useState(!!initialValues?.googleMapsUrl);
const [showRegionOptions, setShowRegionOptions] = useState(false);
const [currentLocation, setCurrentLocation] = useState<{ latitude: number; longitude: number } | null>(
initialValues?.latitude && initialValues?.longitude
const [mapOpen, setMapOpen] = useState(false);
const [currentLocation, setCurrentLocation] = useState<Coords | null>(
initialValues?.latitude != null && initialValues?.longitude != null
? { latitude: initialValues.latitude, longitude: initialValues.longitude }
: null
);
// Region is never picked directly: it is derived from the coordinates.
const [resolvedRegion, setResolvedRegion] = useState<ResolvedRegion | null>(null);
const [locationError, setLocationError] = useState<string | null>(null);
const { regionId: browsingRegionId, boundId: browsingBoundId } = useRegion();
const { data: regions } = trpc.common.listRegions.useQuery();
const utils = trpc.useUtils();
// Edits keep the stored region unless the user explicitly changes it; new
// addresses default to the region the user is currently browsing.
const initialRegionId = initialValues?.regionId ?? browsingRegionId ?? undefined;
// Resolve coordinates -> region + bound. Used for whichever source the user
// picks (attach current location or the map). Out-of-area points are refused.
const resolveLocation = useCallback(
async (coords: Coords) => {
setCurrentLocation(coords);
setLocationError(null);
try {
const resolved = await utils.common.resolveRegionByLocation.fetch({
lat: coords.latitude,
lng: coords.longitude,
});
if (!resolved) {
setResolvedRegion(null);
setLocationError('This location is outside our delivery area. Try selecting on the map.');
return;
}
const info: ResolvedRegion = {
regionId: resolved.region.id,
boundId: resolved.bound?.id ?? null,
};
setResolvedRegion(info);
onResolvedRegion?.(info);
} catch {
setResolvedRegion(null);
setLocationError('Could not verify this location. Please try again.');
}
},
[utils, onResolvedRegion]
);
// Resolve any prefilled coordinates once (e.g. edit, or coming from the map).
useEffect(() => {
if (initialValues?.latitude != null && initialValues?.longitude != null) {
void resolveLocation({ latitude: initialValues.latitude, longitude: initialValues.longitude });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const createAddressMutation = trpc.user.address.createAddress.useMutation({
onSuccess: (data) => {
@ -55,9 +98,6 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
});
const validationSchema = Yup.object({
regionId: Yup.number()
.typeError('Region is required')
.required('Region is required'),
name: Yup.string().required('Name is required'),
phone: Yup.string().required('Phone is required')
.matches(/^[6-9]\d{9}$/, 'Phone must be a 10-digit number starting with 6, 7, 8 or 9'),
@ -70,11 +110,16 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
});
return (
<KeyboardAwareScrollView
style={[tw`px-4 pt-4 pb-32 bg-white`, {maxHeight: Dimensions.get('window').height * 0.7}]}
keyboardShouldPersistTaps="always"
keyboardDismissMode="on-drag"
<KeyboardAvoidingView
style={tw`flex-1 bg-white`}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
>
<ScrollView
style={tw`flex-1`}
contentContainerStyle={tw`px-4 pt-4 pb-10`}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}
>
<MyText style={tw`text-xl font-bold mb-4`}>{isEdit ? 'Edit Address' : 'Add Address'}</MyText>
{/* Service Area Notice */}
@ -94,8 +139,7 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
</View>
)}
<Formik
initialValues={initialValues ? { ...initialValues, regionId: initialRegionId } : {
regionId: initialRegionId,
initialValues={initialValues ? { ...initialValues } : {
name: '',
phone: '',
addressLine1: '',
@ -104,80 +148,59 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
state: 'Telangana',
pincode: '509001',
isDefault: false,
latitude: undefined,
longitude: undefined,
googleMapsUrl: '',
}}
validationSchema={validationSchema}
onSubmit={(values) => {
if (!values.regionId) {
setSubmitError('Please select a delivery region');
onSubmit={async (values) => {
if (!currentLocation) {
setSubmitError('Please attach your current location or select it on the map.');
return;
}
if (!resolvedRegion) {
setSubmitError(locationError || 'Please choose a location inside our delivery area.');
return;
}
setIsSubmitting(true);
setSubmitError(null);
const payload = {
...values,
regionId: values.regionId,
boundId: browsingBoundId ?? undefined,
latitude: currentLocation?.latitude,
longitude: currentLocation?.longitude,
googleMapsUrl: values.googleMapsUrl || undefined,
};
if (isEdit && initialValues?.id) {
updateAddressMutation.mutate({ id: initialValues.id, ...payload });
} else {
createAddressMutation.mutate(payload);
}
regionId: resolvedRegion.regionId,
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
googleMapsUrl: values.googleMapsUrl || undefined,
};
if (draftMode && !isEdit) {
// Signed-out flow: keep the address locally until the user has an
// account. PendingAddressSync posts it after signup/login.
await savePendingAddress({
regionId: resolvedRegion.regionId,
name: values.name,
phone: values.phone,
addressLine1: values.addressLine1,
addressLine2: values.addressLine2 || undefined,
city: values.city,
state: values.state,
pincode: values.pincode,
isDefault: values.isDefault,
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
googleMapsUrl: values.googleMapsUrl || undefined,
});
setIsSubmitting(false);
onSuccess();
return;
}
if (isEdit && initialValues?.id) {
updateAddressMutation.mutate({ id: initialValues.id, ...payload });
} else {
createAddressMutation.mutate(payload);
}
}}
>
{({ handleChange, handleBlur, handleSubmit, values, errors, touched, setFieldValue }) => (
<View style={tw`flex-col gap-2`}>
{/* Delivery Region (required) */}
<View style={tw`mb-1`}>
<MyText style={tw`text-gray-500 text-xs mb-1`}>Delivery Region *</MyText>
<MyTouchableOpacity
testID="address-region"
onPress={() => setShowRegionOptions((prev) => !prev)}
style={tw`border border-gray-200 rounded-lg p-3 flex-row items-center justify-between bg-gray-50`}
>
<MyText style={tw`${values.regionId ? 'text-gray-900' : 'text-gray-400'}`}>
{(regions ?? []).find((region) => region.id === values.regionId)?.name || 'Select region'}
</MyText>
<MaterialIcons
name={showRegionOptions ? 'keyboard-arrow-up' : 'keyboard-arrow-down'}
size={20}
color="#9CA3AF"
/>
</MyTouchableOpacity>
{showRegionOptions && (
<View style={tw`border border-gray-200 rounded-lg mt-1 bg-white overflow-hidden`}>
{(regions ?? []).map((region) => (
<MyTouchableOpacity
key={region.id}
testID={`address-region-option-${region.id}`}
onPress={() => {
setFieldValue('regionId', region.id);
setShowRegionOptions(false);
}}
style={tw`p-3 border-b border-gray-50 flex-row items-center justify-between`}
>
<MyText style={tw`text-gray-800`}>{region.name}</MyText>
{values.regionId === region.id && (
<MaterialIcons name="check" size={18} color="#3B82F6" />
)}
</MyTouchableOpacity>
))}
{(regions ?? []).length === 0 && (
<MyText style={tw`p-3 text-gray-400 text-sm`}>No regions available</MyText>
)}
</View>
)}
{touched.regionId && errors.regionId && (
<MyText style={tw`text-red-500 text-sm mt-1`}>{errors.regionId}</MyText>
)}
</View>
<MyTextInput
testID="address-name"
placeholder="Name"
@ -248,46 +271,37 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
/>
{touched.pincode && errors.pincode && <MyText style={tw`text-red-500 mb-2`}>{errors.pincode}</MyText>}
<LocationAttacher
initialLocation={currentLocation || undefined}
initialGoogleMapsUrl={values.googleMapsUrl}
googleMapsUrl={values.googleMapsUrl}
onGoogleMapsUrlChange={(url) => setFieldValue('googleMapsUrl', url)}
onLocationChange={(location) => setCurrentLocation(location)}
disabled={false}
/>
{!showGoogleMapsField && (
<MyTouchableOpacity
onPress={() => setShowGoogleMapsField(true)}
{/* Location is mandatory and drives the region: attach or pick on map. */}
<View style={tw`mt-1`}>
<MyText style={tw`text-gray-500 text-xs mb-2`}>Delivery Location *</MyText>
<LocationAttacher
initialLocation={currentLocation || undefined}
showGoogleMapsOption={false}
onLocationChange={(location) => {
if (location) void resolveLocation(location);
}}
disabled={false}
style={tw`mb-1`}
/>
<MyTouchableOpacity
testID="address-select-from-map"
onPress={() => setMapOpen(true)}
style={tw`flex-row items-center mb-1`}
>
<MyText style={tw`text-blue-500 text-sm font-medium`}>
Attach with Google Maps
</MyText>
<MaterialIcons name="map" size={18} color="#3B82F6" />
<MyText style={tw`text-blue-500 text-sm font-medium ml-1`}>Select on map</MyText>
</MyTouchableOpacity>
)}
{showGoogleMapsField && (
<View style={tw`mb-2`}>
<MyText style={tw`text-gray-500 text-xs mb-2`}>
1. Open Google Maps and Find location{'\n'}
2. Long press the desired location{'\n'}
3. Click on Share and Click on Copy{'\n'}
4. Paste the copied url here in the field.
{currentLocation && (
<MyText style={tw`text-gray-500 text-xs mt-1`}>
📍 {currentLocation.latitude.toFixed(5)}, {currentLocation.longitude.toFixed(5)}
</MyText>
<MyTextInput
placeholder="Google Maps Shared URL"
shrunkPadding={true}
onChangeText={handleChange('googleMapsUrl')}
onBlur={handleBlur('googleMapsUrl')}
value={values.googleMapsUrl}
/>
</View>
)}
)}
{locationError && (
<MyText style={tw`text-red-500 text-sm mt-1`}>{locationError}</MyText>
)}
</View>
<View style={tw`flex-row items-center mb-4`}>
<View style={tw`flex-row items-center mb-4 mt-2`}>
<Checkbox
checked={values.isDefault}
onPress={() => setFieldValue('isDefault', !values.isDefault)}
@ -314,8 +328,20 @@ const AddressForm: React.FC<AddressFormProps> = ({ onSuccess, initialValues, isE
open={isSubmitting}
message={isEdit ? "Updating address..." : "Adding address..."}
/>
</KeyboardAwareScrollView>
{/* Full-screen map picker. */}
<Modal visible={mapOpen} animationType="slide" onRequestClose={() => setMapOpen(false)}>
<LocationMapStep
onSelect={(coords) => {
setMapOpen(false);
void resolveLocation(coords);
}}
onCancel={() => setMapOpen(false)}
/>
</Modal>
</ScrollView>
</KeyboardAvoidingView>
);
};
export default AddressForm;
export default AddressForm;

View file

@ -1,19 +1,19 @@
import React, { useState } from 'react'
import { View } from 'react-native'
import MaterialIcons from '@expo/vector-icons/MaterialIcons'
import { tw, theme, MyText, MyTouchableOpacity, BottomDialog } from 'common-ui'
import { tw, theme, MyText, MyTouchableOpacity } from 'common-ui'
import { useRegion } from '@/src/hooks/useRegion'
import RegionSelector from '@/src/components/RegionSelector'
import AddressSwitcherSheet from '@/src/components/location/AddressSwitcherSheet'
/**
* Location bar shown at the top of every top-level tab screen.
* Rendered INSIDE the scroll content (first item / ListHeaderComponent) so it
* scrolls out with the page instead of sticking. Tapping opens a bottom
* sheet with the region list; switching is confirmed inside RegionSelector.
* scrolls out with the page instead of sticking. Tapping opens the address
* switcher: pick a saved address (region follows it) or add a new one.
*/
const LocationBar: React.FC = () => {
const [sheetOpen, setSheetOpen] = useState(false)
const { region, regionId } = useRegion()
const { region } = useRegion()
return (
<View style={tw`px-4 pt-3 pb-1`}>
@ -31,22 +31,13 @@ const LocationBar: React.FC = () => {
Deliver to
</MyText>
<MyText style={tw`text-gray-900 text-base font-bold`} numberOfLines={1}>
{region?.name ?? 'Choose your region'}
{region?.name ?? 'Choose your address'}
</MyText>
</View>
<MaterialIcons name="keyboard-arrow-down" size={24} color="#9CA3AF" />
</MyTouchableOpacity>
{sheetOpen && (
<BottomDialog open={sheetOpen} onClose={() => setSheetOpen(false)}>
<RegionSelector
mode="switch"
selectedRegionId={regionId}
onComplete={() => setSheetOpen(false)}
onCancel={() => setSheetOpen(false)}
/>
</BottomDialog>
)}
<AddressSwitcherSheet open={sheetOpen} onClose={() => setSheetOpen(false)} />
</View>
)
}

View file

@ -0,0 +1,50 @@
import { useEffect, useRef } from 'react'
import { trpc } from '@/src/trpc-client'
import { useAuth } from '@/src/contexts/AuthContext'
import { clearPendingAddress, getPendingAddress } from '@/src/lib/pending-address'
/**
* Posts a locally-drafted address (created while signed out in the location
* fallback flow) once the user is authenticated. Also runs at order time,
* because ordering requires an account. The draft is kept on failure so it can
* be retried on the next authenticated mount.
*/
const PendingAddressSync: React.FC = () => {
const { isAuthenticated } = useAuth()
const utils = trpc.useUtils()
const createAddress = trpc.user.address.createAddress.useMutation()
const isSyncing = useRef(false)
useEffect(() => {
if (!isAuthenticated || isSyncing.current) return
let cancelled = false
const run = async () => {
const pending = await getPendingAddress()
if (!pending || cancelled) return
isSyncing.current = true
try {
await createAddress.mutateAsync(pending)
await clearPendingAddress()
await utils.user.address.getUserAddresses.invalidate()
await utils.user.address.getDefaultAddress.invalidate()
} catch {
// Leave the draft in place; a later authenticated mount retries it.
} finally {
isSyncing.current = false
}
}
void run()
return () => {
cancelled = true
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isAuthenticated])
return null
}
export default PendingAddressSync

View file

@ -1,162 +0,0 @@
import React, { useState } from 'react'
import { View, ScrollView, ActivityIndicator, Alert } from 'react-native'
import MaterialIcons from '@expo/vector-icons/MaterialIcons'
import { useQueryClient } from '@tanstack/react-query'
import { tw, MyText, MyTouchableOpacity, theme } from 'common-ui'
import type { RegionSummary } from '@packages/shared'
import { trpc } from '@/src/trpc-client'
import { confirmRegionSwitch } from '@/src/lib/region-switch'
interface RegionSelectorProps {
/**
* 'gate' — first-run full-screen chooser, cannot be dismissed.
* 'switch' — content for a caller-owned dialog; shows a cart-clear confirmation.
*/
mode?: 'gate' | 'switch'
/** Current browsing region id, for highlighting. Supplied by the caller so
* this presentational picker never triggers location tracking itself. */
selectedRegionId?: number | null
onComplete?: (region: RegionSummary) => void
onCancel?: () => void
}
const RegionSelector: React.FC<RegionSelectorProps> = ({
mode = 'gate',
selectedRegionId = null,
onComplete,
onCancel,
}) => {
const queryClient = useQueryClient()
const [isSwitching, setIsSwitching] = useState(false)
const { data: regions, isLoading, error, refetch } = trpc.common.listRegions.useQuery()
const applySwitch = async (region: RegionSummary) => {
setIsSwitching(true)
try {
// The active bound is derived from the user's addresses (see useRegion).
await confirmRegionSwitch(region, queryClient)
onComplete?.(region)
} finally {
setIsSwitching(false)
}
}
const handlePick = (region: RegionSummary) => {
if (isSwitching) return
// First run: no cart exists yet, select directly.
if (mode === 'gate') {
void applySwitch(region)
return
}
if (region.id === selectedRegionId) {
onCancel?.()
return
}
Alert.alert(
'Switch region?',
`Switching to ${region.name} will clear your entire cart (regular and 1-hour delivery). This cannot be undone.`,
[
{ text: 'Cancel', style: 'cancel', onPress: () => onCancel?.() },
{
text: 'Switch & clear cart',
style: 'destructive',
onPress: () => {
void applySwitch(region)
},
},
]
)
}
const header = mode === 'gate' ? (
<View style={tw`px-6 pt-12 pb-6`}>
<MyText style={tw`text-3xl font-extrabold text-gray-900`}>Choose your region</MyText>
<MyText style={tw`text-gray-500 mt-2`}>
We deliver to one region at a time. Pick where you want your groceries delivered.
</MyText>
</View>
) : (
<View style={tw`px-5 pt-2 pb-4`}>
<MyText style={tw`text-xl font-bold text-gray-900`}>Delivery Region</MyText>
<MyText style={tw`text-gray-500 text-sm mt-1`}>
Switching region clears your current cart.
</MyText>
</View>
)
if (isLoading) {
return (
<View style={tw`flex-1 justify-center items-center py-16`}>
<ActivityIndicator size="large" color={theme.colors.brand500} />
<MyText style={tw`text-gray-500 mt-4`}>Loading regions...</MyText>
</View>
)
}
if (error) {
return (
<View style={tw`flex-1 justify-center items-center py-16 px-6`}>
<MaterialIcons name="public-off" size={48} color="#EF4444" />
<MyText style={tw`text-gray-900 font-bold text-lg mt-3`}>Unable to load regions</MyText>
<MyText style={tw`text-gray-500 text-center mt-2 mb-5`}>
Please check your connection and try again.
</MyText>
<MyTouchableOpacity
onPress={() => refetch()}
style={tw`bg-brand500 px-6 py-3 rounded-xl`}
>
<MyText style={tw`text-white font-bold`}>Retry</MyText>
</MyTouchableOpacity>
</View>
)
}
return (
<View style={tw`flex-1`}>
{header}
<ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={tw`px-5 pb-10`}>
{(regions ?? []).map((region) => {
const isSelected = region.id === selectedRegionId
return (
<MyTouchableOpacity
key={region.id}
testID={`region-option-${region.id}`}
activeOpacity={0.85}
disabled={isSwitching}
onPress={() => handlePick(region)}
style={tw`flex-row items-center bg-white border ${isSelected ? 'border-brand500 bg-blue-50' : 'border-gray-100'} rounded-2xl p-4 mb-3 shadow-sm`}
>
<View style={tw`w-11 h-11 rounded-full ${isSelected ? 'bg-brand500' : 'bg-gray-100'} items-center justify-center mr-3`}>
<MaterialIcons
name="location-on"
size={22}
color={isSelected ? 'white' : theme.colors.brand500}
/>
</View>
<View style={tw`flex-1`}>
<MyText style={tw`text-base font-bold text-gray-900`}>{region.name}</MyText>
{!!region.description && (
<MyText style={tw`text-gray-500 text-xs mt-0.5`} numberOfLines={2}>
{region.description}
</MyText>
)}
</View>
{isSelected && (
<MaterialIcons name="check-circle" size={22} color={theme.colors.brand500} />
)}
</MyTouchableOpacity>
)
})}
{isSwitching && (
<MyText style={tw`text-center text-gray-400 text-xs mt-2`}>Switching region...</MyText>
)}
</ScrollView>
</View>
)
}
export default RegionSelector

View file

@ -0,0 +1,24 @@
import React from 'react'
import { Modal, View } from 'react-native'
import { tw } from 'common-ui'
import LocationFallbackFlow from './LocationFallbackFlow'
interface AddressSwitcherSheetProps {
open: boolean
onClose: () => void
}
/**
* Full-screen modal that lets the user switch the active delivery address (and
* therefore region/bound) or add a new one. Used by the location bar and the
* Me screen in place of the old direct region picker.
*/
const AddressSwitcherSheet: React.FC<AddressSwitcherSheetProps> = ({ open, onClose }) => (
<Modal visible={open} animationType="slide" onRequestClose={onClose}>
<View style={tw`flex-1 bg-white`}>
<LocationFallbackFlow onClose={onClose} />
</View>
</Modal>
)
export default AddressSwitcherSheet

View file

@ -0,0 +1,248 @@
import React, { useCallback, useRef, useState } from 'react'
import { View, ScrollView, ActivityIndicator } from 'react-native'
import { useQueryClient } from '@tanstack/react-query'
import MaterialIcons from '@expo/vector-icons/MaterialIcons'
import { MyText, MyTouchableOpacity, tw, theme } from 'common-ui'
import { trpc } from '@/src/trpc-client'
import { useAuthOptional } from '@/src/contexts/AuthContext'
import { confirmRegionSwitch } from '@/src/lib/region-switch'
import AddressForm from '@/src/components/AddressForm'
type ResolvedRegion = { regionId: number; boundId: number | null }
/** Address fields the chooser needs (serialized API shape). */
interface ChooserAddress {
id: number
regionId: number | null
boundId: number | null
latitude: number | null
longitude: number | null
name: string
phone: string
addressLine1: string
addressLine2: string | null
city: string
state: string
pincode: string
isDefault: boolean
}
interface LocationFallbackFlowProps {
/** Present when hosted in a sheet; lets the caller dismiss after a choice. */
onClose?: () => void
}
/**
* Region is no longer chosen directly. The user either picks a saved address
* (which switches the browsing region + bound and clears the cart) or adds a
* new one (coordinates required, via attach-location or the map).
*/
const LocationFallbackFlow: React.FC<LocationFallbackFlowProps> = ({ onClose }) => {
const queryClient = useQueryClient()
const utils = trpc.useUtils()
const auth = useAuthOptional()
const isAuthenticated = auth?.isAuthenticated ?? false
const [mode, setMode] = useState<'choose' | 'add'>('choose')
const [busy, setBusy] = useState(false)
const [message, setMessage] = useState<string | null>(null)
const resolvedRef = useRef<ResolvedRegion | null>(null)
const addressesQuery = trpc.user.address.getUserAddresses.useQuery(undefined, {
enabled: isAuthenticated,
})
const updateAddress = trpc.user.address.updateAddress.useMutation()
const addresses = (addressesQuery.data?.data ?? []) as unknown as ChooserAddress[]
const activate = useCallback(
async (regionId: number, boundId: number | null) => {
setBusy(true)
try {
const regions = await utils.common.listRegions.fetch()
const region = regions.find((candidate) => candidate.id === regionId)
if (!region) {
setMessage('This location is no longer serviceable.')
return
}
await confirmRegionSwitch(region, queryClient, boundId)
} finally {
setBusy(false)
}
},
[queryClient, utils]
)
const handleSelect = useCallback(
async (address: ChooserAddress) => {
if (address.regionId == null) {
setMessage('This saved address has no region. Please add a new address instead.')
return
}
let boundId = address.boundId
if (boundId == null && address.latitude != null && address.longitude != null) {
try {
const resolved = await utils.common.resolveRegionByLocation.fetch({
lat: address.latitude,
lng: address.longitude,
})
boundId = resolved?.bound?.id ?? null
} catch {
boundId = null
}
}
await activate(address.regionId, boundId)
onClose?.()
},
[activate, onClose, utils]
)
const handleSetDefault = useCallback(
(address: ChooserAddress) => {
if (address.regionId == null) {
setMessage('This saved address has no region. Please add a new address instead.')
return
}
updateAddress.mutate(
{
id: address.id,
regionId: address.regionId,
name: address.name,
phone: address.phone,
addressLine1: address.addressLine1,
addressLine2: address.addressLine2 || undefined,
city: address.city,
state: address.state,
pincode: address.pincode,
isDefault: true,
latitude: address.latitude ?? undefined,
longitude: address.longitude ?? undefined,
},
{
onSuccess: () => {
void utils.user.address.getUserAddresses.invalidate()
void utils.user.address.getDefaultAddress.invalidate()
},
onError: (error: any) => setMessage(error?.message || 'Could not set default address.'),
}
)
},
[updateAddress, utils]
)
const handleFormSuccess = useCallback(async () => {
const resolved = resolvedRef.current
if (resolved) {
await activate(resolved.regionId, resolved.boundId)
}
onClose?.()
}, [activate, onClose])
if (mode === 'add') {
return (
<View style={tw`flex-1 bg-white`}>
<MyTouchableOpacity
onPress={() => setMode('choose')}
style={tw`px-5 pt-12 pb-2 flex-row items-center`}
>
<MaterialIcons name="arrow-back" size={22} color="#4B5563" />
<MyText style={tw`text-gray-600 ml-1`}>Back</MyText>
</MyTouchableOpacity>
<AddressForm
draftMode={!isAuthenticated}
onResolvedRegion={(info) => {
resolvedRef.current = info
}}
onSuccess={handleFormSuccess}
/>
</View>
)
}
return (
<View style={tw`flex-1 bg-white`}>
<View style={tw`px-6 pt-12 pb-4 flex-row items-start justify-between`}>
<View style={tw`flex-1`}>
<MyText style={tw`text-3xl font-extrabold text-gray-900`}>Delivery Address</MyText>
<MyText style={tw`text-gray-500 mt-2`}>
Choose a saved address, or add a new one. Your region follows the address.
</MyText>
</View>
{onClose && (
<MyTouchableOpacity onPress={onClose} style={tw`p-1`}>
<MaterialIcons name="close" size={24} color="#9CA3AF" />
</MyTouchableOpacity>
)}
</View>
{message && (
<View style={tw`mx-5 mb-2 bg-red-50 border border-red-200 rounded-xl p-3`}>
<MyText style={tw`text-red-600 text-sm`}>{message}</MyText>
</View>
)}
{isAuthenticated && addressesQuery.isLoading && (
<View style={tw`flex-1 items-center justify-center`}>
<ActivityIndicator size="large" color={theme.colors.brand500} />
</View>
)}
<ScrollView contentContainerStyle={tw`px-5 pb-10`}>
{isAuthenticated &&
addresses.map((address) => (
<View
key={address.id}
style={tw`bg-white border border-gray-100 rounded-2xl p-4 mb-3 shadow-sm`}
>
<MyTouchableOpacity disabled={busy} onPress={() => handleSelect(address)}>
<View style={tw`flex-row items-center mb-1`}>
<MyText style={tw`text-base font-bold text-gray-900 mr-2`}>{address.name}</MyText>
{address.isDefault && (
<View style={tw`bg-green-100 px-2 py-0.5 rounded-full`}>
<MyText style={tw`text-green-700 text-[10px] font-semibold`}>Default</MyText>
</View>
)}
</View>
<MyText style={tw`text-gray-600 text-sm`}>
{address.addressLine1}
{address.addressLine2 ? `, ${address.addressLine2}` : ''}, {address.city} - {address.pincode}
</MyText>
</MyTouchableOpacity>
{!address.isDefault && (
<MyTouchableOpacity
onPress={() => handleSetDefault(address)}
disabled={busy || updateAddress.isPending}
style={tw`mt-2 self-start`}
>
<MyText style={tw`text-blue-500 text-xs font-medium`}>Set as default</MyText>
</MyTouchableOpacity>
)}
</View>
))}
{isAuthenticated && !addressesQuery.isLoading && addresses.length === 0 && (
<MyText style={tw`text-gray-500 mb-3`}>No saved addresses yet.</MyText>
)}
<MyTouchableOpacity
onPress={() => setMode('add')}
style={tw`bg-white border border-dashed border-gray-300 rounded-2xl p-4 flex-row items-center`}
>
<MaterialIcons name="add-location-alt" size={22} color={theme.colors.brand500} />
<MyText style={tw`text-gray-900 font-bold ml-2`}>Add a new address</MyText>
</MyTouchableOpacity>
</ScrollView>
{busy && (
<View style={tw`absolute inset-0 bg-black/20 items-center justify-center`}>
<ActivityIndicator size="large" color={theme.colors.brand500} />
</View>
)}
</View>
)
}
export default LocationFallbackFlow

View file

@ -0,0 +1,86 @@
import React, { useCallback, useState } from 'react'
import { View, ActivityIndicator } from 'react-native'
import { WebView, type WebViewMessageEvent } from 'react-native-webview'
import { MyText, MyTouchableOpacity, tw, theme } from 'common-ui'
import constants from '@/src/constants'
export interface PickedCoords {
latitude: number
longitude: number
}
interface LocationMapStepProps {
/** Called with the coordinates the user confirmed on the map. */
onSelect: (coords: PickedCoords) => void
/** Called when the user backs out of the map. */
onCancel: () => void
/** Shown when a previously picked point was rejected (outside the region). */
error?: string
}
/**
* Full-screen WebView wrapping the web-ui `/location-selector` page. The page
* posts `{ type: 'location-selected', latitude, longitude }` back through
* `window.ReactNativeWebView.postMessage` when the user confirms a point.
*/
export default function LocationMapStep({ onSelect, onCancel, error }: LocationMapStepProps) {
const [isLoading, setIsLoading] = useState(true)
const url = `${constants.WEB_UI_BASE_URL}/location-selector`
const handleMessage = useCallback(
(event: WebViewMessageEvent) => {
try {
const data = JSON.parse(event.nativeEvent.data)
if (
data?.type === 'location-selected' &&
typeof data.latitude === 'number' &&
typeof data.longitude === 'number'
) {
onSelect({ latitude: data.latitude, longitude: data.longitude })
}
} catch {
// Ignore non-JSON or unrelated messages from the page.
}
},
[onSelect]
)
return (
<View style={tw`flex-1 bg-white`}>
<WebView
source={{ uri: url }}
style={tw`flex-1`}
originWhitelist={['*']}
javaScriptEnabled
domStorageEnabled
onMessage={handleMessage}
onLoadEnd={() => setIsLoading(false)}
startInLoadingState
// The map handles its own gestures; page scroll would just fight it.
scrollEnabled={false}
// Needed so the embedded page can geolocate/confirm on device.
geolocationEnabled
/>
{isLoading && (
<View style={tw`absolute inset-0 items-center justify-center bg-white`}>
<ActivityIndicator size="large" color={theme.colors.brand500} />
<MyText style={tw`text-gray-500 mt-3`}>Loading map...</MyText>
</View>
)}
<MyTouchableOpacity
onPress={onCancel}
style={tw`absolute top-12 left-4 bg-white px-4 py-2 rounded-full shadow`}
>
<MyText style={tw`text-gray-700 font-bold`}>Cancel</MyText>
</MyTouchableOpacity>
{!!error && (
<View style={tw`absolute bottom-8 left-4 right-4 bg-red-50 border border-red-200 rounded-xl p-3`}>
<MyText style={tw`text-red-600 text-sm text-center`}>{error}</MyText>
</View>
)}
</View>
)
}

View file

@ -4,6 +4,9 @@ const constants = {
BASE_URL: process.env.BASE_URL,
GOOGLE_AUTH_URL: process.env.GOOGLE_AUTH_URL,
AUTH_REDIRECT_KEY: 'auth_redirect_state',
// Web app used inside the app for the map-based address picker
// (web-ui /location-selector route). Replace with the live URL later.
WEB_UI_BASE_URL: 'https://localuserweb.freshyo.in',
// Bump this on every release. When it is lower than the backend's
// `internalAppVersion` constant, UpdateChecker prompts the user to restart.
INTERNAL_APP_VERSION: 2,

View file

@ -105,7 +105,9 @@ export function useRegion(): UseRegionResult {
// Keep the stored bound in sync with the derived active bound (region-level).
useEffect(() => {
if (regionId == null || !region) return
if (activeBoundId != null && activeBoundId !== storedBoundId) {
// Only fill in a MISSING bound. Never overwrite a bound already resolved
// from the device location or a chosen address: those win at startup.
if (storedBoundId == null && activeBoundId != null) {
setRegion(region, activeBoundId)
}
}, [regionId, region, activeBoundId, storedBoundId, setRegion])

View file

@ -0,0 +1,42 @@
import { StorageServiceCasual } from 'common-ui'
/**
* A delivery address the user filled in while signed out. It is kept in local
* storage and posted to the backend once the user has an account (see
* PendingAddressSync). Coordinates are always present because they come from
* the map picker.
*/
export interface PendingAddressInput {
regionId: number
name: string
phone: string
addressLine1: string
addressLine2?: string
city: string
state: string
pincode: string
isDefault?: boolean
latitude: number
longitude: number
googleMapsUrl?: string
}
const PENDING_ADDRESS_KEY = 'freshyo_pending_address'
export async function savePendingAddress(address: PendingAddressInput): Promise<void> {
await StorageServiceCasual.setItem(PENDING_ADDRESS_KEY, JSON.stringify(address))
}
export async function getPendingAddress(): Promise<PendingAddressInput | null> {
const raw = await StorageServiceCasual.getItem(PENDING_ADDRESS_KEY)
if (!raw) return null
try {
return JSON.parse(raw) as PendingAddressInput
} catch {
return null
}
}
export async function clearPendingAddress(): Promise<void> {
await StorageServiceCasual.removeItem(PENDING_ADDRESS_KEY)
}

1
apps/web-ui/.env Normal file
View file

@ -0,0 +1 @@
VITE_GOOGLE_MAPS_API_KEY=AIzaSyAyvERo7W0k20RNNSKnaXCknfFXBGHRYeM

View file

@ -1,15 +1,14 @@
import React, { useState } from 'react'
import React, { useCallback, useEffect, useState } from 'react'
import { trpc } from '../lib/trpc-client'
import { useRegionStore } from '../lib/stores/region-store'
import { p, pInput as PInput, MyButton, div } from 'web-components'
import { MapPin, X, Plus } from 'lucide-react'
import { MapPin } from 'lucide-react'
import * as Yup from 'yup'
import type { AddressFormProps } from '@packages/shared'
type Coords = { latitude: number; longitude: number }
type ResolvedRegion = { regionId: number; boundId: number | null }
const validationSchema = Yup.object({
regionId: Yup.number()
.typeError('Region is required')
.required('Region is required'),
name: Yup.string().required('Name is required'),
phone: Yup.string().required('Phone is required').matches(/^\d{10}$/, 'Phone must be 10 digits'),
addressLine1: Yup.string().required('Address Line 1 is required'),
@ -20,39 +19,90 @@ const validationSchema = Yup.object({
isDefault: Yup.boolean(),
})
export function AddressForm({ onSuccess, initialValues, isEdit = false }: AddressFormProps) {
export function AddressForm({ onSuccess, initialValues, isEdit = false, onResolvedRegion }: AddressFormProps) {
const [isSubmitting, setIsSubmitting] = useState(false)
const [submitError, setSubmitError] = useState<string | null>(null)
const [showGoogleMapsField, setShowGoogleMapsField] = useState(!!initialValues?.googleMapsUrl)
const [currentLocation, setCurrentLocation] = useState<{ latitude: number; longitude: number } | null>(
initialValues?.latitude && initialValues?.longitude
const [mapOpen, setMapOpen] = useState(false)
const [locating, setLocating] = useState(false)
const [locationError, setLocationError] = useState<string | null>(null)
const [currentLocation, setCurrentLocation] = useState<Coords | null>(
initialValues?.latitude != null && initialValues?.longitude != null
? { latitude: initialValues.latitude, longitude: initialValues.longitude }
: null
)
// Region is derived from the coordinates, never picked directly.
const [resolvedRegion, setResolvedRegion] = useState<ResolvedRegion | null>(null)
const browsingRegionId = useRegionStore((state) => state.selectedRegionId)
const { data: regions } = trpc.common.listRegions.useQuery()
const utils = trpc.useUtils()
const [values, setValues] = useState(() => {
// Edits keep the stored region unless the user explicitly changes it; new
// addresses default to the region the user is currently browsing.
const initialRegionId = initialValues?.regionId ?? browsingRegionId ?? null
return {
regionId: initialRegionId as number | null,
name: initialValues?.name || '',
phone: initialValues?.phone || '',
addressLine1: initialValues?.addressLine1 || '',
addressLine2: initialValues?.addressLine2 || '',
city: initialValues?.city || 'Mahabubnagar',
state: initialValues?.state || 'Telangana',
pincode: initialValues?.pincode || '509001',
isDefault: initialValues?.isDefault || false,
googleMapsUrl: initialValues?.googleMapsUrl || '',
}
})
const [values, setValues] = useState(() => ({
name: initialValues?.name || '',
phone: initialValues?.phone || '',
addressLine1: initialValues?.addressLine1 || '',
addressLine2: initialValues?.addressLine2 || '',
city: initialValues?.city || 'Mahabubnagar',
state: initialValues?.state || 'Telangana',
pincode: initialValues?.pincode || '509001',
isDefault: initialValues?.isDefault || false,
googleMapsUrl: initialValues?.googleMapsUrl || '',
}))
const [errors, setErrors] = useState<Record<string, string>>({})
const resolveLocation = useCallback(
async (coords: Coords) => {
setCurrentLocation(coords)
setLocationError(null)
try {
const resolved = await utils.common.resolveRegionByLocation.fetch({
lat: coords.latitude,
lng: coords.longitude,
})
if (!resolved) {
setResolvedRegion(null)
setLocationError('This location is outside our delivery area. Try selecting on the map.')
return
}
const info: ResolvedRegion = {
regionId: resolved.region.id,
boundId: resolved.bound?.id ?? null,
}
setResolvedRegion(info)
onResolvedRegion?.(info)
} catch {
setResolvedRegion(null)
setLocationError('Could not verify this location. Please try again.')
}
},
[utils, onResolvedRegion]
)
useEffect(() => {
if (initialValues?.latitude != null && initialValues?.longitude != null) {
void resolveLocation({ latitude: initialValues.latitude, longitude: initialValues.longitude })
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
// Coordinates picked on the embedded map are delivered via postMessage.
useEffect(() => {
if (!mapOpen) return
const handler = (event: MessageEvent) => {
if (event.origin !== window.location.origin) return
const data = event.data
if (
data?.type === 'location-selected' &&
typeof data.latitude === 'number' &&
typeof data.longitude === 'number'
) {
setMapOpen(false)
void resolveLocation({ latitude: data.latitude, longitude: data.longitude })
}
}
window.addEventListener('message', handler)
return () => window.removeEventListener('message', handler)
}, [mapOpen, resolveLocation])
const createMutation = trpc.user.address.createAddress.useMutation({
onSuccess: (data) => {
setIsSubmitting(false)
@ -75,20 +125,44 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
},
})
const handleChange = (field: string, value: string | boolean | number | null) => {
const handleChange = (field: string, value: string | boolean) => {
setValues((prev) => ({ ...prev, [field]: value }))
if (errors[field]) {
setErrors((prev) => ({ ...prev, [field]: '' }))
}
}
const handleDetectLocation = () => {
if (!navigator.geolocation) {
setLocationError('Location is not supported in this browser. Please select on the map.')
return
}
setLocating(true)
navigator.geolocation.getCurrentPosition(
(position) => {
setLocating(false)
void resolveLocation({
latitude: position.coords.latitude,
longitude: position.coords.longitude,
})
},
() => {
setLocating(false)
setLocationError('Could not get your location. Please select on the map.')
},
{ enableHighAccuracy: true, timeout: 10000 }
)
}
const handleSubmit = async () => {
try {
await validationSchema.validate(values, { abortEarly: false })
const regionId = values.regionId
if (regionId == null) {
setErrors((prev) => ({ ...prev, regionId: 'Please select a delivery region' }))
setSubmitError('Please select a delivery region')
if (!currentLocation) {
setSubmitError('Please use your current location or select one on the map.')
return
}
if (!resolvedRegion) {
setSubmitError(locationError || 'Please choose a location inside our delivery area.')
return
}
setIsSubmitting(true)
@ -96,9 +170,9 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
const payload = {
...values,
regionId,
latitude: currentLocation?.latitude,
longitude: currentLocation?.longitude,
regionId: resolvedRegion.regionId,
latitude: currentLocation.latitude,
longitude: currentLocation.longitude,
googleMapsUrl: values.googleMapsUrl || undefined,
}
@ -117,24 +191,18 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
}
return (
<div className="max-h-[80vh] overflow-y-auto p-6">
<div className="p-6">
<div className="mb-6 flex items-center justify-between">
<p className="font-bold text-xl">
{isEdit ? 'Edit Address' : 'Add Address'}
</p>
<p className="font-bold text-xl">{isEdit ? 'Edit Address' : 'Add Address'}</p>
</div>
{/* Service Area Notice */}
<div className="mb-4 rounded-lg border border-amber-200 bg-amber-50 p-3">
<div className="flex items-center gap-2">
<span className="text-amber-600">ℹ️</span>
<p className="flex-1 text-sm text-amber-800">
We currently serve only in Mahabubnagar town
</p>
<p className="flex-1 text-sm text-amber-800">We currently serve only in Mahabubnagar town</p>
</div>
</div>
{/* Submit Error Message */}
{submitError && (
<div className="mb-4 rounded-lg border border-red-200 bg-red-50 p-3">
<p className="text-sm text-red-600">{submitError}</p>
@ -142,28 +210,6 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
)}
<div className="space-y-4">
<div>
<p className="mb-1 text-xs text-gray-500">Delivery Region *</p>
<select
data-testid="address-region"
value={values.regionId ?? ''}
onChange={(e) =>
handleChange('regionId', e.target.value ? Number(e.target.value) : null)
}
className={`w-full rounded-lg border bg-gray-50 p-3 text-base outline-none ${
errors.regionId ? 'border-red-500' : 'border-gray-200'
}`}
>
<option value="">Select region</option>
{(regions ?? []).map((region) => (
<option key={region.id} value={region.id}>
{region.name}
</option>
))}
</select>
{errors.regionId && <p className="mt-1 text-sm text-red-500">{errors.regionId}</p>}
</div>
<div>
<PInput
placeholder="Name"
@ -205,58 +251,47 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
<div className="grid grid-cols-2 gap-4">
<div>
<PInput
placeholder="City"
value={values.city}
disabled
className="bg-gray-100"
/>
<PInput placeholder="City" value={values.city} disabled className="bg-gray-100" />
</div>
<div>
<PInput
placeholder="State"
value={values.state}
disabled
className="bg-gray-100"
/>
<PInput placeholder="State" value={values.state} disabled className="bg-gray-100" />
</div>
</div>
<div>
<PInput
placeholder="Pincode"
value={values.pincode}
disabled
className="bg-gray-100"
/>
<PInput placeholder="Pincode" value={values.pincode} disabled className="bg-gray-100" />
</div>
{!showGoogleMapsField && (
<div
onClick={() => setShowGoogleMapsField(true)}
className="text-blue-500"
>
<p className="font-medium text-sm">
Attach with Google Maps
</p>
{/* Location is mandatory and drives the region. */}
<div className="rounded-lg border border-gray-200 p-3">
<p className="mb-2 text-xs text-gray-500">Delivery Location *</p>
<div className="flex flex-col gap-2">
<button
type="button"
onClick={handleDetectLocation}
disabled={locating}
className="flex items-center gap-2 text-left text-sm font-medium text-blue-500 disabled:opacity-50"
>
<MapPin className="h-4 w-4" />
{locating ? 'Fetching location…' : 'Use my current location'}
</button>
<button
type="button"
onClick={() => setMapOpen(true)}
className="flex items-center gap-2 text-left text-sm font-medium text-blue-500"
>
<MapPin className="h-4 w-4" />
Select on map
</button>
</div>
)}
{showGoogleMapsField && (
<div className="space-y-2">
<p className="text-xs text-gray-500">
1. Open Google Maps and Find location<br />
2. Long press the desired location<br />
3. Click on Share and Click on Copy<br />
4. Paste the copied url here in the field.
{currentLocation && (
<p className="mt-2 text-xs text-gray-500">
📍 {currentLocation.latitude.toFixed(5)}, {currentLocation.longitude.toFixed(5)}
</p>
<PInput
placeholder="Google Maps Shared URL"
value={values.googleMapsUrl}
onChange={(e) => handleChange('googleMapsUrl', e.target.value)}
/>
</div>
)}
)}
{locationError && <p className="mt-1 text-sm text-red-500">{locationError}</p>}
</div>
<label className="flex cursor-pointer items-center gap-2">
<input
@ -276,6 +311,24 @@ export function AddressForm({ onSuccess, initialValues, isEdit = false }: Addres
className="bg-brand-500 text-white"
/>
</div>
{/* Full-screen in-page map picker (same origin, posts coordinates back). */}
{mapOpen && (
<div className="fixed inset-0 z-[200] bg-white">
<iframe
src="/location-selector"
title="Select delivery location"
className="h-full w-full border-0"
/>
<button
type="button"
onClick={() => setMapOpen(false)}
className="absolute left-4 top-4 rounded-full bg-white px-4 py-2 font-bold text-gray-700 shadow"
>
Cancel
</button>
</div>
)}
</div>
)
}

View file

@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react'
import { useLocation } from '@tanstack/react-router'
import { Loader2 } from 'lucide-react'
import { trpc } from '../lib/trpc-client'
import { useRegionStore } from '../lib/stores/region-store'
@ -20,6 +21,8 @@ export function RegionGate({ children }: { children: React.ReactNode }) {
const setRegion = useRegionStore((state) => state.setRegion)
const clearRegion = useRegionStore((state) => state.clearRegion)
const location = useLocation()
const [hasHydrated, setHasHydrated] = useState<boolean>(() =>
useRegionStore.persist.hasHydrated()
)
@ -55,6 +58,11 @@ export function RegionGate({ children }: { children: React.ReactNode }) {
}
}, [hasHydrated, regions, selectedRegionId, selectedRegion, setRegion, clearRegion])
// Standalone full-screen routes opt out of the region gate overlay.
if (location.pathname === '/location-selector') {
return <>{children}</>
}
if (!hasHydrated) {
return <>{children}</>
}

View file

@ -15,6 +15,7 @@ import { Route as RegisterRouteImport } from './routes/register'
import { Route as OffersRouteImport } from './routes/offers'
import { Route as MeRouteImport } from './routes/me'
import { Route as LoginRouteImport } from './routes/login'
import { Route as LocationSelectorRouteImport } from './routes/location-selector'
import { Route as HomeRouteImport } from './routes/home'
import { Route as FlashRouteImport } from './routes/flash'
import { Route as CheckoutRouteImport } from './routes/checkout'
@ -71,6 +72,11 @@ const LoginRoute = LoginRouteImport.update({
path: '/login',
getParentRoute: () => rootRouteImport,
} as any)
const LocationSelectorRoute = LocationSelectorRouteImport.update({
id: '/location-selector',
path: '/location-selector',
getParentRoute: () => rootRouteImport,
} as any)
const HomeRoute = HomeRouteImport.update({
id: '/home',
path: '/home',
@ -204,6 +210,7 @@ export interface FileRoutesByFullPath {
'/checkout': typeof CheckoutRoute
'/flash': typeof FlashRouteWithChildren
'/home': typeof HomeRouteWithChildren
'/location-selector': typeof LocationSelectorRoute
'/login': typeof LoginRoute
'/me': typeof MeRouteWithChildren
'/offers': typeof OffersRoute
@ -236,6 +243,7 @@ export interface FileRoutesByTo {
'/cart': typeof CartRoute
'/checkout': typeof CheckoutRoute
'/flash': typeof FlashRouteWithChildren
'/location-selector': typeof LocationSelectorRoute
'/login': typeof LoginRoute
'/me': typeof MeRouteWithChildren
'/offers': typeof OffersRoute
@ -270,6 +278,7 @@ export interface FileRoutesById {
'/checkout': typeof CheckoutRoute
'/flash': typeof FlashRouteWithChildren
'/home': typeof HomeRouteWithChildren
'/location-selector': typeof LocationSelectorRoute
'/login': typeof LoginRoute
'/me': typeof MeRouteWithChildren
'/offers': typeof OffersRoute
@ -305,6 +314,7 @@ export interface FileRouteTypes {
| '/checkout'
| '/flash'
| '/home'
| '/location-selector'
| '/login'
| '/me'
| '/offers'
@ -337,6 +347,7 @@ export interface FileRouteTypes {
| '/cart'
| '/checkout'
| '/flash'
| '/location-selector'
| '/login'
| '/me'
| '/offers'
@ -370,6 +381,7 @@ export interface FileRouteTypes {
| '/checkout'
| '/flash'
| '/home'
| '/location-selector'
| '/login'
| '/me'
| '/offers'
@ -404,6 +416,7 @@ export interface RootRouteChildren {
CheckoutRoute: typeof CheckoutRoute
FlashRoute: typeof FlashRouteWithChildren
HomeRoute: typeof HomeRouteWithChildren
LocationSelectorRoute: typeof LocationSelectorRoute
LoginRoute: typeof LoginRoute
MeRoute: typeof MeRouteWithChildren
OffersRoute: typeof OffersRoute
@ -456,6 +469,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LoginRouteImport
parentRoute: typeof rootRouteImport
}
'/location-selector': {
id: '/location-selector'
path: '/location-selector'
fullPath: '/location-selector'
preLoaderRoute: typeof LocationSelectorRouteImport
parentRoute: typeof rootRouteImport
}
'/home': {
id: '/home'
path: '/home'
@ -733,6 +753,7 @@ const rootRouteChildren: RootRouteChildren = {
CheckoutRoute: CheckoutRoute,
FlashRoute: FlashRouteWithChildren,
HomeRoute: HomeRouteWithChildren,
LocationSelectorRoute: LocationSelectorRoute,
LoginRoute: LoginRoute,
MeRoute: MeRouteWithChildren,
OffersRoute: OffersRoute,

View file

@ -0,0 +1,284 @@
import { createFileRoute } from '@tanstack/react-router'
import { useCallback, useEffect, useRef, useState } from 'react'
import { AlertCircle, Loader2 } from 'lucide-react'
import { BottomDialog } from 'web-components'
import { Dialog } from '../components/Dialog'
export const Route = createFileRoute('/location-selector')({
// Optional centre override (?lat=&lng=&zoom=) so the map can be opened for a
// specific region; defaults to the Mahabubnagar town centre.
validateSearch: (search: Record<string, unknown>) => {
const num = (value: unknown): number | undefined => {
if (typeof value !== 'string' || value.trim() === '') return undefined
const parsed = Number(value)
return Number.isFinite(parsed) ? parsed : undefined
}
return {
lat: num(search.lat),
lng: num(search.lng),
zoom: num(search.zoom),
}
},
component: LocationSelectorPage,
})
type LatLngLiteral = { lat: number; lng: number }
// Minimal structural typings for the small slice of the Google Maps JS API used
// here, so this route does not require the @types/google.maps package.
interface GoogleMapClickEvent {
latLng?: { lat: () => number; lng: () => number } | null
}
interface GoogleMap {
addListener: (event: string, handler: (event: GoogleMapClickEvent) => void) => void
}
interface GoogleMarker {
setMap: (map: GoogleMap | null) => void
setPosition: (position: LatLngLiteral) => void
}
interface GoogleMapsNamespace {
Map: new (element: HTMLElement, options: Record<string, unknown>) => GoogleMap
Marker: new (options: Record<string, unknown>) => GoogleMarker
}
type ReactNativeWebViewBridge = { postMessage: (message: string) => void }
type GoogleWindow = Window & {
google?: { maps: GoogleMapsNamespace }
// Injected by react-native-webview when this page is embedded in user-ui.
ReactNativeWebView?: ReactNativeWebViewBridge
}
// Mahabubnagar (Mahbubnagar), Telangana, India — default map center.
const MAHABUBNAGAR_CENTER: LatLngLiteral = { lat: 16.7488, lng: 77.9851 }
const DEFAULT_ZOOM = 12
// Google Maps JS API key. Provide it via a Vite env var, e.g. in
// apps/web-ui/.env:
// VITE_GOOGLE_MAPS_API_KEY=your-key
const GOOGLE_MAPS_API_KEY = import.meta.env.VITE_GOOGLE_MAPS_API_KEY as string | undefined
let googleMapsLoader: Promise<GoogleMapsNamespace> | null = null
function loadGoogleMaps(apiKey: string): Promise<GoogleMapsNamespace> {
const existing = (window as GoogleWindow).google?.maps
if (existing) return Promise.resolve(existing)
if (googleMapsLoader) return googleMapsLoader
googleMapsLoader = new Promise<GoogleMapsNamespace>((resolve, reject) => {
const script = document.createElement('script')
script.src = `https://maps.googleapis.com/maps/api/js?key=${encodeURIComponent(apiKey)}`
script.async = true
script.defer = true
script.onload = () => {
const maps = (window as GoogleWindow).google?.maps
if (maps) resolve(maps)
else reject(new Error('Google Maps loaded but the maps namespace is unavailable.'))
}
script.onerror = () => reject(new Error('Failed to load the Google Maps script.'))
document.head.appendChild(script)
})
return googleMapsLoader
}
// When embedded in the user-ui WebView, hand the confirmed coordinates back to
// the native host. This is undefined in a normal browser, where the console.log
// below remains the only signal.
function sendCoordsToHost(coords: LatLngLiteral) {
const payload = { type: 'location-selected', latitude: coords.lat, longitude: coords.lng }
// Embedded in the user-ui native app.
const bridge = (window as GoogleWindow).ReactNativeWebView
if (bridge?.postMessage) {
bridge.postMessage(JSON.stringify(payload))
return
}
// Embedded as an iframe in the web app.
if (window.parent && window.parent !== window) {
window.parent.postMessage(payload, window.location.origin)
}
}
// Tailwind's `md` breakpoint is 768px, so "mobile" is anything below it.
const MOBILE_QUERY = '(max-width: 767px)'
function useIsMobile(): boolean {
const [isMobile, setIsMobile] = useState(false)
useEffect(() => {
const mql = window.matchMedia(MOBILE_QUERY)
const update = () => setIsMobile(mql.matches)
update()
mql.addEventListener('change', update)
return () => mql.removeEventListener('change', update)
}, [])
return isMobile
}
function LocationSelectorPage() {
const mapContainerRef = useRef<HTMLDivElement | null>(null)
const mapRef = useRef<GoogleMap | null>(null)
const markerRef = useRef<GoogleMarker | null>(null)
const [isLoading, setIsLoading] = useState(true)
const [loadError, setLoadError] = useState<string | null>(null)
const [pendingCoords, setPendingCoords] = useState<LatLngLiteral | null>(null)
const search = Route.useSearch()
const isMobile = useIsMobile()
useEffect(() => {
if (!GOOGLE_MAPS_API_KEY) {
setLoadError(
'Google Maps API key is not configured yet. Set VITE_GOOGLE_MAPS_API_KEY to enable the map.'
)
setIsLoading(false)
return
}
const container = mapContainerRef.current
if (!container || mapRef.current) return
const center: LatLngLiteral =
search.lat != null && search.lng != null
? { lat: search.lat, lng: search.lng }
: MAHABUBNAGAR_CENTER
const zoom = search.zoom ?? DEFAULT_ZOOM
let cancelled = false
loadGoogleMaps(GOOGLE_MAPS_API_KEY)
.then((maps) => {
if (cancelled) return
const map = new maps.Map(container, {
center,
zoom,
mapTypeControl: false,
streetViewControl: false,
fullscreenControl: false,
clickableIcons: false,
})
mapRef.current = map
map.addListener('click', (event) => {
const latLng = event.latLng
if (!latLng) return
const coords = { lat: latLng.lat(), lng: latLng.lng() }
// Highlight the selected point right away.
if (markerRef.current) {
markerRef.current.setPosition(coords)
markerRef.current.setMap(map)
} else {
markerRef.current = new maps.Marker({ map, position: coords })
}
setPendingCoords(coords)
})
setIsLoading(false)
})
.catch((error: unknown) => {
if (cancelled) return
setLoadError(error instanceof Error ? error.message : 'Failed to load Google Maps.')
setIsLoading(false)
})
return () => {
cancelled = true
}
}, [])
const handleConfirm = useCallback(() => {
if (!pendingCoords) return
// Required behavior: log the chosen coordinates to the console.
console.log('[location-selector] confirmed coordinates:', {
latitude: pendingCoords.lat,
longitude: pendingCoords.lng,
})
// Hand the coordinates back to the native host when embedded.
sendCoordsToHost(pendingCoords)
setPendingCoords(null)
}, [pendingCoords])
const handleCancel = useCallback(() => {
// Remove the highlight if the selection is rejected.
markerRef.current?.setMap(null)
setPendingCoords(null)
}, [])
return (
<div className="fixed inset-0 bg-white">
<div ref={mapContainerRef} className="h-full w-full" />
{isLoading && !loadError && (
<div className="absolute inset-0 flex flex-col items-center justify-center bg-white/70">
<Loader2 className="h-7 w-7 animate-spin text-brand-500" />
<p className="mt-2 text-sm text-gray-600">Loading map...</p>
</div>
)}
{loadError && (
<div className="absolute inset-0 flex flex-col items-center justify-center bg-white/90 p-6 text-center">
<AlertCircle className="mb-2 h-9 w-9 text-amber-500" />
<p className="max-w-md text-sm text-gray-700">{loadError}</p>
</div>
)}
{isMobile ? (
<BottomDialog open={pendingCoords !== null} onClose={handleCancel}>
<div className="pb-2">
<p className="mb-5 text-center text-base font-semibold text-gray-900">
Use the selected point as address location
</p>
<div className="flex gap-3">
<button
type="button"
onClick={handleCancel}
className="flex-1 rounded-lg border border-gray-200 bg-white px-5 py-3 text-sm font-bold text-gray-700 transition-colors hover:bg-gray-50"
>
Cancel
</button>
<button
type="button"
onClick={handleConfirm}
className="flex-1 rounded-lg bg-brand-600 px-5 py-3 text-sm font-bold text-white transition-colors hover:bg-brand-700"
>
Confirm location
</button>
</div>
</div>
</BottomDialog>
) : (
<Dialog open={pendingCoords !== null} onClose={handleCancel} title="Confirm this location?">
<div className="px-6 py-5">
<p className="text-sm text-gray-600">Use the selected point as address location</p>
<div className="mt-5 flex justify-end gap-3">
<button
type="button"
onClick={handleCancel}
className="rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-bold text-gray-700 transition-colors hover:bg-gray-50"
>
Cancel
</button>
<button
type="button"
onClick={handleConfirm}
className="rounded-lg bg-brand-600 px-5 py-2.5 text-sm font-bold text-white transition-colors hover:bg-brand-700"
>
Confirm location
</button>
</div>
</div>
</Dialog>
)}
</div>
)
}

View file

@ -145,6 +145,9 @@ function AddressesPage() {
state: addressToUpdate.state,
pincode: addressToUpdate.pincode,
isDefault: true,
// Keep the stored coordinates so the bound is not re-derived from a fallback.
latitude: addressToUpdate.latitude ?? undefined,
longitude: addressToUpdate.longitude ?? undefined,
},
{
onSuccess: () => {

View file

@ -9,7 +9,7 @@ import { cloudflare } from "@cloudflare/vite-plugin";
const config = defineConfig({
resolve: { tsconfigPaths: true },
server: { port: 4174 },
server: { port: 4174, allowedHosts: ['.freshyo.in'] },
plugins: [
devtools(),
tailwindcss(),

View file

@ -3472,3 +3472,242 @@ user-ui
+ const publicSlots = await apiClient().user.slots.getSlots.query({ regionId: 1 })
3/3 apps/backend/tests/api/order-flow.test.ts ("lists the created slot via user.slots.getSlots"): same change.
No application code touched. No migration. No drizzle migrations run.
- Cloudflare tunnel for superadmin web app: created tunnel `localsuperadmin`
(id 06071937-c31f-47b9-af8c-cb2450085ade), config at
~/.cloudflared/localsuperadmin.yml (metrics 127.0.0.1:20242), ingress
localsuperadmin.freshyo.in -> http://localhost:4175; DNS CNAME routed; running detached.
- apps/superadmin-ui/vite.config.ts: add `server.allowedHosts: ['.freshyo.in']`.
Cause: Vite dev server returned 403 "Blocked request. This host
(localsuperadmin.freshyo.in) is not allowed." through the tunnel. Allowing the
freshyo.in subdomains fixes it. No tests run.
2026-10-13 11:20:48 apps/web-ui: add route /location-selector. Shows a Google Map centered on the Mahabubnagar
(Mahbubnagar), Telangana region. Clicking a point opens a confirmation dialog; confirming logs the coordinates to
the browser console (and drops a marker). The Google Maps JS API key is read from the Vite env var
VITE_GOOGLE_MAPS_API_KEY, which is not provided yet, so the route renders a clear "not configured" state until it
is set. No dependency added; no other route changed; no migration.
New file: apps/web-ui/src/routes/location-selector.tsx
+ import { createFileRoute } from '@tanstack/react-router'
+ import { useCallback, useEffect, useRef, useState } from 'react'
+ import { Loader2, MapPin, AlertCircle } from 'lucide-react'
+ import { AppLayout } from '../components/AppLayout'
+ import { Dialog } from '../components/Dialog'
+
+ export const Route = createFileRoute('/location-selector')({ component: LocationSelectorPage })
+
+ type LatLngLiteral = { lat: number; lng: number }
+
+ // Minimal structural typings for the slice of the Google Maps JS API used here,
+ // so this route does not require the @types/google.maps package.
+ interface GoogleMapClickEvent { latLng?: { lat: () => number; lng: () => number } | null }
+ interface GoogleMap { addListener: (event: string, handler: (event: GoogleMapClickEvent) => void) => void }
+ interface GoogleMarker { setMap: (map: GoogleMap | null) => void; setPosition: (position: LatLngLiteral) => void }
+ interface GoogleMapsNamespace {
+ Map: new (element: HTMLElement, options: Record<string, unknown>) => GoogleMap
+ Marker: new (options: Record<string, unknown>) => GoogleMarker
+ }
+ type GoogleWindow = Window & { google?: { maps: GoogleMapsNamespace } }
+
+ const MAHABUBNAGAR_CENTER: LatLngLiteral = { lat: 16.7488, lng: 77.9851 }
+ const DEFAULT_ZOOM = 12
+ const GOOGLE_MAPS_API_KEY = import.meta.env.VITE_GOOGLE_MAPS_API_KEY as string | undefined
+
+ let googleMapsLoader: Promise<GoogleMapsNamespace> | null = null
+ function loadGoogleMaps(apiKey: string): Promise<GoogleMapsNamespace> { ...singleton script loader... }
+
+ function LocationSelectorPage() {
+ // refs: mapContainer, map, marker
+ // state: isLoading, loadError, pendingCoords
+ // useEffect: guard missing key -> load script -> new Map(center Mahabubnagar) -> click listener sets pendingCoords
+ // handleConfirm: place/move marker, console.log('[location-selector] confirmed coordinates:', { latitude, longitude })
+ // handleCancel: clear pendingCoords
+ // render: AppLayout(showCartBar=false) + header + map container + loading/error overlays + Dialog confirm
+ }
(full implementation written to the file; above is the structural diff summary)
Regenerated (auto): apps/web-ui/src/routeTree.gen.ts via @tanstack/router-generator to register the new
'/location-selector' path. This file is generated; do not hand-edit.
No tests run. No drizzle migration run.
2026-10-13 11:40:51 apps/web-ui: /location-selector now renders standalone — map only. Removed AppLayout (sidebar,
topbar, bottom nav, cart bar) and the page header so the map fills the viewport. The click-confirmation dialog is
unchanged (it only appears after a map click). Also excluded this path from RegionGate so the region-selection
overlay can never cover the map.
1/2 apps/web-ui/src/routes/location-selector.tsx
- import { AppLayout } from '../components/AppLayout'
- <AppLayout showCartBar={false}> ...header... <div ref={mapContainerRef} .../> overlays </AppLayout>
+ <div className="fixed inset-0 bg-white">
+ <div ref={mapContainerRef} className="h-full w-full" />
+ {isLoading overlay}{loadError overlay}
+ </div>
+ <Dialog ... /> (kept as-is; opens only on a map click)
2/2 apps/web-ui/src/components/RegionGate.tsx
+ import { useLocation } from '@tanstack/react-router'
+ const location = useLocation()
+ // Standalone full-screen routes opt out of the region gate overlay.
+ if (location.pathname === '/location-selector') return <>{children}</>
No dependency added; no migration; no tests run.
2026-10-13 11:52:57 apps/web-ui: /location-selector confirmation dialog no longer prints latitude/longitude. The clicked point
is now highlighted immediately (marker dropped on click), and the dialog just asks to confirm. Confirming keeps the
marker and logs the coordinates to the console; cancelling removes the marker.
1/1 apps/web-ui/src/routes/location-selector.tsx
- map click: setPendingCoords({...})
+ map click: create/move marker at coords, then setPendingCoords(coords)
- handleConfirm: place marker, console.log, clear
+ handleConfirm: console.log coords, keep marker, clear
+ handleCancel: markerRef.current?.setMap(null), clear
- Dialog body: Latitude/Longitude block
+ Dialog body: "Use the highlighted point as your selected location?" (no coordinates)
No dependency added; no migration; no tests run.
2026-10-13 12:00:37 apps/web-ui: /location-selector confirmation dialog message changed.
1/1 apps/web-ui/src/routes/location-selector.tsx
- Use the highlighted point as your selected location?
+ Use the selected point as address location
No dependency added; no migration; no tests run.
2026-10-13 12:12:28 apps/web-ui: /location-selector confirmation is now responsive. On mobile (max-width 767px) it uses
the shared BottomDialog (slides up from the bottom, minimal bg-black/30 backdrop, no blur); on larger screens the
existing centered Dialog is kept. Added a small SSR-safe useIsMobile (matchMedia) hook in the route.
1/1 apps/web-ui/src/routes/location-selector.tsx
+ import { BottomDialog } from 'web-components'
+ function useIsMobile(): boolean { matchMedia('(max-width: 767px)') + change listener }
+ const isMobile = useIsMobile()
+ {isMobile ? (<BottomDialog open=... onClose=...> message + Cancel/Confirm </BottomDialog>) : (<Dialog ...>)}
No dependency added (web-components already used in web-ui). No migration; no tests run.
2026-10-13 12:59:39 Address coords/bound model (phase 1 of the location/region rework).
1/4 packages/db_helper_sqlite/src/db/schema.ts (addresses):
+ vagueBackfilledCoords: integer('vague_backfilled_coords', { mode: 'boolean' }).notNull().default(false),
2/4 packages/db_helper_sqlite/drizzle/0006_regions_and_superadmins.sql (__new_addresses rebuild):
+ `vague_backfilled_coords` integer DEFAULT false NOT NULL,
INSERT now backfills coords and bound_id:
latitude -> COALESCE(latitude, 16.750504)
longitude -> COALESCE(longitude, 77.993621)
bound_id -> (SELECT id FROM region_bounds WHERE region_id = (SELECT id FROM regions WHERE name='Mahabubnagar')
ORDER BY CAST(priority AS REAL) ASC LIMIT 1) -- least-priority Mahabubnagar bound
vague_backfilled_coords -> CASE WHEN latitude IS NULL OR longitude IS NULL THEN 1 ELSE 0 END
3/4 packages/shared/types/user.ts (UserAddress):
+ vagueBackfilledCoords: boolean;
4/4 packages/db_helper_sqlite/src/user-apis/address.ts (mapUserAddress + create/update):
+ vagueBackfilledCoords: address.vagueBackfilledCoords ?? false,
No drizzle migrations run (user applies 0006). No tests run.
2026-10-13 13:00:48 Address coords/bound model (phase 2 of the location/region rework): backend derives the bound from
coordinates and rejects out-of-region points.
1/4 NEW apps/backend/src/lib/region-geo.ts:
+ boundToPolygons(geojson): flatten Polygon/MultiPolygon features into turf polygons
+ resolveBoundInRegion(regionId, lat, lng): least-priority bound of the region containing the point, else null
2/4 apps/backend/src/trpc/apis/common-apis/common-trpc-index.ts:
- removed local boundToPolygons + BoundPolygon type (now imported from @/src/lib/region-geo)
- import type drops RegionGeoJson (no longer used here)
+ resolveBound: publicProcedure({ regionId, lat, lng }) -> { regionId, boundId }
throws ApiError 422 when the point is outside every bound of the region
3/4 apps/backend/src/trpc/apis/user-apis/apis/address.ts (createAddress + updateAddress):
- latitude/longitude optional -> required (z.number 90/180 ranges)
- boundId is now derived server-side via resolveBoundInRegion(regionId, lat, lng); 422 when outside
- removed client-supplied boundId and the googleMapsUrl coord-extraction (coords are mandatory now)
4/4 packages/db_helper_sqlite/src/user-apis/address.ts:
+ mapUserAddress includes vagueBackfilledCoords
(create/update signatures unchanged; boundId is passed in by the backend)
No drizzle migrations run. No tests run.
2026-10-13 13:01:51 Location rework (phase 3): web-ui /location-selector can now be embedded in the user-ui WebView.
1/1 apps/web-ui/src/routes/location-selector.tsx:
+ type ReactNativeWebViewBridge = { postMessage: (message: string) => void }
+ sendCoordsToHost(coords) -> window.ReactNativeWebView?.postMessage(JSON.stringify({
type: 'location-selected', latitude, longitude }))
+ called from handleConfirm (console.log kept for browser/native debugging)
+ optional ?lat=&lng=&zoom= search params centre the map (default Mahabubnagar)
No dependency added. No migration. No tests run.
2026-10-13 13:04:21 Location rework (phase 4, user-ui): device-location bound wins at startup; when location is
unusable, a fallback flow lets the user pick an existing address or add a new one (region -> map WebView -> address
form). Signed-out drafts are stored locally and posted after signup.
Files:
* apps/user-ui/src/constants.ts: + WEB_UI_BASE_URL: 'https://localuserweb.freshyo.in'
* apps/user-ui/src/hooks/useRegion.ts: bound sync effect no longer overwrites a stored (location/address) bound
* apps/user-ui/src/components/RegionSelector.tsx: + 'select' mode (picks a region without switching)
* apps/user-ui/src/lib/pending-address.ts: NEW local draft storage helpers
* apps/user-ui/src/components/location/LocationMapStep.tsx: NEW full-screen WebView wrapping /location-selector
* apps/user-ui/src/components/location/LocationFallbackFlow.tsx: NEW choose -> existing/region -> map -> form
* apps/user-ui/components/LocationTestWrapper.tsx: renders the fallback flow instead of RegionSelector gate
* apps/user-ui/src/components/AddressForm.tsx: draftMode prop, remove paste-Google-Maps block, coords required
* apps/user-ui/src/components/PendingAddressSync.tsx: NEW posts a stored draft once authenticated
* apps/user-ui/app/_layout.tsx: mount PendingAddressSync inside AuthProvider
* packages/shared/types/app-common.types.ts: AddressFormProps + draftMode?: boolean
Note: backend create/update address keep latitude/longitude optional so web-ui keeps working; user-ui always sends
them. No dependency added. No migration. No tests run.
2026-10-13 13:09:53 Location rework follow-up (user-ui): the gate must know auth state, and the map must reject
out-of-region pins before the form.
1/4 apps/user-ui/components/FirstUserWrapper.tsx: no longer wraps children in LocationTestWrapper (just renders
children); the first-time welcome branch is unchanged.
2/4 apps/user-ui/app/_layout.tsx: LocationTestWrapper now wraps the app INSIDE AuthProvider
(AuthProvider > PendingAddressSync + LocationTestWrapper > NotificationProvider > ...). The gate can now read
real auth state instead of always seeing "signed out".
3/4 apps/user-ui/src/components/location/LocationFallbackFlow.tsx:
- uses useAuthOptional (safe above/inside providers)
- resolves the pin's bound via common.resolveBound BEFORE the form; on failure stays on the map with an error
- form step carries the resolved boundId; activation reuses it
4/4 apps/user-ui/src/components/location/LocationMapStep.tsx: + optional error prop rendered as a red banner.
No dependency added. No migration. No tests run.
2026-10-13 13:20:29 Address-based region selection (user-ui + web-ui): no direct region switching; the region is derived
from address coordinates. placeOrder treats the order address's coords as authoritative.
Files:
* packages/shared/types/app-common.types.ts: AddressFormProps + onResolvedRegion?: (info) => void
* apps/user-ui/src/components/AddressForm.tsx: removed the Delivery Region dropdown; resolves the region from
coords via common.resolveRegionByLocation; adds a "Select from map" modal; requires a serviceable location
* apps/user-ui/src/components/location/LocationFallbackFlow.tsx: reworked to choose-existing-address (set default
inline) | add-new (AddressForm); selecting an address switches region + clears the cart
* apps/user-ui/src/components/location/AddressSwitcherSheet.tsx: NEW full-screen Modal wrapper used by the
LocationBar and the Me screen
* apps/user-ui/src/components/LocationBar.tsx: opens AddressSwitcherSheet instead of RegionSelector
* apps/user-ui/app/(drawer)/(tabs)/me/index.tsx: "Delivery Region" -> "Delivery Address" opens AddressSwitcherSheet
* apps/user-ui/app/(drawer)/(tabs)/me/addresses/index.tsx: set-default now sends the address's existing coords
* apps/user-ui/src/components/RegionSelector.tsx: DELETED (no longer referenced)
* apps/web-ui/src/components/AddressForm.tsx: same dropdown removal; attach (browser geolocation) + select from map
(full-screen same-origin iframe of /location-selector)
* apps/web-ui/src/routes/location-selector.tsx: on confirm, an embedded iframe receives the coords via
window.parent.postMessage; the native WebView bridge is unchanged
* apps/web-ui/src/routes/me.addresses.tsx: set-default now sends coords
* apps/backend/src/lib/region-geo.ts: + resolveRegionAndBound(lat, lng) reused by placeOrder
* apps/backend/src/trpc/apis/common-apis/common-trpc-index.ts: resolveRegionByLocation now uses resolveRegionAndBound
No dependency added. No migration. No tests run.
2026-10-13 13:37:27 AddressForm layout fix (clipped bottom / 30% dead space, pre-existing).
Cause: the root KeyboardAwareScrollView carried `pb-32` on its style (viewport padding -> blank band) plus a
hardcoded `maxHeight: windowHeight * 0.7` (sized for the old bottom sheet, but the form is now also full-screen).
1/3 apps/user-ui/src/components/AddressForm.tsx:
- style=[tw`px-4 pt-4 pb-32 bg-white`, { maxHeight: Dimensions.get('window').height * 0.7 }]
+ style={tw`flex-1 bg-white`} contentContainerStyle={tw`px-4 pt-4 pb-10`}
- removed the now-unused Dimensions import
2/3 apps/user-ui/app/(drawer)/(tabs)/me/addresses/index.tsx:
RawBottomDialog does not size its children, so the form is wrapped in a fixed-height (85%) white sheet container.
3/3 apps/web-ui/src/components/AddressForm.tsx:
- root div `max-h-[80vh] overflow-y-auto p-6` -> `p-6` (the web BottomDialog already provides the 85vh scroll).
No dependency added. No migration. No tests run.
2026-10-13 13:46:40 AddressForm keyboard handling (user-ui): migrate off react-native-keyboard-aware-scroll-view.
Root cause candidate: AddressForm was the only form still using KeyboardAwareScrollView (v0.9.5, pre-New-Architecture).
On iOS the keyboard was observed rendered off-screen on first focus (focused input, SystemInputAssistantView at
y=896..1211, i.e. below the 896pt screen) until a second tap. Working forms (ComplaintForm/OrderMenu/order notes)
use KeyboardAvoidingView, so AddressForm is aligned with them.
1/1 apps/user-ui/src/components/AddressForm.tsx:
- import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view'
+ import { View, Modal, ScrollView, KeyboardAvoidingView, Platform } from 'react-native'
- <KeyboardAwareScrollView style=... contentContainerStyle=... keyboardShouldPersistTaps="always" keyboardDismissMode="on-drag">
+ <KeyboardAvoidingView style={tw`flex-1 bg-white`} behavior={Platform.OS === 'ios' ? 'padding' : undefined}>
+ <ScrollView style={tw`flex-1`} contentContainerStyle={tw`px-4 pt-4 pb-10`}
+ keyboardShouldPersistTaps="handled" showsVerticalScrollIndicator={false}>
...content unchanged...
+ </ScrollView>
+ </KeyboardAvoidingView>
No dependency added. No migration. No tests run.
- Cloudflare tunnel for user web app: created tunnel `localuserweb`
(id d1c888cb-7ce7-413a-8ac8-bf304cada9ad), config at
~/.cloudflared/localuserweb.yml (metrics 127.0.0.1:20243), ingress
localuserweb.freshyo.in -> http://localhost:4174; DNS CNAME routed; running detached.
- apps/web-ui/vite.config.ts: add `server.allowedHosts: ['.freshyo.in']` so the Vite
dev server does not 403 the tunneled hostname (same fix as superadmin-ui). No tests run.

View file

@ -0,0 +1,115 @@
# Address form: keyboard not appearing (iOS) — fix
Status: fixed (user-ui). Applies to iOS simulator and physical devices.
File changed: `apps/user-ui/src/components/AddressForm.tsx`
## Symptom
On iOS, tapping an input in the address form sometimes focused the field (cursor + iOS
edit menu visible) but the software keyboard did not appear on screen, or appeared
**off-screen**. Other forms in the app (login, complaints, order notes) showed the
keyboard normally.
Captured evidence on the iOS 18.6 simulator: the input was focused while the keyboard's
`SystemInputAssistantView` bounds were `[0,896][414,1211]` — i.e. starting at the bottom
edge of the 896pt screen and extending below it. A second tap brought the keyboard up.
## Root cause
`AddressForm` was the only form still using `react-native-keyboard-aware-scroll-view`
(installed `0.9.5`, last published ~2021) via `KeyboardAwareScrollView`.
That library measures the focused input with the legacy bridge APIs:
```
node_modules/react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js
-> findNodeHandle / UIManager / measureInWindow / TextInputState
```
The app runs `react-native@0.79.6` with `newArchEnabled: true` (Fabric/TurboModules).
Those legacy measurement APIs are unreliable under the New Architecture (stale/zero
measurements, bad ordering), so the library's scroll-into-view / keyboard handling can
leave the keyboard mis-positioned or suppressed.
Every other working form in the app uses React Native's built-in `KeyboardAvoidingView`
instead, which is why they were unaffected.
## Is this simulator-only?
No. The affected code is the library's JS/native HOC, which ships and runs identically on
physical iPhones. The simulator simply reproduced it. Whether you *see* it depends on
geometry and timing (keyboard height, screen size, content height, safe area, animation
timing), so on a device the visible symptom could be "keyboard shows but the field is
scrolled wrong/hidden" rather than exactly "no keyboard".
## The fix
Replace the legacy `KeyboardAwareScrollView` with the app's standard `KeyboardAvoidingView`
+ `ScrollView` pattern.
Before:
```tsx
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view';
<KeyboardAwareScrollView
style={[tw`px-4 pt-4 pb-32 bg-white`, { maxHeight: Dimensions.get('window').height * 0.7 }]}
keyboardShouldPersistTaps="always"
keyboardDismissMode="on-drag"
>
...
</KeyboardAwareScrollView>
```
After:
```tsx
import { View, Modal, ScrollView, KeyboardAvoidingView, Platform } from 'react-native';
<KeyboardAvoidingView
style={tw`flex-1 bg-white`}
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
>
<ScrollView
style={tw`flex-1`}
contentContainerStyle={tw`px-4 pt-4 pb-10`}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}
>
...
</ScrollView>
</KeyboardAvoidingView>
```
Notes:
- `behavior="padding"` on iOS (`undefined` on Android, where `softwareKeyboardLayoutMode: "resize"` is set in `app.json`).
- The scroll container now fills its parent (`flex-1`); padding moved to `contentContainerStyle`.
This also fixed a pre-existing layout bug where `pb-32` (viewport padding) plus a hardcoded
`maxHeight: 70%` left a blank band at the bottom and clipped content on the full-screen
add-address step.
Related wrapper fix (the sheet has no built-in height): `apps/user-ui/app/(drawer)/(tabs)/me/addresses/index.tsx`
wraps the form in a sized container because `RawBottomDialog` renders children bare:
```tsx
<RawBottomDialog open={modalVisible} onClose={() => setModalVisible(false)}>
<View style={[tw`bg-white rounded-t-2xl`, { height: Dimensions.get('window').height * 0.85 }]}>
<AddressForm ... />
</View>
</RawBottomDialog>
```
## Verification
- iOS simulator (iOS 18.6): tapping an input shows the keyboard on-screen
(`SystemInputAssistantView` top at y≈550 instead of y=896); the focused field scrolls into
view and the submit button remains reachable.
- End-to-end: added an address via "Attach Current Location"; the region switched and Home loaded.
- `tsc --noEmit` clean for user-ui.
- No dependency changes; no migrations.
## Remaining risk
`apps/user-ui/app/(auth)/login.tsx` still uses `KeyboardAwareScrollView` from the same
legacy library. It is the same latent risk on devices under the New Architecture; migrate
to `KeyboardAvoidingView` for consistency when convenient.

View file

@ -308,13 +308,14 @@ CREATE TABLE `__new_addresses` (
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`region_id` integer NOT NULL,
`bound_id` integer,
`vague_backfilled_coords` integer DEFAULT false NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`region_id`) REFERENCES `regions`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`bound_id`) REFERENCES `region_bounds`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
INSERT INTO `__new_addresses` (`id`,`user_id`,`name`,`phone`,`address_line1`,`address_line2`,`city`,`state`,`pincode`,`is_default`,`latitude`,`longitude`,`google_maps_url`,`admin_latitude`,`admin_longitude`,`zone_id`,`created_at`,`region_id`,`bound_id`)
SELECT `id`,`user_id`,`name`,`phone`,`address_line1`,`address_line2`,`city`,`state`,`pincode`,`is_default`,`latitude`,`longitude`,`google_maps_url`,`admin_latitude`,`admin_longitude`,`zone_id`,`created_at`,(SELECT `id` FROM `regions` WHERE `name` = 'Mahabubnagar'),1 FROM `addresses`;
INSERT INTO `__new_addresses` (`id`,`user_id`,`name`,`phone`,`address_line1`,`address_line2`,`city`,`state`,`pincode`,`is_default`,`latitude`,`longitude`,`google_maps_url`,`admin_latitude`,`admin_longitude`,`zone_id`,`created_at`,`region_id`,`bound_id`,`vague_backfilled_coords`)
SELECT `id`,`user_id`,`name`,`phone`,`address_line1`,`address_line2`,`city`,`state`,`pincode`,`is_default`,COALESCE(`latitude`, 16.750504),COALESCE(`longitude`, 77.993621),`google_maps_url`,`admin_latitude`,`admin_longitude`,`zone_id`,`created_at`,(SELECT `id` FROM `regions` WHERE `name` = 'Mahabubnagar'),(SELECT `id` FROM `region_bounds` WHERE `region_id` = (SELECT `id` FROM `regions` WHERE `name` = 'Mahabubnagar') ORDER BY CAST(`priority` AS REAL) ASC LIMIT 1),CASE WHEN `latitude` IS NULL OR `longitude` IS NULL THEN 1 ELSE 0 END FROM `addresses`;
--> statement-breakpoint
CREATE TABLE `__new_coupons` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,

View file

@ -124,6 +124,9 @@ export const addresses = sqliteTable('addresses', {
adminLatitude: real('admin_latitude'),
adminLongitude: real('admin_longitude'),
zoneId: integer('zone_id'),
// True when latitude/longitude were backfilled with a placeholder point
// (Mahabubnagar centre) because the address had no coordinates.
vagueBackfilledCoords: integer('vague_backfilled_coords', { mode: 'boolean' }).notNull().default(false),
createdAt: timestampText('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
})

View file

@ -22,6 +22,7 @@ const mapUserAddress = (address: AddressRow): UserAddress => ({
latitude: address.latitude ?? null,
longitude: address.longitude ?? null,
googleMapsUrl: address.googleMapsUrl ?? null,
vagueBackfilledCoords: address.vagueBackfilledCoords ?? false,
adminLatitude: address.adminLatitude ?? null,
adminLongitude: address.adminLongitude ?? null,
zoneId: address.zoneId ?? null,
@ -109,6 +110,7 @@ export async function updateUserAddress(input: {
latitude?: number
longitude?: number
googleMapsUrl?: string
vagueBackfilledCoords?: boolean
}): Promise<UserAddress | null> {
const [updatedAddress] = await db.update(addresses)
.set({
@ -125,6 +127,9 @@ export async function updateUserAddress(input: {
googleMapsUrl: input.googleMapsUrl,
latitude: input.latitude,
longitude: input.longitude,
...(input.vagueBackfilledCoords !== undefined
? { vagueBackfilledCoords: input.vagueBackfilledCoords }
: {}),
})
.where(and(eq(addresses.id, input.addressId), eq(addresses.userId, input.userId)))
.returning()

View file

@ -55,6 +55,17 @@ export interface AddressFormProps {
googleMapsUrl?: string
}
isEdit?: boolean
/**
* When true the form does not call the API; it validates and hands the
* payload to the caller (e.g. to store locally until the user signs up).
* Used by the location fallback flow for signed-out users.
*/
draftMode?: boolean
/**
* Fired whenever the chosen coordinates resolve to a serviceable region.
* Lets the caller activate that region + bound once the address is saved.
*/
onResolvedRegion?: (info: { regionId: number; boundId: number | null }) => void
}
// Generic list-item renderer props — user-ui home RenderStoreProps/SlotItemProps

View file

@ -54,6 +54,8 @@ export interface UserAddress {
latitude: number | null;
longitude: number | null;
googleMapsUrl: string | null;
/** True when coordinates were backfilled with a placeholder point, not user-picked. */
vagueBackfilledCoords: boolean;
adminLatitude: number | null;
adminLongitude: number | null;
zoneId: number | null;