Coverage for polar/customer_portal/schemas/organization.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 16:17 +0000

1from pydantic import Field 1a

2 

3from polar.benefit.schemas import BenefitPublic 1a

4from polar.file.schemas import ProductMediaFileRead 1a

5from polar.kit.schemas import Schema 1a

6from polar.organization.schemas import ( 1a

7 OrganizationPublicBase, 

8) 

9from polar.product.schemas import ProductBase, ProductPrice 1a

10 

11 

12class CustomerProduct(ProductBase): 1a

13 """Schema of a product for customer portal.""" 

14 

15 prices: list[ProductPrice] = Field( 1a

16 description="List of available prices for this product." 

17 ) 

18 benefits: list[BenefitPublic] = Field( 1a

19 title="BenefitPublic", description="The benefits granted by the product." 

20 ) 

21 medias: list[ProductMediaFileRead] = Field( 1a

22 description="The medias associated to the product." 

23 ) 

24 

25 

26class CustomerOrganization(OrganizationPublicBase): ... 1a

27 

28 

29class CustomerOrganizationData(Schema): 1a

30 """Schema of an organization and related data for customer portal.""" 

31 

32 organization: CustomerOrganization 1a

33 products: list[CustomerProduct] 1a