juno-models 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
juno_models ADDED
@@ -0,0 +1,167 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: openapi.yaml
3
+ # timestamp: 2026-06-25T09:55:15+00:00
4
+
5
+ from __future__ import annotations
6
+
7
+ from enum import Enum
8
+ from typing import Annotated
9
+ from uuid import UUID
10
+
11
+ from pydantic import AnyUrl, AwareDatetime, BaseModel, EmailStr, Field
12
+
13
+
14
+ class Money(BaseModel):
15
+ amount: int
16
+ """
17
+ Amount in smallest currency unit (e.g. cents)
18
+ """
19
+ currency: Annotated[str, Field(examples=['USD'], pattern='^[A-Z]{3}$')]
20
+
21
+
22
+ class Address(BaseModel):
23
+ line1: str
24
+ line2: str | None = None
25
+ city: str
26
+ state: str | None = None
27
+ postal_code: str | None = None
28
+ country: Annotated[str, Field(examples=['US'], pattern='^[A-Z]{2}$')]
29
+
30
+
31
+ class ProductStatus(Enum):
32
+ active = 'active'
33
+ inactive = 'inactive'
34
+ archived = 'archived'
35
+
36
+
37
+ class Product(BaseModel):
38
+ id: UUID
39
+ name: Annotated[str, Field(max_length=255)]
40
+ description: str | None = None
41
+ price: Money
42
+ images: list[AnyUrl] | None = []
43
+ category_id: UUID | None = None
44
+ status: ProductStatus
45
+ inventory_count: Annotated[int | None, Field(ge=0)] = None
46
+ created_at: AwareDatetime
47
+ updated_at: AwareDatetime | None = None
48
+
49
+
50
+ class ProductCategory(BaseModel):
51
+ id: UUID
52
+ name: str
53
+ parent_id: UUID | None = None
54
+
55
+
56
+ class OrderStatus(Enum):
57
+ pending = 'pending'
58
+ confirmed = 'confirmed'
59
+ processing = 'processing'
60
+ shipped = 'shipped'
61
+ delivered = 'delivered'
62
+ cancelled = 'cancelled'
63
+ refunded = 'refunded'
64
+
65
+
66
+ class ProductSnapshot(BaseModel):
67
+ name: str | None = None
68
+
69
+
70
+ class OrderItem(BaseModel):
71
+ product_id: UUID
72
+ quantity: Annotated[int, Field(ge=1)]
73
+ unit_price: Money
74
+ product_snapshot: ProductSnapshot | None = None
75
+ """
76
+ Denormalized product name at time of order
77
+ """
78
+
79
+
80
+ class Order(BaseModel):
81
+ id: UUID
82
+ user_id: UUID
83
+ items: Annotated[list[OrderItem], Field(min_length=1)]
84
+ status: OrderStatus
85
+ subtotal: Money
86
+ tax: Money | None = None
87
+ shipping_cost: Money | None = None
88
+ total: Money
89
+ shipping_address: Address | None = None
90
+ notes: str | None = None
91
+ created_at: AwareDatetime
92
+ updated_at: AwareDatetime | None = None
93
+
94
+
95
+ class PaymentMethodType(Enum):
96
+ card = 'card'
97
+ apple_pay = 'apple_pay'
98
+ google_pay = 'google_pay'
99
+ bank_transfer = 'bank_transfer'
100
+
101
+
102
+ class CheckoutStatus(Enum):
103
+ open = 'open'
104
+ processing = 'processing'
105
+ completed = 'completed'
106
+ expired = 'expired'
107
+ failed = 'failed'
108
+
109
+
110
+ class CheckoutLineItem(BaseModel):
111
+ product_id: UUID
112
+ quantity: Annotated[int, Field(ge=1)]
113
+
114
+
115
+ class Checkout(BaseModel):
116
+ id: UUID
117
+ user_id: UUID
118
+ line_items: Annotated[list[CheckoutLineItem], Field(min_length=1)]
119
+ shipping_address: Address | None = None
120
+ payment_method_type: PaymentMethodType | None = None
121
+ promo_code: str | None = None
122
+ status: CheckoutStatus
123
+ order_id: UUID | None = None
124
+ """
125
+ Set when checkout completes and order is created
126
+ """
127
+ expires_at: AwareDatetime | None = None
128
+ created_at: AwareDatetime
129
+ updated_at: AwareDatetime | None = None
130
+
131
+
132
+ class UserRole(Enum):
133
+ customer = 'customer'
134
+ admin = 'admin'
135
+ vendor = 'vendor'
136
+
137
+
138
+ class User(BaseModel):
139
+ id: UUID
140
+ email: EmailStr
141
+ name: str | None = None
142
+ role: UserRole
143
+ created_at: AwareDatetime
144
+
145
+
146
+ class ErrorCode(Enum):
147
+ validation_error = 'validation_error'
148
+ not_found = 'not_found'
149
+ unauthorized = 'unauthorized'
150
+ forbidden = 'forbidden'
151
+ conflict = 'conflict'
152
+ payment_failed = 'payment_failed'
153
+ out_of_stock = 'out_of_stock'
154
+ internal_error = 'internal_error'
155
+
156
+
157
+ class ErrorDetail(BaseModel):
158
+ code: ErrorCode
159
+ message: str
160
+ field: str | None = None
161
+ """
162
+ Field path for validation errors
163
+ """
164
+
165
+
166
+ class ApiError(BaseModel):
167
+ error: ErrorDetail
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: juno-models
3
+ Version: 0.1.5
4
+ Summary: Generated Pydantic models from Juno OpenAPI contracts
5
+ Project-URL: Repository, https://github.com/momerlk/juno_contracts
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: pydantic>=2.0
8
+ Description-Content-Type: text/markdown
9
+
10
+ # juno-models
11
+
12
+ Generated Pydantic v2 models from the [Juno OpenAPI contracts](https://github.com/momerlk/juno_contracts).
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install juno-models
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```python
23
+ from juno_models import *
24
+ ```
25
+
26
+ Models are auto-generated from `openapi.yaml` — do not edit manually.
@@ -0,0 +1,4 @@
1
+ juno_models,sha256=rA-n6hwqt7iaf4aGni65GTIqceurhXVMCIvBJGBxdzc,3804
2
+ juno_models-0.1.5.dist-info/METADATA,sha256=f3qnPdbzOF8-kpYcpiuWfGAfkCE561UlLVrpsXhr9EY,579
3
+ juno_models-0.1.5.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
4
+ juno_models-0.1.5.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any