Completed
Push — main ( 8b0189...d431d8 )
by Jochen
03:33
created

byceps.services.consent.models.brand_requirement   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 26
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A BrandRequirement.__init__() 0 3 1
1
"""
2
byceps.services.consent.models.brand_requirement
3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5
:Copyright: 2006-2020 Jochen Kupperschmidt
6
:License: Modified BSD, see LICENSE for details.
7
"""
8
9 1
from ....database import db
10 1
from ....typing import BrandID
11
12 1
from ..transfer.models import SubjectID
13
14
15 1
class BrandRequirement(db.Model):
16
    """A consent requirement for a brand."""
17
18 1
    __tablename__ = 'consent_brand_requirements'
19
20 1
    brand_id = db.Column(db.UnicodeText, db.ForeignKey('brands.id'), primary_key=True)
21 1
    subject_id = db.Column(db.Uuid, db.ForeignKey('consent_subjects.id'), primary_key=True)
22
23 1
    def __init__(self, brand_id: BrandID, subject_id: SubjectID) -> None:
24 1
        self.brand_id = brand_id
25
        self.subject_id = subject_id
26