add link to bank slip
This commit is contained in:
@@ -180,8 +180,6 @@ export default function Route({ loaderData: { order } }: Route.ComponentProps) {
|
|||||||
reset()
|
reset()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
console.log(order)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-2.5">
|
<div className="space-y-2.5">
|
||||||
<Breadcrumb>
|
<Breadcrumb>
|
||||||
@@ -342,14 +340,29 @@ type PaymentMethodProps = {
|
|||||||
|
|
||||||
type BankSlipPaymentMethodProps = PaymentMethodProps & {}
|
type BankSlipPaymentMethodProps = PaymentMethodProps & {}
|
||||||
|
|
||||||
function BankSlipPaymentMethod({ status }: BankSlipPaymentMethodProps) {
|
function BankSlipPaymentMethod({
|
||||||
|
status,
|
||||||
|
invoice
|
||||||
|
}: BankSlipPaymentMethodProps) {
|
||||||
return (
|
return (
|
||||||
|
<div className="space-y-2">
|
||||||
<ul className="flex gap-x-1.5">
|
<ul className="flex gap-x-1.5">
|
||||||
<li>Boleto bancário</li>
|
<li>Boleto bancário</li>
|
||||||
<li>
|
<li>
|
||||||
<Status status={status} />
|
<Status status={status} />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
{invoice?.bank_slip ? (
|
||||||
|
<>
|
||||||
|
<Button variant="link" asChild>
|
||||||
|
<a href={invoice.bank_slip.bank_slip_pdf_url} target="_blank">
|
||||||
|
Abrir o boleto bancário
|
||||||
|
</a>
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { type ColumnDef } from '@tanstack/react-table'
|
import { type ColumnDef } from '@tanstack/react-table'
|
||||||
|
import { EllipsisIcon, ReceiptTextIcon } from 'lucide-react'
|
||||||
|
import { NavLink } from 'react-router'
|
||||||
|
|
||||||
// import {
|
import { Button } from '@repo/ui/components/ui/button'
|
||||||
// DataTableColumnHeaderSelect,
|
import {
|
||||||
// DataTableColumnSelect
|
DropdownMenu,
|
||||||
// } from '@repo/ui/components/data-table'
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuTrigger
|
||||||
|
} from '@repo/ui/components/ui/dropdown-menu'
|
||||||
|
import { Spinner } from '@repo/ui/components/ui/spinner'
|
||||||
import { columns as columns_, type Order } from '@repo/ui/routes/orders/columns'
|
import { columns as columns_, type Order } from '@repo/ui/routes/orders/columns'
|
||||||
|
|
||||||
export type { Order }
|
export type { Order }
|
||||||
@@ -17,5 +23,41 @@ export const columns: ColumnDef<Order>[] = [
|
|||||||
// cell: DataTableColumnSelect,
|
// cell: DataTableColumnSelect,
|
||||||
// meta: { className: 'w-9' }
|
// meta: { className: 'w-9' }
|
||||||
// },
|
// },
|
||||||
...columns_
|
...columns_,
|
||||||
|
{
|
||||||
|
id: 'action',
|
||||||
|
cell: ActionMenu,
|
||||||
|
meta: { className: 'w-12' }
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
function ActionMenu({ row }: { row: any }) {
|
||||||
|
return (
|
||||||
|
<div className="flex justify-end items-center">
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
className="data-[state=open]:bg-muted text-muted-foreground cursor-pointer"
|
||||||
|
size="icon-sm"
|
||||||
|
>
|
||||||
|
<EllipsisIcon />
|
||||||
|
<span className="sr-only">Abrir menu</span>
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent align="end" className="w-36 *:cursor-pointer">
|
||||||
|
<DropdownMenuItem asChild onSelect={(e) => e.preventDefault()}>
|
||||||
|
<NavLink to={`${row.id}`}>
|
||||||
|
{({ isPending }) => (
|
||||||
|
<>
|
||||||
|
{isPending ? <Spinner /> : <ReceiptTextIcon />}
|
||||||
|
Detalhes
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</NavLink>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,8 +2,15 @@
|
|||||||
|
|
||||||
import { type ColumnDef } from '@tanstack/react-table'
|
import { type ColumnDef } from '@tanstack/react-table'
|
||||||
import { EllipsisIcon, ReceiptTextIcon } from 'lucide-react'
|
import { EllipsisIcon, ReceiptTextIcon } from 'lucide-react'
|
||||||
|
import { NavLink } from 'react-router'
|
||||||
|
|
||||||
import { Abbr } from '@repo/ui/components/abbr'
|
import { Abbr } from '@repo/ui/components/abbr'
|
||||||
|
import {
|
||||||
|
DataTableColumnCpfCnpj,
|
||||||
|
DataTableColumnHeaderSelect,
|
||||||
|
DataTableColumnSelect
|
||||||
|
} from '@repo/ui/components/data-table'
|
||||||
|
import { Avatar, AvatarFallback } from '@repo/ui/components/ui/avatar'
|
||||||
import { Button } from '@repo/ui/components/ui/button'
|
import { Button } from '@repo/ui/components/ui/button'
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@@ -12,18 +19,11 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger
|
DropdownMenuTrigger
|
||||||
} from '@repo/ui/components/ui/dropdown-menu'
|
} from '@repo/ui/components/ui/dropdown-menu'
|
||||||
import { Avatar, AvatarFallback } from '@repo/ui/components/ui/avatar'
|
|
||||||
import { initials } from '@repo/ui/lib/utils'
|
import { initials } from '@repo/ui/lib/utils'
|
||||||
import {
|
|
||||||
DataTableColumnCpfCnpj,
|
|
||||||
DataTableColumnHeaderSelect,
|
|
||||||
DataTableColumnSelect
|
|
||||||
} from '@repo/ui/components/data-table'
|
|
||||||
import { columns as columns_, type Order } from '@repo/ui/routes/orders/columns'
|
import { columns as columns_, type Order } from '@repo/ui/routes/orders/columns'
|
||||||
|
|
||||||
import { CopyToClipboardItem } from '../_app.users._index/columns'
|
|
||||||
import { Spinner } from '@repo/ui/components/ui/spinner'
|
import { Spinner } from '@repo/ui/components/ui/spinner'
|
||||||
import { NavLink } from 'react-router'
|
import { CopyToClipboardItem } from '../_app.users._index/columns'
|
||||||
|
|
||||||
export type { Order }
|
export type { Order }
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
|||||||
if cert.get('exp_interval', 0) > 0
|
if cert.get('exp_interval', 0) > 0
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
s3_uri = _generate_cert(
|
s3_uri = _upload_cert(
|
||||||
enrollment_id,
|
enrollment_id,
|
||||||
cert=cert,
|
cert=cert,
|
||||||
user=new_image['user'],
|
user=new_image['user'],
|
||||||
@@ -116,7 +116,7 @@ User = TypedDict('User', {'name': str, 'cpf': str})
|
|||||||
Cert = TypedDict('Cert', {'s3_uri': NotRequired[str]})
|
Cert = TypedDict('Cert', {'s3_uri': NotRequired[str]})
|
||||||
|
|
||||||
|
|
||||||
def _generate_cert(
|
def _upload_cert(
|
||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
score: int | float,
|
score: int | float,
|
||||||
@@ -167,6 +167,9 @@ def _generate_cert(
|
|||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f'PDF uploaded successfully to {s3_uri}')
|
logger.info(f'PDF uploaded successfully to {s3_uri}')
|
||||||
|
except requests.exceptions.Timeout:
|
||||||
|
logger.info('The request timed out')
|
||||||
|
raise
|
||||||
except requests.exceptions.RequestException as exc:
|
except requests.exceptions.RequestException as exc:
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -220,7 +220,9 @@ def set_status_as_canceled(
|
|||||||
item={
|
item={
|
||||||
'id': id,
|
'id': id,
|
||||||
'sk': 'CANCELED',
|
'sk': 'CANCELED',
|
||||||
'canceled_by': created_by,
|
# 'canceled_by': created_by,
|
||||||
|
'user_id': created_by['id'],
|
||||||
|
'name': created_by['name'],
|
||||||
'created_at': now_,
|
'created_at': now_,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Globals:
|
|||||||
Architectures:
|
Architectures:
|
||||||
- x86_64
|
- x86_64
|
||||||
Layers:
|
Layers:
|
||||||
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:96
|
- !Sub arn:aws:lambda:sa-east-1:336641857101:layer:layercake:104
|
||||||
Environment:
|
Environment:
|
||||||
Variables:
|
Variables:
|
||||||
TZ: America/Sao_Paulo
|
TZ: America/Sao_Paulo
|
||||||
@@ -40,9 +40,9 @@ Globals:
|
|||||||
COURSE_TABLE: !Ref CourseTable
|
COURSE_TABLE: !Ref CourseTable
|
||||||
BUCKET_NAME: !Ref BucketName
|
BUCKET_NAME: !Ref BucketName
|
||||||
KONVIVA_API_URL: https://lms.saladeaula.digital
|
KONVIVA_API_URL: https://lms.saladeaula.digital
|
||||||
KONVIVA_SECRET_KEY: "{{resolve:ssm:/betaeducacao/konviva/secret_key/str}}"
|
KONVIVA_SECRET_KEY: '{{resolve:ssm:/betaeducacao/konviva/secret_key/str}}'
|
||||||
MEILISEARCH_HOST: https://meili.saladeaula.digital
|
MEILISEARCH_HOST: https://meili.saladeaula.digital
|
||||||
MEILISEARCH_API_KEY: "{{resolve:ssm:/saladeaula/meili_api_key}}"
|
MEILISEARCH_API_KEY: '{{resolve:ssm:/saladeaula/meili_api_key}}'
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
HttpLog:
|
HttpLog:
|
||||||
@@ -54,7 +54,7 @@ Resources:
|
|||||||
Type: AWS::Serverless::HttpApi
|
Type: AWS::Serverless::HttpApi
|
||||||
Properties:
|
Properties:
|
||||||
CorsConfiguration:
|
CorsConfiguration:
|
||||||
AllowOrigins: ["*"]
|
AllowOrigins: ['*']
|
||||||
AllowMethods: [GET, POST, PUT, DELETE, PATCH, OPTIONS]
|
AllowMethods: [GET, POST, PUT, DELETE, PATCH, OPTIONS]
|
||||||
AllowHeaders: [Content-Type, X-Requested-With, Authorization, X-Tenant]
|
AllowHeaders: [Content-Type, X-Requested-With, Authorization, X-Tenant]
|
||||||
AllowCredentials: false
|
AllowCredentials: false
|
||||||
@@ -64,7 +64,7 @@ Resources:
|
|||||||
Authorizers:
|
Authorizers:
|
||||||
LambdaRequestAuthorizer:
|
LambdaRequestAuthorizer:
|
||||||
FunctionArn: !GetAtt AuthFunction.Arn
|
FunctionArn: !GetAtt AuthFunction.Arn
|
||||||
AuthorizerPayloadFormatVersion: "2.0"
|
AuthorizerPayloadFormatVersion: '2.0'
|
||||||
EnableFunctionDefaultPermissions: true
|
EnableFunctionDefaultPermissions: true
|
||||||
EnableSimpleResponses: true
|
EnableSimpleResponses: true
|
||||||
Identity:
|
Identity:
|
||||||
|
|||||||
Reference in New Issue
Block a user