Skip to content

Commit

Permalink
fix: required access code properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev authored Nov 16, 2023
1 parent dedc140 commit c6b0481
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/database/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ const initializer = immer<Database>((set, get) => ({
warnings: [],
is_backup_access_code_available: false,
is_external_modification_allowed: false,
is_one_time_use: false,
is_offline_access_code: false,
...params,
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib/zod/access_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const access_code_base = z.object({
pulled_backup_access_code_id: z.string().nullable().optional(),
is_backup_access_code_available: z.boolean(),
is_external_modification_allowed: z.boolean(),
is_one_time_use: z.boolean(),
is_offline_access_code: z.boolean(),
})

export const access_code_managed = access_code_base.extend({
Expand Down
56 changes: 56 additions & 0 deletions src/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -80,6 +82,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -105,6 +109,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -127,6 +133,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -171,6 +179,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -194,6 +204,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -219,6 +231,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -241,6 +255,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -339,6 +355,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -362,6 +380,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -387,6 +407,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -409,6 +431,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -448,6 +472,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -471,6 +497,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -496,6 +524,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -518,6 +548,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -557,6 +589,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -580,6 +614,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -605,6 +641,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -627,6 +665,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -667,6 +707,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -690,6 +732,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -715,6 +759,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -737,6 +783,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down Expand Up @@ -775,6 +823,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "ongoing"
created_at: string
Expand All @@ -798,6 +848,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
common_code_key?: (string | null) | undefined
type: "time_bound"
created_at: string
Expand All @@ -823,6 +875,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set"
created_at: string
type: "ongoing"
Expand All @@ -845,6 +899,8 @@ export type Routes = {
pulled_backup_access_code_id?: (string | null) | undefined
is_backup_access_code_available: boolean
is_external_modification_allowed: boolean
is_one_time_use: boolean
is_offline_access_code: boolean
status: "set" | "unset"
created_at: string
type: "time_bound"
Expand Down

0 comments on commit c6b0481

Please sign in to comment.