-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [#173146890] Align bonus available type with the remote data (#…
…1869) * [#173146890] align bonus available type with the remote data refactoring * [#173146890] fix refactoring errors * [#173146890] fix refactoring errors * [#173146890] fix refactoring errors * [#173146890] change filed from active -> is_active * [#173146890] update comment
- Loading branch information
1 parent
77f8efa
commit 6d8f969
Showing
10 changed files
with
70 additions
and
54 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
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 was deleted.
Oops, something went wrong.
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,34 @@ | ||
/** | ||
* TEMPORARY TYPE DEFINITION | ||
* this type must be replaced with the one auto-generated from spec | ||
*/ | ||
import * as t from "io-ts"; | ||
import { NonNegativeInteger } from "italia-ts-commons/lib/numbers"; | ||
import { Timestamp } from "../../../../definitions/backend/Timestamp"; | ||
|
||
const BonusAvailableR = t.interface({ | ||
id_type: NonNegativeInteger, | ||
name: t.string, | ||
is_active: t.boolean, | ||
description: t.string, | ||
valid_from: Timestamp, | ||
valid_to: Timestamp | ||
}); | ||
const BonusAvailableO = t.partial({ | ||
cover: t.string, | ||
service_id: t.string | ||
}); | ||
export const BonusAvailableCodec = t.intersection( | ||
[BonusAvailableR, BonusAvailableO], | ||
"BonusAvailable" | ||
); | ||
const BonusListR = t.interface({ | ||
items: t.readonlyArray(BonusAvailableCodec, "array of available bonuses") | ||
}); | ||
const BonusListRO = t.partial({}); | ||
export const BonusesAvailableCodec = t.intersection( | ||
[BonusListR, BonusListRO], | ||
"BonusesAvailable" | ||
); | ||
export type BonusesAvailable = t.TypeOf<typeof BonusesAvailableCodec>; | ||
export type BonusAvailable = t.TypeOf<typeof BonusAvailableCodec>; |
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