#![deny(unsafe_code)]
#![deny(missing_docs)]
#![warn(clippy::pedantic, clippy::must_use_candidate)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::doc_markdown)] #![allow(clippy::too_many_lines)] #![allow(clippy::match_same_arms)] #![allow(clippy::manual_let_else)] #![allow(clippy::redundant_closure_for_method_calls)]
#![allow(clippy::unnested_or_patterns)]
#![allow(clippy::map_unwrap_or)]
#![allow(clippy::items_after_statements)]
pub mod abrechnung;
pub mod allokationsliste;
pub mod anfrage_bestellung;
pub mod ankuendigung_zuordnung_lf;
pub mod datenabruf;
pub mod konfiguration;
pub mod konfiguration_aenderung;
pub mod lf_abmeldung;
pub mod lf_anmeldung;
pub mod messwerte;
pub mod neuanlage;
pub mod partin;
pub mod post_acceptance;
pub mod sperrung;
pub mod sperrung_lf;
pub mod stornierung;
pub mod utilts;
pub mod wechselprozesse;
pub use abrechnung::{
ABRECHNUNG_WINDOW_LABEL, AbrechnungCommand, AbrechnungData, AbrechnungEvent,
AbrechnungProjection, AbrechnungRecord, AbrechnungState, COMDIS_ABLEHNUNG_REMADV_PID,
GpkeAbrechnungWorkflow, INVOIC_PIDS, REMADV_PIDS, WORKFLOW_NAME as ABRECHNUNG_WORKFLOW_NAME,
};
pub use allokationsliste::{
AllokationslisteCommand, AllokationslisteEvent, AllokationslisteState, AnforderungData,
GpkeAllokationslisteWorkflow, MSCONS_RESPONSE_PIDS as ALLOKATIONSLISTE_MSCONS_PIDS,
ORDERS_ANFRAGE_PIDS as ALLOKATIONSLISTE_ORDERS_PIDS,
ORDRSP_ABLEHNUNG_PIDS as ALLOKATIONSLISTE_ORDRSP_PIDS,
WORKFLOW_NAME as ALLOKATIONSLISTE_WORKFLOW_NAME,
};
pub use anfrage_bestellung::{
ANFRAGE_PID as ANFRAGE_BESTELLUNG_PID, ANFRAGE_WINDOW_LABEL, AnfrageBestellungCommand,
AnfrageBestellungEvent, AnfrageBestellungState, AnfrageData, GpkeAnfrageBestellungWorkflow,
WORKFLOW_NAME as ANFRAGE_BESTELLUNG_WORKFLOW_NAME,
};
pub use ankuendigung_zuordnung_lf::{
ANKUENDIGUNG_ZUORDNUNG_APERAK_WINDOW_LABEL, ANKUENDIGUNG_ZUORDNUNG_PIDS,
AnkuendigungZuordnungLfCommand, AnkuendigungZuordnungLfData, AnkuendigungZuordnungLfEvent,
AnkuendigungZuordnungLfState, GpkeAnkuendigungZuordnungLfWorkflow,
WORKFLOW_NAME as ANKUENDIGUNG_ZUORDNUNG_LF_WORKFLOW_NAME,
};
pub use datenabruf::{
DatanabrufCommand, DatanabrufEvent, DatanabrufState, GpkeDatanabrufWorkflow,
ORDERS_ANFRAGE_PIDS as DATENABRUF_ORDERS_PIDS, ORDRSP_ABLEHNUNG_PIDS as DATENABRUF_ORDRSP_PIDS,
WORKFLOW_NAME as DATENABRUF_WORKFLOW_NAME,
};
pub use konfiguration::{
BeauftragungData, GpkeKonfigurationWorkflow, KONFIGURATION_WINDOW_LABEL, KonfigurationCommand,
KonfigurationEvent, KonfigurationProjection, KonfigurationRecord, KonfigurationState,
ORDERS_PIDS, ORDRSP_PIDS, WORKFLOW_NAME as KONFIGURATION_WORKFLOW_NAME,
};
pub use konfiguration_aenderung::{
GpkeKonfigurationAenderungWorkflow, IFTSTA_PIDS as KONFIGURATION_AENDERUNG_IFTSTA_PIDS,
KonfigurationAenderungCommand, KonfigurationAenderungEvent, KonfigurationAenderungState,
ORDERS_ANFRAGE_PIDS as KONFIGURATION_AENDERUNG_ORDERS_PIDS,
ORDRSP_PIDS as KONFIGURATION_AENDERUNG_ORDRSP_PIDS,
WORKFLOW_NAME as KONFIGURATION_AENDERUNG_WORKFLOW_NAME,
};
pub use lf_abmeldung::{
GpkeLfAbmeldungWorkflow, LF_ABMELDUNG_APERAK_WINDOW_LABEL, LF_ABMELDUNG_PIDS,
LfAbmeldungCommand, LfAbmeldungData, LfAbmeldungEvent, LfAbmeldungState,
WORKFLOW_NAME as LF_ABMELDUNG_WORKFLOW_NAME,
};
pub use lf_anmeldung::{
ANFRAGE_PIDS_LF, ANTWORT_PIDS_LF, GpkeLfAnmeldungWorkflow, LfAnmeldungCommand, LfAnmeldungData,
LfAnmeldungEvent, LfAnmeldungState, NB_RESPONSE_WINDOW_LABEL,
WORKFLOW_NAME as LF_ANMELDUNG_WORKFLOW_NAME,
};
pub use messwerte::{
GpkeMesswerteLieferungWorkflow, MSCONS_PIDS, MesswerteLieferungCommand, MesswerteLieferungData,
MesswerteLieferungEvent, MesswerteLieferungState, WORKFLOW_NAME as MESSWERTE_WORKFLOW_NAME,
};
pub use neuanlage::{
GpkeNeuanlageWorkflow, NEUANLAGE_APERAK_WINDOW_LABEL, NEUANLAGE_PIDS, NeuanlageCommand,
NeuanlageData, NeuanlageEvent, NeuanlageState, WORKFLOW_NAME as NEUANLAGE_WORKFLOW_NAME,
};
pub use partin::{
GpkePartinWorkflow, KommunikationsdatenCommand, KommunikationsdatenData,
KommunikationsdatenEvent, KommunikationsdatenState, PARTIN_STROM_PIDS,
WORKFLOW_NAME as PARTIN_WORKFLOW_NAME,
};
pub use sperrung::{
GpkeSperrungWorkflow, MSB_ANTWORT_PIDS, ORDCHG_STORNIERUNG_PIDS, SPERRUNG_PIDS,
SPERRUNG_WINDOW_LABEL, SperrungCommand, SperrungData, SperrungEvent, SperrungState,
WORKFLOW_NAME as SPERRUNG_WORKFLOW_NAME,
};
pub use sperrung_lf::{
ANTWORT_WINDOW_LABEL as SPERRUNG_LF_ANTWORT_WINDOW_LABEL, GpkeSperrungLfWorkflow,
IFTSTA_SPERRUNG_PID, ORDRSP_SPERRUNG_PIDS, ORDRSP_STORNO_PIDS,
SPERRUNG_ANFRAGE_PIDS as SPERRUNG_LF_ANFRAGE_PIDS, SperrungAuftragData, SperrungLfCommand,
SperrungLfEvent, SperrungLfState, WORKFLOW_NAME as SPERRUNG_LF_WORKFLOW_NAME,
};
pub use stornierung::{
GpkeStornierungCommand, GpkeStornierungData, GpkeStornierungEvent, GpkeStornierungState,
GpkeStornierungWorkflow,
STORNIERUNG_APERAK_WINDOW_LABEL as STORNIERUNG_GPKE_APERAK_WINDOW_LABEL,
STORNIERUNG_PIDS as STORNIERUNG_GPKE_PIDS, WORKFLOW_NAME as STORNIERUNG_GPKE_WORKFLOW_NAME,
};
pub use utilts::{
GpkeUtiltsWorkflow, UTILTS_PIDS, UtiltsKonfigCommand, UtiltsKonfigData, UtiltsKonfigEvent,
UtiltsKonfigState, WORKFLOW_NAME as UTILTS_WORKFLOW_NAME,
};
pub use wechselprozesse::{
GPKE_PROCESS_RESPONSE_LABEL, GpkeSupplierChangeWorkflow, IFTSTA_PIDS as IFTSTA_VOLLZUGS_PIDS,
InitiatedData, InitiatedDetails, SupplierChangeCommand, SupplierChangeEvent,
SupplierChangeProjection, SupplierChangeRecord, SupplierChangeState, UTILMD_PIDS,
WORKFLOW_NAME as SUPPLIER_CHANGE_WORKFLOW_NAME,
};
pub struct GpkeModule;
impl mako_engine::builder::EngineModule for GpkeModule {
fn name(&self) -> &'static str {
"gpke"
}
fn workflow_names(&self) -> &'static [&'static str] {
&[
"gpke-supplier-change",
lf_anmeldung::WORKFLOW_NAME,
sperrung::WORKFLOW_NAME,
sperrung_lf::WORKFLOW_NAME,
anfrage_bestellung::WORKFLOW_NAME,
"gpke-abrechnung",
"gpke-konfiguration",
"gpke-neuanlage",
"gpke-lf-abmeldung",
ankuendigung_zuordnung_lf::WORKFLOW_NAME,
stornierung::WORKFLOW_NAME,
messwerte::WORKFLOW_NAME,
partin::WORKFLOW_NAME,
utilts::WORKFLOW_NAME,
konfiguration_aenderung::WORKFLOW_NAME,
datenabruf::WORKFLOW_NAME,
allokationsliste::WORKFLOW_NAME,
]
}
fn register_pids_with_roles(
&self,
router: &mut mako_engine::pid_router::PidRouter,
roles: &mako_engine::marktrolle::DeploymentRoles,
) {
for &pid in UTILMD_PIDS {
router.register(pid, "gpke-supplier-change");
}
for &pid in NEUANLAGE_PIDS {
router.register(pid, "gpke-neuanlage");
}
for &pid in LF_ABMELDUNG_PIDS {
router.register(pid, "gpke-lf-abmeldung");
}
for &pid in ANKUENDIGUNG_ZUORDNUNG_PIDS {
router.register(pid, ankuendigung_zuordnung_lf::WORKFLOW_NAME);
}
for &pid in SPERRUNG_PIDS {
router.register(pid, sperrung::WORKFLOW_NAME);
}
for &pid in ORDCHG_STORNIERUNG_PIDS {
router.register(pid, sperrung::WORKFLOW_NAME);
}
for &pid in MSB_ANTWORT_PIDS {
router.register(pid, sperrung::WORKFLOW_NAME);
}
for &pid in ORDRSP_SPERRUNG_PIDS {
router.register(pid, sperrung_lf::WORKFLOW_NAME);
}
for &pid in ORDRSP_STORNO_PIDS {
router.register(pid, sperrung_lf::WORKFLOW_NAME);
}
router.register(IFTSTA_SPERRUNG_PID, sperrung_lf::WORKFLOW_NAME);
for &pid in INVOIC_PIDS {
router.register(pid, "gpke-abrechnung");
}
for &pid in REMADV_PIDS {
router.register(pid, "gpke-abrechnung");
}
router.register(COMDIS_ABLEHNUNG_REMADV_PID, "gpke-abrechnung");
if roles.contains(mako_engine::marktrolle::Marktrolle::Nb) {
for &pid in ORDRSP_PIDS {
router.register_with_module(pid, "gpke-konfiguration", "gpke");
}
}
for &pid in ANTWORT_PIDS_LF {
router.register(pid, lf_anmeldung::WORKFLOW_NAME);
}
for &pid in wechselprozesse::IFTSTA_PIDS {
router.register(pid, "gpke-supplier-change");
}
for &pid in messwerte::MSCONS_PIDS {
router.register(pid, messwerte::WORKFLOW_NAME);
}
for &pid in partin::PARTIN_STROM_PIDS {
router.register(pid, partin::WORKFLOW_NAME);
}
for &pid in utilts::UTILTS_PIDS {
router.register(pid, utilts::WORKFLOW_NAME);
}
for &pid in stornierung::STORNIERUNG_PIDS {
router.register(pid, stornierung::WORKFLOW_NAME);
}
router.register(
anfrage_bestellung::ANFRAGE_PID,
anfrage_bestellung::WORKFLOW_NAME,
);
for &pid in konfiguration_aenderung::ORDERS_ANFRAGE_PIDS {
router.register(pid, konfiguration_aenderung::WORKFLOW_NAME);
}
for &pid in konfiguration_aenderung::ORDRSP_PIDS {
router.register(pid, konfiguration_aenderung::WORKFLOW_NAME);
}
for &pid in konfiguration_aenderung::IFTSTA_PIDS {
router.register(pid, konfiguration_aenderung::WORKFLOW_NAME);
}
for &pid in datenabruf::ORDERS_ANFRAGE_PIDS {
router.register(pid, datenabruf::WORKFLOW_NAME);
}
for &pid in datenabruf::ORDRSP_ABLEHNUNG_PIDS {
router.register(pid, datenabruf::WORKFLOW_NAME);
}
for &pid in allokationsliste::ORDERS_ANFRAGE_PIDS {
router.register(pid, allokationsliste::WORKFLOW_NAME);
}
for &pid in allokationsliste::ORDRSP_ABLEHNUNG_PIDS {
router.register(pid, allokationsliste::WORKFLOW_NAME);
}
for &pid in allokationsliste::MSCONS_RESPONSE_PIDS {
router.register(pid, allokationsliste::WORKFLOW_NAME);
}
}
fn profile_requirements(&self) -> &'static [mako_engine::profile::ProfileRequirement] {
use mako_engine::profile::ProfileRequirement;
&[
ProfileRequirement {
message_type: "UTILMD",
label: "UTILMD Strom (GPKE Lieferantenwechsel)",
},
ProfileRequirement {
message_type: "INVOIC",
label: "INVOIC Abrechnung (GPKE)",
},
ProfileRequirement {
message_type: "REMADV",
label: "REMADV Zahlungsavis (GPKE 33001–33004)",
},
ProfileRequirement {
message_type: "COMDIS",
label: "COMDIS Ablehnung REMADV (GPKE 29001)",
},
ProfileRequirement {
message_type: "IFTSTA",
label: "IFTSTA Vollzugsmeldung (GPKE 21033) + Auftragsstatus Sperren (21039)",
},
ProfileRequirement {
message_type: "ORDRSP",
label: "ORDRSP Sperrung (19116/19117/19118/19119/19128/19129) + Konfiguration (19001/19002)",
},
ProfileRequirement {
message_type: "ORDCHG",
label: "ORDCHG Stornierung Sperrauftrag (39000/39001)",
},
ProfileRequirement {
message_type: "MSCONS",
label: "MSCONS Messdatenlieferung NB/MSB → LF (13015–13027)",
},
ProfileRequirement {
message_type: "PARTIN",
label: "PARTIN Kommunikationsdaten Strom (37000–37006)",
},
ProfileRequirement {
message_type: "UTILTS",
label: "UTILTS Konfigurationsdaten GPKE Teil 3 (25001, 25004–25010)",
},
ProfileRequirement {
message_type: "ORDERS",
label: "ORDERS Konfigurationsänderung/Datenabruf/Allokationsliste (17102–17133)",
},
ProfileRequirement {
message_type: "IFTSTA",
label: "IFTSTA Vollzugsmeldung/Statusmeldung (GPKE 21024-21028, 21033, 21035, 21045, 21047) + Auftragsstatus Sperren (21039) + Konfiguration (21043, 21044)",
},
]
}
fn configure(&self) -> Result<(), String> {
let named: &[(&str, &[u32])] = &[
("UTILMD_PIDS", UTILMD_PIDS),
("SPERRUNG_PIDS", SPERRUNG_PIDS),
("ORDCHG_STORNIERUNG_PIDS", ORDCHG_STORNIERUNG_PIDS),
("ORDRSP_SPERRUNG_PIDS", ORDRSP_SPERRUNG_PIDS),
("ORDRSP_STORNO_PIDS", ORDRSP_STORNO_PIDS),
("MSB_ANTWORT_PIDS", MSB_ANTWORT_PIDS),
("INVOIC_PIDS", INVOIC_PIDS),
("REMADV_PIDS", REMADV_PIDS),
("ORDRSP_PIDS", ORDRSP_PIDS),
("ANTWORT_PIDS_LF", ANTWORT_PIDS_LF),
("wechselprozesse::IFTSTA_PIDS", wechselprozesse::IFTSTA_PIDS),
("NEUANLAGE_PIDS", NEUANLAGE_PIDS),
("LF_ABMELDUNG_PIDS", LF_ABMELDUNG_PIDS),
(
"stornierung::STORNIERUNG_PIDS",
stornierung::STORNIERUNG_PIDS,
),
("messwerte::MSCONS_PIDS", messwerte::MSCONS_PIDS),
("partin::PARTIN_STROM_PIDS", partin::PARTIN_STROM_PIDS),
("utilts::UTILTS_PIDS", utilts::UTILTS_PIDS),
(
"konfiguration_aenderung::ORDERS_ANFRAGE_PIDS",
konfiguration_aenderung::ORDERS_ANFRAGE_PIDS,
),
(
"konfiguration_aenderung::ORDRSP_PIDS",
konfiguration_aenderung::ORDRSP_PIDS,
),
(
"datenabruf::ORDERS_ANFRAGE_PIDS",
datenabruf::ORDERS_ANFRAGE_PIDS,
),
(
"datenabruf::ORDRSP_ABLEHNUNG_PIDS",
datenabruf::ORDRSP_ABLEHNUNG_PIDS,
),
(
"allokationsliste::ORDERS_ANFRAGE_PIDS",
allokationsliste::ORDERS_ANFRAGE_PIDS,
),
(
"allokationsliste::ORDRSP_ABLEHNUNG_PIDS",
allokationsliste::ORDRSP_ABLEHNUNG_PIDS,
),
(
"allokationsliste::MSCONS_RESPONSE_PIDS",
allokationsliste::MSCONS_RESPONSE_PIDS,
),
(
"konfiguration_aenderung::IFTSTA_PIDS",
konfiguration_aenderung::IFTSTA_PIDS,
),
];
for (name, pids) in named {
if pids.is_empty() {
return Err(format!(
"gpke: PID slice '{name}' is empty — \
at least one PID must be registered for each workflow group",
));
}
}
if anfrage_bestellung::ANFRAGE_PID < 10_000 || anfrage_bestellung::ANFRAGE_PID > 99_999 {
return Err(format!(
"gpke: anfrage_bestellung::ANFRAGE_PID {} is outside the valid \
Prüfidentifikator range 10000–99999",
anfrage_bestellung::ANFRAGE_PID,
));
}
Ok(())
}
}