diff --git a/src/app/_helpers/mock-backend.ts b/src/app/_helpers/mock-backend.ts index 59c8a12..ba8bfce 100644 --- a/src/app/_helpers/mock-backend.ts +++ b/src/app/_helpers/mock-backend.ts @@ -14,7 +14,7 @@ import { Observable, of, throwError } from 'rxjs'; import { delay, dematerialize, materialize, mergeMap } from 'rxjs/operators'; // Application imports -import { Action, AreaName, AreaType, Category, Token } from '@app/_models'; +import { Action } from '@app/_models'; /** A mock of the curated account types. */ const accountTypes: Array = ['user', 'cashier', 'vendor', 'tokenagent', 'group']; @@ -30,1048 +30,887 @@ const actions: Array = [ ]; /** A mock of curated area names. */ -const areaNames: Array = [ - { - name: 'Mukuru Nairobi', - locations: [ - 'kayaba', - 'kayba', - 'kambi', - 'mukuru', - 'masai', - 'hazina', - 'south', - 'tetra', - 'tetrapak', - 'ruben', - 'rueben', - 'kingston', - 'korokocho', - 'kingstone', - 'kamongo', - 'lungalunga', - 'sinai', - 'sigei', - 'lungu', - 'lunga lunga', - 'owino road', - 'seigei', - ], - }, - { - name: 'Kinango Kwale', - locations: [ - 'amani', - 'bofu', - 'chibuga', - 'chikomani', - 'chilongoni', - 'chigojoni', - 'chinguluni', - 'chigato', - 'chigale', - 'chikole', - 'chilongoni', - 'chilumani', - 'chigojoni', - 'chikomani', - 'chizini', - 'chikomeni', - 'chidzuvini', - 'chidzivuni', - 'chikuyu', - 'chizingo', - 'doti', - 'dzugwe', - 'dzivani', - 'dzovuni', - 'hanje', - 'kasemeni', - 'katundani', - 'kibandaogo', - 'kibandaongo', - 'kwale', - 'kinango', - 'kidzuvini', - 'kalalani', - 'kafuduni', - 'kaloleni', - 'kilibole', - 'lutsangani', - 'peku', - 'gona', - 'guro', - 'gandini', - 'mkanyeni', - 'myenzeni', - 'miyenzeni', - 'miatsiani', - 'mienzeni', - 'mnyenzeni', - 'minyenzeni', - 'miyani', - 'mioleni', - 'makuluni', - 'mariakani', - 'makobeni', - 'madewani', - 'mwangaraba', - 'mwashanga', - 'miloeni', - 'mabesheni', - 'mazeras', - 'mazera', - 'mlola', - 'muugano', - 'mulunguni', - 'mabesheni', - 'miatsani', - 'miatsiani', - 'mwache', - 'mwangani', - 'mwehavikonje', - 'miguneni', - 'nzora', - 'nzovuni', - 'vikinduni', - 'vikolani', - 'vitangani', - 'viogato', - 'vyogato', - 'vistangani', - 'yapha', - 'yava', - 'yowani', - 'ziwani', - 'majengo', - 'matuga', - 'vigungani', - 'vidziweni', - 'vinyunduni', - 'ukunda', - 'kokotoni', - 'mikindani', - ], - }, - { - name: 'Misc Nairobi', - locations: [ - 'nairobi', - 'west', - 'lindi', - 'kibera', - 'kibira', - 'kibra', - 'makina', - 'soweto', - 'olympic', - 'kangemi', - 'ruiru', - 'congo', - 'kawangware', - 'kwangware', - 'donholm', - 'dagoreti', - 'dandora', - 'kabete', - 'sinai', - 'donhom', - 'donholm', - 'huruma', - 'kitengela', - 'makadara', - ',mlolongo', - 'kenyatta', - 'mlolongo', - 'tassia', - 'tasia', - 'gatina', - '56', - 'industrial', - 'kariobangi', - 'kasarani', - 'kayole', - 'mathare', - 'pipe', - 'juja', - 'uchumi', - 'jogoo', - 'umoja', - 'thika', - 'kikuyu', - 'stadium', - 'buru buru', - 'ngong', - 'starehe', - 'mwiki', - 'fuata', - 'kware', - 'kabiro', - 'embakassi', - 'embakasi', - 'kmoja', - 'east', - 'githurai', - 'landi', - 'langata', - 'limuru', - 'mathere', - 'dagoretti', - 'kirembe', - 'muugano', - 'mwiki', - 'toi market', - ], - }, - { - name: 'Misc Mombasa', - locations: [ - 'mombasa', - 'likoni', - 'bangla', - 'bangladesh', - 'kizingo', - 'old town', - 'makupa', - 'mvita', - 'ngombeni', - 'ngómbeni', - 'ombeni', - 'magongo', - 'miritini', - 'changamwe', - 'jomvu', - 'ohuru', - 'tudor', - 'diani', - ], - }, - { - name: 'Kisauni', - locations: [ - 'bamburi', - 'kisauni', - 'mworoni', - 'nyali', - 'shanzu', - 'bombolulu', - 'mtopanga', - 'mjambere', - 'majaoni', - 'manyani', - 'magogoni', - 'junda', - 'mwakirunge', - 'mshomoroni', - ], - }, - { - name: 'Kilifi', - locations: [ - 'kilfi', - 'kilifi', - 'mtwapa', - 'takaungu', - 'makongeni', - 'mnarani', - 'mnarani', - 'office', - 'g.e', - 'ge', - 'raibai', - 'ribe', - ], - }, - { - name: 'Kakuma', - locations: ['kakuma'], - }, - { - name: 'Kitui', - locations: ['kitui', 'mwingi'], - }, - { - name: 'Nyanza', - locations: [ - 'busia', - 'nyalgunga', - 'mbita', - 'siaya', - 'kisumu', - 'nyalenda', - 'hawinga', - 'rangala', - 'uyoma', - 'mumias', - 'homabay', - 'homaboy', - 'migori', - 'kusumu', - ], - }, - { - name: 'Misc Rural Counties', - locations: [ - 'makueni', - 'meru', - 'kisii', - 'bomet', - 'machakos', - 'bungoma', - 'eldoret', - 'kakamega', - 'kericho', - 'kajiado', - 'nandi', - 'nyeri', - 'wote', - 'kiambu', - 'mwea', - 'nakuru', - 'narok', - ], - }, - { - name: 'other', - locations: ['other', 'none', 'unknown'], - }, -]; +const areaNames: object = { + 'Mukuru Nairobi': [ + 'kayaba', + 'kayba', + 'kambi', + 'mukuru', + 'masai', + 'hazina', + 'south', + 'tetra', + 'tetrapak', + 'ruben', + 'rueben', + 'kingston', + 'korokocho', + 'kingstone', + 'kamongo', + 'lungalunga', + 'sinai', + 'sigei', + 'lungu', + 'lunga lunga', + 'owino road', + 'seigei', + ], + 'Kinango Kwale': [ + 'amani', + 'bofu', + 'chibuga', + 'chikomani', + 'chilongoni', + 'chigojoni', + 'chinguluni', + 'chigato', + 'chigale', + 'chikole', + 'chilongoni', + 'chilumani', + 'chigojoni', + 'chikomani', + 'chizini', + 'chikomeni', + 'chidzuvini', + 'chidzivuni', + 'chikuyu', + 'chizingo', + 'doti', + 'dzugwe', + 'dzivani', + 'dzovuni', + 'hanje', + 'kasemeni', + 'katundani', + 'kibandaogo', + 'kibandaongo', + 'kwale', + 'kinango', + 'kidzuvini', + 'kalalani', + 'kafuduni', + 'kaloleni', + 'kilibole', + 'lutsangani', + 'peku', + 'gona', + 'guro', + 'gandini', + 'mkanyeni', + 'myenzeni', + 'miyenzeni', + 'miatsiani', + 'mienzeni', + 'mnyenzeni', + 'minyenzeni', + 'miyani', + 'mioleni', + 'makuluni', + 'mariakani', + 'makobeni', + 'madewani', + 'mwangaraba', + 'mwashanga', + 'miloeni', + 'mabesheni', + 'mazeras', + 'mazera', + 'mlola', + 'muugano', + 'mulunguni', + 'mabesheni', + 'miatsani', + 'miatsiani', + 'mwache', + 'mwangani', + 'mwehavikonje', + 'miguneni', + 'nzora', + 'nzovuni', + 'vikinduni', + 'vikolani', + 'vitangani', + 'viogato', + 'vyogato', + 'vistangani', + 'yapha', + 'yava', + 'yowani', + 'ziwani', + 'majengo', + 'matuga', + 'vigungani', + 'vidziweni', + 'vinyunduni', + 'ukunda', + 'kokotoni', + 'mikindani', + ], + 'Misc Nairobi': [ + 'nairobi', + 'west', + 'lindi', + 'kibera', + 'kibira', + 'kibra', + 'makina', + 'soweto', + 'olympic', + 'kangemi', + 'ruiru', + 'congo', + 'kawangware', + 'kwangware', + 'donholm', + 'dagoreti', + 'dandora', + 'kabete', + 'sinai', + 'donhom', + 'donholm', + 'huruma', + 'kitengela', + 'makadara', + ',mlolongo', + 'kenyatta', + 'mlolongo', + 'tassia', + 'tasia', + 'gatina', + '56', + 'industrial', + 'kariobangi', + 'kasarani', + 'kayole', + 'mathare', + 'pipe', + 'juja', + 'uchumi', + 'jogoo', + 'umoja', + 'thika', + 'kikuyu', + 'stadium', + 'buru buru', + 'ngong', + 'starehe', + 'mwiki', + 'fuata', + 'kware', + 'kabiro', + 'embakassi', + 'embakasi', + 'kmoja', + 'east', + 'githurai', + 'landi', + 'langata', + 'limuru', + 'mathere', + 'dagoretti', + 'kirembe', + 'muugano', + 'mwiki', + 'toi market', + ], + 'Kisauni Mombasa': [ + 'bamburi', + 'mnyuchi', + 'kisauni', + 'kasauni', + 'mworoni', + 'nyali', + 'falcon', + 'shanzu', + 'bombolulu', + 'kandongo', + 'kadongo', + 'mshomoro', + 'mtopanga', + 'mjambere', + 'majaoni', + 'manyani', + 'magogoni', + 'magongoni', + 'junda', + 'mwakirunge', + 'mshomoroni', + 'mjinga', + 'mlaleo', + 'utange', + ], + 'Misc Mombasa': [ + 'mombasa', + 'likoni', + 'bangla', + 'bangladesh', + 'kizingo', + 'old town', + 'makupa', + 'mvita', + 'ngombeni', + 'ngómbeni', + 'ombeni', + 'magongo', + 'miritini', + 'changamwe', + 'jomvu', + 'ohuru', + 'tudor', + 'diani', + ], + Kilifi: [ + 'kilfi', + 'kilifi', + 'mtwapa', + 'takaungu', + 'makongeni', + 'mnarani', + 'mnarani', + 'office', + 'g.e', + 'ge', + 'raibai', + 'ribe', + ], + Kakuma: ['kakuma'], + Kitui: ['kitui', 'mwingi'], + Nyanza: [ + 'busia', + 'nyalgunga', + 'mbita', + 'siaya', + 'kisumu', + 'nyalenda', + 'hawinga', + 'rangala', + 'uyoma', + 'mumias', + 'homabay', + 'homaboy', + 'migori', + 'kusumu', + ], + 'Misc Rural Counties': [ + 'makueni', + 'meru', + 'kisii', + 'bomet', + 'machakos', + 'bungoma', + 'eldoret', + 'kakamega', + 'kericho', + 'kajiado', + 'nandi', + 'nyeri', + 'wote', + 'kiambu', + 'mwea', + 'nakuru', + 'narok', + ], + other: ['other', 'none', 'unknown'], +}; -/** A mock of curated area types. */ -const areaTypes: Array = [ - { - name: 'urban', - area: ['urban', 'nairobi', 'mombasa'], - }, - { - name: 'rural', - area: ['rural', 'kakuma', 'kwale', 'kinango', 'kitui', 'nyanza'], - }, - { - name: 'periurban', - area: ['kilifi', 'periurban'], - }, - { - name: 'other', - area: ['other'], - }, -]; +const areaTypes: object = { + urban: ['urban', 'nairobi', 'mombasa', 'kisauni'], + rural: ['rural', 'kakuma', 'kwale', 'kinango', 'kitui', 'nyanza'], + periurban: ['kilifi', 'periurban'], + other: ['other'], +}; /** A mock of the user's business categories */ -const categories: Array = [ - { - name: 'system', - products: ['system', 'office main', 'office main phone'], - }, - { - name: 'education', - products: [ - 'book', - 'coach', - 'teacher', - 'sch', - 'school', - 'pry', - 'education', - 'student', - 'mwalimu', - 'maalim', - 'consultant', - 'consult', - 'college', - 'university', - 'lecturer', - 'primary', - 'secondary', - 'daycare', - 'babycare', - 'baby care', - 'elim', - 'eimu', - 'nursery', - 'red cross', - 'volunteer', - 'instructor', - 'journalist', - 'lesson', - 'academy', - 'headmistress', - 'headteacher', - 'cyber', - 'researcher', - 'professor', - 'demo', - 'expert', - 'tution', - 'tuition', - 'children', - 'headmaster', - 'educator', - 'Marital counsellor', - 'counsellor', - 'trainer', - 'vijana', - 'youth', - 'intern', - 'redcross', - 'KRCS', - 'danish', - 'science', - 'data', - 'facilitator', - 'vitabu', - 'kitabu', - ], - }, - { - name: 'faith', - products: [ - 'pastor', - 'imam', - 'madrasa', - 'religous', - 'religious', - 'ustadh', - 'ustadhi', - 'Marital counsellor', - 'counsellor', - 'church', - 'kanisa', - 'mksiti', - 'donor', - ], - }, - { - name: 'government', - products: [ - 'elder', - 'chief', - 'police', - 'government', - 'country', - 'county', - 'soldier', - 'village admin', - 'ward', - 'leader', - 'kra', - 'mailman', - 'immagration', - 'immigration', - ], - }, - { - name: 'environment', - products: [ - 'conservation', - 'toilet', - 'choo', - 'garbage', - 'fagio', - 'waste', - 'tree', - 'taka', - 'scrap', - 'cleaning', - 'gardener', - 'rubbish', - 'usafi', - 'mazingira', - 'miti', - 'trash', - 'cleaner', - 'plastic', - 'collection', - 'seedling', - 'seedlings', - 'recycling', - ], - }, - { - name: 'farming', - products: [ - 'farm', - 'farmer', - 'farming', - 'mkulima', - 'kulima', - 'ukulima', - 'wakulima', - 'jembe', - 'shamba', - ], - }, - { - name: 'labour', - products: [ - 'artist', - 'agent', - 'guard', - 'askari', - 'accountant', - 'baker', - 'beadwork', - 'beauty', - 'business', - 'barber', - 'casual', - 'electrian', - 'caretaker', - 'car wash', - 'capenter', - 'construction', - 'chef', - 'catering', - 'cobler', - 'cobbler', - 'carwash', - 'dhobi', - 'landlord', - 'design', - 'carpenter', - 'fundi', - 'hawking', - 'hawker', - 'househelp', - 'hsehelp', - 'house help', - 'help', - 'housegirl', - 'kushona', - 'juakali', - 'jualikali', - 'juacali', - 'jua kali', - 'shepherd', - 'makuti', - 'kujenga', - 'kinyozi', - 'kazi', - 'knitting', - 'kufua', - 'fua', - 'hustler', - 'biashara', - 'labour', - 'labor', - 'laundry', - 'repair', - 'hair', - 'posho', - 'mill', - 'mtambo', - 'uvuvi', - 'engineer', - 'manager', - 'tailor', - 'nguo', - 'mason', - 'mtumba', - 'garage', - 'mechanic', - 'mjenzi', - 'mfugaji', - 'painter', - 'receptionist', - 'printing', - 'programming', - 'plumb', - 'charging', - 'salon', - 'mpishi', - 'msusi', - 'mgema', - 'footballer', - 'photocopy', - 'peddler', - 'staff', - 'sales', - 'service', - 'saloon', - 'seremala', - 'security', - 'insurance', - 'secretary', - 'shoe', - 'shepard', - 'shephard', - 'tout', - 'tv', - 'mvuvi', - 'mawe', - 'majani', - 'maembe', - 'freelance', - 'mjengo', - 'electronics', - 'photographer', - 'programmer', - 'electrician', - 'washing', - 'bricks', - 'welder', - 'welding', - 'working', - 'worker', - 'watchman', - 'waiter', - 'waitress', - 'viatu', - 'yoga', - 'guitarist', - 'house', - 'artisan', - 'musician', - 'trade', - 'makonge', - 'ujenzi', - 'vendor', - 'watchlady', - 'marketing', - 'beautician', - 'photo', - 'metal work', - 'supplier', - 'law firm', - 'brewer', - ], - }, - { - name: 'food', - products: [ - 'avocado', - 'bhajia', - 'bajia', - 'mbonga', - 'bofu', - 'beans', - 'biscuits', - 'biringanya', - 'banana', - 'bananas', - 'crisps', - 'chakula', - 'coconut', - 'chapati', - 'cereal', - 'chipo', - 'chapo', - 'chai', - 'chips', - 'cassava', - 'cake', - 'cereals', - 'cook', - 'corn', - 'coffee', - 'chicken', - 'dagaa', - 'donut', - 'dough', - 'groundnuts', - 'hotel', - 'holel', - 'hoteli', - 'butcher', - 'butchery', - 'fruit', - 'food', - 'fruits', - 'fish', - 'githeri', - 'grocery', - 'grocer', - 'pojo', - 'papa', - 'goats', - 'mabenda', - 'mbenda', - 'poultry', - 'soda', - 'peanuts', - 'potatoes', - 'samosa', - 'soko', - 'samaki', - 'tomato', - 'tomatoes', - 'mchele', - 'matunda', - 'mango', - 'melon', - 'mellon', - 'nyanya', - 'nyama', - 'omena', - 'umena', - 'ndizi', - 'njugu', - 'kamba kamba', - 'khaimati', - 'kaimati', - 'kunde', - 'kuku', - 'kahawa', - 'keki', - 'muguka', - 'miraa', - 'milk', - 'choma', - 'maziwa', - 'mboga', - 'mbog', - 'busaa', - 'chumvi', - 'cabbages', - 'mabuyu', - 'machungwa', - 'mbuzi', - 'mnazi', - 'mchicha', - 'ngombe', - 'ngano', - 'nazi', - 'oranges', - 'peanuts', - 'mkate', - 'bread', - 'mikate', - 'vitungu', - 'sausages', - 'maize', - 'mbata', - 'mchuzi', - 'mchuuzi', - 'mandazi', - 'mbaazi', - 'mahindi', - 'maandazi', - 'mogoka', - 'meat', - 'mhogo', - 'mihogo', - 'muhogo', - 'maharagwe', - 'miwa', - 'mahamri', - 'mitumba', - 'simsim', - 'porridge', - 'pilau', - 'vegetable', - 'egg', - 'mayai', - 'mifugo', - 'unga', - 'good', - 'sima', - 'sweet', - 'sweats', - 'sambusa', - 'snacks', - 'sugar', - 'suger', - 'ugoro', - 'sukari', - 'soup', - 'spinach', - 'smokie', - 'smokies', - 'sukuma', - 'tea', - 'uji', - 'ugali', - 'uchuzi', - 'uchuuzi', - 'viazi', - 'yoghurt', - 'yogurt', - 'wine', - 'marondo', - 'maandzi', - 'matoke', - 'omeno', - 'onions', - 'nzugu', - 'korosho', - 'barafu', - 'juice', - ], - }, - { - name: 'water', - products: ['maji', 'water'], - }, - { - name: 'health', - products: [ - 'agrovet', - 'dispensary', - 'barakoa', - 'chemist', - 'Chemicals', - 'chv', - 'doctor', - 'daktari', - 'dawa', - 'hospital', - 'herbalist', - 'mganga', - 'sabuni', - 'soap', - 'nurse', - 'heath', - 'community health worker', - 'clinic', - 'clinical', - 'mask', - 'medicine', - 'lab technician', - 'pharmacy', - 'cosmetics', - 'veterinary', - 'vet', - 'sickly', - 'emergency response', - 'emergency', - ], - }, - { - name: 'savings', - products: ['chama', 'group', 'savings', 'loan', 'silc', 'vsla', 'credit', 'finance'], - }, - { - name: 'shop', - products: [ - 'bag', - 'bead', - 'belt', - 'bedding', - 'jik', - 'bed', - 'cement', - 'botique', - 'boutique', - 'lines', - 'kibanda', - 'kiosk', - 'spareparts', - 'candy', - 'cloth', - 'electricals', - 'mutumba', - 'cafe', - 'leso', - 'lesso', - 'duka', - 'spare parts', - 'socks', - 'malimali', - 'mitungi', - 'mali mali', - 'hardware', - 'detergent', - 'detergents', - 'dera', - 'retail', - 'kamba', - 'pombe', - 'pampers', - 'pool', - 'phone', - 'simu', - 'mangwe', - 'mikeka', - 'movie', - 'shop', - 'acces', - 'mchanga', - 'uto', - 'airtime', - 'matress', - 'mattress', - 'mattresses', - 'mpsea', - 'mpesa', - 'shirt', - 'wholesaler', - 'perfume', - 'playstation', - 'tissue', - 'vikapu', - 'uniform', - 'flowers', - 'vitenge', - 'utencils', - 'utensils', - 'station', - 'jewel', - 'pool table', - 'club', - 'pub', - 'bar', - 'furniture', - 'm-pesa', - 'vyombo', - ], - }, - { - name: 'transport', - products: [ - 'kebeba', - 'beba', - 'bebabeba', - 'bike', - 'bicycle', - 'matatu', - 'boda', - 'bodaboda', - 'cart', - 'carrier', - 'tour', - 'travel', - 'driver', - 'dereva', - 'tout', - 'conductor', - 'kubeba', - 'tuktuk', - 'taxi', - 'piki', - 'pikipiki', - 'manamba', - 'trasportion', - 'mkokoteni', - 'mover', - 'motorist', - 'motorbike', - 'transport', - 'transpoter', - 'gari', - 'magari', - 'makanga', - 'car', - ], - }, - { - name: 'fuel/energy', - products: [ - 'timber', - 'timberyard', - 'biogas', - 'charcol', - 'charcoal', - 'kuni', - 'mbao', - 'fuel', - 'makaa', - 'mafuta', - 'moto', - 'solar', - 'stima', - 'fire', - 'firewood', - 'wood', - 'oil', - 'taa', - 'gas', - 'paraffin', - 'parrafin', - 'parafin', - 'petrol', - 'petro', - 'kerosine', - 'kerosene', - 'diesel', - ], - }, - { - name: 'other', - products: ['other', 'none', 'unknown', 'none'], - }, -]; +const categories: object = { + system: ['system', 'office main', 'office main phone'], + education: [ + 'book', + 'coach', + 'teacher', + 'sch', + 'school', + 'pry', + 'education', + 'student', + 'mwalimu', + 'maalim', + 'consultant', + 'consult', + 'college', + 'university', + 'lecturer', + 'primary', + 'secondary', + 'daycare', + 'babycare', + 'baby care', + 'elim', + 'eimu', + 'nursery', + 'red cross', + 'volunteer', + 'instructor', + 'journalist', + 'lesson', + 'academy', + 'headmistress', + 'headteacher', + 'cyber', + 'researcher', + 'professor', + 'demo', + 'expert', + 'tution', + 'children', + 'headmaster', + 'educator', + 'Marital counsellor', + 'counsellor', + 'trainer', + 'vijana', + 'youth', + 'intern', + 'redcross', + 'KRCS', + 'danish', + 'science', + 'data', + 'facilitator', + 'vitabu', + 'kitabu', + ], + faith: [ + 'pastor', + 'imam', + 'madrasa', + 'religous', + 'religious', + 'ustadh', + 'ustadhi', + 'Marital counsellor', + 'counsellor', + 'church', + 'kanisa', + 'mksiti', + 'donor', + ], + government: [ + 'elder', + 'chief', + 'police', + 'government', + 'country', + 'county', + 'soldier', + 'village admin', + 'ward', + 'leader', + 'kra', + 'mailman', + 'immagration', + ], + environment: [ + 'conservation', + 'toilet', + 'choo', + 'garbage', + 'fagio', + 'waste', + 'tree', + 'taka', + 'scrap', + 'cleaning', + 'gardener', + 'rubbish', + 'usafi', + 'mazingira', + 'miti', + 'trash', + 'cleaner', + 'plastic', + 'collection', + 'seedling', + 'seedlings', + 'recycling', + ], + farming: [ + 'farm', + 'farmer', + 'farming', + 'mkulima', + 'kulima', + 'ukulima', + 'wakulima', + 'jembe', + 'shamba', + ], + labour: [ + 'artist', + 'agent', + 'guard', + 'askari', + 'accountant', + 'baker', + 'beadwork', + 'beauty', + 'business', + 'barber', + 'casual', + 'electrian', + 'caretaker', + 'car wash', + 'capenter', + 'construction', + 'chef', + 'catering', + 'cobler', + 'cobbler', + 'carwash', + 'dhobi', + 'landlord', + 'design', + 'carpenter', + 'fundi', + 'hawking', + 'hawker', + 'househelp', + 'hsehelp', + 'house help', + 'help', + 'housegirl', + 'kushona', + 'juakali', + 'jualikali', + 'juacali', + 'jua kali', + 'shepherd', + 'makuti', + 'kujenga', + 'kinyozi', + 'kazi', + 'knitting', + 'kufua', + 'fua', + 'hustler', + 'biashara', + 'labour', + 'labor', + 'laundry', + 'repair', + 'hair', + 'posho', + 'mill', + 'mtambo', + 'uvuvi', + 'engineer', + 'manager', + 'tailor', + 'nguo', + 'mason', + 'mtumba', + 'garage', + 'mechanic', + 'mjenzi', + 'mfugaji', + 'painter', + 'receptionist', + 'printing', + 'programming', + 'plumb', + 'charging', + 'salon', + 'mpishi', + 'msusi', + 'mgema', + 'footballer', + 'photocopy', + 'peddler', + 'staff', + 'sales', + 'service', + 'saloon', + 'seremala', + 'security', + 'insurance', + 'secretary', + 'shoe', + 'shepard', + 'shephard', + 'tout', + 'tv', + 'mvuvi', + 'mawe', + 'majani', + 'maembe', + 'freelance', + 'mjengo', + 'electronics', + 'photographer', + 'programmer', + 'electrician', + 'washing', + 'bricks', + 'welder', + 'welding', + 'working', + 'worker', + 'watchman', + 'waiter', + 'waitress', + 'viatu', + 'yoga', + 'guitarist', + 'house', + 'artisan', + 'musician', + 'trade', + 'makonge', + 'ujenzi', + 'vendor', + 'watchlady', + 'marketing', + 'beautician', + 'photo', + 'metal work', + 'supplier', + 'law firm', + 'brewer', + ], + food: [ + 'avocado', + 'bhajia', + 'bajia', + 'mbonga', + 'bofu', + 'beans', + 'biscuits', + 'biringanya', + 'banana', + 'bananas', + 'crisps', + 'chakula', + 'coconut', + 'chapati', + 'cereal', + 'chipo', + 'chapo', + 'chai', + 'chips', + 'cassava', + 'cake', + 'cereals', + 'cook', + 'corn', + 'coffee', + 'chicken', + 'dagaa', + 'donut', + 'dough', + 'groundnuts', + 'hotel', + 'holel', + 'hoteli', + 'butcher', + 'butchery', + 'fruit', + 'food', + 'fruits', + 'fish', + 'githeri', + 'grocery', + 'grocer', + 'pojo', + 'papa', + 'goats', + 'mabenda', + 'mbenda', + 'poultry', + 'soda', + 'peanuts', + 'potatoes', + 'samosa', + 'soko', + 'samaki', + 'tomato', + 'tomatoes', + 'mchele', + 'matunda', + 'mango', + 'melon', + 'mellon', + 'nyanya', + 'nyama', + 'omena', + 'umena', + 'ndizi', + 'njugu', + 'kamba kamba', + 'khaimati', + 'kaimati', + 'kunde', + 'kuku', + 'kahawa', + 'keki', + 'muguka', + 'miraa', + 'milk', + 'choma', + 'maziwa', + 'mboga', + 'mbog', + 'busaa', + 'chumvi', + 'cabbages', + 'mabuyu', + 'machungwa', + 'mbuzi', + 'mnazi', + 'mchicha', + 'ngombe', + 'ngano', + 'nazi', + 'oranges', + 'peanuts', + 'mkate', + 'bread', + 'mikate', + 'vitungu', + 'sausages', + 'maize', + 'mbata', + 'mchuzi', + 'mchuuzi', + 'mandazi', + 'mbaazi', + 'mahindi', + 'maandazi', + 'mogoka', + 'meat', + 'mhogo', + 'mihogo', + 'muhogo', + 'maharagwe', + 'miwa', + 'mahamri', + 'mitumba', + 'simsim', + 'porridge', + 'pilau', + 'vegetable', + 'egg', + 'mayai', + 'mifugo', + 'unga', + 'good', + 'sima', + 'sweet', + 'sweats', + 'sambusa', + 'snacks', + 'sugar', + 'suger', + 'ugoro', + 'sukari', + 'soup', + 'spinach', + 'smokie', + 'smokies', + 'sukuma', + 'tea', + 'uji', + 'ugali', + 'uchuzi', + 'uchuuzi', + 'viazi', + 'yoghurt', + 'yogurt', + 'wine', + 'marondo', + 'maandzi', + 'matoke', + 'omeno', + 'onions', + 'nzugu', + 'korosho', + 'barafu', + 'juice', + ], + water: ['maji', 'water'], + health: [ + 'agrovet', + 'dispensary', + 'barakoa', + 'chemist', + 'Chemicals', + 'chv', + 'doctor', + 'daktari', + 'dawa', + 'hospital', + 'herbalist', + 'mganga', + 'sabuni', + 'soap', + 'nurse', + 'heath', + 'community health worker', + 'clinic', + 'clinical', + 'mask', + 'medicine', + 'lab technician', + 'pharmacy', + 'cosmetics', + 'veterinary', + 'vet', + 'sickly', + 'emergency response', + 'emergency', + ], + savings: ['chama', 'group', 'savings', 'loan', 'silc', 'vsla', 'credit', 'finance'], + shop: [ + 'bag', + 'bead', + 'belt', + 'bedding', + 'jik', + 'bed', + 'cement', + 'botique', + 'boutique', + 'lines', + 'kibanda', + 'kiosk', + 'spareparts', + 'candy', + 'cloth', + 'electricals', + 'mutumba', + 'cafe', + 'leso', + 'lesso', + 'duka', + 'spare parts', + 'socks', + 'malimali', + 'mitungi', + 'mali mali', + 'hardware', + 'detergent', + 'detergents', + 'dera', + 'retail', + 'kamba', + 'pombe', + 'pampers', + 'pool', + 'phone', + 'simu', + 'mangwe', + 'mikeka', + 'movie', + 'shop', + 'acces', + 'mchanga', + 'uto', + 'airtime', + 'matress', + 'mattress', + 'mattresses', + 'mpsea', + 'mpesa', + 'shirt', + 'wholesaler', + 'perfume', + 'playstation', + 'tissue', + 'vikapu', + 'uniform', + 'flowers', + 'vitenge', + 'utencils', + 'utensils', + 'station', + 'jewel', + 'pool table', + 'club', + 'pub', + 'bar', + 'furniture', + 'm-pesa', + 'vyombo', + ], + transport: [ + 'kebeba', + 'beba', + 'bebabeba', + 'bike', + 'bicycle', + 'matatu', + 'boda', + 'bodaboda', + 'cart', + 'carrier', + 'tour', + 'travel', + 'driver', + 'dereva', + 'tout', + 'conductor', + 'kubeba', + 'tuktuk', + 'taxi', + 'piki', + 'pikipiki', + 'manamba', + 'trasportion', + 'mkokoteni', + 'mover', + 'motorist', + 'motorbike', + 'transport', + 'transpoter', + 'gari', + 'magari', + 'makanga', + 'car', + ], + 'fuel/energy': [ + 'timber', + 'timberyard', + 'biogas', + 'charcol', + 'charcoal', + 'kuni', + 'mbao', + 'fuel', + 'makaa', + 'mafuta', + 'moto', + 'solar', + 'stima', + 'fire', + 'firewood', + 'wood', + 'oil', + 'taa', + 'gas', + 'paraffin', + 'parrafin', + 'parafin', + 'petrol', + 'petro', + 'kerosine', + 'kerosene', + 'diesel', + ], + other: ['other', 'none', 'unknown', 'none'], +}; /** A mock of curated genders */ const genders: Array = ['male', 'female', 'other']; -/** A mock of the tokens in the system. */ -const tokens: Array = [ - { - name: 'Giftable Reserve', - symbol: 'GRZ', - address: '0xa686005CE37Dce7738436256982C3903f2E4ea8E', - supply: '1000000001000000000000000000', - decimals: '18', - reserves: {}, - }, - { - name: 'Demo Token', - symbol: 'DEMO', - address: '0xc80D6aFF8194114c52AEcD84c9f15fd5c8abb187', - supply: '99999999999999998976', - decimals: '18', - reserves: { - '0xa686005CE37Dce7738436256982C3903f2E4ea8E': { - weight: '1000000', - balance: '99999999999999998976', - }, - }, - reserveRatio: '1000000', - owner: '0x3Da99AAD2D9CA01D131eFc3B17444b832B31Ff4a', - }, - { - name: 'Foo Token', - symbol: 'FOO', - address: '0x9ceD86089f7aBB5A97B40eb0E7521e7aa308d354', - supply: '1000000000000000001014', - decimals: '18', - reserves: { - '0xa686005CE37Dce7738436256982C3903f2E4ea8E': { - weight: '1000000', - balance: '1000000000000000001014', - }, - }, - reserveRatio: '1000000', - owner: '0x3Da99AAD2D9CA01D131eFc3B17444b832B31Ff4a', - }, - { - name: 'testb', - symbol: 'tstb', - address: '0xC63cFA91A3BFf41cE31Ff436f67D3ACBC977DB95', - supply: '99000', - decimals: '18', - reserves: { - '0xa686005CE37Dce7738436256982C3903f2E4ea8E': { weight: '1000000', balance: '99000' }, - }, - reserveRatio: '1000000', - owner: '0x3Da99AAD2D9CA01D131eFc3B17444b832B31Ff4a', - }, - { - name: 'testa', - symbol: 'tsta', - address: '0x8fA4101ef19D0a078239d035659e92b278bD083C', - supply: '9981', - decimals: '18', - reserves: { - '0xa686005CE37Dce7738436256982C3903f2E4ea8E': { weight: '1000000', balance: '9981' }, - }, - reserveRatio: '1000000', - owner: '0x3Da99AAD2D9CA01D131eFc3B17444b832B31Ff4a', - }, - { - name: 'testc', - symbol: 'tstc', - address: '0x4A6fA6bc3BfE4C9661bC692D9798425350C9e3D4', - supply: '100990', - decimals: '18', - reserves: { - '0xa686005CE37Dce7738436256982C3903f2E4ea8E': { weight: '1000000', balance: '100990' }, - }, - reserveRatio: '1000000', - owner: '0x3Da99AAD2D9CA01D131eFc3B17444b832B31Ff4a', - }, -]; - /** A mock of curated transaction types. */ const transactionTypes: Array = [ 'transactions', @@ -1118,22 +957,12 @@ export class MockBackendInterceptor implements HttpInterceptor { return approveAction(); case url.endsWith('/areanames') && method === 'GET': return getAreaNames(); - case url.match(/\/areanames\/\w+/) && method === 'GET': - return getAreaNameByLocation(); case url.endsWith('/areatypes') && method === 'GET': return getAreaTypes(); - case url.match(/\/areatypes\/\w+/) && method === 'GET': - return getAreaTypeByArea(); case url.endsWith('/categories') && method === 'GET': return getCategories(); - case url.match(/\/categories\/\w+/) && method === 'GET': - return getCategoryByProduct(); case url.endsWith('/genders') && method === 'GET': return getGenders(); - case url.endsWith('/tokens') && method === 'GET': - return getTokens(); - case url.match(/\/tokens\/\w+/) && method === 'GET': - return getTokenBySymbol(); case url.endsWith('/transactiontypes') && method === 'GET': return getTransactionTypes(); default: @@ -1165,78 +994,21 @@ export class MockBackendInterceptor implements HttpInterceptor { } function getAreaNames(): Observable> { - const areaNameList: Array = areaNames.map((areaName) => areaName.name); - return ok(areaNameList); - } - - function getAreaNameByLocation(): Observable> { - const keywords = stringFromUrl().split(' '); - for (const keyword of keywords) { - const queriedAreaName: AreaName = areaNames.find((areaName) => - areaName.locations.includes(keyword) - ); - if (queriedAreaName) { - return ok(queriedAreaName.name); - } - } - return ok('other'); + return ok(areaNames); } function getAreaTypes(): Observable> { - const areaTypeList: Array = areaTypes.map((areaType) => areaType.name); - return ok(areaTypeList); - } - - function getAreaTypeByArea(): Observable> { - const keywords = stringFromUrl().split(' '); - for (const keyword of keywords) { - const queriedAreaType: AreaType = areaTypes.find((areaType) => - areaType.area.includes(keyword) - ); - if (queriedAreaType) { - return ok(queriedAreaType.name); - } - } - return ok('other'); + return ok(areaTypes); } function getCategories(): Observable> { - const categoryList: Array = categories.map((category) => category.name); - return ok(categoryList); - } - - function getCategoryByProduct(): Observable> { - const keywords = stringFromUrl().split(' '); - for (const keyword of keywords) { - const queriedCategory: Category = categories.find((category) => - category.products.includes(keyword) - ); - if (queriedCategory) { - return ok(queriedCategory.name); - } - } - return ok('other'); + return ok(categories); } function getGenders(): Observable> { return ok(genders); } - function getTokens(): Observable> { - return ok(tokens); - } - - function getTokenBySymbol(): Observable> { - const keywords = stringFromUrl().split(' '); - for (const keyword of keywords) { - const queriedToken: Token = tokens.find((token) => token.symbol === keyword); - if (queriedToken) { - return ok(queriedToken.name); - } - } - return ok('other'); - } - function getTransactionTypes(): Observable> { return ok(transactionTypes); } diff --git a/src/app/_models/mappings.ts b/src/app/_models/mappings.ts index b9cf49d..0481578 100644 --- a/src/app/_models/mappings.ts +++ b/src/app/_models/mappings.ts @@ -12,29 +12,5 @@ interface Action { user: string; } -/** Area name object interface */ -interface AreaName { - /** Locations that map to that area name. */ - locations: Array; - /** Name of area */ - name: string; -} - -/** Area type object interface */ -interface AreaType { - /** Areas that map to that area type. */ - area: Array; - /** Type of area */ - name: string; -} - -/** Category object interface */ -interface Category { - /** Business category */ - name: string; - /** Products that map to that category. */ - products: Array; -} - /** @exports */ -export { Action, AreaName, AreaType, Category }; +export { Action }; diff --git a/src/app/_services/location.service.ts b/src/app/_services/location.service.ts index 2616f02..562952f 100644 --- a/src/app/_services/location.service.ts +++ b/src/app/_services/location.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; +import { BehaviorSubject, Observable } from 'rxjs'; import { environment } from '@src/environments/environment'; import { first } from 'rxjs/operators'; import { HttpClient } from '@angular/common/http'; @@ -8,21 +8,51 @@ import { HttpClient } from '@angular/common/http'; providedIn: 'root', }) export class LocationService { + areaNames: object = {}; + private areaNamesList: BehaviorSubject = new BehaviorSubject(this.areaNames); + areaNamesSubject: Observable = this.areaNamesList.asObservable(); + + areaTypes: object = {}; + private areaTypesList: BehaviorSubject = new BehaviorSubject(this.areaTypes); + areaTypesSubject: Observable = this.areaTypesList.asObservable(); + constructor(private httpClient: HttpClient) {} - getAreaNames(): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/areanames`); + getAreaNames(): void { + this.httpClient + .get(`${environment.cicMetaUrl}/areanames`) + .pipe(first()) + .subscribe((res: object) => this.areaNamesList.next(res)); } - getAreaNameByLocation(location: string): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/areanames/${location.toLowerCase()}`); + getAreaNameByLocation(location: string, areaNames: object): string { + const keywords = location.toLowerCase().split(' '); + for (const keyword of keywords) { + const queriedAreaName: string = Object.keys(areaNames).find((key) => + areaNames[key].includes(keyword) + ); + if (queriedAreaName) { + return queriedAreaName; + } + } } - getAreaTypes(): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/areatypes`).pipe(first()); + getAreaTypes(): void { + this.httpClient + .get(`${environment.cicMetaUrl}/areatypes`) + .pipe(first()) + .subscribe((res: object) => this.areaTypesList.next(res)); } - getAreaTypeByArea(area: string): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/areatypes/${area.toLowerCase()}`); + getAreaTypeByArea(area: string, areaTypes: object): string { + const keywords = area.toLowerCase().split(' '); + for (const keyword of keywords) { + const queriedAreaType: string = Object.keys(areaTypes).find((key) => + areaTypes[key].includes(keyword) + ); + if (queriedAreaType) { + return queriedAreaType; + } + } } } diff --git a/src/app/_services/token.service.ts b/src/app/_services/token.service.ts index ccf595c..a572729 100644 --- a/src/app/_services/token.service.ts +++ b/src/app/_services/token.service.ts @@ -1,7 +1,6 @@ import { Injectable } from '@angular/core'; import { CICRegistry } from '@cicnet/cic-client'; import { TokenRegistry } from '@app/_eth'; -import { HttpClient } from '@angular/common/http'; import { RegistryService } from '@app/_services/registry.service'; import { Token } from '@app/_models'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; @@ -19,7 +18,7 @@ export class TokenService { tokensSubject: Observable> = this.tokensList.asObservable(); load: BehaviorSubject = new BehaviorSubject(false); - constructor(private httpClient: HttpClient) {} + constructor() {} async init(): Promise { this.registry = await RegistryService.getRegistry(); diff --git a/src/app/_services/user.service.ts b/src/app/_services/user.service.ts index 0329bdb..b2a0b90 100644 --- a/src/app/_services/user.service.ts +++ b/src/app/_services/user.service.ts @@ -36,6 +36,10 @@ export class UserService { private actionsList: BehaviorSubject = new BehaviorSubject(this.actions); actionsSubject: Observable> = this.actionsList.asObservable(); + categories: object = {}; + private categoriesList: BehaviorSubject = new BehaviorSubject(this.categories); + categoriesSubject: Observable = this.categoriesList.asObservable(); + constructor( private httpClient: HttpClient, private loggingService: LoggingService, @@ -244,12 +248,23 @@ export class UserService { return; } - getCategories(): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/categories`); + getCategories(): void { + this.httpClient + .get(`${environment.cicMetaUrl}/categories`) + .pipe(first()) + .subscribe((res: object) => this.categoriesList.next(res)); } - getCategoryByProduct(product: string): Observable { - return this.httpClient.get(`${environment.cicMetaUrl}/categories/${product.toLowerCase()}`); + getCategoryByProduct(product: string, categories: object): string { + const keywords = product.toLowerCase().split(' '); + for (const keyword of keywords) { + const queriedCategory: string = Object.keys(categories).find((key) => + categories[key].includes(keyword) + ); + if (queriedCategory) { + return queriedCategory; + } + } } getAccountTypes(): Observable { diff --git a/src/app/pages/accounts/account-details/account-details.component.html b/src/app/pages/accounts/account-details/account-details.component.html index 3b48095..4378beb 100644 --- a/src/app/pages/accounts/account-details/account-details.component.html +++ b/src/app/pages/accounts/account-details/account-details.component.html @@ -113,24 +113,6 @@ -
- - Age: - - Age is required. - -
-
ACCOUNT TYPE: @@ -150,24 +132,6 @@
-
- - Bio: - - Bio is required. - -
-
GENDER: @@ -187,6 +151,42 @@
+
+ + Age: + + Age is required. + +
+ +
+ + Bio: + + Bio is required. + +
+
BUSINESS CATEGORY: diff --git a/src/app/pages/accounts/account-details/account-details.component.ts b/src/app/pages/accounts/account-details/account-details.component.ts index 126f349..f2ecbcb 100644 --- a/src/app/pages/accounts/account-details/account-details.component.ts +++ b/src/app/pages/accounts/account-details/account-details.component.ts @@ -23,7 +23,7 @@ import { copyToClipboard, CustomErrorStateMatcher, exportCsv } from '@app/_helpe import { MatSnackBar } from '@angular/material/snack-bar'; import { add0x, strip0x } from '@src/assets/js/ethtx/dist/hex'; import { environment } from '@src/environments/environment'; -import { AccountDetails, AreaName, AreaType, Category, Transaction } from '@app/_models'; +import { AccountDetails, Transaction } from '@app/_models'; @Component({ selector: 'app-account-details', @@ -52,9 +52,9 @@ export class AccountDetailsComponent implements OnInit { accountStatus: any; accounts: Array = []; accountsType: string = 'all'; - categories: Array; - areaNames: Array; - areaTypes: Array; + categories: Array; + areaNames: Array; + areaTypes: Array; transaction: any; transactions: Array; transactionsType: string = 'all'; @@ -115,27 +115,21 @@ export class AccountDetailsComponent implements OnInit { this.account = res; this.cdr.detectChanges(); this.loggingService.sendInfoLevelMessage(this.account); - this.locationService - .getAreaNameByLocation(this.account.location.area_name) - .pipe(first()) - .subscribe((response) => { - this.area = response; - this.cdr.detectChanges(); - this.locationService - .getAreaTypeByArea(this.area) - .pipe(first()) - .subscribe((result) => { - this.areaType = result; - this.cdr.detectChanges(); - }); - }); - this.userService - .getCategoryByProduct(this.account.products[0]) - .pipe(first()) - .subscribe((response) => { - this.category = response; + this.locationService.areaNamesSubject.subscribe((response) => { + this.area = this.locationService.getAreaNameByLocation( + this.account.location.area_name, + response + ); + this.cdr.detectChanges(); + this.locationService.areaTypesSubject.subscribe((result) => { + this.areaType = this.locationService.getAreaTypeByArea(this.area, result); this.cdr.detectChanges(); }); + }); + this.userService.categoriesSubject.subscribe((result) => { + this.category = this.userService.getCategoryByProduct(this.account.products[0], result); + this.cdr.detectChanges(); + }); const fullName = this.account.vcard?.fn[0].value.split(' '); this.accountInfoForm.patchValue({ firstName: fullName[0].split(',')[0], @@ -174,18 +168,18 @@ export class AccountDetailsComponent implements OnInit { this.transactions = transactions; this.cdr.detectChanges(); }); - this.userService - .getCategories() - .pipe(first()) - .subscribe((res) => (this.categories = res)); - this.locationService - .getAreaNames() - .pipe(first()) - .subscribe((res) => (this.areaNames = res)); - this.locationService - .getAreaTypes() - .pipe(first()) - .subscribe((res) => (this.areaTypes = res)); + this.userService.getCategories(); + this.userService.categoriesSubject.subscribe((res) => { + this.categories = Object.keys(res); + }); + this.locationService.getAreaNames(); + this.locationService.areaNamesSubject.subscribe((res) => { + this.areaNames = Object.keys(res); + }); + this.locationService.getAreaTypes(); + this.locationService.areaTypesSubject.subscribe((res) => { + this.areaTypes = Object.keys(res); + }); this.userService .getAccountTypes() .pipe(first()) diff --git a/src/app/pages/accounts/create-account/create-account.component.ts b/src/app/pages/accounts/create-account/create-account.component.ts index 30692ef..ab6dfbc 100644 --- a/src/app/pages/accounts/create-account/create-account.component.ts +++ b/src/app/pages/accounts/create-account/create-account.component.ts @@ -3,7 +3,6 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { LocationService, UserService } from '@app/_services'; import { CustomErrorStateMatcher } from '@app/_helpers'; import { first } from 'rxjs/operators'; -import { AreaName, Category } from '@app/_models'; @Component({ selector: 'app-create-account', @@ -15,8 +14,8 @@ export class CreateAccountComponent implements OnInit { createForm: FormGroup; matcher: CustomErrorStateMatcher = new CustomErrorStateMatcher(); submitted: boolean = false; - categories: Array; - areaNames: Array; + categories: Array; + areaNames: Array; accountTypes: Array; genders: Array; @@ -40,14 +39,14 @@ export class CreateAccountComponent implements OnInit { referrer: ['', Validators.required], businessCategory: ['', Validators.required], }); - this.userService - .getCategories() - .pipe(first()) - .subscribe((res) => (this.categories = res)); - this.locationService - .getAreaNames() - .pipe(first()) - .subscribe((res) => (this.areaNames = res)); + this.userService.getCategories(); + this.userService.categoriesSubject.subscribe((res) => { + this.categories = Object.keys(res); + }); + this.locationService.getAreaNames(); + this.locationService.areaNamesSubject.subscribe((res) => { + this.areaNames = Object.keys(res); + }); this.userService .getAccountTypes() .pipe(first())