mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
Updated the Provider stats and rates DAO objects to query based on the identifier in the ProviderDetails object.
- updated all tests - changed teardown to leave provider details rows on end of individual tests
This commit is contained in:
@@ -193,13 +193,16 @@ PROVIDERS = SMS_PROVIDERS + EMAIL_PROVIDERS
|
||||
|
||||
NOTIFICATION_TYPE = ['email', 'sms', 'letter']
|
||||
|
||||
|
||||
class ProviderStatistics(db.Model):
|
||||
__tablename__ = 'provider_statistics'
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
day = db.Column(db.Date, nullable=False)
|
||||
provider_id = db.Column(UUID(as_uuid=True), db.ForeignKey('provider_details.id'), index=True, nullable=False)
|
||||
provider_stats_to_provider = db.relationship('ProviderDetails', backref=db.backref('provider_stats', lazy='dynamic'))
|
||||
provider_stats_to_provider = db.relationship(
|
||||
'ProviderDetails', backref=db.backref('provider_stats', lazy='dynamic')
|
||||
)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False)
|
||||
service = db.relationship('Service', backref=db.backref('service_provider_stats', lazy='dynamic'))
|
||||
unit_count = db.Column(db.BigInteger, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user