Skip to content

Publish bills: Save meta, set bill ID, etc.#16

Merged
ch1ll0ut1 merged 44 commits into
developfrom
add/publish-bills-2025b
Jun 13, 2025
Merged

Publish bills: Save meta, set bill ID, etc.#16
ch1ll0ut1 merged 44 commits into
developfrom
add/publish-bills-2025b

Conversation

@gudmdharalds
Copy link
Copy Markdown
Contributor

No description provided.

@gudmdharalds gudmdharalds self-assigned this May 19, 2025
@gudmdharalds gudmdharalds marked this pull request as draft May 19, 2025 16:47
await writeFile(`./tmp/bill-${originalDocument.billId}.xml`, billXml);
console.log('Bill XML exported to', `./tmp/bill-${originalDocument.billId}.xml`);

await postBillForValidation(billXml);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this as I'm not sure this is strictly needed. The same action is now performed when a bill is published. We can keep this if needed though. Just let me know.


return xmlFormat(`
<bill>
<lagasafnID>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lagasafnID and related fields should be defined here, as the bill is being created in the lagasafn API.


export const exportBillXml = (billTitle: string, billDocuments: BillDocument[]): string => {
const documents = billDocuments.map(document => parseDocument(document));
export const exportBillMetaXml = (billPublicID: number, billTitle: string, billDescription: string): string => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exports bill meta XML, which is sent to lagasafn API when creating/updating a bill.

title: string;
}

export const exportBillXml = (billTitle: string, billDocuments: BillDocument[]): string => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip exporting billTitle - this is now done via the bill meta XML function.

lagasafnID: number;
title: string;
description: string;
documents?: any;
Copy link
Copy Markdown
Contributor Author

@gudmdharalds gudmdharalds May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lagasafnID refers to public bill ID, description describes the bill's purpose/aim. Both are consumed by the new lagasafn API bill meta XML endpoint.

)}
{display === 'xml' && (
<CodeBlock
text={exportBillXml(bill.title, documents)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title is no longer exported, see here.

};

export const postBillForPublishing = async (billXml: string) => {
export const postBillForPublishing = async (billNr: number, billXml: string) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lagasafn API now expects bill number in the URL.

@gudmdharalds gudmdharalds marked this pull request as ready for review May 21, 2025 15:47
Base automatically changed from add/publish-bills-2025a to develop May 27, 2025 10:21
@ch1ll0ut1 ch1ll0ut1 merged commit a5aa5a0 into develop Jun 13, 2025
1 check passed
@ch1ll0ut1 ch1ll0ut1 deleted the add/publish-bills-2025b branch June 13, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants