add billing
This commit is contained in:
@@ -49,6 +49,7 @@ app.include_router(users.password, prefix='/users')
|
|||||||
app.include_router(orders.router, prefix='/orders')
|
app.include_router(orders.router, prefix='/orders')
|
||||||
app.include_router(orgs.add, prefix='/orgs')
|
app.include_router(orgs.add, prefix='/orgs')
|
||||||
app.include_router(orgs.admins, prefix='/orgs')
|
app.include_router(orgs.admins, prefix='/orgs')
|
||||||
|
app.include_router(orgs.billing, prefix='/orgs')
|
||||||
app.include_router(orgs.custom_pricing, prefix='/orgs')
|
app.include_router(orgs.custom_pricing, prefix='/orgs')
|
||||||
app.include_router(orgs.scheduled, prefix='/orgs')
|
app.include_router(orgs.scheduled, prefix='/orgs')
|
||||||
app.include_router(orgs.submission, prefix='/orgs')
|
app.include_router(orgs.submission, prefix='/orgs')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from .add import router as add
|
from .add import router as add
|
||||||
from .admins import router as admins
|
from .admins import router as admins
|
||||||
|
from .billing import router as billing
|
||||||
from .custom_pricing import router as custom_pricing
|
from .custom_pricing import router as custom_pricing
|
||||||
from .enrollments.scheduled import router as scheduled
|
from .enrollments.scheduled import router as scheduled
|
||||||
from .enrollments.submission import router as submission
|
from .enrollments.submission import router as submission
|
||||||
@@ -9,6 +10,7 @@ from .users.batch_jobs import router as batch_jobs
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
'add',
|
'add',
|
||||||
'admins',
|
'admins',
|
||||||
|
'billing',
|
||||||
'custom_pricing',
|
'custom_pricing',
|
||||||
'scheduled',
|
'scheduled',
|
||||||
'submission',
|
'submission',
|
||||||
|
|||||||
@@ -163,18 +163,28 @@ export default function Route({ loaderData: { data } }: Route.ComponentProps) {
|
|||||||
({ output, input_record, status }, index) =>
|
({ output, input_record, status }, index) =>
|
||||||
status === 'success' ? (
|
status === 'success' ? (
|
||||||
<li className="space-x-1" key={index}>
|
<li className="space-x-1" key={index}>
|
||||||
|
<span className=" text-green-500">
|
||||||
|
Agendado para{' '}
|
||||||
|
{new Intl.DateTimeFormat(
|
||||||
|
'pt-BR'
|
||||||
|
).format(
|
||||||
|
new Date(output.scheduled_for)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
<span>—</span>
|
||||||
<Abbr>{output.user.name}</Abbr>
|
<Abbr>{output.user.name}</Abbr>
|
||||||
<span>—</span>
|
<span>—</span>
|
||||||
<Abbr>{output.course.name}</Abbr>
|
<Abbr>{output.course.name}</Abbr>
|
||||||
</li>
|
</li>
|
||||||
) : (
|
) : (
|
||||||
<li className="space-x-1" key={index}>
|
<li className="space-x-1" key={index}>
|
||||||
|
<span className=" text-red-500">
|
||||||
|
Agendado anteriormente
|
||||||
|
</span>
|
||||||
|
<span>—</span>
|
||||||
<Abbr>{input_record.user.name}</Abbr>
|
<Abbr>{input_record.user.name}</Abbr>
|
||||||
<span>—</span>
|
<span>—</span>
|
||||||
<Abbr>{input_record.course.name}</Abbr>
|
<Abbr>{input_record.course.name}</Abbr>
|
||||||
<span className=" text-red-500 lowercase">
|
|
||||||
(Agendado anteriormente)
|
|
||||||
</span>
|
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
|||||||
*_, org_id = old_image['id'].split('#')
|
*_, org_id = old_image['id'].split('#')
|
||||||
offset_days = old_image.get('dedup_window_offset_days')
|
offset_days = old_image.get('dedup_window_offset_days')
|
||||||
billing_day = old_image.get('subscription_billing_day')
|
billing_day = old_image.get('subscription_billing_day')
|
||||||
|
created_by = old_image.get('created_by')
|
||||||
enrollment = Enrollment(
|
enrollment = Enrollment(
|
||||||
course=old_image['course'],
|
course=old_image['course'],
|
||||||
user=old_image['user'],
|
user=old_image['user'],
|
||||||
@@ -43,6 +44,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
|||||||
if billing_day
|
if billing_day
|
||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
|
created_by=created_by,
|
||||||
scheduled_at=datetime.fromisoformat(old_image['created_at']),
|
scheduled_at=datetime.fromisoformat(old_image['created_at']),
|
||||||
# Transfer the deduplication window if it exists
|
# Transfer the deduplication window if it exists
|
||||||
deduplication_window={'offset_days': offset_days} if offset_days else None,
|
deduplication_window={'offset_days': offset_days} if offset_days else None,
|
||||||
|
|||||||
Reference in New Issue
Block a user