diff --git a/docs/CAREERJET_GAP_ANALYSIS.md b/docs/CAREERJET_GAP_ANALYSIS.md index 6e5983f..782a37e 100644 --- a/docs/CAREERJET_GAP_ANALYSIS.md +++ b/docs/CAREERJET_GAP_ANALYSIS.md @@ -177,12 +177,12 @@ Mapear o que já existe no GoHorseJobs e o que ainda falta para alcançar um flu ### 3) Informações de faturamento - [x] Capturar dados fiscais (pessoa/empresa, documento, endereço de cobrança). -- [ ] Exibir plano/preço por país e duração (ex.: **US$130/30 dias** para EUA, quando aplicável). -- [ ] Validar consistência entre país da vaga e país de faturamento conforme regra de negócio. +- [x] Exibir plano/preço por país e duração (ex.: **US$130/30 dias** para EUA, quando aplicável). +- [x] Validar consistência entre país da vaga e país de faturamento conforme regra de negócio. ### 4) Pagamento -- [ ] Seleção de método de pagamento disponível no país. -- [ ] Confirmação final com resumo: vaga + faturamento + valor. +- [x] Seleção de método de pagamento disponível no país. +- [x] Confirmação final com resumo: vaga + faturamento + valor. - [ ] Geração de comprovante/registro de transação. - [ ] Definição de status da vaga pós-pagamento (`pending_review`, `active`, `failed_payment`). diff --git a/frontend/src/app/post-job/page.tsx b/frontend/src/app/post-job/page.tsx index 1f1a8ee..28a7687 100644 --- a/frontend/src/app/post-job/page.tsx +++ b/frontend/src/app/post-job/page.tsx @@ -95,6 +95,7 @@ export default function PostJobPage() { document: "", billingCountry: "", address: "", + paymentMethod: "", }); const [showPassword, setShowPassword] = useState(false); @@ -136,6 +137,17 @@ export default function PostJobPage() { const JOB_COUNTRIES = ["BR", "PT", "US", "ES", "UK", "DE", "FR", "JP"]; + const PRICING_BY_COUNTRY: Record = { + US: { amount: "US$130", duration: "30 dias" }, + BR: { amount: "R$490", duration: "30 dias" }, + PT: { amount: "€99", duration: "30 dias" }, + ES: { amount: "€99", duration: "30 dias" }, + UK: { amount: "£89", duration: "30 dias" }, + DE: { amount: "€119", duration: "30 dias" }, + FR: { amount: "€109", duration: "30 dias" }, + JP: { amount: "¥14,900", duration: "30 dias" }, + }; + const cleanCNPJ = (value: string) => value.replace(/\D/g, ""); const isValidCNPJ = (value: string) => { @@ -227,6 +239,18 @@ export default function PostJobPage() { return false; } + if (job.country && billing.billingCountry && job.country !== billing.billingCountry) { + toast.error("País da vaga e país de faturamento devem ser compatíveis."); + setStep(4); + return false; + } + + if (!billing.paymentMethod) { + toast.error("Selecione um método de pagamento."); + setStep(4); + return false; + } + return true; }; @@ -316,7 +340,7 @@ export default function PostJobPage() { employmentType: job.employmentType || null, workingHours: job.workingHours || null, workMode: job.workMode, - status: "pending", + status: "review", questions: questions.length > 0 ? questions : null, languageLevel: job.descriptionLanguage || null, requirements: { @@ -1042,9 +1066,25 @@ export default function PostJobPage() { /> -
-

Resumo: {job.title} · {job.country || "País não informado"}

-

Status após envio: pending_review

+
+ + +
+ +
+

Plano: {PRICING_BY_COUNTRY[billing.billingCountry || job.country]?.amount || "Consulte comercial"} / {PRICING_BY_COUNTRY[billing.billingCountry || job.country]?.duration || "30 dias"}

+

Resumo: {job.title} · {job.country || "País não informado"} · {billing.billingCountry || "Faturamento não informado"}

+

Pagamento: {billing.paymentMethod ? (billing.paymentMethod === "card" ? "Cartão de crédito" : billing.paymentMethod === "pix" ? "PIX" : "Boleto") : "Não selecionado"}

+

Status após envio: review