@burdenoff/microfe-healthybowl 2026.810.13 → 2026.810.14
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.
- package/dist/healthybowl/hooks/useBreedingOutcomes.js +34 -0
- package/dist/healthybowl/hooks/useBreedingOutcomes.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useInvoicePdf.js +52 -0
- package/dist/healthybowl/hooks/useInvoicePdf.js.map +1 -0
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +272 -275
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +318 -230
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useHealthyBowl as e } from "../context/HealthyBowlContext.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { gql as n } from "@apollo/client";
|
|
4
|
+
import { useQuery as r } from "@apollo/client/react";
|
|
5
|
+
//#region src/healthybowl/hooks/useBreedingOutcomes.ts
|
|
6
|
+
var i = n`
|
|
7
|
+
query HealthyBowlBreedingOutcomes($context: ContextInput!) {
|
|
8
|
+
getHealthyBowlLivestockData(context: $context) {
|
|
9
|
+
breedingRecords {
|
|
10
|
+
${"\n id\n notes\n deliveredOn\n offspringBorn\n offspringLive\n expectedDeliveryDate\n"}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
function a() {
|
|
16
|
+
let { workspaceId: n } = e(), { data: a, refetch: o } = r(i, {
|
|
17
|
+
variables: { context: { workspaceId: n } },
|
|
18
|
+
skip: !n,
|
|
19
|
+
fetchPolicy: "cache-and-network",
|
|
20
|
+
errorPolicy: "all",
|
|
21
|
+
notifyOnNetworkStatusChange: !0
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
outcomes: t(() => {
|
|
25
|
+
let e = a?.getHealthyBowlLivestockData?.breedingRecords ?? [];
|
|
26
|
+
return Object.fromEntries(e.map((e) => [e.id, e]));
|
|
27
|
+
}, [a]),
|
|
28
|
+
refetchOutcomes: o
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as useBreedingOutcomes };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=useBreedingOutcomes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreedingOutcomes.js","names":[],"sources":["../../../src/healthybowl/hooks/useBreedingOutcomes.ts"],"sourcesContent":["/**\n * The parts of a breeding record the product used to throw away (BOFF-6034).\n *\n * `notes` was writable and never readable, `DELIVERED` carried only a *predicted* due date and no\n * observed birth date, and `offspring` had been a dead column since February — present in Prisma,\n * absent from the SDL, so nothing could write it and nothing could read it. A farmer could not\n * record that a goat had triplets, in a livestock product.\n *\n * These fields post-date the checked-in SDL snapshot, so — mirroring `useOrderPayments` and\n * `useHealthyBowlInputsInsurance` — they are selected by a hand-written `gql` document executed\n * directly against the live gateway rather than added to `src/operations/*.graphql`, which codegen\n * validates against a snapshot that cannot know them yet.\n *\n * The read is best-effort (`errorPolicy: 'all'`): the breeding list itself comes from\n * `useHealthyBowlData`, so if this read fails the page still renders — it just can't show the\n * outcome columns. That matters while the subgraph rolls out.\n * @module healthybowl\n */\nimport { useMemo } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\n/** What a breeding record records about the birth itself. */\nexport interface BreedingOutcome {\n id: string;\n /** The farmer's own note — the most culling-relevant sentence they will write about an animal. */\n notes?: string | null;\n /** The OBSERVED delivery date. Null until a birth is actually recorded. */\n deliveredOn?: string | null;\n offspringBorn?: number | null;\n /** born - live is perinatal mortality: a stillbirth that was never an Animal row. */\n offspringLive?: number | null;\n /** The PREDICTED date, re-read here so both dates come from one place. */\n expectedDeliveryDate?: string | null;\n}\n\nconst BREEDING_OUTCOME_FIELDS = `\n id\n notes\n deliveredOn\n offspringBorn\n offspringLive\n expectedDeliveryDate\n`;\n\nconst BREEDING_OUTCOMES_QUERY = gql`\n query HealthyBowlBreedingOutcomes($context: ContextInput!) {\n getHealthyBowlLivestockData(context: $context) {\n breedingRecords {\n ${BREEDING_OUTCOME_FIELDS}\n }\n }\n }\n`;\n\ninterface BreedingOutcomesData {\n getHealthyBowlLivestockData: { breedingRecords: BreedingOutcome[] } | null;\n}\n\n/** Breeding outcome detail keyed by record id, plus a refetch for after a write. */\nexport function useBreedingOutcomes() {\n const { workspaceId } = useHealthyBowl();\n\n const { data, refetch } = useQuery<BreedingOutcomesData>(BREEDING_OUTCOMES_QUERY, {\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n notifyOnNetworkStatusChange: true,\n });\n\n const outcomes = useMemo<Record<string, BreedingOutcome>>(() => {\n const records = data?.getHealthyBowlLivestockData?.breedingRecords ?? [];\n return Object.fromEntries(records.map((r) => [r.id, r]));\n }, [data]);\n\n return { outcomes, refetchOutcomes: refetch };\n}\n"],"mappings":";;;;;AA8CA,IAAM,IAA0B,CAAG;;;;UATH,6FAaE;;;;;AAWlC,SAAgB,IAAsB;CACpC,IAAM,EAAE,mBAAgB,GAAgB,EAElC,EAAE,SAAM,eAAY,EAA+B,GAAyB;EAChF,WAAW,EAAE,SAAS,EAAE,gBAAa,EAAE;EACvC,MAAM,CAAC;EACP,aAAa;EACb,aAAa;EACb,6BAA6B;EAC9B,CAAC;AAOF,QAAO;EAAE,UALQ,QAA+C;GAC9D,IAAM,IAAU,GAAM,6BAA6B,mBAAmB,EAAE;AACxE,UAAO,OAAO,YAAY,EAAQ,KAAK,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;KACvD,CAAC,EAAK,CAAC;EAES,iBAAiB;EAAS"}
|