Skip to content

Commit

Permalink
Merge branch 'spiderface' of github.com:Enterprise-CMCS/macpro-mako i…
Browse files Browse the repository at this point in the history
…nto spiderface
  • Loading branch information
mdial89f committed Aug 29, 2024
2 parents 41a6535 + 4e7a16f commit 859018c
Show file tree
Hide file tree
Showing 14 changed files with 431 additions and 819 deletions.
72 changes: 72 additions & 0 deletions lib/packages/shared-types/events/contracting-waivers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { z } from "zod";
import {
attachmentArraySchema,
attachmentArraySchemaOptional,
} from "../attachments";

const baseContractingWaiverSchema = z.object({
// zAmendmentWaiverNumberSchema
id: z.string(),
proposedEffectiveDate: z.date(),
attachments: z.object({
b4WaiverApplication: z.object({
label: z
.string()
.default(
"1915(b)(4) FFS Selective Contracting (Streamlined) Waiver Application Pre-print",
),
files: attachmentArraySchema(),
}),
tribalConsultation: z.object({
label: z.string().default("Tribal Consultation"),
files: attachmentArraySchemaOptional(),
}),
other: z.object({
label: z.string().default("Other"),
files: attachmentArraySchemaOptional(),
}),
}),
additionalInformation: z.string().max(4000).nullable().default(null),
});

export const amendmentFeSchema = baseContractingWaiverSchema.extend({
// zAmendmentOriginalWaiverNumberSchema
waiverNumber: z.number(),
seaActionType: z.string().default("Amend"),
});

export const renewalFeSchema = baseContractingWaiverSchema.extend({
// zAmendmentOriginalWaiverNumberSchema
waiverNumber: z.number(),
seaActionType: z.string().default("Renew"),
attachments: z.object({
b4WaiverApplication: z.object({
label: z
.string()
.default(
"1915(b)(4) FFS Selective Contracting (Streamlined) Waiver Application Pre-print",
),
files: attachmentArraySchema(),
}),
b4IndependentAssessment: z.object({
label: z
.string()
.default(
"1915(b)(4) FFS Selective Contracting (Streamlined) Independent Assessment (first two renewals only)",
),
files: attachmentArraySchemaOptional(),
}),
tribalConsultation: z.object({
label: z.string().default("Tribal Consultation"),
files: attachmentArraySchemaOptional(),
}),
other: z.object({
label: z.string().default("Other"),
files: attachmentArraySchemaOptional(),
}),
}),
});

export const initialFeSchema = baseContractingWaiverSchema.extend({
seaActionType: z.string().default("New"),
});
3 changes: 2 additions & 1 deletion lib/packages/shared-types/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ export * from "./respond-to-rai";
export * from "./withdraw-rai";
export * from "./withdraw-package";
export * as newChipSubmission from "./new-chip-submission";
export * as capitatedWaivers from "./capitated-waivers";
export * as contractingWaivers from "./contracting-waivers";
export * from "./legacy-event";
export * from "./legacy-package-view";
export * from "./legacy-admin-change";
export * from "./seatool";
export * from "./remove-appk-child";
export * from "./update-id";
export * from "./complete-intake";
export * as capitatedWaivers from "./capitated-waivers";

export const events: Record<string, any> = {};

Expand Down
1 change: 1 addition & 0 deletions react-app/src/features/forms/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./new-submission";
export * as CapitatedWaivers from "./waiver/capitated";
export * as ContractingWaivers from "./waiver/contracting";
121 changes: 121 additions & 0 deletions react-app/src/features/forms/waiver/contracting/Amendment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import {
ActionForm,
DatePicker,
FAQ_TAB,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
Input,
RequiredIndicator,
} from "@/components";
import { Link } from "react-router-dom";
import { contractingWaivers } from "shared-types";

