-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
190 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/commons/src/events/OfflineData/CertificateConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* OpenCRVS is also distributed under the terms of the Civil Registration | ||
* & Healthcare Disclaimer located at http://opencrvs.org/license. | ||
* | ||
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. | ||
*/ | ||
|
||
import { z } from 'zod' | ||
|
||
enum EventType { | ||
Birth = 'birth', | ||
Death = 'death', | ||
Marriage = 'marriage', | ||
TENNIS_CLUB_MEMBERSHIP = 'tennis-club-membership' | ||
} | ||
const eventTypeSchema = z.nativeEnum(EventType) | ||
|
||
const fontFamilyTypesSchema = z.object({ | ||
normal: z.string(), | ||
bold: z.string(), | ||
italics: z.string(), | ||
bolditalics: z.string() | ||
}) | ||
|
||
export const CertificateConfigDataSchema = z.object({ | ||
id: z.string(), | ||
event: eventTypeSchema, | ||
label: z.object({ | ||
id: z.string(), | ||
defaultMessage: z.string(), | ||
description: z.string() | ||
}), | ||
isDefault: z.boolean(), | ||
fee: z.object({ | ||
onTime: z.number(), | ||
late: z.number(), | ||
delayed: z.number() | ||
}), | ||
svgUrl: z.string(), | ||
fonts: z.record(fontFamilyTypesSchema).optional() | ||
}) | ||
|
||
export const CertificateDataSchema = CertificateConfigDataSchema.extend({ | ||
hash: z.string().optional(), | ||
svg: z.string() | ||
}) | ||
|
||
export type CertificateDataSchema = z.infer<typeof CertificateDataSchema> |
Oops, something went wrong.