Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldisaro committed Oct 3, 2024
1 parent ce79d3c commit c710b39
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 98 deletions.
43 changes: 0 additions & 43 deletions apps/card-func/utils/activity.ts

This file was deleted.

9 changes: 7 additions & 2 deletions apps/card-func/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import * as O from "fp-ts/lib/Option";
import { pipe } from "fp-ts/lib/function";
import { Context } from "@azure/functions";
import { trackException } from "./appinsights";
import { ActivityResultFailure } from "./activity";

export const GenericFailure = t.interface({
kind: t.literal("FAILURE"),
reason: t.string
});
export type GenericFailure = t.TypeOf<typeof GenericFailure>;

export const TransientFailure = t.interface({
kind: t.literal("TRANSIENT"),
Expand Down Expand Up @@ -54,7 +59,7 @@ export const toPermanentFailure = (

export const trackFailure = (context: Context, logPrefix: string) => (
err: Failure
): ActivityResultFailure => {
): GenericFailure => {
const error = TransientFailure.is(err)
? `${logPrefix}|TRANSIENT_ERROR=${err.reason}`
: `${logPrefix}|FATAL|PERMANENT_ERROR=${err.reason}`;
Expand Down
5 changes: 2 additions & 3 deletions apps/card-func/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { FiscalCode, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { QueueService } from "azure-storage";
import { pipe } from "fp-ts/lib/function";
import * as TE from "fp-ts/lib/TaskEither";
import { ContinueEycaActivationInput } from "../ContinueEycaActivation/handler";
import { UserCgn, UserCgnModel } from "../models/user_cgn";
import { UserEycaCard, UserEycaCardModel } from "../models/user_eyca_card";

Expand Down Expand Up @@ -54,13 +53,13 @@ export const getEnqueueEycaActivation = (
queueService: QueueService,
queueName: NonEmptyString
): ((
input: ContinueEycaActivationInput
input: Record<string,string>
) => TE.TaskEither<Error, QueueService.QueueMessageResult>) => {
const createMessage = TE.taskify(
queueService.createMessage.bind(queueService)
);
return (
input: ContinueEycaActivationInput
input: Record<string,string>
): TE.TaskEither<Error, QueueService.QueueMessageResult> => {
// see https://github.com/Azure/Azure-Functions/issues/1091
const message = Buffer.from(JSON.stringify(input)).toString("base64");
Expand Down
50 changes: 0 additions & 50 deletions apps/card-func/utils/special_service.ts

This file was deleted.

0 comments on commit c710b39

Please sign in to comment.