-
Notifications
You must be signed in to change notification settings - Fork 1
Addressing PR comments #59
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
Draft
Claude
wants to merge
5
commits into
main
Choose a base branch
from
claude/add-map-collections-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
97b9d12
Initial plan
Claude c28ca18
feat: add collections service and database tables
Claude 258ab61
refactor: reorganize schema file and use supabase schemas pattern
Claude cfba7d4
refactor: move collection_favorites to favorites.sql
Claude f59317f
add action base for copilot and workflow for supabase db diff
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,114 @@ | ||
| import { z } from 'zod'; | ||
| import { ApiError, ApiSuccess } from './api'; | ||
|
|
||
| /* Structs */ | ||
| export const CollectionUserProjection = z.object({ | ||
| isFavorited: z.boolean(), | ||
| }); | ||
|
|
||
| export const CollectionMap = z.object({ | ||
| mapId: z.string(), | ||
| position: z.number(), | ||
| }); | ||
|
|
||
| export const Collection = z.object({ | ||
| id: z.string(), | ||
| creatorId: z.string(), | ||
| creationDate: z.iso.datetime({ local: true }), | ||
| name: z.string(), | ||
| description: z.string().nullish(), | ||
| albumArt: z.string().nullish(), | ||
| maps: z.array(CollectionMap), | ||
| favorites: z.number(), | ||
| userProjection: CollectionUserProjection.optional(), | ||
| }); | ||
|
|
||
| /* GET getCollection */ | ||
| export const GetCollectionSuccess = ApiSuccess.extend({ | ||
| collection: Collection, | ||
| }); | ||
|
|
||
| export const GetCollectionResponse = z.discriminatedUnion('success', [ | ||
| GetCollectionSuccess, | ||
| ApiError, | ||
| ]); | ||
|
|
||
| /* GET findCollections */ | ||
| export const FindCollectionsSuccess = ApiSuccess.extend({ | ||
| collections: z.array(Collection), | ||
| }); | ||
|
|
||
| export const FindCollectionsResponse = z.discriminatedUnion('success', [ | ||
| FindCollectionsSuccess, | ||
| ApiError, | ||
| ]); | ||
|
|
||
| /* POST createCollection */ | ||
| export const CreateCollectionRequest = z.object({ | ||
| name: z.string(), | ||
| description: z.string().optional(), | ||
| albumArt: z.string().optional(), | ||
| mapIds: z.array(z.string()).optional(), | ||
| }); | ||
|
|
||
| export const CreateCollectionSuccess = ApiSuccess.extend({ | ||
| id: z.string(), | ||
| }); | ||
|
|
||
| export const CreateCollectionResponse = z.discriminatedUnion('success', [ | ||
| CreateCollectionSuccess, | ||
| ApiError, | ||
| ]); | ||
|
|
||
| /* PUT updateCollection */ | ||
| export const UpdateCollectionRequest = z.object({ | ||
| id: z.string(), | ||
| name: z.string().optional(), | ||
| description: z.string().optional(), | ||
| albumArt: z.string().optional(), | ||
| mapIds: z.array(z.string()).optional(), | ||
| }); | ||
|
|
||
| export const UpdateCollectionResponse = z.discriminatedUnion('success', [ApiSuccess, ApiError]); | ||
|
|
||
| /* DELETE deleteCollection */ | ||
| export const DeleteCollectionSuccess = ApiSuccess.extend({}); | ||
|
|
||
| export const DeleteCollectionResponse = z.discriminatedUnion('success', [ | ||
| DeleteCollectionSuccess, | ||
| ApiError, | ||
| ]); | ||
|
|
||
| /* Collection Favorites */ | ||
| export const SetCollectionFavoritesRequest = z.object({ | ||
| collectionIds: z.array(z.string()), | ||
| isFavorite: z.boolean(), | ||
| }); | ||
|
|
||
| export const GetFavoriteCollectionsSuccess = ApiSuccess.extend({ | ||
| collections: z.array(Collection), | ||
| }); | ||
|
|
||
| export const GetFavoriteCollectionsResponse = z.discriminatedUnion('success', [ | ||
| GetFavoriteCollectionsSuccess, | ||
| ApiError, | ||
| ]); | ||
|
|
||
| /* Inferred types */ | ||
| export type CollectionUserProjection = z.infer<typeof CollectionUserProjection>; | ||
| export type CollectionMap = z.infer<typeof CollectionMap>; | ||
| export type Collection = z.infer<typeof Collection>; | ||
| export type GetCollectionSuccess = z.infer<typeof GetCollectionSuccess>; | ||
| export type GetCollectionResponse = z.infer<typeof GetCollectionResponse>; | ||
| export type FindCollectionsSuccess = z.infer<typeof FindCollectionsSuccess>; | ||
| export type FindCollectionsResponse = z.infer<typeof FindCollectionsResponse>; | ||
| export type CreateCollectionRequest = z.infer<typeof CreateCollectionRequest>; | ||
| export type CreateCollectionSuccess = z.infer<typeof CreateCollectionSuccess>; | ||
| export type CreateCollectionResponse = z.infer<typeof CreateCollectionResponse>; | ||
| export type UpdateCollectionRequest = z.infer<typeof UpdateCollectionRequest>; | ||
| export type UpdateCollectionResponse = z.infer<typeof UpdateCollectionResponse>; | ||
| export type DeleteCollectionSuccess = z.infer<typeof DeleteCollectionSuccess>; | ||
| export type DeleteCollectionResponse = z.infer<typeof DeleteCollectionResponse>; | ||
| export type SetCollectionFavoritesRequest = z.infer<typeof SetCollectionFavoritesRequest>; | ||
| export type GetFavoriteCollectionsSuccess = z.infer<typeof GetFavoriteCollectionsSuccess>; | ||
| export type GetFavoriteCollectionsResponse = z.infer<typeof GetFavoriteCollectionsResponse>; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.