4 | 7 | R = {user_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, city_name, region_id, region_name, cust_EDB, cust_company_name, cust_adr, cust_representative_img, wh_id, wh_adr, veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin,veh_reg_date, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email, art_id, art_name, art_image, art_weight, price_id, price, price_eff_date, pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc, del_id, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, d_status_name, d_status_desc, ord_id, ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, unit_id, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, day_id, day_name, cust_day_id, start_time, end_time, t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, img_id, img_path, img_ent_type, img_ent_id} |
5 | 8 | |
6 | 9 | === Функционални зависности |
| 117 | |
| 118 | === Покривачи на примарните клучеви |
| 119 | |
| 120 | ==== Vehicle |
| 121 | |
| 122 | veh_id+ = {veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr, city_id, city_name, region_id, region_name} |
| 123 | |
| 124 | ==== User |
| 125 | |
| 126 | user_id+ = {user_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, city_name, region_id, region_name} |
| 127 | |
| 128 | * Ако тип на корисник е 'customer': |
| 129 | |
| 130 | *user_id+** += {cust_EDB, cust_company_name, cust_adr, cust_representative_img} |
| 131 | |
| 132 | * Ако тип на корисник е 'manager': |
| 133 | |
| 134 | **user_id+** += {wh_id, wh_adr} |
| 135 | |
| 136 | * Ако тип на корисник е 'driver': |
| 137 | |
| 138 | **user_id+** += {veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr} |
| 139 | |
| 140 | ==== Manufacturer |
| 141 | |
| 142 | man_id+ = {man_id, man_name, man_adr, man_mobile, man_email} |
| 143 | |
| 144 | ==== Article |
| 145 | |
| 146 | art_id+ = {art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email} |
| 147 | |
| 148 | ==== Price |
| 149 | |
| 150 | price_id+ = {price_id, price, price_eff_date, art_id, art_name, art_image, art_weight, ctg_id, ctg_name, man_id, man_name, man_adr, man_mobile, man_email} |
| 151 | |
| 152 | ==== Pro-forma |
| 153 | |
| 154 | pf_id+ = {pf_id, pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc} |
| 155 | |
| 156 | ==== Delivery |
| 157 | |
| 158 | del_id+ = {del_id, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, d_status_name, d_status_desc, veh_id, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr, city_id, city_name, region_id, region_name} |
| 159 | |
| 160 | ==== Order |
| 161 | |
| 162 | ord_id+ = {ord_id, ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, cust_id, del_id, pf_id, user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, cust_EDB, cust_company_name, cust_adr, cust_representative_img, city_name, region_id, region_name, del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, veh_id, d_status_name, d_status_desc, veh_carry_weight, veh_service_interval, veh_kilometers, veh_last_service, veh_last_service_km, veh_plate, veh_vin, veh_reg_date, wh_id, wh_adr,pf_deadline, pf_date_created, pf_status_id, pf_status_name, pf_status_desc} |
| 163 | |
| 164 | ==== Article Unit |
| 165 | |
| 166 | unit_id+ = {unit_id, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, wh_adr, city_id, city_name, region_id, region_name, ord_id} |
| 167 | |
| 168 | * Ако ord_id не е null, исто така ги вклучува и: |
| 169 | unit_id+ += {ord_date, ord_sum, ord_fulfillment_date, ord_comment, o_status_id, o_status_name, o_status_desc, cust_id, del_id, pf_id, |
| 170 | |
| 171 | ''и сите атрибути одредени од ord_id'' |
| 172 | |
| 173 | } |
| 174 | |
| 175 | ==== Композитен клуч - Article Unit и Price |
| 176 | |
| 177 | (unit_id, price_id)+ = {unit_id, price_id, |
| 178 | |
| 179 | ''Сите атрибути определни од unit_id'' |
| 180 | |
| 181 | unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, wh_id, ord_id, |
| 182 | |
| 183 | ''Сите атрибути определни од price_id'' |
| 184 | |
| 185 | price, price_eff_date, art_id, |
| 186 | |
| 187 | ''Сите транзитивни атрибути'' |
| 188 | |
| 189 | wh_adr, city_id, city_name, region_id, region_name, art_name, art_image, art_weight, ctg_id, man_id, ctg_name, man_name, man_adr, man_mobile, man_email} |
| 190 | |
| 191 | ==== Weekday |
| 192 | |
| 193 | cust_day_id+ = {cust_day_id, cust_id, day_id, start_time, end_time, |
| 194 | |
| 195 | ''Од day_id:'' |
| 196 | |
| 197 | day_name, |
| 198 | |
| 199 | ''Од cust_id:'' |
| 200 | |
| 201 | user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, cust_EDB, cust_company_name, cust_adr, cust_representative_img, |
| 202 | |
| 203 | ''Од city_id:'' |
| 204 | |
| 205 | city_name, region_id, region_name} |
| 206 | |
| 207 | ==== Token |
| 208 | |
| 209 | t_id+ = {t_id, t_value, t_date, t_type, t_expiry, t_validated_at, t_user, |
| 210 | |
| 211 | ''Од t_user (кое е user_id):'' |
| 212 | |
| 213 | user_name, user_surname, user_pass, user_salt, user_email, user_mobile, user_active, user_image, clazz_, user_role, city_id, |
| 214 | |
| 215 | ''Од city_id:'' |
| 216 | |
| 217 | city_name, region_id, region_name} |
| 218 | |
| 219 | ==== Image Store |
| 220 | |
| 221 | img_id+ = {img_id, img_path, img_ent_type, img_ent_id} |
| 222 | |
| 223 | === Анализа според покривачи |
| 224 | |
| 225 | Од анализирање на покривачите може да ги забележиме следните проблеми во нормализацијата на базата: |
| 226 | |
| 227 | * Транзитивни зависности во податоците за возила: `veh_id → veh_last_service, veh_last_service_km` |
| 228 | * Недостига зависноста `(ord_id, art_id) → quantity, price` |
| 229 | * Историја на цени и вредност - `unit_id → unit_cost_price` |
| 230 | * Поврзување на слики: `img_id → img_ent_type, img_ent_id` |