export const AmendmentForm = () => {
return (
<ActionForm
schema={contractingWaivers.amendmentFeSchema}
title="1915(b) Waiver Amendment Request Details"
fields={({ control }) => (
<>
<div className="flex flex-col">
<FormLabel className="font-semibold" htmlFor="1975b">
Waiver Authority
</FormLabel>
<span className="text-lg font-thin" id="1975b">
1915(b)
</span>
</div>
<FormField
control={control}
name="waiverNumber"
render={({ field }) => (
<FormItem>
<FormLabel className="font-semibold">
Existing Waiver Number to Amend <RequiredIndicator />
</FormLabel>
<p className="text-gray-500 font-light">
Enter the existing waiver number you are seeking to amend in
the format it was approved, using a dash after the two
character state abbreviation.
</p>
<FormControl className="max-w-sm">
<Input
ref={field.ref}
value={field.value}
onChange={(e) =>
field.onChange(e.currentTarget.value.toUpperCase())
}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="id"
render={({ field }) => (
<FormItem>
<div className="flex gap-4">
<FormLabel className="font-semibold">
1915(b) Waiver Amendment Number <RequiredIndicator />
</FormLabel>
<Link
to="/faq/waiver-amendment-id-format"
target={FAQ_TAB}
rel="noopener noreferrer"
className="text-blue-900 underline"
>
What is my 1915(b) Waiver Amendment Number?
</Link>
</div>
<p className="text-gray-500 font-light">
The Waiver Number must be in the format of SS-####.R##.## or
SS-#####.R##.##. For amendments, the last two digits start
with {"'01'"} and ascends.
</p>
<FormControl className="max-w-sm">
<Input
ref={field.ref}
value={field.value}
onChange={(e) =>
field.onChange(e.currentTarget.value.toUpperCase())
}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="proposedEffectiveDate"
render={({ field }) => (
<FormItem className="max-w-lg">
<FormLabel className="text-lg font-semibold block">
Proposed Effective Date of 1915(b) Waiver Amendment{" "}
<RequiredIndicator />
</FormLabel>
<FormControl className="max-w-sm">
<DatePicker onChange={field.onChange} date={field.value} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</>
)}
attachments={{
faqLink: "/faq/waiverb-attachments",
}}
defaultValues={{ id: "" }}
documentPollerArgs={{
property: "id",
documentChecker: (checks) => checks.actionIs("Amend"),
}}
/>
);
};
97 changes: 97 additions & 0 deletions react-app/src/features/forms/waiver/contracting/Initial.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import {
ActionForm,
DatePicker,
FAQ_TAB,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
Input,
RequiredIndicator,
} from "@/components";
import { Link } from "react-router-dom";
import { contractingWaivers } from "shared-types";

export const InitialForm = () => {
return (
<ActionForm
schema={contractingWaivers.initialFeSchema}
title="1915(b) Comprehensive (Capitated) Renewal Waiver"
fields={({ control }) => (
<>
<div className="flex flex-col">
<FormLabel className="font-semibold" htmlFor="1975b">
Waiver Authority
</FormLabel>
<span className="text-lg font-thin" id="1975b">
1915(b)
</span>
</div>
<FormField
control={control}
name="id"
render={({ field }) => (
<FormItem>
<div className="flex gap-4">
<FormLabel className="text-lg font-semibold mr-1">
Initial Waiver Number <RequiredIndicator />
</FormLabel>
<Link
to={"/faq/initial-waiver-id-format"}
target={FAQ_TAB}
rel="noopener noreferrer"
className="text-blue-900 underline"
>
What is my Initial Waiver Number?
</Link>
</div>
<p
className="text-gray-500 font-light"
id="waiver-number-format"
>
Must be a new initial number with the format SS-####.R00.00 or
SS-#####.R00.00
</p>
<FormControl className="max-w-sm">
<Input
ref={field.ref}
value={field.value}
onChange={(e) =>
field.onChange(e.currentTarget.value.toUpperCase())
}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={control}
name="proposedEffectiveDate"
render={({ field }) => (
<FormItem className="max-w-lg">
<FormLabel className="text-lg font-semibold block">
Proposed Effective Date of 1915(b) Initial Waiver{" "}
<RequiredIndicator />
</FormLabel>
<FormControl className="max-w-sm">
<DatePicker onChange={field.onChange} date={field.value} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</>
)}
attachments={{
faqLink: "/faq/waiverb-attachments",
}}
defaultValues={{ id: "" }}
documentPollerArgs={{
property: "id",
documentChecker: (checks) => checks.actionIs("New"),
}}
/>
);
};
Loading

0 comments on commit 859018c

Please sign in to comment.