Update: table design

This commit is contained in:
dx-tan 2024-01-24 14:14:33 +07:00
parent bf8742fa4b
commit 965fa8e9ca
5 changed files with 24 additions and 8 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "cope2n-ai-fi/modules/sdsvkvu"]
path = cope2n-ai-fi/modules/sdsvkvu
url = https://code.sdsdev.co.kr/SDSRV-IDP/sdsvkvu.git
[submodule "cope2n-api/fwd_api/utils/sdsvkvu"]
path = cope2n-api/fwd_api/utils/sdsvkvu
url = https://code.sdsdev.co.kr/SDSRV-IDP/sdsvkvu

View File

@ -3,24 +3,29 @@ from django.utils import timezone
from fwd_api.models.Subscription import Subscription
class Report(models.Model):
# Metadata
id = models.AutoField(primary_key=True)
report_id = models.CharField(max_length=200) # Change to request_id
local_file_name = models.CharField(max_length=200) # Change to request_id
origin_name = models.CharField(max_length=200) # Change to request_id
error_status = models.JSONField(null=True)
created_at = models.DateTimeField(default=timezone.now, db_index=True)
updated_at = models.DateTimeField(auto_now=True)
subscription = models.ForeignKey(Subscription, on_delete=models.CASCADE)
S3_uploaded = models.BooleanField(default=False)
start_at = models.DateTimeField(null=True)
end_at = models.DateTimeField(null=True)
include_for_test_sample = models.BooleanField(default=False)
status = models.CharField(null=True)
is_daily_report = models.BooleanField(default=False)
# Data
S3_uploaded = models.BooleanField(default=False)
number_request = models.IntegerField(default=0)
number_images = models.IntegerField(default=0)
number_bad_images = models.IntegerField(default=0)
average_client_time_profile = models.JSONField(default=0) # {"0.1": 100, 0.2: 200, ...}
average_OCR_time_profile = models.JSONField(default=0) # {"0.1": 98, 0.2: 202, ...}
average_OCR_time = models.FloatField(default=0) # {"0.1": 98, 0.2: 202, ...}
average_client_time = models.FloatField(default=0) # {"0.1": 98, 0.2: 202, ...}
accuracy = models.JSONField(null=True) # {"imei": {}, "purchase_date": {}, "retailer_name": {}}
average_OCR_time = models.JSONField(null=True) # {"invoice": 0.1, "imei": 0.1}
average_client_time = models.JSONField(null=True) # {"invoice": 0.1, "imei": 0.1}
imei_accuracy = models.FloatField(default=-1)
purchase_date_accuracy = models.FloatField(default=-1)
retailer_name_accuracy = models.FloatField(default=-1)
sold_to_party_accuracy = models.FloatField(default=-1)

View File

@ -21,6 +21,10 @@ class SubscriptionRequest(models.Model):
updated_at = models.DateTimeField(auto_now=True)
is_test_request = models.BooleanField(default=False)
S3_uploaded = models.BooleanField(default=False)
imei_accuracy = models.FloatField(default=-1)
purchase_date_accuracy = models.FloatField(default=-1)
retailer_name_accuracy = models.FloatField(default=-1)
sold_to_party_accuracy = models.FloatField(default=-1)
ai_inference_profile = models.JSONField(null=True)
preprocessing_time = models.FloatField(default=-1)

View File

@ -19,10 +19,13 @@ class SubscriptionRequestFile(models.Model):
request = models.ForeignKey(SubscriptionRequest, related_name="files", on_delete=models.CASCADE)
created_at = models.DateTimeField(default=timezone.now, db_index=True)
updated_at = models.DateTimeField(auto_now=True)
accuracy = models.JSONField(null=True)
is_bad_image_quality = models.BooleanField(default=False)
doc_type = models.CharField(max_length=100, default="")
index_in_request = models.IntegerField(default=0)
processing_time = models.IntegerField(default=-1) # in milisecond
reason = models.TextField(blank=True)
counter_measures = models.TextField(blank=True)
counter_measures = models.TextField(blank=True)
imei_accuracy = models.FloatField(default=-1)
purchase_date_accuracy = models.FloatField(default=-1)
retailer_name_accuracy = models.FloatField(default=-1)
sold_to_party_accuracy = models.FloatField(default=-1)

@ -0,0 +1 @@
Subproject commit b6d4fab46f7f8689dd6b050cfbff2faa6a6f3fec