Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAP make more fields optional for project #410

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/.template.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ OIDC_REDIRECT_URI=https://localhost/api/v1/auth/callback
# SAP
SAP_WS_BASIC_AUTH_USER=notarealuser
SAP_WS_BASIC_AUTH_PASS=notarealpassword
SAP_WS_PROJECTINFO_ENDPOINT=http://127.0.0.1:3000/projectinfo
SAP_WS_ACTUALS_ENDPOINT=http://127.0.0.1:3000/actuals
SAP_WS_ENDPOINT=http://127.0.0.1:3000/projectinfo
SAP_WS_PROJECTINFO_ENDPOINT=http://127.0.0.1:9043/projectinfo
SAP_WS_ACTUALS_ENDPOINT=http://127.0.0.1:9043/actuals
SAP_WS_ENDPOINT=http://127.0.0.1:9043/projectinfo
SAP_WS_PROJECTINFO_TTL_SECONDS=300
SAP_WS_ACTUALS_TTL_SECONDS=300
FEATURE_ENABLED_SAP_ACTUALS=true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE sap_project
ALTER COLUMN project_manager_name DROP NOT NULL,
ALTER COLUMN applicant_name DROP NOT NULL;
4 changes: 2 additions & 2 deletions backend/src/components/sap/dataImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ async function insertProject(conn: DatabaseTransactionConnection, project: SAPPr
${project.createdBy},
${project.updatedAt ?? null},
${project.updatedBy ?? null},
${project.projectManagerName},
${project.applicantName},
${project.projectManagerName ?? null},
${project.applicantName ?? null},
${project.plannedStartDate ?? null},
${project.plannedEndDate ?? null},
${project.plant ?? null}
Expand Down
8 changes: 4 additions & 4 deletions shared/src/schema/sapProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const incomingSapProjectSchema = z.object({
ERNAM: z.string(),
AEDAT: isoDateString.nullish(),
AENAM: z.string().nullish(),
VERNA: z.string(),
ASTNA: z.string(),
VERNA: z.string().nullish(),
ASTNA: z.string().nullish(),
PLFAZ: isoDateString.nullish(),
PLSEZ: isoDateString.nullish(),
WERKS: z.string().nullish(),
Expand Down Expand Up @@ -148,8 +148,8 @@ export const sapProjectSchema = z.object({
createdBy: z.string(),
updatedAt: isoDateString.nullish(),
updatedBy: z.string().nullish(),
projectManagerName: z.string(),
applicantName: z.string(),
projectManagerName: z.string().nullish(),
applicantName: z.string().nullish(),
plannedStartDate: isoDateString.nullish(),
plannedEndDate: isoDateString.nullish(),
plant: z.string().nullish(),
Expand Down