|
| 1 | +/** |
| 2 | + * Sample small businesses in Botswana for counterparty data |
| 3 | + * |
| 4 | + * These represent typical small businesses that might be counterparties |
| 5 | + * for banking transactions in Botswana. |
| 6 | + */ |
| 7 | + |
| 8 | +import type { CreateCounterpartyPayload } from '$lib/obp/types'; |
| 9 | + |
| 10 | +export interface Business { |
| 11 | + name: string; |
| 12 | + description: string; |
| 13 | + category: string; |
| 14 | + location: string; |
| 15 | + account_number: string; |
| 16 | + bank_code: string; |
| 17 | +} |
| 18 | + |
| 19 | +// Botswana Small Businesses Data |
| 20 | +// Each business has a name, description, category, and location |
| 21 | +export const BOTSWANA_BUSINESSES: Business[] = [ |
| 22 | + { |
| 23 | + name: 'Mokolodi Crafts', |
| 24 | + description: 'Traditional Botswana crafts and artwork', |
| 25 | + category: 'Retail - Arts & Crafts', |
| 26 | + location: 'Gaborone', |
| 27 | + account_number: 'BW0001000001', |
| 28 | + bank_code: 'FNBBBWGX' |
| 29 | + }, |
| 30 | + { |
| 31 | + name: 'Kalahari Safari Tours', |
| 32 | + description: 'Wildlife safari and eco-tourism services', |
| 33 | + category: 'Tourism', |
| 34 | + location: 'Maun', |
| 35 | + account_number: 'BW0001000002', |
| 36 | + bank_code: 'SBICBWGX' |
| 37 | + }, |
| 38 | + { |
| 39 | + name: 'Botho Fresh Produce', |
| 40 | + description: 'Fresh fruits and vegetables supplier', |
| 41 | + category: 'Agriculture - Produce', |
| 42 | + location: 'Francistown', |
| 43 | + account_number: 'BW0001000003', |
| 44 | + bank_code: 'BABORWGX' |
| 45 | + }, |
| 46 | + { |
| 47 | + name: 'Tswana Textiles', |
| 48 | + description: 'Traditional and modern African textiles', |
| 49 | + category: 'Manufacturing - Textiles', |
| 50 | + location: 'Gaborone', |
| 51 | + account_number: 'BW0001000004', |
| 52 | + bank_code: 'FNBBBWGX' |
| 53 | + }, |
| 54 | + { |
| 55 | + name: 'Okavango Fish Farm', |
| 56 | + description: 'Sustainable aquaculture and fish supply', |
| 57 | + category: 'Agriculture - Aquaculture', |
| 58 | + location: 'Kasane', |
| 59 | + account_number: 'BW0001000005', |
| 60 | + bank_code: 'SBICBWGX' |
| 61 | + }, |
| 62 | + { |
| 63 | + name: 'Setswana Solar Solutions', |
| 64 | + description: 'Solar panel installation and maintenance', |
| 65 | + category: 'Energy - Renewable', |
| 66 | + location: 'Gaborone', |
| 67 | + account_number: 'BW0001000006', |
| 68 | + bank_code: 'BABORWGX' |
| 69 | + }, |
| 70 | + { |
| 71 | + name: 'Motswana Mobile Repairs', |
| 72 | + description: 'Mobile phone and electronics repair', |
| 73 | + category: 'Services - Electronics', |
| 74 | + location: 'Lobatse', |
| 75 | + account_number: 'BW0001000007', |
| 76 | + bank_code: 'FNBBBWGX' |
| 77 | + }, |
| 78 | + { |
| 79 | + name: 'Chobe Leather Goods', |
| 80 | + description: 'Handcrafted leather products and accessories', |
| 81 | + category: 'Manufacturing - Leather', |
| 82 | + location: 'Kasane', |
| 83 | + account_number: 'BW0001000008', |
| 84 | + bank_code: 'SBICBWGX' |
| 85 | + }, |
| 86 | + { |
| 87 | + name: 'Gaborone Catering Services', |
| 88 | + description: 'Event catering and food services', |
| 89 | + category: 'Food & Beverage', |
| 90 | + location: 'Gaborone', |
| 91 | + account_number: 'BW0001000009', |
| 92 | + bank_code: 'BABORWGX' |
| 93 | + }, |
| 94 | + { |
| 95 | + name: 'Pula Construction Materials', |
| 96 | + description: 'Building materials and construction supplies', |
| 97 | + category: 'Construction', |
| 98 | + location: 'Francistown', |
| 99 | + account_number: 'BW0001000010', |
| 100 | + bank_code: 'FNBBBWGX' |
| 101 | + }, |
| 102 | + { |
| 103 | + name: 'Tlokweng Transport Services', |
| 104 | + description: 'Local freight and logistics services', |
| 105 | + category: 'Transport & Logistics', |
| 106 | + location: 'Tlokweng', |
| 107 | + account_number: 'BW0001000011', |
| 108 | + bank_code: 'SBICBWGX' |
| 109 | + }, |
| 110 | + { |
| 111 | + name: 'Botswana Beekeepers Cooperative', |
| 112 | + description: 'Honey production and bee products', |
| 113 | + category: 'Agriculture - Apiculture', |
| 114 | + location: 'Palapye', |
| 115 | + account_number: 'BW0001000012', |
| 116 | + bank_code: 'BABORWGX' |
| 117 | + }, |
| 118 | + { |
| 119 | + name: 'Maun Auto Mechanics', |
| 120 | + description: 'Vehicle repair and maintenance services', |
| 121 | + category: 'Automotive Services', |
| 122 | + location: 'Maun', |
| 123 | + account_number: 'BW0001000013', |
| 124 | + bank_code: 'FNBBBWGX' |
| 125 | + }, |
| 126 | + { |
| 127 | + name: 'Kgalagadi Pottery Studio', |
| 128 | + description: 'Handmade pottery and ceramics', |
| 129 | + category: 'Arts & Crafts', |
| 130 | + location: 'Molepolole', |
| 131 | + account_number: 'BW0001000014', |
| 132 | + bank_code: 'SBICBWGX' |
| 133 | + }, |
| 134 | + { |
| 135 | + name: 'Delta Digital Services', |
| 136 | + description: 'IT support and digital marketing', |
| 137 | + category: 'Technology Services', |
| 138 | + location: 'Gaborone', |
| 139 | + account_number: 'BW0001000015', |
| 140 | + bank_code: 'BABORWGX' |
| 141 | + }, |
| 142 | + { |
| 143 | + name: 'Serowe Grain Mills', |
| 144 | + description: 'Grain processing and flour production', |
| 145 | + category: 'Food Processing', |
| 146 | + location: 'Serowe', |
| 147 | + account_number: 'BW0001000016', |
| 148 | + bank_code: 'FNBBBWGX' |
| 149 | + }, |
| 150 | + { |
| 151 | + name: 'Nata Salt Mining', |
| 152 | + description: 'Natural salt extraction and processing', |
| 153 | + category: 'Mining - Salt', |
| 154 | + location: 'Nata', |
| 155 | + account_number: 'BW0001000017', |
| 156 | + bank_code: 'SBICBWGX' |
| 157 | + }, |
| 158 | + { |
| 159 | + name: 'Botswana Beauty Products', |
| 160 | + description: 'Natural cosmetics and skincare products', |
| 161 | + category: 'Manufacturing - Cosmetics', |
| 162 | + location: 'Gaborone', |
| 163 | + account_number: 'BW0001000018', |
| 164 | + bank_code: 'BABORWGX' |
| 165 | + }, |
| 166 | + { |
| 167 | + name: 'Jwaneng Jewelry Workshop', |
| 168 | + description: 'Custom jewelry and diamond polishing', |
| 169 | + category: 'Manufacturing - Jewelry', |
| 170 | + location: 'Jwaneng', |
| 171 | + account_number: 'BW0001000019', |
| 172 | + bank_code: 'FNBBBWGX' |
| 173 | + }, |
| 174 | + { |
| 175 | + name: 'Moremi Eco Lodge Supplies', |
| 176 | + description: 'Eco-friendly hospitality supplies', |
| 177 | + category: 'Hospitality Supplies', |
| 178 | + location: 'Maun', |
| 179 | + account_number: 'BW0001000020', |
| 180 | + bank_code: 'SBICBWGX' |
| 181 | + } |
| 182 | +]; |
| 183 | + |
| 184 | +/** |
| 185 | + * Get list of Botswana businesses |
| 186 | + * |
| 187 | + * @param count - Number of businesses to return. If undefined, returns all. |
| 188 | + * @returns List of business objects |
| 189 | + */ |
| 190 | +export function getBusinesses(count?: number): Business[] { |
| 191 | + if (count === undefined) { |
| 192 | + return BOTSWANA_BUSINESSES; |
| 193 | + } |
| 194 | + return BOTSWANA_BUSINESSES.slice(0, count); |
| 195 | +} |
| 196 | + |
| 197 | +/** |
| 198 | + * Convert business data to counterparty format |
| 199 | + * |
| 200 | + * @param business - Business object |
| 201 | + * @param currency - Currency code (default: BWP for Botswana Pula) |
| 202 | + * @returns Payload formatted for OBP counterparty creation |
| 203 | + */ |
| 204 | +export function getBusinessForCounterparty( |
| 205 | + business: Business, |
| 206 | + currency: string = 'BWP' |
| 207 | +): CreateCounterpartyPayload { |
| 208 | + // Truncate description to max 36 characters (OBP limit) |
| 209 | + const description = business.description.slice(0, 36); |
| 210 | + |
| 211 | + return { |
| 212 | + name: business.name, |
| 213 | + description: description, |
| 214 | + currency: currency, |
| 215 | + other_account_routing_scheme: 'AccountNumber', |
| 216 | + other_account_routing_address: business.account_number, |
| 217 | + other_bank_routing_scheme: 'BIC', |
| 218 | + other_bank_routing_address: business.bank_code, |
| 219 | + bespoke: [ |
| 220 | + { key: 'category', value: business.category }, |
| 221 | + { key: 'location', value: business.location } |
| 222 | + ] |
| 223 | + }; |
| 224 | +} |
0 commit comments