|
@@ -4,6 +4,12 @@ Dicts from:
|
|
https://wiki.sharix.org/doku.php/open/tech/dev/db/slovari_bd#resource_type
|
|
https://wiki.sharix.org/doku.php/open/tech/dev/db/slovari_bd#resource_type
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
+
|
|
|
|
+def reverse_obj(obj):
|
|
|
|
+ """Меняет местами ключ и значение"""
|
|
|
|
+ return {status_code: name for name, status_code in obj.items()}
|
|
|
|
+
|
|
|
|
+
|
|
neg_type = {
|
|
neg_type = {
|
|
"disfollow": 0,
|
|
"disfollow": 0,
|
|
"prefer": 1,
|
|
"prefer": 1,
|
|
@@ -11,33 +17,36 @@ neg_type = {
|
|
"contract": 3,
|
|
"contract": 3,
|
|
"client": 4
|
|
"client": 4
|
|
}
|
|
}
|
|
|
|
+neg_type_by_code = reverse_obj(neg_type)
|
|
|
|
|
|
type_legal_form = {
|
|
type_legal_form = {
|
|
"self-employed": 0,
|
|
"self-employed": 0,
|
|
"ip": 1,
|
|
"ip": 1,
|
|
"company": 2
|
|
"company": 2
|
|
}
|
|
}
|
|
|
|
+type_legal_form_by_code = reverse_obj(type_legal_form)
|
|
|
|
|
|
# FIXME: resource_type ??
|
|
# FIXME: resource_type ??
|
|
|
|
|
|
# FIXME: permission_type ??
|
|
# FIXME: permission_type ??
|
|
permissions_type = {
|
|
permissions_type = {
|
|
-"platform_admin": "01",
|
|
|
|
-"platform_supervisor": "02",
|
|
|
|
-"platform_support": "03",
|
|
|
|
-"platform_techsupport": "04",
|
|
|
|
-"metaservice_admin": "11",
|
|
|
|
-"metaservice_supervisor": "12",
|
|
|
|
-"metaservice_support": "13",
|
|
|
|
-"metaservice_techsupport": "14",
|
|
|
|
-"partner_admin": "21",
|
|
|
|
-"partner_supervisor": "22",
|
|
|
|
-"partner_support": "23",
|
|
|
|
-"partner_techsupport": "24",
|
|
|
|
-"provider": "15",
|
|
|
|
-"platform_user": "06",
|
|
|
|
-"metaservice_user": "16",
|
|
|
|
|
|
+ "platform_admin": "01",
|
|
|
|
+ "platform_supervisor": "02",
|
|
|
|
+ "platform_support": "03",
|
|
|
|
+ "platform_techsupport": "04",
|
|
|
|
+ "metaservice_admin": "11",
|
|
|
|
+ "metaservice_supervisor": "12",
|
|
|
|
+ "metaservice_support": "13",
|
|
|
|
+ "metaservice_techsupport": "14",
|
|
|
|
+ "partner_admin": "21",
|
|
|
|
+ "partner_supervisor": "22",
|
|
|
|
+ "partner_support": "23",
|
|
|
|
+ "partner_techsupport": "24",
|
|
|
|
+ "provider": "15",
|
|
|
|
+ "platform_user": "06",
|
|
|
|
+ "metaservice_user": "16",
|
|
}
|
|
}
|
|
|
|
+permissions_type_by_code = reverse_obj(permissions_type)
|
|
|
|
|
|
initiator_type = {
|
|
initiator_type = {
|
|
"manual": 0,
|
|
"manual": 0,
|
|
@@ -46,12 +55,14 @@ initiator_type = {
|
|
"metaservice_event": 3,
|
|
"metaservice_event": 3,
|
|
"platform_event": 4
|
|
"platform_event": 4
|
|
}
|
|
}
|
|
|
|
+initiator_type_by_code = reverse_obj(initiator_type)
|
|
|
|
|
|
event_type = {
|
|
event_type = {
|
|
"add": 1,
|
|
"add": 1,
|
|
"del": 2,
|
|
"del": 2,
|
|
"change": 3
|
|
"change": 3
|
|
}
|
|
}
|
|
|
|
+event_type_by_code = reverse_obj(event_type)
|
|
|
|
|
|
status = {
|
|
status = {
|
|
"false": "f",
|
|
"false": "f",
|
|
@@ -60,6 +71,7 @@ status = {
|
|
"switch": "s",
|
|
"switch": "s",
|
|
"error": "e"
|
|
"error": "e"
|
|
}
|
|
}
|
|
|
|
+status_by_code = reverse_obj(status)
|
|
|
|
|
|
# FIXME: Requirements ???
|
|
# FIXME: Requirements ???
|
|
|
|
|
|
@@ -83,40 +95,47 @@ price_type = {
|
|
"ipd": 5,
|
|
"ipd": 5,
|
|
"ipt": 6
|
|
"ipt": 6
|
|
}
|
|
}
|
|
|
|
+price_type_by_code = reverse_obj(price_type)
|
|
|
|
|
|
location_type = {
|
|
location_type = {
|
|
"static": 0,
|
|
"static": 0,
|
|
"dynamic": 1
|
|
"dynamic": 1
|
|
}
|
|
}
|
|
|
|
+location_type_by_code = reverse_obj(location_type)
|
|
|
|
|
|
provider_type = {
|
|
provider_type = {
|
|
"partner": 1,
|
|
"partner": 1,
|
|
"responsible_person": 2,
|
|
"responsible_person": 2,
|
|
"service_provider": 3
|
|
"service_provider": 3
|
|
}
|
|
}
|
|
|
|
+provider_type_by_code = reverse_obj(provider_type)
|
|
|
|
|
|
service_status = {
|
|
service_status = {
|
|
"online": 1,
|
|
"online": 1,
|
|
"offline": 2,
|
|
"offline": 2,
|
|
"gap": 3
|
|
"gap": 3
|
|
}
|
|
}
|
|
|
|
+service_status_by_code = reverse_obj(service_status)
|
|
|
|
|
|
activity_status = {
|
|
activity_status = {
|
|
"active": 0,
|
|
"active": 0,
|
|
"deactivated": 1,
|
|
"deactivated": 1,
|
|
"deleted": 2
|
|
"deleted": 2
|
|
}
|
|
}
|
|
|
|
+activity_status_by_code = reverse_obj(activity_status)
|
|
|
|
|
|
transaction_type = {
|
|
transaction_type = {
|
|
"active": 0,
|
|
"active": 0,
|
|
"deactivated": 1
|
|
"deactivated": 1
|
|
}
|
|
}
|
|
|
|
+transaction_type_by_code = reverse_obj(transaction_type)
|
|
|
|
|
|
tax_method = {
|
|
tax_method = {
|
|
"Main": 0,
|
|
"Main": 0,
|
|
"Simple1": 1,
|
|
"Simple1": 1,
|
|
"Simple2": 2
|
|
"Simple2": 2
|
|
}
|
|
}
|
|
|
|
+tax_method_by_code = reverse_obj(tax_method)
|
|
|
|
|
|
# FIXME: STATE (статусы заказов/заявок с кодами)
|
|
# FIXME: STATE (статусы заказов/заявок с кодами)
|
|
|
|
|